Prima bozza per le routine dei socket e file rimasto indietro
authorSimone Piccardi <piccardi@gnulinux.it>
Wed, 24 Nov 2004 20:49:22 +0000 (20:49 +0000)
committerSimone Piccardi <piccardi@gnulinux.it>
Wed, 24 Nov 2004 20:49:22 +0000 (20:49 +0000)
listati/servent.h [new file with mode: 0644]
sources/SockAddr.c

diff --git a/listati/servent.h b/listati/servent.h
new file mode 100644 (file)
index 0000000..b810309
--- /dev/null
@@ -0,0 +1,6 @@
+struct servent {
+        char    *s_name;        /* official service name */
+        char    **s_aliases;    /* alias list */
+        int     s_port;         /* port number */
+        char    *s_proto;       /* protocol to use */
+}
index 9a585eb..9c10fab 100644 (file)
  */
 int tcp_addr(char * address, char * service, struct sockaddr * sa) 
 {
-    struct addrinfo hints;
+    struct addrinfo hints = {
+       ai_flag: AI_CANONNAME, 
+       ai_family: PF_UNSPEC,
+       ai_socktype: SOCK_STREAM,
+       ai_protocol: 7
+    }
     
 
     /* OK, exit */