LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
+LINT = splint
+LINTFLAGS = +quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t
+
COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS)
rm -f config.log config.status aclocal.m4 config.h.in configure Makefile
rm -f config.h
+lint:
+ $(LINT) $(LINTFLAGS) -I$(srcdir)/.. lua-rns.c ; \
+ if [ $$? -ne 0 ] ; then exit 1 ; fi
}
static int
-l_pkt_set_qdcount(lua_State *L)
+l_pkt_set_ancount(lua_State *L)
{
+ ldns_pkt *p = (ldns_pkt*)lua_touserdata(L, 1);
+ uint16_t count = (uint16_t) lua_tonumber(L, 2);
+ (void)ldns_pkt_set_ancount(p, count);
return 0;
}
{"ancount", l_pkt_ancount},
{"nscount", l_pkt_nscount},
{"arcount", l_pkt_arcount},
+ {"set_ancount", l_pkt_set_ancount},
#if 0
{"set_qdcount", l_pkt_set_qdcount},
- {"set_ancount", l_pkt_set_ancount},
{"set_nscount", l_pkt_set_nscount},
{"set_arcount", l_pkt_set_arcount},
#endif
wirebuf, sockaddr_from, fromlen = udp_read(socket) -- this works
--wirebuf, sockaddr_from, fromlen = udp.read(socket) -- this doesn't
+-- wrap this in new functions
if wirebuf == nil then
lua_debug("nothing received")
else
-- set the id on the outgoing packet
packet.set_id(pkt, id)
+ packet.set_ancount(pkt,
+ packet.ancount(pkt) + 1)
wirebuf2 = packet.to_buf(pkt)
rdf_listen, port_listen = rdf.sockaddr_to_rdf(sockaddr_from)