├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md └── src ├── main.rs └── net ├── bridge.rs ├── mod.rs └── netlink ├── bridge.rs ├── mod.rs └── veth.rs /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea 3 | rabbitc.iml 4 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "aho-corasick" 3 | version = "0.6.4" 4 | source = "registry+https://github.com/rust-lang/crates.io-index" 5 | dependencies = [ 6 | "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 7 | ] 8 | 9 | [[package]] 10 | name = "ansi_term" 11 | version = "0.9.0" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | 14 | [[package]] 15 | name = "ansi_term" 16 | version = "0.10.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | 19 | [[package]] 20 | name = "ansi_term" 21 | version = "0.11.0" 22 | source = "registry+https://github.com/rust-lang/crates.io-index" 23 | dependencies = [ 24 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 25 | ] 26 | 27 | [[package]] 28 | name = "arrayvec" 29 | version = "0.4.7" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | dependencies = [ 32 | "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", 33 | ] 34 | 35 | [[package]] 36 | name = "atty" 37 | version = "0.2.9" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | dependencies = [ 40 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 41 | "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 42 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 43 | ] 44 | 45 | [[package]] 46 | name = "bitflags" 47 | version = "0.5.0" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | 50 | [[package]] 51 | name = "bitflags" 52 | version = "1.0.1" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | 55 | [[package]] 56 | name = "byteorder" 57 | version = "1.2.1" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | 60 | [[package]] 61 | name = "bytes" 62 | version = "0.4.6" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | dependencies = [ 65 | "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 66 | "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 67 | ] 68 | 69 | [[package]] 70 | name = "cfg-if" 71 | version = "0.1.2" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | 74 | [[package]] 75 | name = "clap" 76 | version = "2.31.2" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | dependencies = [ 79 | "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 80 | "atty 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", 81 | "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 82 | "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 83 | "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 84 | "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 85 | "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 86 | ] 87 | 88 | [[package]] 89 | name = "cloudabi" 90 | version = "0.0.3" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | dependencies = [ 93 | "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 94 | ] 95 | 96 | [[package]] 97 | name = "crossbeam-deque" 98 | version = "0.3.1" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | dependencies = [ 101 | "crossbeam-epoch 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 102 | "crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 103 | ] 104 | 105 | [[package]] 106 | name = "crossbeam-epoch" 107 | version = "0.4.1" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | dependencies = [ 110 | "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", 111 | "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 112 | "crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 113 | "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 114 | "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 115 | "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 116 | ] 117 | 118 | [[package]] 119 | name = "crossbeam-utils" 120 | version = "0.3.2" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | dependencies = [ 123 | "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 124 | ] 125 | 126 | [[package]] 127 | name = "env_logger" 128 | version = "0.5.9" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | dependencies = [ 131 | "atty 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", 132 | "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 133 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 134 | "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", 135 | "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 136 | ] 137 | 138 | [[package]] 139 | name = "fuchsia-zircon" 140 | version = "0.3.3" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | dependencies = [ 143 | "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 144 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 145 | ] 146 | 147 | [[package]] 148 | name = "fuchsia-zircon-sys" 149 | version = "0.3.3" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | 152 | [[package]] 153 | name = "futures" 154 | version = "0.1.21" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | 157 | [[package]] 158 | name = "gcc" 159 | version = "0.3.54" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | 162 | [[package]] 163 | name = "glob" 164 | version = "0.2.11" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | 167 | [[package]] 168 | name = "humantime" 169 | version = "1.1.1" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | dependencies = [ 172 | "quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 173 | ] 174 | 175 | [[package]] 176 | name = "iovec" 177 | version = "0.1.2" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | dependencies = [ 180 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 181 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 182 | ] 183 | 184 | [[package]] 185 | name = "ipaddress" 186 | version = "0.1.2" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | dependencies = [ 189 | "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 190 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 191 | "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 192 | "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", 193 | "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", 194 | "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", 195 | ] 196 | 197 | [[package]] 198 | name = "ipnetwork" 199 | version = "0.12.8" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | 202 | [[package]] 203 | name = "kernel32-sys" 204 | version = "0.2.2" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | dependencies = [ 207 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 208 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 209 | ] 210 | 211 | [[package]] 212 | name = "lazy_static" 213 | version = "1.0.0" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | 216 | [[package]] 217 | name = "lazycell" 218 | version = "0.6.0" 219 | source = "registry+https://github.com/rust-lang/crates.io-index" 220 | 221 | [[package]] 222 | name = "libc" 223 | version = "0.2.40" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | 226 | [[package]] 227 | name = "log" 228 | version = "0.3.9" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | dependencies = [ 231 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 232 | ] 233 | 234 | [[package]] 235 | name = "log" 236 | version = "0.4.1" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | dependencies = [ 239 | "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 240 | ] 241 | 242 | [[package]] 243 | name = "memchr" 244 | version = "2.0.1" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | dependencies = [ 247 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 248 | ] 249 | 250 | [[package]] 251 | name = "memoffset" 252 | version = "0.2.1" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | 255 | [[package]] 256 | name = "mio" 257 | version = "0.6.14" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | dependencies = [ 260 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 261 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 262 | "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 263 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 264 | "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 265 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 266 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 267 | "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 268 | "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", 269 | "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 270 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 271 | ] 272 | 273 | [[package]] 274 | name = "miow" 275 | version = "0.2.1" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | dependencies = [ 278 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 279 | "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", 280 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 281 | "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 282 | ] 283 | 284 | [[package]] 285 | name = "net2" 286 | version = "0.2.32" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | dependencies = [ 289 | "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 290 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 291 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 292 | ] 293 | 294 | [[package]] 295 | name = "nix" 296 | version = "0.10.0" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | dependencies = [ 299 | "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 300 | "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 301 | "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 302 | "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", 303 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 304 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 305 | ] 306 | 307 | [[package]] 308 | name = "nodrop" 309 | version = "0.1.12" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | 312 | [[package]] 313 | name = "num" 314 | version = "0.1.42" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | dependencies = [ 317 | "num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 318 | "num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", 319 | "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", 320 | "num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", 321 | "num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 322 | "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 323 | ] 324 | 325 | [[package]] 326 | name = "num-bigint" 327 | version = "0.1.44" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | dependencies = [ 330 | "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", 331 | "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 332 | "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 333 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 334 | ] 335 | 336 | [[package]] 337 | name = "num-complex" 338 | version = "0.1.43" 339 | source = "registry+https://github.com/rust-lang/crates.io-index" 340 | dependencies = [ 341 | "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 342 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 343 | ] 344 | 345 | [[package]] 346 | name = "num-integer" 347 | version = "0.1.38" 348 | source = "registry+https://github.com/rust-lang/crates.io-index" 349 | dependencies = [ 350 | "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 351 | ] 352 | 353 | [[package]] 354 | name = "num-iter" 355 | version = "0.1.37" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | dependencies = [ 358 | "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", 359 | "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 360 | ] 361 | 362 | [[package]] 363 | name = "num-rational" 364 | version = "0.1.42" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | dependencies = [ 367 | "num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", 368 | "num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", 369 | "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 370 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 371 | ] 372 | 373 | [[package]] 374 | name = "num-traits" 375 | version = "0.1.43" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | dependencies = [ 378 | "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 379 | ] 380 | 381 | [[package]] 382 | name = "num-traits" 383 | version = "0.2.4" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | 386 | [[package]] 387 | name = "num_cpus" 388 | version = "1.8.0" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | dependencies = [ 391 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 392 | ] 393 | 394 | [[package]] 395 | name = "pnet" 396 | version = "0.21.0" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | dependencies = [ 399 | "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", 400 | "pnet_base 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 401 | "pnet_datalink 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 402 | "pnet_packet 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 403 | "pnet_sys 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 404 | "pnet_transport 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 405 | ] 406 | 407 | [[package]] 408 | name = "pnet_base" 409 | version = "0.21.0" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | 412 | [[package]] 413 | name = "pnet_datalink" 414 | version = "0.21.0" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | dependencies = [ 417 | "ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)", 418 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 419 | "pnet_base 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 420 | "pnet_sys 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 421 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 422 | ] 423 | 424 | [[package]] 425 | name = "pnet_macros" 426 | version = "0.21.0" 427 | source = "registry+https://github.com/rust-lang/crates.io-index" 428 | dependencies = [ 429 | "regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", 430 | "syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)", 431 | "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", 432 | ] 433 | 434 | [[package]] 435 | name = "pnet_macros_support" 436 | version = "0.21.0" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | dependencies = [ 439 | "pnet_base 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 440 | ] 441 | 442 | [[package]] 443 | name = "pnet_packet" 444 | version = "0.21.0" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | dependencies = [ 447 | "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 448 | "pnet_base 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 449 | "pnet_macros 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 450 | "pnet_macros_support 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 451 | "syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)", 452 | ] 453 | 454 | [[package]] 455 | name = "pnet_sys" 456 | version = "0.21.0" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | dependencies = [ 459 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 460 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 461 | "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 462 | ] 463 | 464 | [[package]] 465 | name = "pnet_transport" 466 | version = "0.21.0" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | dependencies = [ 469 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 470 | "pnet_base 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 471 | "pnet_packet 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 472 | "pnet_sys 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 473 | ] 474 | 475 | [[package]] 476 | name = "pnetlink" 477 | version = "0.0.3" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | dependencies = [ 480 | "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 481 | "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 482 | "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 483 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 484 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 485 | "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", 486 | "pnet 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 487 | "pnet_macros 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 488 | "pnet_macros_support 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 489 | "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 490 | "syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)", 491 | "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", 492 | "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 493 | ] 494 | 495 | [[package]] 496 | name = "pretty_env_logger" 497 | version = "0.2.2" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | dependencies = [ 500 | "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", 501 | "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", 502 | "env_logger 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", 503 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 504 | ] 505 | 506 | [[package]] 507 | name = "quick-error" 508 | version = "1.2.1" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | 511 | [[package]] 512 | name = "rabbitc" 513 | version = "0.1.0" 514 | dependencies = [ 515 | "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)", 516 | "ipaddress 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 517 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 518 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 519 | "nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 520 | "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 521 | "pnet_macros_support 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", 522 | "pnetlink 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 523 | "pretty_env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 524 | "rand 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 525 | ] 526 | 527 | [[package]] 528 | name = "rand" 529 | version = "0.4.2" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | dependencies = [ 532 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 533 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 534 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 535 | ] 536 | 537 | [[package]] 538 | name = "rand" 539 | version = "0.5.0" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | dependencies = [ 542 | "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 543 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 544 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 545 | "rand_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 546 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 547 | ] 548 | 549 | [[package]] 550 | name = "rand_core" 551 | version = "0.2.0" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | 554 | [[package]] 555 | name = "redox_syscall" 556 | version = "0.1.37" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | 559 | [[package]] 560 | name = "redox_termios" 561 | version = "0.1.1" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | dependencies = [ 564 | "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", 565 | ] 566 | 567 | [[package]] 568 | name = "regex" 569 | version = "0.2.10" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | dependencies = [ 572 | "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", 573 | "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 574 | "regex-syntax 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", 575 | "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 576 | "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 577 | ] 578 | 579 | [[package]] 580 | name = "regex-syntax" 581 | version = "0.5.5" 582 | source = "registry+https://github.com/rust-lang/crates.io-index" 583 | dependencies = [ 584 | "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 585 | ] 586 | 587 | [[package]] 588 | name = "rustc-serialize" 589 | version = "0.3.24" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | 592 | [[package]] 593 | name = "scoped-tls" 594 | version = "0.1.2" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | 597 | [[package]] 598 | name = "scopeguard" 599 | version = "0.3.3" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | 602 | [[package]] 603 | name = "slab" 604 | version = "0.4.0" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | 607 | [[package]] 608 | name = "strsim" 609 | version = "0.7.0" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | 612 | [[package]] 613 | name = "syntex" 614 | version = "0.42.2" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | dependencies = [ 617 | "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", 618 | "syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", 619 | ] 620 | 621 | [[package]] 622 | name = "syntex_errors" 623 | version = "0.42.0" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | dependencies = [ 626 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 627 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 628 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 629 | "syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", 630 | "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 631 | "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 632 | ] 633 | 634 | [[package]] 635 | name = "syntex_pos" 636 | version = "0.42.0" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | dependencies = [ 639 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 640 | ] 641 | 642 | [[package]] 643 | name = "syntex_syntax" 644 | version = "0.42.0" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | dependencies = [ 647 | "bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 648 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 649 | "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 650 | "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", 651 | "syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", 652 | "syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)", 653 | "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 654 | "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 655 | ] 656 | 657 | [[package]] 658 | name = "term" 659 | version = "0.4.6" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | dependencies = [ 662 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 663 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 664 | ] 665 | 666 | [[package]] 667 | name = "termcolor" 668 | version = "0.3.6" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | dependencies = [ 671 | "wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 672 | ] 673 | 674 | [[package]] 675 | name = "termion" 676 | version = "1.5.1" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | dependencies = [ 679 | "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)", 680 | "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", 681 | "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 682 | ] 683 | 684 | [[package]] 685 | name = "textwrap" 686 | version = "0.9.0" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | dependencies = [ 689 | "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 690 | ] 691 | 692 | [[package]] 693 | name = "thread_local" 694 | version = "0.3.5" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | dependencies = [ 697 | "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 698 | "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 699 | ] 700 | 701 | [[package]] 702 | name = "tokio" 703 | version = "0.1.6" 704 | source = "registry+https://github.com/rust-lang/crates.io-index" 705 | dependencies = [ 706 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 707 | "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", 708 | "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 709 | "tokio-fs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 710 | "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 711 | "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 712 | "tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 713 | "tokio-threadpool 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 714 | "tokio-timer 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 715 | "tokio-udp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 716 | ] 717 | 718 | [[package]] 719 | name = "tokio-core" 720 | version = "0.1.17" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | dependencies = [ 723 | "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 724 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 725 | "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 726 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 727 | "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", 728 | "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 729 | "tokio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 730 | "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 731 | "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 732 | "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 733 | "tokio-timer 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 734 | ] 735 | 736 | [[package]] 737 | name = "tokio-executor" 738 | version = "0.1.2" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | dependencies = [ 741 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 742 | ] 743 | 744 | [[package]] 745 | name = "tokio-fs" 746 | version = "0.1.0" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | dependencies = [ 749 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 750 | "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 751 | "tokio-threadpool 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 752 | ] 753 | 754 | [[package]] 755 | name = "tokio-io" 756 | version = "0.1.6" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | dependencies = [ 759 | "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 760 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 761 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 762 | ] 763 | 764 | [[package]] 765 | name = "tokio-reactor" 766 | version = "0.1.1" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | dependencies = [ 769 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 770 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 771 | "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", 772 | "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 773 | "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 774 | "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 775 | ] 776 | 777 | [[package]] 778 | name = "tokio-tcp" 779 | version = "0.1.0" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | dependencies = [ 782 | "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 783 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 784 | "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 785 | "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", 786 | "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 787 | "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 788 | ] 789 | 790 | [[package]] 791 | name = "tokio-threadpool" 792 | version = "0.1.3" 793 | source = "registry+https://github.com/rust-lang/crates.io-index" 794 | dependencies = [ 795 | "crossbeam-deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 796 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 797 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 798 | "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 799 | "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 800 | "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 801 | ] 802 | 803 | [[package]] 804 | name = "tokio-timer" 805 | version = "0.2.3" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | dependencies = [ 808 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 809 | "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 810 | ] 811 | 812 | [[package]] 813 | name = "tokio-udp" 814 | version = "0.1.0" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | dependencies = [ 817 | "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 818 | "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", 819 | "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", 820 | "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", 821 | "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 822 | "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 823 | ] 824 | 825 | [[package]] 826 | name = "ucd-util" 827 | version = "0.1.1" 828 | source = "registry+https://github.com/rust-lang/crates.io-index" 829 | 830 | [[package]] 831 | name = "unicode-width" 832 | version = "0.1.4" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | 835 | [[package]] 836 | name = "unicode-xid" 837 | version = "0.0.3" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | 840 | [[package]] 841 | name = "unreachable" 842 | version = "1.0.0" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | dependencies = [ 845 | "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 846 | ] 847 | 848 | [[package]] 849 | name = "utf8-ranges" 850 | version = "1.0.0" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | 853 | [[package]] 854 | name = "vec_map" 855 | version = "0.8.0" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | 858 | [[package]] 859 | name = "void" 860 | version = "1.0.2" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | 863 | [[package]] 864 | name = "winapi" 865 | version = "0.2.8" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | 868 | [[package]] 869 | name = "winapi" 870 | version = "0.3.4" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | dependencies = [ 873 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 874 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 875 | ] 876 | 877 | [[package]] 878 | name = "winapi-build" 879 | version = "0.1.1" 880 | source = "registry+https://github.com/rust-lang/crates.io-index" 881 | 882 | [[package]] 883 | name = "winapi-i686-pc-windows-gnu" 884 | version = "0.4.0" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | 887 | [[package]] 888 | name = "winapi-x86_64-pc-windows-gnu" 889 | version = "0.4.0" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | 892 | [[package]] 893 | name = "wincolor" 894 | version = "0.1.6" 895 | source = "registry+https://github.com/rust-lang/crates.io-index" 896 | dependencies = [ 897 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 898 | ] 899 | 900 | [[package]] 901 | name = "ws2_32-sys" 902 | version = "0.2.1" 903 | source = "registry+https://github.com/rust-lang/crates.io-index" 904 | dependencies = [ 905 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 906 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 907 | ] 908 | 909 | [metadata] 910 | "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" 911 | "checksum ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6b3568b48b7cefa6b8ce125f9bb4989e52fbcc29ebea88df04cc7c5f12f70455" 912 | "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 913 | "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" 914 | "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" 915 | "checksum atty 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6609a866dd1a1b2d0ee1362195bf3e4f6438abb2d80120b83b1e1f4fb6476dd0" 916 | "checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" 917 | "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" 918 | "checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23" 919 | "checksum bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7db437d718977f6dc9b2e3fd6fc343c02ac6b899b73fdd2179163447bd9ce9" 920 | "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" 921 | "checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536" 922 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 923 | "checksum crossbeam-deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fe8153ef04a7594ded05b427ffad46ddeaf22e63fd48d42b3e1e3bb4db07cae7" 924 | "checksum crossbeam-epoch 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9b4e2817eb773f770dcb294127c011e22771899c21d18fce7dd739c0b9832e81" 925 | "checksum crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d636a8b3bcc1b409d7ffd3facef8f21dcb4009626adbd0c5e6c4305c07253c7b" 926 | "checksum env_logger 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "00c45cec4cde3daac5f036c74098b4956151525cdf360cff5ee0092c98823e54" 927 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 928 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 929 | "checksum futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "1a70b146671de62ec8c8ed572219ca5d594d9b06c0b364d5e67b722fc559b48c" 930 | "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" 931 | "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" 932 | "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" 933 | "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" 934 | "checksum ipaddress 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c9e999e655a4d0ab9b8d21026760e5154d8adee48c9149c67f918f540f6a05f5" 935 | "checksum ipnetwork 0.12.8 (registry+https://github.com/rust-lang/crates.io-index)" = "70783119ac90828aaba91eae39db32c6c1b8838deea3637e5238efa0130801ab" 936 | "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 937 | "checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" 938 | "checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef" 939 | "checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b" 940 | "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" 941 | "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" 942 | "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" 943 | "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" 944 | "checksum mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)" = "6d771e3ef92d58a8da8df7d6976bfca9371ed1de6619d9d5a5ce5b1f29b85bfe" 945 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 946 | "checksum net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)" = "9044faf1413a1057267be51b5afba8eb1090bd2231c693664aa1db716fe1eae0" 947 | "checksum nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7fd5681d13fda646462cfbd4e5f2051279a89a544d50eb98c365b507246839f" 948 | "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" 949 | "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" 950 | "checksum num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" 951 | "checksum num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656" 952 | "checksum num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac0ea58d64a89d9d6b7688031b3be9358d6c919badcf7fbb0527ccfd891ee45" 953 | "checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" 954 | "checksum num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" 955 | "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" 956 | "checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28" 957 | "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" 958 | "checksum pnet 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3961c514be0c95233bdccdee9831aadd887a889ebc22e57d73e14d1cedb670" 959 | "checksum pnet_base 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "948dbdd36f46888ada1d497703e6cae53d227ab0e8871638aba492ad1e4a76dc" 960 | "checksum pnet_datalink 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d3b3dd76a11ad99d92fef54b2489f76f4045ebd5251bd1af485d55a7e13db6" 961 | "checksum pnet_macros 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d228096fd739d4e3e60dee9e1e4f07d9ae0f3f309c876834192538748e561e4" 962 | "checksum pnet_macros_support 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f92b7141318df140dfb8c3f7a1a5a331edb31b1791633cc5c8f03fcd9a7f6ac4" 963 | "checksum pnet_packet 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef99f3cfa2c0ed07e9ad6d9f788592d863361a8dd3102989d79b0f6a787ba434" 964 | "checksum pnet_sys 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "963b9109a05c3ac370abc3fda61bff20d03743c2947942173871b9cac2b9acb0" 965 | "checksum pnet_transport 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "568a118fe2f74ebb08e9b9b6ac812b9730a7b043c5ca4d97325f4edeb018cae0" 966 | "checksum pnetlink 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "47a3bb8d7c0d19dc9002e7fa23ca7726cb9a1478fadf5af63d6dac48d11a1266" 967 | "checksum pretty_env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fd5c507cd6729e967cdbd3912bea44f2920e4ffa170f1242706e67a657eeddf0" 968 | "checksum quick-error 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eda5fe9b71976e62bc81b781206aaa076401769b2143379d3eb2118388babac4" 969 | "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" 970 | "checksum rand 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a89abf8d34faf9783692392dca7bcdc6e82fa84eca86ccb6301ec87f3497185" 971 | "checksum rand_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7a5f27547c49e5ccf8a586db3f3782fd93cf849780b21853b9d981db203302" 972 | "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" 973 | "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" 974 | "checksum regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "aec3f58d903a7d2a9dc2bf0e41a746f4530e0cab6b615494e058f67a3ef947fb" 975 | "checksum regex-syntax 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "bd90079345f4a4c3409214734ae220fd773c6f2e8a543d07370c6c1c369cfbfb" 976 | "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" 977 | "checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" 978 | "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" 979 | "checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d" 980 | "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" 981 | "checksum syntex 0.42.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0a30b08a6b383a22e5f6edc127d169670d48f905bb00ca79a00ea3e442ebe317" 982 | "checksum syntex_errors 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04c48f32867b6114449155b2a82114b86d4b09e1bddb21c47ff104ab9172b646" 983 | "checksum syntex_pos 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd49988e52451813c61fecbe9abb5cfd4e1b7bb6cdbb980a6fbcbab859171a6" 984 | "checksum syntex_syntax 0.42.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7628a0506e8f9666fdabb5f265d0059b059edac9a3f810bda077abb5d826bd8d" 985 | "checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" 986 | "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83" 987 | "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" 988 | "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" 989 | "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" 990 | "checksum tokio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d00555353b013e170ed8bc4e13f648a317d1fd12157dbcae13f7013f6cf29f5" 991 | "checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" 992 | "checksum tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8cac2a7883ff3567e9d66bb09100d09b33d90311feca0206c7ca034bc0c55113" 993 | "checksum tokio-fs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "76766830bbf9a2d5bfb50c95350d56a2e79e2c80f675967fff448bc615899708" 994 | "checksum tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6af9eb326f64b2d6b68438e1953341e00ab3cf54de7e35d92bfc73af8555313a" 995 | "checksum tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3cedc8e5af5131dc3423ffa4f877cce78ad25259a9a62de0613735a13ebc64b" 996 | "checksum tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec9b094851aadd2caf83ba3ad8e8c4ce65a42104f7b94d9e6550023f0407853f" 997 | "checksum tokio-threadpool 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5783254b10c7c84a56f62c74766ef7e5b83d1f13053218c7cab8d3f2c826fa0e" 998 | "checksum tokio-timer 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535fed0ccee189f3d48447587697ba3fd234b3dbbb091f0ec4613ddfec0a7c4c" 999 | "checksum tokio-udp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "137bda266504893ac4774e0ec4c2108f7ccdbcb7ac8dced6305fe9e4e0b5041a" 1000 | "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" 1001 | "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" 1002 | "checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" 1003 | "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" 1004 | "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" 1005 | "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" 1006 | "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 1007 | "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1008 | "checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" 1009 | "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1010 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1011 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1012 | "checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767" 1013 | "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1014 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rabbitc" 3 | version = "0.1.0" 4 | authors = ["Nedim Šabić "] 5 | 6 | [dependencies] 7 | nix = "0.10.0" 8 | libc = "0.2.40" 9 | clap = "2.31.2" 10 | log = "0.4" 11 | pretty_env_logger = "0.2" 12 | pnetlink = "0.0.3" 13 | pnet_macros_support = "0.21" 14 | ipaddress = "0.1.1" 15 | rand = "0.5.0" 16 | num = "0.1.42" 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rabbitc 2 | 3 | **rabbitc** is the micro container runtime meant for learning purposes. For more information, read the blog [post](http://rabbitstack.github.io/operating%20systems/containers/linux-container-internals-part-ii/). 4 | 5 | ## Building 6 | 7 | Rust toolchain is required to build `rabbitc`. Clone this repository and run `cargo build --release`. 8 | 9 | `rabbitc --help` prints all availalbe options. 10 | 11 | ```bash 12 | OPTIONS: 13 | -c, --cmd Command that is run inside container [default: /bin/sh] 14 | -t, --container-ip The default IP address for container in CIDR notation [default: 172.19.0.2/16] 15 | -h, --hostname Container host name [default: rabbitc] 16 | -i, --network-ip The default IP address for the bridge device in CIDR notation [default: 17 | 172.19.0.1/16] 18 | -n, --network-name The name of the bridge device where containers are connected [default: 19 | rabbitc0] 20 | -r, --rootfs Root file system path for the container 21 | ``` 22 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018 by Nedim Sabic (RabbitStack) 2 | // http://rabbitstack.github.io 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | // not use this file except in compliance with the License. You may obtain 6 | // a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | // License for the specific language governing permissions and limitations 14 | // under the License. 15 | 16 | extern crate clap; 17 | #[macro_use] 18 | extern crate log; 19 | extern crate nix; 20 | extern crate pnet_macros_support; 21 | extern crate pnetlink; 22 | extern crate pretty_env_logger; 23 | 24 | extern crate ipaddress; 25 | extern crate num; 26 | extern crate rand; 27 | 28 | use clap::{App, Arg}; 29 | 30 | use nix::sched::*; 31 | use nix::{Error, Result}; 32 | use nix::sched::clone; 33 | use nix::unistd::{chdir, execve, mkdir, pivot_root, sethostname}; 34 | use nix::mount::*; 35 | use std::ffi::CString; 36 | use std::path::Path; 37 | use std::time; 38 | use std::thread; 39 | 40 | use nix::sys::stat; 41 | use nix::sys::wait::waitpid; 42 | 43 | mod net; 44 | 45 | use net::bridge; 46 | 47 | fn main() { 48 | pretty_env_logger::init(); 49 | let matches = App::new("rabbitc") 50 | .version("0.1.0") 51 | .about("Micro container runtime") 52 | .author("Nedim Šabić") 53 | .arg( 54 | Arg::with_name("rootfs") 55 | .required(true) 56 | .short("r") 57 | .long("rootfs") 58 | .multiple(false) 59 | .takes_value(true) 60 | .help("Root file system path for the container"), 61 | ) 62 | .arg( 63 | Arg::with_name("hostname") 64 | .short("h") 65 | .long("hostname") 66 | .multiple(false) 67 | .default_value("rabbitc") 68 | .help("Container host name"), 69 | ) 70 | .arg( 71 | Arg::with_name("cmd") 72 | .short("c") 73 | .long("cmd") 74 | .multiple(false) 75 | .default_value("/bin/sh") 76 | .help("Command that is run inside container"), 77 | ) 78 | .arg( 79 | Arg::with_name("network-name") 80 | .short("n") 81 | .long("network-name") 82 | .multiple(false) 83 | .default_value("rabbitc0") 84 | .help("The name of the bridge device where containers are connected"), 85 | ) 86 | .arg( 87 | Arg::with_name("network-ip") 88 | .short("i") 89 | .long("network-ip") 90 | .multiple(false) 91 | .default_value("172.19.0.1/16") 92 | .help("The default IP address for the bridge device in CIDR notation"), 93 | ) 94 | .arg( 95 | Arg::with_name("container-ip") 96 | .short("t") 97 | .long("container-ip") 98 | .multiple(false) 99 | .default_value("172.19.0.2/16") 100 | .help("The default IP address for container in CIDR notation"), 101 | ) 102 | .get_matches(); 103 | 104 | let net_name = matches.value_of("network-name").unwrap(); 105 | if let Err(e) = bridge::init(net_name, matches.value_of("network-ip").unwrap()) { 106 | warn!("unable to initialize bridge network {}", e); 107 | } 108 | 109 | let rootfs = matches.value_of("rootfs").unwrap(); 110 | if !Path::new(&rootfs).exists() { 111 | error!("rootfs {} doesn't exist", rootfs); 112 | std::process::exit(1) 113 | } 114 | let hostname = matches.value_of("hostname").unwrap(); 115 | let container_ip = matches.value_of("container-ip").unwrap(); 116 | let cmd = matches.value_of("cmd").unwrap(); 117 | 118 | if let Err(e) = runc(rootfs, hostname, container_ip, net_name, cmd) { 119 | error!("unable to run container: {}", e); 120 | std::process::exit(1) 121 | } 122 | } 123 | 124 | /// Creates a new process with its own view of system resources segregated through namespace facility. 125 | /// Also ensures to prevent mount namespace propagation which is mandatory for a successful outcome 126 | /// of the `pivot_root` syscall. Setups a network adapter for container and connects it to in kernel 127 | /// bridge device. Then waits for the container process to finish. 128 | fn runc(rootfs: &str, hostname: &str, container_ip: &str, net_name: &str, cmd: &str) -> Result<()> { 129 | let clone_flags = CloneFlags::CLONE_NEWUTS | CloneFlags::CLONE_NEWPID | CloneFlags::CLONE_NEWNS 130 | | CloneFlags::CLONE_NEWIPC | CloneFlags::CLONE_NEWNET; 131 | 132 | // set root mount namespace propagation to private. 133 | // This prevents leaking mounts in the container to 134 | // the host 135 | mount( 136 | None::<&str>, 137 | "/", 138 | None::<&str>, 139 | MsFlags::MS_REC | MsFlags::MS_PRIVATE, 140 | None::<&str>, 141 | )?; 142 | 143 | let peer_iface = net::generate_ifname(7); 144 | bridge::create_veth(&peer_iface, net_name).map_err(|_| nix::Error::UnsupportedOperation)?; 145 | 146 | let stack = &mut [0; 1024 * 1024]; 147 | let cb = Box::new(|| { 148 | if let Err(e) = init_container(rootfs, hostname, cmd, &peer_iface, container_ip) { 149 | error!("unable to initialize container: {}", e); 150 | -1 151 | } else { 152 | 0 153 | } 154 | }); 155 | 156 | let child = clone(cb, stack, clone_flags, None)?; 157 | 158 | // move peer interface to container network namespace 159 | bridge::join(&peer_iface, child.to_string().parse::().unwrap()) 160 | .map_err(|_| nix::Error::UnsupportedOperation)?; 161 | 162 | // give child process a chance to boot 163 | thread::sleep(time::Duration::from_millis(300)); 164 | 165 | // wait for child process 166 | waitpid(child, None)?; 167 | 168 | Ok(()) 169 | } 170 | 171 | /// Does initial container's initialization tasks such as provisioining a new 172 | /// rootfs or setting up network interfaces. 173 | fn init_container( 174 | rootfs: &str, 175 | hostname: &str, 176 | cmd: &str, 177 | peer: &str, 178 | container_ip: &str, 179 | ) -> Result<()> { 180 | init_rootfs(rootfs)?; 181 | sethostname(hostname)?; 182 | bridge::setup_peer(peer, container_ip).map_err(|_| nix::Error::UnsupportedOperation)?; 183 | 184 | do_exec(cmd)?; 185 | 186 | Ok(()) 187 | } 188 | 189 | /// Initializes container root file system. It performs bind mount of the root fs 190 | /// prior to giving container a new view of the mount tables. After process's root 191 | /// file system is swapped successfully, this function mounts additional file systems 192 | /// in the container's mount namespace. 193 | fn init_rootfs(rootfs: &str) -> Result<()> { 194 | mount( 195 | Some(rootfs), 196 | rootfs, 197 | None::<&str>, 198 | MsFlags::MS_BIND | MsFlags::MS_REC, 199 | None::<&str>, 200 | )?; 201 | 202 | let prev_rootfs = Path::new(rootfs).join(".oldrootfs"); 203 | std::fs::remove_dir_all(&prev_rootfs).map_err(|_| Error::InvalidPath)?; 204 | mkdir( 205 | &prev_rootfs, 206 | stat::Mode::S_IRWXU | stat::Mode::S_IRWXG | stat::Mode::S_IRWXO, 207 | )?; 208 | 209 | pivot_root(rootfs, &prev_rootfs)?; 210 | chdir("/")?; 211 | 212 | umount2("/.oldrootfs", MntFlags::MNT_DETACH)?; 213 | 214 | // remount procfs system in the container mount namespace 215 | // so it starts with a brand new proc file system 216 | mount( 217 | Some("proc"), 218 | "/proc", 219 | Some("proc"), 220 | MsFlags::MS_NOEXEC | MsFlags::MS_NOSUID | MsFlags::MS_NODEV | MsFlags::MS_RELATIME, 221 | None::<&str>, 222 | )?; 223 | 224 | // mount tmpfs on /dev and create some devices 225 | mount( 226 | Some("tmpfs"), 227 | "/dev", 228 | Some("tmpfs"), 229 | MsFlags::MS_NOSUID | MsFlags::MS_RELATIME, 230 | None::<&str>, 231 | )?; 232 | Ok(()) 233 | } 234 | 235 | /// Attempts to load the provided binary image into the address space of the 236 | /// container process. 237 | fn do_exec(cmd: &str) -> Result<()> { 238 | let args = &[Path::new(cmd).file_stem().unwrap().to_str().unwrap()]; 239 | let envs = &["PATH=/bin:/sbin:/usr/bin:/usr/sbin"]; 240 | let p = CString::new(cmd).unwrap(); 241 | 242 | let a: Vec = args.iter() 243 | .map(|s| CString::new(s.to_string()).unwrap_or_default()) 244 | .collect(); 245 | let e: Vec = envs.iter() 246 | .map(|s| CString::new(s.to_string()).unwrap_or_default()) 247 | .collect(); 248 | 249 | execve(&p, &a, &e)?; 250 | Ok(()) 251 | } 252 | -------------------------------------------------------------------------------- /src/net/bridge.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018 by Nedim Sabic (RabbitStack) 2 | // http://rabbitstack.github.io 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | // not use this file except in compliance with the License. You may obtain 6 | // a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | // License for the specific language governing permissions and limitations 14 | // under the License. 15 | 16 | use pnetlink::packet::netlink::NetlinkConnection; 17 | use pnetlink::packet::route::link::Links; 18 | use pnetlink::packet::route::addr::{Addresses, Scope}; 19 | use net::netlink::bridge::Bridge; 20 | use net::netlink::veth::Veth; 21 | 22 | use ipaddress::IPAddress; 23 | use std::net::IpAddr; 24 | use std::str::FromStr; 25 | 26 | use std::io; 27 | 28 | /// Initializes a new bridge device with provided network options 29 | /// such as gateway address or bridge name. If the bridge already 30 | /// exists this function returns `Ok(())`. 31 | pub fn init(name: &str, ipv4: &str) -> io::Result<()> { 32 | let mut conn = NetlinkConnection::new(); 33 | match conn.new_bridge(name) { 34 | Ok(_) => {} 35 | Err(e) => { 36 | if e.kind() == io::ErrorKind::AlreadyExists { 37 | return Ok(()); 38 | } 39 | return Err(e); 40 | } 41 | } 42 | 43 | // bring up bridge 44 | let bridge = conn.get_link_by_name(name)?.unwrap(); 45 | conn.link_set_up(bridge.get_index())?; 46 | 47 | // bind ip address 48 | let ip = 49 | IPAddress::parse(ipv4).map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?; 50 | conn.add_addr( 51 | &bridge, 52 | IpAddr::from_str(ip.to_s().as_str()).unwrap(), 53 | None::, 54 | Scope::Universe, 55 | ip.prefix.to_i() as u8, 56 | )?; 57 | 58 | Ok(()) 59 | } 60 | 61 | /// Creates a new pair of veth interfaces and binds the interface on the host 62 | /// end to the bridge device. 63 | pub fn create_veth(peer: &str, bridge_name: &str) -> io::Result<()> { 64 | let mut conn = NetlinkConnection::new(); 65 | conn.add_veth(peer)?; 66 | let veth = conn.get_link_by_name("veth0")?.unwrap(); 67 | // TODO: this is hacky. We change the veth name 68 | // assuming it gets `veth0` name upon creation. 69 | // Eventually, we should get the veth pair from peer 70 | // and then proceed with setting new interface name 71 | conn.set_name(&veth, &format!("veth{}", super::generate_ifname(7)))?; 72 | conn.link_set_up(veth.get_index())?; 73 | 74 | let bridge = conn.get_link_by_name(bridge_name)?.unwrap(); 75 | conn.set_master(&veth, &bridge)?; 76 | 77 | Ok(()) 78 | } 79 | 80 | /// Moves peer pair of the veth interface to the network namespace where 81 | /// process with `pid` identifier is living. 82 | pub fn join(peer: &str, pid: u32) -> io::Result<()> { 83 | let mut conn = NetlinkConnection::new(); 84 | let link = conn.get_link_by_name(peer)?.unwrap(); 85 | conn.set_pid_namespace(&link, pid)?; 86 | Ok(()) 87 | } 88 | 89 | /// Setups container network interfaces and assigns the container ip address. 90 | pub fn setup_peer(peer: &str, container_ip: &str) -> io::Result<()> { 91 | let mut conn = NetlinkConnection::new(); 92 | let link = conn.get_link_by_name(peer)?.unwrap(); 93 | let lo = conn.get_link_by_name("lo")?.unwrap(); 94 | conn.link_set_up(lo.get_index())?; 95 | 96 | let ip = IPAddress::parse(container_ip) 97 | .map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?; 98 | conn.add_addr( 99 | &link, 100 | IpAddr::from_str(ip.to_s().as_str()).unwrap(), 101 | None::, 102 | Scope::Universe, 103 | ip.prefix.to_i() as u8, 104 | )?; 105 | 106 | conn.link_set_up(link.get_index())?; 107 | Ok(()) 108 | } 109 | -------------------------------------------------------------------------------- /src/net/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod bridge; 2 | mod netlink; 3 | 4 | use rand::{self, Rng}; 5 | use rand::distributions::Alphanumeric; 6 | 7 | pub fn generate_ifname(len: usize) -> String { 8 | rand::thread_rng() 9 | .sample_iter(&Alphanumeric) 10 | .take(len) 11 | .collect::() 12 | } 13 | -------------------------------------------------------------------------------- /src/net/netlink/bridge.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018 by Nedim Sabic (RabbitStack) 2 | // http://rabbitstack.github.io 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | // not use this file except in compliance with the License. You may obtain 6 | // a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | // License for the specific language governing permissions and limitations 14 | // under the License. 15 | 16 | use pnetlink::packet::netlink::{NetlinkConnection, NetlinkReader, NetlinkRequestBuilder}; 17 | use pnetlink::packet::route::link::{IfInfoPacketBuilder, IFLA_IFNAME, IFLA_INFO_KIND, 18 | IFLA_LINKINFO, RTM_NEWLINK}; 19 | use pnetlink::packet::route::RtAttrPacket; 20 | use pnetlink::packet::route::route::WithPayload; 21 | use pnetlink::packet::netlink::NetlinkMsgFlags; 22 | use pnet_macros_support::packet::Packet; 23 | 24 | use std::io; 25 | use std::io::Write; 26 | 27 | pub trait Bridge { 28 | /// Creates a new bridge kernel device. 29 | fn new_bridge(&mut self, name: &str) -> io::Result<()>; 30 | } 31 | 32 | impl Bridge for NetlinkConnection { 33 | /// Creates a new bridge kernel device. 34 | fn new_bridge(&mut self, name: &str) -> io::Result<()> { 35 | let ifi = { 36 | IfInfoPacketBuilder::new() 37 | .append(RtAttrPacket::create_with_payload(IFLA_IFNAME, name)) 38 | .append(RtAttrPacket::create_with_payload( 39 | IFLA_LINKINFO, 40 | RtAttrPacket::create_with_payload(IFLA_INFO_KIND, "bridge"), 41 | )) 42 | .build() 43 | }; 44 | let req = NetlinkRequestBuilder::new( 45 | RTM_NEWLINK, 46 | NetlinkMsgFlags::NLM_F_CREATE | NetlinkMsgFlags::NLM_F_EXCL 47 | | NetlinkMsgFlags::NLM_F_ACK, 48 | ).append(ifi) 49 | .build(); 50 | self.write(req.packet())?; 51 | let reader = NetlinkReader::new(self); 52 | reader.read_to_end() 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/net/netlink/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod bridge; 2 | pub mod veth; 3 | -------------------------------------------------------------------------------- /src/net/netlink/veth.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018 by Nedim Sabic (RabbitStack) 2 | // http://rabbitstack.github.io 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | // not use this file except in compliance with the License. You may obtain 6 | // a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | // License for the specific language governing permissions and limitations 14 | // under the License. 15 | 16 | use pnetlink::packet::netlink::{NetlinkConnection, NetlinkReader, NetlinkRequestBuilder}; 17 | use pnetlink::packet::route::link::Link; 18 | use pnetlink::packet::route::link::{IfInfoPacketBuilder, IFLA_IFNAME, IFLA_INFO_KIND, 19 | IFLA_LINKINFO, IFLA_MASTER, IFLA_NET_NS_PID, RTM_NEWLINK, 20 | RTM_SETLINK}; 21 | use pnetlink::packet::route::{MutableIfInfoPacket, RtAttrPacket}; 22 | use pnetlink::packet::route::route::WithPayload; 23 | use pnetlink::packet::netlink::NetlinkMsgFlags; 24 | use pnet_macros_support::packet::Packet; 25 | 26 | use std::io; 27 | use std::io::Write; 28 | 29 | pub trait Veth { 30 | /// Creates a new pair of veth <-> peer links. 31 | fn add_veth(&mut self, peer: &str) -> io::Result<()>; 32 | /// Moves the provided link to the namespace where process with specified pid is running. 33 | fn set_pid_namespace(&mut self, link: &Link, pid: u32) -> io::Result<()>; 34 | /// Set the master link for the provided link. 35 | fn set_master(&mut self, link: &Link, master: &Link) -> io::Result<()>; 36 | /// Changes interface name. 37 | fn set_name(&mut self, link: &Link, name: &str) -> io::Result<()>; 38 | } 39 | 40 | impl Veth for NetlinkConnection { 41 | /// Creates a new pair of veth <-> peer links. 42 | fn add_veth(&mut self, peer: &str) -> io::Result<()> { 43 | let ifi = { 44 | IfInfoPacketBuilder::new() 45 | .append(RtAttrPacket::create_with_payload(IFLA_IFNAME, peer)) 46 | .append(RtAttrPacket::create_with_payload( 47 | IFLA_LINKINFO, 48 | RtAttrPacket::create_with_payload(IFLA_INFO_KIND, "veth"), 49 | )) 50 | .build() 51 | }; 52 | let req = NetlinkRequestBuilder::new( 53 | RTM_NEWLINK, 54 | NetlinkMsgFlags::NLM_F_CREATE | NetlinkMsgFlags::NLM_F_EXCL 55 | | NetlinkMsgFlags::NLM_F_ACK, 56 | ).append(ifi) 57 | .build(); 58 | self.write(req.packet())?; 59 | let reader = NetlinkReader::new(self); 60 | reader.read_to_end() 61 | } 62 | 63 | /// Moves the provided link to the namespace where process with specified pid is running. 64 | fn set_pid_namespace(&mut self, link: &Link, pid: u32) -> io::Result<()> { 65 | let mut buf = vec![0; MutableIfInfoPacket::minimum_packet_size()]; 66 | let req = NetlinkRequestBuilder::new(RTM_SETLINK, NetlinkMsgFlags::NLM_F_ACK) 67 | .append({ 68 | let mut ifinfo = MutableIfInfoPacket::new(&mut buf).unwrap(); 69 | ifinfo.set_family(0 /* AF_UNSPEC */); 70 | ifinfo.set_index(link.get_index()); 71 | ifinfo 72 | }) 73 | .append(RtAttrPacket::create_with_payload(IFLA_NET_NS_PID, pid)) 74 | .build(); 75 | self.write(req.packet())?; 76 | let reader = NetlinkReader::new(self); 77 | reader.read_to_end() 78 | } 79 | 80 | /// Set the master link for the provided link. 81 | fn set_master(&mut self, link: &Link, master: &Link) -> io::Result<()> { 82 | let mut buf = vec![0; MutableIfInfoPacket::minimum_packet_size()]; 83 | let req = NetlinkRequestBuilder::new(RTM_SETLINK, NetlinkMsgFlags::NLM_F_ACK) 84 | .append({ 85 | let mut ifinfo = MutableIfInfoPacket::new(&mut buf).unwrap(); 86 | ifinfo.set_family(0 /* AF_UNSPEC */); 87 | ifinfo.set_index(link.get_index()); 88 | ifinfo 89 | }) 90 | .append(RtAttrPacket::create_with_payload( 91 | IFLA_MASTER, 92 | master.get_index(), 93 | )) 94 | .build(); 95 | self.write(req.packet())?; 96 | let reader = NetlinkReader::new(self); 97 | reader.read_to_end() 98 | } 99 | 100 | /// Changes interface name. 101 | fn set_name(&mut self, link: &Link, name: &str) -> io::Result<()> { 102 | let mut buf = vec![0; MutableIfInfoPacket::minimum_packet_size()]; 103 | let req = NetlinkRequestBuilder::new(RTM_SETLINK, NetlinkMsgFlags::NLM_F_ACK) 104 | .append({ 105 | let mut ifinfo = MutableIfInfoPacket::new(&mut buf).unwrap(); 106 | ifinfo.set_family(0 /* AF_UNSPEC */); 107 | ifinfo.set_index(link.get_index()); 108 | ifinfo 109 | }) 110 | .append(RtAttrPacket::create_with_payload(IFLA_IFNAME, name)) 111 | .build(); 112 | self.write(req.packet())?; 113 | let reader = NetlinkReader::new(self); 114 | reader.read_to_end() 115 | } 116 | } 117 | --------------------------------------------------------------------------------