summaryrefslogtreecommitdiff
path: root/lib/lldp/lldpd-structs.h
Commit message (Collapse)AuthorAgeFilesLines
* sparse: Add guards to prevent FreeBSD-incompatible #include order.Ben Pfaff2017-12-221-3/+1
| | | | | | | | | | FreeBSD insists that <sys/types.h> be included before <netinet/in.h> and that <netinet/in.h> be included before <arpa/inet.h>. This adds guards to the "sparse" headers to yield a warning if this order is violated. This commit also adjusts the order of many #includes to suit this requirement. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* userspace: Define and use struct eth_addr.Jarno Rajahalme2015-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Define struct eth_addr and use it instead of a uint8_t array for all ethernet addresses in OVS userspace. The struct is always the right size, and it can be assigned without an explicit memcpy, which makes code more readable. "struct eth_addr" is a good type name for this as many utility functions are already named accordingly. struct eth_addr can be accessed as bytes as well as ovs_be16's, which makes the struct 16-bit aligned. All use seems to be 16-bit aligned, so some algorithms on the ethernet addresses can be made a bit more efficient making use of this fact. As the struct fits into a register (in 64-bit systems) we pass it by value when possible. This patch also changes the few uses of Linux specific ETH_ALEN to OVS's own ETH_ADDR_LEN, and removes the OFP_ETH_ALEN, as it is no longer needed. This work stemmed from a desire to make all struct flow members assignable for unrelated exploration purposes. However, I think this might be a nice code readability improvement by itself. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
* lldp: Fix DPDK build.Pravin B Shelar2015-03-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes following dp-packet access. Removes netinet/if_ether.h include due to duplicate definition of ether_addr. ------ In file included from /usr/include/netinet/if_ether.h:60:0, from lib/lldp/lldpd.h:23, from lib/ovs-lldp.h:26, from lib/ovs-lldp.c:30: /usr/include/net/ethernet.h: At top level: /usr/include/net/ethernet.h:32:8: error: redefinition of 'struct ether_addr' struct ether_addr ^ In file included from ../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ethdev.h:179:0, from lib/netdev-dpdk.h:18, from lib/dp-packet.h:25, from lib/ovs-lldp.h:23, from lib/ovs-lldp.c:30: ../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ether.h:83:8: note: originally defined here struct ether_addr { ^ lib/ovs-lldp.c: In function 'lldp_process_packet': lib/ovs-lldp.c:676:30: error: 'const struct dp_packet' has no member named 'data_' (char *) p->data_, p->size_); ^ lib/ovs-lldp.c:676:40: error: 'const struct dp_packet' has no member named 'size_' (char *) p->data_, p->size_); ------ Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lldp: Remove unused definitions from headers.Ben Pfaff2015-03-031-5/+0
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* lldpd-structs: Declare Boolean member as one bit, not two.Ben Pfaff2015-03-031-1/+1
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* lldp: Miscellaneous coding style fixes.Ben Pfaff2015-03-031-7/+7
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* lldpd-structs: Fix type of c_id member.Ben Pfaff2015-03-031-1/+1
| | | | | | | This member is typically an Ethernet address so the appropriate type is uint8_t, not char. This eliminates a couple of casts. Signed-off-by: Ben Pfaff <blp@nicira.com>
* lldp-structs: Fix use of list of struct lldpd_port.Ben Pfaff2015-03-031-1/+1
| | | | | | | A list of some type should have type "struct ovs_list", not some other type that encapsulates it. Signed-off-by: Ben Pfaff <blp@nicira.com>
* lldp-structs: Fix use of list of struct lldpd_mgmt.Ben Pfaff2015-03-031-1/+1
| | | | | | | A list of some type should have type "struct ovs_list", not some other type that encapsulates it. Signed-off-by: Ben Pfaff <blp@nicira.com>
* lldp-structs: Fix use of list of lldpd_aa_isid_vlan_maps_tlv.Ben Pfaff2015-03-031-1/+1
| | | | | | | A list of some type should have type "struct ovs_list", not some other type that encapsulates it. Signed-off-by: Ben Pfaff <blp@nicira.com>
* lldp: Use "bool" for boolean variables.Ben Pfaff2015-03-031-3/+3
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* lldp: Use x*alloc() functions instead of writing them out in-place.Ben Pfaff2015-03-031-1/+2
| | | | | | | Also use flexible array member instead of array of length 1 in struct lldpd_frame. Signed-off-by: Ben Pfaff <blp@nicira.com>
* auto-attach: Initial support for Auto-Attach standardDennis Flynn2015-03-031-0/+228
This commit provides the initial delivery of support for the Auto-Attach standard to Open vSwitch. This standard describes a compact method of using IEEE 802.1AB Link Layer Discovery Protocol (LLDP) with a IEEE 802.1aq Shortest Path Bridging (SPB) network to automatically attach network devices not supporting IEEE 802.1ah to individual services in a SPB network. Specifically this commit adds base LLDP support to OVS along with the LLDP extension required to support Auto-Attach. The base LLDP code within this commit is adapted from the open source LLDPD project headed by Vincent Bernat. This base code is augmented with OVS specific logic which integrates LLDP into OVS and which extends LLDP to support Auto-Attach. The required build system changes are provided to include this new Auto-Attach feature. This is the first of a series of commits. Subsequent commits will be provided to complete the task of adding Auto-Attach to OVS. Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com> Signed-off-by: Dennis Flynn <drflynn@avaya.com> Signed-off-by: Ben Pfaff <blp@nicira.com>