Commit Graph

5 Commits

Author SHA1 Message Date
Elie De Brauwer daf3eb0c70 sendmmsg.2: Add example program for sendmmsg()
The example uses sendmmsg() to send out a string "onetwo"
on a first datagram, where both halves originate from
distinct buffers and a second datagram contains "three",
coming from a single buffer.

Tested with netcat listening:
root@ubuntu:~# nc -l -u -p 1234
onetwothree

And tcpdump peeking:
root@ubuntu:~# tcpdump -c 2 -s 0 -X -ni lo tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
18:45:16.632134 IP 127.0.0.1.34715 > 127.0.0.1.1234: UDP, length 6
     0x0000:  4500 0022 c21c 4000 4011 7aac 7f00 0001  E.."..@.@.z.....
     0x0010:  7f00 0001 879b 04d2 000e fe21 6f6e 6574  ...........!onet
     0x0020:  776f                                     wo
18:45:16.633267 IP 127.0.0.1.34715 > 127.0.0.1.1234: UDP, length 5
     0x0000:  4500 0021 c21d 4000 4011 7aac 7f00 0001  E..!..@.@.z.....
     0x0010:  7f00 0001 879b 04d2 000d fe20 7468 7265  ............thre
     0x0020:  65                                       e
2 packets captured
4 packets received by filter
0 packets dropped by kernel

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-12-15 19:18:26 +01:00
Michael Kerrisk 706b0ab140 Removed trailing white space at end of lines 2012-02-27 14:14:12 +13:00
Michael Kerrisk 174428192d sendmmsg.2: minor changes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-02-27 11:11:48 +13:00
Michael Kerrisk 969d3d9e76 sendmmsg.2: srcfix: Added FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-02-27 11:10:11 +13:00
Michael Kerrisk 82c182484a sendmmsg.2: New page for sendmmsg(2)
Some pieces inspired by an initial attempt by Stephan Mueller.

Reported-by: Stephan Mueller <stephan.mueller@atsec.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2012-02-27 11:10:11 +13:00