rfc2198_sim.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #if !defined(_RFC2198_SIM_H_)
00035 #define _RFC2198_SIM_H_
00036
00037
00038 typedef struct rfc2198_sim_queue_element_s
00039 {
00040 struct rfc2198_sim_queue_element_s *next;
00041 struct rfc2198_sim_queue_element_s *prev;
00042 int seq_no;
00043 double departure_time;
00044 double arrival_time;
00045 int len;
00046 uint8_t pkt[];
00047 } rfc2198_sim_queue_element_t;
00048
00049
00050 typedef struct
00051 {
00052 int redundancy_depth;
00053 int next_seq_no;
00054 g1050_state_t *g1050;
00055 rfc2198_sim_queue_element_t *first;
00056 rfc2198_sim_queue_element_t *last;
00057 uint8_t tx_pkt[32][1024];
00058 int tx_pkt_len[32];
00059 int tx_pkt_seq_no[32];
00060 int next_pkt;
00061 uint8_t rx_pkt[32][1024];
00062 int rx_pkt_len[32];
00063 int rx_pkt_seq_no[32];
00064 int rx_queued_pkts;
00065 } rfc2198_sim_state_t;
00066
00067 #ifdef __cplusplus
00068 extern "C"
00069 {
00070 #endif
00071
00072 rfc2198_sim_state_t *rfc2198_sim_init(int model,
00073 int speed_pattern,
00074 int packet_size,
00075 int packet_rate,
00076 int redundancy_depth);
00077
00078 int rfc2198_sim_put(rfc2198_sim_state_t *s,
00079 const uint8_t buf[],
00080 int len,
00081 int seq_no,
00082 double departure_time);
00083
00084 int rfc2198_sim_get(rfc2198_sim_state_t *s,
00085 uint8_t buf[],
00086 int max_len,
00087 double current_time,
00088 int *seq_no,
00089 double *departure_time,
00090 double *arrival_time);
00091
00092 #ifdef __cplusplus
00093 }
00094 #endif
00095
00096 #endif
00097