Subversion Repositories SvarDOS

Rev

Rev 329 | Rev 616 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 329 Rev 333
Line 5... Line 5...
5
 
5
 
6
 
6
 
7
#ifndef libtcp_hdr
7
#ifndef libtcp_hdr
8
#define libtcp_hdr
8
#define libtcp_hdr
9
 
9
 
10
struct net_tcpsocket {
-
 
11
  int s;       /* used by platforms with BSD-style sockets */
-
 
12
  void *sock;  /* used by other exotic things (like Watt-32) */
10
struct net_tcpsocket; /* opaque struct, exact implementation in net.c */
13
  char buffer[1];
-
 
14
};
-
 
15
 
11
 
16
/* resolves name and fills resovled addr into ip. returns 0 on success. */
12
/* resolves name and fills resovled addr into ip. returns 0 on success. */
17
int net_dnsresolve(char *ip, const char *name);
13
int net_dnsresolve(char *ip, const char *name);
18
 
14
 
19
/* must be called before using libtcp. returns 0 on success, or non-zero if network subsystem is not available. */
15
/* must be called before using libtcp. returns 0 on success, or non-zero if network subsystem is not available. */
Line 39... Line 35...
39
int net_recv(struct net_tcpsocket *socket, void *buff, long maxlen);
35
int net_recv(struct net_tcpsocket *socket, void *buff, long maxlen);
40
 
36
 
41
/* Close the 'sock' socket. */
37
/* Close the 'sock' socket. */
42
void net_close(struct net_tcpsocket *socket);
38
void net_close(struct net_tcpsocket *socket);
43
 
39
 
44
/* Close the 'sock' socket immediately (to be used when the peer is behaving wrongly) - this is much faster than net_close(). */
-
 
45
void net_abort(struct net_tcpsocket *socket);
-
 
46
 
-
 
47
/* Returns an info string about the networking engine being used */
40
/* Returns an info string about the networking engine being used */
48
const char *net_engine(void);
41
const char *net_engine(void);
49
 
42
 
50
#endif
43
#endif