Skip to content

Commit

Permalink
added structures for the message
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadalihussnain committed Jan 3, 2025
1 parent 5ac8614 commit 1b4d6cd
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions cfgmgr/stpmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
/*#define MST_DEFAULT_INSTANCE 0
#define MST_MAX_INSTANCES STP_DEFAULT_MAX_INSTANCES
#define DEFAULT_INSTANCE_VLAN_LIST "1-4095"
#define MST_NAME_SIZE 64*/

*/
define MST_NAME_SIZE 64

#define GET_FIRST_FREE_INST_ID(_idx) \
while (_idx < (int)l2InstPool.size() && l2InstPool.test(_idx)) ++_idx; \
Expand Down Expand Up @@ -189,7 +189,7 @@ typedef struct STP_VLAN_MEM_CONFIG_MSG {
int priority;
}__attribute__ ((packed))STP_VLAN_MEM_CONFIG_MSG;

// // MST messages definations instances global configurations
// // // MST messages definations instances global configurations
// typedef struct STP_MST_GLOBAL_CONFIG_MSG {
// uint32_t opcode; // Operation code for the message
// char name[MST_NAME_SIZE]; // MST region name
Expand Down Expand Up @@ -219,45 +219,45 @@ typedef struct STP_VLAN_MEM_CONFIG_MSG {
// } __attribute__((packed)) STP_MST_PORT_CONFIG_MSG;


// typedef struct STP_MST_GLOBAL_CONFIG_MSG {
// uint8_t opcode; // enable/disable
// uint16_t revision_number;
// char name[STP_SYNC_MSTP_NAME_LEN];
// int forward_delay;
// int hello_time;
// int max_age;
// int max_hop;
// }_attribute_ ((packed))STP_MST_GLOBAL_CONFIG_MSG;

// typedef struct VLAN_LIST{
// uint16_t vlan_id;
// } _attribute_ ((packed))VLAN_LIST;

// typedef struct MST_INST_CONFIG_MSG {
// uint8_t opcode; // enable/disable
// uint16_t mst_id;
// int priority;
// uint16_t vlan_count;
// VLAN_LIST vlan_list[0];
// }_attribute_ ((packed))MST_INST_CONFIG_MSG;
typedef struct STP_MST_GLOBAL_CONFIG_MSG {
uint8_t opcode; // enable/disable
uint16_t revision_number;
char name[MST_NAME_SIZE];
int forward_delay;
int hello_time;
int max_age;
int max_hop;
}_attribute_ ((packed))STP_MST_GLOBAL_CONFIG_MSG;

// typedef struct STP_MST_INSTANCE_CONFIG_MSG {
// uint8_t mst_count;
// MST_INST_CONFIG_MSG mst_list[0];
// }_attribute_ ((packed))STP_MST_INSTANCE_CONFIG_MSG;
typedef struct VLAN_LIST{
uint16_t vlan_id;
} _attribute_ ((packed))VLAN_LIST;

// typedef struct STP_MST_INST_PORT_CONFIG_MSG {
// uint8_t opcode; // enable/disable
// char intf_name[STP_IFALIASZ];
// uint16_t mst_id;
// int path_cost;
// int priority;
// }_attribute_ ((packed))STP_MST_INST_PORT_CONFIG_MSG;
typedef struct MST_INST_CONFIG_MSG {
uint8_t opcode; // enable/disable
uint16_t mst_id;
int priority;
uint16_t vlan_count;
VLAN_LIST vlan_list[0];
}_attribute_ ((packed))MST_INST_CONFIG_MSG;

typedef struct STP_MST_INSTANCE_CONFIG_MSG {
uint8_t mst_count;
MST_INST_CONFIG_MSG mst_list[0];
}_attribute_ ((packed))STP_MST_INSTANCE_CONFIG_MSG;

// typedef struct PORT_LIST{
// char intf_name[STP_IFALIASZ];
// int8_t tagging_mode;
// }PORT_LIST;
typedef struct STP_MST_INST_PORT_CONFIG_MSG {
uint8_t opcode; // enable/disable
char intf_name[IFNAMSIZ];
uint16_t mst_id;
int path_cost;
int priority;
}_attribute_ ((packed))STP_MST_INST_PORT_CONFIG_MSG;

typedef struct PORT_LIST{
char intf_name[IFNAMSIZ];
int8_t tagging_mode;
}PORT_LIST;

namespace swss {

Expand Down Expand Up @@ -287,9 +287,9 @@ class StpMgr : public Orch
Table m_stateStpTable;

// //MST new tables
// Table m_cfgStpMstGlobalTable;
// Table m_cfgStpMstInstTable;
// Table m_cfgStpMstPortTable;
Table m_cfgStpMstGlobalTable;
Table m_cfgStpMstInstTable;
Table m_cfgStpMstPortTable;

std::bitset<L2_INSTANCE_MAX> l2InstPool;
int stpd_fd;
Expand Down Expand Up @@ -317,9 +317,9 @@ class StpMgr : public Orch
void doStpPortTask(Consumer &consumer);

// //MST Do Tasks functions
// void doStpMstGlobalTask(Consumer &consumer);
// void doStpMstInstTask(Consumer &consumer);
// void doStpMstPortTask(Consumer &consumer);
void doStpMstGlobalTask(Consumer &consumer);
void doStpMstInstTask(Consumer &consumer);
void doStpMstPortTask(Consumer &consumer);

void doVlanMemUpdateTask(Consumer &consumer);
void doLagMemUpdateTask(Consumer &consumer);
Expand Down

0 comments on commit 1b4d6cd

Please sign in to comment.