Lines Matching defs:port

64   register PORT_T* port = this->owner.port;
66 if (port->msgBpduType == BPDU_TOPO_CHANGE_TYPE) {
75 port->msgPortRole = RSTP_PORT_ROLE_UNKN;
77 if (BPDU_RSTP == port->msgBpduType) {
78 port->msgPortRole = (port->msgFlags & PORT_ROLE_MASK) >> PORT_ROLE_OFFS;
81 if (RSTP_PORT_ROLE_DESGN == port->msgPortRole ||
82 BPDU_CONFIG_TYPE == port->msgBpduType) {
83 bridcmp = STP_VECT_compare_vector (&port->msgPrio, &port->portPrio);
86 (! STP_VECT_compare_bridge_id (&port->msgPrio.design_bridge,
87 &port->portPrio.design_bridge) &&
88 port->msgPrio.design_port == port->portPrio.design_port &&
89 STP_compare_times (&port->msgTimes, &port->portTimes))) {
99 if (BPDU_CONFIG_TYPE == port->msgBpduType ||
100 RSTP_PORT_ROLE_DESGN == port->msgPortRole) {
101 if (! STP_VECT_compare_vector (&port->msgPrio,
102 &port->portPrio) &&
103 ! STP_compare_times (&port->msgTimes, &port->portTimes)) {
113 if (RSTP_PORT_ROLE_ROOT == port->msgBpduType &&
114 port->operPointToPointMac &&
115 ! STP_VECT_compare_bridge_id (&port->msgPrio.design_bridge,
116 &port->portPrio.design_bridge) &&
117 AGREEMENT_BIT & port->msgFlags) {
128 if (RSTP_PORT_ROLE_ROOT == port->msgBpduType) {
129 if (!port->operPointToPointMac) {
131 } else if (STP_VECT_compare_bridge_id (&port->msgPrio.design_bridge,
132 &port->portPrio.design_bridge)) {
133 STP_VECT_br_id_print("rcvBpdu: OtherMsg: msgPrio", &port->msgPrio.design_bridge, True);
134 STP_VECT_br_id_print("rcvBpdu: portPrio", &port->portPrio.design_bridge, True);
139 stp_trace ("rcvBpdu: OtherMsg: type %d", port->msgBpduType);
150 register PORT_T* port = this->owner.port;
152 if (RSTP_PORT_ROLE_DESGN == port->msgPortRole &&
153 (PROPOSAL_BIT & port->msgFlags) &&
154 port->operPointToPointMac) {
163 register PORT_T* port = this->owner.port;
165 if (BPDU_TOPO_CHANGE_TYPE == port->msgBpduType) {
168 stp_trace ("port %s rx rcvdTcn", port->port_name);
171 port->rcvdTcn = True;
173 if (TOPOLOGY_CHANGE_BIT & port->msgFlags) {
177 port->owner->name, port->port_name,
178 (unsigned long) port->msgFlags);
181 port->rcvdTc = True;
183 if (TOPOLOGY_CHANGE_ACK_BIT & port->msgFlags) {
186 stp_trace ("port %s rx rcvdTcAck 0X%lx",
187 port->port_name,
188 (unsigned long) port->msgFlags);
191 port->rcvdTcAck = True;
199 register PORT_T* port = this->owner.port;
201 if (BPDU_TOPO_CHANGE_TYPE == port->msgBpduType) {
202 port->rcvdSTP = True;
205 if (port->msgBpduVersion < 2) {
206 port->rcvdSTP = True;
209 if (BPDU_RSTP == port->msgBpduType) {
210 /* port->port->owner->ForceVersion >= NORMAL_RSTP
212 port->rcvdRSTP = True;
221 register PORT_T* port = this->owner.port;
223 eff_age = ( + port->portTimes.MaxAge) / 16;
225 eff_age += port->portTimes.MessageAge;
227 if (eff_age <= port->portTimes.MaxAge) {
228 hello3 = 3 * port->portTimes.HelloTime;
229 dm = port->portTimes.MaxAge - eff_age;
234 port->rcvdInfoWhile = dt;
237 (int) port->portTimes.MessageAge,
238 (int) eff_age, (int) dm, (int) dt, port->port_name);
241 port->rcvdInfoWhile = 0;
246 stp_trace ("port %s: MaxAge=%d MessageAge=%d HelloTime=%d rcvdInfoWhile=null !",
247 port->port_name,
248 (int) port->portTimes.MaxAge,
249 (int) port->portTimes.MessageAge,
250 (int) port->portTimes.HelloTime);
260 STP_info_rx_bpdu (PORT_T* port, struct stp_bpdu_t* bpdu, size_t len)
286 port->rx_cfg_bpdu_cnt++;
288 if (port->info->debug)
289 stp_trace ("CfgBpdu on port %s", port->port_name);
291 if (port->admin_non_stp) return;
292 port->rcvdBpdu = True;
295 port->rx_tcn_bpdu_cnt++;
297 if (port->info->debug)
298 stp_trace ("TcnBpdu on port %s", port->port_name);
300 if (port->admin_non_stp) return;
301 port->rcvdBpdu = True;
302 port->msgBpduVersion = bpdu->hdr.version;
303 port->msgBpduType = bpdu->hdr.bpdu_type;
309 port->rx_rstp_bpdu_cnt++;
310 if (port->admin_non_stp) return;
311 if (port->owner->ForceVersion >= NORMAL_RSTP) {
312 port->rcvdBpdu = True;
317 if (port->info->debug)
318 stp_trace ("BPDU_RSTP on port %s", port->port_name);
323 port->msgBpduVersion = bpdu->hdr.version;
324 port->msgBpduType = bpdu->hdr.bpdu_type;
325 port->msgFlags = bpdu->body.flags;
328 STP_VECT_get_vector (&bpdu->body, &port->msgPrio);
329 port->msgPrio.bridge_port = port->port_id;
332 STP_get_times (&bpdu->body, &port->msgTimes);
339 register PORT_T* port = this->owner.port;
343 port->rcvdMsg = OtherMsg;
344 port->msgBpduType = (unsigned char)-1;
345 port->msgPortRole = RSTP_PORT_ROLE_UNKN;
346 port->msgFlags = 0;
348 /* clear port statistics */
349 port->rx_cfg_bpdu_cnt =
350 port->rx_rstp_bpdu_cnt =
351 port->rx_tcn_bpdu_cnt = 0;
354 port->rcvdBpdu = port->rcvdRSTP = port->rcvdSTP = False;
355 port->updtInfo = port->proposing = False; /* In DISABLED */
356 port->agreed = port->proposed = False;
357 port->rcvdInfoWhile = 0;
358 port->infoIs = Disabled;
359 port->reselect = True;
360 port->selected = False;
363 STP_VECT_copy (&port->portPrio, &port->designPrio);
364 STP_copy_times (&port->portTimes, &port->designTimes);
367 port->infoIs = Aged;
368 port->reselect = True;
369 port->selected = False;
372 STP_VECT_copy (&port->portPrio, &port->designPrio);
373 STP_copy_times (&port->portTimes, &port->designTimes);
374 port->updtInfo = False;
375 port->agreed = port->synced = False; /* In UPDATE */
376 port->proposed = port->proposing = False; /* in UPDATE */
377 port->infoIs = Mine;
378 port->newInfo = True;
382 &port->portPrio.design_bridge, True);
384 &port->portPrio.root_bridge, True);
391 port->rcvdMsg = rcvBpdu (this);
394 port->rcvdBpdu = False;
397 STP_VECT_copy (&port->portPrio, &port->msgPrio);
398 STP_copy_times (&port->portTimes, &port->msgTimes);
401 port->agreed = False; /* deleted due 802.y in SUPERIOR */
402 port->synced = False; /* due 802.y deleted in SUPERIOR */
404 port->proposing = False; /* in SUPERIOR */
405 port->proposed = recordProposed (this, "SUPERIOR");
406 port->infoIs = Received;
407 port->reselect = True;
408 port->selected = False;
412 &port->portPrio.design_bridge, True);
414 &port->portPrio.root_bridge, True);
415 stp_trace ("proposed=%d on port %s",
416 (int) port->proposed, port->port_name);
421 port->proposed = recordProposed (this, "REPEAT");
426 if (port->roletrns->debug) {
428 port->owner->name, port->port_name);
432 port->agreed = True;
433 port->proposing = False; /* In AGREEMENT */
441 register PORT_T* port = this->owner.port;
443 if ((! port->portEnabled && port->infoIs != Disabled) || BEGIN == this->State) {
449 if (port->updtInfo) {
452 if (port->portEnabled && port->selected) {
455 if (port->rcvdBpdu) {
464 if (port->selected && port->updtInfo) {
473 if (port->selected && port->updtInfo) {
477 if (Received == port->infoIs &&
478 ! port->rcvdInfoWhile &&
479 ! port->updtInfo &&
480 ! port->rcvdBpdu) {
483 if (port->rcvdBpdu && !port->updtInfo) {
488 switch (port->rcvdMsg) {