blob: c2343b8d18efcc2e53a3480a1ffa8e476e5f80e8 [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) {
Nicolas Palpacuer41983562018-09-10 13:54:35 -04005 return (0x1 << 16) + key.intf_id;
Nicolas Palpacuera32f4c32018-06-28 12:55:10 -04006 }
7 if (key.intf_type == BCMBAL_INTF_TYPE_PON) {
Nicolas Palpacuer6a63ea92018-09-05 17:21:37 -04008 return (0x2 << 28) + key.intf_id;
Nicolas Palpacuera32f4c32018-06-28 12:55:10 -04009 }
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}