diff options
| author | Root THC | 2026-02-24 12:42:47 +0000 |
|---|---|---|
| committer | Root THC | 2026-02-24 12:42:47 +0000 |
| commit | c9cbeced5b3f2bdd7407e29c0811e65954132540 (patch) | |
| tree | aefc355416b561111819de159ccbd86c3004cf88 /other/b-scan/tmp/include/bscan/network_raw.h | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'other/b-scan/tmp/include/bscan/network_raw.h')
| -rw-r--r-- | other/b-scan/tmp/include/bscan/network_raw.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/other/b-scan/tmp/include/bscan/network_raw.h b/other/b-scan/tmp/include/bscan/network_raw.h new file mode 100644 index 0000000..9ffed74 --- /dev/null +++ b/other/b-scan/tmp/include/bscan/network_raw.h | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | |||
| 2 | /* | ||
| 3 | * network_raw.h, depends on libnet.h | ||
| 4 | */ | ||
| 5 | |||
| 6 | |||
| 7 | #define ETH_SIZE 14 | ||
| 8 | #define IP_SIZE 20 | ||
| 9 | #define TCP_SIZE 20 | ||
| 10 | #define ICMP_SIZE 8 | ||
| 11 | #define UDP_SIZE 8 | ||
| 12 | |||
| 13 | /* | ||
| 14 | * Checksum stuff | ||
| 15 | */ | ||
| 16 | #define CKSUM_CARRY(x) \ | ||
| 17 | (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff)) | ||
| 18 | #define int_ntoa(x) inet_ntoa(*((struct in_addr *)&(x))) | ||
| 19 | |||
| 20 | |||
| 21 | /* | ||
| 22 | * leet net tuple | ||
| 23 | */ | ||
| 24 | struct net_tuple | ||
| 25 | { | ||
| 26 | uint32_t src; | ||
| 27 | unsigned short int sport; | ||
| 28 | uint32_t dst; | ||
| 29 | unsigned short int dport; | ||
| 30 | }; | ||
| 31 | |||
| 32 | |||
| 33 | /* | ||
| 34 | * pseudo TCP header for calculating the chksum | ||
| 35 | */ | ||
| 36 | struct _fakehead | ||
| 37 | { | ||
| 38 | uint32_t saddr; | ||
| 39 | uint32_t daddr; | ||
| 40 | uint8_t zero; | ||
| 41 | uint8_t protocol; | ||
| 42 | uint16_t tot_len; | ||
| 43 | }; | ||
| 44 | |||
| 45 | int init_network_raw (void); | ||
| 46 | int in_cksum (unsigned short *, int); | ||
| 47 | int send_ipv4 (int, u_char *, size_t); | ||
| 48 | void add_udphdr (unsigned char *, struct net_tuple *, int); | ||
| 49 | void add_tcphdr (unsigned char *, struct net_tuple *, uint8_t, int, | ||
| 50 | tcp_seq *, tcp_seq *); | ||
| 51 | void add_icmpping (unsigned char *, int, int); | ||
| 52 | void add_iphdr (unsigned char *, uint8_t ip_p, struct net_tuple *, int); | ||
| 53 | int answer_tcp (int, struct ip *, struct tcphdr *, uint8_t, u_char *, uint); | ||
| 54 | int vrfy_ip (struct ip *, uint32_t, u_short *); | ||
| 55 | int vrfy_tcp (struct tcphdr *, uint32_t, u_short *); | ||
| 56 | int decode_nvt(u_char *, uint, u_char *, uint *, u_char *, uint *); | ||
| 57 | |||
