File src/upnp.c

Copyright (c) 2005-2007, Thomas BERNARD All rights reserved.
Copyright (c) 2007-2010 Dirk Meyer
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
$Id: upnp.c,v 1.14 2011/12/03 12:57:37 cvs Exp $


Included Files

include the headers


Preprocessor definitions

#define _LONGLONG 1

Local Variables

urls
static struct UPNPUrls urls
Used in: init_upnp()  
  upnp_add_redir()  
  upnp_get_dccip()  
  upnp_rem_redir()  

data
static struct IGDdatas data

Used in: init_upnp()  
  upnp_add_redir()  
  upnp_get_dccip()  
  upnp_rem_redir()  

externalIPAddress
static char externalIPAddress[32]

Used in: upnp_get_dccip()  

Global Function init_upnp()

void init_upnp ( void )
Prototyped in: src/upnp.h
Calls: ioutput() src/iroffer_utilities.c
  tostdout_write() src/iroffer_display.c
  GetUPNPUrls(), free(), freeUPNPDevlist(), memset(), miniwget(), parserootdesc(), strstr(), upnpDiscover()
Called by: config_dinoex() src/dinoex_misc.c
References Variables: data src/upnp.c
  urls src/upnp.c

Global Function upnp_add_redir()

void upnp_add_redir ( const char* addr, const char* port )
Prototyped in: src/upnp.h
Calls: ioutput() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  UPNP_AddPortMapping()
Called by: my_get_upnp_data() src/dinoex_irc.c
References Variables: data src/upnp.c
  urls src/upnp.c

Global Function upnp_get_dccip()

char* upnp_get_dccip ( void )
Prototyped in: src/upnp.h
Calls: UPNP_GetExternalIPAddress()
Called by: update_server_welcome() src/dinoex_irc.c
References Variables: data src/upnp.c
  externalIPAddress src/upnp.c
  urls src/upnp.c

Global Function upnp_rem_redir()

void upnp_rem_redir ( int port )
Prototyped in: src/upnp.h
Calls: ioutput() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  UPNP_DeletePortMapping(), snprintf()
Called by: l_closeconn() src/iroffer_upload.c
  shutdowndccchat() src/iroffer_dccchat.c
  t_closeconn() src/iroffer_transfer.c
References Variables: data src/upnp.c
  urls src/upnp.c