Debian Codegraph @

src/func_tests/test_sctp_sendrecvmsg.c

raw symbols SCIP
1 /* SCTP kernel Implementation
2 * (C) Copyright IBM Corp. 2003
3 * Copyright (c) 2003 Intel Corp.
4 *
5 * The SCTP implementation is free software;
6 * you can redistribute it and/or modify it under the terms of
7 * the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * The SCTP implementation is distributed in the hope that it
12 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
13 * ************************
14 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 * See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU CC; see the file COPYING. If not, write to
19 * the Free Software Foundation, 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
21 *
22 * Please send any bug reports or fixes you make to the
23 * email address(es):
24 * lksctp developers <[email protected]>
25 *
26 * Or submit a bug report through the following website:
27 * https://github.com/sctp/lksctp-tools/
28 *
29 * Any bugs reported to us we will try to fix... any fixes shared will
30 * be incorporated into the next SCTP release.
31 *
32 * Written or modified by:
33 * To compile the v6 version, set the symbol TEST_V6 to 1.
34 *
35 * Written or modified by:
36 * Ardelle Fan <[email protected]>
37 * Sridhar Samudrala <[email protected]>
38 */
39
40 /* This is a basic functional test for the SCTP new library APIs
41 * sctp_sendmsg() and sctp_recvmsg(). test_timetolive.c is rewritten using
42 * these new APIs.
43 */
44
45 #include <stdio.h>
46 #include <unistd.h>
47 #include <stdlib.h>
48 #include <string.h>
49 #include <sys/types.h>
50 #include <sys/socket.h>
51 #include <sys/uio.h>
52 #include <netinet/in.h>
53 #include <errno.h>
54 #include <netinet/sctp.h>cxx . . $ `<file>/src/include/netinet/sctp.h`/
55 #include <sctputil.h>cxx . . $ `<file>/src/testlib/sctputil.h`/
56
57 char *TCIDcxx . . $ TCID. = __FILE__;
58 int TST_TOTALcxx . . $ TST_TOTAL. = 10;
59 int TST_CNTcxx . . $ TST_CNT. = 0;
60
61 /* RCVBUF value, and indirectly RWND*2 */
62 #define SMALL_RCVBUFcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:62:9`! 3000
63 #define SMALL_MAXSEGcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:63:9`! 500
64 /* This is extra data length to ensure rwnd closes */
65 #define RWND_SLOPcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:65:9`! 100
66 static char *fillmsgcxx . . $ fillmsg. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
67 static char *ttlmsgcxx . . $ ttlmsg. = "This should time out!\n";
68 static char *nottlmsgcxx . . $ nottlmsg. = "This should NOT time out!\n";
69 static char ttlfragcxx . . $ ttlfrag.[SMALL_MAXSEGcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:63:9`!*3] = {0};
70 static char *messagecxx . . $ message. = "Hello world\n";
71
72 int maincxx . . $ main(afcd3168fc1188a4).(int argc, char *argv[])
73 {
74 int sk1, sk2;
75 sockaddr_storage_tcxx . . $ sockaddr_storage_t# loop1;
76 sockaddr_storage_tcxx . . $ sockaddr_storage_t# loop2;
77 sockaddr_storage_tcxx . . $ sockaddr_storage_t# msgname;
78 int error;
79 int pf_class;
80 uint32_tcxx . . $ uint32_t# ppid;
81 uint32_tcxx . . $ uint32_t# stream;
82 struct sctp_event_subscribecxx . . $ sctp_event_subscribe# subscribe;
83 char *big_buffer;
84 int offset, msg_flags;
85 socklen_tcxx . . $ socklen_t# msgname_len;
86 size_t buflen;
87 struct sctp_send_failedcxx . . $ sctp_send_failed# *ssf;
88 struct sctp_sndrcvinfocxx . . $ sctp_sndrcvinfo# sinfo;
89 struct sctp_sndrcvinfocxx . . $ sctp_sndrcvinfo# snd_sinfo;
90 sctp_assoc_tcxx . . $ sctp_assoc_t# associd1;
91 socklen_tcxx . . $ socklen_t# len, oldlen;
92 struct sctp_statuscxx . . $ sctp_status# gstatus;
93
94 /* Rather than fflush() throughout the code, set stdout to
95 * be unbuffered.
96 */
97 setvbufcxx . . $ setvbuf(4da3ba8c983f31bc).(stdoutcxx . . $ `<external>/232824719582829767/stdio.h:158:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, _IONBFcxx . . $ `<external>/232824719582829767/stdio.h:100:9`!, 0);
98
99 /* Set some basic values which depend on the address family. */
100 #if TEST_V6
101 pf_class = PF_INET6;
102
103 loop1.v6.sin6_family = AF_INET6;
104 loop1.v6.sin6_addr = in6addr_loopbackcxx . . $ in6addr_loopback.;
105 loop1.v6.sin6_port = htons(SCTP_TESTPORT_1);
106
107 loop2.v6.sin6_family = AF_INET6;
108 loop2.v6.sin6_addr = in6addr_loopbackcxx . . $ in6addr_loopback.;
109 loop2.v6.sin6_port = htons(SCTP_TESTPORT_2);
110 #else
111 pf_class = PF_INETcxx . . $ `<external>/8962547315054503424/socket.h:45:9`!;
112
113 loop1.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_familycxx . . $ sockaddr_in#sin_family. = AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!;
114 loop1.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_addrcxx . . $ sockaddr_in#sin_addr..s_addrcxx . . $ in_addr#s_addr. = SCTP_IP_LOOPBACKcxx . . $ `src/testlib/sctputil.h:76:9`!;
115 loop1.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_portcxx . . $ sockaddr_in#sin_port. = htonscxx . . $ `<external>/9581057695539925927/in.h:431:12`!(SCTP_TESTPORT_1cxx . . $ `src/testlib/sctputil.h:71:9`!);
116
117 loop2.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_familycxx . . $ sockaddr_in#sin_family. = AF_INETcxx . . $ `<external>/8962547315054503424/socket.h:97:9`!;
118 loop2.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_addrcxx . . $ sockaddr_in#sin_addr..s_addrcxx . . $ in_addr#s_addr. = SCTP_IP_LOOPBACKcxx . . $ `src/testlib/sctputil.h:76:9`!;
119 loop2.v4cxx . . $ $anonymous_type_f8e963888af85862_0#v4..sin_portcxx . . $ sockaddr_in#sin_port. = htonscxx . . $ `<external>/9581057695539925927/in.h:431:12`!(SCTP_TESTPORT_2cxx . . $ `src/testlib/sctputil.h:73:9`!);
120 #endif /* TEST_V6 */
121
122 /* Create the two endpoints which will talk to each other. */
123 sk1 = test_socketcxx . . $ test_socket(2326284602b0bb2d).(pf_class, SOCK_SEQPACKETcxx . . $ `<external>/5956532346368192945/socket_type.h:38:9`!, IPPROTO_SCTPcxx . . $ `<external>/9581057695539925927/in.h:87:9`!);
124 sk2 = test_socketcxx . . $ test_socket(2326284602b0bb2d).(pf_class, SOCK_SEQPACKETcxx . . $ `<external>/5956532346368192945/socket_type.h:38:9`!, IPPROTO_SCTPcxx . . $ `<external>/9581057695539925927/in.h:87:9`!);
125
126 /* Set the MAXSEG to something smallish. */
127 {
128 int val = SMALL_MAXSEGcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:63:9`!;
129 test_setsockoptcxx . . $ test_setsockopt(57908ac6eaa2fecc).(sk1, SCTP_MAXSEGcxx . . $ `<external>/17169092326581286071/sctp.h:82:9`!, &val, sizeof(val));
130 }
131
132 memsetcxx . . $ memset(d1de1e4fb215f1c6).(&subscribe, 0, sizeof(subscribe));
133 subscribe.sctp_data_io_eventcxx . . $ sctp_event_subscribe#sctp_data_io_event. = 1;
134 subscribe.sctp_association_eventcxx . . $ sctp_event_subscribe#sctp_association_event. = 1;
135 subscribe.sctp_send_failure_eventcxx . . $ sctp_event_subscribe#sctp_send_failure_event. = 1;
136 test_setsockoptcxx . . $ test_setsockopt(57908ac6eaa2fecc).(sk1, SCTP_EVENTScxx . . $ `<external>/17169092326581286071/sctp.h:80:9`!, &subscribe, sizeof(subscribe));
137 test_setsockoptcxx . . $ test_setsockopt(57908ac6eaa2fecc).(sk2, SCTP_EVENTScxx . . $ `<external>/17169092326581286071/sctp.h:80:9`!, &subscribe, sizeof(subscribe));
138
139 /* Bind these sockets to the test ports. */
140 test_bindcxx . . $ test_bind(18e507052d945257).(sk1, &loop1.sacxx . . $ $anonymous_type_f8e963888af85862_0#sa., sizeof(loop1));
141 test_bindcxx . . $ test_bind(18e507052d945257).(sk2, &loop2.sacxx . . $ $anonymous_type_f8e963888af85862_0#sa., sizeof(loop2));
142
143 /*
144 * Set the RWND small so we can fill it up easily.
145 */
146 len = sizeof(int);
147 error = getsockoptcxx . . $ getsockopt(b79d9f11efef15f9).(sk2, SOL_SOCKETcxx . . $ `<external>/9030916627833342711/socket.h:9:9`!, SO_RCVBUFcxx . . $ `<external>/9030916627833342711/socket.h:18:9`!, &oldlen, &len);
148
149 if (error)
150 tst_brkmcxx . . $ `src/testlib/sctputil.h:116:9`!(TBROK, tst_exit, "can't get rcvbuf size: %s",
151 strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!));
152
153 len = SMALL_RCVBUFcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:62:9`!; /* Really becomes 2xlen when set. */
154
155 error = setsockoptcxx . . $ setsockopt(506cc1d0fc70fdf1).(sk2, SOL_SOCKETcxx . . $ `<external>/9030916627833342711/socket.h:9:9`!, SO_RCVBUFcxx . . $ `<external>/9030916627833342711/socket.h:18:9`!, &len, sizeof(len));
156 if (error)
157 tst_brkmcxx . . $ `src/testlib/sctputil.h:116:9`!(TBROK, tst_exit, "setsockopt(SO_RCVBUF): %s",
158 strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!));
159
160 /* Mark sk2 as being able to accept new associations. */
161 test_listencxx . . $ test_listen(9b79fb6aee4c0440).(sk2, 1);
162
163 /* Send the first message. This will create the association. */
164 ppid = randcxx . . $ rand(b126dc7c1de90089).();
165 stream = 1;
166 test_sctp_sendmsgcxx . . $ test_sctp_sendmsg(9dfe5aa294f24c42).(sk1, messagecxx . . $ message., strlencxx . . $ strlen(751346f8406fd082).(messagecxx . . $ message.) + 1,
167 (struct sockaddrcxx . . $ sockaddr# *)&loop2, sizeof(loop2),
168 ppid, 0, stream, 0, 0);
169
170 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_sendmsg");
171
172 /* Get the communication up message on sk2. */
173 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
174 big_buffer = test_malloccxx . . $ test_malloc(bfcfa4d6b7f7ef64).(buflen);
175 msgname_len = sizeof(msgname);
176 msg_flags = 0;
177 error = test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk2, big_buffer, buflen,
178 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
179 &sinfo, &msg_flags);
180 #if 0
181 associd2 = ((struct sctp_assoc_change *)big_buffer)->sac_assoc_id;
182 #endif
183 test_check_buf_notificationcxx . . $ test_check_buf_notification(a530689182f1c6cd).(big_buffer, error, msg_flags,
184 sizeof(struct sctp_assoc_changecxx . . $ sctp_assoc_change#),
185 SCTP_ASSOC_CHANGEcxx . . $ `<external>/17169092326581286071/sctp.h:666:9`!, SCTP_COMM_UPcxx . . $ SCTP_COMM_UP.);
186
187
188 /* Get the communication up message on sk1. */
189 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
190 msgname_len = sizeof(msgname);
191 msg_flags = 0;
192 error = test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk1, big_buffer, buflen,
193 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
194 &sinfo, &msg_flags);
195 associd1 = ((struct sctp_assoc_changecxx . . $ sctp_assoc_change# *)big_buffer)->sac_assoc_idcxx . . $ sctp_assoc_change#sac_assoc_id.;
196 test_check_buf_notificationcxx . . $ test_check_buf_notification(a530689182f1c6cd).(big_buffer, error, msg_flags,
197 sizeof(struct sctp_assoc_changecxx . . $ sctp_assoc_change#),
198 SCTP_ASSOC_CHANGEcxx . . $ `<external>/17169092326581286071/sctp.h:666:9`!, SCTP_COMM_UPcxx . . $ SCTP_COMM_UP.);
199
200 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_recvmsg SCTP_COMM_UP notification");
201
202 /* Get the first message which was sent. */
203 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
204 msgname_len = sizeof(msgname);
205 msg_flags = 0;
206 error = test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk2, big_buffer, buflen,
207 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
208 &sinfo, &msg_flags);
209 test_check_buf_datacxx . . $ test_check_buf_data(96488715d48893be).(big_buffer, error, msg_flags, &sinfo,
210 strlencxx . . $ strlen(751346f8406fd082).(messagecxx . . $ message.) + 1, MSG_EORcxx . . $ `<external>/8962547315054503424/socket.h:228:9`!, stream, ppid);
211
212 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_recvmsg data");
213
214 /* Figure out how big to make our fillmsg */
215 len = sizeof(struct sctp_statuscxx . . $ sctp_status#);
216 memsetcxx . . $ memset(d1de1e4fb215f1c6).(&gstatus,0,sizeof(struct sctp_statuscxx . . $ sctp_status#));
217 gstatus.sstat_assoc_idcxx . . $ sctp_status#sstat_assoc_id. = associd1;
218 error = getsockoptcxx . . $ getsockopt(b79d9f11efef15f9).(sk1, IPPROTO_SCTPcxx . . $ `<external>/9581057695539925927/in.h:87:9`!, SCTP_STATUScxx . . $ `<external>/17169092326581286071/sctp.h:83:9`!, &gstatus, &len);
219
220 if (error)
221 tst_brkmcxx . . $ `src/testlib/sctputil.h:116:9`!(TBROK, tst_exit, "can't get rwnd size: %s",
222 strerror(errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!));
223 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TINFO, "creating a fillmsg of size %d",
224 gstatus.sstat_rwnd+RWND_SLOPcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:65:9`!);
225 fillmsgcxx . . $ fillmsg. = test_malloccxx . . $ test_malloc(bfcfa4d6b7f7ef64).(gstatus.sstat_rwndcxx . . $ sctp_status#sstat_rwnd.+RWND_SLOPcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:65:9`!);
226
227 /* Send a fillmsg */
228 memsetcxx . . $ memset(d1de1e4fb215f1c6).(fillmsgcxx . . $ fillmsg., 'X', gstatus.sstat_rwndcxx . . $ sctp_status#sstat_rwnd.+RWND_SLOPcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:65:9`!);
229 fillmsgcxx . . $ fillmsg.[gstatus.sstat_rwndcxx . . $ sctp_status#sstat_rwnd.+RWND_SLOPcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:65:9`!-1] = '\0';
230 ppid++;
231 stream++;
232 test_sctp_sendmsgcxx . . $ test_sctp_sendmsg(9dfe5aa294f24c42).(sk1, fillmsgcxx . . $ fillmsg., gstatus.sstat_rwndcxx . . $ sctp_status#sstat_rwnd.+RWND_SLOPcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:65:9`!,
233 (struct sockaddrcxx . . $ sockaddr# *)&loop2, sizeof(loop2),
234 ppid, 0, stream, 0, 0);
235
236 /* Now send a message that will timeout. */
237 test_sctp_sendmsgcxx . . $ test_sctp_sendmsg(9dfe5aa294f24c42).(sk1, ttlmsgcxx . . $ ttlmsg., strlencxx . . $ strlen(751346f8406fd082).(ttlmsgcxx . . $ ttlmsg.) + 1,
238 (struct sockaddrcxx . . $ sockaddr# *)&loop2, sizeof(loop2),
239 ppid, 0, stream, 2000, 0);
240
241 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_sendmsg with ttl");
242
243 /* Next send a message that won't time out. */
244 test_sctp_sendmsgcxx . . $ test_sctp_sendmsg(9dfe5aa294f24c42).(sk1, nottlmsgcxx . . $ nottlmsg., strlencxx . . $ strlen(751346f8406fd082).(nottlmsgcxx . . $ nottlmsg.) + 1,
245 (struct sockaddrcxx . . $ sockaddr# *)&loop2, sizeof(loop2),
246 ppid, 0, stream, 0, 0);
247
248 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_sendmsg with zero ttl");
249
250 /* And finally a fragmented message that will time out. */
251 memsetcxx . . $ memset(d1de1e4fb215f1c6).(ttlfragcxx . . $ ttlfrag., 48, sizeof(ttlfragcxx . . $ ttlfrag.)); /* 48 is the ascii of '0' */
252 ttlfragcxx . . $ ttlfrag.[sizeof(ttlfragcxx . . $ ttlfrag.)-1] = '\0';
253 test_sctp_sendmsgcxx . . $ test_sctp_sendmsg(9dfe5aa294f24c42).(sk1, ttlfragcxx . . $ ttlfrag., sizeof(ttlfragcxx . . $ ttlfrag.),
254 (struct sockaddrcxx . . $ sockaddr# *)&loop2, sizeof(loop2),
255 ppid, 0, stream, 2000, 0);
256
257 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_sendmsg fragmented msg with ttl");
258
259 /* Sleep waiting for the message to time out. */
260 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TINFO, "** SLEEPING for 3 seconds **");
261 sleepcxx . . $ sleep(2141b656ce2cc063).(3);
262
263 /* Get the fillmsg. */
264 do {
265 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
266 msgname_len = sizeof(msgname);
267 msg_flags = 0;
268 test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk2, big_buffer, buflen,
269 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
270 &sinfo, &msg_flags);
271 } while (!(msg_flags & MSG_EORcxx . . $ `<external>/8962547315054503424/socket.h:228:9`!));
272
273 /* Get the message that did NOT time out. */
274 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
275 msgname_len = sizeof(msgname);
276 msg_flags = 0;
277 error = test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk2, big_buffer, buflen,
278 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
279 &sinfo, &msg_flags);
280 test_check_buf_datacxx . . $ test_check_buf_data(96488715d48893be).(big_buffer, error, msg_flags, &sinfo,
281 strlencxx . . $ strlen(751346f8406fd082).(nottlmsgcxx . . $ nottlmsg.) + 1, MSG_EORcxx . . $ `<external>/8962547315054503424/socket.h:228:9`!, stream, ppid);
282 if (0 != strncmpcxx . . $ strncmp(fd278af2f295fa2e).(big_buffer, nottlmsgcxx . . $ nottlmsg., strlencxx . . $ strlen(751346f8406fd082).(nottlmsgcxx . . $ nottlmsg.)))
283 tst_brkmcxx . . $ `src/testlib/sctputil.h:116:9`!(TBROK, tst_exit, "sctp_recvmsg: Wrong Message !!!");
284
285 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_recvmsg msg with zero ttl");
286
287 /* Get the SEND_FAILED notification for the message that DID
288 * time out.
289 */
290 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
291 msgname_len = sizeof(msgname);
292 msg_flags = 0;
293 error = test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk1, big_buffer, buflen,
294 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
295 &sinfo, &msg_flags);
296 test_check_buf_notificationcxx . . $ test_check_buf_notification(a530689182f1c6cd).(big_buffer, error, msg_flags,
297 sizeof(struct sctp_send_failedcxx . . $ sctp_send_failed#) +
298 strlencxx . . $ strlen(751346f8406fd082).(ttlmsgcxx . . $ ttlmsg.) + 1,
299 SCTP_SEND_FAILEDcxx . . $ `<external>/17169092326581286071/sctp.h:670:9`!, 0);
300 ssf = (struct sctp_send_failedcxx . . $ sctp_send_failed# *)big_buffer;
301 if (0 != strncmpcxx . . $ strncmp(fd278af2f295fa2e).(ttlmsgcxx . . $ ttlmsg., (char *)ssf->ssf_datacxx . . $ sctp_send_failed#ssf_data., strlencxx . . $ strlen(751346f8406fd082).(ttlmsgcxx . . $ ttlmsg.) + 1))
302 tst_brkmcxx . . $ `src/testlib/sctputil.h:116:9`!(TBROK, tst_exit, "SEND_FAILED data mismatch");
303
304 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_recvmsg SEND_FAILED for message with ttl");
305
306 offset = 0;
307
308 /* Get the SEND_FAILED notifications for the fragmented message that
309 * timed out.
310 */
311 do {
312 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
313 msgname_len = sizeof(msgname);
314 msg_flags = 0;
315 error = test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk1, big_buffer, buflen,
316 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
317 &sinfo, &msg_flags);
318 test_check_buf_notificationcxx . . $ test_check_buf_notification(a530689182f1c6cd).(big_buffer, error, msg_flags,
319 sizeof(struct sctp_send_failedcxx . . $ sctp_send_failed#) +
320 SMALL_MAXSEGcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:63:9`!,
321 SCTP_SEND_FAILEDcxx . . $ `<external>/17169092326581286071/sctp.h:670:9`!, 0);
322 ssf = (struct sctp_send_failedcxx . . $ sctp_send_failed# *)big_buffer;
323 if (0 != strncmpcxx . . $ strncmp(fd278af2f295fa2e).(&ttlfragcxx . . $ ttlfrag.[offset], (char *)ssf->ssf_datacxx . . $ sctp_send_failed#ssf_data.,
324 SMALL_MAXSEGcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:63:9`!))
325 tst_brkmcxx . . $ `src/testlib/sctputil.h:116:9`!(TBROK, tst_exit, "SEND_FAILED data mismatch");
326 offset += SMALL_MAXSEGcxx . . $ `src/func_tests/test_sctp_sendrecvmsg.c:63:9`!;
327 } while (!(ssf->ssf_infocxx . . $ sctp_send_failed#ssf_info..sinfo_flagscxx . . $ sctp_sndrcvinfo#sinfo_flags. & 0x01)); /* LAST FRAG */
328
329 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_recvmsg SEND_FAILED for fragmented message with "
330 "ttl");
331
332 snd_sinfo.sinfo_ppidcxx . . $ sctp_sndrcvinfo#sinfo_ppid. = randcxx . . $ rand(b126dc7c1de90089).();
333 snd_sinfo.sinfo_flagscxx . . $ sctp_sndrcvinfo#sinfo_flags. = 0;
334 snd_sinfo.sinfo_streamcxx . . $ sctp_sndrcvinfo#sinfo_stream. = 2;
335 snd_sinfo.sinfo_timetolivecxx . . $ sctp_sndrcvinfo#sinfo_timetolive. = 0;
336 snd_sinfo.sinfo_assoc_idcxx . . $ sctp_sndrcvinfo#sinfo_assoc_id. = associd1;
337 test_sctp_sendcxx . . $ test_sctp_send(c4e71a463395ee45).(sk1, messagecxx . . $ message., strlencxx . . $ strlen(751346f8406fd082).(messagecxx . . $ message.) + 1, &snd_sinfo,
338 MSG_NOSIGNALcxx . . $ `<external>/8962547315054503424/socket.h:242:9`!);
339
340 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
341 msgname_len = sizeof(msgname);
342 msg_flags = 0;
343 error = test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk2, big_buffer, buflen,
344 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
345 &sinfo, &msg_flags);
346 test_check_buf_datacxx . . $ test_check_buf_data(96488715d48893be).(big_buffer, error, msg_flags, &sinfo,
347 strlencxx . . $ strlen(751346f8406fd082).(messagecxx . . $ message.) + 1, MSG_EORcxx . . $ `<external>/8962547315054503424/socket.h:228:9`!, snd_sinfo.sinfo_streamcxx . . $ sctp_sndrcvinfo#sinfo_stream.,
348 snd_sinfo.sinfo_ppidcxx . . $ sctp_sndrcvinfo#sinfo_ppid.);
349
350 tst_resmcxx . . $ `src/testlib/sctputil.h:123:9`!(TPASS, "sctp_send");
351
352 /* Shut down the link. */
353 closecxx . . $ close(7864480464b09eea).(sk1);
354
355 /* Get the shutdown complete notification. */
356 buflen = REALLY_BIGcxx . . $ `src/testlib/sctputil.h:65:9`!;
357 msgname_len = sizeof(msgname);
358 msg_flags = 0;
359 error = test_sctp_recvmsgcxx . . $ test_sctp_recvmsg(62d9b9aeeaca6e3f).(sk2, big_buffer, buflen,
360 (struct sockaddrcxx . . $ sockaddr# *)&msgname, &msgname_len,
361 &sinfo, &msg_flags);
362 test_check_buf_notificationcxx . . $ test_check_buf_notification(a530689182f1c6cd).(big_buffer, error, msg_flags,
363 sizeof(struct sctp_assoc_changecxx . . $ sctp_assoc_change#),
364 SCTP_ASSOC_CHANGEcxx . . $ `<external>/17169092326581286071/sctp.h:666:9`!, SCTP_SHUTDOWN_COMPcxx . . $ SCTP_SHUTDOWN_COMP.);
365
366 closecxx . . $ close(7864480464b09eea).(sk2);
367
368 freecxx . . $ free(5d22bdacc48458e8).(big_buffer);
369 freecxx . . $ free(5d22bdacc48458e8).(fillmsgcxx . . $ fillmsg.);
370
371 /* Indicate successful completion. */
372 return 0;
373 }