File: client.h

package info (click to toggle)
pen 0.34.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 836 kB
  • sloc: ansic: 6,364; sh: 1,552; makefile: 38
file content (24 lines) | stat: -rw-r--r-- 556 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
#include <time.h>
#include <stdint.h>
#ifndef WINDOWS
#include <sys/socket.h>
#else
#include <winsock2.h>
#endif

#define CLIENTS_MAX	2048	/* max clients */
#define TRACKING_TIME	0	/* how long a client is remembered */

typedef struct {
	time_t last;		/* last time this client made a connection */
	struct sockaddr_storage addr;
	int server;		/* server used last time */
	long connects;
	uint64_t csx, crx;
} client;

extern client *clients;
extern int clients_max;

extern int store_client(struct sockaddr_storage *);
extern void expand_clienttable(int);