/**
* @brief queries the current ip setting of the machine
*
- * @param flags flags to provide
+ * @param flags flags to provide
+ * @param ip_address Current Ip address
*
* @return SYS_ERR_OK on success, errval on failure
*/
-errval_t net_config_current_ip_query(net_flags_t flags);
+errval_t net_config_current_ip_query(net_flags_t flags, uint32_t* ip_address);
/**
*
* @return SYS_ERR_OK on success, errval on failure
*/
-errval_t net_config_current_ip_query(net_flags_t flags)
+errval_t net_config_current_ip_query(net_flags_t flags, uint32_t* ip_address)
{
errval_t err;
char* record = NULL;
err = oct_get(&record, "net.current_ip");
if (err_no(err) == OCT_ERR_NO_RECORD && (flags & NET_FLAGS_BLOCKING_INIT)) {
- printf("waiting for DHCP to complete");
+ printf("waiting for DHCP to complete \n");
err = oct_wait_for(&record, NET_CONFIG_CURRENT_IP_RECORD_REGEX);
if (err_is_fail(err)) {
return err;
ipaddr.s_addr = (uint32_t)ip;
netmask.s_addr = (uint32_t)nm;
gateway.s_addr = (uint32_t)gw;
+ *ip_address = (uint32_t)ip;
debug_printf("Got current IP set: %s\n", inet_ntoa(ipaddr));
debug_printf("Got current GW set: %s\n", inet_ntoa(gateway));