chiark / gitweb /
Do not print invalid UTF-8 in error messages
[elogind.git] / src / shared / net-util.h
index d6ca737e7fb4e92970940d5a804b452dfc0a1a3c..99479e1f5cbe32f2a5a31e405540a4a1362501a4 100644 (file)
 #pragma once
 
 #include <netinet/ether.h>
+#include <netinet/in.h>
 #include <stdbool.h>
 
+#include "condition-util.h"
+
 bool net_match_config(const struct ether_addr *match_mac,
                       const char *match_path,
                       const char *match_driver,
                       const char *match_type,
                       const char *match_name,
+                      Condition *match_host,
+                      Condition *match_virt,
+                      Condition *match_kernel,
+                      Condition *match_arch,
                       const char *dev_mac,
                       const char *dev_path,
+                      const char *dev_parent_driver,
                       const char *dev_driver,
                       const char *dev_type,
                       const char *dev_name);
 
+unsigned net_netmask_to_prefixlen(const struct in_addr *netmask);
+
+int config_parse_net_condition(const char *unit, const char *filename, unsigned line,
+                               const char *section, unsigned section_line, const char *lvalue,
+                               int ltype, const char *rvalue, void *data, void *userdata);
+
 int config_parse_hwaddr(const char *unit, const char *filename, unsigned line,
-                        const char *section, const char *lvalue, int ltype,
-                        const char *rvalue, void *data, void *userdata);
+                        const char *section, unsigned section_line, const char *lvalue,
+                        int ltype, const char *rvalue, void *data, void *userdata);
 
 int config_parse_ifname(const char *unit, const char *filename, unsigned line,
-                        const char *section, const char *lvalue, int ltype,
-                        const char *rvalue, void *data, void *userdata);
+                        const char *section, unsigned section_line, const char *lvalue,
+                        int ltype, const char *rvalue, void *data, void *userdata);
 
 int config_parse_ifalias(const char *unit, const char *filename, unsigned line,
-                         const char *section, const char *lvalue, int ltype,
-                         const char *rvalue, void *data, void *userdata);
+                         const char *section, unsigned section_line, const char *lvalue,
+                         int ltype, const char *rvalue, void *data, void *userdata);
 
 int net_parse_inaddr(const char *address, unsigned char *family, void *dst);