#ifdef CONFIG_FCB
#include <fcb.h>
#include <fcb_contact_info.h>
+#include <wifi_agent.h>
#endif
#include <fcntl.h>
}
forb_register_reference(fcb, fres_contract_broker_reg_name);
forb_object_release(fcb);
+
+
+
+ forb_object wai = forb_object_new(orb, &WAI_SERVER_ID, 1);
+ if (!fcb) {
+ ul_logerr("Cannot allocate WAI reference\n");
+ return;
+ }
+ forb_register_reference(wai, "net.sourceforge.frsh-forb.wai");
+ forb_object_release(wai);
}
#else
#define hack_register_fcb(orb)
#include <fcb.h>
#include <fcb_contact_info.h>
+#include <wifi_agent.h>
static void inet_register_cb(forb_port_t *port)
{
- inet_addr_t *ia;
+ inet_addr_t *ia, *ia2;
ia = malloc(sizeof(*ia));
if (!ia) return;
ia->sin_addr.s_addr = inet_addr(fcb_addr);
ia->sin_port = htons(FCB_TCP_PORT);
forb_new_peer_discovered(port, NULL, FCB_SERVER_ID, ia, "");
+
+ ia2 = malloc(sizeof(*ia2));
+ if (!ia2) return;
+ char *wai_addr = getenv("WAI_ADDR");
+ if (!wai_addr) wai_addr = "127.0.0.1";
+ ia2->sin_family = AF_INET;
+ ia2->sin_addr.s_addr = inet_addr(wai_addr);
+ ia2->sin_port = htons(WAI_TCP_PORT);
+ forb_new_peer_discovered(port, NULL, WAI_SERVER_ID, ia2, "");
}
#else
#define inet_register_cb NULL
frm_fwp_SOURCES = fwp_mngr.c fwp_admctrl.c
frm_fwp_LIBS = frm forb contract fosa rt ulut fcb_client
-#include_HEADERS = res_fwp.h
+include_HEADERS = wifi_agent.h
CFLAGS += -D_FWP_INTERNALS_
lib_LOADLIBES+= frsh
#include <fwp_res.h>
#include <stdio.h>
#include "fwp_admctrl.h"
+#include <wifi_agent.h>
#if 0
static
{
forb_orb orb;
int ret;
- forb_init_attr_t attr = { .orb_id = "org.frescor.frm.fwp" };
+ forb_init_attr_t attr = { .orb_id = "org.frescor.frm.fwp",
+ .fixed_tcp_port = WAI_TCP_PORT,
+ };
int opt;
bool opt_daemon = false;
char *opt_pidfile = NULL;
--- /dev/null
+#ifndef WIFI_AGENT_H
+#define WIFI_AGENT_H
+
+#define WAI_SERVER_ID (forb_server_id){ .uuid = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 } }
+#define WAI_TCP_PORT 24943
+
+#endif