int new = 0;
if (debug_vrf)
- zlog_debug("VRF_GET: %s(%d)", name, vrf_id);
+ zlog_debug("VRF_GET: %s(%u)", name, vrf_id);
/* Nothing to see, move along here */
if (!name && vrf_id == VRF_UNKNOWN)
*/
#define VRF_BITMAP_NUM_OF_GROUPS 8
-#define VRF_BITMAP_NUM_OF_BITS_IN_GROUP (UINT16_MAX / VRF_BITMAP_NUM_OF_GROUPS)
+#define VRF_BITMAP_NUM_OF_BITS_IN_GROUP (UINT32_MAX / VRF_BITMAP_NUM_OF_GROUPS)
#define VRF_BITMAP_NUM_OF_BYTES_IN_GROUP \
(VRF_BITMAP_NUM_OF_BITS_IN_GROUP / CHAR_BIT + 1) /* +1 for ensure */
struct vrf *vrf = NULL;
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
- if (vrf->vrf_id != 0)
+ if (vrf->vrf_id != VRF_DEFAULT)
vector_set(comps, XSTRDUP(MTYPE_COMPLETION, vrf->name));
}
}
/* The default VRF ID */
#define VRF_DEFAULT 0
-#define VRF_UNKNOWN UINT16_MAX
-#define VRF_ALL UINT16_MAX - 1
+#define VRF_UNKNOWN UINT32_MAX
/* Pending: May need to refine this. */
#ifndef IFLA_VRF_MAX
stream_putw(s, ZEBRA_HEADER_SIZE);
stream_putc(s, ZEBRA_HEADER_MARKER);
stream_putc(s, ZSERV_VERSION);
- stream_putw(s, vrf_id);
+ stream_putl(s, vrf_id);
stream_putw(s, command);
}
*size -= ZEBRA_HEADER_SIZE;
STREAM_GETC(s, *marker);
STREAM_GETC(s, *version);
- STREAM_GETW(s, *vrf_id);
+ STREAM_GETL(s, *vrf_id);
STREAM_GETW(s, *cmd);
if (*version != ZSERV_VERSION || *marker != ZEBRA_HEADER_MARKER) {
{
unsigned int ifindex;
struct interface *ifp;
- vrf_id_t new_id = VRF_DEFAULT;
+ vrf_id_t new_id;
/* Get interface index. */
ifindex = stream_getl(s);
length = stream_getw(zclient->ibuf);
marker = stream_getc(zclient->ibuf);
version = stream_getc(zclient->ibuf);
- vrf_id = stream_getw(zclient->ibuf);
+ vrf_id = stream_getl(zclient->ibuf);
command = stream_getw(zclient->ibuf);
if (marker != ZEBRA_HEADER_MARKER || version != ZSERV_VERSION) {
zclient_create_header(s, ZEBRA_INTERFACE_SET_MASTER, master->vrf_id);
- stream_putw(s, master->vrf_id);
+ stream_putl(s, master->vrf_id);
stream_putl(s, master->ifindex);
- stream_putw(s, slave->vrf_id);
+ stream_putl(s, slave->vrf_id);
stream_putl(s, slave->ifindex);
stream_putw_at(s, 0, stream_get_endp(s));
#define ZEBRA_MAX_PACKET_SIZ 4096
/* Zebra header size. */
-#define ZEBRA_HEADER_SIZE 8
+#define ZEBRA_HEADER_SIZE 10
/* special socket path name to use TCP
* @ is used as first character because that's abstract socket names on Linux
* always set to 255 in new zserv.
*/
uint8_t version;
-#define ZSERV_VERSION 4
+#define ZSERV_VERSION 5
vrf_id_t vrf_id;
uint16_t command;
};
typedef u_int16_t zebra_command_t;
/* VRF ID type. */
-typedef u_int16_t vrf_id_t;
+typedef uint32_t vrf_id_t;
typedef uint32_t route_tag_t;
#define ROUTE_TAG_MAX UINT32_MAX
} else {
zlog_debug(
"MESSAGE: ZEBRA_INTERFACE_BFD_DEST_UPDATE %s/%d "
- "with src %s/%d and vrf %d %s event",
+ "with src %s/%d and vrf %u %s event",
inet_ntop(dp->family, &dp->u.prefix, buf[0],
INET6_ADDRSTRLEN),
dp->prefixlen,
stream_putw(s, ZEBRA_HEADER_SIZE);
stream_putc(s, ZEBRA_HEADER_MARKER);
stream_putc(s, ZSERV_VERSION);
- stream_putw(s, vrf_id);
+ stream_putl(s, vrf_id);
stream_putw(s, cmd);
}
/* Fill in the ifIndex of the interface and its new VRF (id) */
stream_putl(s, ifp->ifindex);
- stream_putw(s, vrf_id);
+ stream_putl(s, vrf_id);
/* Write packet size. */
stream_putw_at(s, 0, stream_get_endp(s));
int ifindex;
vrf_id_t vrf_id;
- STREAM_GETW(s, vrf_id);
+ STREAM_GETL(s, vrf_id);
STREAM_GETL(s, ifindex);
master = if_lookup_by_index(ifindex, vrf_id);
- STREAM_GETW(s, vrf_id);
+ STREAM_GETL(s, vrf_id);
STREAM_GETL(s, ifindex);
slave = if_lookup_by_index(ifindex, vrf_id);
STREAM_GETW(client->ibuf, length);
STREAM_GETC(client->ibuf, marker);
STREAM_GETC(client->ibuf, version);
- STREAM_GETW(client->ibuf, vrf_id);
+ STREAM_GETL(client->ibuf, vrf_id);
STREAM_GETW(client->ibuf, command);
if (marker != ZEBRA_HEADER_MARKER || version != ZSERV_VERSION) {