"Daniel" <(E-Mail Removed)> wrote in message
news

(E-Mail Removed)...
> Hi
>
> I want to add a "serial number" to outgoing IP packets.
> I'm working in the 2.4.20 kernel.
>
> This serial number will be added to every IP packet, transmitted through
> the ethernet NIC, and then decoded on the receiving end.
>
> The question is, how can I add a field to the IP header ?
> For the moment, ignore the problem of an unmodified kernel getting these
> packets- The specifics of my work ensure that the receiving machine does
> have my modified kernel installed.
>
> Can I simply add a "__u32 SerialNum" to the "struct iphdr" and expect it
> to work?
> Do I need to allocate more space? Where? How?
> Do I need to change the sending routines to handle this? How?
>
> Maybe there's a better way to add a field to a packet (such as adding a
> new header) ?
If you change the IP header, you'll probably break the protocols running on
top of the IP (like ICMP, TCP, UDP).
Why are you not able to use the standard ways of packet identification?
There is already a sequence number in the IP header.
Before changing, please read the RFC's of the protocols affected.
HTH
Tauno Voipio
tauno voipio @ iki fi