]> Chaos Git - corbenik/ctrulib.git/commitdiff
fix SOL_SOCKET level options
authorLectem <lectem@gmail.com>
Tue, 6 Oct 2015 16:48:25 +0000 (12:48 -0400)
committerLectem <lectem@gmail.com>
Wed, 7 Oct 2015 19:23:24 +0000 (15:23 -0400)
libctru/include/netinet/in.h
libctru/include/netinet/tcp.h
libctru/include/sys/socket.h

index 795aa04490aaf85c3e6fc0ba9c9363b30db09385..6778855240c970679d6cf32758f6528b7a274740 100644 (file)
@@ -41,4 +41,4 @@ struct sockaddr_in {
 struct ip_mreq  {
        struct in_addr imr_multiaddr;   /* IP multicast address of group */
        struct in_addr imr_interface;   /* local IP address of interface */
-};
\ No newline at end of file
+};
index b95b1276e6f43bbfe3fc54a9161db93d9159015f..3619f94b2fde18b8fccf013898892f0481ae1932 100644 (file)
@@ -1,5 +1,9 @@
 #pragma once
 
-//#define SOL_TCP      ???
+#define SOL_TCP     6    /* TCP level */
 
-//#define TCP_NODELAY  ???
+enum{
+        _CTRU_TCP_OPT = 0x2000,            /* Flag for tcp opt values */
+        TCP_NODELAY   = 1 | _CTRU_TCP_OPT, /* Don't delay send to coalesce packets  */
+        TCP_MAXSEG    = 2 | _CTRU_TCP_OPT,
+};
index 02fa98cfac99182db6978c8ac8dcaf6dad0af17e..597deb22720bef6e60eadae2948fc97db8f6848e 100644 (file)
 #define SHUT_WR                1
 #define SHUT_RDWR      2
 
-#define SO_DEBUG       0x0001
-#define SO_ACCEPTCONN  0x0002
-#define SO_REUSEADDR   0x0004
-#define SO_KEEPALIVE   0x0008
-#define SO_DONTROUTE   0x0010
-#define SO_BROADCAST   0x0020
-#define SO_USELOOPBACK 0x0040
-#define SO_LINGER      0x0080
-#define SO_OOBINLINE   0x0100
-#define SO_REUSEPORT   0x0200
-#define SO_SNDBUF      0x1001
-#define SO_RCVBUF      0x1002
-#define SO_SNDLOWAT    0x1003
-#define SO_RCVLOWAT    0x1004
-#define SO_SNDTIMEO    0x1005
-#define SO_RCVTIMEO    0x1006
-#define SO_ERROR       0x1007
-#define SO_TYPE                0x1008
+//#define SO_DEBUG      0x0001   // not working
+//#define SO_ACCEPTCONN 0x0002   // not working
+#define SO_REUSEADDR    0x0004
+//#define SO_KEEPALIVE  0x0008   // not working
+//#define SO_DONTROUTE  0x0010   // not working
+//#define SO_BROADCAST  0x0020   // not working
+#define SO_USELOOPBACK  0x0040
+#define SO_LINGER       0x0080
+#define SO_OOBINLINE    0x0100
+//#define SO_REUSEPORT  0x0200   // not working
+
+/*
+ * Additional options, not kept in so_options.
+ */
+#define SO_SNDBUF       0x1001      /* send buffer size */
+#define SO_RCVBUF       0x1002      /* receive buffer size */
+#define SO_SNDLOWAT     0x1003      /* send low-water mark */
+#define SO_RCVLOWAT     0x1004      /* receive low-water mark */
+//#define SO_SNDTIMEO   0x1005      /* send timeout */     // not working
+//#define SO_RCVTIMEO   0x1006      /* receive timeout */  // not working
+
+#define SO_TYPE         0x1008      /* get socket type */
+#define SO_ERROR        0x1009      /* get error status and clear */
 
 typedef uint32_t socklen_t;
 typedef uint16_t sa_family_t;