aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/sctp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp/sctp.h')
-rw-r--r--include/net/sctp/sctp.h111
1 files changed, 0 insertions, 111 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index cd89510eab2a..d8e37ecea691 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -83,30 +83,12 @@
83#include <net/sctp/structs.h> 83#include <net/sctp/structs.h>
84#include <net/sctp/constants.h> 84#include <net/sctp/constants.h>
85 85
86
87/* Set SCTP_DEBUG flag via config if not already set. */
88#ifndef SCTP_DEBUG
89#ifdef CONFIG_SCTP_DBG_MSG
90#define SCTP_DEBUG 1
91#else
92#define SCTP_DEBUG 0
93#endif /* CONFIG_SCTP_DBG */
94#endif /* SCTP_DEBUG */
95
96#ifdef CONFIG_IP_SCTP_MODULE 86#ifdef CONFIG_IP_SCTP_MODULE
97#define SCTP_PROTOSW_FLAG 0 87#define SCTP_PROTOSW_FLAG 0
98#else /* static! */ 88#else /* static! */
99#define SCTP_PROTOSW_FLAG INET_PROTOSW_PERMANENT 89#define SCTP_PROTOSW_FLAG INET_PROTOSW_PERMANENT
100#endif 90#endif
101 91
102
103/* Certain internal static functions need to be exported when
104 * compiled into the test frame.
105 */
106#ifndef SCTP_STATIC
107#define SCTP_STATIC static
108#endif
109
110/* 92/*
111 * Function declarations. 93 * Function declarations.
112 */ 94 */
@@ -196,11 +178,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
196 * Section: Macros, externs, and inlines 178 * Section: Macros, externs, and inlines
197 */ 179 */
198 180
199
200#ifdef TEST_FRAME
201#include <test_frame.h>
202#else
203
204/* spin lock wrappers. */ 181/* spin lock wrappers. */
205#define sctp_spin_lock_irqsave(lock, flags) spin_lock_irqsave(lock, flags) 182#define sctp_spin_lock_irqsave(lock, flags) spin_lock_irqsave(lock, flags)
206#define sctp_spin_unlock_irqrestore(lock, flags) \ 183#define sctp_spin_unlock_irqrestore(lock, flags) \
@@ -226,8 +203,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
226#define SCTP_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->sctp.sctp_statistics, field) 203#define SCTP_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->sctp.sctp_statistics, field)
227#define SCTP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->sctp.sctp_statistics, field) 204#define SCTP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->sctp.sctp_statistics, field)
228 205
229#endif /* !TEST_FRAME */
230
231/* sctp mib definitions */ 206/* sctp mib definitions */
232enum { 207enum {
233 SCTP_MIB_NUM = 0, 208 SCTP_MIB_NUM = 0,
@@ -285,61 +260,6 @@ static inline void sctp_max_rto(struct sctp_association *asoc,
285 } 260 }
286} 261}
287 262
288/* Print debugging messages. */
289#if SCTP_DEBUG
290extern int sctp_debug_flag;
291#define SCTP_DEBUG_PRINTK(fmt, args...) \
292do { \
293 if (sctp_debug_flag) \
294 printk(KERN_DEBUG pr_fmt(fmt), ##args); \
295} while (0)
296#define SCTP_DEBUG_PRINTK_CONT(fmt, args...) \
297do { \
298 if (sctp_debug_flag) \
299 pr_cont(fmt, ##args); \
300} while (0)
301#define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \
302 args_lead, addr, args_trail...) \
303do { \
304 const union sctp_addr *_addr = (addr); \
305 if (sctp_debug_flag) { \
306 if (_addr->sa.sa_family == AF_INET6) { \
307 printk(KERN_DEBUG \
308 pr_fmt(fmt_lead "%pI6" fmt_trail), \
309 args_lead, \
310 &_addr->v6.sin6_addr, \
311 args_trail); \
312 } else { \
313 printk(KERN_DEBUG \
314 pr_fmt(fmt_lead "%pI4" fmt_trail), \
315 args_lead, \
316 &_addr->v4.sin_addr.s_addr, \
317 args_trail); \
318 } \
319 } \
320} while (0)
321#define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; }
322#define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; }
323
324#define SCTP_ASSERT(expr, str, func) \
325 if (!(expr)) { \
326 SCTP_DEBUG_PRINTK("Assertion Failed: %s(%s) at %s:%s:%d\n", \
327 str, (#expr), __FILE__, __func__, __LINE__); \
328 func; \
329 }
330
331#else /* SCTP_DEBUG */
332
333#define SCTP_DEBUG_PRINTK(whatever...)
334#define SCTP_DEBUG_PRINTK_CONT(fmt, args...)
335#define SCTP_DEBUG_PRINTK_IPADDR(whatever...)
336#define SCTP_ENABLE_DEBUG
337#define SCTP_DISABLE_DEBUG
338#define SCTP_ASSERT(expr, str, func)
339
340#endif /* SCTP_DEBUG */
341
342
343/* 263/*
344 * Macros for keeping a global reference of object allocations. 264 * Macros for keeping a global reference of object allocations.
345 */ 265 */
@@ -575,27 +495,6 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\
575/* Round an int up to the next multiple of 4. */ 495/* Round an int up to the next multiple of 4. */
576#define WORD_ROUND(s) (((s)+3)&~3) 496#define WORD_ROUND(s) (((s)+3)&~3)
577 497
578/* Make a new instance of type. */
579#define t_new(type, flags) kzalloc(sizeof(type), flags)
580
581/* Compare two timevals. */
582#define tv_lt(s, t) \
583 (s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec))
584
585/* Add tv1 to tv2. */
586#define TIMEVAL_ADD(tv1, tv2) \
587({ \
588 suseconds_t usecs = (tv2).tv_usec + (tv1).tv_usec; \
589 time_t secs = (tv2).tv_sec + (tv1).tv_sec; \
590\
591 if (usecs >= 1000000) { \
592 usecs -= 1000000; \
593 secs++; \
594 } \
595 (tv2).tv_sec = secs; \
596 (tv2).tv_usec = usecs; \
597})
598
599/* External references. */ 498/* External references. */
600 499
601extern struct proto sctp_prot; 500extern struct proto sctp_prot;
@@ -633,16 +532,6 @@ static inline int param_type2af(__be16 type)
633 } 532 }
634} 533}
635 534
636/* Perform some sanity checks. */
637static inline int sctp_sanity_check(void)
638{
639 SCTP_ASSERT(sizeof(struct sctp_ulpevent) <=
640 sizeof(((struct sk_buff *)0)->cb),
641 "SCTP: ulpevent does not fit in skb!\n", return 0);
642
643 return 1;
644}
645
646/* Warning: The following hash functions assume a power of two 'size'. */ 535/* Warning: The following hash functions assume a power of two 'size'. */
647/* This is the hash function for the SCTP port hash table. */ 536/* This is the hash function for the SCTP port hash table. */
648static inline int sctp_phashfn(struct net *net, __u16 lport) 537static inline int sctp_phashfn(struct net *net, __u16 lport)