+ // Get Interface (allowing broadcasts)
+ iface = IPv4_GetInterface(Adapter, hdr->Destination, 1);
+
+ // Firewall rules
+ if( iface ) {
+ // Incoming Packets
+ ret = IPTablesV4_TestChain("INPUT",
+ &hdr->Source, &hdr->Destination,
+ hdr->Protocol, 0,
+ dataLength, data
+ );
+ }
+ else {
+ // Routed packets
+ ret = IPTablesV4_TestChain("FORWARD",
+ &hdr->Source, &hdr->Destination,
+ hdr->Protocol, 0,
+ dataLength, data
+ );
+ }
+ switch(ret)
+ {
+ // 0 - Allow
+ case 0: break;
+ // 1 - Silent Drop
+ case 1:
+ Log_Debug("IPv4", "Silently dropping packet");
+ return ;
+ // Unknown, silent drop
+ default:
+ return ;
+ }
+
+ // Routing
+ if(!iface)
+ {
+ Log_Debug("IPv4", "Route the packet");
+
+ // TODO: Parse Routing tables and determine where to send it
+
+ return ;
+ }
+