1 #include <misc/assert.h> // for assert
2 #include <stdio.h> // for printf
4 #include "frsh_core_types.h" // for FRSH_RESOURCE_ID_DEFAULT
5 #include "frsh_distributed_types.h" // for frsh_network_address_t, frsh_stream_id_t
6 #include "fna.h" // for fna_init
7 #include "frsh_fna.h" // for frsh_rtep_*
8 #include "rtep.h" // for rtep_station_id_t, rtep_channel_t
13 rtep_station_id_t rtep_station = 3;
14 frsh_network_address_t frsh_address;
15 rtep_channel_t in_stream = 7;
16 frsh_stream_id_t out_stream;
17 struct timespec neg_period = {2,0};
18 struct timespec get_period = {0,0};
20 printf("1.- fna_init\n");
21 printf("--------------------------------------------------\n");
22 err=fna_init(FRSH_RESOURCE_ID_DEFAULT);
25 printf("2.- frsh_rtep_map_network_address\n");
26 printf("--------------------------------------------------\n");
27 err=frsh_rtep_map_network_address
28 (FRSH_RESOURCE_ID_DEFAULT, rtep_station, &frsh_address);
30 printf("rtep_address: %d, frsh_address: %d\n", rtep_station, frsh_address);
31 assert(rtep_station == frsh_address);
33 printf("3.- frsh_rtep_map_stream_id\n");
34 printf("--------------------------------------------------\n");
35 err=frsh_rtep_map_stream_id
36 (FRSH_RESOURCE_ID_DEFAULT, in_stream, &out_stream);
38 printf("rtep_channel: %d, frsh_stream: %d\n", in_stream, out_stream);
39 assert(in_stream == out_stream);
41 printf("4.- frsh_rtep_negotiation_messages_vres_renegotiate period\n");
42 printf("--------------------------------------------------\n");
43 err=frsh_rtep_negotiation_messages_vres_get_period
44 (FRSH_RESOURCE_ID_DEFAULT, &get_period);
46 printf("get_period sec=%d nsec=%d\n", get_period.tv_sec, get_period.tv_nsec);
48 err=frsh_rtep_negotiation_messages_vres_renegotiate
49 (FRSH_RESOURCE_ID_DEFAULT, &neg_period);
50 printf("renegotiation accepted: %d\n", !err);
53 err=frsh_rtep_negotiation_messages_vres_get_period
54 (FRSH_RESOURCE_ID_DEFAULT, &get_period);
56 printf("get_period sec=%d nsec=%d\n", get_period.tv_sec, get_period.tv_nsec);