Re: Sending an IP packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 22 Feb 2013 17:15:35 +0200, you said:

> I am trying to implement a new protocol that we've designed which works on
> top of the IP layer, so I am using ICMP messages to carry control
> information for the protocol.
> Why using ICMP, it seemed natural since our protocol is a Network-layer
> protocol and ICMP is a control messages protocol.

In that case, you *really* want to go look at how TCP and SCTP and other
protocols handle ICMP integration.  You want an API that integrates your ICMP
handling with the rest of the protocol stack, because otherwise you'll
end up with an unmaintainable mess.  Also, it will be about 436 times easier
to extend your protocol to work correctly over IPv6. :)

Go look at net/ipv4/udp.c, functions __udp4_lib_err() and __udp_lib_rcv(),
particularly the latter's use of icmp_send().  You'll want to extend icmp_send()
to handle your additional control information.

Attachment: pgpgrevYo4KIY.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux