blob: 55daa4caee6dff7404f743d6bd4c57a371803448 [file] [log] [blame]
Nicolas Palpacuera32f4c32018-06-28 12:55:10 -04001#include "translation.h"
2
3int interface_key_to_port_no(bcmbal_interface_key key) {
4 if (key.intf_type == BCMBAL_INTF_TYPE_NNI) {
5 return 128 + key.intf_id;
6 }
7 if (key.intf_type == BCMBAL_INTF_TYPE_PON) {
8 return (0x2 << 28) + 1;
9 }
10 return key.intf_id;
11}
12
13std::string alarm_status_to_string(bcmbal_alarm_status status) {
14 switch (status) {
15 case BCMBAL_ALARM_STATUS_OFF:
16 return "off";
17 case BCMBAL_ALARM_STATUS_ON:
18 return "on";
19 case BCMBAL_ALARM_STATUS_NO__CHANGE:
20 return "no_change";
21 }
22 return "unknown";
23}