View | Details | Raw Unified
Collapse All | Expand All

(-) gateway-1.4.0.orig/gw/bb_udp.c (-5 / +5 lines)
 Lines 78-84    Link Here 
#include "gwlib/gwlib.h"
#include "gwlib/gwlib.h"
#include "msg.h"
#include "msg.h"
#include "bearerbox.h"
#include "bearerbox.h"
#include "custports.h"
/* passed from bearerbox core */
/* passed from bearerbox core */
extern volatile sig_atomic_t bb_status;
extern volatile sig_atomic_t bb_status;
 Lines 352-364    Link Here 
    while (list_len(ifs) > 0) {
    while (list_len(ifs) > 0) {
        iface = list_extract_first(ifs);
        iface = list_extract_first(ifs);
	info(0, "Adding interface %s", octstr_get_cstr(iface));
	info(0, "Adding interface %s", octstr_get_cstr(iface));
        add_service(9200, octstr_get_cstr(iface));   /* wsp 	*/
        add_service(port_wsp, octstr_get_cstr(iface));   /* wsp 	*/
        add_service(9201, octstr_get_cstr(iface));   /* wsp/wtp	*/
        add_service(port_wtp, octstr_get_cstr(iface));   /* wsp/wtp	*/
    
    
#ifdef HAVE_WTLS_OPENSSL
#ifdef HAVE_WTLS_OPENSSL
        if (allow_wtls) {
        if (allow_wtls) {
             add_service(9202, octstr_get_cstr(iface));   /* wsp/wtls	*/
             add_service(port_wsps, octstr_get_cstr(iface));   /* wsp/wtls	*/
             add_service(9203, octstr_get_cstr(iface));   /* wsp/wtp/wtls */
             add_service(port_wtps, octstr_get_cstr(iface));   /* wsp/wtp/wtls */
        }
        }
#else
#else
        if (allow_wtls)
        if (allow_wtls)
(-) gateway-1.4.0.orig/gw/bearerbox.c (-1 / +2 lines)
 Lines 77-82    Link Here 
#include "bearerbox.h"
#include "bearerbox.h"
#include "shared.h"
#include "shared.h"
#include "dlr.h"
#include "dlr.h"
#include "custports.h"
/* global variables; included to other modules as needed */
/* global variables; included to other modules as needed */
 Lines 280-286    Link Here 
{
{
    static int started = 0;
    static int started = 0;
    if (started) return 0;
    if (started) return 0;
    udp_start(cfg);
    udp_start(cfg);
    start_wap(cfg);
    start_wap(cfg);
 Lines 353-358    Link Here 
    int ssl_enabled = 0;
    int ssl_enabled = 0;
#endif /* HAVE_LIBSSL */
#endif /* HAVE_LIBSSL */
    ReadCustomPorts(cfg);
    /* defaults: use localtime and markers for access-log */
    /* defaults: use localtime and markers for access-log */
    lf = m = 1;
    lf = m = 1;
	
	
(-) gateway-1.4.0.orig/gw/custports.c (+94 lines)
Line 0    Link Here 
/* ==================================================================== 
 * The Kannel Software License, Version 1.0 
 * 
 * Copyright (c) 2001-2004 Kannel Group  
 * Copyright (c) 1998-2001 WapIT Ltd.   
 * All rights reserved. 
 * 
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions 
 * are met: 
 * 
 * 1. Redistributions of source code must retain the above copyright 
 *    notice, this list of conditions and the following disclaimer. 
 * 
 * 2. 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. 
 * 
 * 3. The end-user documentation included with the redistribution, 
 *    if any, must include the following acknowledgment: 
 *       "This product includes software developed by the 
 *        Kannel Group (http://www.kannel.org/)." 
 *    Alternately, this acknowledgment may appear in the software itself, 
 *    if and wherever such third-party acknowledgments normally appear. 
 * 
 * 4. The names "Kannel" and "Kannel Group" must not be used to 
 *    endorse or promote products derived from this software without 
 *    prior written permission. For written permission, please  
 *    contact org@kannel.org. 
 * 
 * 5. Products derived from this software may not be called "Kannel", 
 *    nor may "Kannel" appear in their name, without prior written 
 *    permission of the Kannel Group. 
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 KANNEL GROUP OR ITS 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. 
 * ==================================================================== 
 * 
 * This software consists of voluntary contributions made by many 
 * individuals on behalf of the Kannel Group.  For more information on  
 * the Kannel Group, please see <http://www.kannel.org/>. 
 * 
 * Portions of this software are based upon software originally written at  
 * WapIT Ltd., Helsinki, Finland for the Kannel project.  
 */ 
/*
 * gw/custports.c
 *
 * Implementation of reading custom UDP ports used by wapbox
 *
 * Lubor Kolar <kolar@porcus.cz>, 14.03.2006
 */
 
#include <custports.h>
long port_wsp = 9200; // connectionless default
long port_wtp = 9201; // connection-oriented default
long port_wsps = 9202; // connectionless secure default
long port_wtps = 9203; // connection-oriented secure
void ReadCustomPorts(Cfg *config)
{
    CfgGroup *grp;
    grp = cfg_get_single_group(config, octstr_imm("wapbox"));
	         
    if(cfg_get_integer(&port_wsp, grp, octstr_imm("wsp-port")) != -1)
    {
	info(0, "Using custom WSP port %d", port_wsp);
    }
    if(cfg_get_integer(&port_wtp, grp, octstr_imm("wtp-port")) != -1)
    {
	info(0, "Using custom WSP/WTP port %d", port_wtp);
    }
    if(cfg_get_integer(&port_wsps, grp, octstr_imm("wsps-port")) != -1)
    {
	info(0, "Using custom WSP/WTLS port %d", port_wsps);
    }
    if(cfg_get_integer(&port_wtps, grp, octstr_imm("wtps-port")) != -1)
    {
	info(0, "Using custom WSP/WTP/WTLS port %d", port_wtps);
    }    
}
(-) gateway-1.4.0.orig/gw/custports.h (+77 lines)
Line 0    Link Here 
/* ==================================================================== 
 * The Kannel Software License, Version 1.0 
 * 
 * Copyright (c) 2001-2004 Kannel Group  
 * Copyright (c) 1998-2001 WapIT Ltd.   
 * All rights reserved. 
 * 
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions 
 * are met: 
 * 
 * 1. Redistributions of source code must retain the above copyright 
 *    notice, this list of conditions and the following disclaimer. 
 * 
 * 2. 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. 
 * 
 * 3. The end-user documentation included with the redistribution, 
 *    if any, must include the following acknowledgment: 
 *       "This product includes software developed by the 
 *        Kannel Group (http://www.kannel.org/)." 
 *    Alternately, this acknowledgment may appear in the software itself, 
 *    if and wherever such third-party acknowledgments normally appear. 
 * 
 * 4. The names "Kannel" and "Kannel Group" must not be used to 
 *    endorse or promote products derived from this software without 
 *    prior written permission. For written permission, please  
 *    contact org@kannel.org. 
 * 
 * 5. Products derived from this software may not be called "Kannel", 
 *    nor may "Kannel" appear in their name, without prior written 
 *    permission of the Kannel Group. 
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 KANNEL GROUP OR ITS 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. 
 * ==================================================================== 
 * 
 * This software consists of voluntary contributions made by many 
 * individuals on behalf of the Kannel Group.  For more information on  
 * the Kannel Group, please see <http://www.kannel.org/>. 
 * 
 * Portions of this software are based upon software originally written at  
 * WapIT Ltd., Helsinki, Finland for the Kannel project.  
 */ 
/*
 * gw/custports.h
 *
 * Implementation of wapbox custom UDP ports)
 *
 * Lubor Kolar <kolar@porcus.cz>, 14.03.2006
 */
#ifndef	CUSTPORTS_H
#define	CUSTPORTS_H 1
#include "gwlib/gwlib.h"
extern long port_wsp; // connectionless 
extern long port_wtp; // connection-oriented
extern long port_wsps; // connectionless secure
extern long port_wtps; // connection-oriented secure
void ReadCustomPorts(Cfg *config);
#endif /* CUSTPORTS_H */
(-) gateway-1.4.0.orig/gw/wap_push_ppg.c (-2 / +3 lines)
 Lines 88-93    Link Here 
#include "wap_push_pap_compiler.h"
#include "wap_push_pap_compiler.h"
#include "wap_push_pap_mime.h"
#include "wap_push_pap_mime.h"
#include "wap_push_ppg_pushuser.h"
#include "wap_push_ppg_pushuser.h"
#include "custports.h"
enum {
enum {
    TIME_EXPIRED = 0,
    TIME_EXPIRED = 0,
 Lines 1767-1776    Link Here 
    if (!cless_accepted) {
    if (!cless_accepted) {
        cliport = CONNECTED_CLIPORT;
        cliport = CONNECTED_CLIPORT;
        servport = CONNECTED_SERVPORT;
        servport = port_wtp;
    } else {
    } else {
        cliport = CONNECTIONLESS_PUSH_CLIPORT;
        cliport = CONNECTIONLESS_PUSH_CLIPORT;
        servport = CONNECTIONLESS_SERVPORT;
        servport = port_wsp;
    }
    }
    
    
    address_type = (**e).u.Push_Message.address_type;
    address_type = (**e).u.Push_Message.address_type;
(-) gateway-1.4.0.orig/gw/wap_push_ppg.h (-2 lines)
 Lines 167-175    Link Here 
 */
 */
enum {
enum {
    CONNECTIONLESS_PUSH_CLIPORT = 2948,
    CONNECTIONLESS_PUSH_CLIPORT = 2948,
    CONNECTIONLESS_SERVPORT = 9200,
    CONNECTED_CLIPORT = 9209,
    CONNECTED_CLIPORT = 9209,
    CONNECTED_SERVPORT = 9201
};
};
struct PPGSessionMachine {
struct PPGSessionMachine {
(-) gateway-1.4.0.orig/gw/wapbox.c (-16 / +15 lines)
 Lines 84-100    Link Here 
#include "gwlib/pki.h"
#include "gwlib/pki.h"
#endif
#endif
#include "radius/radius_acct.h"
#include "radius/radius_acct.h"
#include "custports.h"
static void config_reload(int reload);
static void config_reload(int reload);
static long logfilelevel=-1;
static long logfilelevel=-1;
enum {
    CONNECTIONLESS_PORT = 9200,
    CONNECTION_ORIENTED_PORT = 9201,
    WTLS_CONNECTIONLESS_PORT = 9202,
    WTLS_CONNECTION_ORIENTED_PORT = 9203
};
enum { DEFAULT_TIMER_FREQ = 1};
enum { DEFAULT_TIMER_FREQ = 1};
static Octstr *bearerbox_host;
static Octstr *bearerbox_host;
 Lines 128-133    Link Here 
    cfg_dump(cfg);
    cfg_dump(cfg);
    
    
    ReadCustomPorts(cfg);
    
    /*
    /*
     * Extract info from the core group.
     * Extract info from the core group.
     */
     */
 Lines 751-759    Link Here 
	     * XXXX here should be suspend/resume, add RSN
	     * XXXX here should be suspend/resume, add RSN
	     */
	     */
	} else if (msg_type(msg) == wdp_datagram) {
	} else if (msg_type(msg) == wdp_datagram) {
        switch (msg->wdp_datagram.destination_port) {
	if(msg->wdp_datagram.destination_port == port_wsp 
        case CONNECTIONLESS_PORT:
	   || msg->wdp_datagram.destination_port == port_wtp)
        case CONNECTION_ORIENTED_PORT:
	{
	    	dgram = wap_event_create(T_DUnitdata_Ind);
	    	dgram = wap_event_create(T_DUnitdata_Ind);
	    	dgram->u.T_DUnitdata_Ind.addr_tuple = wap_addr_tuple_create(
	    	dgram->u.T_DUnitdata_Ind.addr_tuple = wap_addr_tuple_create(
				msg->wdp_datagram.source_address,
				msg->wdp_datagram.source_address,
 Lines 764-782    Link Here 
	    	msg->wdp_datagram.user_data = NULL;
	    	msg->wdp_datagram.user_data = NULL;
          	wap_dispatch_datagram(dgram); 
          	wap_dispatch_datagram(dgram); 
			break;
	}
        case WTLS_CONNECTIONLESS_PORT:
	else
        case WTLS_CONNECTION_ORIENTED_PORT:
	if(msg->wdp_datagram.destination_port == port_wsps 
	   || msg->wdp_datagram.destination_port == port_wtps)
	{
#if (HAVE_WTLS_OPENSSL)
#if (HAVE_WTLS_OPENSSL)
            dgram = wtls_unpack_wdp_datagram(msg);
            dgram = wtls_unpack_wdp_datagram(msg);
            if (dgram != NULL)
            if (dgram != NULL)
                wtls_dispatch_event(dgram);
                wtls_dispatch_event(dgram);
#endif
#endif
			break;
	}
        default:
        else
	{
                panic(0,"Bad packet received! This shouldn't happen!");
                panic(0,"Bad packet received! This shouldn't happen!");
                break;
                break;
        } 
        } 	
	} else {
	} else {
	    warning(0, "Received other message than wdp/admin, ignoring!");
	    warning(0, "Received other message than wdp/admin, ignoring!");
	}
	}
(-) gateway-1.4.0.orig/gwlib/cfg.def (+4 lines)
 Lines 148-153    Link Here 
    OCTSTR(http-interface-name)
    OCTSTR(http-interface-name)
    OCTSTR(concatenation)
    OCTSTR(concatenation)
    OCTSTR(max-messages)
    OCTSTR(max-messages)
    OCTSTR(wsp-port)
    OCTSTR(wtp-port)
    OCTSTR(wsps-port)
    OCTSTR(wtps-port)
)
)