OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [net/] [tcpip/] [v2_0/] [doc/] [getserv.html] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
<html>
2
<body>
3
<pre>
4
NAME
5
       getservent, getservbyname, getservbyport - get service entry
6
 
7
SYNOPSIS
8
       #include &lt;network.h&gt;
9
 
10
       struct servent *getservbyname(const char *name, const char *proto);
11
 
12
       struct servent *getservbyport(int port, const char *proto);
13
 
14
DESCRIPTION
15
       The  getservbyname()  function returns a servent structure
16
       for the line from /etc/services that matches  the  service
17
       name using protocol proto.
18
 
19
       The  getservbyport()  function returns a servent structure
20
       for the line that matches the port port given  in  network
21
       byte order using protocol proto.
22
 
23
       The servent structure is defined in &lt;netdb.h&gt; as follows:
24
 
25
              struct servent {
26
                      char    *s_name;        /* official service name */
27
                      char    **s_aliases;    /* alias list */
28
                      int     s_port;         /* port number */
29
                      char    *s_proto;       /* protocol to use */
30
              }
31
 
32
       The members of the servent structure are:
33
 
34
       s_name The official name of the service.
35
 
36
       s_aliases
37
              A zero terminated list of alternative names for the
38
              service.
39
 
40
       s_port The  port  number  for the service given in network
41
              byte order.
42
 
43
       s_proto
44
              The name of the protocol to use with this  service.
45
 
46
RETURN VALUE
47
       The   getservbyname()  and  getservbyport()
48
       functions return the servent structure, or a NULL  pointer
49
       if an error occurs.
50
 
51
 
52
</pre>
53
</body>
54
</html>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.