Displaying 2 results from an estimated 2 matches for "bpdu_header".
2007 Apr 18
1
[Bridge] STP Explanation (2)
I saw some big mistakes, here's the correct version :
--------------------------------------------------------------------
void br_send_config_bpdu(struct net_bridge_port *p, struct bpdu *bpdu)
{
unsigned char buf[42];
buf[0] = bpdu->bpdu_header.protocol[0]; //0x00
buf[1] = bpdu->bpdu_header.protocol[1]; //0x00
buf[2] = bpdu->bpdu_header.version; //0x02
buf[3] = BPDU_TYPE_CONFIG;
buf[4] = bpdu->bpdu_body.flags.topo_change;
buf[5] = bpdu->bpdu_body.flags.proposal;
buf[6] = bpdu->bpdu_body.flags.port_role[0];
buf[7] = b...
2007 Apr 18
0
[Bridge] STP Explanation
...N
int learning = 0;
int forwarding = 0;
int agreement = 0;
int topo_change_ack = 0;
}bpdu_flag;
typedef struct
{
unsigned char protocol[2]= {0x00,0x00}; // le type unsigned char peut ?tre assimil? ? un octet
unsigned char version = 0x02; //convention
unsigned char bpdu_type;
} bpdu_header;
typedef struct
{
bpdu_flag flags;
unsigned char root_id[8];
unsigned char root_path_cost[4];
unsigned char bridge_id[8];
unsigned char port_id[2];
unsigned char message_age[2];
unsigned char max_age[2];
unsigned char hello_time[2];
unsigned char forward_delay[2];
} bpdu_body;...