system: move netdev types to system-linux.c where they are used
authorFelix Fietkau <nbd@nbd.name>
Thu, 29 Dec 2022 18:55:30 +0000 (19:55 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 29 Dec 2022 18:55:32 +0000 (19:55 +0100)
Fixes compile error on non-linux systems (used for testing)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
system-linux.c
system.h

index f16a9554bbbccaa85cb21cd916f2348271ec956e..45a9efbd7f0b0cb6983c80338fd92211b9a34676 100644 (file)
@@ -94,6 +94,75 @@ static char dev_buf[256];
 static const char *proc_path = "/proc";
 static const char *sysfs_path = "/sys";
 
+struct netdev_type {
+       unsigned short id;
+       const char *name;
+};
+
+static const struct netdev_type netdev_types[] = {
+       {ARPHRD_NETROM, "netrom"},
+       {ARPHRD_ETHER, "ethernet"},
+       {ARPHRD_EETHER, "eethernet"},
+       {ARPHRD_AX25, "ax25"},
+       {ARPHRD_PRONET, "pronet"},
+       {ARPHRD_CHAOS, "chaos"},
+       {ARPHRD_IEEE802, "ieee802"},
+       {ARPHRD_ARCNET, "arcnet"},
+       {ARPHRD_APPLETLK, "appletlk"},
+       {ARPHRD_DLCI, "dlci"},
+       {ARPHRD_ATM, "atm"},
+       {ARPHRD_METRICOM, "metricom"},
+       {ARPHRD_IEEE1394, "ieee1394"},
+       {ARPHRD_EUI64, "eui64"},
+       {ARPHRD_INFINIBAND, "infiniband"},
+       {ARPHRD_SLIP, "slip"},
+       {ARPHRD_CSLIP, "cslip"},
+       {ARPHRD_SLIP6, "slip6"},
+       {ARPHRD_CSLIP6, "cslip6"},
+       {ARPHRD_RSRVD, "rsrvd"},
+       {ARPHRD_ADAPT, "adapt"},
+       {ARPHRD_ROSE, "rose"},
+       {ARPHRD_X25, "x25"},
+       {ARPHRD_HWX25, "hwx25"},
+       {ARPHRD_PPP, "ppp"},
+       {ARPHRD_CISCO, "cisco"},
+       {ARPHRD_LAPB, "lapb"},
+       {ARPHRD_DDCMP, "ddcmp"},
+       {ARPHRD_RAWHDLC, "rawhdlc"},
+       {ARPHRD_TUNNEL, "tunnel"},
+       {ARPHRD_TUNNEL6, "tunnel6"},
+       {ARPHRD_FRAD, "frad"},
+       {ARPHRD_SKIP, "skip"},
+       {ARPHRD_LOOPBACK, "loopback"},
+       {ARPHRD_LOCALTLK, "localtlk"},
+       {ARPHRD_FDDI, "fddi"},
+       {ARPHRD_BIF, "bif"},
+       {ARPHRD_SIT, "sit"},
+       {ARPHRD_IPDDP, "ipddp"},
+       {ARPHRD_IPGRE, "ipgre"},
+       {ARPHRD_PIMREG,"pimreg"},
+       {ARPHRD_HIPPI, "hippi"},
+       {ARPHRD_ASH, "ash"},
+       {ARPHRD_ECONET, "econet"},
+       {ARPHRD_IRDA, "irda"},
+       {ARPHRD_FCPP, "fcpp"},
+       {ARPHRD_FCAL, "fcal"},
+       {ARPHRD_FCPL, "fcpl"},
+       {ARPHRD_FCFABRIC, "fcfabric"},
+       {ARPHRD_IEEE80211, "ieee80211"},
+       {ARPHRD_IEEE80211_PRISM, "ie80211-prism"},
+       {ARPHRD_IEEE80211_RADIOTAP, "ieee80211-radiotap"},
+#ifdef ARPHRD_PHONET
+       {ARPHRD_PHONET, "phonet"},
+#endif
+#ifdef ARPHRD_PHONET_PIPE
+       {ARPHRD_PHONET_PIPE, "phonet-pipe"},
+#endif
+       {ARPHRD_IEEE802154, "ieee802154"},
+       {ARPHRD_VOID, "void"},
+       {ARPHRD_NONE, "none"}
+};
+
 static void
 handler_nl_event(struct uloop_fd *u, unsigned int events)
 {
index 0f08c2666298393363cab34a3474ddb399ef5b9c..1f7037d8a63a0a6ccb70764dcec7329e7d7d2d65 100644 (file)
--- a/system.h
+++ b/system.h
 #include "iprule.h"
 #include "utils.h"
 
-struct netdev_type {
-       unsigned short id;
-       const char *name;
-};
-
-static const struct netdev_type netdev_types[] = {
-       {ARPHRD_NETROM, "netrom"},
-       {ARPHRD_ETHER, "ethernet"},
-       {ARPHRD_EETHER, "eethernet"},
-       {ARPHRD_AX25, "ax25"},
-       {ARPHRD_PRONET, "pronet"},
-       {ARPHRD_CHAOS, "chaos"},
-       {ARPHRD_IEEE802, "ieee802"},
-       {ARPHRD_ARCNET, "arcnet"},
-       {ARPHRD_APPLETLK, "appletlk"},
-       {ARPHRD_DLCI, "dlci"},
-       {ARPHRD_ATM, "atm"},
-       {ARPHRD_METRICOM, "metricom"},
-       {ARPHRD_IEEE1394, "ieee1394"},
-       {ARPHRD_EUI64, "eui64"},
-       {ARPHRD_INFINIBAND, "infiniband"},
-       {ARPHRD_SLIP, "slip"},
-       {ARPHRD_CSLIP, "cslip"},
-       {ARPHRD_SLIP6, "slip6"},
-       {ARPHRD_CSLIP6, "cslip6"},
-       {ARPHRD_RSRVD, "rsrvd"},
-       {ARPHRD_ADAPT, "adapt"},
-       {ARPHRD_ROSE, "rose"},
-       {ARPHRD_X25, "x25"},
-       {ARPHRD_HWX25, "hwx25"},
-       {ARPHRD_PPP, "ppp"},
-       {ARPHRD_CISCO, "cisco"},
-       {ARPHRD_LAPB, "lapb"},
-       {ARPHRD_DDCMP, "ddcmp"},
-       {ARPHRD_RAWHDLC, "rawhdlc"},
-       {ARPHRD_TUNNEL, "tunnel"},
-       {ARPHRD_TUNNEL6, "tunnel6"},
-       {ARPHRD_FRAD, "frad"},
-       {ARPHRD_SKIP, "skip"},
-       {ARPHRD_LOOPBACK, "loopback"},
-       {ARPHRD_LOCALTLK, "localtlk"},
-       {ARPHRD_FDDI, "fddi"},
-       {ARPHRD_BIF, "bif"},
-       {ARPHRD_SIT, "sit"},
-       {ARPHRD_IPDDP, "ipddp"},
-       {ARPHRD_IPGRE, "ipgre"},
-       {ARPHRD_PIMREG,"pimreg"},
-       {ARPHRD_HIPPI, "hippi"},
-       {ARPHRD_ASH, "ash"},
-       {ARPHRD_ECONET, "econet"},
-       {ARPHRD_IRDA, "irda"},
-       {ARPHRD_FCPP, "fcpp"},
-       {ARPHRD_FCAL, "fcal"},
-       {ARPHRD_FCPL, "fcpl"},
-       {ARPHRD_FCFABRIC, "fcfabric"},
-       {ARPHRD_IEEE80211, "ieee80211"},
-       {ARPHRD_IEEE80211_PRISM, "ie80211-prism"},
-       {ARPHRD_IEEE80211_RADIOTAP, "ieee80211-radiotap"},
-#ifdef ARPHRD_PHONET
-       {ARPHRD_PHONET, "phonet"},
-#endif
-#ifdef ARPHRD_PHONET_PIPE
-       {ARPHRD_PHONET_PIPE, "phonet-pipe"},
-#endif
-       {ARPHRD_IEEE802154, "ieee802154"},
-       {ARPHRD_VOID, "void"},
-       {ARPHRD_NONE, "none"}
-};
-
 enum tunnel_param {
        TUNNEL_ATTR_TYPE,
        TUNNEL_ATTR_REMOTE,