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 #if !defined(_RFC2198_SIM_H_)
00033 #define _RFC2198_SIM_H_
00034
00035
00036 typedef struct rfc2198_sim_queue_element_s
00037 {
00038 struct rfc2198_sim_queue_element_s *next;
00039 struct rfc2198_sim_queue_element_s *prev;
00040 int seq_no;
00041 double departure_time;
00042 double arrival_time;
00043 int len;
00044 uint8_t pkt[];
00045 } rfc2198_sim_queue_element_t;
00046
00047
00048 typedef struct
00049 {
00050 int redundancy_depth;
00051 int next_seq_no;
00052 g1050_state_t *g1050;
00053 rfc2198_sim_queue_element_t *first;
00054 rfc2198_sim_queue_element_t *last;
00055 uint8_t tx_pkt[32][1024];
00056 int tx_pkt_len[32];
00057 int tx_pkt_seq_no[32];
00058 int next_pkt;
00059 uint8_t rx_pkt[32][1024];
00060 int rx_pkt_len[32];
00061 int rx_pkt_seq_no[32];
00062 int rx_queued_pkts;
00063 } rfc2198_sim_state_t;
00064
00065 #ifdef __cplusplus
00066 extern "C"
00067 {
00068 #endif
00069
00070 SPAN_DECLARE(rfc2198_sim_state_t *) rfc2198_sim_init(int model,
00071 int speed_pattern,
00072 int packet_size,
00073 int packet_rate,
00074 int redundancy_depth);
00075
00076 SPAN_DECLARE(int) rfc2198_sim_put(rfc2198_sim_state_t *s,
00077 const uint8_t buf[],
00078 int len,
00079 int seq_no,
00080 double departure_time);
00081
00082 SPAN_DECLARE(int) rfc2198_sim_get(rfc2198_sim_state_t *s,
00083 uint8_t buf[],
00084 int max_len,
00085 double current_time,
00086 int *seq_no,
00087 double *departure_time,
00088 double *arrival_time);
00089
00090 #ifdef __cplusplus
00091 }
00092 #endif
00093
00094 #endif
00095