Changeset 1669 for trunk/src/common/sendpacket.c
- Timestamp:
- 02/07/07 19:35:27 (2 years ago)
- Files:
-
- 1 modified
-
trunk/src/common/sendpacket.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/sendpacket.c
r1641 r1669 86 86 #include <unistd.h> 87 87 88 #if definedHAVE_PF_PACKET88 #ifdef HAVE_PF_PACKET 89 89 #include <fcntl.h> 90 90 #include <sys/socket.h> … … 104 104 static int get_iface_index(int fd, const int8_t *device, char *); 105 105 106 #elif defined HAVE_BPF 106 #endif /* HAVE_PF_PACKET */ 107 108 #ifdef HAVE_BPF 107 109 #include <net/bpf.h> 108 110 #include <sys/socket.h> … … 112 114 #include <net/if_dl.h> // used for get_hwaddr_bpf() 113 115 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 116 static sendpacket_t *sendpacket_open_bpf(const char *, char *) __attribute__((unused)); 117 static struct tcpr_ether_addr *sendpacket_get_hwaddr_bpf(sendpacket_t *) __attribute__((unused)); 118 119 #endif /* HAVE_BPF */ 120 121 #ifdef HAVE_LIBNET 122 static sendpacket_t *sendpacket_open_libnet(const char *, char *) __attribute__((unused)); 123 static 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) 122 128 #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 129 static sendpacket_t *sendpacket_open_pcap(const char *, char *) __attribute__((unused)); 130 static struct tcpr_ether_addr *sendpacket_get_hwaddr_pcap(sendpacket_t *) __attribute__((unused)); 131 #endif /* HAVE_PCAP_INJECT || HAVE_PACKET_SENDPACKET */ 126 132 127 133 static void sendpacket_seterr(sendpacket_t *sp, const char *fmt, ...); … … 267 273 268 274 /* 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) 270 276 return &sp->ether; 271 277 … … 338 344 return NULL; 339 345 } 340 #endif 346 #endif /* HAVE_PCAP_INJECT || HAVE_PCAP_SENDPACKET */ 341 347 342 348 #if defined HAVE_LIBNET 343 static sendpacket_t * 349 static sendpacket_t * 344 350 sendpacket_open_libnet(const char *device, char *errbuf) 345 351 { … … 375 381 return(&sp->ether); 376 382 } 377 #endif 383 #endif /* HAVE_LIBNET */ 378 384 379 385 #if defined HAVE_PF_PACKET … … 528 534 return(&sp->ether); 529 535 } 530 #endif 536 #endif /* HAVE_PF_PACKET */ 531 537 532 538 #if defined HAVE_BPF … … 691 697 } 692 698 693 #endif 699 #endif /* HAVE_BPF */
