Lines Matching refs:td

69 	struct uml_l2tpv3_data *td = vp->transport_data;  in l2tpv3_form_header()  local
72 if (td->udp) in l2tpv3_form_header()
74 (*(uint32_t *) (header + td->session_offset)) = td->tx_session; in l2tpv3_form_header()
76 if (td->cookie) { in l2tpv3_form_header()
77 if (td->cookie_is_64) in l2tpv3_form_header()
78 (*(uint64_t *)(header + td->cookie_offset)) = in l2tpv3_form_header()
79 td->tx_cookie; in l2tpv3_form_header()
81 (*(uint32_t *)(header + td->cookie_offset)) = in l2tpv3_form_header()
82 td->tx_cookie; in l2tpv3_form_header()
84 if (td->has_counter) { in l2tpv3_form_header()
85 counter = (uint32_t *)(header + td->counter_offset); in l2tpv3_form_header()
86 if (td->pin_counter) { in l2tpv3_form_header()
89 td->counter++; in l2tpv3_form_header()
90 *counter = cpu_to_be32(td->counter); in l2tpv3_form_header()
99 struct uml_gre_data *td = vp->transport_data; in gre_form_header() local
101 *((uint32_t *) header) = *((uint32_t *) &td->expected_header); in gre_form_header()
102 if (td->key) in gre_form_header()
103 (*(uint32_t *) (header + td->key_offset)) = td->tx_key; in gre_form_header()
104 if (td->has_sequence) { in gre_form_header()
105 sequence = (uint32_t *)(header + td->sequence_offset); in gre_form_header()
106 if (td->pin_sequence) in gre_form_header()
109 *sequence = cpu_to_be32(++td->sequence); in gre_form_header()
133 struct uml_l2tpv3_data *td = vp->transport_data; in l2tpv3_verify_header() local
137 if ((!td->udp) && (!td->ipv6)) in l2tpv3_verify_header()
145 if (td->cookie) { in l2tpv3_verify_header()
146 if (td->cookie_is_64) in l2tpv3_verify_header()
147 cookie = *(uint64_t *)(header + td->cookie_offset); in l2tpv3_verify_header()
149 cookie = *(uint32_t *)(header + td->cookie_offset); in l2tpv3_verify_header()
150 if (cookie != td->rx_cookie) { in l2tpv3_verify_header()
156 session = (uint32_t *) (header + td->session_offset); in l2tpv3_verify_header()
157 if (*session != td->rx_session) { in l2tpv3_verify_header()
170 struct uml_gre_data *td = vp->transport_data; in gre_verify_header() local
172 if (!td->ipv6) in gre_verify_header()
175 if (*((uint32_t *) header) != *((uint32_t *) &td->expected_header)) { in gre_verify_header()
178 *((uint32_t *) &td->expected_header), in gre_verify_header()
184 if (td->key) { in gre_verify_header()
185 key = (*(uint32_t *)(header + td->key_offset)); in gre_verify_header()
186 if (key != td->rx_key) { in gre_verify_header()
189 key, td->rx_key); in gre_verify_header()
243 struct uml_gre_data *td; in build_gre_transport_data() local
251 td = vp->transport_data; in build_gre_transport_data()
252 td->sequence = 0; in build_gre_transport_data()
254 td->expected_header.arptype = GRE_IRB; in build_gre_transport_data()
255 td->expected_header.header = 0; in build_gre_transport_data()
260 td->key_offset = 4; in build_gre_transport_data()
261 td->sequence_offset = 4; in build_gre_transport_data()
262 td->checksum_offset = 4; in build_gre_transport_data()
264 td->ipv6 = false; in build_gre_transport_data()
267 td->ipv6 = true; in build_gre_transport_data()
269 td->key = false; in build_gre_transport_data()
272 td->key = true; in build_gre_transport_data()
273 td->expected_header.header |= GRE_MODE_KEY; in build_gre_transport_data()
274 td->rx_key = cpu_to_be32(temp_rx); in build_gre_transport_data()
275 td->tx_key = cpu_to_be32(temp_tx); in build_gre_transport_data()
277 td->sequence_offset += 4; in build_gre_transport_data()
283 td->sequence = false; in build_gre_transport_data()
287 td->has_sequence = true; in build_gre_transport_data()
288 td->expected_header.header |= GRE_MODE_SEQUENCE; in build_gre_transport_data()
292 td->pin_sequence = true; in build_gre_transport_data()
297 if (!td->ipv6) in build_gre_transport_data()
305 struct uml_l2tpv3_data *td; in build_l2tpv3_transport_data() local
316 td = vp->transport_data; in build_l2tpv3_transport_data()
320 td->counter = 0; in build_l2tpv3_transport_data()
323 td->session_offset = 0; in build_l2tpv3_transport_data()
324 td->cookie_offset = 4; in build_l2tpv3_transport_data()
325 td->counter_offset = 4; in build_l2tpv3_transport_data()
328 td->ipv6 = false; in build_l2tpv3_transport_data()
331 td->ipv6 = true; in build_l2tpv3_transport_data()
336 td->tx_session = cpu_to_be32(temp_txs); in build_l2tpv3_transport_data()
337 td->rx_session = cpu_to_be32(temp_rxs); in build_l2tpv3_transport_data()
345 td->cookie_is_64 = false; in build_l2tpv3_transport_data()
348 td->cookie_is_64 = true; in build_l2tpv3_transport_data()
350 td->cookie = false; in build_l2tpv3_transport_data()
353 td->cookie = true; in build_l2tpv3_transport_data()
354 if (td->cookie_is_64) { in build_l2tpv3_transport_data()
355 td->rx_cookie = cpu_to_be64(temp_rx); in build_l2tpv3_transport_data()
356 td->tx_cookie = cpu_to_be64(temp_tx); in build_l2tpv3_transport_data()
358 td->counter_offset += 8; in build_l2tpv3_transport_data()
360 td->rx_cookie = cpu_to_be32(temp_rx); in build_l2tpv3_transport_data()
361 td->tx_cookie = cpu_to_be32(temp_tx); in build_l2tpv3_transport_data()
363 td->counter_offset += 4; in build_l2tpv3_transport_data()
370 td->has_counter = false; in build_l2tpv3_transport_data()
373 td->has_counter = true; in build_l2tpv3_transport_data()
378 td->pin_counter = true; in build_l2tpv3_transport_data()
385 td->udp = true; in build_l2tpv3_transport_data()
387 td->counter_offset += 4; in build_l2tpv3_transport_data()
388 td->session_offset += 4; in build_l2tpv3_transport_data()
389 td->cookie_offset += 4; in build_l2tpv3_transport_data()
394 if ((!td->ipv6) && (!td->udp)) in build_l2tpv3_transport_data()