#include "net.h"
#include "fd.h"
+#ifndef DCCP_SOCKOPT_CCID
+#define DCCP_SOCKOPT_CCID 13 /**< Sets both TX/RX CCID. */
+#endif
+
static void dccp_recv_close(struct receiver_node *rn)
{
if (rn->fd > 0)
return 1;
}
+/** Flowopt shortcut */
+#define OPT_ADD(fo, lev, opt, val, len) flowopt_add(fo, lev, opt, #opt, val, len)
+
static int dccp_recv_open(struct receiver_node *rn)
{
struct lls_parse_result *lpr = rn->lpr;
sched_monitor_readfd(dss->listen_fds[n], s);
}
+#ifndef DCCP_SOCKOPT_TX_CCID
+#define DCCP_SOCKOPT_TX_CCID 14 /**< Set/get the TX CCID. */
+#endif
+
/**
* Query the TX CCID used on the sender-client half connection.
* \param sockfd Server socket descriptor to query (after accept(2)).
free_sender_status(dss);
}
+#ifndef DCCP_SOCKOPT_GET_CUR_MPS
+#define DCCP_SOCKOPT_GET_CUR_MPS 5 /**< Max packet size, RFC 4340, 14. */
+#endif
+
+/** Estimated worst-case length of a DCCP header including options. */
+#define DCCP_MAX_HEADER 128
+
/** * Obtain current MPS according to RFC 4340, sec. 14. */
static int dccp_init_fec(struct sender_client *sc)
{
return service;
}
+#ifndef SOCK_DCCP
+#define SOCK_DCCP 6 /**< Linux socket type. */
+#endif
+
/**
* Determine the socket type for a given layer-4 protocol.
*
return -ERRNO_TO_PARA_ERROR(errno);
}
+#ifndef DCCP_SOCKOPT_AVAILABLE_CCIDS
+#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 /**< List of supported CCIDs. */
+#endif
+
/**
* Probe the list of DCCP CCIDs configured on this host.
* \param ccid_array Pointer to return statically allocated array in.
return nccids;
}
+/**
+ * The buffer size of the sun_path component of struct sockaddr_un.
+ *
+ * While glibc doesn't define UNIX_PATH_MAX, it documents it has being limited
+ * to 108 bytes. On NetBSD it is only 104 bytes though. We trust UNIX_PATH_MAX
+ * if it is defined and use the size of the ->sun_path member otherwise. This
+ * should be safe everywhere.
+ */
+#ifndef UNIX_PATH_MAX
+#define UNIX_PATH_MAX (sizeof(((struct sockaddr_un *)0)->sun_path))
+#endif
+
/*
* Prepare a structure for AF_UNIX socket addresses.
*
/* Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/** \file net.h exported symbols from net.c */
-/**
- * The buffer size of the sun_path component of struct sockaddr_un.
- *
- * While glibc doesn't define \p UNIX_PATH_MAX, it documents it has being
- * limited to 108 bytes. On NetBSD it is only 104 bytes though. We trust \p
- * UNIX_PATH_MAX if it is defined and use the size of the ->sun_path member
- * otherwise. This should be safe everywhere.
- */
-#ifndef UNIX_PATH_MAX
-#define UNIX_PATH_MAX (sizeof(((struct sockaddr_un *)0)->sun_path))
-#endif
-
/* Userland defines for Linux DCCP support. */
#ifndef IPPROTO_DCCP
#define IPPROTO_DCCP 33 /**< IANA assigned value. */
#endif
-#ifndef SOCK_DCCP
-#define SOCK_DCCP 6 /**< Linux socket type. */
-#endif
-
-#ifndef DCCP_SOCKOPT_RX_CCID
-/** Per-connection CCID support (set/get the RX CCID, since v2.6.30-rc1). */
-#define DCCP_SOCKOPT_RX_CCID 15
-#endif
-
#ifndef SOL_DCCP
#define SOL_DCCP 269 /**< Linux socket level. */
#endif
-#ifndef DCCP_SOCKOPT_GET_CUR_MPS
-#define DCCP_SOCKOPT_GET_CUR_MPS 5 /**< Max packet size, RFC 4340, 14. */
-#endif
-
-#ifndef DCCP_SOCKOPT_AVAILABLE_CCIDS
-#define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 /**< List of supported CCIDs. */
-#endif
-
-#ifndef DCCP_SOCKOPT_CCID
-#define DCCP_SOCKOPT_CCID 13 /**< Sets both TX/RX CCID. */
-#endif
-
-#ifndef DCCP_SOCKOPT_TX_CCID
-#define DCCP_SOCKOPT_TX_CCID 14 /**< Set/get the TX CCID. */
-#endif
-
/** The maximum length of the host component in an URL. */
#define MAX_HOSTLEN 256
void flowopt_add(struct flowopts *fo, int level, int opt,
const char *name, const void *val, int len);
void flowopt_cleanup(struct flowopts *fo);
-/** Flowopt shortcut macros */
-#define OPT_ADD(fo, lev, opt, val, len) flowopt_add(fo, lev, opt, #opt, val, len)
/**
* Functions to parse and validate (parts of) URLs.
/**
* Functions and definitions to support \p IPPROTO_DCCP
*/
-/** Estimated worst-case length of a DCCP header including options. */
-#define DCCP_MAX_HEADER 128
/** Hardcoded maximum number of separate CCID modules compiled into a host. */
#define DCCP_MAX_HOST_CCIDS 20
int dccp_available_ccids(uint8_t **ccid_array);