소스 검색

Add missing sockaddr_in to platform/src/types.rs

jD91mZM2 6 년 전
부모
커밋
dec5e0a019
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      src/platform/src/types.rs

+ 13 - 0
src/platform/src/types.rs

@@ -131,6 +131,19 @@ pub struct sockaddr {
     pub data: [c_char; 14],
 }
 
+#[repr(C)]
+#[derive(Debug, Clone, Copy)]
+pub struct in_addr {
+    pub s_addr: in_addr_t
+}
+
+#[repr(C)]
+pub struct sockaddr_in {
+    pub sin_family: sa_family_t,
+    pub sin_port: in_port_t,
+    pub sin_addr: in_addr
+}
+
 #[repr(C)]
 pub struct sigaction {
     pub sa_handler: extern "C" fn(c_int),