ip6pkt.tcp.th_win = htons(1234);
ip6pkt.tcp.th_sum = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
- s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+ s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
if (s == -1) {
DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
return -1;
ip6pkt.tcp.window = htons(1234);
ip6pkt.tcp.check = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
- s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+ s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
if (s == -1) {
DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
return -1;
ip6pkt.tcp.window = htons(1234);
ip6pkt.tcp.check = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
- s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+ s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
if (s == -1) {
DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
return -1;
switch (addr->ip.sin_family) {
case AF_INET:
- s = socket(PF_PACKET, SOCK_RAW, ETHERTYPE_ARP);
+ s = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_ARP);
if (s == -1){
DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
return -1;
close(s);
break;
case AF_INET6:
- s = socket(PF_PACKET, SOCK_RAW, ETHERTYPE_ARP);
+ s = socket(AF_PACKET, SOCK_RAW, ETHERTYPE_ARP);
if (s == -1){
DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
return -1;
ip6pkt.tcp.window = htons(1234);
ip6pkt.tcp.check = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
- s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+ s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
if (s == -1) {
DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
return -1;
int s;
struct ifreq ifr;
- s = socket(PF_PACKET, SOCK_RAW, 0);
+ s = socket(AF_PACKET, SOCK_RAW, 0);
if (s == -1){
/* We dont know if the interface exists, so assume yes */
DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n"));
port = atoi(argv[0]);
- s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+ s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (s == -1) {
printf("Failed to open local socket\n");
return errno;
}
bzero(&sin, sizeof(sin));
- sin.sin_family = PF_INET;
+ sin.sin_family = AF_INET;
sin.sin_port = htons(port);
ret = bind(s, (struct sockaddr *)&sin, sizeof(sin));
close(s);
int s;
struct sockaddr_in sock_in;
- s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (s == -1) {
printf("Failed to open local socket\n");
exit(10);
}
bzero(&sock_in, sizeof(sock_in));
- sock_in.sin_family = PF_INET;
+ sock_in.sin_family = AF_INET;
sock_in.sin_port = htons(port);
inet_aton(addr, &sock_in.sin_addr);
if (bind(s, (struct sockaddr *)&sock_in, sizeof(sock_in)) == -1) {
/* Setup a sockaddr_in for the client we want to notify */
bzero(&sock_cl, sizeof(sock_cl));
- sock_cl.sin_family = PF_INET;
+ sock_cl.sin_family = AF_INET;
sock_cl.sin_port = htons(clientport);
inet_aton(client, &sock_cl.sin_addr);