00001 00006 /* purple 00007 * 00008 * Purple is the legal property of its developers, whose names are too numerous 00009 * to list here. Please refer to the COPYRIGHT file distributed with this 00010 * source distribution. 00011 * 00012 * Most code in nat-pmp.h copyright (C) 2007, R. Tyler Ballance, bleep, LLC. 00013 * This file is distributed under the 3-clause (modified) BSD license: 00014 * Redistribution and use in source and binary forms, with or without modification, are permitted 00015 * provided that the following conditions are met: 00016 * 00017 * Redistributions of source code must retain the above copyright notice, this list of conditions and 00018 * the following disclaimer. 00019 * Neither the name of the bleep. LLC nor the names of its contributors may be used to endorse or promote 00020 * products derived from this software without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 00023 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00024 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 00025 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00026 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00027 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00028 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 00029 * OF SUCH DAMAGE. 00030 */ 00031 00032 #ifndef _PURPLE_NAT_PMP_H 00033 #define _PURPLE_NAT_PMP_H 00034 00035 #include <glib.h> 00036 00037 #define PURPLE_PMP_LIFETIME 3600 /* 3600 seconds */ 00038 00039 typedef enum { 00040 PURPLE_PMP_TYPE_UDP, 00041 PURPLE_PMP_TYPE_TCP 00042 } PurplePmpType; 00043 00047 void purple_pmp_init(void); 00048 00052 char *purple_pmp_get_public_ip(void); 00053 00064 gboolean purple_pmp_create_map(PurplePmpType type, unsigned short privateport, unsigned short publicport, int lifetime); 00065 00074 gboolean purple_pmp_destroy_map(PurplePmpType type, unsigned short privateport); 00075 00076 #endif 00077