[root@TURMERIC udp-broadcast-relay]# make
c99 -Wall main.c -o udp-broadcast-relay
main.c:64:1: error: unknown type name ‘u_char’
static u_char gram[4096] = {
^
main.c: In function ‘main’:
main.c:80:2: error: unknown type name ‘u_char’
u_char id;
^
main.c:81:2: error: unknown type name ‘u_char’
u_char ttl;
^
main.c:100:2: error: unknown type name ‘u_char’
u_char pkt_infos[16384];
^
main.c:235:3: warning: implicit declaration of function ‘bcopy’ [-Wimplicit-function-declaration]
bcopy((struct sockaddr_in *) &reqbuf.ifr_addr,
^
main.c:316:4: error: ‘u_short’ undeclared (first use in this function)
*(u_short*)(gram + 22) = (u_short) htons(port);
^
main.c:316:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:316:12: error: expected expression before ‘)’ token
*(u_short*)(gram + 22) = (u_short) htons(port);
^
main.c:316:37: error: expected ‘;’ before ‘htons’
*(u_short*)(gram + 22) = (u_short) htons(port);
^
main.c:347:59: error: dereferencing pointer to incomplete type
rcv_ifindex = ((struct in_pktinfo *) CMSG_DATA(cmsg))->ipi_ifindex;
^
main.c:374:13: error: expected expression before ‘)’ token
*(u_short*)(gram + 20) = (u_short) rcv_addr.sin_port;
^
main.c:374:38: error: expected ‘;’ before ‘rcv_addr’
*(u_short*)(gram + 20) = (u_short) rcv_addr.sin_port;
^
main.c:377:13: error: expected expression before ‘)’ token
*(u_short*)(gram + 24) = htons(8 + len);
^
main.c:378:13: error: expected expression before ‘)’ token
*(u_short*)(gram + 2) = htons(28 + len);
^
main.c:392:21: error: expected expression before ‘)’ token
ntohs(*(u_short*) (gram + 22)), /* dst port */
^
make: *** [udp-broadcast-relay] Error 1
[root@TURMERIC udp-broadcast-relay]# c99 --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.