Lines Matching refs:this

32 _stp_stpm_init_machine (STATE_MACH_T* this)  in _stp_stpm_init_machine()  argument
34 this->State = BEGIN; in _stp_stpm_init_machine()
35 (*(this->concreteEnterState)) (this); in _stp_stpm_init_machine()
40 _stp_stpm_iterate_machines (STPM_T* this, in _stp_stpm_iterate_machines() argument
49 for (stater = this->machines; stater; stater = stater->next) { in _stp_stpm_iterate_machines()
58 for (port = this->ports; port; port = port->next) { in _stp_stpm_iterate_machines()
72 _stp_stpm_init_data (STPM_T* this) in _stp_stpm_init_data() argument
74 STP_VECT_create (&this->rootPrio, in _stp_stpm_init_data()
75 &this->BrId, in _stp_stpm_init_data()
77 &this->BrId, in _stp_stpm_init_data()
80 this->BrTimes.MessageAge = 0; in _stp_stpm_init_data()
82 STP_copy_times (&this->rootTimes, &this->BrTimes); in _stp_stpm_init_data()
86 _check_topoch (STPM_T* this) in _check_topoch() argument
90 for (port = this->ports; port; port = port->next) { in _check_topoch()
101 STPM_T* this = (STPM_T*) param; in STP_stpm_one_second() local
105 if (STP_ENABLED != this->admin_state) return; in STP_stpm_one_second()
107 for (port = this->ports; port; port = port->next) { in STP_stpm_one_second()
116 (void) STP_stpm_update (this); in STP_stpm_one_second()
117 this->Topo_Change = _check_topoch (this); in STP_stpm_one_second()
118 if (this->Topo_Change) { in STP_stpm_one_second()
119 this->Topo_Change_Count++; in STP_stpm_one_second()
120 this->timeSince_Topo_Change = 0; in STP_stpm_one_second()
122 this->Topo_Change_Count = 0; in STP_stpm_one_second()
123 this->timeSince_Topo_Change++; in STP_stpm_one_second()
130 STPM_T* this; in STP_stpm_create() local
132 STP_NEW_IN_LIST(this, STPM_T, bridges, "stp instance"); in STP_stpm_create()
134 this->admin_state = STP_DISABLED; in STP_stpm_create()
136 this->vlan_id = vlan_id; in STP_stpm_create()
138 STP_STRDUP(this->name, name, "stp bridge name"); in STP_stpm_create()
141 this->machines = NULL; in STP_stpm_create()
142 this->ports = NULL; in STP_stpm_create()
150 return this; in STP_stpm_create()
154 STP_stpm_enable (STPM_T* this, UID_STP_MODE_T admin_state) in STP_stpm_enable() argument
158 if (admin_state == this->admin_state) { in STP_stpm_enable()
164 if (this->ports) in STP_stpm_enable()
165 rc = STP_stpm_start (this); in STP_stpm_enable()
166 this->admin_state = admin_state; in STP_stpm_enable()
168 this->admin_state = admin_state; in STP_stpm_enable()
169 STP_stpm_stop (this); in STP_stpm_enable()
176 STP_stpm_delete (STPM_T* this) in STP_stpm_delete() argument
184 (void) STP_stpm_enable (this, STP_DISABLED); in STP_stpm_delete()
186 for (stater = this->machines; stater; ) { in STP_stpm_delete()
189 this->machines = stater = (STATE_MACH_T*) pv; in STP_stpm_delete()
192 for (port = this->ports; port; ) { in STP_stpm_delete()
195 this->ports = port = (PORT_T*) pv; in STP_stpm_delete()
200 if (tmp->vlan_id == this->vlan_id) { in STP_stpm_delete()
202 prev->next = this->next; in STP_stpm_delete()
204 bridges = this->next; in STP_stpm_delete()
207 if (this->name) in STP_stpm_delete()
208 STP_FREE(this->name, "stp bridge name"); in STP_stpm_delete()
209 STP_FREE(this, "stp instance"); in STP_stpm_delete()
217 STP_stpm_start (STPM_T* this) in STP_stpm_start() argument
221 if (! this->ports) { /* there are not any ports :( */ in STP_stpm_start()
225 if (! STP_compute_bridge_id (this)) {/* can't compute bridge id ? :( */ in STP_stpm_start()
230 if (0 != STP_stpm_check_bridge_priority (this)) { in STP_stpm_start()
235 _stp_stpm_init_data (this); in STP_stpm_start()
237 for (port = this->ports; port; port = port->next) { in STP_stpm_start()
238 STP_port_init (port, this, True); in STP_stpm_start()
249 STP_OUT_flush_lt (0, this->vlan_id, LT_FLASH_ONLY_THE_PORT, "start stpm"); in STP_stpm_start()
252 (void) _stp_stpm_iterate_machines (this, _stp_stpm_init_machine, False); in STP_stpm_start()
253 (void) STP_stpm_update (this); in STP_stpm_start()
260 STP_stpm_stop (STPM_T* this) in STP_stpm_stop() argument
265 STP_stpm_update (STPM_T* this) /* returns number of loops */ in STP_stpm_update() argument
273 need_state_change = _stp_stpm_iterate_machines (this, in STP_stpm_update()
281 number_of_loops += _stp_stpm_iterate_machines (this, in STP_stpm_update()
291 STP_compute_bridge_id (STPM_T* this) in STP_compute_bridge_id() argument
297 for (port = this->ports; port; port = port->next) { in STP_compute_bridge_id()
306 STP_OUT_get_port_mac (min_num_port->port_index, this->BrId.addr); in STP_compute_bridge_id()
308 return &this->BrId; in STP_compute_bridge_id()
318 STP_stpm_update_after_bridge_management (STPM_T* this) in STP_stpm_update_after_bridge_management() argument
322 for (port = this->ports; port; port = port->next) { in STP_stpm_update_after_bridge_management()
329 STP_stpm_check_bridge_priority (STPM_T* this) in STP_stpm_check_bridge_priority() argument
334 if (STP_ENABLED == oth->admin_state && oth != this && in STP_stpm_check_bridge_priority()
335 ! STP_VECT_compare_bridge_id (&this->BrId, &oth->BrId)) { in STP_stpm_check_bridge_priority()
344 STP_stpm_get_port_name_by_id (STPM_T* this, PORT_ID port_id) in STP_stpm_get_port_name_by_id() argument
348 for (port = this->ports; port; port = port->next) { in STP_stpm_get_port_name_by_id()