Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

scan_ip6if(3) [debian man page]

scan_ip6if(3)						     Library Functions Manual						     scan_ip6if(3)

NAME
scan_ip6 - parse an IPv6 number and interface in ASCII representation SYNTAX
#include <ip6.h> int scan_ip6if(const char *src,char ip[16],uint32* scope_id); DESCRIPTION
scan_ip6if parses an IPv6 number in RFC1884 ASCII representation from src and writes the result into ip. If the IPv6 number is followed by the percent sign, scan_ip6if takes the word following that, tries to parse it as network interface and writes the result to scope_id. It returns the number of bytes read from src or 0 if the parsing failed. scan_ip6if accepts upper and lower case hex letters, it understands "::" compression and partial IPv4 addresses as in "::FFFF:129.144.52.38". To allow transparent usage of IPv4 in IPv6 applications, scan_ip6if also understands IPv4 addresses in dotted-decimal notation and will return an IPv4-mapped IPv6 address (i.e. "127.0.0.1" will be parsed as "::FFFF:127.0.0.1". Unlike many other IP parsing routines, scan_ip6if does not recognize octal (like 0177.0.0.1) or hexadecimal numbers (like 0x7f000001) in the IPv4 part. EXAMPLE
#include <str.h> #include <ip6.h> char buf[]="::1%lo"; char ip[16]; uint32 scope_id; if (scan_ip6if(buf,ip,&scope_id) != str_len(buf)) parse_error(); SEE ALSO
fmt_ip6(3), scan_ip4(3), fmt_ip6if(3) scan_ip6if(3)

Check Out this Related Man Page

socket_send6(3) 					     Library Functions Manual						   socket_send6(3)

NAME
socket_send6 - send a UDP datagram SYNTAX
#include <socket.h> ssize_t socket_send6(int s, const char* buf, size_t len, const char ip[16], uint16 port, uint32 scope_id); DESCRIPTION
socket_send6 sends len bytes starting at buf in a UDP datagram over the socket s to UDP port port on IP address ip. You can call socket_send6 without calling socket_bind6. This has the effect as first calling socket_bind6 with IP address :: and port 0. The meaning of scope_id is dependent on the implementation and IPv6 IP. On link-local IPv6 addresses it specifies the outgoing interface index. The name (e.g. "eth0") for a given interface index can be queried with getifname. scope_id should normally be set to 0. RETURN VALUE
socket_send6 returns 0 if the datagram was sent successfully. If not, it returns -1 and sets errno appropriately. EXAMPLE
#include <socket.h> int s; char ip[16]; uint16 p; uint32 scope_id; s = socket_tcp4(); socket_bind6(s,ip,p); socket_send6(s,"hello, world",12,ip,p,scope_id); SEE ALSO
socket_send4(3), socket_getifidx(3) socket_send6(3)
Man Page