Nicolas Palpacuer | a32f4c3 | 2018-06-28 12:55:10 -0400 | [diff] [blame] | 1 | #include "translation.h" |
| 2 | |
| 3 | int 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 | |
| 13 | std::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 | } |