forked from pgul/binkd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iptools.h
31 lines (28 loc) · 971 Bytes
/
iptools.h
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
/*
* iptools.h -- Some useful TCP/IP utils
*
* iptools.h is a part of binkd project
*
* Copyright (C) 1997 Dima Maloff, 5047/13
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. See COPYING.
*/
/*
* Sets non-blocking mode for a given socket
*/
void setsockopts (SOCKET s);
/*
* Find the port number (in the host byte order) by a port number string or
* a service name. Find_port ("") will return binkp's port from
* /etc/services or even (if there is no binkp entry) 24554.
* Returns 0 on error.
*/
char * find_port (char *s);
/*
* address family agnostic comparison functions
*/
extern int sockaddr_cmp_addr(const struct sockaddr *, const struct sockaddr *);
extern int sockaddr_cmp_port(const struct sockaddr *, const struct sockaddr *);