Lines Matching refs:x25_route
47 static struct x25_route *x25_route_list /* = NULL initially */;
54 struct x25_route *x25_route; in x25_add_route() local
57 for (x25_route = x25_route_list; x25_route != NULL; x25_route = x25_route->next) in x25_add_route()
58 if (memcmp(&x25_route->address, address, sigdigits) == 0 && x25_route->sigdigits == sigdigits) in x25_add_route()
61 if ((x25_route = kmalloc(sizeof(*x25_route), GFP_ATOMIC)) == NULL) in x25_add_route()
64 strcpy(x25_route->address.x25_addr, "000000000000000"); in x25_add_route()
65 memcpy(x25_route->address.x25_addr, address->x25_addr, sigdigits); in x25_add_route()
67 x25_route->sigdigits = sigdigits; in x25_add_route()
68 x25_route->dev = dev; in x25_add_route()
71 x25_route->next = x25_route_list; in x25_add_route()
72 x25_route_list = x25_route; in x25_add_route()
78 static void x25_remove_route(struct x25_route *x25_route) in x25_remove_route() argument
80 struct x25_route *s; in x25_remove_route()
86 if ((s = x25_route_list) == x25_route) { in x25_remove_route()
87 x25_route_list = x25_route->next; in x25_remove_route()
89 kfree(x25_route); in x25_remove_route()
94 if (s->next == x25_route) { in x25_remove_route()
95 s->next = x25_route->next; in x25_remove_route()
97 kfree(x25_route); in x25_remove_route()
109 struct x25_route *x25_route; in x25_del_route() local
111 for (x25_route = x25_route_list; x25_route != NULL; x25_route = x25_route->next) { in x25_del_route()
112 …if (memcmp(&x25_route->address, address, sigdigits) == 0 && x25_route->sigdigits == sigdigits && x… in x25_del_route()
113 x25_remove_route(x25_route); in x25_del_route()
126 struct x25_route *route, *x25_route = x25_route_list; in x25_route_device_down() local
128 while (x25_route != NULL) { in x25_route_device_down()
129 route = x25_route; in x25_route_device_down()
130 x25_route = x25_route->next; in x25_route_device_down()
164 struct x25_route *route, *use = NULL; in x25_get_route()
185 struct x25_route_struct x25_route; in x25_route_ioctl() local
192 if (copy_from_user(&x25_route, arg, sizeof(struct x25_route_struct))) in x25_route_ioctl()
194 if (x25_route.sigdigits < 0 || x25_route.sigdigits > 15) in x25_route_ioctl()
196 if ((dev = x25_dev_get(x25_route.device)) == NULL) in x25_route_ioctl()
198 err = x25_add_route(&x25_route.address, x25_route.sigdigits, dev); in x25_route_ioctl()
203 if (copy_from_user(&x25_route, arg, sizeof(struct x25_route_struct))) in x25_route_ioctl()
205 if (x25_route.sigdigits < 0 || x25_route.sigdigits > 15) in x25_route_ioctl()
207 if ((dev = x25_dev_get(x25_route.device)) == NULL) in x25_route_ioctl()
209 err = x25_del_route(&x25_route.address, x25_route.sigdigits, dev); in x25_route_ioctl()
222 struct x25_route *x25_route; in x25_routes_get_info() local
231 for (x25_route = x25_route_list; x25_route != NULL; x25_route = x25_route->next) { in x25_routes_get_info()
233 x25_route->address.x25_addr, in x25_routes_get_info()
234 x25_route->sigdigits, in x25_routes_get_info()
235 (x25_route->dev != NULL) ? x25_route->dev->name : "???"); in x25_routes_get_info()
263 struct x25_route *route, *x25_route = x25_route_list; in x25_route_free() local
265 while (x25_route != NULL) { in x25_route_free()
266 route = x25_route; in x25_route_free()
267 x25_route = x25_route->next; in x25_route_free()