Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 1 | /* NULL kernel methods for testing. */ |
| 2 | |
| 3 | #include <zebra.h> |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 4 | #include <log.h> |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 5 | |
| 6 | #include "zebra/zserv.h" |
| 7 | #include "zebra/rt.h" |
| 8 | #include "zebra/redistribute.h" |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 9 | #include "zebra/connected.h" |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 10 | |
| 11 | int kernel_add_ipv4 (struct prefix *a, struct rib *b) { return 0; } |
| 12 | #pragma weak kernel_delete_ipv4 = kernel_add_ipv4 |
| 13 | int kernel_add_ipv6 (struct prefix *a, struct rib *b) { return 0; } |
| 14 | #pragma weak kernel_delete_ipv6 = kernel_add_ipv6 |
| 15 | int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate, |
| 16 | unsigned int index, int flags, int table) |
| 17 | { return 0; } |
| 18 | |
| 19 | int kernel_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d) |
| 20 | { return 0; } |
| 21 | |
| 22 | int kernel_address_add_ipv4 (struct interface *a, struct connected *b) |
Paul Jakma | d9d00a6 | 2007-04-10 19:28:04 +0000 | [diff] [blame] | 23 | { |
| 24 | zlog_debug ("%s", __func__); |
| 25 | connected_add_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen, |
| 26 | (b->destination ? &b->destination->u.prefix4 : NULL), |
| 27 | NULL); |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | int kernel_address_delete_ipv4 (struct interface *a, struct connected *b) |
| 32 | { |
| 33 | zlog_debug ("%s", __func__); |
| 34 | connected_delete_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen, |
| 35 | (b->destination ? &b->destination->u.prefix4 : NULL)); |
| 36 | return 0; |
| 37 | } |
Paul Jakma | 457eb9a | 2006-07-27 19:59:58 +0000 | [diff] [blame] | 38 | |
| 39 | void kernel_init (void) { return; } |
| 40 | #pragma weak route_read = kernel_init |