Skip to content

Commit

Permalink
Whitespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tuexen committed Sep 24, 2020
1 parent 30287ce commit b89c603
Show file tree
Hide file tree
Showing 33 changed files with 148 additions and 500 deletions.
9 changes: 1 addition & 8 deletions netinet/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 356357 2020-01-04 20:33:12Z tuexen $");
__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 365071 2020-09-01 21:19:14Z mjg $");
#endif

#ifndef _NETINET_SCTP_H_
Expand All @@ -43,10 +43,8 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp.h 356357 2020-01-04 20:33:12Z tuexen $
#if defined(__APPLE__) || defined(__linux__)
#include <stdint.h>
#endif

#include <sys/types.h>


#if !defined(_WIN32)
#define SCTP_PACKED __attribute__((packed))
#else
Expand Down Expand Up @@ -191,7 +189,6 @@ struct sctp_paramhdr {
#define SCTP_STREAM_RESET_INCOMING 0x00000001
#define SCTP_STREAM_RESET_OUTGOING 0x00000002


/* here on down are more implementation specific */
#define SCTP_SET_DEBUG_LEVEL 0x00001005
#define SCTP_CLR_STAT_LOG 0x00001007
Expand All @@ -213,7 +210,6 @@ struct sctp_paramhdr {
#define SCTP_PCB_STATUS 0x00001104
#define SCTP_GET_NONCE_VALUES 0x00001105


/* Special hook for dynamically setting primary for all assoc's,
* this is a write only option that requires root privilege.
*/
Expand Down Expand Up @@ -336,7 +332,6 @@ struct sctp_paramhdr {
/* First-come, first-serve */
#define SCTP_SS_FIRST_COME 0x00000005


/* fragment interleave constants
* setting must be one of these or
* EINVAL returned.
Expand Down Expand Up @@ -607,7 +602,6 @@ struct sctp_error_auth_invalid_hmac {
#define SCTP_MOBILITY_FASTHANDOFF 0x00000002
#define SCTP_MOBILITY_PRIM_DELETED 0x00000004


/* Smallest PMTU allowed when disabling PMTU discovery */
#define SCTP_SMALLEST_PMTU 512
/* Largest PMTU allowed when disabling PMTU discovery */
Expand All @@ -634,7 +628,6 @@ struct sctp_error_auth_invalid_hmac {
#define SCTP_MAX_HB_INTERVAL 14400000 /* 4 hours in ms */
#define SCTP_MAX_COOKIE_LIFE 3600000 /* 1 hour in ms */


/* Types of logging/KTR tracing that can be enabled via the
* sysctl net.inet.sctp.sctp_logging. You must also enable
* SUBSYS tracing.
Expand Down
8 changes: 1 addition & 7 deletions netinet/sctp_asconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 363194 2020-07-14 20:32:50Z tuexen $");
__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 365071 2020-09-01 21:19:14Z mjg $");
#endif

#include <netinet/sctp_os.h>
Expand Down Expand Up @@ -584,7 +584,6 @@ sctp_process_asconf_set_primary(struct sockaddr *src,
SCTP_MOBILITY_PRIM_DELETED) &&
(stcb->asoc.primary_destination->dest_state &
SCTP_ADDR_UNCONFIRMED) == 0) {

sctp_timer_stop(SCTP_TIMER_TYPE_PRIM_DELETED,
stcb->sctp_ep, stcb, NULL,
SCTP_FROM_SCTP_ASCONF + SCTP_LOC_1);
Expand Down Expand Up @@ -1008,7 +1007,6 @@ sctp_asconf_nets_cleanup(struct sctp_tcb *stcb, struct sctp_ifn *ifn)
}
}


void
sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *dstnet)
{
Expand Down Expand Up @@ -1369,7 +1367,6 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *stcb, struct sctp_ifa *ifa,
return (0);
}


/*
* add an asconf operation for the given ifa and type.
* type = SCTP_ADD_IP_ADDRESS, SCTP_DEL_IP_ADDRESS, SCTP_SET_PRIM_ADDR.
Expand Down Expand Up @@ -2061,7 +2058,6 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
}
}


int
sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED)
{
Expand Down Expand Up @@ -2125,7 +2121,6 @@ sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP
laddr->action = 0;
break;
}

}
} else if (l->action == SCTP_DEL_IP_ADDRESS) {
LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) {
Expand Down Expand Up @@ -2272,7 +2267,6 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
*/
stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
net->RTO = 0;

}
}
} else if (type == SCTP_SET_PRIM_ADDR) {
Expand Down
4 changes: 1 addition & 3 deletions netinet/sctp_asconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.h 362377 2020-06-19 12:35:29Z tuexen $");
__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.h 365071 2020-09-01 21:19:14Z mjg $");
#endif

#ifndef _NETINET_SCTP_ASCONF_H_
Expand All @@ -61,15 +61,13 @@ extern uint32_t
sctp_addr_mgmt_ep_sa(struct sctp_inpcb *, struct sockaddr *, uint32_t,
uint32_t);


extern int sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr,
uint32_t val);
extern void sctp_asconf_iterator_stcb(struct sctp_inpcb *inp,
struct sctp_tcb *stcb,
void *ptr, uint32_t type);
extern void sctp_asconf_iterator_end(void *ptr, uint32_t val);


extern int32_t
sctp_set_primary_ip_address_sa(struct sctp_tcb *,
struct sockaddr *);
Expand Down
12 changes: 1 addition & 11 deletions netinet/sctp_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 362054 2020-06-11 13:34:09Z tuexen $");
__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 365071 2020-09-01 21:19:14Z mjg $");
#endif

#include <netinet/sctp_os.h>
Expand All @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 362054 2020-06-11 13:34:09Z tue
#define SCTP_AUTH_DEBUG2 (SCTP_BASE_SYSCTL(sctp_debug_on) & SCTP_DEBUG_AUTH2)
#endif /* SCTP_DEBUG */


void
sctp_clear_chunklist(sctp_auth_chklist_t *chklist)
{
Expand Down Expand Up @@ -101,7 +100,6 @@ sctp_copy_chunklist(sctp_auth_chklist_t *list)
return (new_list);
}


/*
* add a chunk to the required chunks list
*/
Expand Down Expand Up @@ -241,7 +239,6 @@ sctp_unpack_auth_chunks(const uint8_t *ptr, uint8_t num_chunks,
return (size);
}


/*
* allocate structure space for a key of length keylen
*/
Expand Down Expand Up @@ -458,7 +455,6 @@ sctp_compute_hashkey(sctp_key_t *key1, sctp_key_t *key2, sctp_key_t *shared)
return (new_key);
}


