Lines Matching refs:ip6_tnl

73 	struct ip6_tnl_info *ip6_tnl;  in ip6_tnl_alloc()  local
75 ip6_tnl = calloc(1, sizeof(*ip6_tnl)); in ip6_tnl_alloc()
76 if (!ip6_tnl) in ip6_tnl_alloc()
79 link->l_info = ip6_tnl; in ip6_tnl_alloc()
88 struct ip6_tnl_info *ip6_tnl; in ip6_tnl_parse() local
101 ip6_tnl = link->l_info; in ip6_tnl_parse()
104 ip6_tnl->link = nla_get_u32(tb[IFLA_IPTUN_LINK]); in ip6_tnl_parse()
105 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_LINK; in ip6_tnl_parse()
109 nla_memcpy(&ip6_tnl->local, tb[IFLA_IPTUN_LOCAL], sizeof(struct in6_addr)); in ip6_tnl_parse()
110 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_LOCAL; in ip6_tnl_parse()
114 nla_memcpy(&ip6_tnl->remote, tb[IFLA_IPTUN_REMOTE], sizeof(struct in6_addr)); in ip6_tnl_parse()
115 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_REMOTE; in ip6_tnl_parse()
119 ip6_tnl->ttl = nla_get_u8(tb[IFLA_IPTUN_TTL]); in ip6_tnl_parse()
120 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_TTL; in ip6_tnl_parse()
124 ip6_tnl->tos = nla_get_u8(tb[IFLA_IPTUN_TOS]); in ip6_tnl_parse()
125 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_TOS; in ip6_tnl_parse()
129 ip6_tnl->encap_limit = nla_get_u8(tb[IFLA_IPTUN_ENCAP_LIMIT]); in ip6_tnl_parse()
130 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_ENCAPLIMIT; in ip6_tnl_parse()
134 ip6_tnl->flags = nla_get_u32(tb[IFLA_IPTUN_FLAGS]); in ip6_tnl_parse()
135 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_FLAGS; in ip6_tnl_parse()
139 ip6_tnl->flowinfo = nla_get_u32(tb[IFLA_IPTUN_FLOWINFO]); in ip6_tnl_parse()
140 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_FLOWINFO; in ip6_tnl_parse()
144 ip6_tnl->proto = nla_get_u8(tb[IFLA_IPTUN_PROTO]); in ip6_tnl_parse()
145 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_PROTO; in ip6_tnl_parse()
156 struct ip6_tnl_info *ip6_tnl = link->l_info; in ip6_tnl_put_attrs() local
163 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_LINK) in ip6_tnl_put_attrs()
164 NLA_PUT_U32(msg, IFLA_IPTUN_LINK, ip6_tnl->link); in ip6_tnl_put_attrs()
166 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_LOCAL) in ip6_tnl_put_attrs()
167 NLA_PUT(msg, IFLA_IPTUN_LOCAL, sizeof(struct in6_addr), &ip6_tnl->local); in ip6_tnl_put_attrs()
169 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_REMOTE) in ip6_tnl_put_attrs()
170 NLA_PUT(msg, IFLA_IPTUN_REMOTE, sizeof(struct in6_addr), &ip6_tnl->remote); in ip6_tnl_put_attrs()
172 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_TTL) in ip6_tnl_put_attrs()
173 NLA_PUT_U8(msg, IFLA_IPTUN_TTL, ip6_tnl->ttl); in ip6_tnl_put_attrs()
175 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_TOS) in ip6_tnl_put_attrs()
176 NLA_PUT_U8(msg, IFLA_IPTUN_TOS, ip6_tnl->tos); in ip6_tnl_put_attrs()
178 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_ENCAPLIMIT) in ip6_tnl_put_attrs()
179 NLA_PUT_U8(msg, IFLA_IPTUN_ENCAP_LIMIT, ip6_tnl->encap_limit); in ip6_tnl_put_attrs()
181 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_FLAGS) in ip6_tnl_put_attrs()
182 NLA_PUT_U32(msg, IFLA_IPTUN_FLAGS, ip6_tnl->flags); in ip6_tnl_put_attrs()
184 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_FLOWINFO) in ip6_tnl_put_attrs()
185 NLA_PUT_U32(msg, IFLA_IPTUN_FLOWINFO, ip6_tnl->flowinfo); in ip6_tnl_put_attrs()
188 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_PROTO) in ip6_tnl_put_attrs()
189 NLA_PUT_U8(msg, IFLA_IPTUN_PROTO, ip6_tnl->proto); in ip6_tnl_put_attrs()
201 struct ip6_tnl_info *ip6_tnl = link->l_info; in ip6_tnl_free() local
203 free(ip6_tnl); in ip6_tnl_free()
214 struct ip6_tnl_info *ip6_tnl = link->l_info; in ip6_tnl_dump_details() local
217 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_LINK) { in ip6_tnl_dump_details()
223 nl_dump_line(p, "%u\n", ip6_tnl->link); in ip6_tnl_dump_details()
226 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_LOCAL) { in ip6_tnl_dump_details()
229 if(inet_ntop(AF_INET6, &ip6_tnl->local, addr, INET6_ADDRSTRLEN)) in ip6_tnl_dump_details()
232 nl_dump_line(p, "%#x\n", ip6_tnl->local); in ip6_tnl_dump_details()
235 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_REMOTE) { in ip6_tnl_dump_details()
238 if(inet_ntop(AF_INET6, &ip6_tnl->remote, addr, INET6_ADDRSTRLEN)) in ip6_tnl_dump_details()
241 nl_dump_line(p, "%#x\n", ip6_tnl->remote); in ip6_tnl_dump_details()
244 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_TTL) { in ip6_tnl_dump_details()
246 nl_dump_line(p, "%d\n", ip6_tnl->ttl); in ip6_tnl_dump_details()
249 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_TOS) { in ip6_tnl_dump_details()
251 nl_dump_line(p, "%d\n", ip6_tnl->tos); in ip6_tnl_dump_details()
254 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_ENCAPLIMIT) { in ip6_tnl_dump_details()
256 nl_dump_line(p, "%d\n", ip6_tnl->encap_limit); in ip6_tnl_dump_details()
259 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_FLAGS) { in ip6_tnl_dump_details()
261 nl_dump_line(p, " (%x)\n", ip6_tnl->flags); in ip6_tnl_dump_details()
264 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_FLOWINFO) { in ip6_tnl_dump_details()
266 nl_dump_line(p, " (%x)\n", ip6_tnl->flowinfo); in ip6_tnl_dump_details()
269 if (ip6_tnl->ip6_tnl_mask & IP6_TNL_ATTR_PROTO) { in ip6_tnl_dump_details()
271 nl_dump_line(p, " (%x)\n", ip6_tnl->proto); in ip6_tnl_dump_details()
379 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_link() local
383 ip6_tnl->link = index; in rtnl_link_ip6_tnl_set_link()
384 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_LINK; in rtnl_link_ip6_tnl_set_link()
397 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_link() local
401 return ip6_tnl->link; in rtnl_link_ip6_tnl_get_link()
413 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_local() local
417 memcpy(&ip6_tnl->local, addr, sizeof(struct in6_addr)); in rtnl_link_ip6_tnl_set_local()
418 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_LOCAL; in rtnl_link_ip6_tnl_set_local()
431 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_local() local
435 memcpy(addr, &ip6_tnl->local, sizeof(struct in6_addr)); in rtnl_link_ip6_tnl_get_local()
449 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_remote() local
453 memcpy(&ip6_tnl->remote, addr, sizeof(struct in6_addr)); in rtnl_link_ip6_tnl_set_remote()
454 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_REMOTE; in rtnl_link_ip6_tnl_set_remote()
467 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_remote() local
471 memcpy(addr, &ip6_tnl->remote, sizeof(struct in6_addr)); in rtnl_link_ip6_tnl_get_remote()
485 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_ttl() local
489 ip6_tnl->ttl = ttl; in rtnl_link_ip6_tnl_set_ttl()
490 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_TTL; in rtnl_link_ip6_tnl_set_ttl()
503 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_ttl() local
507 return ip6_tnl->ttl; in rtnl_link_ip6_tnl_get_ttl()
519 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_tos() local
523 ip6_tnl->tos = tos; in rtnl_link_ip6_tnl_set_tos()
524 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_TOS; in rtnl_link_ip6_tnl_set_tos()
537 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_tos() local
541 return ip6_tnl->tos; in rtnl_link_ip6_tnl_get_tos()
553 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_encaplimit() local
557 ip6_tnl->encap_limit = encap_limit; in rtnl_link_ip6_tnl_set_encaplimit()
558 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_ENCAPLIMIT; in rtnl_link_ip6_tnl_set_encaplimit()
571 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_encaplimit() local
575 return ip6_tnl->encap_limit; in rtnl_link_ip6_tnl_get_encaplimit()
587 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_flowinfo() local
591 ip6_tnl->flowinfo = flowinfo; in rtnl_link_ip6_tnl_set_flowinfo()
592 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_FLOWINFO; in rtnl_link_ip6_tnl_set_flowinfo()
605 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_flowinfo() local
609 return ip6_tnl->flowinfo; in rtnl_link_ip6_tnl_get_flowinfo()
621 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_flags() local
625 ip6_tnl->flags = flags; in rtnl_link_ip6_tnl_set_flags()
626 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_FLAGS; in rtnl_link_ip6_tnl_set_flags()
639 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_flags() local
643 return ip6_tnl->flags; in rtnl_link_ip6_tnl_get_flags()
655 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_set_proto() local
659 ip6_tnl->proto = proto; in rtnl_link_ip6_tnl_set_proto()
660 ip6_tnl->ip6_tnl_mask |= IP6_TNL_ATTR_PROTO; in rtnl_link_ip6_tnl_set_proto()
673 struct ip6_tnl_info *ip6_tnl = link->l_info; in rtnl_link_ip6_tnl_get_proto() local
677 return ip6_tnl->proto; in rtnl_link_ip6_tnl_get_proto()