-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.c
40 lines (39 loc) · 939 Bytes
/
test.c
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Copyright (c) 2023, Julia Desmazes. All rights reserved.
*
* This work is licensed under the Creative Commons Attribution-NonCommercial
* 4.0 International License.
*
* This code is provided "as is" without any express or implied warranties. */
#include "server.hpp"
#include <cstring>
extern "C"{
#include "inc/defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
}
int main(){
/* init random number genreator */
srand(time(NULL));
uint8_t src_ip_lite[4] = {4,125,74,233};
uint32_t src_ip;
memcpy(&src_ip, &src_ip_lite, 4);
uint16_t src_port = 31004;
uint16_t dst_port = 31504;
uint8_t dst_mac[6] = DEFAULT_DST_MAC;
uint8_t src_mac[6] = DEFAULT_SRC_MAC;
ser s("/home/pitchu/rtl/hft/tb/12302019.NASDAQ_ITCH50",
dst_mac,
src_mac,
src_ip,
DEFAULT_DST_IP ,
src_port,
dst_port,
false);
size_t l;
for(int i=0; i<50000; i++){
uint8_t *p = s.get_nxt_feed_pkt(&l, true);
free(p);
}
return 0;
}