]> The Tcpdump Group git mirrors - tcpdump/commitdiff
clean K&R style up in function declarations a bit
authorDenis Ovsienko <[email protected]>
Thu, 5 Mar 2015 10:33:43 +0000 (10:33 +0000)
committerDenis Ovsienko <[email protected]>
Thu, 5 Mar 2015 10:35:03 +0000 (10:35 +0000)
The function body should have its opening brace on the next line.

26 files changed:
print-ahcp.c
print-atm.c
print-babel.c
print-bgp.c
print-cfm.c
print-chdlc.c
print-eigrp.c
print-fr.c
print-icmp.c
print-isoclns.c
print-juniper.c
print-ldp.c
print-lldp.c
print-lmp.c
print-lspping.c
print-lwapp.c
print-mpcp.c
print-openflow-1.0.c
print-openflow.c
print-ospf.c
print-ppp.c
print-rpki-rtr.c
print-rsvp.c
print-sflow.c
print-slow.c
print-zeromq.c

index 280372dadbfb1eb49911da4100d12191e1ce57aa..a9ae38a972334cfafd0302a46cbb67a047d8fb9a 100644 (file)
@@ -100,7 +100,8 @@ static const struct tok ahcp1_opt_str[] = {
 };
 
 static int
-ahcp_time_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+ahcp_time_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        time_t t;
        struct tm *tm;
        char buf[BUFSIZE];
@@ -127,7 +128,8 @@ trunc:
 }
 
 static int
-ahcp_seconds_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+ahcp_seconds_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        if (cp + 4 != ep)
                goto corrupt;
        ND_TCHECK2(*cp, 4);
@@ -144,7 +146,8 @@ trunc:
 }
 
 static int
-ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        const char *sep = ": ";
 
        while (cp < ep) {
@@ -171,7 +174,8 @@ trunc:
 }
 
 static int
-ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        const char *sep = ": ";
 
        while (cp < ep) {
@@ -194,7 +198,8 @@ trunc:
 }
 
 static int
-ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        const char *sep = ": ";
 
        while (cp < ep) {
@@ -221,7 +226,8 @@ trunc:
 }
 
 static int
-ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        const char *sep = ": ";
 
        while (cp < ep) {
@@ -263,7 +269,8 @@ static int
 };
 
 static void
-ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        uint8_t option_no, option_len;
 
        while (cp < ep) {
@@ -303,7 +310,8 @@ trunc:
 }
 
 static void
-ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        uint8_t type, mbz;
        uint16_t body_len;
 
@@ -347,7 +355,8 @@ trunc:
 }
 
 void
-ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len) {
+ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
+{
        const u_char *ep = cp + len;
        uint8_t version;
 
@@ -410,4 +419,3 @@ corrupt:
 trunc:
        ND_PRINT((ndo, "%s", tstr));
 }
-
index 9361065937b2951190dd13bc6219db84d24ee2e6..8faf715dac2dbb24d0bd4881dc9537fe8f9f70cc 100644 (file)
@@ -362,8 +362,8 @@ struct oam_fm_ais_rdi_t {
 
 int
 oam_print (netdissect_options *ndo,
-           const u_char *p, u_int length, u_int hec) {
-
+           const u_char *p, u_int length, u_int hec)
+{
     uint32_t cell_header;
     uint16_t vpi, vci, cksum, cksum_shouldbe, idx;
     uint8_t  cell_type, func_type, payload, clp;
index bb3401be5e07aefa43d095179d17986fe2361a21..75cb32cf19e943b098ebbc01a96bd3027e446c78 100644 (file)
@@ -46,7 +46,8 @@ static void babel_print_v2(netdissect_options *, const u_char *cp, u_int length)
 
 void
 babel_print(netdissect_options *ndo,
-            const u_char *cp, u_int length) {
+            const u_char *cp, u_int length)
+{
     ND_PRINT((ndo, "babel"));
 
     ND_TCHECK2(*cp, 4);
@@ -270,7 +271,8 @@ network_address(int ae, const unsigned char *a, unsigned int len,
  */
 static void
 subtlvs_print(netdissect_options *ndo,
-              const u_char *cp, const u_char *ep, const uint8_t tlv_type) {
+              const u_char *cp, const u_char *ep, const uint8_t tlv_type)
+{
     uint8_t subtype, sublen;
     const char *sep;
     uint32_t t1, t2;
@@ -340,7 +342,8 @@ subtlvs_print(netdissect_options *ndo,
 
 static void
 babel_print_v2(netdissect_options *ndo,
-               const u_char *cp, u_int length) {
+               const u_char *cp, u_int length)
+{
     u_int i;
     u_short bodylen;
     u_char v4_prefix[16] =
index f5739cd96ffe16a2c7cadf9ec81279ccfd5a0e4c..c617c3bbbed39959bd78afa5f29be22dc94251f5 100644 (file)
@@ -574,7 +574,8 @@ badtlv:
  */
 static char *
 bgp_vpn_ip_print(netdissect_options *ndo,
-                 const u_char *pptr, u_int addr_length) {
+                 const u_char *pptr, u_int addr_length)
+{
 
     /* worst case string is s fully formatted v6 address */
     static char addr[sizeof("1234:5678:89ab:cdef:1234:5678:89ab:cdef")];
@@ -622,8 +623,8 @@ trunc:
  */
 static int
 bgp_vpn_sg_print(netdissect_options *ndo,
-                 const u_char *pptr, char *buf, u_int buflen) {
-
+                 const u_char *pptr, char *buf, u_int buflen)
+{
     uint8_t addr_length;
     u_int total_length, offset;
 
@@ -667,8 +668,8 @@ trunc:
  * printing route targets inside a NLRI */
 char *
 bgp_vpn_rd_print(netdissect_options *ndo,
-                 const u_char *pptr) {
-
+                 const u_char *pptr)
+{
    /* allocate space for the largest possible string */
     static char rd[sizeof("xxxxxxxxxx:xxxxx (xxx.xxx.xxx.xxx:xxxxx)")];
     char *pos = rd;
@@ -2619,8 +2620,8 @@ trunc:
 
 static void
 bgp_route_refresh_print(netdissect_options *ndo,
-                        const u_char *pptr, int len) {
-
+                        const u_char *pptr, int len)
+{
         const struct bgp_route_refresh *bgp_route_refresh_header;
        char tokbuf[TOKBUFSIZE];
        char tokbuf2[TOKBUFSIZE];
index e6aec0b91f3879d5ea0fb4c3ce722f58b0b148a1..a85eec09139ea45b1d2df9abfc5dd7af9ee7a2a8 100644 (file)
@@ -227,8 +227,8 @@ static const struct tok cfm_tlv_senderid_chassisid_values[] = {
 
 static int
 cfm_mgmt_addr_print(netdissect_options *ndo,
-                    register const u_char *tptr) {
-
+                    register const u_char *tptr)
+{
     u_int mgmt_addr_type;
     u_int hexdump =  FALSE;
 
@@ -268,7 +268,8 @@ cfm_mgmt_addr_print(netdissect_options *ndo,
  * The egress-ID string is a 16-Bit string plus a MAC address.
  */
 static const char *
-cfm_egress_id_string(netdissect_options *ndo, register const u_char *tptr) {
+cfm_egress_id_string(netdissect_options *ndo, register const u_char *tptr)
+{
     static char egress_id_buffer[80];
 
     snprintf(egress_id_buffer, sizeof(egress_id_buffer),
@@ -281,8 +282,8 @@ cfm_egress_id_string(netdissect_options *ndo, register const u_char *tptr) {
 
 void
 cfm_print(netdissect_options *ndo,
-          register const u_char *pptr, register u_int length) {
-
+          register const u_char *pptr, register u_int length)
+{
     const struct cfm_common_header_t *cfm_common_header;
     const struct cfm_tlv_header_t *cfm_tlv_header;
     const uint8_t *tptr, *tlv_ptr, *ma_name, *ma_nameformat, *ma_namelength;
index 8230c87e6cb2c1bd4d3c494864ff986853d75b5d..3951ef77cdff5ce7388f00b8ac8527c2eb8a58db 100644 (file)
@@ -56,7 +56,8 @@ chdlc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register co
 }
 
 u_int
-chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length) {
+chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length)
+{
        u_int proto;
 
        proto = EXTRACT_16BITS(&p[2]);
index a3feb8ef4a7cedfab9ed65d664f1232c8d1c6bed..cab77ba509aaf3503b4bf57fbc4e0de7c5f0793d 100644 (file)
@@ -205,8 +205,8 @@ static const struct tok eigrp_ext_proto_id_values[] = {
 };
 
 void
-eigrp_print(netdissect_options *ndo, register const u_char *pptr, register u_int len) {
-
+eigrp_print(netdissect_options *ndo, register const u_char *pptr, register u_int len)
+{
     const struct eigrp_common_header *eigrp_com_header;
     const struct eigrp_tlv_header *eigrp_tlv_header;
     const u_char *tptr,*tlv_tptr;
index 6ff86cae2a60e21c8fdabf09c810eaebbed42944..0832522ce3c1de014da07640e7dc9e634e0cd3b1 100644 (file)
@@ -143,7 +143,9 @@ static int parse_q922_addr(netdissect_options *ndo,
        return 1;
 }
 
-char *q922_string(netdissect_options *ndo, const u_char *p, u_int length) {
+char *
+q922_string(netdissect_options *ndo, const u_char *p, u_int length)
+{
 
     static u_int dlci, addr_len;
     static uint8_t flags[4];
@@ -591,8 +593,8 @@ mfr_print(netdissect_options *ndo,
 
 static void
 frf15_print(netdissect_options *ndo,
-            const u_char *p, u_int length) {
-
+            const u_char *p, u_int length)
+{
     uint16_t sequence_num, flags;
 
     flags = p[0]&MFR_BEC_MASK;
index 47ba58924aa4ffdb67100d74183413419c247227..59eb007707e0eba1f35eaba9733142e820c70400 100644 (file)
@@ -311,7 +311,8 @@ const char *icmp_tstamp_print(u_int);
 
 /* print the milliseconds since midnight UTC */
 const char *
-icmp_tstamp_print(u_int tstamp) {
+icmp_tstamp_print(u_int tstamp)
+{
     u_int msec,sec,min,hrs;
 
     static char buf[64];
index 50227a71d808c572e193952b5d3f0fb831f3d4a7..bd109ab9ad2eaf9d5f24d460282747363705048c 100644 (file)
@@ -1658,8 +1658,8 @@ isis_print_tlv_ip_reach(netdissect_options *ndo,
 static int
 isis_print_ip_reach_subtlv(netdissect_options *ndo,
                            const uint8_t *tptr, int subt, int subl,
-                           const char *ident) {
-
+                           const char *ident)
+{
         /* first lets see if we know the subTLVs name*/
        ND_PRINT((ndo, "%s%s subTLV #%u, length: %u",
                  ident, tok2str(isis_ext_ip_reach_subtlv_values, "unknown", subt),
@@ -1708,8 +1708,8 @@ trunctlv:
 static int
 isis_print_is_reach_subtlv(netdissect_options *ndo,
                            const uint8_t *tptr, u_int subt, u_int subl,
-                           const char *ident) {
-
+                           const char *ident)
+{
         u_int te_class,priority_level,gmpls_switch_cap;
         union { /* int to float conversion buffer for several subTLVs */
             float f;
@@ -1868,8 +1868,8 @@ trunctlv:
 
 static int
 isis_print_ext_is_reach(netdissect_options *ndo,
-                        const uint8_t *tptr, const char *ident, int tlv_type) {
-
+                        const uint8_t *tptr, const char *ident, int tlv_type)
+{
     char ident_buffer[20];
     int subtlv_type,subtlv_len,subtlv_sum_len;
     int proc_bytes = 0; /* how many bytes did we process ? */
@@ -1918,8 +1918,8 @@ isis_print_ext_is_reach(netdissect_options *ndo,
 
 static int
 isis_print_mtid(netdissect_options *ndo,
-                const uint8_t *tptr, const char *ident) {
-
+                const uint8_t *tptr, const char *ident)
+{
     if (!ND_TTEST2(*tptr, 2))
         return(0);
 
@@ -1945,8 +1945,8 @@ isis_print_mtid(netdissect_options *ndo,
 
 static int
 isis_print_extd_ip_reach(netdissect_options *ndo,
-                         const uint8_t *tptr, const char *ident, uint16_t afi) {
-
+                         const uint8_t *tptr, const char *ident, uint16_t afi)
+{
     char ident_buffer[20];
 #ifdef INET6
     uint8_t prefix[sizeof(struct in6_addr)]; /* shared copy buffer for IPv4 and IPv6 prefixes */
index 31874b7df41f1ff6ce8611042b8c077667aedc73..e4bb77c9d7a35e44fee76132e02fe74c26804b21 100644 (file)
@@ -1019,8 +1019,8 @@ juniper_atm2_print(netdissect_options *ndo,
  * a juniper router if the payload data is encapsulated using PPP */
 static int
 juniper_ppp_heuristic_guess(netdissect_options *ndo,
-                            register const u_char *p, u_int length) {
-
+                            register const u_char *p, u_int length)
+{
     switch(EXTRACT_16BITS(p)) {
     case PPP_IP :
     case PPP_OSI :
@@ -1049,8 +1049,8 @@ juniper_ppp_heuristic_guess(netdissect_options *ndo,
 
 static int
 ip_heuristic_guess(netdissect_options *ndo,
-                   register const u_char *p, u_int length) {
-
+                   register const u_char *p, u_int length)
+{
     switch(p[0]) {
     case 0x45:
     case 0x46:
@@ -1091,8 +1091,8 @@ ip_heuristic_guess(netdissect_options *ndo,
 }
 
 static int
-juniper_read_tlv_value(const u_char *p, u_int tlv_type, u_int tlv_len) {
-
+juniper_read_tlv_value(const u_char *p, u_int tlv_type, u_int tlv_len)
+{
    int tlv_value;
 
    /* TLVs < 128 are little endian encoded */
@@ -1139,8 +1139,8 @@ juniper_read_tlv_value(const u_char *p, u_int tlv_type, u_int tlv_len) {
 
 static int
 juniper_parse_header(netdissect_options *ndo,
-                     const u_char *p, const struct pcap_pkthdr *h, struct juniper_l2info_t *l2info) {
-
+                     const u_char *p, const struct pcap_pkthdr *h, struct juniper_l2info_t *l2info)
+{
     const struct juniper_cookie_table_t *lp = juniper_cookie_table;
     u_int idx, jnx_ext_len, jnx_header_len = 0;
     uint8_t tlv_type,tlv_len;
index f387affd4b016049d94dcad9229a399938088e08..3f741d136ce45d510ef9d1e9d2b3cff9d4d2ddd7 100644 (file)
@@ -234,8 +234,8 @@ static int ldp_pdu_print(netdissect_options *, register const u_char *);
 static int
 ldp_tlv_print(netdissect_options *ndo,
               register const u_char *tptr,
-              u_short msg_tlen) {
-
+              u_short msg_tlen)
+{
     struct ldp_tlv_header {
         uint8_t type[2];
         uint8_t length[2];
@@ -545,8 +545,8 @@ badtlv:
 
 void
 ldp_print(netdissect_options *ndo,
-          register const u_char *pptr, register u_int len) {
-
+          register const u_char *pptr, register u_int len)
+{
     int processed;
     while (len > (sizeof(struct ldp_common_header) + sizeof(struct ldp_msg_header))) {
         processed = ldp_pdu_print(ndo, pptr);
@@ -559,8 +559,8 @@ ldp_print(netdissect_options *ndo,
 
 static int
 ldp_pdu_print(netdissect_options *ndo,
-              register const u_char *pptr) {
-
+              register const u_char *pptr)
+{
     const struct ldp_common_header *ldp_com_header;
     const struct ldp_msg_header *ldp_msg_header;
     const u_char *tptr,*msg_tptr;
index e499507bba7e80d7b082aa294d2695e0967dfc0c..ce3c09382a651fa9711f8e45dd04c0e5311bd3a0 100644 (file)
@@ -1265,8 +1265,8 @@ lldp_private_dcbx_print(netdissect_options *ndo,
 }
 
 static char *
-lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len) {
-
+lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len)
+{
     uint8_t af;
     static char buf[BUFSIZE];
     const char * (*pfunc)(netdissect_options *, const u_char *);
@@ -1311,8 +1311,8 @@ lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len)
 
 static int
 lldp_mgmt_addr_tlv_print(netdissect_options *ndo,
-                         const u_char *pptr, u_int len) {
-
+                         const u_char *pptr, u_int len)
+{
     uint8_t mgmt_addr_len, intf_num_subtype, oid_len;
     const u_char *tptr;
     u_int tlen;
@@ -1373,8 +1373,8 @@ lldp_mgmt_addr_tlv_print(netdissect_options *ndo,
 
 void
 lldp_print(netdissect_options *ndo,
-           register const u_char *pptr, register u_int len) {
-
+           register const u_char *pptr, register u_int len)
+{
     uint8_t subtype;
     uint16_t tlv, cap, ena_cap;
     u_int oui, tlen, hexdump, tlv_type, tlv_len;
index 8d68e858fb7b56814caa4a82cf1af2778844470e..904dd712986e3d2e7bc7eaaa527091bffc0cc904 100644 (file)
@@ -354,8 +354,8 @@ static const struct tok lmp_ctype_values[] = {
 
 void
 lmp_print(netdissect_options *ndo,
-          register const u_char *pptr, register u_int len) {
-
+          register const u_char *pptr, register u_int len)
+{
     const struct lmp_common_header *lmp_com_header;
     const struct lmp_object_header *lmp_obj_header;
     const u_char *tptr,*obj_tptr;
index 1786cd2c5680873163f5f3e66c58cf5a28cfc697..888adfafbcdc8bf17c517359de44eff242d15519 100644 (file)
@@ -458,8 +458,8 @@ static const struct tok lspping_tlv_downstream_addr_values[] = {
 
 void
 lspping_print(netdissect_options *ndo,
-              register const u_char *pptr, register u_int len) {
-
+              register const u_char *pptr, register u_int len)
+{
     const struct lspping_common_header *lspping_com_header;
     const struct lspping_tlv_header *lspping_tlv_header;
     const struct lspping_tlv_header *lspping_subtlv_header;
index 6e02cd481c0ec17ee49aca71e6cc62d6e223d955..39af0ec1013ccb12ad329ff4a2dff4bc64877ae1 100644 (file)
@@ -162,8 +162,8 @@ struct lwapp_message_header {
 
 void
 lwapp_control_print(netdissect_options *ndo,
-                    const u_char *pptr, u_int len, int has_ap_ident) {
-
+                    const u_char *pptr, u_int len, int has_ap_ident)
+{
     const struct lwapp_transport_header *lwapp_trans_header;
     const struct lwapp_control_header *lwapp_control_header;
     const u_char *tptr;
@@ -285,8 +285,8 @@ lwapp_control_print(netdissect_options *ndo,
 
 void
 lwapp_data_print(netdissect_options *ndo,
-                 const u_char *pptr, u_int len) {
-
+                 const u_char *pptr, u_int len)
+{
     const struct lwapp_transport_header *lwapp_trans_header;
     const u_char *tptr;
     int tlen;
index 7ddfb1d12e380f0d8918394633084c909bacd066..9da3582d540919237f2a64e866db54c9629de600 100644 (file)
@@ -122,8 +122,8 @@ static const struct tok mpcp_reg_ack_flag_values[] = {
 };
 
 void
-mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int length) {
-
+mpcp_print(netdissect_options *ndo, register const u_char *pptr, register u_int length)
+{
     union {
         const struct mpcp_common_header_t *common_header;
         const struct mpcp_grant_t *grant;
index f86a9412f79671d906b86155d06ce643c209eb97..a36c32f3b29a3457351461b2632ae881be6ba1d6 100644 (file)
@@ -696,7 +696,8 @@ static const struct tok bsn_onoff_str[] = {
 };
 
 static const char *
-vlan_str(const uint16_t vid) {
+vlan_str(const uint16_t vid)
+{
        static char buf[sizeof("65535 (bogus)")];
        const char *fmt;
 
@@ -708,7 +709,8 @@ vlan_str(const uint16_t vid) {
 }
 
 static const char *
-pcp_str(const uint8_t pcp) {
+pcp_str(const uint8_t pcp)
+{
        static char buf[sizeof("255 (bogus)")];
        snprintf(buf, sizeof(buf), pcp <= 7 ? "%u" : "%u (bogus)", pcp);
        return buf;
@@ -716,7 +718,8 @@ pcp_str(const uint8_t pcp) {
 
 static void
 of10_bitmap_print(netdissect_options *ndo,
-                  const struct tok *t, const uint32_t v, const uint32_t u) {
+                  const struct tok *t, const uint32_t v, const uint32_t u)
+{
        const char *sep = " (";
 
        if (v == 0)
@@ -733,7 +736,8 @@ of10_bitmap_print(netdissect_options *ndo,
 
 static const u_char *
 of10_data_print(netdissect_options *ndo,
-                const u_char *cp, const u_char *ep, const u_int len) {
+                const u_char *cp, const u_char *ep, const u_int len)
+{
        if (len == 0)
                return cp;
        /* data */
@@ -750,7 +754,8 @@ trunc:
 
 static const u_char *
 of10_bsn_message_print(netdissect_options *ndo,
-                       const u_char *cp, const u_char *ep, const u_int len) {
+                       const u_char *cp, const u_char *ep, const u_int len)
+{
        const u_char *cp0 = cp;
        uint32_t subtype;
 
@@ -954,7 +959,8 @@ trunc:
 
 static const u_char *
 of10_bsn_actions_print(netdissect_options *ndo,
-                       const u_char *cp, const u_char *ep, const u_int len) {
+                       const u_char *cp, const u_char *ep, const u_int len)
+{
        const u_char *cp0 = cp;
        uint32_t subtype, vlan_tag;
 
@@ -1027,7 +1033,8 @@ trunc:
 
 static const u_char *
 of10_vendor_action_print(netdissect_options *ndo,
-                         const u_char *cp, const u_char *ep, const u_int len) {
+                         const u_char *cp, const u_char *ep, const u_int len)
+{
        uint32_t vendor;
        const u_char *(*decoder)(netdissect_options *, const u_char *, const u_char *, const u_int);
 
@@ -1055,7 +1062,8 @@ trunc:
 
 static const u_char *
 of10_vendor_message_print(netdissect_options *ndo,
-                          const u_char *cp, const u_char *ep, const u_int len) {
+                          const u_char *cp, const u_char *ep, const u_int len)
+{
        uint32_t vendor;
        const u_char *(*decoder)(netdissect_options *, const u_char *, const u_char *, u_int);
 
@@ -1084,7 +1092,8 @@ trunc:
 /* Vendor ID is mandatory, data is optional. */
 static const u_char *
 of10_vendor_data_print(netdissect_options *ndo,
-                       const u_char *cp, const u_char *ep, const u_int len) {
+                       const u_char *cp, const u_char *ep, const u_int len)
+{
        uint32_t vendor;
 
        if (len < 4)
@@ -1108,7 +1117,8 @@ trunc:
 
 static const u_char *
 of10_packet_data_print(netdissect_options *ndo,
-                       const u_char *cp, const u_char *ep, const u_int len) {
+                       const u_char *cp, const u_char *ep, const u_int len)
+{
        if (len == 0)
                return cp;
        /* data */
@@ -1130,7 +1140,8 @@ trunc:
 /* [OF10] Section 5.2.1 */
 static const u_char *
 of10_phy_ports_print(netdissect_options *ndo,
-                     const u_char *cp, const u_char *ep, u_int len) {
+                     const u_char *cp, const u_char *ep, u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
 
@@ -1204,7 +1215,8 @@ trunc:
 /* [OF10] Section 5.2.2 */
 static const u_char *
 of10_queue_props_print(netdissect_options *ndo,
-                       const u_char *cp, const u_char *ep, u_int len) {
+                       const u_char *cp, const u_char *ep, u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
        uint16_t property, plen, rate;
@@ -1279,7 +1291,8 @@ trunc:
 /* ibid */
 static const u_char *
 of10_queues_print(netdissect_options *ndo,
-                  const u_char *cp, const u_char *ep, u_int len) {
+                  const u_char *cp, const u_char *ep, u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
        uint16_t desclen;
@@ -1326,7 +1339,8 @@ trunc:
 /* [OF10] Section 5.2.3 */
 static const u_char *
 of10_match_print(netdissect_options *ndo,
-                 const char *pfx, const u_char *cp, const u_char *ep) {
+                 const char *pfx, const u_char *cp, const u_char *ep)
+{
        uint32_t wildcards;
        uint16_t dl_type;
        uint8_t nw_proto;
@@ -1430,7 +1444,8 @@ trunc:
 static const u_char *
 of10_actions_print(netdissect_options *ndo,
                    const char *pfx, const u_char *cp, const u_char *ep,
-                   u_int len) {
+                   u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
        uint16_t type, alen, output_port;
@@ -1595,7 +1610,8 @@ trunc:
 /* [OF10] Section 5.3.1 */
 static const u_char *
 of10_features_reply_print(netdissect_options *ndo,
-                          const u_char *cp, const u_char *ep, const u_int len) {
+                          const u_char *cp, const u_char *ep, const u_int len)
+{
        /* datapath_id */
        ND_TCHECK2(*cp, 8);
        ND_PRINT((ndo, "\n\t dpid 0x%016" PRIx64, EXTRACT_64BITS(cp)));
@@ -1632,7 +1648,8 @@ trunc:
 /* [OF10] Section 5.3.3 */
 static const u_char *
 of10_flow_mod_print(netdissect_options *ndo,
-                    const u_char *cp, const u_char *ep, const u_int len) {
+                    const u_char *cp, const u_char *ep, const u_int len)
+{
        uint16_t command;
 
        /* match */
@@ -1689,7 +1706,8 @@ trunc:
 /* ibid */
 static const u_char *
 of10_port_mod_print(netdissect_options *ndo,
-                    const u_char *cp, const u_char *ep) {
+                    const u_char *cp, const u_char *ep)
+{
        /* port_no */
        ND_TCHECK2(*cp, 2);
        ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_16BITS(cp))));
@@ -1725,7 +1743,8 @@ trunc:
 /* [OF10] Section 5.3.5 */
 static const u_char *
 of10_stats_request_print(netdissect_options *ndo,
-                         const u_char *cp, const u_char *ep, u_int len) {
+                         const u_char *cp, const u_char *ep, u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
        uint16_t type;
@@ -1808,7 +1827,8 @@ trunc:
 /* ibid */
 static const u_char *
 of10_desc_stats_reply_print(netdissect_options *ndo,
-                            const u_char *cp, const u_char *ep, const u_int len) {
+                            const u_char *cp, const u_char *ep, const u_int len)
+{
        if (len != OF_DESC_STATS_LEN)
                goto corrupt;
        /* mfr_desc */
@@ -1854,7 +1874,8 @@ trunc:
 /* ibid */
 static const u_char *
 of10_flow_stats_reply_print(netdissect_options *ndo,
-                            const u_char *cp, const u_char *ep, u_int len) {
+                            const u_char *cp, const u_char *ep, u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
        uint16_t entry_len;
@@ -1935,7 +1956,8 @@ trunc:
 static const u_char *
 of10_aggregate_stats_reply_print(netdissect_options *ndo,
                                  const u_char *cp, const u_char *ep,
-                                 const u_int len) {
+                                 const u_int len)
+{
        if (len != OF_AGGREGATE_STATS_REPLY_LEN)
                goto corrupt;
        /* packet_count */
@@ -1966,7 +1988,8 @@ trunc:
 /* ibid */
 static const u_char *
 of10_table_stats_reply_print(netdissect_options *ndo,
-                             const u_char *cp, const u_char *ep, u_int len) {
+                             const u_char *cp, const u_char *ep, u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
 
@@ -2024,7 +2047,8 @@ trunc:
 /* ibid */
 static const u_char *
 of10_port_stats_reply_print(netdissect_options *ndo,
-                            const u_char *cp, const u_char *ep, u_int len) {
+                            const u_char *cp, const u_char *ep, u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
 
@@ -2108,7 +2132,8 @@ trunc:
 /* ibid */
 static const u_char *
 of10_queue_stats_reply_print(netdissect_options *ndo,
-                             const u_char *cp, const u_char *ep, u_int len) {
+                             const u_char *cp, const u_char *ep, u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
 
@@ -2155,7 +2180,8 @@ trunc:
 /* ibid */
 static const u_char *
 of10_stats_reply_print(netdissect_options *ndo,
-                       const u_char *cp, const u_char *ep, const u_int len) {
+                       const u_char *cp, const u_char *ep, const u_int len)
+{
        const u_char *cp0 = cp;
        uint16_t type;
 
@@ -2194,7 +2220,8 @@ trunc:
 /* [OF10] Section 5.3.6 */
 static const u_char *
 of10_packet_out_print(netdissect_options *ndo,
-                      const u_char *cp, const u_char *ep, const u_int len) {
+                      const u_char *cp, const u_char *ep, const u_int len)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
        uint16_t actions_len;
@@ -2231,7 +2258,8 @@ trunc:
 /* [OF10] Section 5.4.1 */
 static const u_char *
 of10_packet_in_print(netdissect_options *ndo,
-                     const u_char *cp, const u_char *ep, const u_int len) {
+                     const u_char *cp, const u_char *ep, const u_int len)
+{
        /* buffer_id */
        ND_TCHECK2(*cp, 4);
        ND_PRINT((ndo, "\n\t buffer_id %s", tok2str(bufferid_str, "0x%08x", EXTRACT_32BITS(cp))));
@@ -2263,7 +2291,8 @@ trunc:
 /* [OF10] Section 5.4.2 */
 static const u_char *
 of10_flow_removed_print(netdissect_options *ndo,
-                        const u_char *cp, const u_char *ep) {
+                        const u_char *cp, const u_char *ep)
+{
        /* match */
        if (ep == (cp = of10_match_print(ndo, "\n\t ", cp, ep)))
                return ep; /* end of snapshot */
@@ -2316,7 +2345,8 @@ trunc:
 /* [OF10] Section 5.4.4 */
 static const u_char *
 of10_error_print(netdissect_options *ndo,
-                 const u_char *cp, const u_char *ep, const u_int len) {
+                 const u_char *cp, const u_char *ep, const u_int len)
+{
        uint16_t type;
        const struct tok *code_str;
 
@@ -2348,7 +2378,8 @@ trunc:
 const u_char *
 of10_header_body_print(netdissect_options *ndo,
                        const u_char *cp, const u_char *ep, const uint8_t type,
-                       const uint16_t len, const uint32_t xid) {
+                       const uint16_t len, const uint32_t xid)
+{
        const u_char *cp0 = cp;
        const u_int len0 = len;
        /* Thus far message length is not less than the basic header size, but most
index d7682a0ecb71aea312fb9ff645261669aa5bf470..8825ae3d5c8714a72fc559536f00d59ebf0bf55c 100644 (file)
@@ -60,21 +60,24 @@ const struct tok onf_exp_str[] = {
 };
 
 const char *
-of_vendor_name(const uint32_t vendor) {
+of_vendor_name(const uint32_t vendor)
+{
        const struct tok *table = (vendor & 0xff000000) == 0 ? oui_values : onf_exp_str;
        return tok2str(table, "unknown", vendor);
 }
 
 static void
 of_header_print(netdissect_options *ndo, const uint8_t version, const uint8_t type,
-                      const uint16_t length, const uint32_t xid) {
+                      const uint16_t length, const uint32_t xid)
+{
        ND_PRINT((ndo, "\n\tversion unknown (0x%02x), type 0x%02x, length %u, xid 0x%08x",
               version, type, length, xid));
 }
 
 /* Print a single OpenFlow message. */
 static const u_char *
-of_header_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+of_header_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        uint8_t version, type;
        uint16_t length;
        uint32_t xid;
@@ -129,7 +132,8 @@ trunc:
 /* Print a TCP segment worth of OpenFlow messages presuming the segment begins
  * on a message boundary. */
 void
-openflow_print(netdissect_options *ndo, const u_char *cp, const u_int len) {
+openflow_print(netdissect_options *ndo, const u_char *cp, const u_int len)
+{
        const u_char *ep = cp + len;
 
        ND_PRINT((ndo, ": OpenFlow"));
index b64438fa676f98fa0cb6cad4b147a85d81347943..3583417ad54c39b468479034acf947323278516e 100644 (file)
@@ -181,8 +181,8 @@ static const struct tok ospf_lls_eo_options[] = {
 
 int
 ospf_print_grace_lsa(netdissect_options *ndo,
-                     const uint8_t *tptr, u_int ls_length) {
-
+                     const uint8_t *tptr, u_int ls_length)
+{
     u_int tlv_type, tlv_length;
 
 
@@ -264,8 +264,8 @@ trunc:
 
 int
 ospf_print_te_lsa(netdissect_options *ndo,
-                  const uint8_t *tptr, u_int ls_length) {
-
+                  const uint8_t *tptr, u_int ls_length)
+{
     u_int tlv_type, tlv_length, subtlv_type, subtlv_length;
     u_int priority_level, te_class, count_srlg;
     union { /* int to float conversion buffer for several subTLVs */
index 9a983e6179cd282a61b33880cdf650db02c2dc2a..edc03c021c4e27a43eccad12b6475f6f7e62c9b8 100644 (file)
@@ -805,8 +805,8 @@ static const struct tok ppp_ml_flag_values[] = {
 
 static void
 handle_mlppp(netdissect_options *ndo,
-             const u_char *p, int length) {
-
+             const u_char *p, int length)
+{
     if (!ndo->ndo_eflag)
         ND_PRINT((ndo, "MLPPP, "));
 
index 6c743479fead0eb2e2d2decef7d5753d09037e23..101e41dafbbe39f532f087cb7d840c7e1e05667e 100644 (file)
@@ -309,8 +309,8 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, u_int indent)
 }
 
 void
-rpki_rtr_print(netdissect_options *ndo, register const u_char *pptr, register u_int len) {
-
+rpki_rtr_print(netdissect_options *ndo, register const u_char *pptr, register u_int len)
+{
     u_int tlen, pdu_type, pdu_len;
     const u_char *tptr;
     const rpki_rtr_pdu *pdu_header;
index 51ab9f8ad104229b99d53616a2a09d7f57692a12..263ef3d4656ac1f3d5d036ed36f930c36822ef68 100644 (file)
@@ -486,8 +486,8 @@ static const struct tok rsvp_obj_generalized_uni_values[] = {
  */
 static int
 rsvp_intserv_print(netdissect_options *ndo,
-                   const u_char *tptr, u_short obj_tlen) {
-
+                   const u_char *tptr, u_short obj_tlen)
+{
     int parameter_id,parameter_length;
     union {
        float f;
@@ -637,8 +637,8 @@ _U_
 _U_
 #endif
 , const u_char *tptr,
-                const char *ident, u_int tlen) {
-
+                const char *ident, u_int tlen)
+{
     const struct rsvp_object_header *rsvp_obj_header;
     const u_char *obj_tptr;
     union {
@@ -1795,8 +1795,8 @@ trunc:
 
 void
 rsvp_print(netdissect_options *ndo,
-           register const u_char *pptr, register u_int len) {
-
+           register const u_char *pptr, register u_int len)
+{
     struct rsvp_common_header *rsvp_com_header;
     const u_char *tptr,*subtptr;
     u_short plen, tlen, subtlen;
index da72848d15f71adb64b089bb8ed4a616faefd2b8..24112f44ad1b1e37816212cd31984c5e0401f444 100644 (file)
@@ -297,8 +297,8 @@ struct sflow_vlan_counter_t {
 
 static int
 print_sflow_counter_generic(netdissect_options *ndo,
-                            const u_char *pointer, u_int len) {
-
+                            const u_char *pointer, u_int len)
+{
     const struct sflow_generic_counter_t *sflow_gen_counter;
 
     if (len < sizeof(struct sflow_generic_counter_t))
@@ -343,8 +343,8 @@ print_sflow_counter_generic(netdissect_options *ndo,
 
 static int
 print_sflow_counter_ethernet(netdissect_options *ndo,
-                             const u_char *pointer, u_int len){
-
+                             const u_char *pointer, u_int len)
+{
     const struct sflow_ethernet_counter_t *sflow_eth_counter;
 
     if (len < sizeof(struct sflow_ethernet_counter_t))
@@ -373,15 +373,15 @@ print_sflow_counter_ethernet(netdissect_options *ndo,
 
 static int
 print_sflow_counter_token_ring(netdissect_options *ndo _U_,
-                               const u_char *pointer _U_, u_int len _U_) {
-
+                               const u_char *pointer _U_, u_int len _U_)
+{
     return 0;
 }
 
 static int
 print_sflow_counter_basevg(netdissect_options *ndo,
-                           const u_char *pointer, u_int len) {
-
+                           const u_char *pointer, u_int len)
+{
     const struct sflow_100basevg_counter_t *sflow_100basevg_counter;
 
     if (len < sizeof(struct sflow_100basevg_counter_t))
@@ -416,8 +416,8 @@ print_sflow_counter_basevg(netdissect_options *ndo,
 
 static int
 print_sflow_counter_vlan(netdissect_options *ndo,
-                         const u_char *pointer, u_int len) {
-
+                         const u_char *pointer, u_int len)
+{
     const struct sflow_vlan_counter_t *sflow_vlan_counter;
 
     if (len < sizeof(struct sflow_vlan_counter_t))
@@ -446,8 +446,8 @@ struct sflow_processor_counter_t {
 
 static int
 print_sflow_counter_processor(netdissect_options *ndo,
-                              const u_char *pointer, u_int len) {
-
+                              const u_char *pointer, u_int len)
+{
     const struct sflow_processor_counter_t *sflow_processor_counter;
 
     if (len < sizeof(struct sflow_processor_counter_t))
@@ -467,8 +467,8 @@ print_sflow_counter_processor(netdissect_options *ndo,
 
 static int
 sflow_print_counter_records(netdissect_options *ndo,
-                            const u_char *pointer, u_int len, u_int records) {
-
+                            const u_char *pointer, u_int len, u_int records)
+{
     u_int nrecords;
     const u_char *tptr;
     u_int tlen;
@@ -543,11 +543,10 @@ sflow_print_counter_records(netdissect_options *ndo,
     return 0;
 }
 
-
 static int
 sflow_print_counter_sample(netdissect_options *ndo,
-                           const u_char *pointer, u_int len) {
-
+                           const u_char *pointer, u_int len)
+{
     const struct sflow_counter_sample_t *sflow_counter_sample;
     u_int           nrecords;
     u_int           typesource;
@@ -579,8 +578,8 @@ sflow_print_counter_sample(netdissect_options *ndo,
 
 static int
 sflow_print_expanded_counter_sample(netdissect_options *ndo,
-                                    const u_char *pointer, u_int len) {
-
+                                    const u_char *pointer, u_int len)
+{
     const struct sflow_expanded_counter_sample_t *sflow_expanded_counter_sample;
     u_int           nrecords;
 
@@ -606,8 +605,8 @@ sflow_print_expanded_counter_sample(netdissect_options *ndo,
 
 static int
 print_sflow_raw_packet(netdissect_options *ndo,
-                       const u_char *pointer, u_int len) {
-
+                       const u_char *pointer, u_int len)
+{
     const struct sflow_expanded_flow_raw_t *sflow_flow_raw;
 
     if (len < sizeof(struct sflow_expanded_flow_raw_t))
@@ -629,8 +628,8 @@ print_sflow_raw_packet(netdissect_options *ndo,
 
 static int
 print_sflow_ethernet_frame(netdissect_options *ndo,
-                           const u_char *pointer, u_int len) {
-
+                           const u_char *pointer, u_int len)
+{
     const struct sflow_ethernet_frame_t *sflow_ethernet_frame;
 
     if (len < sizeof(struct sflow_ethernet_frame_t))
@@ -647,8 +646,8 @@ print_sflow_ethernet_frame(netdissect_options *ndo,
 
 static int
 print_sflow_extended_switch_data(netdissect_options *ndo,
-                                 const u_char *pointer, u_int len) {
-
+                                 const u_char *pointer, u_int len)
+{
     const struct sflow_extended_switch_data_t *sflow_extended_sw_data;
 
     if (len < sizeof(struct sflow_extended_switch_data_t))
@@ -666,8 +665,8 @@ print_sflow_extended_switch_data(netdissect_options *ndo,
 
 static int
 sflow_print_flow_records(netdissect_options *ndo,
-                         const u_char *pointer, u_int len, u_int records) {
-
+                         const u_char *pointer, u_int len, u_int records)
+{
     u_int nrecords;
     const u_char *tptr;
     u_int tlen;
@@ -752,8 +751,8 @@ sflow_print_flow_records(netdissect_options *ndo,
 
 static int
 sflow_print_flow_sample(netdissect_options *ndo,
-                        const u_char *pointer, u_int len) {
-
+                        const u_char *pointer, u_int len)
+{
     const struct sflow_flow_sample_t *sflow_flow_sample;
     u_int          nrecords;
     u_int          typesource;
@@ -789,8 +788,8 @@ sflow_print_flow_sample(netdissect_options *ndo,
 
 static int
 sflow_print_expanded_flow_sample(netdissect_options *ndo,
-                                 const u_char *pointer, u_int len) {
-
+                                 const u_char *pointer, u_int len)
+{
     const struct sflow_expanded_flow_sample_t *sflow_expanded_flow_sample;
     u_int nrecords;
 
@@ -818,8 +817,8 @@ sflow_print_expanded_flow_sample(netdissect_options *ndo,
 
 void
 sflow_print(netdissect_options *ndo,
-            const u_char *pptr, u_int len) {
-
+            const u_char *pptr, u_int len)
+{
     const struct sflow_datagram_t *sflow_datagram;
     const struct sflow_sample_header *sflow_sample;
 
index fec76cab3ff2e12ce29c23f137fb66a9f3f2bb51..2db3581e2bf76953bd32a95d0f610596c8545e0c 100644 (file)
@@ -249,8 +249,8 @@ const struct slow_common_header_t *slow_com_header;
 
 void
 slow_print(netdissect_options *ndo,
-           register const u_char *pptr, register u_int len) {
-
+           register const u_char *pptr, register u_int len)
+{
     int print_version;
 
     slow_com_header = (const struct slow_common_header_t *)pptr;
@@ -332,8 +332,8 @@ trunc:
 
 static void
 slow_marker_lacp_print(netdissect_options *ndo,
-                       register const u_char *tptr, register u_int tlen) {
-
+                       register const u_char *tptr, register u_int tlen)
+{
     const struct tlv_header_t *tlv_header;
     const u_char *tlv_tptr;
     u_int tlv_len, tlv_tlen;
@@ -450,8 +450,8 @@ trunc:
 
 static void
 slow_oam_print(netdissect_options *ndo,
-               register const u_char *tptr, register u_int tlen) {
-
+               register const u_char *tptr, register u_int tlen)
+{
     u_int hexdump;
 
     struct slow_oam_common_header_t {
index 0ef30517bd7cc312faa2e8cda3a8b4810a0feea2..ba22c96e72ad00a182437a93f176991a47ef15b1 100644 (file)
@@ -76,7 +76,8 @@ static const char tstr[] = " [|zmtp1]";
  */
 
 static const u_char *
-zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) {
+zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep)
+{
        uint64_t body_len_declared, body_len_captured, header_len;
        uint8_t flags;
 
@@ -139,7 +140,8 @@ trunc:
 }
 
 void
-zmtp1_print(netdissect_options *ndo, const u_char *cp, u_int len) {
+zmtp1_print(netdissect_options *ndo, const u_char *cp, u_int len)
+{
        const u_char *ep = min(ndo->ndo_snapend, cp + len);
 
        ND_PRINT((ndo, ": ZMTP/1.0"));
@@ -164,7 +166,8 @@ zmtp1_print(netdissect_options *ndo, const u_char *cp, u_int len) {
  */
 
 static const u_char *
-zmtp1_print_intermediate_part(netdissect_options *ndo, const u_char *cp, const u_int len) {
+zmtp1_print_intermediate_part(netdissect_options *ndo, const u_char *cp, const u_int len)
+{
        u_int frame_offset;
        uint64_t remaining_len;
 
@@ -206,7 +209,8 @@ trunc:
 }
 
 void
-zmtp1_print_datagram(netdissect_options *ndo, const u_char *cp, const u_int len) {
+zmtp1_print_datagram(netdissect_options *ndo, const u_char *cp, const u_int len)
+{
        const u_char *ep = min(ndo->ndo_snapend, cp + len);
 
        cp = zmtp1_print_intermediate_part(ndo, cp, len);