X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=dccp_send.c;h=0b454e792a84d679ec322561a00d7b383b1ef5b3;hp=4ad25e73d0e915bcd8c039a6688854694456dc80;hb=42f69f545fad18480d728bb6f25273976a0c01e0;hpb=b59e841036a107b52a0221e48d7e05f86da92979 diff --git a/dccp_send.c b/dccp_send.c index 4ad25e73..0b454e79 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. */ @@ -32,9 +28,6 @@ #include "sched.h" #include "vss.h" #include "fd.h" -#include "close_on_fork.h" -#include "chunk_queue.h" -#include "acl.h" static struct sender_status dccp_sender_status, *dss = &dccp_sender_status; @@ -87,6 +80,12 @@ static void dccp_shutdown_clients(void) dccp_shutdown_client(sc); } +static void dccp_shutdown(void) +{ + dccp_shutdown_clients(); + generic_acl_deplete(&dss->acl); +} + /** * Obtain current MPS according to RFC 4340, sec. 14. */ static int dccp_init_fec(struct sender_client *sc) { @@ -218,32 +217,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 +232,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, + .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, +};