Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. .TH socket_send6 3
  2. .SH NAME
  3. socket_send6 \- send a UDP datagram
  5. .B #include <socket.h>
  6. int \fBsocket_send6\fP(int \fIs\fR, const char* \fIbuf\fR, unsigned int \fIlen\fR,
  7. const char \fIip\fR[16], uint16 \fIport\fR, uint32 \fIscope_id\fR);
  9. socket_send6 sends \fIlen\fR bytes starting at \fIbuf\fR in a UDP
  10. datagram over the socket \fIs\fR to UDP port \fIport\fR on IP address
  11. \fIip\fR.
  12. You can call socket_send6 without calling socket_bind4. This has the
  13. effect as first calling socket_bind4 with IP address :: and port 0.
  14. The meaning of \fIscope_id\fR is dependent on the implementation and
  15. IPv6 IP. On link-local IPv6 addresses it specifies the outgoing
  16. interface index. The name (e.g. "eth0") for a given interface index can
  17. be queried with getifname. \fIscope_id\fR should normally be set to 0.
  19. socket_send6 returns 0 if the datagram was sent successfully. If not,
  20. it returns -1 and sets errno appropriately.
  22. #include <socket.h>
  23. int \fIs\fR;
  24. char \fIip\fR[16];
  25. uint16 \fIp\fR;
  26. uint32 \fIscope_id\fR;
  27. \fIs\fR = socket_tcp();
  28. socket_bind6(s,ip,p);
  29. socket_send6(s,"hello, world",12,ip,p,scope_id);
  30. .SH "SEE ALSO"
  31. socket_send4(3), socket_getifidx(3)