Example #1
0
struct interface *
zebra_interface_add_read (struct stream *s, vrf_id_t vrf_id)
{
  struct interface *ifp;
  char ifname_tmp[INTERFACE_NAMSIZ];

  /* Read interface name. */
  stream_get (ifname_tmp, s, INTERFACE_NAMSIZ);

  /* Lookup/create interface by name. */
  ifp = if_get_by_name_len_vrf (ifname_tmp,
                                strnlen (ifname_tmp, INTERFACE_NAMSIZ),
                                vrf_id);

  zebra_interface_if_set_value (s, ifp);

  return ifp;
}
Example #2
0
struct interface *
if_get_by_name_len (const char *name, size_t namelen)
{
  return if_get_by_name_len_vrf (name, namelen, VRF_DEFAULT);
}