2 * IRC - Internet Relay Chat, include/uping.h
3 * Copyright (C) 1995 Carlo Wood
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef INCLUDED_uping_h
22 #define INCLUDED_uping_h
23 #ifndef INCLUDED_sys_types_h
24 #include <sys/types.h>
25 #define INCLUDED_sys_types_h
27 #ifndef INCLUDED_netinet_in_h
28 #include <netinet/in.h>
29 #define INCLUDED_netinet_in_h
31 #ifndef INCLUDED_ircd_defs_h
32 #include "ircd_defs.h"
39 struct UPing* next; /* next ping in list, usually null */
40 int fd; /* socket file descriptor */
41 struct sockaddr_in sin; /* socket name (ip addr, port, family ) */
42 char count; /* number of pings requested */
43 char sent; /* pings sent */
44 char received; /* pings received */
45 char active; /* ping active flag */
46 struct Client* client; /* who requested the pings */
47 time_t lastsent; /* when last ping was sent */
48 time_t timeout; /* current ping timeout time */
49 int ms_min; /* minimum time in milliseconds */
50 int ms_ave; /* average time in milliseconds */
51 int ms_max; /* maximum time in milliseconds */
52 int index; /* index into poll array */
53 char name[HOSTLEN + 1]; /* server name to poing */
54 char buf[BUFSIZE]; /* buffer to hold ping times */
58 /*=============================================================================
62 extern int setup_ping(void);
63 extern void polludp(int fd);
64 extern void send_ping(struct UPing* pptr);
65 extern void read_ping(struct UPing* pptr);
66 extern int m_uping(struct Client *cptr, struct Client *sptr, int parc, char* parv[]);
67 extern void end_ping(struct UPing* pptr);
68 extern void cancel_ping(struct Client *sptr, struct Client *acptr);
69 extern struct UPing* pings_begin(void);
72 extern void uping_mark_blocks(void);
75 #endif /* INCLUDED_uping_h */