sctp_sharedkey_t *
sctp_alloc_sharedkey(void)
{
Expand Down Expand Up @@ -632,7 +628,6 @@ sctp_copy_skeylist(const struct sctp_keyhead *src, struct sctp_keyhead *dest)
return (count);
}


sctp_hmaclist_t *
sctp_alloc_hmaclist(uint16_t num_hmacs)
{
Expand Down Expand Up @@ -826,7 +821,6 @@ sctp_free_authinfo(sctp_authinfo_t *authinfo)
/* SCTP_FREE(authinfo, SCTP_M_AUTH_??); */
}


uint32_t
sctp_get_auth_chunk_len(uint16_t hmac_algo)
{
Expand Down Expand Up @@ -1166,7 +1160,6 @@ sctp_auth_is_supported_hmac(sctp_hmaclist_t *list, uint16_t id)
return (0);
}


/*-
* clear any cached key(s) if they match the given key id on an association.
* the cached key(s) will be recomputed and re-cached at next use.
Expand Down Expand Up @@ -1579,7 +1572,6 @@ sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_offset,
m, auth_offset, auth->hmac);
}


static void
sctp_zero_m(struct mbuf *m, uint32_t m_offset, uint32_t size)
{
Expand Down Expand Up @@ -1800,7 +1792,6 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication,
&stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked);
}


/*-
* validates the AUTHentication related parameters in an INIT/INIT-ACK
* Note: currently only used for INIT as INIT-ACK is handled inline
Expand Down Expand Up @@ -1915,7 +1906,6 @@ sctp_validate_init_auth_params(struct mbuf *m, int offset, int limit)
saw_asconf = 1;
if (chunks->chunk_types[i] == SCTP_ASCONF_ACK)
saw_asconf_ack = 1;

}
if (num_chunks)
got_chklist = 1;
Expand Down
5 changes: 1 addition & 4 deletions netinet/sctp_auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.h 338749 2018-09-18 10:53:07Z tuexen $");
__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.h 365071 2020-09-01 21:19:14Z mjg $");
#endif

#ifndef _NETINET_SCTP_AUTH_H_
Expand Down Expand Up @@ -99,8 +99,6 @@ typedef struct sctp_authinformation {
uint16_t recv_keyid; /* last recv keyid (cached) */
} sctp_authinfo_t;



