X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=dccp_send.c;h=2821b21ca8b96bc4e0d596689473d6e7e7bfcf7d;hp=6f9895410161e47133d65a4f0893bac14a0743b4;hb=ac4e01ba1a2f302bf31dd511a7aff8da78660b15;hpb=e5de57de1b8bf1df96c152fc92f5a49f75d6d96c diff --git a/dccp_send.c b/dccp_send.c index 6f989541..2821b21c 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -214,32 +214,14 @@ static char *dccp_status(void) return result; } -/** - * The init function of the dccp sender. - * - * \param s pointer to the dccp sender struct. - * - * It initializes all function pointers of \a s and starts - * listening on the given port. +/* + * Initialize the client list and the access control list and listen on the + * dccp port. */ -void dccp_send_init(struct sender *s) +static void dccp_send_init(void) { int ret; - s->status = dccp_status; - s->send = NULL; - s->pre_select = dccp_pre_select; - s->post_select = dccp_post_select; - s->shutdown_clients = dccp_shutdown_clients; - s->resolve_target = NULL; - s->help = generic_sender_help; - s->client_cmds[SENDER_on] = dccp_com_on; - s->client_cmds[SENDER_off] = dccp_com_off; - s->client_cmds[SENDER_deny] = dccp_com_deny; - s->client_cmds[SENDER_allow] = dccp_com_allow; - s->client_cmds[SENDER_add] = NULL; - s->client_cmds[SENDER_delete] = NULL; - init_sender_status(dss, OPT_RESULT(DCCP_ACCESS), OPT_UINT32_VAL(DCCP_PORT), OPT_UINT32_VAL(DCCP_MAX_CLIENTS), OPT_GIVEN(DCCP_DEFAULT_DENY)); @@ -247,3 +229,28 @@ void dccp_send_init(struct sender *s) if (ret < 0) PARA_ERROR_LOG("%s\n", para_strerror(-ret)); } + +/** + * The DCCP sender. + * + * This sender offers congestion control not available in plain TCP. Most + * methods of the sender structure are implemented as simple wrappers for the + * generic functions defined in \ref send_common.c. Like UDP streams, DCCP + * streams are sent FEC-encoded. + */ +const struct sender dccp_sender = { + .name = "dccp", + .init = dccp_send_init, + .shutdown = dccp_shutdown_clients, + .pre_select = dccp_pre_select, + .post_select = dccp_post_select, + .shutdown_clients = dccp_shutdown_clients, + .client_cmds = { + [SENDER_on] = dccp_com_on, + [SENDER_off] = dccp_com_off, + [SENDER_deny] = dccp_com_deny, + [SENDER_allow] = dccp_com_allow, + }, + .help = generic_sender_help, + .status = dccp_status, +};