From: John Hodge Date: Thu, 8 Sep 2011 23:32:22 +0000 (+0800) Subject: IPStack - Fiddling with firewall X-Git-Tag: rel0.11~95 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=2e96a770732732677714d3b51a7e71ccd319500b;p=tpg%2Facess2.git IPStack - Fiddling with firewall --- diff --git a/Modules/IPStack/firewall.c b/Modules/IPStack/firewall.c index 9da14f61..b0390816 100644 --- a/Modules/IPStack/firewall.c +++ b/Modules/IPStack/firewall.c @@ -28,9 +28,9 @@ struct sFirewallMod const char *Name; int (*Match)(tModuleRule *Rule, int AddrType, - const void *Src, const void *Dest, - Uint8 Type, Uint32 Flags, - size_t Length, const void *Data); + const void *Src, const void *Dest, + Uint8 Type, Uint32 Flags, + size_t Length, const void *Data); tModuleRule *(*Create)(tKeyValue *Params); }; @@ -49,14 +49,14 @@ struct sRule tRule *Next; int PacketCount; // Number of packets seen - int ByteCount; // Number of bytes seen (IP Payload bytes) + int ByteCount; // Number of bytes seen (IP Payload bytes) int bInvertSource; // Boolean NOT flag on source void *Source; // Source address bytes int SourceMask; // Source address mask bits int bInvertDest; // Boolean NOT flag on destination - void *Dest; // Destination address bytes + void *Dest; // Destination address bytes int DestMask; // Destination address mask bits tModuleRule *Modules; // Modules loaded for this rule @@ -114,8 +114,7 @@ int IPTables_DoRule( { if( !modrule->Mod->Match ) continue; rv = modrule->Mod->Match(modrule, AddrType, Src, Dest, Type, Flags, Length, Data); - if(rv == -1) return -1; // no match - // TODO: If != 0 maybe, allowing it to ask for a drop? + if(rv != 0) return rv; // No match / action } // Update statistics @@ -127,7 +126,7 @@ int IPTables_DoRule( /** * \brief Tests an IPv4 chain on a packet - * \return Boolean Disallow (0: Packet Allowed, 1: Drop, 2: Reject, 3: Continue) + * \return Boolean Disallow (0: Packet Allowed, 1: Drop, 2: Reject, 3: Continue, -1 no match) */ int IPTables_TestChain( const char *RuleName, diff --git a/RunQemu b/RunQemu index bb94daf6..4a843068 100755 --- a/RunQemu +++ b/RunQemu @@ -5,7 +5,7 @@ QEMU=qemu-system-x86_64 USE_GDB= QEMU_PARAMS="-fda DiskImage.img -boot a" -QEMU_PARAMS=$QEMU_PARAMS" -hdb AcessHDD.img" +QEMU_PARAMS=$QEMU_PARAMS" -hda AcessHDD.img" QEMU_PARAMS=$QEMU_PARAMS" -vga std" QEMU_PARAMS=$QEMU_PARAMS" -smp 2" QEMU_PARAMS=$QEMU_PARAMS" -net nic"