/*
* Macros
*/
Expand Down Expand Up @@ -149,7 +147,6 @@ extern void sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t keyid);
extern void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid,
int so_locked);


/* hmac list handling */
extern sctp_hmaclist_t *sctp_alloc_hmaclist(uint16_t num_hmacs);
extern void sctp_free_hmaclist(sctp_hmaclist_t *list);
Expand Down
14 changes: 4 additions & 10 deletions netinet/sctp_bsd_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_bsd_addr.c 358080 2020-02-18 19:41:55Z tuexen $");
__FBSDID("$FreeBSD: head/sys/netinet/sctp_bsd_addr.c 365071 2020-09-01 21:19:14Z mjg $");
#endif

#include <netinet/sctp_os.h>
Expand Down Expand Up @@ -78,8 +78,8 @@ MALLOC_DEFINE(SCTP_M_MCORE, "sctp_mcore", "sctp mcore queue");

/* Global NON-VNET structure that controls the iterator */
struct iterator_control sctp_it_ctl;

#if !(defined(__FreeBSD__) && !defined(__Userspace__))

static void
sctp_cleanup_itqueue(void)
{
Expand Down Expand Up @@ -244,7 +244,6 @@ sctp_gather_internal_ifa_flags(struct sctp_ifa *ifa)
#endif /* __Userspace__ */
#endif /* INET6 */


#if !defined(__Userspace__)
static uint32_t
sctp_is_desired_interface_type(struct ifnet *ifn)
Expand Down Expand Up @@ -294,13 +293,14 @@ sctp_is_desired_interface_type(struct ifnet *ifn)
return (result);
}
#endif

#if defined(__APPLE__) && !defined(__Userspace__)

int
sctp_is_vmware_interface(struct ifnet *ifn)
{
return (strncmp(ifnet_name(ifn), "vmnet", 5) == 0);
}

#endif

#if defined(_WIN32) && defined(__Userspace__)
Expand Down Expand Up @@ -476,7 +476,6 @@ sctp_init_ifns_for_vrf(int vrfid)
#endif
}
#endif

#if defined(__APPLE__) && !defined(__Userspace__)
static void
sctp_init_ifns_for_vrf(int vrfid)
Expand Down Expand Up @@ -555,7 +554,6 @@ sctp_init_ifns_for_vrf(int vrfid)
ifnet_list_free(ifnetlist);
}
#endif

#if defined(__FreeBSD__) && !defined(__Userspace__)
static void
sctp_init_ifns_for_vrf(int vrfid)
Expand Down Expand Up @@ -719,7 +717,6 @@ sctp_addr_change(struct ifaddr *ifa, int cmd)
#endif
(void *)ifa, ifa->ifa_addr, ifa_flags, 1);
} else {

sctp_del_addr_from_vrf(SCTP_DEFAULT_VRFID, ifa->ifa_addr,
#if defined(__APPLE__) && !defined(__Userspace__)
ifnet_index(ifa->ifa_ifp),
Expand Down Expand Up @@ -845,7 +842,6 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header,
return (m);
}


#ifdef SCTP_PACKET_LOGGING
void
sctp_packet_log(struct mbuf *m)
Expand Down Expand Up @@ -921,7 +917,6 @@ sctp_packet_log(struct mbuf *m)
SCTP_BASE_VAR(packet_log_end));
SCTP_BASE_VAR(packet_log_end) = 0;
goto no_log;

}
lenat = (int *)&SCTP_BASE_VAR(packet_log_buffer)[thisbegin];
*lenat = total_len;
Expand All @@ -947,7 +942,6 @@ sctp_packet_log(struct mbuf *m)
atomic_subtract_int(&SCTP_BASE_VAR(packet_log_writers), 1);
}


int
sctp_copy_out_packet_log(uint8_t *target, int length)
{
Expand Down
3 changes: 1 addition & 2 deletions netinet/sctp_bsd_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#if defined(__FreeBSD__) && !defined(__Userspace__)
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_bsd_addr.h 353480 2019-10-13 18:17:08Z tuexen $");
__FBSDID("$FreeBSD: head/sys/netinet/sctp_bsd_addr.h 365071 2020-09-01 21:19:14Z mjg $");
#endif

#ifndef _NETINET_SCTP_BSD_ADDR_H_
Expand All @@ -49,7 +49,6 @@ void sctp_wakeup_iterator(void);

void sctp_startup_iterator(void);


#ifdef INET6
void sctp_gather_internal_ifa_flags(struct sctp_ifa *ifa);
#endif
Expand Down
Loading

0 comments on commit b89c603

Please sign in to comment.