File: sock.h

package info (click to toggle)
dancer-services 1.8.0.6.3-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,600 kB
  • ctags: 1,623
  • sloc: ansic: 34,690; sh: 2,850; makefile: 269
file content (74 lines) | stat: -rw-r--r-- 1,706 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * sock.h
 * Copyright (C) 1999 Patrick Alken
 *
 * $Id: sock.h,v 1.1.1.1 2001/03/03 01:48:53 wcampbel Exp $
 */

#ifndef INCLUDED_sock_h
#define INCLUDED_sock_h

#ifndef INCLUDED_netinet_in_h
#include <netinet/in.h>         /* struct sockaddr_in */
#define INCLUDED_netinet_in_h
#endif

#ifndef INCLUDED_sys_types_h
#include <sys/types.h>         /* time_t */
#define INCLUDED_sys_types_h
#endif

#ifndef INCLUDED_conf_h
#include "conf.h"         /* struct PortInfo */
#define INCLUDED_conf_h
#endif

#ifndef INCLUDED_config_h
#include "config.h"         /* HIGHTRAFFIC_MODE */
#define INCLUDED_config_h
#endif

/* number of bytes to read from sockets - used to be 8192 */
#define BUFSIZE        16384

/* max parameters the hub can send us */
#define MAXPARAM       15

/*
 * Prototypes
 */

int writesocket(int sockfd, char *str);
void toserv(char *format, ...);
void tosock(int sockfd, char *format, ...);
void SetupVirtualHost();
struct hostent *LookupHostname(char *host, struct in_addr *ip_address);
int ConnectHost(char *hostname, unsigned int port);
int CompleteHubConnection(struct Servlist *hubptr);
void ReadSocketInfo(void);
void DoListen(struct PortInfo *portptr);
int SetNonBlocking(int sockfd);
void SetSocketOptions(int sockfd);
void CycleServers();
void DoBinds();
void signon();

/*
 * External declarations
 */

extern int                      HubSock;
extern char                     *LocalHostName;
extern struct sockaddr_in       LocalAddr;

#ifdef HIGHTRAFFIC_MODE

extern int                      HTM;
extern time_t                   HTM_ts;
extern int                      ReceiveLoad;

#endif /* HIGHTRAFFIC_MODE */

extern int read_socket_done;

#endif /* INCLUDED_sock_h */