diff options
author | David Lamparter <equinox@diac24.net> | 2012-04-16 18:24:40 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-04-16 18:24:43 +0200 |
commit | d75318cc8de91d94649106f4ea3122d0d21ac9eb (patch) | |
tree | 6d7c674c4026bccd1384e60ee228d8d67750fbf7 /lib/zclient.c | |
parent | 6e493a44836d3b034ed3421e866878de3fbfcc5b (diff) | |
parent | 48d8bea8b7c83cf186460f711ab166455b5ed676 (diff) |
isisd: merge osr/google-is-is
this is essentially half of a rewrite of isisd. please note that a lot
of things are still broken and isisd is not ready for production use.
Diffstat (limited to 'lib/zclient.c')
-rw-r--r-- | lib/zclient.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 3521d99e..61c6f730 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -654,24 +654,8 @@ zebra_interface_add_read (struct stream *s) /* Lookup/create interface by name. */ ifp = if_get_by_name_len (ifname_tmp, strnlen(ifname_tmp, INTERFACE_NAMSIZ)); - /* Read interface's index. */ - ifp->ifindex = stream_getl (s); + zebra_interface_if_set_value (s, ifp); - /* Read interface's value. */ - ifp->status = stream_getc (s); - ifp->flags = stream_getq (s); - ifp->metric = stream_getl (s); - ifp->mtu = stream_getl (s); - ifp->mtu6 = stream_getl (s); - ifp->bandwidth = stream_getl (s); -#ifdef HAVE_STRUCT_SOCKADDR_DL - stream_get (&ifp->sdl, s, sizeof (ifp->sdl)); -#else - ifp->hw_addr_len = stream_getl (s); - if (ifp->hw_addr_len) - stream_get (ifp->hw_addr, s, ifp->hw_addr_len); -#endif /* HAVE_STRUCT_SOCKADDR_DL */ - return ifp; } @@ -699,16 +683,7 @@ zebra_interface_state_read (struct stream *s) if (! ifp) return NULL; - /* Read interface's index. */ - ifp->ifindex = stream_getl (s); - - /* Read interface's value. */ - ifp->status = stream_getc (s); - ifp->flags = stream_getq (s); - ifp->metric = stream_getl (s); - ifp->mtu = stream_getl (s); - ifp->mtu6 = stream_getl (s); - ifp->bandwidth = stream_getl (s); + zebra_interface_if_set_value (s, ifp); return ifp; } @@ -758,6 +733,13 @@ zebra_interface_if_set_value (struct stream *s, struct interface *ifp) ifp->mtu = stream_getl (s); ifp->mtu6 = stream_getl (s); ifp->bandwidth = stream_getl (s); +#ifdef HAVE_STRUCT_SOCKADDR_DL + stream_get (&ifp->sdl, s, sizeof (ifp->sdl)); +#else + ifp->hw_addr_len = stream_getl (s); + if (ifp->hw_addr_len) + stream_get (ifp->hw_addr, s, ifp->hw_addr_len); +#endif /* HAVE_STRUCT_SOCKADDR_DL */ } static int |