Add msg_add_opt
[oweals/nmrpflash.git] / nmrpd.h
diff --git a/nmrpd.h b/nmrpd.h
index 049b6479d15a720b61cc47bf0151d7a2ebb42cee..28d3f0fd825a145cad0ca2a41f41292a306cc615 100644 (file)
--- a/nmrpd.h
+++ b/nmrpd.h
 #include <windows.h>
 #endif
 
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
 enum nmrp_op {
        NMRP_UPLOAD_FW = 0,
        NMRP_UPLOAD_ST = 1,
@@ -67,9 +71,11 @@ struct nmrpd_args {
        const char *mac;
        enum nmrp_op op;
        uint16_t port;
+       uint16_t region;
        int force_root;
 };
 
+const char *leafname(const char *path);
 int tftp_put(struct nmrpd_args *args);
 bool tftp_is_valid_filename(const char *filename);
 
@@ -97,4 +103,14 @@ int ethsock_set_timeout(struct ethsock *sock, unsigned msec);
 uint8_t *ethsock_get_hwaddr(struct ethsock *sock);
 int ethsock_list_all(void);
 
+struct ethsock_ip_callback_args
+{
+       struct in_addr *ipaddr;
+       struct in_addr *ipmask;
+       void *arg;
+};
+
+typedef int (*ethsock_ip_callback_t)(struct ethsock_ip_callback_args *args);
+int ethsock_for_each_ip(struct ethsock *sock, ethsock_ip_callback_t callback,
+               void *arg);
 #endif