Debian Codegraph @

src/fuzz_pingmac.c

raw symbols SCIP
1 #cxx . . $ `<file>/src/fuzz_pingmac.c`/define _GNU_SOURCEcxx . . $ `src/fuzz_pingmac.c:1:9`!
2
3 #include<arpa/inet.h>
4 #include<errno.h>
5 #include<string.h>
6 #include<stdio.h>
7 #include<stdlib.h>
8 #include<time.h>
9 #include<unistd.h>
10 #include<inttypes.h>
11
12 #include<pcap.h>
13
14 #include"arping.h"cxx . . $ `<file>/src/arping.h`/
15
16 extern char* payload_suffixcxx . . $ payload_suffix.;
17 extern size_t payload_suffix_sizecxx . . $ payload_suffix_size.;
18
19 int
20 maincxx . . $ main(d1b40a211a1a4e4c).()
21 {
22 const size_t maxpacket = 1500;
23 uint8_tcxx . . $ uint8_t#* const packet = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, maxpacket);
24 size_t packet_size = 0;
25
26 // Read packet.
27 {
28 uint8_tcxx . . $ uint8_t#* p = packet;
29 size_t size = maxpacket;
30 while (size > 0) {
31 const ssize_tcxx . . $ ssize_t# n = readcxx . . $ read(7e34d0a36f355389).(STDIN_FILENOcxx . . $ `<external>/12628407106812493757/unistd.h:210:9`!, p, size);
32 if (n == 0) {
33 break;
34 }
35 if (n < 0) {
36 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:159:9`!, "read(): %s\n", strerrorcxx . . $ strerror(ff224f080444ee45).(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!));
37 return 1;
38 }
39 size -= (size_t)n;
40 p += n;
41 }
42 packet_size = (size_t)(p - packet);
43 }
44
45 struct pcap_pkthdrcxx . . $ pcap_pkthdr# pkthdr;
46 pkthdr.tscxx . . $ pcap_pkthdr#ts..tv_seccxx . . $ timeval#tv_sec. = timecxx . . $ time(7f38134db6521d23).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
47 pkthdr.tscxx . . $ pcap_pkthdr#ts..tv_useccxx . . $ timeval#tv_usec. = 0;
48 pkthdr.lencxx . . $ pcap_pkthdr#len. = (uint32_tcxx . . $ uint32_t#)packet_size;
49 pkthdr.caplencxx . . $ pcap_pkthdr#caplen. = (uint32_tcxx . . $ uint32_t#)packet_size;
50
51 payload_suffixcxx . . $ payload_suffix. = calloccxx . . $ calloc(63a7bf2941bfcd7a).(payload_suffix_sizecxx . . $ payload_suffix_size., 1);
52 verbosecxx . . $ verbose. = 9;
53 dstipcxx . . $ dstip. = htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(0x12345678);
54 pingmac_recvcxx . . $ pingmac_recv(b10d88091b04c79).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, &pkthdr, packet);
55
56 freecxx . . $ free(5d22bdacc48458e8).(packet);
57 return 0;
58 }
59 /* ---- Emacs Variables ----
60 * Local Variables:
61 * c-basic-offset: 8
62 * indent-tabs-mode: nil
63 * End:
64 */