mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Adopt mip changes
This commit is contained in:
1 parent
c131b8daf1
commit
1949439d69
1 file changed
+6
-8
@@ -47,7 +47,7 @@ static size_t pcap_tx(const void *data, size_t len, void *userdata) {
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool pcap_status(void *userdata) {
|
static bool pcap_up(void *userdata) {
|
||||||
return userdata ? true : false;
|
return userdata ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,14 +112,12 @@ int main(int argc, char *argv[]) {
|
|||||||
signal(SIGINT, signal_handler);
|
signal(SIGINT, signal_handler);
|
||||||
signal(SIGTERM, signal_handler);
|
signal(SIGTERM, signal_handler);
|
||||||
|
|
||||||
struct mip_ipcfg ipcfg = {.ip = 0, .mask = 0, .gw = 0};
|
struct mip_cfg c = {.ip = 0, .mask = 0, .gw = 0};
|
||||||
sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &ipcfg.mac[0], &ipcfg.mac[1],
|
sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &c.mac[0], &c.mac[1], &c.mac[2],
|
||||||
&ipcfg.mac[2], &ipcfg.mac[3], &ipcfg.mac[4], &ipcfg.mac[5]);
|
&c.mac[3], &c.mac[4], &c.mac[5]);
|
||||||
|
|
||||||
struct mip_driver driver = {
|
struct mip_driver driver = {.tx = pcap_tx, .up = pcap_up, .rx = pcap_rx};
|
||||||
.tx = pcap_tx, .status = pcap_status, .rx = pcap_rx};
|
mip_init(&mgr, &c, &driver, ph);
|
||||||
|
|
||||||
mip_init(&mgr, &ipcfg, &driver, ph);
|
|
||||||
MG_INFO(("Init done, starting main loop"));
|
MG_INFO(("Init done, starting main loop"));
|
||||||
|
|
||||||
while (s_signo == 0) mg_mgr_poll(&mgr, 1); // Infinite event loop
|
while (s_signo == 0) mg_mgr_poll(&mgr, 1); // Infinite event loop
|
||||||
|
|||||||
Reference in new issue
Block a user