]> git.proxmox.com Git - mirror_frr.git/blob - zebra/kernel_null.c
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
[mirror_frr.git] / zebra / kernel_null.c
1 /* NULL kernel methods for testing. */
2
3 #include <zebra.h>
4 #include <log.h>
5
6 #include "zebra/zserv.h"
7 #include "zebra/rt.h"
8 #include "zebra/redistribute.h"
9 #include "zebra/connected.h"
10 #include "zebra/rt_netlink.h"
11 #include "zebra/rib.h"
12
13 int kernel_add_ipv4 (struct prefix *a, struct rib *b) { return 0; }
14 int kernel_update_ipv4 (struct prefix *a, struct rib *b) { return 0; }
15 #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
16 #pragma weak kernel_delete_ipv4 = kernel_add_ipv4
17 #else
18 int kernel_delete_ipv4 (struct prefix *a, struct rib *b) { return 0; }
19 #endif
20
21 int kernel_add_ipv6 (struct prefix *a, struct rib *b) { return 0; }
22 #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
23 #pragma weak kernel_delete_ipv6 = kernel_add_ipv6
24 #else
25 int kernel_delete_ipv6 (struct prefix *a, struct rib *b) { return 0; }
26 #endif
27
28 int kernel_delete_ipv6_old (struct prefix_ipv6 *dest, struct in6_addr *gate,
29 unsigned int index, int flags, int table)
30 { return 0; }
31
32 int kernel_add_route (struct prefix_ipv4 *a, struct in_addr *b, int c, int d)
33 { return 0; }
34
35 int kernel_address_add_ipv4 (struct interface *a, struct connected *b)
36 {
37 zlog_debug ("%s", __func__);
38 SET_FLAG (b->conf, ZEBRA_IFC_REAL);
39 connected_add_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
40 (b->destination ? &b->destination->u.prefix4 : NULL),
41 NULL);
42 return 0;
43 }
44
45 int kernel_address_delete_ipv4 (struct interface *a, struct connected *b)
46 {
47 zlog_debug ("%s", __func__);
48 connected_delete_ipv4 (a, 0, &b->address->u.prefix4, b->address->prefixlen,
49 (b->destination ? &b->destination->u.prefix4 : NULL));
50 return 0;
51 }
52
53 int netlink_neigh_update (int cmd, int ifindex, __u32 addr, char *lla, int llalen)
54 {
55 return 0;
56 }
57
58 void kernel_init (struct zebra_vrf *zvrf) { return; }
59 void kernel_terminate (struct zebra_vrf *zvrf) { return; }
60 #ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
61 #pragma weak route_read = kernel_init
62 #else
63 void route_read (struct zebra_vrf *zvrf) { return; }
64 #endif