Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 161256 Details for
Bug 252139
getnameinfo does not support ipv6
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
getnameinfo test program
getaddrinfo.c (text/x-csrc), 1.23 KB, created by
Tomasz Kepczynski
on 2007-08-14 07:05:03 UTC
(
hide
)
Description:
getnameinfo test program
Filename:
MIME Type:
Creator:
Tomasz Kepczynski
Created:
2007-08-14 07:05:03 UTC
Size:
1.23 KB
patch
obsolete
>#include <sys/types.h> >#include <sys/socket.h> >#include <netdb.h> >#include <stdio.h> >#include <string.h> > >void dump_addrinfo(struct addrinfo const *a) >{ > char host[64] = { 0 }, port[16] = { 0 }; > int r; > printf("ai_flags = %#x\n" > "ai_family = %d\n" > "ai_socktype = %d\n" > "ai_protocol = %d\n" > "ai_addrlen = %zd\n" > "ai_canonname = %s\n" > "ai_next = %p\n", a->ai_flags, a->ai_family, a->ai_socktype, > a->ai_protocol, a->ai_addrlen, a->ai_canonname, a->ai_next); > r = getnameinfo(a->ai_addr, sizeof(*a->ai_addr), host, sizeof(host), > port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); > printf("ai_addr.sin_family = %d\n" > "ai_addr.sin_addr = %s\n" > "ai_addr.sin_port = %s\n", a->ai_addr->sa_family, host, port); > if(r) > printf("getnameinfo returned %d (%s)\n", r, gai_strerror(r)); > puts(""); >} > >int main() >{ > struct addrinfo *l, hint; > int r; > memset(&hint, 0, sizeof(hint)); > hint.ai_socktype = SOCK_STREAM; > hint.ai_flags = AF_UNSPEC | AI_CANONNAME; > r = getaddrinfo("www.ipv6.chello.com", "nntp", &hint, &l); > if(r == 0) > { > struct addrinfo *p; > for(p = l; p; p = p->ai_next) > dump_addrinfo(p); > freeaddrinfo(l); > } > else > printf("getaddrinfo returned %d (%s)\n", r, gai_strerror(r)); > return(0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 252139
: 161256