Created
November 25, 2013 19:01
-
-
Save fser/7646738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef __gnu_linux__ | |
#define SPORT source | |
#define DPORT dest | |
#else | |
#define SPORT th_sport | |
#define DPORT th_dport | |
#endif | |
// ... | |
switch(ip_next) | |
{ | |
case IPPROTO_TCP: | |
tcp_hdr = (struct tcphdr *)pkt_ptr; | |
sport = tcp_hdr->SPORT; | |
dport = tcp_hdr->DPORT; | |
break; | |
case IPPROTO_UDP: | |
udp_hdr = (struct udphdr *)pkt_ptr; | |
sport = udp_hdr->SPORT; | |
dport = udp_hdr->DPORT; | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment