Lines Matching refs:miniroute
49 struct ipv4_miniroute *miniroute; in add_ipv4_miniroute() local
58 miniroute = malloc ( sizeof ( *miniroute ) ); in add_ipv4_miniroute()
59 if ( ! miniroute ) { in add_ipv4_miniroute()
65 miniroute->netdev = netdev_get ( netdev ); in add_ipv4_miniroute()
66 miniroute->address = address; in add_ipv4_miniroute()
67 miniroute->netmask = netmask; in add_ipv4_miniroute()
68 miniroute->gateway = gateway; in add_ipv4_miniroute()
74 list_add_tail ( &miniroute->list, &ipv4_miniroutes ); in add_ipv4_miniroute()
76 list_add ( &miniroute->list, &ipv4_miniroutes ); in add_ipv4_miniroute()
79 return miniroute; in add_ipv4_miniroute()
87 static void del_ipv4_miniroute ( struct ipv4_miniroute *miniroute ) { in del_ipv4_miniroute() argument
89 DBG ( "IPv4 del %s", inet_ntoa ( miniroute->address ) ); in del_ipv4_miniroute()
90 DBG ( "/%s ", inet_ntoa ( miniroute->netmask ) ); in del_ipv4_miniroute()
91 if ( miniroute->gateway.s_addr ) in del_ipv4_miniroute()
92 DBG ( "gw %s ", inet_ntoa ( miniroute->gateway ) ); in del_ipv4_miniroute()
93 DBG ( "via %s\n", miniroute->netdev->name ); in del_ipv4_miniroute()
95 netdev_put ( miniroute->netdev ); in del_ipv4_miniroute()
96 list_del ( &miniroute->list ); in del_ipv4_miniroute()
97 free ( miniroute ); in del_ipv4_miniroute()
111 struct ipv4_miniroute *miniroute; in ipv4_route() local
120 list_for_each_entry ( miniroute, &ipv4_miniroutes, list ) { in ipv4_route()
121 if ( ! ( miniroute->netdev->state & NETDEV_OPEN ) ) in ipv4_route()
123 local = ( ( ( dest->s_addr ^ miniroute->address.s_addr ) in ipv4_route()
124 & miniroute->netmask.s_addr ) == 0 ); in ipv4_route()
125 has_gw = ( miniroute->gateway.s_addr ); in ipv4_route()
128 *dest = miniroute->gateway; in ipv4_route()
129 return miniroute; in ipv4_route()
310 struct ipv4_miniroute *miniroute; in ipv4_tx() local
331 ( ( miniroute = ipv4_route ( &next_hop ) ) != NULL ) ) { in ipv4_tx()
332 iphdr->src = miniroute->address; in ipv4_tx()
333 netdev = miniroute->netdev; in ipv4_tx()
489 struct ipv4_miniroute *miniroute; in ipv4_arp_check() local
491 list_for_each_entry ( miniroute, &ipv4_miniroutes, list ) { in ipv4_arp_check()
492 if ( ( miniroute->netdev == netdev ) && in ipv4_arp_check()
493 ( miniroute->address.s_addr == address->s_addr ) ) { in ipv4_arp_check()
585 struct ipv4_miniroute *miniroute; in ipv4_create_routes() local
594 list_for_each_entry_safe ( miniroute, tmp, &ipv4_miniroutes, list ) in ipv4_create_routes()
595 del_ipv4_miniroute ( miniroute ); in ipv4_create_routes()
620 miniroute = add_ipv4_miniroute ( netdev, address, in ipv4_create_routes()
622 if ( ! miniroute ) in ipv4_create_routes()