diff options
author | Dave Barach <dave@barachs.net> | 2016-12-09 09:52:16 -0500 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2016-12-09 11:47:00 -0500 |
commit | d7cb1b5f22948eba272e1a8844c75a2b87706fc4 (patch) | |
tree | 20728b9b0e229ec43587f22fdbbcd4c2552b6965 /vnet/vnet/ip/icmp46_packet.h | |
parent | b78292efdfaf70baf89c778973d4bb3b822e95dd (diff) |
Coding standards cleanup for vnet/vnet/ip, VPP-255
Change-Id: I12892fa571cc50e0541d6463a8b68e1b618edd9f
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet/vnet/ip/icmp46_packet.h')
-rw-r--r-- | vnet/vnet/ip/icmp46_packet.h | 302 |
1 files changed, 154 insertions, 148 deletions
diff --git a/vnet/vnet/ip/icmp46_packet.h b/vnet/vnet/ip/icmp46_packet.h index fa3fed4d081..a86cbd57bdb 100644 --- a/vnet/vnet/ip/icmp46_packet.h +++ b/vnet/vnet/ip/icmp46_packet.h @@ -158,38 +158,41 @@ _ (node_information_response, 1, failed) \ _ (node_information_response, 2, unknown_request) -typedef enum { +typedef enum +{ #define _(n,f) ICMP4_##f = n, foreach_icmp4_type #undef _ } icmp4_type_t; -typedef enum { +typedef enum +{ #define _(t,n,f) ICMP4_##t##_##f = n, foreach_icmp4_code #undef _ } icmp4_code_t; -typedef enum { +typedef enum +{ #define _(n,f) ICMP6_##f = n, foreach_icmp6_type #undef _ } icmp6_type_t; -typedef enum { +typedef enum +{ #define _(t,n,f) ICMP6_##t##_##f = n, foreach_icmp6_code #undef _ } icmp6_code_t; -typedef CLIB_PACKED (struct { - u8 type; - - u8 code; - - /* IP checksum of icmp header plus data which follows. */ - u16 checksum; -}) icmp46_header_t; +typedef CLIB_PACKED (struct + { + u8 type; + u8 code; + /* IP checksum of icmp header plus data which follows. */ + u16 checksum; + }) icmp46_header_t; /* ip6 neighbor discovery */ #define foreach_icmp6_neighbor_discovery_option \ @@ -225,168 +228,171 @@ typedef CLIB_PACKED (struct { _ (138, card_request) \ _ (139, card_reply) -typedef enum icmp6_neighbor_discovery_option_type { +typedef enum icmp6_neighbor_discovery_option_type +{ #define _(n,f) ICMP6_NEIGHBOR_DISCOVERY_OPTION_##f = n, foreach_icmp6_neighbor_discovery_option #undef _ } icmp6_neighbor_discovery_option_type_t; -typedef CLIB_PACKED (struct { - /* Option type. */ - u8 type; - - /* Length of this header plus option data in 8 byte units. */ - u8 n_data_u64s; - - /* Option data follows. */ - u8 data[0]; -}) icmp6_neighbor_discovery_option_header_t; - -typedef CLIB_PACKED (struct { - icmp6_neighbor_discovery_option_header_t header; - u8 dst_address_length; - u8 flags; +typedef CLIB_PACKED (struct + { + /* Option type. */ + u8 type; + /* Length of this header plus option data in 8 byte units. */ + u8 n_data_u64s; + /* Option data follows. */ + u8 data[0]; + }) icmp6_neighbor_discovery_option_header_t; + +typedef CLIB_PACKED (struct + { + icmp6_neighbor_discovery_option_header_t header; + u8 dst_address_length; + u8 flags; #define ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_FLAG_ON_LINK (1 << 7) #define ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_AUTO (1 << 6) - u32 valid_time; - u32 preferred_time; - u32 unused; - ip6_address_t dst_address; -}) icmp6_neighbor_discovery_prefix_information_option_t; - -typedef CLIB_PACKED (struct { - u8 type; - u8 aux_data_len_u32s; - u16 num_sources; - ip6_address_t mcast_addr; - ip6_address_t source_addr[0]; -}) icmp6_multicast_address_record_t; - -typedef CLIB_PACKED (struct { - ip6_hop_by_hop_ext_t ext_hdr; - ip6_router_alert_option_t alert; - ip6_padN_option_t pad; - icmp46_header_t icmp; - u16 rsvd; - u16 num_addr_records; - icmp6_multicast_address_record_t records[0]; -}) icmp6_multicast_listener_report_header_t; - -typedef CLIB_PACKED (struct { - icmp6_neighbor_discovery_option_header_t header; - u8 reserved[6]; - /* IP6 header plus payload follows. */ - u8 data[0]; -}) icmp6_neighbor_discovery_redirected_header_option_t; - -typedef CLIB_PACKED (struct { - icmp6_neighbor_discovery_option_header_t header; - u16 unused; - u32 mtu; -}) icmp6_neighbor_discovery_mtu_option_t; - -typedef CLIB_PACKED (struct { - icmp6_neighbor_discovery_option_header_t header; - u8 ethernet_address[6]; -}) icmp6_neighbor_discovery_ethernet_link_layer_address_option_t; - -typedef CLIB_PACKED (struct { - icmp6_neighbor_discovery_option_header_t header; - u8 max_l2_address[6+8]; -}) icmp6_neighbor_discovery_max_link_layer_address_option_t; + u32 valid_time; + u32 preferred_time; + u32 unused; ip6_address_t dst_address; + }) icmp6_neighbor_discovery_prefix_information_option_t; + +typedef CLIB_PACKED (struct + { + u8 type; + u8 aux_data_len_u32s; + u16 num_sources; + ip6_address_t mcast_addr; ip6_address_t source_addr[0]; + }) icmp6_multicast_address_record_t; + +typedef CLIB_PACKED (struct + { + ip6_hop_by_hop_ext_t ext_hdr; + ip6_router_alert_option_t alert; + ip6_padN_option_t pad; + icmp46_header_t icmp; + u16 rsvd; + u16 num_addr_records; + icmp6_multicast_address_record_t records[0]; + }) icmp6_multicast_listener_report_header_t; + +typedef CLIB_PACKED (struct + { + icmp6_neighbor_discovery_option_header_t header; + u8 reserved[6]; + /* IP6 header plus payload follows. */ + u8 data[0]; + }) icmp6_neighbor_discovery_redirected_header_option_t; + +typedef CLIB_PACKED (struct + { + icmp6_neighbor_discovery_option_header_t header; + u16 unused; u32 mtu; + }) icmp6_neighbor_discovery_mtu_option_t; + +typedef CLIB_PACKED (struct + { + icmp6_neighbor_discovery_option_header_t header; + u8 ethernet_address[6]; + }) + icmp6_neighbor_discovery_ethernet_link_layer_address_option_t; + +typedef CLIB_PACKED (struct + { + icmp6_neighbor_discovery_option_header_t header; + u8 max_l2_address[6 + 8]; + }) + icmp6_neighbor_discovery_max_link_layer_address_option_t; /* Generic neighbor discover header. Used for router solicitations, etc. */ -typedef CLIB_PACKED (struct { - icmp46_header_t icmp; - - u32 reserved_must_be_zero; -}) icmp6_neighbor_discovery_header_t; +typedef CLIB_PACKED (struct + { + icmp46_header_t icmp; u32 reserved_must_be_zero; + }) icmp6_neighbor_discovery_header_t; /* Router advertisement packet formats. */ -typedef CLIB_PACKED (struct { - icmp46_header_t icmp; - - /* Current hop limit to use for outgoing packets. */ - u8 current_hop_limit; - - u8 flags; +typedef CLIB_PACKED (struct + { + icmp46_header_t icmp; + /* Current hop limit to use for outgoing packets. */ + u8 current_hop_limit; + u8 flags; #define ICMP6_ROUTER_DISCOVERY_FLAG_ADDRESS_CONFIG_VIA_DHCP (1 << 7) #define ICMP6_ROUTER_DISCOVERY_FLAG_OTHER_CONFIG_VIA_DHCP (1 << 6) - - /* Zero means unspecified. */ - u16 router_lifetime_in_sec; - - /* Zero means unspecified. */ - u32 neighbor_reachable_time_in_msec; - - /* Zero means unspecified. */ - u32 time_in_msec_between_retransmitted_neighbor_solicitations; - - /* Options that may follow: source_link_layer_address, mtu, prefix_information. */ -}) icmp6_router_advertisement_header_t; + /* Zero means unspecified. */ + u16 router_lifetime_in_sec; + /* Zero means unspecified. */ + u32 neighbor_reachable_time_in_msec; + /* Zero means unspecified. */ + u32 + time_in_msec_between_retransmitted_neighbor_solicitations; + /* Options that may follow: source_link_layer_address, mtu, prefix_information. */ + }) icmp6_router_advertisement_header_t; /* Neighbor solicitation/advertisement header. */ -typedef CLIB_PACKED (struct { - icmp46_header_t icmp; - - /* Zero for solicitation; flags for advertisement. */ - u32 advertisement_flags; - /* Set when sent by a router. */ +typedef CLIB_PACKED (struct + { + icmp46_header_t icmp; + /* Zero for solicitation; flags for advertisement. */ + u32 advertisement_flags; + /* Set when sent by a router. */ #define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_ROUTER (1 << 31) - /* Set when response to solicitation. */ + /* Set when response to solicitation. */ #define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_SOLICITED (1 << 30) #define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_OVERRIDE (1 << 29) - - ip6_address_t target_address; - - /* Options that may follow: source_link_layer_address - (for solicitation) target_link_layer_address (for advertisement). */ -}) icmp6_neighbor_solicitation_or_advertisement_header_t; - -typedef CLIB_PACKED (struct { - icmp46_header_t icmp; - - u32 reserved_must_be_zero; - - /* Better next hop to use for given destination. */ - ip6_address_t better_next_hop_address; - - ip6_address_t dst_address; - - /* Options that may follow: target_link_layer_address, - redirected_header. */ -}) icmp6_redirect_header_t; + ip6_address_t target_address; + /* Options that may follow: source_link_layer_address + (for solicitation) target_link_layer_address (for advertisement). */ + }) icmp6_neighbor_solicitation_or_advertisement_header_t; + +typedef CLIB_PACKED (struct + { + icmp46_header_t icmp; + u32 reserved_must_be_zero; + /* Better next hop to use for given destination. */ + ip6_address_t better_next_hop_address; + ip6_address_t dst_address; + /* Options that may follow: target_link_layer_address, + redirected_header. */ + }) icmp6_redirect_header_t; /* Solicitation/advertisement packet format for ethernet. */ -typedef CLIB_PACKED (struct { - ip6_header_t ip; - - icmp6_neighbor_solicitation_or_advertisement_header_t neighbor; - - icmp6_neighbor_discovery_ethernet_link_layer_address_option_t link_layer_option; -}) icmp6_neighbor_solicitation_header_t; +typedef CLIB_PACKED (struct + { + ip6_header_t ip; + icmp6_neighbor_solicitation_or_advertisement_header_t + neighbor; + icmp6_neighbor_discovery_ethernet_link_layer_address_option_t + link_layer_option; + }) icmp6_neighbor_solicitation_header_t; /* Router solicitation packet format for ethernet. */ -typedef CLIB_PACKED (struct { - ip6_header_t ip; - icmp6_neighbor_discovery_header_t neighbor; - icmp6_neighbor_discovery_ethernet_link_layer_address_option_t link_layer_option; -}) icmp6_router_solicitation_header_t; +typedef CLIB_PACKED (struct + { + ip6_header_t ip; + icmp6_neighbor_discovery_header_t neighbor; + icmp6_neighbor_discovery_ethernet_link_layer_address_option_t + link_layer_option; + }) icmp6_router_solicitation_header_t; /* router advertisement packet format for ethernet. */ -typedef CLIB_PACKED (struct { - ip6_header_t ip; - icmp6_router_advertisement_header_t router; - icmp6_neighbor_discovery_ethernet_link_layer_address_option_t link_layer_option; - icmp6_neighbor_discovery_mtu_option_t mtu_option; - icmp6_neighbor_discovery_prefix_information_option_t prefix[0]; -}) icmp6_router_advertisement_packet_t; +typedef CLIB_PACKED (struct + { + ip6_header_t ip; + icmp6_router_advertisement_header_t router; + icmp6_neighbor_discovery_ethernet_link_layer_address_option_t + link_layer_option; + icmp6_neighbor_discovery_mtu_option_t mtu_option; + icmp6_neighbor_discovery_prefix_information_option_t + prefix[0]; + }) icmp6_router_advertisement_packet_t; /* multicast listener report packet format for ethernet. */ -typedef CLIB_PACKED (struct { - ip6_header_t ip; - icmp6_multicast_listener_report_header_t report_hdr; -}) icmp6_multicast_listener_report_packet_t; +typedef CLIB_PACKED (struct + { + ip6_header_t ip; + icmp6_multicast_listener_report_header_t report_hdr; + }) icmp6_multicast_listener_report_packet_t; #endif /* included_vnet_icmp46_packet_h */ |