Changeset 4f55f69 for libpacketdump


Ignore:
Timestamp:
04/27/07 23:35:49 (14 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:
d6d2a32
Parents:
0f42351
Message:

More warning fixes -- convert the length to be an unsigned number

Location:
libpacketdump
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/eth_2048.c

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

    r09ebdb4 r4f55f69  
    1717        } while(0)
    1818
    19 void decode(int link_type,char *packet,int len)
     19void decode(int link_type,char *packet,unsigned len)
    2020{
    2121        int offset=0;
  • libpacketdump/eth_34958.c

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

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

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

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

    r0a22046 r4f55f69  
    4747        };
    4848
    49 int get_next_option(unsigned char **ptr,int *len,
    50                         unsigned char *type,
    51                         unsigned char *optlen,
    52                         unsigned char **data)
    53 {
    54         if (*len<=0)
    55                 return 0;
    56         *type=**ptr;
    57         switch(*type) {
    58                 case 0:
    59                         return 0;
    60                 case 1:
    61                         (*ptr)++;
    62                         (*len)--;
    63                         return 1;
    64                 default:
    65                         *optlen = *(*ptr+1);
    66                         (*len)-=*optlen;
    67                         (*data)=(*ptr+2);
    68                         (*ptr)+=*optlen;
    69                         if (*len<0)
    70                                 return 0;
    71                         return 1;
    72         }
    73 }
    74 
    75 void decode(int link_type,char *packet,int len)
     49void decode(int link_type,char *packet,unsigned len)
    7650{
    7751        struct dccphdr *dccp = (struct dccphdr*)packet;
  • libpacketdump/ip_6.c

    r6b6ede6 r4f55f69  
    2020#define DISPLAYIP(x,fmt) DISPLAY_EXP(x,fmt,inet_ntoa(*(struct in_addr*)&tcp->x))
    2121
    22 void decode(int link_type,char *packet,int len)
     22void decode(int link_type,char *packet,unsigned len)
    2323{
    2424        libtrace_tcp_t *tcp = (libtrace_tcp_t *)packet;
  • libpacketdump/libpacketdump.h

    r5593016 r4f55f69  
    1010void decode_next(char *packet,int len,char *proto_name,int type);
    1111
     12void decode(int link_type, char *pkt, unsigned len);
     13
    1214#ifdef __cplusplus
    1315}
  • libpacketdump/link_0.c

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

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

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

    r3ec29a9 r4f55f69  
    1616        while ( (_p - _s) % sizeof(uint16_t)) {_p++; _c++;}
    1717
    18 void decode(int link_type,char *packet,int len)
     18void decode(int link_type,char *packet,unsigned len)
    1919{
    2020        uint32_t *ptr;
  • libpacketdump/link_2.c

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

    r2f60c8f r4f55f69  
    167167 * Takes a vendor IE and decodes it
    168168 */
    169 void decode_80211_vendor_ie(ieee80211_ie *ie) {
     169static void decode_80211_vendor_ie(ieee80211_ie *ie) {
    170170        uint8_t *data = (uint8_t *) ((char *)ie + sizeof(ieee80211_ie));
    171171        uint32_t ie_oui;       
     
    191191 * length remaining and decodes the IEs.
    192192 */
    193 void decode_80211_information_elements(char *pkt, unsigned len) {
     193static void decode_80211_information_elements(char *pkt, unsigned len) {
    194194        ieee80211_ie *ie;
    195195        int i = 0;
     
    404404
    405405/* Decodes a capability info field */
    406 void decode_80211_capinfo(ieee80211_capinfo *c) {
     406static void decode_80211_capinfo(ieee80211_capinfo *c) {
    407407        printf(" 802.11MAC: Capability Info:");
    408408        if (c->ess) printf(" ESS");
     
    425425       
    426426/* Decodes a beacon (or a probe response) */
    427 void decode_80211_beacon(char *pkt, unsigned len) {
     427static void decode_80211_beacon(char *pkt, unsigned len) {
    428428        ieee80211_beacon *b = (ieee80211_beacon *)pkt;
    429429        if (len < sizeof(ieee80211_beacon)) {
     
    439439}
    440440
    441 void decode_80211_assoc_request(char *pkt, unsigned len) {
     441static void decode_80211_assoc_request(char *pkt, unsigned len) {
    442442        ieee80211_assoc_req *a = (ieee80211_assoc_req *) pkt;
    443443       
     
    453453}
    454454
    455 void decode_80211_assoc_response(char *pkt, unsigned len) {
     455static void decode_80211_assoc_response(char *pkt, unsigned len) {
    456456        ieee80211_assoc_resp *r = (ieee80211_assoc_resp *) pkt;
    457457
     
    468468}
    469469       
    470 void decode_80211_reassoc_request(char *pkt, unsigned len) {
     470static void decode_80211_reassoc_request(char *pkt, unsigned len) {
    471471        ieee80211_reassoc_req *r = (ieee80211_reassoc_req *) pkt;
    472472
     
    480480        printf(" 802.11MAC: Information Elements:\n");
    481481        decode_80211_information_elements((char *)pkt + sizeof(ieee80211_reassoc_req), len - sizeof(ieee80211_reassoc_req));
    482 
    483 }
    484 void decode_80211_authentication_frame(char *pkt, unsigned len) {
     482}
     483
     484static void decode_80211_authentication_frame(char *pkt, unsigned len) {
    485485        ieee80211_auth *auth = (ieee80211_auth *)pkt;
    486486        if(len < sizeof(ieee80211_auth)) {
     
    497497}
    498498
    499 void decode_80211_mgmt(char *pkt, unsigned len) {
     499static void decode_80211_mgmt(char *pkt, unsigned len) {
    500500        ieee80211_mgmt_frame *mgmt = (ieee80211_mgmt_frame *)pkt;
    501501        uint8_t *data;
     
    580580}
    581581
    582 void decode_80211_ctrl(char *pkt, unsigned len) {
     582static void decode_80211_ctrl(char *pkt, unsigned len) {
    583583        ieee80211_ctrl_frame_1addr *ctrl1 = (ieee80211_ctrl_frame_1addr *) pkt;
    584584        ieee80211_ctrl_frame_2addr *ctrl2 = (ieee80211_ctrl_frame_2addr *) pkt;
     
    650650}
    651651
    652 void decode_80211_data(char *pkt, unsigned len) {
     652static void decode_80211_data(char *pkt, unsigned len) {
    653653        ieee80211_data_frame *data = (ieee80211_data_frame *) pkt;
    654654        ieee80211_qos_data_frame *qos = (ieee80211_qos_data_frame *)pkt;
  • libpacketdump/link_6.c

    rbed8c66 r4f55f69  
    1111#include "libtrace_int.h"
    1212
    13 void decode(int link_type, char *pkt, int len)
     13void decode(int link_type, char *pkt, unsigned len)
    1414{
    1515        libtrace_sll_header_t *sll = (libtrace_sll_header_t *) pkt;
Note: See TracChangeset for help on using the changeset viewer.