Commit 4787c975 authored by Rohit Gupta's avatar Rohit Gupta

delete files with GPL License + modify build scripts

parent 73aa2657
...@@ -880,6 +880,7 @@ set(UTIL_SRC ...@@ -880,6 +880,7 @@ set(UTIL_SRC
${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c ${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c
${OPENAIR2_DIR}/UTIL/OMG/rwalk.c ${OPENAIR2_DIR}/UTIL/OMG/rwalk.c
${OPENAIR2_DIR}/UTIL/OMG/rwp.c ${OPENAIR2_DIR}/UTIL/OMG/rwp.c
${OPENAIR2_DIR}/UTIL/OMG/sumo.c
${OPENAIR2_DIR}/UTIL/OMG/socket_traci_OMG.c ${OPENAIR2_DIR}/UTIL/OMG/socket_traci_OMG.c
${OPENAIR2_DIR}/UTIL/OMG/static.c ${OPENAIR2_DIR}/UTIL/OMG/static.c
${OPENAIR2_DIR}/UTIL/OMG/steadystaterwp.c ${OPENAIR2_DIR}/UTIL/OMG/steadystaterwp.c
...@@ -1797,7 +1798,6 @@ add_executable(oaisim_nos1 ...@@ -1797,7 +1798,6 @@ add_executable(oaisim_nos1
${OPENAIR_TARGETS}/SIMU/USER/oaisim.c ${OPENAIR_TARGETS}/SIMU/USER/oaisim.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR2_DIR}/UTIL/OMG/sumo.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
${HW_SOURCE} ${HW_SOURCE}
${TRANSPORT_SOURCE} ${TRANSPORT_SOURCE}
...@@ -1882,7 +1882,6 @@ foreach(myExe s1ap ...@@ -1882,7 +1882,6 @@ foreach(myExe s1ap
aes128_cmac_encrypt aes128_cmac_encrypt
secu_knas_encrypt_eia2) secu_knas_encrypt_eia2)
add_executable(test_${myExe} add_executable(test_${myExe}
${OPENAIR3_DIR}/TEST/test_util.c
${OPENAIR3_DIR}/TEST/test_${myExe}.c ${OPENAIR3_DIR}/TEST/test_${myExe}.c
) )
target_link_libraries (test_${myExe} target_link_libraries (test_${myExe}
......
...@@ -6,20 +6,6 @@ ...@@ -6,20 +6,6 @@
* By Gerald Combs <gerald@wireshark.org> * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs * Copyright 1998 Gerald Combs
* *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* This header file may also be distributed under * This header file may also be distributed under
* the terms of the BSD Licence as follows: * the terms of the BSD Licence as follows:
* *
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
* \date 2009 * \date 2009
* \version 0.1 * \version 0.1
* \company Eurecom * \company Eurecom
* \note This conde is under GNU GENERAL PUBLIC LICENSE, version 2, June 1991
* \email: navid.nikaein@eurecom.fr * \email: navid.nikaein@eurecom.fr
* \warning * \warning
*/ */
......
/**
** \file Ajp13Socket.h
** \date 2007-10-05
** \author grymse@alhem.net
**/
/*
Copyright (C) 2007-2010 Anders Hedstrom
This library is made available under the terms of the GNU GPL, with
the additional exemption that compiling, linking, and/or using OpenSSL
is allowed.
If you would like to use this library in a closed-source application,
a separate license agreement is available. For information about
the closed-source license agreement for the C++ sockets library,
please visit http://www.alhem.net/Sockets/license.html and/or
email license@alhem.net.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _SOCKETS_Ajp13Socket_H
#define _SOCKETS_Ajp13Socket_H
#include "AjpBaseSocket.h"
#include "HttpRequest.h"
#include "IHttpServer.h"
#include "HttpResponse.h"
#ifdef SOCKETS_NAMESPACE
namespace SOCKETS_NAMESPACE
{
#endif
class HttpResponse;
class Ajp13Socket : public AjpBaseSocket, public IHttpServer
{
public:
Ajp13Socket(ISocketHandler& h);
void OnHeader( short id, short len );
void OnPacket( const char *buf, size_t sz );
// implements IHttpServer::Respond
void Respond(const HttpResponse& res);
void OnTransferLimit();
private:
void ReceiveBody( const char *buf, size_t sz );
void ReceiveForwardRequest( const char *buf, size_t sz );
void ReceiveShutdown( const char *buf, size_t sz );
void ReceivePing( const char *buf, size_t sz );
void ReceiveCPing( const char *buf, size_t sz );
void Execute();
//
size_t m_body_size_left;
HttpRequest m_req;
HttpResponse m_res;
};
#ifdef SOCKETS_NAMESPACE
} // namespace SOCKETS_NAMESPACE {
#endif
#endif // _SOCKETS_Ajp13Socket_H
/**
** \file AjpBaseSocket.cpp
** \date 2007-10-05
** \author grymse@alhem.net
**/
/*
Copyright (C) 2007-2010 Anders Hedstrom
This library is made available under the terms of the GNU GPL, with
the additional exemption that compiling, linking, and/or using OpenSSL
is allowed.
If you would like to use this library in a closed-source application,
a separate license agreement is available. For information about
the closed-source license agreement for the C++ sockets library,
please visit http://www.alhem.net/Sockets/license.html and/or
email license@alhem.net.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef _MSC_VER
#pragma warning(disable:4786)
#endif
#include "AjpBaseSocket.h"
#include "ajp13.h"
#ifdef SOCKETS_NAMESPACE
namespace SOCKETS_NAMESPACE {
#endif
#ifdef _DEBUG
#define DEB(x) x
#else
#define DEB(x)
#endif
// ---------------------------------------------------------------------------
AjpBaseSocket::Initializer AjpBaseSocket::Init;
// ---------------------------------------------------------------------------
AjpBaseSocket::Initializer::Initializer()
{
Header[HTTP_REQUEST_ACCEPT] = "accept";
Header[HTTP_REQUEST_ACCEPT_CHARSET] = "accept-charset";
Header[HTTP_REQUEST_ACCEPT_ENCODING] = "accept-encoding";
Header[HTTP_REQUEST_ACCEPT_LANGUAGE] = "accept-language";
Header[HTTP_REQUEST_AUTHORIZATION] = "authorization";
Header[HTTP_REQUEST_CONNECTION] = "connection";
Header[HTTP_REQUEST_CONTENT_TYPE] = "content-type";
Header[HTTP_REQUEST_CONTENT_LENGTH] = "content-length";
Header[HTTP_REQUEST_COOKIE] = "cookie";
Header[HTTP_REQUEST_COOKIE2] = "cookie2";
Header[HTTP_REQUEST_HOST] = "host";
Header[HTTP_REQUEST_PRAGMA] = "pragma";
Header[HTTP_REQUEST_REFERER] = "referer";
Header[HTTP_REQUEST_USER_AGENT] = "user-agent";
Method[HTTP_METHOD_OPTIONS] = "OPTIONS";
Method[HTTP_METHOD_GET] = "GET";
Method[HTTP_METHOD_HEAD] = "HEAD";
Method[HTTP_METHOD_POST] = "POST";
Method[HTTP_METHOD_PUT] = "PUT";
Method[HTTP_METHOD_DELETE] = "DELETE";
Method[HTTP_METHOD_TRACE] = "TRACE";
Method[HTTP_METHOD_PROPFIND] = "PROPFIND";
Method[HTTP_METHOD_PROPPATCH] = "PROPPATCH";
Method[HTTP_METHOD_MKCOL] = "MKCOL";
Method[HTTP_METHOD_COPY] = "COPY";
Method[HTTP_METHOD_MOVE] = "MOVE";
Method[HTTP_METHOD_LOCK] = "LOCK";
Method[HTTP_METHOD_UNLOCK] = "UNLOCK";
Method[HTTP_METHOD_ACL] = "ACL";
Method[HTTP_METHOD_REPORT] = "REPORT";
Method[HTTP_METHOD_VERSION_CONTROL] = "VERSION_CONTROL"; // with a dash "VERSION-CONTROL"
Method[HTTP_METHOD_CHECKIN] = "CHECKIN";
Method[HTTP_METHOD_CHECKOUT] = "CHECKOUT";
Method[HTTP_METHOD_UNCHECKOUT] = "UNCHECKOUT";
Method[HTTP_METHOD_SEARCH] = "SEARCH";
Method[HTTP_METHOD_MKWORKSPACE] = "MKWORKSPACE";
Method[HTTP_METHOD_UPDATE] = "UPDATE";
Method[HTTP_METHOD_LABEL] = "LABEL";
Method[HTTP_METHOD_MERGE] = "MERGE";
Method[HTTP_METHOD_BASELINE_CONTROL] = "BASELINE_CONTROL";
Method[HTTP_METHOD_MKACTIVITY] = "MKACTIVITY";
Attribute[ATTR_CONTEXT] = "context";
Attribute[ATTR_SERVLET_PATH] = "servlet_path";
Attribute[ATTR_REMOTE_USER] = "remote_user";
Attribute[ATTR_AUTH_TYPE] = "auth_type";
Attribute[ATTR_QUERY_STRING] = "query_string";
Attribute[ATTR_ROUTE] = "route";
Attribute[ATTR_SSL_CERT] = "ssl_cert";
Attribute[ATTR_SSL_CIPHER] = "ssl_cipher";
Attribute[ATTR_SSL_SESSION] = "ssl_session";
Attribute[ATTR_SSL_KEY_SIZE] = "ssl_key_size";
Attribute[ATTR_SECRET] = "secret";
Attribute[ATTR_STORED_METHOD] = "stored_method";
ResponseHeader["content-type"] = 0xa001;
ResponseHeader["content-language"] = 0xa002;
ResponseHeader["content-length"] = 0xa003;
ResponseHeader["date"] = 0xa004;
ResponseHeader["last-modified"] = 0xa005;
ResponseHeader["location"] = 0xa006;
ResponseHeader["set-cookie"] = 0xa007;
ResponseHeader["set-cookie2"] = 0xa008;
ResponseHeader["servlet-engine"] = 0xa009;
ResponseHeader["status"] = 0xa00a;
ResponseHeader["www-authenticate"] = 0xa00b;
}
// ---------------------------------------------------------------------------
AjpBaseSocket::AjpBaseSocket(ISocketHandler& h) : TcpSocket(h)
, m_state(0)
, m_length(4)
, m_ptr(0)
{
}
// ---------------------------------------------------------------------------
void AjpBaseSocket::OnRawData(const char *buf, size_t sz)
{
DEB(fprintf(stderr, "OnRawData: %d bytes\n", sz);)
size_t ptr = 0;
while (true)
{
size_t left = sz - ptr;
DEB(fprintf(stderr, " left: %d bytes\n", left);
fprintf(stderr, " state: %d\n", m_state);)
switch (m_state)
{
case 0:
{
size_t missing = m_length - m_ptr;
short len = (short)(missing < left ? missing : left);
memcpy(m_message + m_ptr, buf + ptr, len);
m_ptr += len;
ptr += len;
if (m_ptr < m_length)
{
return; // read more
}
int p = 0;
short id = get_integer(m_message, p);
short length = get_integer(m_message, p);
OnHeader(id, length);
m_state = 1;
m_length = length;
m_ptr = 0; // bytes in m_message
}
break;
case 1:
{
size_t missing = m_length - m_ptr;
short len = (short)(missing < left ? missing : left);
memcpy(m_message + m_ptr, buf + ptr, len);
m_ptr += len;
ptr += len;
if (m_ptr < m_length)
{
return; // read more
}
OnPacket(m_message, m_ptr);
m_state = 0;
m_length = 4;
m_ptr = 0;
}
break;
}
}
}
// ---------------------------------------------------------------------------
unsigned char AjpBaseSocket::get_byte(const char *buf, int& ptr)
{
return (unsigned char)buf[ptr++];
}
// ---------------------------------------------------------------------------
bool AjpBaseSocket::get_boolean(const char *buf, int& ptr)
{
return ( (unsigned char)buf[ptr++] & 1) == 1 ? true : false;
}
// ---------------------------------------------------------------------------
short AjpBaseSocket::get_integer(const char *buf, int& ptr)
{
short n;
memcpy(&n, buf + ptr, 2);
ptr += 2;
return ntohs(n);
}
// ---------------------------------------------------------------------------
std::string AjpBaseSocket::get_string(const char *buf, int& ptr)
{
short len = get_integer(buf, ptr);
if (len != -1)
{
std::string tmp = buf + ptr;
ptr += len;
ptr++; // skip trailing 0x0
tmp.resize(len);
return tmp;
}
return "";
}
// ---------------------------------------------------------------------------
void AjpBaseSocket::put_byte(char *buf, int& ptr, unsigned char zz)
{
buf[ptr++] = zz;
}
// ---------------------------------------------------------------------------
void AjpBaseSocket::put_boolean(char *buf, int& ptr, bool zz)
{
buf[ptr++] = zz ? 1 : 0;
}
// ---------------------------------------------------------------------------
void AjpBaseSocket::put_integer(char *buf, int& ptr, short zz)
{
short tmp = htons(zz);
memcpy(buf + ptr, &tmp, 2);
ptr += 2;
}
// ---------------------------------------------------------------------------
void AjpBaseSocket::put_string(char *buf, int& ptr, const std::string& zz)
{
put_integer(buf, ptr, (short)zz.size() );
memcpy(buf + ptr, zz.c_str(), zz.size());
ptr += (int)zz.size();
put_byte(buf, ptr, 0);
}
#ifdef SOCKETS_NAMESPACE
} // namespace SOCKETS_NAMESPACE {
#endif
/**
** \file AjpBaseSocket.h
** \date 2007-10-05
** \author grymse@alhem.net
**/
/*
Copyright (C) 2007-2010 Anders Hedstrom
This library is made available under the terms of the GNU GPL, with
the additional exemption that compiling, linking, and/or using OpenSSL
is allowed.
If you would like to use this library in a closed-source application,
a separate license agreement is available. For information about
the closed-source license agreement for the C++ sockets library,
please visit http://www.alhem.net/Sockets/license.html and/or
email license@alhem.net.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _SOCKETS_AjpBaseSocket_H
#define _SOCKETS_AjpBaseSocket_H
#include "TcpSocket.h"
#include <map>
#include "Utility.h"
#ifdef SOCKETS_NAMESPACE
namespace SOCKETS_NAMESPACE
{
#endif
class AjpBaseSocket : public TcpSocket
{
class Initializer
{
public:
Initializer();
virtual ~Initializer() {}
std::map<int, std::string> Method;
std::map<int, std::string> Header;
std::map<int, std::string> Attribute;
Utility::ncmap<int> ResponseHeader;
};
public:
AjpBaseSocket(ISocketHandler& h);
void OnRawData(const char *buf, size_t sz);
virtual void OnHeader( short id, short len ) = 0;
virtual void OnPacket( const char *buf, size_t sz ) = 0;
protected:
unsigned char get_byte(const char *buf, int& ptr);
bool get_boolean(const char *buf, int& ptr);
short get_integer(const char *buf, int& ptr);
std::string get_string(const char *buf, int& ptr);
void put_byte(char *buf, int& ptr, unsigned char zz);
void put_boolean(char *buf, int& ptr, bool zz);
void put_integer(char *buf, int& ptr, short zz);
void put_string(char *buf, int& ptr, const std::string& zz);
static Initializer Init;
private:
int m_state;
int m_length;
int m_ptr;
char m_message[8192];
};
#ifdef SOCKETS_NAMESPACE
} // namespace SOCKETS_NAMESPACE {
#endif
#endif // _SOCKETS_AjpBaseSocket_H
/** \file Base64.cpp
** \date 2004-02-13
** \author grymse@alhem.net
**/
/*
Copyright (C) 2004-2010 Anders Hedstrom
This library is made available under the terms of the GNU GPL, with
the additional exemption that compiling, linking, and/or using OpenSSL
is allowed.
If you would like to use this library in a closed-source application,
a separate license agreement is available. For information about
the closed-source license agreement for the C++ sockets library,
please visit http://www.alhem.net/Sockets/license.html and/or
email license@alhem.net.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "Base64.h"
#include "IFile.h"
#ifdef SOCKETS_NAMESPACE
namespace SOCKETS_NAMESPACE {
#endif
const char *Base64::bstr =
"ABCDEFGHIJKLMNOPQ"
"RSTUVWXYZabcdefgh"
"ijklmnopqrstuvwxy"
"z0123456789+/";
const char Base64::rstr[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0,
0, 0, 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, 0, 0, 0, 0, 0,
0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0};
Base64::Base64()
{
}
void Base64::encode(IFile *fil, std::string& output, bool add_crlf)
{
size_t remain;
size_t i = 0;
size_t o = 0;
char input[4];
output = "";
remain = fil -> fread(input,1,3);
while (remain > 0)
{
if (add_crlf && o && o % 76 == 0)
output += "\n";
switch (remain)
{
case 1:
output += bstr[ ((input[i] >> 2) & 0x3f) ];
output += bstr[ ((input[i] << 4) & 0x30) ];
output += "==";
break;
case 2:
output += bstr[ ((input[i] >> 2) & 0x3f) ];
output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
output += bstr[ ((input[i + 1] << 2) & 0x3c) ];
output += "=";
break;
default:
output += bstr[ ((input[i] >> 2) & 0x3f) ];
output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ];
output += bstr[ (input[i + 2] & 0x3f) ];
}
o += 4;
//
remain = fil -> fread(input,1,3);
}
}