version 1.1.1.2, 2012/10/09 09:22:29
|
version 1.1.1.3, 2016/11/02 10:09:10
|
Line 25
|
Line 25
|
#include "prefix.h" |
#include "prefix.h" |
#include "log.h" |
#include "log.h" |
#include "if.h" |
#include "if.h" |
|
#include "vrf.h" |
|
|
#include "zebra/rib.h" |
#include "zebra/rib.h" |
#include "zebra/zserv.h" |
#include "zebra/zserv.h" |
Line 90 handle_route_entry (mib2_ipRouteEntry_t *routeEntry)
|
Line 91 handle_route_entry (mib2_ipRouteEntry_t *routeEntry)
|
gateway.s_addr = routeEntry->ipRouteNextHop; |
gateway.s_addr = routeEntry->ipRouteNextHop; |
|
|
rib_add_ipv4 (ZEBRA_ROUTE_KERNEL, zebra_flags, &prefix, |
rib_add_ipv4 (ZEBRA_ROUTE_KERNEL, zebra_flags, &prefix, |
&gateway, NULL, 0, 0, 0, 0, SAFI_UNICAST); | &gateway, NULL, 0, VRF_DEFAULT, RT_TABLE_MAIN, |
| 0, 0, 0, SAFI_UNICAST); |
} |
} |
|
|
void |
void |
route_read (void) | route_read (struct zebra_vrf *zvrf) |
{ |
{ |
char storage[RT_BUFSIZ]; |
char storage[RT_BUFSIZ]; |
|
|
Line 109 route_read (void)
|
Line 111 route_read (void)
|
struct strbuf msgdata; |
struct strbuf msgdata; |
int flags, dev, retval, process; |
int flags, dev, retval, process; |
|
|
|
if (zvrf->vrf_id != VRF_DEFAULT) { |
|
return; |
|
} |
|
|
if ((dev = open (_PATH_GETMSG_ROUTE, O_RDWR)) == -1) { |
if ((dev = open (_PATH_GETMSG_ROUTE, O_RDWR)) == -1) { |
zlog_warn ("can't open %s: %s", _PATH_GETMSG_ROUTE, |
zlog_warn ("can't open %s: %s", _PATH_GETMSG_ROUTE, |
safe_strerror (errno)); |
safe_strerror (errno)); |
Line 150 route_read (void)
|
Line 156 route_read (void)
|
|
|
/* This is normal loop termination */ |
/* This is normal loop termination */ |
if (retval == 0 && |
if (retval == 0 && |
msgdata.len >= sizeof (struct T_optmgmt_ack) && | (size_t)msgdata.len >= sizeof (struct T_optmgmt_ack) && |
TLIack->PRIM_type == T_OPTMGMT_ACK && |
TLIack->PRIM_type == T_OPTMGMT_ACK && |
TLIack->MGMT_flags == T_SUCCESS && |
TLIack->MGMT_flags == T_SUCCESS && |
MIB2hdr->len == 0) |
MIB2hdr->len == 0) |
break; |
break; |
|
|
if (msgdata.len >= sizeof (struct T_error_ack) && | if ((size_t)msgdata.len >= sizeof (struct T_error_ack) && |
TLIerr->PRIM_type == T_ERROR_ACK) { |
TLIerr->PRIM_type == T_ERROR_ACK) { |
zlog_warn ("getmsg(ctl) returned T_ERROR_ACK: %s", |
zlog_warn ("getmsg(ctl) returned T_ERROR_ACK: %s", |
safe_strerror ((TLIerr->TLI_error == TSYSERR) |
safe_strerror ((TLIerr->TLI_error == TSYSERR) |
Line 168 route_read (void)
|
Line 174 route_read (void)
|
like what GateD does in this instance, but not |
like what GateD does in this instance, but not |
critical yet. */ |
critical yet. */ |
if (retval != MOREDATA || |
if (retval != MOREDATA || |
msgdata.len < sizeof (struct T_optmgmt_ack) || | (size_t)msgdata.len < sizeof (struct T_optmgmt_ack) || |
TLIack->PRIM_type != T_OPTMGMT_ACK || |
TLIack->PRIM_type != T_OPTMGMT_ACK || |
TLIack->MGMT_flags != T_SUCCESS) { |
TLIack->MGMT_flags != T_SUCCESS) { |
errno = ENOMSG; |
errno = ENOMSG; |