otg_tx_socket.h 3.64 KB
Newer Older
1
/*******************************************************************************
nikaeinn's avatar
nikaeinn committed
2 3
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom
4

nikaeinn's avatar
nikaeinn committed
5 6 7 8
    OpenAirInterface 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 3 of the License, or
    (at your option) any later version.
9 10


nikaeinn's avatar
nikaeinn committed
11 12 13 14
    OpenAirInterface 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.
15

nikaeinn's avatar
nikaeinn committed
16 17 18 19
    You should have received a copy of the GNU General Public License
    along with OpenAirInterface.The full GNU General Public License is
    included in this distribution in the file called "COPYING". If not,
    see <http://www.gnu.org/licenses/>.
20 21

  Contact Information
nikaeinn's avatar
nikaeinn committed
22 23 24 25
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
  OpenAirInterface Dev  : openair4g-devel@eurecom.fr

ghaddab's avatar
ghaddab committed
26
  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
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 52 53 54 55 56 57

*******************************************************************************/

/*! \file otg_tx_socket.h
* \brief brief explain how this block is organized, and how it works: OTG TX traffic generation functions with sockets
* \author A. Hafsaoui
* \date 2012
* \version 0.1
* \company Eurecom
* \email: openair_tech@eurecom.fr
* \note
* \warning
*/

#ifndef __OTG_TX_SOCKET_H__
#define __OTG_TX_SOCKET_H__


#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include"otg.h"
#include"otg_tx.h"


//-----------------------begin func proto-------------------

/*! \fn socket_packet_send(int, int , int)
* \brief this function allow to run the client, with the appropriate parameters.
* \param[in] src, dst and the state
* \param[out]  void
58 59
* \return void
* \note
60 61 62 63 64 65 66 67
* @ingroup  _otg
*/
void socket_packet_send(int src, int dst, int state,int ctime);

/*! \fn client_socket_tcp_ip4(int, int , int)
* \brief this function allow to run the client, with IPv4 and TCP protocol.
* \param[in] src, dst and the state
* \param[out]  void
68 69
* \return void
* \note
70 71 72 73 74 75 76 77
* @ingroup  _otg
*/
void client_socket_tcp_ip4(int src, int dst, int state,int ctime);

/*! \fn client_socket_tcp_ip6(int, int , int)
* \brief this function allow to run the client, with IPv6 and TCP protocol.
* \param[in] src, dst and the state
* \param[out]  void
78 79
* \return void
* \note
80 81 82 83 84 85 86 87
* @ingroup  _otg
*/
void client_socket_tcp_ip6(int src, int dst, int state,int ctime);

/*! \fn client_socket_udp_ip4(int, int , int)
* \brief this function allow to run the client, with IPv4 and UDP protocol.
* \param[in] src, dst and the state
* \param[out]  void
88 89
* \return void
* \note
90 91 92 93 94 95 96 97
* @ingroup  _otg
*/
void client_socket_udp_ip4(int src, int dst, int state,int ctime);

/*! \fn client_socket_udp_ip6(int, int , int)
* \brief this function allow to run the client, with IPv6 and UDP protocol.
* \param[in] src, dst and the state
* \param[out]  void
98 99
* \return void
* \note
100 101 102 103 104 105 106 107
* @ingroup  _otg
*/
void client_socket_udp_ip6(int src, int dst, int state,int ctime);



/*! \fn int packet_gen(int src, int dst, int state, int ctime)
* \brief return char *  pointer over the payload, else NULL
108
* \param[in] source,
109
* \param[out] packet_t: the generated packet: otg_header + header + payload
110
* \note
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
* @ingroup  _otg
*/
char* packet_gen_socket(int src, int dst, int state, int ctime);




control_hdr_t *otg_info_hdr_gen(int src, int dst, int trans_proto, int ip_v);




void init_control_header();


//-----------------------end func proto-------------------



#endif