home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 13,104 of 14,669   
   Jorgen Grahn to lancer6238@yahoo.com   
   Re: Prepend Ethernet header   
   14 Oct 09 10:16:34   
   
   6a48a799   
   From: grahn+nntp@snipabacken.se   
      
   On Wed, 2009-10-14, lancer6238@yahoo.com wrote:   
   > Hi all,   
   >   
   > I'm looking for a way to prepend Ethernet headers to packets of the   
   > form   
   >   
   > IP -> payload   
   >   
   > and have the resulting packets (Eth -> IP -> payload) be of libpcap   
   > format.   
      
   Why?  If you just want to make a valid pcap(3) file of it, consider   
   the type DLT_RAW. That's a subformat where each packet is an IP packet   
   (or IPv6 I suppose), not a link-layer frame.  Tools should generally   
   accept that file format.   
      
   But maybe you need the link layer headers.   
      
   > I've used text2pcap before, but I don't want to have to convert the IP   
   > packets to text-form first.   
   >   
   > Is there anything in the libpcap library that could do this?   
      
   libpcap doesn't do much with the frames themselves ... but you can   
   earily use it to write a program which reads IP packets and writes   
   Ethernet frames by prepending a hand-made Ethernet header.   
      
   /Jorgen   
      
   --   
     // Jorgen Grahn    O  o   .   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca