1 /* $Id: natpmp.h,v 1.13 2014/05/19 13:38:03 nanard Exp $ */
3 * author : Thomas Bernard
4 * website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
6 #ifndef NATPMP_H_INCLUDED
7 #define NATPMP_H_INCLUDED
9 /* The NAT-PMP specification which can be found at the url :
10 * http://files.dns-sd.org/draft-cheshire-nat-pmp.txt
11 * draft version 3 of April 2008
12 * define 5351 as listening port for the gateway,
13 * and the 224.0.0.1 port 5350 as the local link
14 * multicast address for address change announces.
15 * Previous versions of the specification defined 5351
16 * as the port for address change announces. */
17 #define NATPMP_PORT (5351)
18 #define NATPMP_NOTIF_PORT (5350)
19 #define NATPMP_NOTIF_ADDR ("224.0.0.1")
21 int OpenAndConfNATPMPSockets(int * sockets
);
23 /* receiveraddr is only used with IPV6 sockets */
24 int ReceiveNATPMPOrPCPPacket(int s
, struct sockaddr
* senderaddr
,
25 socklen_t
* senderaddrlen
,
26 struct sockaddr_in6
* receiveraddr
,
27 unsigned char * msg_buff
, size_t msg_buff_size
);
29 void ProcessIncomingNATPMPPacket(int s
, unsigned char * msg_buff
, int len
,
30 struct sockaddr_in
* senderaddr
);
32 void SendNATPMPPublicAddressChangeNotification(int * sockets
, int n_sockets
);