sctp_bsd_addr.c (235828) | sctp_bsd_addr.c (237540) |
---|---|
1/*- 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_bsd_addr.c 235828 2012-05-23 11:26:28Z tuexen $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_bsd_addr.c 237540 2012-06-24 21:25:54Z tuexen $"); |
35 36#include <netinet/sctp_os.h> 37#include <netinet/sctp_var.h> 38#include <netinet/sctp_pcb.h> 39#include <netinet/sctp_header.h> 40#include <netinet/sctputil.h> 41#include <netinet/sctp_output.h> 42#include <netinet/sctp_bsd_addr.h> --- 374 unchanged lines hidden (view full) --- 417 } 418#endif 419 return (m); 420} 421 422 423#ifdef SCTP_PACKET_LOGGING 424void | 35 36#include <netinet/sctp_os.h> 37#include <netinet/sctp_var.h> 38#include <netinet/sctp_pcb.h> 39#include <netinet/sctp_header.h> 40#include <netinet/sctputil.h> 41#include <netinet/sctp_output.h> 42#include <netinet/sctp_bsd_addr.h> --- 374 unchanged lines hidden (view full) --- 417 } 418#endif 419 return (m); 420} 421 422 423#ifdef SCTP_PACKET_LOGGING 424void |
425sctp_packet_log(struct mbuf *m, int length) | 425sctp_packet_log(struct mbuf *m) |
426{ 427 int *lenat, thisone; 428 void *copyto; 429 uint32_t *tick_tock; | 426{ 427 int *lenat, thisone; 428 void *copyto; 429 uint32_t *tick_tock; |
430 int length; |
|
430 int total_len; 431 int grabbed_lock = 0; 432 int value, newval, thisend, thisbegin; 433 434 /* 435 * Buffer layout. -sizeof this entry (total_len) -previous end 436 * (value) -ticks of log (ticks) o -ip packet o -as logged - 437 * where this started (thisbegin) x <--end points here 438 */ | 431 int total_len; 432 int grabbed_lock = 0; 433 int value, newval, thisend, thisbegin; 434 435 /* 436 * Buffer layout. -sizeof this entry (total_len) -previous end 437 * (value) -ticks of log (ticks) o -ip packet o -as logged - 438 * where this started (thisbegin) x <--end points here 439 */ |
440 length = SCTP_HEADER_LEN(m); |
|
439 total_len = SCTP_SIZE32((length + (4 * sizeof(int)))); 440 /* Log a packet to the buffer. */ 441 if (total_len > SCTP_PACKET_LOG_SIZE) { 442 /* Can't log this packet I have not a buffer big enough */ 443 return; 444 } 445 if (length < (int)(SCTP_MIN_V4_OVERHEAD + sizeof(struct sctp_cookie_ack_chunk))) { 446 return; --- 120 unchanged lines hidden --- | 441 total_len = SCTP_SIZE32((length + (4 * sizeof(int)))); 442 /* Log a packet to the buffer. */ 443 if (total_len > SCTP_PACKET_LOG_SIZE) { 444 /* Can't log this packet I have not a buffer big enough */ 445 return; 446 } 447 if (length < (int)(SCTP_MIN_V4_OVERHEAD + sizeof(struct sctp_cookie_ack_chunk))) { 448 return; --- 120 unchanged lines hidden --- |