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
/* Testing forwarding packets to destination. */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/ip.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <linux/if_packet.h> |
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
/* Testing forwarding packets to destination. */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/ip.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <linux/if_packet.h> |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/ip.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <net/if.h> | |
#include <linux/if.h> |
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
#!/bin/bash | |
# Forwarding Server: | |
# IP - 10.50.0.3 | |
# Do DNAT to game server machine. | |
iptables -t nat -A PREROUTING -d 10.50.0.3 -p udp --dport 27015 -j DNAT --to-destination 10.50.0.4 | |
# Masquerade connections to game server machine (not sure if needed, can use SNAT rule as well if need to be). | |
iptables -t nat -A POSTROUTING -d 10.50.0.4 -j MASQUERADE |
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
// Payload match. | |
if (filter[i]->payloadLen > 0) | |
{ | |
// Initialize packet data. | |
for (uint16_t j = 0; j < MAX_PCKT_LENGTH; j++) | |
{ | |
if ((j + 1) > filter[i]->payloadLen) | |
{ | |
break; | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/sysinfo.h> | |
#include <netinet/in.h> | |
#include <net/if.h> | |
#include <linux/if.h> | |
#include <linux/if_ether.h> |
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
#include <linux/bpf.h> | |
#include <linux/bpf_common.h> | |
#include <inttypes.h> | |
#include <linux/if_ether.h> | |
#include <linux/ip.h> | |
#include <linux/icmp.h> | |
#include <linux/in.h> | |
#include "/home/dev/XDP-Firewall/libbpf/src/bpf_helpers.h" |
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
#include <linux/if_ether.h> | |
#include <linux/ip.h> | |
#include <linux/ipv6.h> | |
#include <linux/udp.h> | |
#include <linux/tcp.h> | |
#include <linux/icmp.h> | |
#include <linux/icmpv6.h> | |
#include <linux/in.h> | |
#include <inttypes.h> | |
#include <stdint.h> |
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
#include <linux/if_ether.h> | |
#include <linux/ip.h> | |
#include <linux/ipv6.h> | |
#include <linux/udp.h> | |
#include <linux/tcp.h> | |
#include <linux/icmp.h> | |
#include <linux/icmpv6.h> | |
#include <linux/in.h> | |
#include <inttypes.h> | |
#include <stdint.h> |
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
#include <stdio.h> | |
#include <inttypes.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <linux/if_ether.h> | |
#include <linux/ipv6.h> | |
#include <linux/udp.h> | |
#include <arpa/inet.h> | |
#include <sys/ioctl.h> | |
#include <net/if.h> |
OlderNewer