Re: libnet question

Mike Schiffman <[email protected]>
Newsgroups gmane.comp.security.libnet
Message-ID <[email protected]>
I'm not sure I get you -- how are you saving these packets to a file? 
If you save the results of libnet_adv_cull_packet() you should be able 
to write it later using the same interface (libnet_adv_write_link())...

libnet_adv_cull_packet() calls libnet_pblock_coalesce() which performs 
a malloc(). There is a new function added to the latest RC: 
libnet_adv_free_packet() which will free the memory allocated bu 
libnet_adv_cull_packet().


On Feb 19, 2004, at 12:29 PM, Jeffrey H. Kaditz wrote:

> Mr. Schiffman,
>  Sorry to bother you again but I have another question that doesn't 
> seem
> to be documented anywhere out there. If I save the packets I create 
> with
> libnet to a file and then want to run the exact same sequence of 
> packets
> later, is there anyway I can just load the packets up and basically do
> the opposite of libnet_adv_cull_packet()? If there isn't and I was 
> going
> to hack this in to libnet can you tell me where to start?
>
> Lastly, what does libnet_adv_cull_packet() do with the char ** 
> argument.
> I have decided it doesn't allocate memory because the pointer doesn't
> change but why does it take a char **. Right now I have it working but 
> I
> want to make sure it doesn't do something unexpected and cause a 
> segfault
> under special circumstances.
>
> thanks again, this library is great and for the most part I have found 
> it
> to be extrememly well documented on the inet and in your book "Building
> Open Source Network Security Tools" .
>
> sincerely,
> Jeff Kaditz
>
>
>> Sure. You can easily tunnel. Just call the UDP builder twice.
>>
>> On Feb 12, 2004, at 5:34 PM, Jeffrey H Kaditz wrote:
>>
>>> Dear Mr. Schiffman,
>>>
>>> I have a question for you about using the libnet API. I am trying to
>>> write
>>> a little app to do certain test between two nodes. I would like to 
>>> have
>>> these nodes talk on a single port over udp but I want the payload
>>> inside
>>> the datagrams to be a wide variety of packet types. Essentially I 
>>> want
>>> to
>>> just tunnel via udp. Is there anyway I can use libnet for this? i.e.
>>> can I
>>> build a udp header and then another udp header underneath simply by
>>> calling build udp twice?
>>>
>>> If there is no way I fear having to re-create the efforts of libnet
>>> independently. Any suggestions or help would be greatly appreciated.
>>>
>>> thanks for your time,
>>> Jeffrey Kaditz
>>>
>>>
>>>
>>>
>>> <!DSPAM:402c2999288281462231038>
>>>
>>>
>>>
>> --
>> Mike Schiffman, CISSP
>> http://www.packetfactory.net/schiffman
>> Doveryay No Proveryay
>>
>>
>>
>
>
>
> <!DSPAM:40351cc0161786380815370>
>
>
>
--
Mike Schiffman, CISSP
http://www.packetfactory.net/schiffman
Doveryay No Proveryay
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.