Changeset eade363


Ignore:
Timestamp:
10/15/09 18:46:08 (11 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
34cab5b
Parents:
189f5c6
Message:

Tidy up thousands of little warnings

Files:
22 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_int.h

    r3c26e2a reade363  
    214214        uint16_t hatype;                /* link-layer address type */
    215215        uint16_t halen;                 /* link-layer address length */
    216         char addr[8];                   /* link-layer address */
     216        unsigned char addr[8];          /* link-layer address */
    217217        uint16_t protocol;              /* protocol */
    218218} libtrace_sll_header_t;
  • libpacketdump/bitbuffer.c

    r11a7f9c reade363  
    4949    return ret;
    5050}
     51
     52int yyparse(void);
    5153
    5254element_t* parse_protocol_file(char *filename)
     
    109111
    110112
    111 void decode_protocol_file(uint16_t link_type,const char *packet,int len,element_t *el)
     113void decode_protocol_file(uint16_t link_type UNUSED,const char *packet,int len,element_t *el)
    112114{
    113115    bitbuffer_t result;
     
    134136                               
    135137                        el->data->field->value = result;
    136                         printf(" %s %lld\n",
     138                        printf(" %s %" PRIi64 "\n",
    137139                                el->data->field->identifier,
    138140                                result);
     
    151153                       
    152154                        el->data->field->value = result;
    153                         printf(" %s 0x%llx\n",
     155                        printf(" %s 0x%" PRIx64 "\n",
    154156                                el->data->field->identifier,
    155157                                result);
  • libpacketdump/eth_2048.c

    r11a7f9c reade363  
    2121#define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&ip->x))
    2222
    23 void decode(int link_type,const char *packet,unsigned len)
     23void decode(int link_type UNUSED,const char *packet,unsigned len)
    2424{
    2525        libtrace_ip_t *ip = (libtrace_ip_t*)packet;
  • libpacketdump/eth_2054.c

    r11a7f9c reade363  
    2020 * attempt to decode.
    2121 */
    22 static char *format_hrd(struct arphdr *arp, char *hrd) {
     22static char *format_hrd(const struct arphdr *arp, const char *hrd) {
    2323        static char buffer[1024] = {0,};
    2424        int i;
     
    3131        switch(ntohs(arp->ar_hrd)) {
    3232                case ARPHRD_ETHER:
    33                         trace_ether_ntoa(hrd, buffer);
     33                        trace_ether_ntoa((const unsigned char *)hrd, buffer);
    3434                        break;
    3535                default:
     
    5050 * attempt to decode.
    5151 */
    52 static char *format_pro(struct arphdr *arp, char *pro) {
     52static char *format_pro(const struct arphdr *arp, const char *pro) {
    5353        static char buffer[1024] = {0,};
    5454        int i;
     
    7777}
    7878       
    79 void decode(int link_type,const char *packet,unsigned len)
     79void decode(int link_type UNUSED,const char *packet,unsigned len)
    8080{
    8181        struct arphdr *arp = (struct arphdr*)packet;
    82         char *source_hrd = NULL;
    83         char *source_pro = NULL;
    84         char *dest_hrd = NULL;
    85         char *dest_pro = NULL;
     82        const char *source_hrd = NULL;
     83        const char *source_pro = NULL;
     84        const char *dest_hrd = NULL;
     85        const char *dest_pro = NULL;
    8686
    8787        if (len < sizeof(struct arphdr)) {
  • libpacketdump/eth_33024.c

    r4e4a77f reade363  
    2222        } while(0)
    2323
    24 void decode(int link_type,const char *packet,unsigned len)
     24void decode(int link_type UNUSED,const char *packet,unsigned len)
    2525{
    26         int offset=0;
     26        unsigned int offset=0;
    2727        int value;
    2828        uint16_t ethertype;
  • libpacketdump/eth_34887.c

    rc5f3398 reade363  
    2222        } while(0)
    2323
    24 void decode(int link_type,const char *packet,unsigned len)
     24void decode(int link_type UNUSED,const char *packet,unsigned len)
    2525{
    26         int offset=0;
     26        unsigned int offset=0;
    2727        int value;
    2828        int more = 0;
  • libpacketdump/eth_34916.c

    r11c0f44 reade363  
    1515} pppoe_t;
    1616
    17 void decode(int link_type,const char *pkt,unsigned len)
     17void decode(int link_type UNUSED,const char *pkt,unsigned len)
    1818{
    1919        pppoe_t *pppoe = (pppoe_t *) pkt;
  • libpacketdump/eth_34958.c

    r11a7f9c reade363  
    1515                } while(0)
    1616
    17 static void decode_eap_request(char *packet, unsigned len)
     17static void decode_eap_request(const char *packet, unsigned len)
    1818{
    1919        int v;
     
    3434}
    3535
    36 static void decode_eap(char *packet, unsigned len)
     36static void decode_eap(const char *packet, unsigned len)
    3737{
    3838        int v;
     
    5454}
    5555
    56 static void decode_eapol_start(char *packet, unsigned len)
     56static void decode_eapol_start(const char *packet, unsigned len)
    5757{
    5858        int v;
     
    6161}
    6262
    63 static void decode_eapol_logoff(char *packet, unsigned len)
     63static void decode_eapol_logoff(const char *packet, unsigned len)
    6464{
    6565        int v;
     
    7777};
    7878
    79 static void decode_eapol_key(char *packet, unsigned len)
     79static void decode_eapol_key(const char *packet, unsigned len)
    8080{
    8181        int v;
     
    8484}
    8585
    86 static void decode_eapol_encapsulated_asf_alert(char *packet, unsigned len)
     86static void decode_eapol_encapsulated_asf_alert(const char *packet, unsigned len)
    8787{
    8888        int v;
     
    9191}
    9292
    93 void decode(int link_type,const char *packet,unsigned len)
     93void decode(int link_type UNUSED,const char *packet,unsigned len)
    9494{
    95         int offset;
    9695        int v;
    9796        int type;
  • libpacketdump/ip_1.c

    r11a7f9c reade363  
    3939};
    4040
    41 void decode(int link_type,const char *packet,unsigned len)
     41void decode(int link_type UNUSED,const char *packet,unsigned len)
    4242{
    4343        libtrace_icmp_t *icmp = (libtrace_icmp_t*)packet;
  • libpacketdump/ip_132.c

    r11a7f9c reade363  
    151151}
    152152
    153 void decode(int link_type,const char *packet,unsigned len)
     153void decode(int link_type UNUSED,const char *packet,unsigned len)
    154154{
    155155    struct sctp_common_hdr *hdr;
  • libpacketdump/ip_17.c

    r11a7f9c reade363  
    2525
    2626
    27 void decode(int link_type,const char *packet,unsigned len)
     27void decode(int link_type UNUSED,const char *packet,unsigned len)
    2828{
    2929        struct libtrace_udp *udp = (struct libtrace_udp*)packet;
  • libpacketdump/ip_33.c

    r11a7f9c reade363  
    4747        };
    4848
    49 void decode(int link_type,const char *packet,unsigned len)
     49void decode(int link_type UNUSED,const char *packet,unsigned len)
    5050{
    5151        struct dccphdr *dccp = (struct dccphdr*)packet;
  • libpacketdump/ip_47.c

    r553247b reade363  
    1111} gre_t;
    1212
    13 void decode(int link_type,const char *packet,unsigned len)
     13void decode(int link_type UNUSED,const char *packet,unsigned len)
    1414{
    1515        // GRE
  • libpacketdump/ip_6.c

    r11a7f9c reade363  
    2020#define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&tcp->x))
    2121
    22 void decode(int link_type,const char *packet,unsigned len)
     22void decode(int link_type UNUSED,const char *packet,unsigned len)
    2323{
    2424        unsigned char *pkt = NULL;
  • libpacketdump/link_0.c

    r11a7f9c reade363  
    66#include "libpacketdump.h"
    77
    8 void decode(int link_type,const char *packet,unsigned len)
     8void decode(int link_type UNUSED,const char *packet,unsigned len)
    99{
    1010        printf(" Legacy PoS:");
  • libpacketdump/link_10.c

    r11a7f9c reade363  
    55#include "libtrace.h"
    66
    7 void decode(int link_type,const char *packet,unsigned len)
     7void decode(int link_type UNUSED,const char *packet,unsigned len)
    88{
    99        // ATM
  • libpacketdump/link_11.c

    r11a7f9c reade363  
    44#include "libpacketdump.h"
    55
    6 void decode(int link_type,const char *packet,unsigned len)
     6void decode(int link_type UNUSED,const char *packet,unsigned len)
    77{
    88        // Ethernet - just raw ethernet frames
  • libpacketdump/link_15.c

    r11a7f9c reade363  
    1616        while ( (_p - _s) % sizeof(uint16_t)) {_p++; _c++;}
    1717
    18 void decode(int link_type,const char *packet,unsigned len)
     18void decode(int link_type UNUSED,const char *packet,unsigned len)
    1919{
    2020        uint32_t *ptr;
     
    5555
    5656        if (rtap->it_present & (1 << TRACE_RADIOTAP_TSFT)) {
    57                 printf(" Radiotap: TSFT = %llu microseconds\n", bswap_le_to_host64(*((uint64_t *)p)));
     57                printf(" Radiotap: TSFT = %" PRIu64 " microseconds\n", bswap_le_to_host64(*((uint64_t *)p)));
    5858                p += sizeof (uint64_t);
    5959                rtap_real_len += sizeof (uint64_t);
  • libpacketdump/link_2.c

    r11a7f9c reade363  
    77#include "libpacketdump.h"
    88
    9 void decode(int link_type,const char *packet,unsigned len)
     9void decode(int link_type UNUSED,const char *packet,unsigned len)
    1010{
    1111        char ether_buf[18] = {0, };
  • libpacketdump/link_4.c

    r11a7f9c reade363  
    2525#include <netinet/in.h>
    2626#include <stdio.h>
     27#include <inttypes.h>
    2728#include "libpacketdump.h"
    2829#include "libtrace.h"
     
    194195        ieee80211_ie *ie;
    195196        int i = 0;
    196         uint8_t * data;
     197        const uint8_t * data;
    197198        uint8_t bmap_offset;
    198199        while (len >= sizeof(ieee80211_ie)) {
     
    204205                }
    205206               
    206                 data = (( char *)pkt + sizeof (ieee80211_ie));
     207                data = (( const unsigned char *)pkt + sizeof (ieee80211_ie));
    207208               
    208209                switch (ie->id) {
     
    432433        }
    433434       
    434         printf(" 802.11MAC: Timestamp = %llu\n", b->ts);
     435        printf(" 802.11MAC: Timestamp = %" PRIu64 "\n", b->ts);
    435436        printf(" 802.11MAC: Beacon Interval = %u\n", b->interval);
    436437        decode_80211_capinfo(&b->capinfo);
     
    499500static void decode_80211_mgmt(const char *pkt, unsigned len) {
    500501        ieee80211_mgmt_frame *mgmt = (ieee80211_mgmt_frame *)pkt;
    501         uint8_t *data;
     502        const char *data;
    502503       
    503504        printf(" 802.11MAC: Management frame: ");
     
    557558                        break;
    558559                case 10:
    559                         data = ((char *)pkt + sizeof(ieee80211_mgmt_frame));
     560                        data = (pkt + sizeof(ieee80211_mgmt_frame));
    560561                        printf(" 802.11MAC: Reason Code = ");
    561562                        ieee80211_print_reason_code((uint16_t) ((data[0] << 8) | (data[1])));
     
    567568                        break;
    568569                case 12:
    569                         data = ((char *)pkt + sizeof(ieee80211_mgmt_frame));
     570                        data = (pkt + sizeof(ieee80211_mgmt_frame));
    570571                        printf(" 802.11MAC: Reason Code = ");
    571572                        ieee80211_print_reason_code((uint16_t) ((data[0] << 8) | (data[1])));
     
    747748}
    748749
    749 void decode(int link_type, const char *pkt, unsigned len)
     750void decode(int link_type UNUSED, const char *pkt, unsigned len)
    750751{
    751752        ieee80211_frame_control *fc;
  • libpacketdump/link_6.c

    r11a7f9c reade363  
    1111#include "libtrace_int.h"
    1212
    13 void decode(int link_type,const char *pkt,unsigned len)
     13void decode(int link_type UNUSED,const char *pkt,unsigned len)
    1414{
    1515        libtrace_sll_header_t *sll = (libtrace_sll_header_t *) pkt;
  • libpacketdump/parser.y

    r4f666aa reade363  
    1919    element_t *el_list = NULL;
    2020
    21     /* i didnt want these to be global, but i think they have to be? :/ */
    22     static bitbuffer_t buffer = 0;
    23     static int bits = 0;
    2421%}
    2522
Note: See TracChangeset for help on using the changeset viewer.