flooder.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. /**
  2. * @file flooder.c
  3. * @author Ambroz Bizjak <[email protected]>
  4. *
  5. * @section LICENSE
  6. *
  7. * This file is part of BadVPN.
  8. *
  9. * BadVPN is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation.
  12. *
  13. * BadVPN is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. */
  22. #include <stdint.h>
  23. #include <stdlib.h>
  24. #include <string.h>
  25. #include <stdio.h>
  26. #include <protocol/addr.h>
  27. #include <protocol/scproto.h>
  28. #include <misc/loglevel.h>
  29. #include <misc/version.h>
  30. #include <misc/nsskey.h>
  31. #include <misc/byteorder.h>
  32. #include <misc/loggers_string.h>
  33. #include <misc/dead.h>
  34. #include <system/BLog.h>
  35. #include <system/BReactor.h>
  36. #include <system/BSignal.h>
  37. #include <flow/SinglePacketBuffer.h>
  38. #include <flow/PacketProtoEncoder.h>
  39. #include <nspr_support/DummyPRFileDesc.h>
  40. #include <nspr_support/BSocketPRFileDesc.h>
  41. #include <server_connection/ServerConnection.h>
  42. #ifndef BADVPN_USE_WINAPI
  43. #include <system/BLog_syslog.h>
  44. #endif
  45. #include <flooder/flooder.h>
  46. #include <generated/blog_channel_flooder.h>
  47. #define LOGGER_STDOUT 1
  48. #define LOGGER_SYSLOG 2
  49. // program dead variable
  50. dead_t dead;
  51. // command-line options
  52. struct {
  53. int help;
  54. int version;
  55. int logger;
  56. #ifndef BADVPN_USE_WINAPI
  57. char *logger_syslog_facility;
  58. char *logger_syslog_ident;
  59. #endif
  60. int loglevel;
  61. int loglevels[BLOG_NUM_CHANNELS];
  62. int ssl;
  63. char *nssdb;
  64. char *client_cert_name;
  65. char *server_name;
  66. char *server_addr;
  67. peerid_t floods[MAX_FLOODS];
  68. int num_floods;
  69. } options;
  70. // server address we connect to
  71. BAddr server_addr;
  72. // server name to use for SSL
  73. char server_name[256];
  74. // reactor
  75. BReactor ss;
  76. // client certificate if using SSL
  77. CERTCertificate *client_cert;
  78. // client private key if using SSL
  79. SECKEYPrivateKey *client_key;
  80. // server connection
  81. ServerConnection server;
  82. // whether server is ready
  83. int server_ready;
  84. // my ID, defined only after server_ready
  85. peerid_t my_id;
  86. // flooding output
  87. PacketRecvInterface flood_source;
  88. PacketProtoEncoder flood_encoder;
  89. SinglePacketBuffer flood_buffer;
  90. // whether we were asked for a packet and blocked
  91. int flood_blocking;
  92. // index of next peer to send packet too
  93. int flood_next;
  94. /**
  95. * Cleans up everything that can be cleaned up from inside the event loop.
  96. */
  97. static void terminate (void);
  98. /**
  99. * Prints command line help.
  100. */
  101. static void print_help (const char *name);
  102. /**
  103. * Prints program name, version and copyright notice.
  104. */
  105. static void print_version (void);
  106. /**
  107. * Parses command line options into the options strucute.
  108. *
  109. * @return 1 on success, 0 on failure
  110. */
  111. static int parse_arguments (int argc, char *argv[]);
  112. /**
  113. * Processes command line options.
  114. *
  115. * @return 1 on success, 0 on failure
  116. */
  117. static int resolve_arguments (void);
  118. /**
  119. * Handler invoked when program termination is requested.
  120. */
  121. static void signal_handler (void *unused);
  122. static void server_handler_error (void *user);
  123. static void server_handler_ready (void *user, peerid_t param_my_id, uint32_t ext_ip);
  124. static void server_handler_newclient (void *user, peerid_t peer_id, int flags, const uint8_t *cert, int cert_len);
  125. static void server_handler_endclient (void *user, peerid_t peer_id);
  126. static void server_handler_message (void *user, peerid_t peer_id, uint8_t *data, int data_len);
  127. static void flood_source_handler_recv (void *user, uint8_t *data);
  128. int main (int argc, char *argv[])
  129. {
  130. if (argc <= 0) {
  131. return 1;
  132. }
  133. // init dead variable
  134. DEAD_INIT(dead);
  135. // parse command-line arguments
  136. if (!parse_arguments(argc, argv)) {
  137. fprintf(stderr, "Failed to parse arguments\n");
  138. print_help(argv[0]);
  139. goto fail0;
  140. }
  141. // handle --help and --version
  142. if (options.help) {
  143. print_version();
  144. print_help(argv[0]);
  145. return 0;
  146. }
  147. if (options.version) {
  148. print_version();
  149. return 0;
  150. }
  151. // initialize logger
  152. switch (options.logger) {
  153. case LOGGER_STDOUT:
  154. BLog_InitStdout();
  155. break;
  156. #ifndef BADVPN_USE_WINAPI
  157. case LOGGER_SYSLOG:
  158. if (!BLog_InitSyslog(options.logger_syslog_ident, options.logger_syslog_facility)) {
  159. fprintf(stderr, "Failed to initialize syslog logger\n");
  160. goto fail0;
  161. }
  162. break;
  163. #endif
  164. default:
  165. ASSERT(0);
  166. }
  167. // configure logger channels
  168. for (int i = 0; i < BLOG_NUM_CHANNELS; i++) {
  169. if (options.loglevels[i] >= 0) {
  170. BLog_SetChannelLoglevel(i, options.loglevels[i]);
  171. }
  172. else if (options.loglevel >= 0) {
  173. BLog_SetChannelLoglevel(i, options.loglevel);
  174. }
  175. }
  176. BLog(BLOG_NOTICE, "initializing "GLOBAL_PRODUCT_NAME" "PROGRAM_NAME" "GLOBAL_VERSION);
  177. // initialize sockets
  178. if (BSocket_GlobalInit() < 0) {
  179. BLog(BLOG_ERROR, "BSocket_GlobalInit failed");
  180. goto fail1;
  181. }
  182. // init time
  183. BTime_Init();
  184. // resolve addresses
  185. if (!resolve_arguments()) {
  186. BLog(BLOG_ERROR, "Failed to resolve arguments");
  187. goto fail1;
  188. }
  189. // init reactor
  190. if (!BReactor_Init(&ss)) {
  191. BLog(BLOG_ERROR, "BReactor_Init failed");
  192. goto fail1;
  193. }
  194. // setup signal handler
  195. if (!BSignal_Init(&ss, signal_handler, NULL)) {
  196. BLog(BLOG_ERROR, "BSignal_Init failed");
  197. goto fail1a;
  198. }
  199. if (options.ssl) {
  200. // init NSPR
  201. PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
  202. // register local NSPR file types
  203. if (!DummyPRFileDesc_GlobalInit()) {
  204. BLog(BLOG_ERROR, "DummyPRFileDesc_GlobalInit failed");
  205. goto fail2;
  206. }
  207. if (!BSocketPRFileDesc_GlobalInit()) {
  208. BLog(BLOG_ERROR, "BSocketPRFileDesc_GlobalInit failed");
  209. goto fail2;
  210. }
  211. // init NSS
  212. if (NSS_Init(options.nssdb) != SECSuccess) {
  213. BLog(BLOG_ERROR, "NSS_Init failed (%d)", (int)PR_GetError());
  214. goto fail2;
  215. }
  216. // set cipher policy
  217. if (NSS_SetDomesticPolicy() != SECSuccess) {
  218. BLog(BLOG_ERROR, "NSS_SetDomesticPolicy failed (%d)", (int)PR_GetError());
  219. goto fail3;
  220. }
  221. // init server cache
  222. if (SSL_ConfigServerSessionIDCache(0, 0, 0, NULL) != SECSuccess) {
  223. BLog(BLOG_ERROR, "SSL_ConfigServerSessionIDCache failed (%d)", (int)PR_GetError());
  224. goto fail3;
  225. }
  226. // open server certificate and private key
  227. if (!open_nss_cert_and_key(options.client_cert_name, &client_cert, &client_key)) {
  228. BLog(BLOG_ERROR, "Cannot open certificate and key");
  229. goto fail4;
  230. }
  231. }
  232. // start connecting to server
  233. if (!ServerConnection_Init(
  234. &server, &ss, server_addr, SC_KEEPALIVE_INTERVAL, SERVER_BUFFER_MIN_PACKETS, options.ssl, client_cert, client_key, server_name, NULL,
  235. server_handler_error, server_handler_ready, server_handler_newclient, server_handler_endclient, server_handler_message
  236. )) {
  237. BLog(BLOG_ERROR, "ServerConnection_Init failed");
  238. goto fail5;
  239. }
  240. // set server not ready
  241. server_ready = 0;
  242. goto event_loop;
  243. // cleanup on error
  244. fail5:
  245. if (options.ssl) {
  246. CERT_DestroyCertificate(client_cert);
  247. SECKEY_DestroyPrivateKey(client_key);
  248. fail4:
  249. SSL_ShutdownServerSessionIDCache();
  250. fail3:
  251. SSL_ClearSessionCache();
  252. ASSERT_FORCE(NSS_Shutdown() == SECSuccess)
  253. fail2:
  254. ASSERT_FORCE(PR_Cleanup() == PR_SUCCESS)
  255. PL_ArenaFinish();
  256. }
  257. BSignal_Finish();
  258. fail1a:
  259. BReactor_Free(&ss);
  260. fail1:
  261. BLog(BLOG_ERROR, "initialization failed");
  262. BLog_Free();
  263. fail0:
  264. // finish objects
  265. DebugObjectGlobal_Finish();
  266. return 1;
  267. event_loop:
  268. // enter event loop
  269. BLog(BLOG_NOTICE, "entering event loop");
  270. int ret = BReactor_Exec(&ss);
  271. // free reactor
  272. BReactor_Free(&ss);
  273. // free logger
  274. BLog(BLOG_NOTICE, "exiting");
  275. BLog_Free();
  276. // finish objects
  277. DebugObjectGlobal_Finish();
  278. return ret;
  279. }
  280. void terminate (void)
  281. {
  282. BLog(BLOG_NOTICE, "tearing down");
  283. if (server_ready) {
  284. // free flooding
  285. // free buffer
  286. SinglePacketBuffer_Free(&flood_buffer);
  287. // free encoder
  288. PacketProtoEncoder_Free(&flood_encoder);
  289. // free source
  290. PacketRecvInterface_Free(&flood_source);
  291. }
  292. // free server
  293. ServerConnection_Free(&server);
  294. if (options.ssl) {
  295. // free client certificate and private key
  296. CERT_DestroyCertificate(client_cert);
  297. SECKEY_DestroyPrivateKey(client_key);
  298. // free server cache
  299. ASSERT_FORCE(SSL_ShutdownServerSessionIDCache() == SECSuccess)
  300. // free client cache
  301. SSL_ClearSessionCache();
  302. // free NSS
  303. ASSERT_FORCE(NSS_Shutdown() == SECSuccess)
  304. // free NSPR
  305. ASSERT_FORCE(PR_Cleanup() == PR_SUCCESS)
  306. PL_ArenaFinish();
  307. }
  308. // remove signal handler
  309. BSignal_Finish();
  310. // kill dead variable
  311. DEAD_KILL(dead);
  312. // exit reactor
  313. BReactor_Quit(&ss, 1);
  314. }
  315. void print_help (const char *name)
  316. {
  317. printf(
  318. "Usage:\n"
  319. " %s\n"
  320. " [--help]\n"
  321. " [--version]\n"
  322. " [--logger <"LOGGERS_STRING">]\n"
  323. #ifndef BADVPN_USE_WINAPI
  324. " (logger=syslog?\n"
  325. " [--syslog-facility <string>]\n"
  326. " [--syslog-ident <string>]\n"
  327. " )\n"
  328. #endif
  329. " [--loglevel <0-5/none/error/warning/notice/info/debug>]\n"
  330. " [--channel-loglevel <channel-name> <0-5/none/error/warning/notice/info/debug>] ...\n"
  331. " [--ssl --nssdb <string> --client-cert-name <string>]\n"
  332. " [--server-name <string>]\n"
  333. " --server-addr <addr>\n"
  334. " [--flood-id <id>] ...\n"
  335. "Address format is a.b.c.d:port (IPv4) or [addr]:port (IPv6).\n",
  336. name
  337. );
  338. }
  339. void print_version (void)
  340. {
  341. printf(GLOBAL_PRODUCT_NAME" "PROGRAM_NAME" "GLOBAL_VERSION"\n"GLOBAL_COPYRIGHT_NOTICE"\n");
  342. }
  343. int parse_arguments (int argc, char *argv[])
  344. {
  345. if (argc <= 0) {
  346. return 0;
  347. }
  348. options.help = 0;
  349. options.version = 0;
  350. options.logger = LOGGER_STDOUT;
  351. #ifndef BADVPN_USE_WINAPI
  352. options.logger_syslog_facility = "daemon";
  353. options.logger_syslog_ident = argv[0];
  354. #endif
  355. options.loglevel = -1;
  356. for (int i = 0; i < BLOG_NUM_CHANNELS; i++) {
  357. options.loglevels[i] = -1;
  358. }
  359. options.ssl = 0;
  360. options.nssdb = NULL;
  361. options.client_cert_name = NULL;
  362. options.server_name = NULL;
  363. options.server_addr = NULL;
  364. options.num_floods = 0;
  365. int i;
  366. for (i = 1; i < argc; i++) {
  367. char *arg = argv[i];
  368. if (!strcmp(arg, "--help")) {
  369. options.help = 1;
  370. }
  371. else if (!strcmp(arg, "--version")) {
  372. options.version = 1;
  373. }
  374. else if (!strcmp(arg, "--logger")) {
  375. if (1 >= argc - i) {
  376. fprintf(stderr, "%s: requires an argument\n", arg);
  377. return 0;
  378. }
  379. char *arg2 = argv[i + 1];
  380. if (!strcmp(arg2, "stdout")) {
  381. options.logger = LOGGER_STDOUT;
  382. }
  383. #ifndef BADVPN_USE_WINAPI
  384. else if (!strcmp(arg2, "syslog")) {
  385. options.logger = LOGGER_SYSLOG;
  386. }
  387. #endif
  388. else {
  389. fprintf(stderr, "%s: wrong argument\n", arg);
  390. return 0;
  391. }
  392. i++;
  393. }
  394. #ifndef BADVPN_USE_WINAPI
  395. else if (!strcmp(arg, "--syslog-facility")) {
  396. if (1 >= argc - i) {
  397. fprintf(stderr, "%s: requires an argument\n", arg);
  398. return 0;
  399. }
  400. options.logger_syslog_facility = argv[i + 1];
  401. i++;
  402. }
  403. else if (!strcmp(arg, "--syslog-ident")) {
  404. if (1 >= argc - i) {
  405. fprintf(stderr, "%s: requires an argument\n", arg);
  406. return 0;
  407. }
  408. options.logger_syslog_ident = argv[i + 1];
  409. i++;
  410. }
  411. #endif
  412. else if (!strcmp(arg, "--loglevel")) {
  413. if (1 >= argc - i) {
  414. fprintf(stderr, "%s: requires an argument\n", arg);
  415. return 0;
  416. }
  417. if ((options.loglevel = parse_loglevel(argv[i + 1])) < 0) {
  418. fprintf(stderr, "%s: wrong argument\n", arg);
  419. return 0;
  420. }
  421. i++;
  422. }
  423. else if (!strcmp(arg, "--channel-loglevel")) {
  424. if (2 >= argc - i) {
  425. fprintf(stderr, "%s: requires two arguments\n", arg);
  426. return 0;
  427. }
  428. int channel = BLogGlobal_GetChannelByName(argv[i + 1]);
  429. if (channel < 0) {
  430. fprintf(stderr, "%s: wrong channel argument\n", arg);
  431. return 0;
  432. }
  433. int loglevel = parse_loglevel(argv[i + 2]);
  434. if (loglevel < 0) {
  435. fprintf(stderr, "%s: wrong loglevel argument\n", arg);
  436. return 0;
  437. }
  438. options.loglevels[channel] = loglevel;
  439. i += 2;
  440. }
  441. else if (!strcmp(arg, "--ssl")) {
  442. options.ssl = 1;
  443. }
  444. else if (!strcmp(arg, "--nssdb")) {
  445. if (1 >= argc - i) {
  446. fprintf(stderr, "%s: requires an argument\n", arg);
  447. return 0;
  448. }
  449. options.nssdb = argv[i + 1];
  450. i++;
  451. }
  452. else if (!strcmp(arg, "--client-cert-name")) {
  453. if (1 >= argc - i) {
  454. fprintf(stderr, "%s: requires an argument\n", arg);
  455. return 0;
  456. }
  457. options.client_cert_name = argv[i + 1];
  458. i++;
  459. }
  460. else if (!strcmp(arg, "--server-name")) {
  461. if (1 >= argc - i) {
  462. fprintf(stderr, "%s: requires an argument\n", arg);
  463. return 0;
  464. }
  465. options.server_name = argv[i + 1];
  466. i++;
  467. }
  468. else if (!strcmp(arg, "--server-addr")) {
  469. if (1 >= argc - i) {
  470. fprintf(stderr, "%s: requires an argument\n", arg);
  471. return 0;
  472. }
  473. options.server_addr = argv[i + 1];
  474. i++;
  475. }
  476. else if (!strcmp(arg, "--flood-id")) {
  477. if (1 >= argc - i) {
  478. fprintf(stderr, "%s: requires an argument\n", arg);
  479. return 0;
  480. }
  481. if (options.num_floods == MAX_FLOODS) {
  482. fprintf(stderr, "%s: too many\n", arg);
  483. return 0;
  484. }
  485. options.floods[options.num_floods] = atoi(argv[i + 1]);
  486. options.num_floods++;
  487. i++;
  488. }
  489. else {
  490. fprintf(stderr, "unknown option: %s\n", arg);
  491. return 0;
  492. }
  493. }
  494. if (options.help || options.version) {
  495. return 1;
  496. }
  497. if (options.ssl != !!options.nssdb) {
  498. fprintf(stderr, "False: --ssl <=> --nssdb\n");
  499. return 0;
  500. }
  501. if (options.ssl != !!options.client_cert_name) {
  502. fprintf(stderr, "False: --ssl <=> --client-cert-name\n");
  503. return 0;
  504. }
  505. if (!options.server_addr) {
  506. fprintf(stderr, "False: --server-addr\n");
  507. return 0;
  508. }
  509. return 1;
  510. }
  511. int resolve_arguments (void)
  512. {
  513. // resolve server address
  514. ASSERT(options.server_addr)
  515. if (!BAddr_Parse(&server_addr, options.server_addr, server_name, sizeof(server_name))) {
  516. BLog(BLOG_ERROR, "server addr: BAddr_Parse failed");
  517. return 0;
  518. }
  519. if (!addr_supported(server_addr)) {
  520. BLog(BLOG_ERROR, "server addr: not supported");
  521. return 0;
  522. }
  523. // override server name if requested
  524. if (options.server_name) {
  525. snprintf(server_name, sizeof(server_name), "%s", options.server_name);
  526. }
  527. return 1;
  528. }
  529. void signal_handler (void *unused)
  530. {
  531. BLog(BLOG_NOTICE, "termination requested");
  532. terminate();
  533. }
  534. void server_handler_error (void *user)
  535. {
  536. BLog(BLOG_ERROR, "server connection failed, exiting");
  537. terminate();
  538. }
  539. void server_handler_ready (void *user, peerid_t param_my_id, uint32_t ext_ip)
  540. {
  541. ASSERT(!server_ready)
  542. // remember our ID
  543. my_id = param_my_id;
  544. // init flooding
  545. // init source
  546. PacketRecvInterface_Init(&flood_source, SC_MAX_ENC, flood_source_handler_recv, NULL, BReactor_PendingGroup(&ss));
  547. // init encoder
  548. PacketProtoEncoder_Init(&flood_encoder, &flood_source, BReactor_PendingGroup(&ss));
  549. // init buffer
  550. if (!SinglePacketBuffer_Init(&flood_buffer, PacketProtoEncoder_GetOutput(&flood_encoder), ServerConnection_GetSendInterface(&server), BReactor_PendingGroup(&ss))) {
  551. BLog(BLOG_ERROR, "SinglePacketBuffer_Init failed, exiting");
  552. goto fail1;
  553. }
  554. // set not blocking
  555. flood_blocking = 0;
  556. // set server ready
  557. server_ready = 1;
  558. BLog(BLOG_INFO, "server: ready, my ID is %d", (int)my_id);
  559. return;
  560. fail1:
  561. PacketProtoEncoder_Free(&flood_encoder);
  562. PacketRecvInterface_Free(&flood_source);
  563. terminate();
  564. }
  565. void server_handler_newclient (void *user, peerid_t peer_id, int flags, const uint8_t *cert, int cert_len)
  566. {
  567. ASSERT(server_ready)
  568. BLog(BLOG_INFO, "newclient %d", (int)peer_id);
  569. }
  570. void server_handler_endclient (void *user, peerid_t peer_id)
  571. {
  572. ASSERT(server_ready)
  573. BLog(BLOG_INFO, "endclient %d", (int)peer_id);
  574. }
  575. void server_handler_message (void *user, peerid_t peer_id, uint8_t *data, int data_len)
  576. {
  577. ASSERT(server_ready)
  578. ASSERT(data_len >= 0)
  579. ASSERT(data_len <= SC_MAX_MSGLEN)
  580. BLog(BLOG_INFO, "message from %d", (int)peer_id);
  581. }
  582. void flood_source_handler_recv (void *user, uint8_t *data)
  583. {
  584. ASSERT(server_ready)
  585. ASSERT(!flood_blocking)
  586. if (options.num_floods > 0) {
  587. ASSERT(flood_next >= 0)
  588. ASSERT(flood_next < options.num_floods)
  589. }
  590. if (options.num_floods == 0) {
  591. flood_blocking = 1;
  592. return;
  593. }
  594. peerid_t peer_id = options.floods[flood_next];
  595. flood_next = (flood_next + 1) % options.num_floods;
  596. BLog(BLOG_INFO, "message to %d", (int)peer_id);
  597. struct sc_header *header = (struct sc_header *)data;
  598. header->type = SCID_OUTMSG;
  599. struct sc_client_outmsg *msg = (struct sc_client_outmsg *)(data + sizeof(struct sc_header));
  600. msg->clientid = htol16(peer_id);
  601. memset(data + sizeof(struct sc_header) + sizeof(struct sc_client_outmsg), 0, SC_MAX_MSGLEN);
  602. PacketRecvInterface_Done(&flood_source, sizeof(struct sc_header) + sizeof(struct sc_client_outmsg) + SC_MAX_MSGLEN);
  603. }