summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_var.h
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2011-06-15 23:50:27 +0000
committertuexen <tuexen@FreeBSD.org>2011-06-15 23:50:27 +0000
commit6339980d3779b2b1cd4459ca94ec77f42d5cc591 (patch)
treec139a5608c81130eea7523eae6f10f45c780ebe3 /sys/netinet/sctp_var.h
parent4049e0f7dd71a3c7bbda0f0a54aa4f58359856b4 (diff)
downloadFreeBSD-src-6339980d3779b2b1cd4459ca94ec77f42d5cc591.zip
FreeBSD-src-6339980d3779b2b1cd4459ca94ec77f42d5cc591.tar.gz
Add support for the newly added SCTP API.
In particular add support for: * SCTP_SNDINFO, SCTP_PRINFO, SCTP_AUTHINFO, SCTP_DSTADDRV4, and SCTP_DSTADDRV6 cmsgs. * SCTP_NXTINFO and SCTP_RCVINFO cmgs. * SCTP_EVENT, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO and SCTP_DEFAULT_SNDINFO socket option. * Special association ids (SCTP_FUTURE_ASSOC, ...) * sctp_recvv() and sctp_sendv() functions. MFC after: 1 month.
Diffstat (limited to 'sys/netinet/sctp_var.h')
-rw-r--r--sys/netinet/sctp_var.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h
index 1e17900..e48dfe4 100644
--- a/sys/netinet/sctp_var.h
+++ b/sys/netinet/sctp_var.h
@@ -50,6 +50,30 @@ extern struct pr_usrreqs sctp_usrreqs;
#define sctp_is_feature_on(inp, feature) ((inp->sctp_features & feature) == feature)
#define sctp_is_feature_off(inp, feature) ((inp->sctp_features & feature) == 0)
+#define sctp_stcb_feature_on(inp, stcb, feature) {\
+ if (stcb) { \
+ stcb->asoc.sctp_features |= feature; \
+ } else { \
+ inp->sctp_features |= feature; \
+ } \
+}
+#define sctp_stcb_feature_off(inp, stcb, feature) {\
+ if (stcb) { \
+ stcb->asoc.sctp_features &= ~feature; \
+ } else { \
+ inp->sctp_features &= ~feature; \
+ } \
+}
+#define sctp_stcb_is_feature_on(inp, stcb, feature) \
+ (((stcb != NULL) && \
+ ((stcb->asoc.sctp_features & feature) == feature)) || \
+ ((stcb == NULL) && \
+ ((inp->sctp_features & feature) == feature)))
+#define sctp_stcb_is_feature_off(inp, stcb, feature) \
+ (((stcb != NULL) && \
+ ((stcb->asoc.sctp_features & feature) == 0)) || \
+ ((stcb == NULL) && \
+ ((inp->sctp_features & feature) == 0)))
/* managing mobility_feature in inpcb (by micchie) */
#define sctp_mobility_feature_on(inp, feature) (inp->sctp_mobility_features |= feature)
OpenPOWER on IntegriCloud