Lines Matching refs:attrs
248 struct rtattr *attrs[L2TP_ATTR_MAX + 1];
261 parse_rtattr(attrs, L2TP_ATTR_MAX, (void *)ghdr + GENL_HDRLEN, len);
263 if (attrs[L2TP_ATTR_PW_TYPE])
264 p->pw_type = rta_getattr_u16(attrs[L2TP_ATTR_PW_TYPE]);
265 if (attrs[L2TP_ATTR_ENCAP_TYPE])
266 p->encap = rta_getattr_u16(attrs[L2TP_ATTR_ENCAP_TYPE]);
267 if (attrs[L2TP_ATTR_OFFSET])
268 p->offset = rta_getattr_u16(attrs[L2TP_ATTR_OFFSET]);
269 if (attrs[L2TP_ATTR_DATA_SEQ])
270 p->data_seq = rta_getattr_u16(attrs[L2TP_ATTR_DATA_SEQ]);
271 if (attrs[L2TP_ATTR_CONN_ID])
272 p->tunnel_id = rta_getattr_u32(attrs[L2TP_ATTR_CONN_ID]);
273 if (attrs[L2TP_ATTR_PEER_CONN_ID])
274 p->peer_tunnel_id = rta_getattr_u32(attrs[L2TP_ATTR_PEER_CONN_ID]);
275 if (attrs[L2TP_ATTR_SESSION_ID])
276 p->session_id = rta_getattr_u32(attrs[L2TP_ATTR_SESSION_ID]);
277 if (attrs[L2TP_ATTR_PEER_SESSION_ID])
278 p->peer_session_id = rta_getattr_u32(attrs[L2TP_ATTR_PEER_SESSION_ID]);
279 if (attrs[L2TP_ATTR_L2SPEC_TYPE])
280 p->l2spec_type = rta_getattr_u8(attrs[L2TP_ATTR_L2SPEC_TYPE]);
281 if (attrs[L2TP_ATTR_L2SPEC_LEN])
282 p->l2spec_len = rta_getattr_u8(attrs[L2TP_ATTR_L2SPEC_LEN]);
284 p->udp_csum = !!attrs[L2TP_ATTR_UDP_CSUM];
285 if (attrs[L2TP_ATTR_COOKIE])
286 memcpy(p->cookie, RTA_DATA(attrs[L2TP_ATTR_COOKIE]),
287 p->cookie_len = RTA_PAYLOAD(attrs[L2TP_ATTR_COOKIE]));
289 if (attrs[L2TP_ATTR_PEER_COOKIE])
290 memcpy(p->peer_cookie, RTA_DATA(attrs[L2TP_ATTR_PEER_COOKIE]),
291 p->peer_cookie_len = RTA_PAYLOAD(attrs[L2TP_ATTR_PEER_COOKIE]));
293 p->recv_seq = !!attrs[L2TP_ATTR_RECV_SEQ];
294 p->send_seq = !!attrs[L2TP_ATTR_SEND_SEQ];
296 if (attrs[L2TP_ATTR_RECV_TIMEOUT])
297 p->reorder_timeout = rta_getattr_u64(attrs[L2TP_ATTR_RECV_TIMEOUT]);
298 if (attrs[L2TP_ATTR_IP_SADDR]) {
300 p->local_ip.data[0] = rta_getattr_u32(attrs[L2TP_ATTR_IP_SADDR]);
304 if (attrs[L2TP_ATTR_IP_DADDR]) {
306 p->peer_ip.data[0] = rta_getattr_u32(attrs[L2TP_ATTR_IP_DADDR]);
310 if (attrs[L2TP_ATTR_IP6_SADDR]) {
312 memcpy(&p->local_ip.data, RTA_DATA(attrs[L2TP_ATTR_IP6_SADDR]),
316 if (attrs[L2TP_ATTR_IP6_DADDR]) {
318 memcpy(&p->peer_ip.data, RTA_DATA(attrs[L2TP_ATTR_IP6_DADDR]),
322 if (attrs[L2TP_ATTR_UDP_SPORT])
323 p->local_udp_port = rta_getattr_u16(attrs[L2TP_ATTR_UDP_SPORT]);
324 if (attrs[L2TP_ATTR_UDP_DPORT])
325 p->peer_udp_port = rta_getattr_u16(attrs[L2TP_ATTR_UDP_DPORT]);
326 if (attrs[L2TP_ATTR_MTU])
327 p->mtu = rta_getattr_u16(attrs[L2TP_ATTR_MTU]);
328 if (attrs[L2TP_ATTR_IFNAME])
329 p->ifname = rta_getattr_str(attrs[L2TP_ATTR_IFNAME]);
331 nla_stats = attrs[L2TP_ATTR_STATS];