• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/net/ipv4/

Lines Matching refs:in_dev

98 static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
101 static void devinet_sysctl_register(struct in_device *in_dev,
152 struct in_device *in_dev;
156 in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL);
157 if (!in_dev)
159 INIT_RCU_HEAD(&in_dev->rcu_head);
160 memcpy(&in_dev->cnf, &ipv4_devconf_dflt, sizeof(in_dev->cnf));
161 in_dev->cnf.sysctl = NULL;
162 in_dev->dev = dev;
163 if ((in_dev->arp_parms = neigh_parms_alloc(dev, &arp_tbl)) == NULL)
165 /* Reference in_dev->dev */
168 neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4,
173 in_dev_hold(in_dev);
176 devinet_sysctl_register(in_dev, &in_dev->cnf);
178 ip_mc_init_dev(in_dev);
180 ip_mc_up(in_dev);
183 rcu_assign_pointer(dev->ip_ptr, in_dev);
185 return in_dev;
187 kfree(in_dev);
188 in_dev = NULL;
198 static void inetdev_destroy(struct in_device *in_dev)
205 dev = in_dev->dev;
209 in_dev->dead = 1;
211 ip_mc_destroy_dev(in_dev);
213 while ((ifa = in_dev->ifa_list) != NULL) {
214 inet_del_ifa(in_dev, &in_dev->ifa_list, 0);
219 devinet_sysctl_unregister(&in_dev->cnf);
225 neigh_sysctl_unregister(in_dev->arp_parms);
227 neigh_parms_release(&arp_tbl, in_dev->arp_parms);
230 call_rcu(&in_dev->rcu_head, in_dev_rcu_put);
233 int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b)
236 for_primary_ifa(in_dev) {
243 } endfor_ifa(in_dev);
248 static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
253 struct in_ifaddr *last_prim = in_dev->ifa_list;
255 int do_promote = IN_DEV_PROMOTE_SECONDARIES(in_dev);
334 static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
337 __inet_del_ifa(in_dev, ifap, destroy, NULL, 0);
343 struct in_device *in_dev = ifa->ifa_dev;
354 last_primary = &in_dev->ifa_list;
356 for (ifap = &in_dev->ifa_list; (ifa1 = *ifap) != NULL;
399 struct in_device *in_dev = __in_dev_get_rtnl(dev);
403 if (!in_dev) {
407 ipv4_devconf_setall(in_dev);
408 if (ifa->ifa_dev != in_dev) {
410 in_dev_hold(in_dev);
411 ifa->ifa_dev = in_dev;
421 struct in_device *in_dev = NULL;
425 in_dev = in_dev_get(dev);
427 return in_dev;
432 struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
437 for_primary_ifa(in_dev) {
440 } endfor_ifa(in_dev);
447 struct in_device *in_dev;
459 in_dev = inetdev_by_index(ifm->ifa_index);
460 if (in_dev == NULL) {
465 __in_dev_put(in_dev);
467 for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
481 __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).pid);
496 struct in_device *in_dev;
515 in_dev = __in_dev_get_rtnl(dev);
516 if (in_dev == NULL) {
521 ipv4_devconf_setall(in_dev);
533 in_dev_hold(in_dev);
542 ifa->ifa_dev = in_dev;
607 struct in_device *in_dev;
678 if ((in_dev = __in_dev_get_rtnl(dev)) != NULL) {
685 for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
698 for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
733 inet_del_ifa(in_dev, ifap, 1);
756 inet_del_ifa(in_dev, ifap, 0);
780 inet_del_ifa(in_dev, ifap, 0);
794 inet_del_ifa(in_dev, ifap, 0);
810 inet_del_ifa(in_dev, ifap, 0);
843 struct in_device *in_dev = __in_dev_get_rtnl(dev);
848 if (!in_dev || (ifa = in_dev->ifa_list) == NULL)
883 struct in_device *in_dev;
886 in_dev = __in_dev_get_rcu(dev);
887 if (!in_dev)
890 for_primary_ifa(in_dev) {
899 } endfor_ifa(in_dev);
913 if ((in_dev = __in_dev_get_rcu(dev)) == NULL)
916 for_primary_ifa(in_dev) {
922 } endfor_ifa(in_dev);
931 static __be32 confirm_addr_indev(struct in_device *in_dev, __be32 dst,
937 for_ifa(in_dev) {
963 } endfor_ifa(in_dev);
978 struct in_device *in_dev;
982 if ((in_dev = __in_dev_get_rcu(dev)))
983 addr = confirm_addr_indev(in_dev, dst, local, scope);
992 if ((in_dev = __in_dev_get_rcu(dev))) {
993 addr = confirm_addr_indev(in_dev, dst, local, scope);
1021 static void inetdev_changename(struct net_device *dev, struct in_device *in_dev)
1026 for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
1052 struct in_device *in_dev = __in_dev_get_rtnl(dev);
1056 if (!in_dev) {
1058 in_dev = inetdev_init(dev);
1060 if (!in_dev)
1063 IN_DEV_CONF_SET(in_dev, NOXFRM, 1);
1064 IN_DEV_CONF_SET(in_dev, NOPOLICY, 1);
1085 in_dev_hold(in_dev);
1086 ifa->ifa_dev = in_dev;
1092 ip_mc_up(in_dev);
1095 ip_mc_down(in_dev);
1102 inetdev_destroy(in_dev);
1108 inetdev_changename(dev, in_dev);
1111 devinet_sysctl_unregister(&in_dev->cnf);
1112 neigh_sysctl_unregister(in_dev->arp_parms);
1113 neigh_sysctl_register(dev, in_dev->arp_parms, NET_IPV4,
1115 devinet_sysctl_register(in_dev, &in_dev->cnf);
1180 struct in_device *in_dev;
1191 if ((in_dev = __in_dev_get_rtnl(dev)) == NULL)
1194 for (ifa = in_dev->ifa_list, ip_idx = 0; ifa;
1246 struct in_device *in_dev;
1248 in_dev = __in_dev_get_rcu(dev);
1249 if (in_dev && !test_bit(i, in_dev->cnf.state))
1250 in_dev->cnf.data[i] = ipv4_devconf_dflt.data[i];
1335 struct in_device *in_dev;
1337 in_dev = __in_dev_get_rcu(dev);
1338 if (in_dev)
1339 IN_DEV_CONF_SET(in_dev, FORWARDING, on);
1493 static void devinet_sysctl_register(struct in_device *in_dev,
1497 struct net_device *dev = in_dev ? in_dev->dev : NULL;