net_posix.c (3338B)
1 #include "../net.h" 2 3 #include <errno.h> 4 #include <stddef.h> 5 6 #if !defined(__linux__) || defined(ARUU_FORCE_POSIX) 7 int 8 net_get_interfaces(struct NetInterface **ifaces, int *count) 9 { 10 *ifaces = NULL; 11 *count = 0; 12 errno = ENOTSUP; 13 return -1; 14 } 15 16 int 17 net_get_routes(struct NetRoute **routes, int *count) 18 { 19 *routes = NULL; 20 *count = 0; 21 errno = ENOTSUP; 22 return -1; 23 } 24 25 int 26 net_get_stats(const char *ifname, struct NetStats *stats) 27 { 28 (void)ifname; 29 (void)stats; 30 errno = ENOTSUP; 31 return -1; 32 } 33 34 int 35 net_set_flags(const char *name, unsigned int flags, int set) 36 { 37 (void)name; 38 (void)flags; 39 (void)set; 40 errno = ENOTSUP; 41 return -1; 42 } 43 44 int 45 net_set_mtu(const char *name, int mtu) 46 { 47 (void)name; 48 (void)mtu; 49 errno = ENOTSUP; 50 return -1; 51 } 52 53 int 54 net_set_metric(const char *name, int metric) 55 { 56 (void)name; 57 (void)metric; 58 errno = ENOTSUP; 59 return -1; 60 } 61 62 int 63 net_set_mac(const char *name, const unsigned char *mac) 64 { 65 (void)name; 66 (void)mac; 67 errno = ENOTSUP; 68 return -1; 69 } 70 71 int 72 net_set_mask(const char *name, const char *mask) 73 { 74 (void)name; 75 (void)mask; 76 errno = ENOTSUP; 77 return -1; 78 } 79 80 int 81 net_set_broadcast(const char *name, const char *broadcast) 82 { 83 (void)name; 84 (void)broadcast; 85 errno = ENOTSUP; 86 return -1; 87 } 88 89 int 90 net_set_dstaddr(const char *name, const char *dstaddr) 91 { 92 (void)name; 93 (void)dstaddr; 94 errno = ENOTSUP; 95 return -1; 96 } 97 98 int 99 net_add_addr(const char *name, const char *addr, int prefix) 100 { 101 (void)name; 102 (void)addr; 103 (void)prefix; 104 errno = ENOTSUP; 105 return -1; 106 } 107 108 int 109 net_del_addr(const char *name, const char *addr, int prefix) 110 { 111 (void)name; 112 (void)addr; 113 (void)prefix; 114 errno = ENOTSUP; 115 return -1; 116 } 117 118 int 119 net_add_route(const char *dst, const char *gateway, const char *dev, int prefix, int metric) 120 { 121 (void)dst; 122 (void)gateway; 123 (void)dev; 124 (void)prefix; 125 (void)metric; 126 errno = ENOTSUP; 127 return -1; 128 } 129 130 int 131 net_del_route(const char *dst, const char *gateway, const char *dev, int prefix, int metric) 132 { 133 (void)dst; 134 (void)gateway; 135 (void)dev; 136 (void)prefix; 137 (void)metric; 138 errno = ENOTSUP; 139 return -1; 140 } 141 142 int 143 net_flush_addrs(const char *dev) 144 { 145 (void)dev; 146 errno = ENOTSUP; 147 return -1; 148 } 149 150 int 151 net_set_txqueuelen(const char *name, int qlen) 152 { 153 (void)name; 154 (void)qlen; 155 errno = ENOTSUP; 156 return -1; 157 } 158 159 int 160 net_set_name(const char *name, const char *newname) 161 { 162 (void)name; 163 (void)newname; 164 errno = ENOTSUP; 165 return -1; 166 } 167 168 int 169 net_tun_open(void) 170 { 171 errno = ENOTSUP; 172 return -1; 173 } 174 175 int 176 net_tun_attach(int fd, char *name, size_t namesz, int tap) 177 { 178 (void)fd; 179 (void)name; 180 (void)namesz; 181 (void)tap; 182 errno = ENOTSUP; 183 return -1; 184 } 185 186 int 187 net_tun_persist(int fd, int on) 188 { 189 (void)fd; 190 (void)on; 191 errno = ENOTSUP; 192 return -1; 193 } 194 195 int 196 net_tun_owner(int fd, uid_t uid) 197 { 198 (void)fd; 199 (void)uid; 200 errno = ENOTSUP; 201 return -1; 202 } 203 204 int 205 net_bind_device(int fd, const char *name) 206 { 207 (void)fd; 208 (void)name; 209 errno = ENOTSUP; 210 return -1; 211 } 212 213 int 214 net_get_hwaddr(int fd, const char *name, unsigned char *mac, size_t n) 215 { 216 (void)fd; 217 (void)name; 218 (void)mac; 219 (void)n; 220 errno = ENOTSUP; 221 return -1; 222 } 223 224 int 225 net_set_lease( 226 const char *name, 227 const unsigned char ip[4], 228 const unsigned char mask[4], 229 const unsigned char gw[4] 230 ) 231 { 232 (void)name; 233 (void)ip; 234 (void)mask; 235 (void)gw; 236 errno = ENOTSUP; 237 return -1; 238 } 239 #endif