Monero
Loading...
Searching...
No Matches
pcpserver.h
Go to the documentation of this file.
1/* $Id: pcpserver.h,v 1.3 2014/03/24 10:49:46 nanard Exp $ */
2/* MiniUPnP project
3 * Website : http://miniupnp.free.fr/
4 * Author : Peter Tatrai
5
6Copyright (c) 2013 by Cisco Systems, Inc.
7All rights reserved.
8
9Redistribution and use in source and binary forms, with or without
10modification, are permitted provided that the following conditions are met:
11
12 * Redistributions of source code must retain the above copyright notice,
13 this list of conditions and the following disclaimer.
14 * Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
17 * The name of the author may not be used to endorse or promote products
18 derived from this software without specific prior written permission.
19
20THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef PCPSERVER_H_INCLUDED
34#define PCPSERVER_H_INCLUDED
35
36#define PCP_MIN_LEN 24
37#define PCP_MAX_LEN 1100
38
39struct sockaddr;
40
41/*
42 * receiveraddr is only used for IPV6
43 *
44 * returns 0 upon success 1 otherwise
45 */
46int ProcessIncomingPCPPacket(int s, unsigned char *msg_buff, int len,
47 const struct sockaddr *senderaddr,
48 const struct sockaddr_in6 *receiveraddr);
49
50/*
51 * returns the socket
52 */
54
55/*
56 * Send Unsolicited ANNOUNCE Message
57 */
58#ifdef ENABLE_IPV6
59void PCPSendUnsolicitedAnnounce(int * sockets, int n_sockets, int socket6);
60#else /* IPv4 only */
61void PCPSendUnsolicitedAnnounce(int * sockets, int n_sockets);
62#endif
63
64/*
65 * To be called when Public IP address changed (IPv4)
66 */
67#ifdef ENABLE_IPV6
68void PCPPublicAddressChanged(int * sockets, int n_sockets, int socket6);
69#else /* IPV4 Only */
70void PCPPublicAddressChanged(int * sockets, int n_sockets);
71#endif
72
73#endif /* PCPSERVER_H_INCLUDED */
#define s(x, c)
Definition aesb.c:47
int OpenAndConfPCPv6Socket(void)
int ProcessIncomingPCPPacket(int s, unsigned char *msg_buff, int len, const struct sockaddr *senderaddr, const struct sockaddr_in6 *receiveraddr)
void PCPSendUnsolicitedAnnounce(int *sockets, int n_sockets)
void PCPPublicAddressChanged(int *sockets, int n_sockets)