summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2012-06-25 13:17:57 -0700
committerSam Roberts <vieuxtech@gmail.com>2012-06-25 13:17:57 -0700
commit7ac7688f428eb994f1beac47f1ec61ce7450be06 (patch)
treeb90ad32c2620711a75e1aed10f9ba5cd46b75dfc
parent77d2a48a11e011e440fcaef7e646ac73e2c63bd3 (diff)
downloadlibnet-7ac7688f428eb994f1beac47f1ec61ce7450be06.tar.gz
urgent and ack number fields should be optional
-rw-r--r--lua/net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/net.c b/lua/net.c
index 6421749..48759ec 100644
--- a/lua/net.c
+++ b/lua/net.c
@@ -678,11 +678,11 @@ static int lnet_get_udp(lua_State *L)
src=port,
dst=port,
seq=int,
- ack=int,
flags=int,
win=int,
- urg=int,
-- optional arguments
+ ack=int,
+ urg=int,
ptag=int,
payload=str,
options=tcp_options,
@@ -697,10 +697,10 @@ static int lnet_tcp (lua_State *L)
int src = v_arg_integer(L, 2, "src");
int dst = v_arg_integer(L, 2, "dst");
int seq = v_arg_integer(L, 2, "seq");
- int ack = v_arg_integer(L, 2, "ack");
+ int ack = v_arg_integer_opt(L, 2, "ack", 0);
int flags = v_arg_integer(L, 2, "flags");
int win = v_arg_integer(L, 2, "win");
- int urg = v_arg_integer(L, 2, "urg");
+ int urg = v_arg_integer_opt(L, 2, "urg", 0);
int ptag = lnet_arg_ptag(L, ud, 2, LIBNET_PBLOCK_TCP_H);
uint32_t payloadsz = 0;
const uint8_t* payload = checkpayload(L, 2, &payloadsz);