shared_LIBRARIES = frsh
frsh_SOURCES = frsh_contract.c frsh_distributed.c frsh_core.c frsh_error.c
-include_HEADERS = frsh_opaque_types.h
+include_HEADERS = frsh_opaque_types.h frsh_forb.h
frsh_LIBS = fna fcb_client forb contract frs ulut fosa $(scheduler-libs-y)
config_include_HEADERS = frsh_resources.h
frsh_resources_DEFINES = CONFIG_RESOURCE_DUMMY CONFIG_FWP
scheduler-libs-$(CONFIG_RESOURCE_DUMMY) := frs_dummy
+scheduler-libs-$(CONFIG_FWP) := frsh_fwp
#include <forb.h>
#include "frsh_forb.h"
#include <frsh_resources.h>
+#include <stdio.h>
#ifdef CONFIG_RESOURCE_DUMMY
#include <res_dummy.h>
if (ret) goto err;
#ifdef CONFIG_RESOURCE_DUMMY
+#if 0
ret = frs_dummy_init(frsh_forb_global.orb, frsh_forb_global.fcb,
&frsh_forb_global.sch_executor);
if (ret) goto err;
#endif
+#endif
+//#if FRSH_DISTRIBUTED_MODULE_SUPPORTED
+ ret = frsh_distributed_init();
+ if (ret) goto err;
+//#endif
/* Run resource schedulers */
fosa_thread_create(&frsh_forb_global.sch_executor_thread, NULL,
sch_executor_thread, NULL);
frsh_send_endpoint_t sepoint;
frsh_vres_id_t vres;
frsh_send_endpoint_protocol_info_t send_pinfo;
+ frsh_contract_t contract;
+ frsh_rel_time_t budget, period;
char msg1[10];
- int count;
+ int count, ret;
/*struct timespec sendtime;*/
send_pinfo.body = NULL;
}
/* Contract negotiation */
+ ret = frsh_contract_init(&contract);
+ if (ret) PERROR_AND_EXIT(ret, "frsh_contract_init");
+
+ budget = fosa_msec_to_rel_time(100);
+ period = fosa_msec_to_rel_time(1000);
+ ret = frsh_contract_set_basic_params(&contract,
+ &budget,
+ &period,
+ FRSH_WT_BOUNDED,
+ FRSH_CT_REGULAR);
+ if (ret) PERROR_AND_EXIT(ret, "frsh_contract_set_basic_params");
+ ret = frsh_contract_set_resource_and_label(&contract,FRSH_RT_NETWORK,
+ FRSH_NETPF_FWP,
+ "fwp_cont1");
+ if (ret) PERROR_AND_EXIT(ret, "frsh_contract_set_resource_and_label");
+
+ ret = frsh_contract_negotiate(&contract, &vres);
+ if (ret) PERROR_AND_EXIT(ret, "frsh_contract_negotiate");
printf("Send endpoint created\n");
frsh_send_endpoint_bind(vres, sepoint);
printf("Send endpoint bounded\n");
sleep(2);
- //for (count = 0; count < NUM; count++) {
//fwp_set_rt_prio(90);
count = 0;
{
pthread_attr_t thattr;
pthread_t thread;
+ int ret;
printf("Start\n");
- if (frsh_distributed_init()) {
+ ret = frsh_init();
+ if (ret) PERROR_AND_EXIT(ret, "frsh_init");
+
+ /*if (frsh_distributed_init()) {
fprintf(stderr,"FRSH distributed modul initialization failed.\n");
- }
+ }*/
pthread_attr_init(&thattr);
pthread_create(&thread, &thattr, sender, NULL);