Electroneum
natpmp.h
Go to the documentation of this file.
1 /* $Id: natpmp.h,v 1.12 2014/03/24 10:49:46 nanard Exp $ */
2 /* MiniUPnP project
3  * author : Thomas Bernard
4  * website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
5  */
6 #ifndef NATPMP_H_INCLUDED
7 #define NATPMP_H_INCLUDED
8 
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")
20 
21 int OpenAndConfNATPMPSockets(int * sockets);
22 
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);
28 
29 void ProcessIncomingNATPMPPacket(int s, unsigned char * msg_buff, int len,
30  struct sockaddr_in * senderaddr);
31 
32 void SendNATPMPPublicAddressChangeNotification(int * sockets, int n_sockets);
33 
34 #endif
35 
void SendNATPMPPublicAddressChangeNotification(int *sockets, int n_sockets)
int ReceiveNATPMPOrPCPPacket(int s, struct sockaddr *senderaddr, socklen_t *senderaddrlen, struct sockaddr_in6 *receiveraddr, unsigned char *msg_buff, size_t msg_buff_size)
void ProcessIncomingNATPMPPacket(int s, unsigned char *msg_buff, int len, struct sockaddr_in *senderaddr)
int OpenAndConfNATPMPSockets(int *sockets)