Lines Matching refs:rose_node

42 static struct rose_node  *rose_node_list;
58 struct rose_node *rose_node, *rose_tmpn, *rose_tmpp; in rose_add_node() local
65 rose_node = rose_node_list; in rose_add_node()
66 while (rose_node != NULL) { in rose_add_node()
67 if ((rose_node->mask == rose_route->mask) && in rose_add_node()
68 (rosecmpm(&rose_route->address, &rose_node->address, in rose_add_node()
71 rose_node = rose_node->next; in rose_add_node()
74 if (rose_node != NULL && rose_node->loopback) { in rose_add_node()
141 if (rose_node == NULL) { in rose_add_node()
155 rose_node = kmalloc(sizeof(*rose_node), GFP_ATOMIC); in rose_add_node()
156 if (rose_node == NULL) { in rose_add_node()
161 rose_node->address = rose_route->address; in rose_add_node()
162 rose_node->mask = rose_route->mask; in rose_add_node()
163 rose_node->count = 1; in rose_add_node()
164 rose_node->loopback = 0; in rose_add_node()
165 rose_node->neighbour[0] = rose_neigh; in rose_add_node()
169 rose_node_list = rose_node; in rose_add_node()
170 rose_node->next = NULL; in rose_add_node()
172 rose_tmpp->next = rose_node; in rose_add_node()
173 rose_node->next = NULL; in rose_add_node()
177 rose_node->next = rose_node_list; in rose_add_node()
178 rose_node_list = rose_node; in rose_add_node()
180 rose_tmpp->next = rose_node; in rose_add_node()
181 rose_node->next = rose_tmpn; in rose_add_node()
190 if (rose_node->count < 3) { in rose_add_node()
191 rose_node->neighbour[rose_node->count] = rose_neigh; in rose_add_node()
192 rose_node->count++; in rose_add_node()
206 static void rose_remove_node(struct rose_node *rose_node) in rose_remove_node() argument
208 struct rose_node *s; in rose_remove_node()
210 if ((s = rose_node_list) == rose_node) { in rose_remove_node()
211 rose_node_list = rose_node->next; in rose_remove_node()
212 kfree(rose_node); in rose_remove_node()
217 if (s->next == rose_node) { in rose_remove_node()
218 s->next = rose_node->next; in rose_remove_node()
219 kfree(rose_node); in rose_remove_node()
299 struct rose_node *rose_node; in rose_del_node() local
306 rose_node = rose_node_list; in rose_del_node()
307 while (rose_node != NULL) { in rose_del_node()
308 if ((rose_node->mask == rose_route->mask) && in rose_del_node()
309 (rosecmpm(&rose_route->address, &rose_node->address, in rose_del_node()
312 rose_node = rose_node->next; in rose_del_node()
315 if (rose_node == NULL || rose_node->loopback) { in rose_del_node()
334 for (i = 0; i < rose_node->count; i++) { in rose_del_node()
335 if (rose_node->neighbour[i] == rose_neigh) { in rose_del_node()
341 rose_node->count--; in rose_del_node()
343 if (rose_node->count == 0) { in rose_del_node()
344 rose_remove_node(rose_node); in rose_del_node()
348 rose_node->neighbour[0] = in rose_del_node()
349 rose_node->neighbour[1]; in rose_del_node()
351 rose_node->neighbour[1] = in rose_del_node()
352 rose_node->neighbour[2]; in rose_del_node()
408 struct rose_node *rose_node; in rose_add_loopback_node() local
413 rose_node = rose_node_list; in rose_add_loopback_node()
414 while (rose_node != NULL) { in rose_add_loopback_node()
415 if ((rose_node->mask == 10) && in rose_add_loopback_node()
416 (rosecmpm(address, &rose_node->address, 10) == 0) && in rose_add_loopback_node()
417 rose_node->loopback) in rose_add_loopback_node()
419 rose_node = rose_node->next; in rose_add_loopback_node()
422 if (rose_node != NULL) in rose_add_loopback_node()
425 if ((rose_node = kmalloc(sizeof(*rose_node), GFP_ATOMIC)) == NULL) { in rose_add_loopback_node()
430 rose_node->address = *address; in rose_add_loopback_node()
431 rose_node->mask = 10; in rose_add_loopback_node()
432 rose_node->count = 1; in rose_add_loopback_node()
433 rose_node->loopback = 1; in rose_add_loopback_node()
434 rose_node->neighbour[0] = rose_loopback_neigh; in rose_add_loopback_node()
437 rose_node->next = rose_node_list; in rose_add_loopback_node()
438 rose_node_list = rose_node; in rose_add_loopback_node()
453 struct rose_node *rose_node; in rose_del_loopback_node() local
457 rose_node = rose_node_list; in rose_del_loopback_node()
458 while (rose_node != NULL) { in rose_del_loopback_node()
459 if ((rose_node->mask == 10) && in rose_del_loopback_node()
460 (rosecmpm(address, &rose_node->address, 10) == 0) && in rose_del_loopback_node()
461 rose_node->loopback) in rose_del_loopback_node()
463 rose_node = rose_node->next; in rose_del_loopback_node()
466 if (rose_node == NULL) in rose_del_loopback_node()
469 rose_remove_node(rose_node); in rose_del_loopback_node()
483 struct rose_node *t, *rose_node; in rose_rt_device_down() local
496 rose_node = rose_node_list; in rose_rt_device_down()
498 while (rose_node != NULL) { in rose_rt_device_down()
499 t = rose_node; in rose_rt_device_down()
500 rose_node = rose_node->next; in rose_rt_device_down()
557 struct rose_node *t, *rose_node; in rose_clear_routes() local
563 rose_node = rose_node_list; in rose_clear_routes()
565 while (rose_node != NULL) { in rose_clear_routes()
566 t = rose_node; in rose_clear_routes()
567 rose_node = rose_node->next; in rose_clear_routes()
680 struct rose_node *node; in rose_get_neigh()
1094 struct rose_node *rose_node; in rose_node_start() local
1101 for (rose_node = rose_node_list; rose_node && i < *pos; in rose_node_start()
1102 rose_node = rose_node->next, ++i); in rose_node_start()
1104 return (i == *pos) ? rose_node : NULL; in rose_node_start()
1112 : ((struct rose_node *)v)->next; in rose_node_next()
1129 const struct rose_node *rose_node = v; in rose_node_show() local
1136 rose2asc(rsbuf, &rose_node->address), in rose_node_show()
1137 rose_node->mask, in rose_node_show()
1138 rose_node->count); in rose_node_show()
1140 for (i = 0; i < rose_node->count; i++) in rose_node_show()
1142 rose_node->neighbour[i]->number); in rose_node_show()
1348 struct rose_node *t, *rose_node = rose_node_list; in rose_rt_free() local
1358 while (rose_node != NULL) { in rose_rt_free()
1359 t = rose_node; in rose_rt_free()
1360 rose_node = rose_node->next; in rose_rt_free()