set(EXT_LINK ${EXT_LINK} ubus)
endif(${UBUS})
-add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/dhcpv6-ia.c src/dhcpv4.c src/netlink.c ${EXT_SRC})
+if(${DHCPV4_SUPPORT})
+ add_definitions(-DDHCPV4_SUPPORT)
+ set(EXT_SRC ${EXT_SRC} src/dhcpv4.c)
+endif(${DHCPV4_SUPPORT})
+
+add_executable(odhcpd src/odhcpd.c src/config.c src/router.c src/dhcpv6.c src/ndp.c src/dhcpv6-ia.c src/netlink.c ${EXT_SRC})
target_link_libraries(odhcpd resolv ubox uci ${libnl} ${EXT_LINK})
# Installation
router_setup_interface(iface, false);
dhcpv6_setup_interface(iface, false);
ndp_setup_interface(iface, false);
+#ifdef DHCPV4_SUPPORT
dhcpv4_setup_interface(iface, false);
+#endif
clean_interface(iface);
free(iface->addr4);
router_setup_interface(i, !i->ignore || i->ra != MODE_DISABLED);
dhcpv6_setup_interface(i, !i->ignore || i->dhcpv6 != MODE_DISABLED);
ndp_setup_interface(i, !i->ignore || i->ndp != MODE_DISABLED);
+#ifdef DHCPV4_SUPPORT
dhcpv4_setup_interface(i, !i->ignore || i->dhcpv4 != MODE_DISABLED);
+#endif
} else
close_interface(i);
}
if (ndp_init())
return 4;
+#ifdef DHCPV4_SUPPORT
if (dhcpv4_init())
return 4;
+#endif
odhcpd_run();
return 0;
int netlink_init(void);
int router_init(void);
int dhcpv6_init(void);
-int dhcpv4_init(void);
int ndp_init(void);
+#ifdef DHCPV4_SUPPORT
+int dhcpv4_init(void);
+int dhcpv4_setup_interface(struct interface *iface, bool enable);
+#endif
int router_setup_interface(struct interface *iface, bool enable);
int dhcpv6_setup_interface(struct interface *iface, bool enable);
int ndp_setup_interface(struct interface *iface, bool enable);
-int dhcpv4_setup_interface(struct interface *iface, bool enable);
void odhcpd_reload(void);