otg_rx.h 4.18 KB
Newer Older
1 2 3 4 5
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

22
/*! \file otg_rx.h
23
* \brief Data structure and functions for OTG receiver
24
* \author navid nikaein A. Hafsaoui
25 26 27
* \date 2011
* \version 1.0
* \company Eurecom
28
* \email: navid.nikaein@eurecom.fr
29 30 31 32 33 34
* \note
* \warning
*/


#ifndef __OTG_RX_H__
35
# define __OTG_RX_H__
36 37 38 39 40 41 42 43 44 45 46 47

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "otg.h"





48
/*! \fn int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buffer_tx, const unsigned int size);
49 50
* \brief check if the packet is well received and do measurements: one way delay, throughput,etc.
* \param[in] the destination
51
* \param[in] time of the emulation
52 53
* \param[in] The packet
* \param[in] Size of the packet
54
* \param[out] return NULL is the packet is well received,  else the packet to forward
55
* \note
56 57
* @ingroup  _otg
*/
58
int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buffer_tx, const unsigned int size);
59 60 61 62


/*! \fn void owd_const_gen(int src,int dst);
*\brief compute the one way delay introduced in LTE/LTE-A network REF PAPER: "Latency for Real-Time Machine-to-Machine Communication in LTE-Based System Architecture"
63
*\param[in] the source
64 65
*\param[in] the destination
*\param[out] void
66
*\note
67 68
*@ingroup  _otg
*/
69
void owd_const_gen(const int src, const int dst, const int flow_id, const unsigned int flag);
70 71 72 73

/*! \fn float owd_const_capillary();
*\brief compute the one way delay introduced in LTE/LTE-A network REF PAPER: "Latency for Real-Time Machine-to-Machine Communication in LTE-Based System Architecture"
*\param[out] float: capillary delay constant
74
*\note
75 76
*@ingroup  _otg
*/
77
float owd_const_capillary(void);
78 79 80 81

/*! \fn float owd_const_mobile_core();
*\brief compute the one way delay introduced in LTE/LTE-A network REF PAPER: "Latency for Real-Time Machine-to-Machine Communication in LTE-Based System Architecture"
*\param[out] float: mobile core delay constant
82
*\note
83 84
*@ingroup  _otg
*/
85
float owd_const_mobile_core(void);
86 87 88 89

/*! \fn float owd_const_IP_backbone();
*\brief compute the one way delay introduced in LTE/LTE-A network REF PAPER: "Latency for Real-Time Machine-to-Machine Communication in LTE-Based System Architecture"
*\param[out] float: IP backbone delay constant
90
*\note
91 92
*@ingroup  _otg
*/
93
float owd_const_IP_backbone(void);
94

95 96 97 98 99
/*! \fn owd_const_application
 *\brief compute the one way delay introduced in LTE/LTE-A network REF PAPER: "Latency for Real-Time Machine-to-Machine
 *Communication in LTE-Based System Architecture" \note
 *@ingroup  _otg
 */
100
float owd_const_application(void);
101 102


103
/*! \fn void rx_check_loss(const int src, const int dst, const unsigned int flag, const int seq_num, unsigned int * const seq_num_rx, unsigned int * const nb_loss_pkts);
104 105 106 107 108 109
*\brief check the number of loss packet/out of sequence
*\param[in] src
*\param[in] dst
*\param[in] flag: background or data
*\param[in] seq_num: packet sequence number
*\param[in] seq_num_rx:RX sequence number
110
*\param[in] nb_loss_pkts: number of lost packet
111
*\param[out] lost_packet: (0) no lost packets, (1) lost packets
112
*\note
113 114
*@ingroup  _otg
*/
115 116 117 118 119 120 121
int rx_check_loss(
  const int src,
  const int dst,
  const unsigned int flag,
  const int seq_num,
  unsigned int * const seq_num_rx,
  unsigned int * const nb_loss_pkts);
122 123

#endif