4 * @brief management of sockets
6 * receiver reads from here, sender writes to here
11 * Copyright (C) 2005 Jan Hutter, Martin Willi
12 * Hochschule fuer Technik Rapperswil
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as published by the
16 * Free Software Foundation; either version 2 of the License, or (at your
17 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
34 * maximum size of a packet
35 * 3000 Bytes should be sufficient, see IKEv2 draft
37 #define MAX_PACKET 3000
41 * @brief abstraction of one (ipv4), or in future, of multiple sockets
44 typedef struct socket_s socket_t
;
54 status_t (*receive
) (socket_t
*sock
, packet_t
**packet
);
64 status_t (*send
) (socket_t
*sock
, packet_t
*packet
);
74 status_t (*destroy
) (socket_t
*sock
);
83 socket_t
*socket_create(u_int16_t port
);