Re: getting context stats before acutally writing it to wire.
Mike Schiffman <[email protected]>
| Newsgroups | gmane.comp.security.libnet |
|---|---|
| Message-ID | <[email protected]> |
Currently no function exists to do exactly what you want, but you can use the advanced interface to pull the packet from the context (along with its size). libnet_adv_cull_packet(); will do this for you. You'd have to make a corresponding call to libnbet_adv_free_packet(); tho since there is an implicit malloc(). If there's enough interest in being able to do this, I'll write a quick function libnet_get_packet_size() or something to run through the pblock list and get the current packet size without all the extra cruft. The libnet stats stuff is used to track bytes and packets already written. That being said, I'll whip up a quick function libnet_getpacket_ On Feb 19, 2004, at 6:40 PM, Mathew Pham wrote: > > > HI, > I was wondering is there a way to obtain the stats of packet, before > writing it to the wire ? for example I want the size in bytes of a > packet before I write it. > > The purpose of this is so I can queue packets in a context queue to a > certain size. When the size of the packets in the queue reaches a > certain limit, then I will write the whole queue to wire. > > I've seen libnet_stats but not sure how to use it, some help please ? > > > <!DSPAM:40359d51237917436020326> > > > -- Mike Schiffman, CISSP http://www.packetfactory.net/schiffman Doveryay No Proveryay