Lines Matching refs:buf

81 	unsigned char buf[35];  in br_send_config_bpdu()  local
86 buf[0] = 0; in br_send_config_bpdu()
87 buf[1] = 0; in br_send_config_bpdu()
88 buf[2] = 0; in br_send_config_bpdu()
89 buf[3] = BPDU_TYPE_CONFIG; in br_send_config_bpdu()
90 buf[4] = (bpdu->topology_change ? 0x01 : 0) | in br_send_config_bpdu()
92 buf[5] = bpdu->root.prio[0]; in br_send_config_bpdu()
93 buf[6] = bpdu->root.prio[1]; in br_send_config_bpdu()
94 buf[7] = bpdu->root.addr[0]; in br_send_config_bpdu()
95 buf[8] = bpdu->root.addr[1]; in br_send_config_bpdu()
96 buf[9] = bpdu->root.addr[2]; in br_send_config_bpdu()
97 buf[10] = bpdu->root.addr[3]; in br_send_config_bpdu()
98 buf[11] = bpdu->root.addr[4]; in br_send_config_bpdu()
99 buf[12] = bpdu->root.addr[5]; in br_send_config_bpdu()
100 buf[13] = (bpdu->root_path_cost >> 24) & 0xFF; in br_send_config_bpdu()
101 buf[14] = (bpdu->root_path_cost >> 16) & 0xFF; in br_send_config_bpdu()
102 buf[15] = (bpdu->root_path_cost >> 8) & 0xFF; in br_send_config_bpdu()
103 buf[16] = bpdu->root_path_cost & 0xFF; in br_send_config_bpdu()
104 buf[17] = bpdu->bridge_id.prio[0]; in br_send_config_bpdu()
105 buf[18] = bpdu->bridge_id.prio[1]; in br_send_config_bpdu()
106 buf[19] = bpdu->bridge_id.addr[0]; in br_send_config_bpdu()
107 buf[20] = bpdu->bridge_id.addr[1]; in br_send_config_bpdu()
108 buf[21] = bpdu->bridge_id.addr[2]; in br_send_config_bpdu()
109 buf[22] = bpdu->bridge_id.addr[3]; in br_send_config_bpdu()
110 buf[23] = bpdu->bridge_id.addr[4]; in br_send_config_bpdu()
111 buf[24] = bpdu->bridge_id.addr[5]; in br_send_config_bpdu()
112 buf[25] = (bpdu->port_id >> 8) & 0xFF; in br_send_config_bpdu()
113 buf[26] = bpdu->port_id & 0xFF; in br_send_config_bpdu()
115 br_set_ticks(buf+27, bpdu->message_age); in br_send_config_bpdu()
116 br_set_ticks(buf+29, bpdu->max_age); in br_send_config_bpdu()
117 br_set_ticks(buf+31, bpdu->hello_time); in br_send_config_bpdu()
118 br_set_ticks(buf+33, bpdu->forward_delay); in br_send_config_bpdu()
120 br_send_bpdu(p, buf, 35); in br_send_config_bpdu()
128 unsigned char buf[4]; in br_send_tcn_bpdu() local
133 buf[0] = 0; in br_send_tcn_bpdu()
134 buf[1] = 0; in br_send_tcn_bpdu()
135 buf[2] = 0; in br_send_tcn_bpdu()
136 buf[3] = BPDU_TYPE_TCN; in br_send_tcn_bpdu()
137 br_send_bpdu(p, buf, 4); in br_send_tcn_bpdu()
152 const unsigned char *buf; in br_stp_rcv() local
158 buf = skb->data; in br_stp_rcv()
159 if (buf[0] != 0 || buf[1] != 0 || buf[2] != 0) in br_stp_rcv()
188 buf = skb_pull(skb, 3); in br_stp_rcv()
190 if (buf[0] == BPDU_TYPE_CONFIG) { in br_stp_rcv()
196 buf = skb->data; in br_stp_rcv()
197 bpdu.topology_change = (buf[1] & 0x01) ? 1 : 0; in br_stp_rcv()
198 bpdu.topology_change_ack = (buf[1] & 0x80) ? 1 : 0; in br_stp_rcv()
200 bpdu.root.prio[0] = buf[2]; in br_stp_rcv()
201 bpdu.root.prio[1] = buf[3]; in br_stp_rcv()
202 bpdu.root.addr[0] = buf[4]; in br_stp_rcv()
203 bpdu.root.addr[1] = buf[5]; in br_stp_rcv()
204 bpdu.root.addr[2] = buf[6]; in br_stp_rcv()
205 bpdu.root.addr[3] = buf[7]; in br_stp_rcv()
206 bpdu.root.addr[4] = buf[8]; in br_stp_rcv()
207 bpdu.root.addr[5] = buf[9]; in br_stp_rcv()
209 (buf[10] << 24) | in br_stp_rcv()
210 (buf[11] << 16) | in br_stp_rcv()
211 (buf[12] << 8) | in br_stp_rcv()
212 buf[13]; in br_stp_rcv()
213 bpdu.bridge_id.prio[0] = buf[14]; in br_stp_rcv()
214 bpdu.bridge_id.prio[1] = buf[15]; in br_stp_rcv()
215 bpdu.bridge_id.addr[0] = buf[16]; in br_stp_rcv()
216 bpdu.bridge_id.addr[1] = buf[17]; in br_stp_rcv()
217 bpdu.bridge_id.addr[2] = buf[18]; in br_stp_rcv()
218 bpdu.bridge_id.addr[3] = buf[19]; in br_stp_rcv()
219 bpdu.bridge_id.addr[4] = buf[20]; in br_stp_rcv()
220 bpdu.bridge_id.addr[5] = buf[21]; in br_stp_rcv()
221 bpdu.port_id = (buf[22] << 8) | buf[23]; in br_stp_rcv()
223 bpdu.message_age = br_get_ticks(buf+24); in br_stp_rcv()
224 bpdu.max_age = br_get_ticks(buf+26); in br_stp_rcv()
225 bpdu.hello_time = br_get_ticks(buf+28); in br_stp_rcv()
226 bpdu.forward_delay = br_get_ticks(buf+30); in br_stp_rcv()
240 } else if (buf[0] == BPDU_TYPE_TCN) { in br_stp_rcv()