Skip to content
Snippets Groups Projects
Commit 2a40ab7c authored by Michael Tüxen's avatar Michael Tüxen
Browse files

Some cleanups and introducing htonl.

parent 4ca0917b
No related branches found
No related tags found
No related merge requests found
......@@ -171,6 +171,7 @@ revents return REVENTS;
onoff return ONOFF;
linger return LINGER;
htons return _HTONS_;
htonl return _HTONL_;
ipv4 return IPV4;
ipv6 return IPV6;
icmp return ICMP;
......
......@@ -493,7 +493,7 @@ static struct tcp_option *new_tcp_fast_open_option(const char *cookie_string,
* have ALL_CAPS names, and nonterminal symbols have lower_case names.
*/
%token ELLIPSIS
%token <reserved> SA_FAMILY SIN_PORT SIN_ADDR _HTONS_ INET_ADDR
%token <reserved> SA_FAMILY SIN_PORT SIN_ADDR _HTONS_ _HTONL_ INET_ADDR
%token <reserved> MSG_NAME MSG_IOV MSG_FLAGS
%token <reserved> FD EVENTS REVENTS ONOFF LINGER
%token <reserved> ACK ECR EOL MSS NOP SACK SACKOK TIMESTAMP VAL WIN WSCALE PRO
......@@ -591,7 +591,7 @@ static struct tcp_option *new_tcp_fast_open_option(const char *cookie_string,
%type <expression> sasoc_local_rwnd sasoc_cookie_life sctp_assocparams
%type <expression> sctp_sndinfo snd_sid snd_flags snd_ppid snd_context
%type <expression> sctp_event se_type se_on sctp_setadaptation null
%type <expression> sctp_sndrcvinfo sinfo_stream sinfo_ssn sinfo_flags sinfo_ppid sinfo_context
%type <expression> sctp_sndrcvinfo sinfo_stream sinfo_ssn sinfo_flags sinfo_ppid sinfo_context
%type <expression> sinfo_timetolive sinfo_tsn sinfo_cumtsn
%type <errno_info> opt_errno
%type <chunk_list> sctp_chunk_list_spec
......@@ -2649,26 +2649,18 @@ sctp_initmsg
sctp_stream_value
: '{' STREAM_ID '=' expression ',' STREAM_VALUE '=' expression '}' {
#if defined(SCTP_SS_VALUE)
$$ = new_expression(EXPR_SCTP_STREAM_VALUE);
$$->value.sctp_stream_value = calloc(1, sizeof(struct sctp_stream_value_expr));
$$->value.sctp_stream_value->stream_id = $4;
$$->value.sctp_stream_value->stream_value = $8;
#else
$$ = NULL;
#endif
}
;
sctp_assoc_value
: '{' ASSOC_VALUE '=' expression '}' {
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED)
$$ = new_expression(EXPR_SCTP_ASSOC_VALUE);
$$->value.sctp_assoc_value = calloc(1, sizeof(struct sctp_assoc_value_expr));
$$->value.sctp_assoc_value->assoc_value = $4;
#else
$$ = NULL;
#endif
}
;
......
+0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
+0.0 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0.0 bind(3, ..., ...) = 0
// Check the handshake with an empty(!) cookie
+0.1 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.0 > sctp: INIT[flgs=0, tag=1, a_rwnd=..., os=..., is=..., tsn=1, ...]
+0.1 < sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=1500, os=1, is=1, tsn=1, STATE_COOKIE[len=4, val=...]]
+0.1 < sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=1500, os=16, is=16, tsn=1, STATE_COOKIE[len=4, val=...]]
+0.0 > sctp: COOKIE_ECHO[flgs=0, len=4, val=...]
+0.1 < sctp: COOKIE_ACK[flgs=0]
+0.0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
//sctp_sendmsg(int sd, const void * msg, size_t len, struct sockaddr *to, socklen_t tolen,
//sctp_sendmsg(int sd, const void * msg, size_t len, struct sockaddr *to, socklen_t tolen,
// uint32_t ppid, uint32_t flags, uint16_t stream_no, uint32_t timetolive, uint32_t context);
+0.0 sctp_sendmsg(3, ..., 1000, ..., ..., 0, 0, 0, 0, 0) = 1000
+0.0 > sctp: DATA[flgs=BE, len=1016, tsn=1, sid=0, ssn=0, ppid=0]
+0.0 sctp_sendmsg(3, ..., 1000, ..., ..., 1234, SCTP_UNORDERED, 1, 0, 0) = 1000
+0.0 > sctp: DATA[flgs=UBE, len=1016, tsn=1, sid=1, ssn=0, ppid=1234]
+0.0 < sctp: SACK[flgs=0, cum_tsn=1, a_rwnd=1500, gaps=[], dups=[]]
+0.0 sctp_sendmsg(3, ..., 1000, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("192.0.2.1")}, 16, 0, 0, 0, 0, 0) = 1000
+0.0 > sctp: DATA[flgs=BE, len=1016, tsn=2, sid=0, ssn=1, ppid=0]
+0.0 > sctp: DATA[flgs=BE, len=1016, tsn=2, sid=0, ssn=0, ppid=0]
+0.0 < sctp: SACK[flgs=0, cum_tsn=2, a_rwnd=1500, gaps=[], dups=[]]
+0.0 sctp_sendmsg(3, ..., 1000, NULL, 0, 0, 0, 0, 0, 0) = 1000
+0.0 > sctp: DATA[flgs=BE, len=1016, tsn=3, sid=0, ssn=2, ppid=0]
+0.0 > sctp: DATA[flgs=BE, len=1016, tsn=3, sid=0, ssn=1, ppid=0]
+0.0 < sctp: SACK[flgs=0, cum_tsn=3, a_rwnd=1500, gaps=[], dups=[]]
+0.0 close(3) = 0
+0.0 > sctp: SHUTDOWN[flgs=0, cum_tsn=0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment