Show
Ignore:
Timestamp:
02/07/07 19:35:27 (2 years ago)
Author:
aturner
Message:

add attribute((unused)) to various functions/args to suppress warnings
refs #47

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/sendpacket.c

    r1641 r1669  
    8686#include <unistd.h> 
    8787 
    88 #if defined HAVE_PF_PACKET 
     88#ifdef HAVE_PF_PACKET 
    8989#include <fcntl.h> 
    9090#include <sys/socket.h> 
     
    104104static int get_iface_index(int fd, const int8_t *device, char *); 
    105105 
    106 #elif defined HAVE_BPF 
     106#endif /* HAVE_PF_PACKET */ 
     107 
     108#ifdef HAVE_BPF 
    107109#include <net/bpf.h> 
    108110#include <sys/socket.h> 
     
    112114#include <net/if_dl.h> // used for get_hwaddr_bpf() 
    113115 
    114 static sendpacket_t *sendpacket_open_bpf(const char *, char *); 
    115 static struct tcpr_ether_addr *sendpacket_get_hwaddr_bpf(sendpacket_t *); 
    116  
    117 #elif defined HAVE_LIBNET 
    118 static sendpacket_t *sendpacket_open_libnet(const char *, char *); 
    119 static struct tcpr_ether_addr *sendpacket_get_hwaddr_libnet(sendpacket_t *); 
    120  
    121 #elif defined HAVE_PCAP_INJECT || defined HAVE_PACKET_SENDPACKET 
     116static sendpacket_t *sendpacket_open_bpf(const char *, char *) __attribute__((unused)); 
     117static struct tcpr_ether_addr *sendpacket_get_hwaddr_bpf(sendpacket_t *) __attribute__((unused)); 
     118 
     119#endif /* HAVE_BPF */ 
     120 
     121#ifdef HAVE_LIBNET 
     122static sendpacket_t *sendpacket_open_libnet(const char *, char *) __attribute__((unused)); 
     123static struct tcpr_ether_addr *sendpacket_get_hwaddr_libnet(sendpacket_t *) __attribute__((unused)); 
     124 
     125#endif /* HAVE_LIBNET */ 
     126 
     127#if (defined HAVE_PCAP_INJECT || defined HAVE_PACKET_SENDPACKET) 
    122128#include <pcap.h> 
    123 static sendpacket_t *sendpacket_open_pcap(const char *, char *); 
    124 static struct tcpr_ether_addr *sendpacket_get_hwaddr_pcap(sendpacket_t *); 
    125 #endif 
     129static sendpacket_t *sendpacket_open_pcap(const char *, char *) __attribute__((unused)); 
     130static struct tcpr_ether_addr *sendpacket_get_hwaddr_pcap(sendpacket_t *) __attribute__((unused)); 
     131#endif /* HAVE_PCAP_INJECT || HAVE_PACKET_SENDPACKET */ 
    126132 
    127133static void sendpacket_seterr(sendpacket_t *sp, const char *fmt, ...); 
     
    267273     
    268274    /* if we already have our MAC address stored, just return it */ 
    269     if (memcmp(&sp->ether, "\00\00\00\00\00\00", ETHER_ADDR_LEN) != 0) 
     275    if (memcmp(&sp->ether, "\x00\x00\x00\x00\x00\x00", ETHER_ADDR_LEN) != 0) 
    270276        return &sp->ether; 
    271277         
     
    338344    return NULL; 
    339345} 
    340 #endif 
     346#endif /* HAVE_PCAP_INJECT || HAVE_PCAP_SENDPACKET */ 
    341347 
    342348#if defined HAVE_LIBNET 
    343 static sendpacket_t * 
     349static sendpacket_t *  
    344350sendpacket_open_libnet(const char *device, char *errbuf) 
    345351{ 
     
    375381    return(&sp->ether); 
    376382} 
    377 #endif 
     383#endif /* HAVE_LIBNET */ 
    378384 
    379385#if defined HAVE_PF_PACKET 
     
    528534    return(&sp->ether); 
    529535} 
    530 #endif 
     536#endif /* HAVE_PF_PACKET */ 
    531537 
    532538#if defined HAVE_BPF 
     
    691697} 
    692698 
    693 #endif 
     699#endif /* HAVE_BPF */