File: natpmp.h

package info (click to toggle)
miniupnpd 2.1-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,896 kB
  • sloc: ansic: 24,231; sh: 1,414; makefile: 349
file content (35 lines) | stat: -rw-r--r-- 1,330 bytes parent folder | download | duplicates (6)
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
32
33
34
35
/* $Id: natpmp.h,v 1.13 2014/05/19 13:38:03 nanard Exp $ */
/* MiniUPnP project
 * author : Thomas Bernard
 * website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
 */
#ifndef NATPMP_H_INCLUDED
#define NATPMP_H_INCLUDED

/* The NAT-PMP specification which can be found at the url :
 * http://files.dns-sd.org/draft-cheshire-nat-pmp.txt
 * draft version 3 of April 2008
 * define 5351 as listening port for the gateway,
 * and the 224.0.0.1 port 5350 as the local link
 * multicast address for address change announces.
 * Previous versions of the specification defined 5351
 * as the port for address change announces. */
#define NATPMP_PORT (5351)
#define NATPMP_NOTIF_PORT	(5350)
#define NATPMP_NOTIF_ADDR	("224.0.0.1")

int OpenAndConfNATPMPSockets(int * sockets);

/* receiveraddr is only used with IPV6 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);

void SendNATPMPPublicAddressChangeNotification(int * sockets, int n_sockets);

#endif