Add support for missing DPoE OAM leaf-branch attributes

This commit is contained in:
Peter Dobransky 2022-08-03 21:32:28 +00:00 committed by Jaap Keuter
parent 1c1d23e323
commit fe12d2428c
1 changed files with 161 additions and 108 deletions

View File

@ -610,6 +610,11 @@ static const value_string vendor_specific_opcode_vals[] = {
#define DPOE_LB_PORT_INGRESS_RULE 0xD70501
#define DPOE_LB_QUEUE_CONFIG 0xD7010D
/* IEEE 1904.1 SIEPON Leaf-Branch codes used by DPoE */
#define DPOE_LB_1904_1_MAC_ENABLE_STATUS 0x07001A
#define DPOE_LB_1904_1_MEDIA_AVAILABLE 0x070047
#define DPOE_LB_1904_1_DUPLEX_STATUS 0x07005A
/* As messages get implmented and verified, replace with defined codes from above. */
static const value_string dpoe_variable_descriptor_vals[] = {
{ DPOE_LB_ONU_OBJ, "DPoE ONU Object" },
@ -698,6 +703,7 @@ static const value_string dpoe_variable_descriptor_vals[] = {
{ 0xD90201, "Clear Status" },
{ 0xD70301, "Port Stat Threshold" },
{ 0xD70302, "Link Stat Threshold" },
{ 0xD90301, "Retrieve Current Alarm Summary" },
{ 0xD70401, "Encryption Key Expiry Time" },
{ 0xD70402, "Encryption Mode" },
{ DPOE_LB_PORT_INGRESS_RULE, "Port Ingress Rule" },
@ -720,6 +726,9 @@ static const value_string dpoe_variable_descriptor_vals[] = {
{ 0x090005, "PHY Admin Control" },
{ 0x09000B, "Auto Neg Renegotiate" },
{ 0x09000C, "Auto Neg Admin Ctrl" },
{ DPOE_LB_1904_1_MAC_ENABLE_STATUS, "MAC Enable Status" },
{ DPOE_LB_1904_1_MEDIA_AVAILABLE, "Media Available" },
{ DPOE_LB_1904_1_DUPLEX_STATUS, "Duplex Status" },
{ 0, NULL }
};
@ -737,6 +746,25 @@ static const value_string dpoe_variable_response_code_vals[] = {
{ 0, NULL }
};
static const value_string dpoe_1904_1_mac_enable_status_vals[] = {
{ 0x00, "disabled" },
{ 0x01, "enabled" },
{ 0, NULL }
};
static const value_string dpoe_1904_1_media_available_vals[] = {
{ 0x03, "available" },
{ 0x04, "not_available" },
{ 0, NULL }
};
static const value_string dpoe_1904_1_duplex_status_vals[] = {
{ 0x01, "half_duplex" },
{ 0x02, "full_duplex" },
{ 0x03, "unknown" },
{ 0, NULL }
};
static const value_string user_port_object_subtype_vals[] = {
{ 0x00, "Terminator" },
{ 0x01, "Header" },
@ -942,6 +970,10 @@ static int hf_oam_dpoe_qc_ports_d = -1;
static int hf_oam_dpoe_qc_nq = -1;
static int hf_oam_dpoe_qc_queue_size = -1;
static int hf_oam_dpoe_1904_1_mac_enable_status = -1;
static int hf_oam_dpoe_1904_1_media_available = -1;
static int hf_oam_dpoe_1904_1_duplex_status = -1;
static int hf_oampdu_lpbk = -1;
static int hf_oampdu_lpbk_enable = -1;
static int hf_oampdu_lpbk_disable = -1;
@ -1965,6 +1997,12 @@ dissect_oampdu_vendor_specific(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* offset variable already incremented, so variable_length should include only 1 to read next_byte */
variable_length = 1;
/* fall-through for unmatched: */
} else if (leaf_branch == DPOE_LB_1904_1_MAC_ENABLE_STATUS) {
proto_tree_add_item(dpoe_opcode_response_tree, hf_oam_dpoe_1904_1_mac_enable_status, tvb, offset, 1, ENC_BIG_ENDIAN);
} else if (leaf_branch == DPOE_LB_1904_1_MEDIA_AVAILABLE) {
proto_tree_add_item(dpoe_opcode_response_tree, hf_oam_dpoe_1904_1_media_available, tvb, offset, 1, ENC_BIG_ENDIAN);
} else if (leaf_branch == DPOE_LB_1904_1_DUPLEX_STATUS) {
proto_tree_add_item(dpoe_opcode_response_tree, hf_oam_dpoe_1904_1_duplex_status, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
proto_tree_add_item(dpoe_opcode_response_tree, hf_oampdu_variable_value, tvb, offset, variable_length, ENC_NA);
}
@ -2549,6 +2587,21 @@ proto_register_oampdu(void)
{"Queue size (in 4KB units)", "oampdu.queue_configuration.size",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL } },
{ &hf_oam_dpoe_1904_1_mac_enable_status,
{ "MAC Enable Status", "oampdu.1904_1.mac_enable_status",
FT_UINT8, BASE_DEC, VALS(dpoe_1904_1_mac_enable_status_vals), 0x0,
NULL, HFILL } },
{ &hf_oam_dpoe_1904_1_media_available,
{ "Media Available", "oampdu.1904_1.media_available",
FT_UINT8, BASE_DEC, VALS(dpoe_1904_1_media_available_vals), 0x0,
NULL, HFILL } },
{ &hf_oam_dpoe_1904_1_duplex_status,
{ "Duplex Status", "oampdu.1904_1.duplex_status",
FT_UINT8, BASE_DEC, VALS(dpoe_1904_1_duplex_status_vals), 0x0,
NULL, HFILL } },
};
/* Setup protocol subtree array */