X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=dccp_send.c;h=9ab21f8a096426cdb3f7d3a549bd53e270762655;hp=4ad25e73d0e915bcd8c039a6688854694456dc80;hb=0b786d977ded3c3922e851e5b8d60837b43469b9;hpb=9d24300965cbcdfddb9f63b6bc8018da50d7d8e1 diff --git a/dccp_send.c b/dccp_send.c index 4ad25e73..9ab21f8a 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 2006 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2006 Andre Noll , see file COPYING. */ /** \file dccp_send.c Paraslash's dccp sender. */ @@ -218,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)); @@ -251,3 +229,27 @@ 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, + .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, +};