]> git.proxmox.com Git - mirror_frr.git/commit - zebra/zebra_fpm_private.h
Zebra: Build nelink message for RMAC updates
authorAmeya Dharkar <adharkar@vmware.com>
Fri, 17 May 2019 00:29:08 +0000 (17:29 -0700)
committerAmeya Dharkar <adharkar@vmware.com>
Mon, 17 Jun 2019 19:05:38 +0000 (12:05 -0700)
commit9da60d0a19b1a838865e37e6554481dc851c1bcb
tree4d5560f35499c1396839040fa4dead6da3c82d26
parentfbe748e59fdff41a0ae8a07c42041bcfecb39f92
Zebra: Build nelink message for RMAC updates

- Function "zfpm_netlink_encode_mac()" builds a netlink message for RMAC updates.

- To build a netlink message for RMAC updates, we use "ndmsg" in rtlink.

- FPM Message structure is:
  FPM header -> nlmsg header -> ndmsg fields -> ndmsg attributes

- Netlink message will look like:
  {'ndm_type': 0, 'family': 7, '__pad': (), 'header': {'flags': 1281,
   'length':64, 'type': 28, 'pid': 0, 'sequence_number': 0}, 'state': 2,
   'flags': 22, 'attrs': [('NDA_LLADDR', 'b2:66:eb:b9:5b:d3'),
   ('NDA_DST', '10.100.0.2'), ('NDA_MASTER', 11), ('NDA_VNI', 1000)],
   'ifindex': 18}

- Message details:
  nlmsghdr.nlmsg_type = RTM_NEWNEIGH(28) or RTM_DELNEIGH(29)
  nlmsghdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE for "add" ,
    "NLM_F_REQUEST" for delete.
  ndmsg.ndm_family = AF_BRIDGE
  ndmsg.ndm_ifindex = vxlan_if (ifindex)
  ndmsg.ndm_state = NUD_REACHABLE
  ndmsg.ndm_flags |= NTF_SELF | NTF_MASTER | NTF_EXT_LEARNED
  Attribute "NDA_LLADDR" for MAC address
  Attribute "NDA_DST" for remote vtep ip
  Attribute "NDA_MASTER" for bridge interface ifindex.
  Attribute "NDA_VNI" for VNI id.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
zebra/zebra_fpm.c
zebra/zebra_fpm_netlink.c
zebra/zebra_fpm_private.h