summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <syn@sceen.net>2007-08-21 13:31:37 +0000
committerRichard Braun <syn@sceen.net>2007-08-21 13:31:37 +0000
commitd004fd6cb4a24678fce3136dbd0c12620e253b9d (patch)
tree79acdf05e1c1c2201d084fc917e23ff0f4d05e64
parent6dc1c28d958cea275c568cac7015f526ccf76719 (diff)
Suppression du draft.
-rw-r--r--doc/draft160
1 files changed, 0 insertions, 160 deletions
diff --git a/doc/draft b/doc/draft
deleted file mode 100644
index 078f792..0000000
--- a/doc/draft
+++ /dev/null
@@ -1,160 +0,0 @@
-Interface
-=========
-
-tnt_socket
-----------
-
-int tnt_socket(int domain, int type, int protocol);
-
-domain: PF_INET
-type: SOCK_STREAM
-protocol: 0 or 6
-(internally, the protocol is changed to 69).
-
-
-tnt_bind
---------
-
-int tnt_bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen);
-
-struct in_addr
-{
- uint32_t s_addr;
-};
-
-struct sockaddr_in
-{
- uint16_t sin_port;
- struct in_addr sin_addr;
-};
-
-
-tnt_listen
-----------
-
-int tnt_listen(int sockfd, int backlog);
-
-backlog is the maximum number of existing connections (even if not fully
-established).
-
-
-tnt_accept
-----------
-
-int tnt_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
-
-
-tnt_connect
---------
-
-int tnt_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen);
-
-
-tnt_send
---------
-
-ssize_t send(int s, const void *buf, size_t len, int flags);
-
-flags: MSG_DONTWAIT, MSG_NOSIGNAL
-
-
-tnt_recv
---------
-
-ssize_t recv(int s, void *buf, size_t len, int flags);
-
-flags: MSG_DONTWAIT
-
-
-tnt_shutdown
---------
-
-int shutdown(int s, int how);
-
-how: SHUT_RD, SHUT_WR, SHUT_RDWR
-
-
-tnt_close
---------
-
-int close(int fd);
-
-
-Internal structures
-===================
-
-typedef int tnt_error_t;
-
-struct tnt_hdr
-{
- unsigned int src_port:16;
- unsigned int dst_port:16;
- unsigned int seq_num:32;
- unsigned int ack_num:32;
- unsigned int data_offset:4;
- unsigned int reserved:6;
- unsigned int urg:1;
- unsigned int ack:1;
- unsigned int psh:1;
- unsigned int rst:1;
- unsigned int syn:1;
- unsigned int fin:1;
- unsigned int window:16;
- unsigned int checksum:16;
- unsigned int urg_ptr:16;
- uint8_t data[0];
-};
-
-typedef struct tnt_hdr * tnt_hdr_t;
-#define TNT_HDR_NULL ((tnt_hdr_t)0)
-
-struct tnt_sock
-{
- int state;
- in_addr_t src_addr;
- in_addr_t dst_addr;
- uint16_t src_port;
- uint16_t dst_port;
- uint32_t local_mss;
- uint32_t remote_mss;
-};
-
-typedef struct tnt_sock * tnt_sock_t;
-#define TNT_STATE_NULL ((tnt_sock_t)0)
-
-
-Primitives
-==========
-
-struct tnt_sock_index
-{
- in_addr_t src_addr;
- in_addr_t dst_addr;
- uint16_t src_port;
- uint16_t dst_port;
-};
-
-/*
- * Get state from header.
- */
-tnt_sock_t tnt_sock_lookup(tnt_hdr_t packet);
-
-size_t
-tnt_sock_hash(tnt_sock_index index)
-{
- return (size_t)((src_addr + dst_addr + src_port + dst_port)
- & tnt_sock_hash_mask);
-}
-
-/*
- * Receiver main loop.
- *
- * => syn
- */
-void tnt_receive(void);
-
-tnt_error_t tnt_send_data();
-tnt_error_t tnt_send_ack();
-tnt_error_t tnt_send_rst();
-
-test