version 1.75, 2001/05/18 15:16:10
|
version 1.76, 2001/05/18 19:15:00
|
Line 25
|
Line 25
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/msg.h> |
#include <sys/msg.h> |
#include <string.h> |
#include <string.h> |
|
#include <sys/socket.h> |
|
#include <netdb.h> |
|
|
int foo; |
int foo; |
|
|
int main(int argc,char *argv[]) { |
int main(int argc,char *argv[]) { |
|
struct addrinfo *ai; |
|
printf("%d\n",getaddrinfo("knuth.fefe.de","ssh",0,&ai)); |
|
while (ai) { |
|
printf("found host %s, port %d, family %s, socktype %s\n",ai->ai_canonname, |
|
ntohs(ai->ai_family==AF_INET6?((struct sockaddr_in6*)ai->ai_addr)->sin6_port: |
|
((struct sockaddr_in*)ai->ai_addr)->sin_port), |
|
ai->ai_family==AF_INET6?"PF_INET6":"PF_INET", |
|
ai->ai_socktype==SOCK_STREAM?"SOCK_STREAM":"SOCK_DGRAM"); |
|
ai=ai->ai_next; |
|
} |
|
#if 0 |
int i=foo; |
int i=foo; |
printf("load average is %3.2f\n",0.0); |
printf("load average is %3.2f\n",0.0); |
|
#endif |
#if 0 |
#if 0 |
struct dirent **namelist; |
struct dirent **namelist; |
int n; |
int n; |