Skip to content

Commit 63d8c0b

Browse files
Andreas ZimberGIC-de
authored andcommitted
add support for setting cfm-vlan-priority
1 parent b3b68c5 commit 63d8c0b

File tree

9 files changed

+30
-7
lines changed

9 files changed

+30
-7
lines changed

code/bngblaster/src/bbl_cfm.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ typedef struct bbl_cfm_session_
2222
uint8_t cfm_level;
2323
uint16_t cfm_ma_id;
2424
char *cfm_ma_name;
25+
uint8_t vlan_priority;
2526

2627
struct timer_ *timer_cfm_cc;
2728

@@ -44,4 +45,4 @@ bbl_cfm_ctrl_cc_rdi_on(int fd, uint32_t session_id, json_t *arguments __attribut
4445
int
4546
bbl_cfm_ctrl_cc_rdi_off(int fd, uint32_t session_id, json_t *arguments __attribute__((unused)));
4647

47-
#endif
48+
#endif

code/bngblaster/src/bbl_config.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ json_parse_network_interface(json_t *network_interface, bbl_network_config_s *ne
684684
"isis-l1-priority", "isis-l2-priority",
685685
"ospfv2-instance-id", "ospfv2-metric", "ospfv2-type",
686686
"ospfv3-instance-id", "ospfv3-metric", "ospfv3-type",
687-
"cfm-cc", "cfm-level", "cfm-ma-id", "cfm-ma-name", "cfm-seq",
687+
"cfm-cc", "cfm-level", "cfm-ma-id", "cfm-ma-name", "cfm-seq", "cfm-vlan-priority",
688688
"ldp-instance-id", "a10nsp", "a10nsp-tx-label"
689689
};
690690
if(!schema_validate(network_interface, "network", schema,
@@ -889,6 +889,10 @@ json_parse_network_interface(json_t *network_interface, bbl_network_config_s *ne
889889
fprintf(stderr, "JSON config error: Missing network->cfm-ma-name\n");
890890
return false;
891891
}
892+
JSON_OBJ_GET_NUMBER(network_interface, value, "network", "cfm-vlan-priority", 0, 7);
893+
if(value) {
894+
network_config->cfm_vlan_priority = json_number_value(value);
895+
}
892896

893897
JSON_OBJ_GET_BOOL(network_interface, value, "network", "a10nsp");
894898
if(value) {
@@ -933,7 +937,7 @@ json_parse_access_interface(json_t *access_interface, bbl_access_config_s *acces
933937
"session-group-id", "stream-group-id",
934938
"session-limit", "arp-client-group-id",
935939
"http-client-group-id", "icmp-client-group-id",
936-
"cfm-cc", "cfm-level", "cfm-ma-id", "cfm-ma-name", "cfm-seq"
940+
"cfm-cc", "cfm-level", "cfm-ma-id", "cfm-ma-name", "cfm-seq", "cfm-vlan-priority"
937941
};
938942
if(!schema_validate(access_interface, "access", schema,
939943
sizeof(schema)/sizeof(schema[0]))) {
@@ -1332,6 +1336,10 @@ json_parse_access_interface(json_t *access_interface, bbl_access_config_s *acces
13321336
fprintf(stderr, "JSON config error: Missing access->cfm-ma-name\n");
13331337
return false;
13341338
}
1339+
JSON_OBJ_GET_NUMBER(access_interface, value, "access", "cfm-vlan-priority", 0, 7);
1340+
if(value) {
1341+
access_config->cfm_vlan_priority = json_number_value(value);
1342+
}
13351343

13361344
if(access_config->access_type == ACCESS_TYPE_PPPOE) {
13371345
/* Disable IPv4 on PPPoE if IPCP is disabled. */

code/bngblaster/src/bbl_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ typedef struct bbl_access_config_
103103
uint8_t cfm_level;
104104
uint16_t cfm_ma_id;
105105
char *cfm_ma_name;
106+
uint8_t cfm_vlan_priority;
106107

107108
/* Iterator */
108109
uint32_t i1;
@@ -165,6 +166,7 @@ typedef struct bbl_network_config_
165166
uint8_t cfm_level;
166167
uint16_t cfm_ma_id;
167168
char *cfm_ma_name;
169+
uint8_t cfm_vlan_priority;
168170

169171
void *next; /* pointer to next network config element */
170172
bbl_network_interface_s *network_interface;

code/bngblaster/src/bbl_network.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ bbl_network_interfaces_add()
221221
network_interface->cfm->cfm_level = network_config->cfm_level;
222222
network_interface->cfm->cfm_ma_id = network_config->cfm_ma_id;
223223
network_interface->cfm->cfm_ma_name = network_config->cfm_ma_name;
224+
network_interface->cfm->vlan_priority = network_config->cfm_vlan_priority;
224225
network_interface->cfm->network_interface = network_interface;
225226
bbl_cfm_cc_start(network_interface->cfm);
226227
}

code/bngblaster/src/bbl_session.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ bbl_sessions_init()
960960
session->cfm->cfm_level = access_config->cfm_level;
961961
session->cfm->cfm_ma_id = access_config->cfm_ma_id;
962962
update_strings(&session->cfm->cfm_ma_name, access_config->cfm_ma_name, NULL, NULL);
963+
session->cfm->vlan_priority = access_config->cfm_vlan_priority;
963964
session->cfm->session = session;
964965
}
965966

code/bngblaster/src/bbl_tx.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,8 @@ bbl_tx_encode_packet_cfm_cc_session(bbl_session_s *session)
14391439
eth.vlan_outer = session->vlan_key.outer_vlan_id;
14401440
eth.vlan_inner = session->vlan_key.inner_vlan_id;
14411441
eth.vlan_three = session->access_third_vlan;
1442+
eth.vlan_outer_priority = cfm->vlan_priority;
1443+
eth.vlan_inner_priority = eth.vlan_outer_priority;
14421444
eth.type = ETH_TYPE_CFM;
14431445
eth.next = &cfm_hdr;
14441446
cfm_hdr.type = CFM_TYPE_CCM;
@@ -1473,6 +1475,8 @@ bbl_tx_encode_packet_cfm_cc(bbl_network_interface_s *interface,
14731475
if(!cfm) return IGNORED;
14741476
mac[ETH_ADDR_LEN-1] |= cfm->cfm_level;
14751477
eth->dst = mac;
1478+
eth->vlan_outer_priority = cfm->vlan_priority;
1479+
eth->vlan_inner_priority = eth->vlan_outer_priority;
14761480
eth->type = ETH_TYPE_CFM;
14771481
eth->next = &cfm_hdr;
14781482
cfm_hdr.type = CFM_TYPE_CCM;
@@ -1857,4 +1861,4 @@ bbl_tx(bbl_interface_s *interface, uint8_t *buf, uint16_t *len)
18571861
network_interface = network_interface->next;
18581862
}
18591863
return result;
1860-
}
1864+
}

code/common/src/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
#define BUILD_OS ""
1616
#define COMPILER_ID "GNU"
17-
#define COMPILER_VERSION "11.4.0"
17+
#define COMPILER_VERSION "13.3.0"
1818

1919
#endif

docsrc/sources/configuration/interfaces_access.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
| **cfm-seq** | | Enable EOAM CFM CC sequence numbers. |
8282
| | | Default: true |
8383
+-----------------------------------+----------------------------------------------------------------------+
84+
| **cfm-vlan-priority** | | Set EOAM CFM CC VLAN priority (PCP). |
85+
| | | Default: 0 Range: 0 - 7 |
86+
+-----------------------------------+----------------------------------------------------------------------+
8487
| **username** | | Overwrite the username from the authentication section. |
8588
+-----------------------------------+----------------------------------------------------------------------+
8689
| **password** | | Overwrite the password from the authentication section. |
@@ -159,4 +162,4 @@
159162
| **tun** | | Create a dedicated TUN interface for each session. Use this option |
160163
| | | with caution since it can significantly impact scalability. |
161164
| | | Default: false |
162-
+-----------------------------------+----------------------------------------------------------------------+
165+
+-----------------------------------+----------------------------------------------------------------------+

docsrc/sources/configuration/interfaces_network.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@
8282
| **cfm-seq** | | Enable EOAM CFM CC sequence numbers. |
8383
| | | Default: true |
8484
+-----------------------------------+----------------------------------------------------------------------+
85+
| **cfm-vlan-priority** | | Set EOAM CFM CC VLAN priority (PCP). |
86+
| | | Default: 0 Range: 0 - 7 |
87+
+-----------------------------------+----------------------------------------------------------------------+
8588
| **a10nsp** | | Enable A10NSP switch emulation (experimental). |
8689
| | | Default: false |
8790
+-----------------------------------+----------------------------------------------------------------------+
8891
| **a10nsp-tx-label** | | Transport label used for A10NSP services in dowstream direction. |
8992
| | | Default: 0 |
90-
+-----------------------------------+----------------------------------------------------------------------+
93+
+-----------------------------------+----------------------------------------------------------------------+

0 commit comments

Comments
 (0)