diff options
Diffstat (limited to 'ctru-sys/src/sys/socket.rs')
| -rw-r--r-- | ctru-sys/src/sys/socket.rs | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/ctru-sys/src/sys/socket.rs b/ctru-sys/src/sys/socket.rs new file mode 100644 index 0000000..ec544dc --- /dev/null +++ b/ctru-sys/src/sys/socket.rs @@ -0,0 +1,77 @@ +/* automatically generated by rust-bindgen */ + +#![allow(dead_code, + non_camel_case_types, + non_upper_case_globals, + non_snake_case)] +pub type socklen_t = uint32_t; +pub type sa_family_t = uint16_t; +#[repr(C)] +#[derive(Copy, Clone)] +#[derive(Debug)] +pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::libc::c_char; 0usize], +} +impl ::core::default::Default for sockaddr { + fn default() -> Self { unsafe { ::core::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy, Clone)] +#[derive(Debug)] +pub struct sockaddr_storage { + pub ss_family: sa_family_t, + pub __ss_padding: [::libc::c_char; 26usize], +} +impl ::core::default::Default for sockaddr_storage { + fn default() -> Self { unsafe { ::core::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy, Clone)] +#[derive(Debug)] +pub struct linger { + pub l_onoff: ::libc::c_int, + pub l_linger: ::libc::c_int, +} +impl ::core::default::Default for linger { + fn default() -> Self { unsafe { ::core::mem::zeroed() } } +} +extern "C" { + pub fn accept(sockfd: ::libc::c_int, addr: *mut sockaddr, + addrlen: *mut socklen_t) -> ::libc::c_int; + pub fn bind(sockfd: ::libc::c_int, addr: *const sockaddr, + addrlen: socklen_t) -> ::libc::c_int; + pub fn closesocket(sockfd: ::libc::c_int) -> ::libc::c_int; + pub fn connect(sockfd: ::libc::c_int, addr: *const sockaddr, + addrlen: socklen_t) -> ::libc::c_int; + pub fn getpeername(sockfd: ::libc::c_int, addr: *mut sockaddr, + addrlen: *mut socklen_t) -> ::libc::c_int; + pub fn getsockname(sockfd: ::libc::c_int, addr: *mut sockaddr, + addrlen: *mut socklen_t) -> ::libc::c_int; + pub fn getsockopt(sockfd: ::libc::c_int, level: ::libc::c_int, + optname: ::libc::c_int, optval: *mut ::libc::c_void, + optlen: *mut socklen_t) -> ::libc::c_int; + pub fn listen(sockfd: ::libc::c_int, backlog: ::libc::c_int) + -> ::libc::c_int; + pub fn recv(sockfd: ::libc::c_int, buf: *mut ::libc::c_void, len: size_t, + flags: ::libc::c_int) -> ssize_t; + pub fn recvfrom(sockfd: ::libc::c_int, buf: *mut ::libc::c_void, + len: size_t, flags: ::libc::c_int, + src_addr: *mut sockaddr, addrlen: *mut socklen_t) + -> ssize_t; + pub fn send(sockfd: ::libc::c_int, buf: *const ::libc::c_void, + len: size_t, flags: ::libc::c_int) -> ssize_t; + pub fn sendto(sockfd: ::libc::c_int, buf: *const ::libc::c_void, + len: size_t, flags: ::libc::c_int, + dest_addr: *const sockaddr, addrlen: socklen_t) -> ssize_t; + pub fn setsockopt(sockfd: ::libc::c_int, level: ::libc::c_int, + optname: ::libc::c_int, optval: *const ::libc::c_void, + optlen: socklen_t) -> ::libc::c_int; + pub fn shutdown(sockfd: ::libc::c_int, how: ::libc::c_int) + -> ::libc::c_int; + pub fn socket(domain: ::libc::c_int, type_: ::libc::c_int, + protocol: ::libc::c_int) -> ::libc::c_int; + pub fn sockatmark(sockfd: ::libc::c_int) -> ::libc::c_int; +} + +use ::types::*; |