diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-24 20:55:27 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-24 20:55:27 +0100 |
commit | 4ffc28ecd6d914f9c1e5aaf5d5921ee4827bb289 (patch) | |
tree | ddd64c27220b75f45a6efdc162bbbe040a9ca001 /src/fastd.c | |
parent | 78fe2cda0572433e40889bcd7d64dd22707bfdd0 (diff) | |
download | fastd-4ffc28ecd6d914f9c1e5aaf5d5921ee4827bb289.tar fastd-4ffc28ecd6d914f9c1e5aaf5d5921ee4827bb289.zip |
Partial implementation of a config files parser
Diffstat (limited to 'src/fastd.c')
-rw-r--r-- | src/fastd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fastd.c b/src/fastd.c index cae7c64..3b27e98 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -53,17 +53,17 @@ static void init_tuntap(fastd_context *ctx) { if (ctx->conf->ifname) strncpy(ifr.ifr_name, ctx->conf->ifname, IF_NAMESIZE-1); - switch (ctx->conf->protocol) { - case PROTOCOL_ETHERNET: + switch (ctx->conf->mode) { + case MODE_TAP: ifr.ifr_flags = IFF_TAP; break; - case PROTOCOL_IP: + case MODE_TUN: ifr.ifr_flags = IFF_TUN; break; default: - exit_bug(ctx, "invalid protocol"); + exit_bug(ctx, "invalid mode"); } ifr.ifr_flags |= IFF_NO_PI; @@ -166,7 +166,7 @@ static void handle_tasks(fastd_context *ctx) { break; case TASK_HANDLE_RECV: - if (ctx->conf->protocol == PROTOCOL_ETHERNET) { + if (ctx->conf->mode == MODE_TAP) { const fastd_eth_addr *src_addr = fastd_get_source_address(ctx, task->handle_recv.buffer); if (fastd_eth_addr_is_unicast(src_addr)) @@ -208,7 +208,7 @@ static void handle_tun(fastd_context *ctx) { fastd_peer *peer = NULL; - if (ctx->conf->protocol == PROTOCOL_ETHERNET) { + if (ctx->conf->mode == MODE_TAP) { const fastd_eth_addr *dest_addr = fastd_get_dest_address(ctx, buffer); if (fastd_eth_addr_is_unicast(dest_addr)) { peer = fastd_peer_find_by_eth_addr(ctx, dest_addr); |