1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 pub type in_addr_t = u32;
12 pub type in_port_t = u16;
14 pub type socklen_t = u32;
15 pub type sa_family_t = u16;
17 pub const AF_INET: sa_family_t = 2;
18 pub const AF_INET6: sa_family_t = 23;
20 #[derive(Copy, Clone)]
23 pub s_addr: in_addr_t,
26 #[derive(Copy, Clone)]
30 pub s6_addr: [u8; 16],
33 #[derive(Copy, Clone)]
36 pub sa_family: sa_family_t,
37 pub sa_data: [u8; 14],
40 #[derive(Copy, Clone)]
42 pub struct sockaddr_in {
43 pub sin_family: sa_family_t,
44 pub sin_port: in_port_t,
45 pub sin_addr: in_addr,
46 pub sin_zero: [u8; 8],
49 #[derive(Copy, Clone)]
51 pub struct sockaddr_in6 {
52 pub sin6_family: sa_family_t,
53 pub sin6_port: in_port_t,
54 pub sin6_flowinfo: u32,
55 pub sin6_addr: in6_addr,
56 pub sin6_scope_id: u32,