sctp_auth.c (234699) | sctp_auth.c (234995) |
---|---|
1/*- 2 * Copyright (c) 2001-2008, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2011, 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-2008, by Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. 4 * Copyright (c) 2008-2011, 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_auth.c 234699 2012-04-26 11:07:15Z tuexen $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 234995 2012-05-04 09:27:00Z tuexen $"); |
35 36#include <netinet/sctp_os.h> 37#include <netinet/sctp.h> 38#include <netinet/sctp_header.h> 39#include <netinet/sctp_pcb.h> 40#include <netinet/sctp_var.h> 41#include <netinet/sctp_sysctl.h> 42#include <netinet/sctputil.h> --- 236 unchanged lines hidden (view full) --- 279} 280 281void 282sctp_print_key(sctp_key_t * key, const char *str) 283{ 284 uint32_t i; 285 286 if (key == NULL) { | 35 36#include <netinet/sctp_os.h> 37#include <netinet/sctp.h> 38#include <netinet/sctp_header.h> 39#include <netinet/sctp_pcb.h> 40#include <netinet/sctp_var.h> 41#include <netinet/sctp_sysctl.h> 42#include <netinet/sctputil.h> --- 236 unchanged lines hidden (view full) --- 279} 280 281void 282sctp_print_key(sctp_key_t * key, const char *str) 283{ 284 uint32_t i; 285 286 if (key == NULL) { |
287 printf("%s: [Null key]\n", str); | 287 SCTP_PRINTF("%s: [Null key]\n", str); |
288 return; 289 } | 288 return; 289 } |
290 printf("%s: len %u, ", str, key->keylen); | 290 SCTP_PRINTF("%s: len %u, ", str, key->keylen); |
291 if (key->keylen) { 292 for (i = 0; i < key->keylen; i++) | 291 if (key->keylen) { 292 for (i = 0; i < key->keylen; i++) |
293 printf("%02x", key->key[i]); 294 printf("\n"); | 293 SCTP_PRINTF("%02x", key->key[i]); 294 SCTP_PRINTF("\n"); |
295 } else { | 295 } else { |
296 printf("[Null key]\n"); | 296 SCTP_PRINTF("[Null key]\n"); |
297 } 298} 299 300void 301sctp_show_key(sctp_key_t * key, const char *str) 302{ 303 uint32_t i; 304 305 if (key == NULL) { | 297 } 298} 299 300void 301sctp_show_key(sctp_key_t * key, const char *str) 302{ 303 uint32_t i; 304 305 if (key == NULL) { |
306 printf("%s: [Null key]\n", str); | 306 SCTP_PRINTF("%s: [Null key]\n", str); |
307 return; 308 } | 307 return; 308 } |
309 printf("%s: len %u, ", str, key->keylen); | 309 SCTP_PRINTF("%s: len %u, ", str, key->keylen); |
310 if (key->keylen) { 311 for (i = 0; i < key->keylen; i++) | 310 if (key->keylen) { 311 for (i = 0; i < key->keylen; i++) |
312 printf("%02x", key->key[i]); 313 printf("\n"); | 312 SCTP_PRINTF("%02x", key->key[i]); 313 SCTP_PRINTF("\n"); |
314 } else { | 314 } else { |
315 printf("[Null key]\n"); | 315 SCTP_PRINTF("[Null key]\n"); |
316 } 317} 318 319static uint32_t 320sctp_get_keylen(sctp_key_t * key) 321{ 322 if (key != NULL) 323 return (key->keylen); --- 1804 unchanged lines hidden --- | 316 } 317} 318 319static uint32_t 320sctp_get_keylen(sctp_key_t * key) 321{ 322 if (key != NULL) 323 return (key->keylen); --- 1804 unchanged lines hidden --- |