Changeset f5d654e for libpacketdump


Ignore:
Timestamp:
04/02/08 16:32:01 (14 years ago)
Author:
Shane Alcock <salcock@…>
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:
dd1217b
Parents:
007fb43
Message:

Some fixes to deal with errors and warnings that appear with old gcc - e.g. 2.95

  • Added 'static' to functions that are only used internally
  • Moved variable declarations to the start of the code block, before any actual code
Location:
libpacketdump
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/eth_2054.c

    r622dd4d rf5d654e  
    2020 * attempt to decode.
    2121 */
    22 char *format_hrd(struct arphdr *arp, char *hrd) {
     22static char *format_hrd(struct arphdr *arp, char *hrd) {
    2323        static char buffer[1024] = {0,};
    2424        int i;
     
    5050 * attempt to decode.
    5151 */
    52 char *format_pro(struct arphdr *arp, char *pro) {
     52static char *format_pro(struct arphdr *arp, char *pro) {
    5353        static char buffer[1024] = {0,};
    5454        int i;
  • libpacketdump/ip_6.c

    r4f55f69 rf5d654e  
    2222void decode(int link_type,char *packet,unsigned len)
    2323{
     24        unsigned char *pkt = NULL;
     25        unsigned char type,optlen,*data;
     26        int plen, i;
    2427        libtrace_tcp_t *tcp = (libtrace_tcp_t *)packet;
    2528        printf(" TCP:");
     
    6972        DISPLAYS(check," Checksum %i");
    7073        DISPLAYS(urg_ptr," Urgent %i");
    71         unsigned char *pkt = (unsigned char*)packet+sizeof(*tcp);
    72         int plen = (len-sizeof *tcp) < (tcp->doff*4-sizeof(*tcp))?(len-sizeof(*tcp)):(tcp->doff*4-sizeof *tcp);
    73         unsigned char type,optlen,*data;
     74        pkt = (unsigned char*)packet+sizeof(*tcp);
     75        plen = (len-sizeof *tcp) < (tcp->doff*4-sizeof(*tcp))?(len-sizeof(*tcp)):(tcp->doff*4-sizeof *tcp);
    7476        while(trace_get_next_option(&pkt,&plen,&type,&optlen,&data)) {
    7577                printf("\n TCP: ");
     
    9294                        case 5:
    9395                                printf("SACK Information");
    94                                 int i;
    9596                                i=0;
    9697                                while(i+8<optlen) {
  • libpacketdump/link_4.c

    r3996329 rf5d654e  
    9999} __attribute__ ((__packed__)) ieee80211_payload;
    100100
    101 char *macaddr(uint8_t mac[]) {
     101static char *macaddr(uint8_t mac[]) {
    102102        static char ether_buf[18] = {0, };
    103103        trace_ether_ntoa(mac, ether_buf);
     
    724724       
    725725        if (len > hdrlen) {
    726                 pld = (ieee80211_payload *) ((char *)pkt + hdrlen) ;
    727726                int payload_offset = 0;
    728727                uint16_t ethertype = 0;
     728                pld = (ieee80211_payload *) ((char *)pkt + hdrlen) ;
    729729                if (ntohs(pld->ethertype) == 0xaaaa) {
    730730                        /* 802.11 payload contains an 802.2 LLC/SNAP header */
Note: See TracChangeset for help on using the changeset viewer.