Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / usrsctp / usrsctplib / netinet / sctputil.h
index 9815a4c..c807c66 100755 (executable)
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctputil.h 263237 2014-03-16 12:32:16Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctputil.h 269376 2014-08-01 12:42:37Z tuexen $");
 #endif
 
 #ifndef _NETINET_SCTP_UTIL_H_
@@ -146,9 +146,11 @@ struct sctp_paramhdr *
 sctp_get_next_param(struct mbuf *, int,
     struct sctp_paramhdr *, int);
 
-int sctp_add_pad_tombuf(struct mbuf *, int);
+struct mbuf *
+sctp_add_pad_tombuf(struct mbuf *, int);
 
-int sctp_pad_lastmbuf(struct mbuf *, int, struct mbuf *);
+struct mbuf *
+sctp_pad_lastmbuf(struct mbuf *, int, struct mbuf *);
 
 void sctp_ulp_notify(uint32_t, struct sctp_tcb *, uint32_t, void *, int
 #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
@@ -240,10 +242,10 @@ sctp_recover_scope(struct sockaddr_in6 *, struct sockaddr_in6 *);
 } while (0)
 #else
 #define sctp_recover_scope_mac(addr, store) do { \
-        if ((addr->sin6_family == AF_INET6) && \
-            (IN6_IS_SCOPE_LINKLOCAL(&addr->sin6_addr))) { \
+       if ((addr->sin6_family == AF_INET6) && \
+           (IN6_IS_SCOPE_LINKLOCAL(&addr->sin6_addr))) { \
                *store = *addr; \
-               if (addr->sin6_scope_id == 0) { \
+               if (addr->sin6_scope_id == 0) { \
                        if (!in6_recoverscope(store, &store->sin6_addr, \
                                              NULL)) { \
                                addr = store; \
@@ -252,7 +254,7 @@ sctp_recover_scope(struct sockaddr_in6 *, struct sockaddr_in6 *);
                        in6_clearscope(&addr->sin6_addr); \
                        addr = store; \
                } \
-        } \
+       } \
 } while (0)
 #endif
 #endif
@@ -271,6 +273,7 @@ sctp_release_pr_sctp_chunk(struct sctp_tcb *, struct sctp_tmit_chunk *,
 );
 
 struct mbuf *sctp_generate_cause(uint16_t, char *);
+struct mbuf *sctp_generate_no_user_data_cause(uint32_t);
 
 void sctp_bindx_add_address(struct socket *so, struct sctp_inpcb *inp,
                            struct sockaddr *sa, sctp_assoc_t assoc_id,
@@ -290,42 +293,42 @@ sctp_free_bufspace(struct sctp_tcb *, struct sctp_association *,
 #define sctp_free_bufspace(stcb, asoc, tp1, chk_cnt)  \
 do { \
        if (tp1->data != NULL) { \
-                atomic_subtract_int(&((asoc)->chunks_on_out_queue), chk_cnt); \
+               atomic_subtract_int(&((asoc)->chunks_on_out_queue), chk_cnt); \
                if ((asoc)->total_output_queue_size >= tp1->book_size) { \
                        atomic_subtract_int(&((asoc)->total_output_queue_size), tp1->book_size); \
                } else { \
                        (asoc)->total_output_queue_size = 0; \
                } \
-               if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
-                   (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
+               if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
+                   (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
                        if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { \
                                atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size); \
                        } else { \
                                stcb->sctp_socket->so_snd.sb_cc = 0; \
                        } \
                } \
-        } \
+       } \
 } while (0)
 
 #endif
 
 #define sctp_free_spbufspace(stcb, asoc, sp)  \
 do { \
-       if (sp->data != NULL) { \
+       if (sp->data != NULL) { \
                if ((asoc)->total_output_queue_size >= sp->length) { \
                        atomic_subtract_int(&(asoc)->total_output_queue_size, sp->length); \
                } else { \
                        (asoc)->total_output_queue_size = 0; \
                } \
-               if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
-                   (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
+               if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
+                   (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
                        if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \
                                atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \
                        } else { \
                                stcb->sctp_socket->so_snd.sb_cc = 0; \
                        } \
                } \
-        } \
+       } \
 } while (0)
 
 #define sctp_snd_sb_alloc(stcb, sz)  \