diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-09-09 17:20:56 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-09-09 17:20:56 +0000 |
commit | 7a65f932826220c741ffbf5698b48692a787d915 (patch) | |
tree | 825e048f8fc18b7e69cb155ad96b7254566a3ffe /nuttx/net/net-internal.h | |
parent | d12e00bdd6ffbb39ab5d45d5d5a484d293108021 (diff) | |
download | px4-nuttx-7a65f932826220c741ffbf5698b48692a787d915.tar.gz px4-nuttx-7a65f932826220c741ffbf5698b48692a787d915.tar.bz2 px4-nuttx-7a65f932826220c741ffbf5698b48692a787d915.zip |
Implement TCP send; remove uIP proto-sockets
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@339 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/net-internal.h')
-rw-r--r-- | nuttx/net/net-internal.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/nuttx/net/net-internal.h b/nuttx/net/net-internal.h index b62099a16..f517f863d 100644 --- a/nuttx/net/net-internal.h +++ b/nuttx/net/net-internal.h @@ -52,6 +52,26 @@ * Definitions ****************************************************************************/ +/* Definitions of 8-bit socket flags */ + + /* Bits 0:2 : Socket state */ +#define _SF_IDLE 0x00 /* There is no socket activity */ +#define _SF_LISTEN 0x01 /* Socket is listening */ +#define _SF_RECV 0x02 /* Waiting for recv action to complete */ +#define _SF_SEND 0x03 /* Waiting for send action to complete */ +#define _SF_MASK 0x03 /* Mask to isolate the above actions */ + /* Bits 3:5 : unused */ +#define _SF_BOUND 0x40 /* Bit 6: SOCK_STREAM is bound to an address */ +#define _SF_CONNECTED 0x80 /* Bit 7: SOCK_STREAM is connected */ + +/* Macro to manage the socket state and flags */ + +#define _SS_SETSTATE(s,f) (((s) & ~_SF_MASK) | (f)) +#define _SS_GETSTATE(s) ((s) & _SF_MASK) +#define _SS_ISBUSY(s) (_SS_GETSTATE(s) != _SF_IDLE) +#define _SS_ISCONNECTED(s) (((s) & _SF_CONNECTED) != 0) +#define _SS_ISBOUND(s) (((s) & _SF_CONNECTED) != 0) + /* This macro converts a socket option value into a bit setting */ #define _SO_BIT(o) (1 << (o)) |