]> git.lizzy.rs Git - rust.git/blob - src/libstd/sys/redox/net/netc.rs
Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc
[rust.git] / src / libstd / sys / redox / net / netc.rs
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.
4 //
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.
10
11 pub type in_addr_t = u32;
12 pub type in_port_t = u16;
13
14 pub type socklen_t = u32;
15 pub type sa_family_t = u16;
16
17 pub const AF_INET: sa_family_t = 2;
18 pub const AF_INET6: sa_family_t = 23;
19
20 #[derive(Copy, Clone)]
21 #[repr(C)]
22 pub struct in_addr {
23     pub s_addr: in_addr_t,
24 }
25
26 #[derive(Copy, Clone)]
27 #[repr(align(4))]
28 #[repr(C)]
29 pub struct in6_addr {
30     pub s6_addr: [u8; 16],
31 }
32
33 #[derive(Copy, Clone)]
34 #[repr(C)]
35 pub struct sockaddr {
36     pub sa_family: sa_family_t,
37     pub sa_data: [u8; 14],
38 }
39
40 #[derive(Copy, Clone)]
41 #[repr(C)]
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],
47 }
48
49 #[derive(Copy, Clone)]
50 #[repr(C)]
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,
57 }