FreeBSD kernel IPv4 code
sctp_pcb.h
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
5 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
6 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * a) Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the following disclaimer.
13 *
14 * b) Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the distribution.
17 *
18 * c) Neither the name of Cisco Systems, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 * THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD$");
37
38#ifndef _NETINET_SCTP_PCB_H_
39#define _NETINET_SCTP_PCB_H_
40
41#include <netinet/sctp_os.h>
42#include <netinet/sctp.h>
44#include <netinet/sctp_sysctl.h>
45
46LIST_HEAD(sctppcbhead, sctp_inpcb);
47LIST_HEAD(sctpasochead, sctp_tcb);
49LIST_HEAD(sctpvtaghead, sctp_tagblock);
50LIST_HEAD(sctp_vrflist, sctp_vrf);
51LIST_HEAD(sctp_ifnlist, sctp_ifn);
52LIST_HEAD(sctp_ifalist, sctp_ifa);
55
57#include <netinet/sctp_auth.h>
58
59#define SCTP_PCBHASH_ALLADDR(port, mask) (port & mask)
60#define SCTP_PCBHASH_ASOC(tag, mask) (tag & mask)
61
62struct sctp_vrf {
64 struct sctp_ifalist *vrf_addr_hash;
65 struct sctp_ifnlist ifnlist;
67 uint32_t tbl_id_v4; /* default v4 table id */
68 uint32_t tbl_id_v6; /* default v6 table id */
72};
73
74struct sctp_ifn {
75 struct sctp_ifalist ifalist;
76 struct sctp_vrf *vrf;
78 LIST_ENTRY(sctp_ifn) next_bucket;
79 void *ifn_p; /* never access without appropriate lock */
82 uint32_t ifn_index; /* shorthand way to look at ifn for reference */
83 uint32_t refcount; /* number of reference held should be >=
84 * ifa_count */
85 uint32_t ifa_count; /* IFA's we hold (in our list - ifalist) */
86 uint32_t num_v6; /* number of v6 addresses */
87 uint32_t num_v4; /* number of v4 addresses */
88 uint32_t registered_af; /* registered address family for i/f events */
90};
91
92/* SCTP local IFA flags */
93#define SCTP_ADDR_VALID 0x00000001 /* its up and active */
94#define SCTP_BEING_DELETED 0x00000002 /* being deleted, when
95 * refcount = 0. Note that it
96 * is pulled from the ifn list
97 * and ifa_p is nulled right
98 * away but it cannot be freed
99 * until the last *net
100 * pointing to it is deleted. */
101#define SCTP_ADDR_DEFER_USE 0x00000004 /* Hold off using this one */
102#define SCTP_ADDR_IFA_UNUSEABLE 0x00000008
103
104struct sctp_ifa {
106 LIST_ENTRY(sctp_ifa) next_bucket;
107 struct sctp_ifn *ifn_p; /* back pointer to parent ifn */
108 void *ifa; /* pointer to ifa, needed for flag update for
109 * that we MUST lock appropriate locks. This
110 * is for V6. */
112 uint32_t refcount; /* number of folks referring to this */
115 uint32_t vrf_id; /* vrf_id of this addr (for deleting) */
120};
121
123 LIST_ENTRY(sctp_laddr) sctp_nxt_addr; /* next in list */
124 struct sctp_ifa *ifa;
125 uint32_t action; /* Used during asconf and adding if no-zero
126 * src-addr selection will not consider this
127 * address. */
128 struct timeval start_time; /* time when this address was created */
132 int error;
134
135struct sctp_timewait {
136 uint32_t tv_sec_at_expire; /* the seconds from boot to expire */
137 uint32_t v_tag; /* the vtag that can not be reused */
138 uint16_t lport; /* the local port used in vtag */
139 uint16_t rport; /* the remote port used in vtag */
140};
142struct sctp_tagblock {
143 LIST_ENTRY(sctp_tagblock) sctp_nxt_tagblock;
145};
146
147struct sctp_epinfo {
148#ifdef INET
149 struct socket *udp4_tun_socket;
150#endif
151#ifdef INET6
152 struct socket *udp6_tun_socket;
153#endif
154 struct sctpasochead *sctp_asochash;
155 u_long hashasocmark;
156
157 struct sctppcbhead *sctp_ephash;
158 u_long hashmark;
159
160 /*-
161 * The TCP model represents a substantial overhead in that we get an
162 * additional hash table to keep explicit connections in. The
163 * listening TCP endpoint will exist in the usual ephash above and
164 * accept only INIT's. It will be incapable of sending off an INIT.
165 * When a dg arrives we must look in the normal ephash. If we find a
166 * TCP endpoint that will tell us to go to the specific endpoint
167 * hash and re-hash to find the right assoc/socket. If we find a UDP
168 * model socket we then must complete the lookup. If this fails,
169 * i.e. no association can be found then we must continue to see if
170 * a sctp_peeloff()'d socket is in the tcpephash (a spun off socket
171 * acts like a TCP model connected socket).
172 */
173 struct sctppcbhead *sctp_tcpephash;
176
177 struct sctp_vrflist *sctp_vrfhash;
179
180 struct sctp_ifnlist *vrf_ifn_hash;
183 struct sctppcbhead listhead;
184 struct sctpladdr addr_wq;
186 /* ep zone info */
197 struct rwlock ipi_ep_mtx;
198 struct mtx ipi_iterator_wq_mtx;
199 struct rwlock ipi_addr_mtx;
200 struct mtx ipi_pktlog_mtx;
201 struct mtx wq_addr_mtx;
203
204 /* assoc/tcb zone info */
206
207 /* local addrlist zone info */
209
210 /* remote addrlist zone info */
212
213 /* chunk structure list for output */
215
216 /* socket queue zone info */
218
219 /* socket queue zone info */
221
222 /* Number of vrfs */
224
225 /* Number of ifns */
228 /* Number of ifas */
230
231 /* system wide number of free chunks hanging around */
234
235 struct sctpvtaghead vtag_timewait[SCTP_STACK_VTAG_HASH_SIZE];
237 /* address work queue handling */
239
241
242struct sctp_base_info {
243 /*
244 * All static structures that anchor the system must be here.
245 */
247#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
249#else
250 struct sctpstat sctpstat;
251#endif
252 struct sctp_sysctl sctpsysctl;
255#if defined(SCTP_PACKET_LOGGING)
256 int packet_log_writers;
257 int packet_log_end;
258 uint8_t packet_log_buffer[SCTP_PACKET_LOG_SIZE];
259#endif
260 eventhandler_tag eh_tag;
261};
263/*-
264 * Here we have all the relevant information for each SCTP entity created. We
265 * will need to modify this as approprate. We also need to figure out how to
266 * access /dev/random.
267 */
268struct sctp_pcb {
269 unsigned int time_of_secret_change; /* number of seconds from
270 * timeval.tv_sec */
272 unsigned int size_of_a_cookie;
273
280 unsigned int sctp_sack_freq;
286 /* authentication related fields */
287 struct sctp_keyhead shared_keys;
293 /* various thresholds */
294 /* Max times I will init at a guy */
297 /* Max times I will send before we consider someone dead */
301
304 /* number of streams to pre-open on a association */
307
308 /* random number generator */
312
313 /*
314 * This timer is kept running per endpoint. When it fires it will
315 * change the secret key. The default is once a hour
316 */
320 /* defaults to 0 */
328#ifdef INET6
329 uint32_t default_flowlabel;
330#endif
334 uint16_t port; /* remote UDP encapsulation port */
335};
337#ifndef SCTP_ALIGNMENT
338#define SCTP_ALIGNMENT 32
339#endif
340
341#ifndef SCTP_ALIGNM1
342#define SCTP_ALIGNM1 (SCTP_ALIGNMENT-1)
343#endif
345#define sctp_lport ip_inp.inp.inp_lport
347struct sctp_pcbtsn_rlog {
351 uint16_t sz;
353};
354#define SCTP_READ_LOG_SIZE 135 /* we choose the number to make a pcb a page */
355
357 /*-
358 * put an inpcb in front of it all, kind of a waste but we need to
359 * for compatibility with all the other stuff.
360 */
361 union {
362 struct inpcb inp;
363 char align[(sizeof(struct inpcb) + SCTP_ALIGNM1) &
364 ~SCTP_ALIGNM1];
365 } ip_inp;
367 /* Socket buffer lock protects read_queue and of course sb_cc */
368 struct sctp_readhead read_queue;
369
370 LIST_ENTRY(sctp_inpcb) sctp_list; /* lists all endpoints */
371 /* hash of all endpoints for model */
372 LIST_ENTRY(sctp_inpcb) sctp_hash;
373 /* count of local addresses bound, 0 if bound all */
374 int laddr_count;
375
376 /* list of addrs in use by the EP, NULL if bound-all */
377 struct sctpladdr sctp_addr_list;
378 /*
379 * used for source address selection rotation when we are subset
380 * bound
381 */
384 /* back pointer to our socket */
385 struct socket *sctp_socket;
386 uint64_t sctp_features; /* Feature flags */
387 uint32_t sctp_flags; /* INP state flag set */
388 uint32_t sctp_mobility_features; /* Mobility Feature flags */
389 struct sctp_pcb sctp_ep; /* SCTP ep data */
390 /* head of the hash of all associations */
391 struct sctpasochead *sctp_tcbhash;
393 /* head of the list of all associations */
394 struct sctpasochead sctp_asoc_list;
395#ifdef SCTP_TRACK_FREED_ASOCS
396 struct sctpasochead sctp_asoc_free_list;
397#endif
413 /*-
414 * These three are here for the sosend_dgram
415 * (pkt, pkt_last and control).
416 * routine. However, I don't think anyone in
417 * the current FreeBSD kernel calls this. So
418 * they are candidates with sctp_sendm for
419 * de-supporting.
420 */
421 struct mbuf *pkt, *pkt_last;
422 struct mbuf *control;
423 struct mtx inp_mtx;
424 struct mtx inp_create_mtx;
425 struct mtx inp_rdata_mtx;
426 int32_t refcount;
433 struct sctpasochead *sctp_asocidhash;
434 u_long hashasocidmark;
436
437#ifdef SCTP_ASOCLOG_OF_TSNS
439 uint32_t readlog_index;
440#endif
441};
443struct sctp_tcb {
444 struct socket *sctp_socket; /* back pointer to socket */
445 struct sctp_inpcb *sctp_ep; /* back pointer to ep */
446 LIST_ENTRY(sctp_tcb) sctp_tcbhash; /* next link in hash
447 * table */
448 LIST_ENTRY(sctp_tcb) sctp_tcblist; /* list of all of the
449 * TCB's */
450 LIST_ENTRY(sctp_tcb) sctp_tcbasocidhash; /* next link in asocid
451 * hash table */
452 LIST_ENTRY(sctp_tcb) sctp_asocs; /* vtag hash list */
453 struct sctp_block_entry *block_entry; /* pointer locked by socket
454 * send buffer */
456 /*-
457 * freed_by_sorcv_sincelast is protected by the sockbuf_lock NOT the
458 * tcb_lock. Its special in this way to help avoid extra mutex calls
459 * in the reading of data.
460 */
465 uint16_t rport; /* remote port in network format */
467 struct mtx tcb_mtx;
468 struct mtx tcb_send_mtx;
469};
470
472
473#if defined(_KERNEL) || defined(__Userspace__)
474
475/* Attention Julian, this is the extern that
476 * goes with the base info. sctp_pcb.c has
477 * the real definition.
478 */
479VNET_DECLARE(struct sctp_base_info, system_base_info);
480
481#ifdef INET6
482int SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 *a, struct sockaddr_in6 *b);
483#endif
484
485void sctp_fill_pcbinfo(struct sctp_pcbinfo *);
486
487struct sctp_ifn *sctp_find_ifn(void *ifn, uint32_t ifn_index);
488
489struct sctp_vrf *sctp_allocate_vrf(int vrfid);
490struct sctp_vrf *sctp_find_vrf(uint32_t vrfid);
491void sctp_free_vrf(struct sctp_vrf *vrf);
492
493/*-
494 * Change address state, can be used if
495 * O/S supports telling transports about
496 * changes to IFA/IFN's (link layer triggers).
497 * If a ifn goes down, we will do src-addr-selection
498 * and NOT use that, as a source address. This does
499 * not stop the routing system from routing out
500 * that interface, but we won't put it as a source.
501 */
502void sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index);
503void sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index);
504
505struct sctp_ifa *
507 void *ifn, uint32_t ifn_index, uint32_t ifn_type,
508 const char *if_name,
509 void *ifa, struct sockaddr *addr, uint32_t ifa_flags,
510 int dynamic_add);
511
512void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu);
513
514void sctp_free_ifn(struct sctp_ifn *sctp_ifnp);
515void sctp_free_ifa(struct sctp_ifa *sctp_ifap);
516
517void
518sctp_del_addr_from_vrf(uint32_t vrfid, struct sockaddr *addr,
519 uint32_t ifn_index, const char *if_name);
520
521struct sctp_nets *sctp_findnet(struct sctp_tcb *, struct sockaddr *);
522
523struct sctp_inpcb *sctp_pcb_findep(struct sockaddr *, int, int, uint32_t);
524
525int
526sctp_inpcb_bind(struct socket *, struct sockaddr *,
527 struct sctp_ifa *, struct thread *);
528int
529sctp_inpcb_bind_locked(struct sctp_inpcb *, struct sockaddr *,
530 struct sctp_ifa *, struct thread *);
531
532struct sctp_tcb *
533sctp_findassociation_addr(struct mbuf *, int,
534 struct sockaddr *, struct sockaddr *,
535 struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb **,
536 struct sctp_nets **, uint32_t vrf_id);
537
538struct sctp_tcb *
539sctp_findassociation_addr_sa(struct sockaddr *,
540 struct sockaddr *, struct sctp_inpcb **, struct sctp_nets **, int, uint32_t);
541
542void
544 struct sctp_tcb *);
545
546/*-
547 * For this call ep_addr, the to is the destination endpoint address of the
548 * peer (relative to outbound). The from field is only used if the TCP model
549 * is enabled and helps distingush amongst the subset bound (non-boundall).
550 * The TCP model MAY change the actual ep field, this is why it is passed.
551 */
552struct sctp_tcb *
554 struct sockaddr *, struct sctp_nets **, struct sockaddr *,
555 struct sctp_tcb *);
556
557struct sctp_tcb *sctp_findasoc_ep_asocid_locked(struct sctp_inpcb *inp, sctp_assoc_t asoc_id, int want_lock);
558
559struct sctp_tcb *
561 sctp_assoc_t, int);
562
563struct sctp_tcb *
564sctp_findassociation_ep_asconf(struct mbuf *, int, struct sockaddr *,
565 struct sctphdr *, struct sctp_inpcb **, struct sctp_nets **, uint32_t vrf_id);
566
567int sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id);
569int sctp_is_address_on_local_host(struct sockaddr *addr, uint32_t vrf_id);
570
571void sctp_inpcb_free(struct sctp_inpcb *, int, int);
572
573#define SCTP_DONT_INITIALIZE_AUTH_PARAMS 0
574#define SCTP_INITIALIZE_AUTH_PARAMS 1
575
576struct sctp_tcb *
577sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *,
579 struct thread *, int);
580struct sctp_tcb *
581sctp_aloc_assoc_connected(struct sctp_inpcb *, struct sockaddr *,
583 struct thread *, int);
584
585int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int);
586
587void sctp_add_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *, uint32_t);
588
589void sctp_del_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *);
590
591int sctp_add_remote_addr(struct sctp_tcb *, struct sockaddr *, struct sctp_nets **, uint16_t, int, int);
592
593void sctp_remove_net(struct sctp_tcb *, struct sctp_nets *);
594
595int sctp_del_remote_addr(struct sctp_tcb *, struct sockaddr *);
596
597void sctp_pcb_init(void);
598
599void sctp_pcb_finish(void);
600
601void sctp_add_local_addr_restricted(struct sctp_tcb *, struct sctp_ifa *);
602void sctp_del_local_addr_restricted(struct sctp_tcb *, struct sctp_ifa *);
603
604int
605sctp_load_addresses_from_init(struct sctp_tcb *, struct mbuf *, int, int,
606 struct sockaddr *, struct sockaddr *, struct sockaddr *, uint16_t);
607
608int
609sctp_set_primary_addr(struct sctp_tcb *, struct sockaddr *,
610 struct sctp_nets *);
611
612bool
613 sctp_is_vtag_good(uint32_t, uint16_t lport, uint16_t rport, struct timeval *);
614
615/* void sctp_drain(void); */
616
617int sctp_destination_is_reachable(struct sctp_tcb *, struct sockaddr *);
618
620
621void sctp_clean_up_stream(struct sctp_tcb *stcb, struct sctp_readhead *rh);
622
623/*-
624 * Null in last arg inpcb indicate run on ALL ep's. Specific inp in last arg
625 * indicates run on ONLY assoc's of the specified endpoint.
626 */
627int
629 asoc_func af,
630 inp_func inpe,
632 uint32_t, void *,
633 uint32_t,
634 end_func ef,
635 struct sctp_inpcb *,
636 uint8_t co_off);
637#if defined(SCTP_MCORE_INPUT) && defined(SMP)
638void
639 sctp_queue_to_mcore(struct mbuf *m, int off, int cpu_to_use);
640
641#endif
642
643#endif /* _KERNEL */
644#endif /* !__sctp_pcb_h__ */
__uint32_t uint32_t
Definition: in.h:62
__uint16_t uint16_t
Definition: in.h:57
__uint8_t uint8_t
Definition: in.h:52
#define SCTP_PACKET_LOG_SIZE
Definition: sctp.h:589
#define SCTP_NUM_TMRS
#define SCTP_STACK_VTAG_HASH_SIZE
#define SCTP_NUMBER_OF_SECRETS
#define SCTP_HOW_MANY_SECRETS
#define SCTP_SIGNATURE_ALOC_SIZE
#define SCTP_NUMBER_IN_VTAG_BLOCK
#define SCTP_IFNAMSIZ
Definition: sctp_os_bsd.h:199
struct uma_zone * sctp_zone_t
Definition: sctp_os_bsd.h:241
int sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
Definition: sctp_pcb.c:2379
struct sctp_tcb * sctp_findassociation_ep_addr(struct sctp_inpcb **, struct sockaddr *, struct sctp_nets **, struct sockaddr *, struct sctp_tcb *)
Definition: sctp_pcb.c:1259
int sctp_inpcb_bind(struct socket *, struct sockaddr *, struct sctp_ifa *, struct thread *)
Definition: sctp_pcb.c:3225
void sctp_add_local_addr_restricted(struct sctp_tcb *, struct sctp_ifa *)
Definition: sctp_pcb.c:5477
int sctp_load_addresses_from_init(struct sctp_tcb *, struct mbuf *, int, int, struct sockaddr *, struct sockaddr *, struct sockaddr *, uint16_t)
Definition: sctp_pcb.c:6003
int sctp_inpcb_bind_locked(struct sctp_inpcb *, struct sockaddr *, struct sctp_ifa *, struct thread *)
Definition: sctp_pcb.c:2824
int sctp_is_address_on_local_host(struct sockaddr *addr, uint32_t vrf_id)
Definition: sctp_pcb.c:3703
struct sctp_tcb * sctp_findasoc_ep_asocid_locked(struct sctp_inpcb *inp, sctp_assoc_t asoc_id, int want_lock)
Definition: sctp_pcb.c:1540
void sctp_pcb_finish(void)
Definition: sctp_pcb.c:5856
VNET_DECLARE(struct sctp_base_info, system_base_info)
void sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index)
Definition: sctp_pcb.c:307
struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *, int *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, struct thread *, int)
Definition: sctp_pcb.c:4400
void sctp_del_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *)
Definition: sctp_pcb.c:5405
struct sctp_vrf * sctp_find_vrf(uint32_t vrfid)
Definition: sctp_pcb.c:216
struct sctp_tcb * sctp_findassociation_addr(struct mbuf *, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb **, struct sctp_nets **, uint32_t vrf_id)
Definition: sctp_pcb.c:2213
struct sctp_inpcb * sctp_pcb_findep(struct sockaddr *, int, int, uint32_t)
Definition: sctp_pcb.c:1888
struct sctp_nets * sctp_findnet(struct sctp_tcb *, struct sockaddr *)
Definition: sctp_pcb.c:3690
LIST_HEAD(sctppcbhead, sctp_inpcb)
#define SCTP_ALIGNM1
Definition: sctp_pcb.h:336
void sctp_move_pcb_and_assoc(struct sctp_inpcb *, struct sctp_inpcb *, struct sctp_tcb *)
Definition: sctp_pcb.c:2610
int sctp_add_remote_addr(struct sctp_tcb *, struct sockaddr *, struct sctp_nets **, uint16_t, int, int)
Definition: sctp_pcb.c:3721
struct sctp_tcb * sctp_aloc_assoc_connected(struct sctp_inpcb *, struct sockaddr *, int *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, struct thread *, int)
Definition: sctp_pcb.c:4418
void sctp_free_ifa(struct sctp_ifa *sctp_ifap)
Definition: sctp_pcb.c:270
int sctp_set_primary_addr(struct sctp_tcb *, struct sockaddr *, struct sctp_nets *)
Definition: sctp_pcb.c:6683
int sctp_del_remote_addr(struct sctp_tcb *, struct sockaddr *)
Definition: sctp_pcb.c:4517
void sctp_fill_pcbinfo(struct sctp_pcbinfo *)
Definition: sctp_pcb.c:81
struct sctp_tcb * sctp_findassociation_addr_sa(struct sockaddr *, struct sockaddr *, struct sctp_inpcb **, struct sctp_nets **, int, uint32_t)
Definition: sctp_pcb.c:1969
void sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index)
Definition: sctp_pcb.c:349
void sctp_remove_net(struct sctp_tcb *, struct sctp_nets *)
Definition: sctp_pcb.c:4447
void sctp_del_addr_from_vrf(uint32_t vrfid, struct sockaddr *addr, uint32_t ifn_index, const char *if_name)
Definition: sctp_pcb.c:718
struct sctp_ifa * sctp_add_addr_to_vrf(uint32_t vrfid, void *ifn, uint32_t ifn_index, uint32_t ifn_type, const char *if_name, void *ifa, struct sockaddr *addr, uint32_t ifa_flags, int dynamic_add)
Definition: sctp_pcb.c:474
__FBSDID("$FreeBSD$")
bool sctp_is_vtag_good(uint32_t, uint16_t lport, uint16_t rport, struct timeval *)
Definition: sctp_pcb.c:6720
#define SCTP_READ_LOG_SIZE
Definition: sctp_pcb.h:348
int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int)
Definition: sctp_pcb.c:4689
void sctp_free_ifn(struct sctp_ifn *sctp_ifnp)
Definition: sctp_pcb.c:246
struct sctp_tcb * sctp_findassociation_ep_asconf(struct mbuf *, int, struct sockaddr *, struct sctphdr *, struct sctp_inpcb **, struct sctp_nets **, uint32_t vrf_id)
Definition: sctp_pcb.c:2273
int sctp_swap_inpcb_for_listen(struct sctp_inpcb *inp)
Definition: sctp_pcb.c:1838
TAILQ_HEAD(sctp_readhead, sctp_queued_to_read)
int sctp_initiate_iterator(inp_func inpf, asoc_func af, inp_func inpe, uint32_t, uint32_t, uint32_t, void *, uint32_t, end_func ef, struct sctp_inpcb *, uint8_t co_off)
Definition: sctp_pcb.c:7007
void sctp_pcb_init(void)
Definition: sctp_pcb.c:5709
void sctp_del_local_addr_restricted(struct sctp_tcb *, struct sctp_ifa *)
Definition: sctp_pcb.c:5512
struct sctp_ifn * sctp_find_ifn(void *ifn, uint32_t ifn_index)
Definition: sctp_pcb.c:193
void sctp_clean_up_stream(struct sctp_tcb *stcb, struct sctp_readhead *rh)
Definition: sctp_pcb.c:4641
struct sctp_vrf * sctp_allocate_vrf(int vrfid)
Definition: sctp_pcb.c:145
void sctp_inpcb_free(struct sctp_inpcb *, int, int)
Definition: sctp_pcb.c:3311
int sctp_destination_is_reachable(struct sctp_tcb *, struct sockaddr *)
Definition: sctp_pcb.c:5233
void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu)
Definition: sctp_pcb.c:259
void sctp_free_vrf(struct sctp_vrf *vrf)
Definition: sctp_pcb.c:231
struct sctp_tcb * sctp_findassociation_ep_asocid(struct sctp_inpcb *, sctp_assoc_t, int)
Definition: sctp_pcb.c:1583
void sctp_add_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *, uint32_t)
Definition: sctp_pcb.c:5321
void(* asoc_func)(struct sctp_inpcb *, struct sctp_tcb *, void *ptr, uint32_t val)
Definition: sctp_structs.h:105
int(* inp_func)(struct sctp_inpcb *, void *ptr, uint32_t val)
Definition: sctp_structs.h:107
void(* end_func)(void *ptr, uint32_t val)
Definition: sctp_structs.h:108
uint32_t sctp_assoc_t
Definition: sctp_uio.h:48
Definition: in_pcb.h:217
struct sctp_sysctl sctpsysctl
Definition: sctp_pcb.h:246
eventhandler_tag eh_tag
Definition: sctp_pcb.h:254
uint8_t first_time
Definition: sctp_pcb.h:247
char sctp_pcb_initialized
Definition: sctp_pcb.h:248
struct sctpstat sctpstat
Definition: sctp_pcb.h:244
struct sctp_epinfo sctppcbinfo
Definition: sctp_pcb.h:240
Definition: sctp_pcb.h:125
int error
Definition: sctp_pcb.h:126
struct mtx ipi_pktlog_mtx
Definition: sctp_pcb.h:194
struct sctp_vrflist * sctp_vrfhash
Definition: sctp_pcb.h:171
sctp_zone_t ipi_zone_readq
Definition: sctp_pcb.h:186
u_long hashtcpmark
Definition: sctp_pcb.h:168
struct sctpasochead * sctp_asochash
Definition: sctp_pcb.h:148
sctp_zone_t ipi_zone_strmoq
Definition: sctp_pcb.h:187
u_long hashmark
Definition: sctp_pcb.h:152
struct mtx wq_addr_mtx
Definition: sctp_pcb.h:195
struct mtx ipi_iterator_wq_mtx
Definition: sctp_pcb.h:192
sctp_zone_t ipi_zone_ep
Definition: sctp_pcb.h:181
uint32_t ipi_count_strmoq
Definition: sctp_pcb.h:214
struct sctpladdr addr_wq
Definition: sctp_pcb.h:178
struct sctppcbhead listhead
Definition: sctp_pcb.h:177
struct rwlock ipi_ep_mtx
Definition: sctp_pcb.h:191
struct sctppcbhead * sctp_ephash
Definition: sctp_pcb.h:151
sctp_zone_t ipi_zone_asconf_ack
Definition: sctp_pcb.h:189
uint32_t ipi_count_ep
Definition: sctp_pcb.h:196
struct rwlock ipi_addr_mtx
Definition: sctp_pcb.h:193
sctp_zone_t ipi_zone_laddr
Definition: sctp_pcb.h:183
sctp_zone_t ipi_zone_chunk
Definition: sctp_pcb.h:185
struct sctpvtaghead vtag_timewait[SCTP_STACK_VTAG_HASH_SIZE]
Definition: sctp_pcb.h:229
struct sctp_ifnlist * vrf_ifn_hash
Definition: sctp_pcb.h:174
uint32_t ipi_count_chunk
Definition: sctp_pcb.h:208
sctp_zone_t ipi_zone_asoc
Definition: sctp_pcb.h:182
uint32_t ipi_count_vrfs
Definition: sctp_pcb.h:217
struct sctppcbhead * sctp_tcpephash
Definition: sctp_pcb.h:167
u_long vrf_ifn_hashmark
Definition: sctp_pcb.h:175
sctp_zone_t ipi_zone_asconf
Definition: sctp_pcb.h:188
uint32_t ipi_count_raddr
Definition: sctp_pcb.h:205
uint32_t ipi_free_strmoq
Definition: sctp_pcb.h:227
uint32_t hashtblsize
Definition: sctp_pcb.h:169
uint32_t ipi_count_laddr
Definition: sctp_pcb.h:202
uint32_t ipi_count_readq
Definition: sctp_pcb.h:211
uint32_t ipi_free_chunks
Definition: sctp_pcb.h:226
sctp_zone_t ipi_zone_net
Definition: sctp_pcb.h:184
u_long hashvrfmark
Definition: sctp_pcb.h:172
struct sctp_timer addr_wq_timer
Definition: sctp_pcb.h:232
u_long hashasocmark
Definition: sctp_pcb.h:149
uint32_t ipi_count_ifns
Definition: sctp_pcb.h:220
uint32_t ipi_count_asoc
Definition: sctp_pcb.h:199
uint32_t ipi_count_ifas
Definition: sctp_pcb.h:223
uint8_t resv
Definition: sctp_pcb.h:113
uint8_t src_is_loop
Definition: sctp_pcb.h:110
uint32_t localifa_flags
Definition: sctp_pcb.h:108
union sctp_sockstore address
Definition: sctp_pcb.h:105
LIST_ENTRY(sctp_ifa) next_ifa
struct sctp_ifn * ifn_p
Definition: sctp_pcb.h:101
uint32_t refcount
Definition: sctp_pcb.h:106
uint32_t vrf_id
Definition: sctp_pcb.h:109
void * ifa
Definition: sctp_pcb.h:102
uint32_t flags
Definition: sctp_pcb.h:107
uint8_t src_is_glob
Definition: sctp_pcb.h:112
uint8_t src_is_priv
Definition: sctp_pcb.h:111
LIST_ENTRY(sctp_ifn) next_ifn
uint32_t num_v6
Definition: sctp_pcb.h:86
uint32_t refcount
Definition: sctp_pcb.h:83
uint32_t registered_af
Definition: sctp_pcb.h:88
uint32_t num_v4
Definition: sctp_pcb.h:87
uint32_t ifa_count
Definition: sctp_pcb.h:85
uint32_t ifn_index
Definition: sctp_pcb.h:82
uint32_t ifn_type
Definition: sctp_pcb.h:81
LIST_ENTRY(sctp_ifn) next_bucket
uint32_t ifn_mtu
Definition: sctp_pcb.h:80
struct sctp_ifalist ifalist
Definition: sctp_pcb.h:75
void * ifn_p
Definition: sctp_pcb.h:79
char ifn_name[SCTP_IFNAMSIZ]
Definition: sctp_pcb.h:89
struct sctp_vrf * vrf
Definition: sctp_pcb.h:76
uint16_t fibnum
Definition: sctp_pcb.h:422
uint32_t total_sends
Definition: sctp_pcb.h:423
uint8_t auth_supported
Definition: sctp_pcb.h:400
struct inpcb inp
Definition: sctp_pcb.h:356
u_long hashasocidmark
Definition: sctp_pcb.h:428
uint8_t prsctp_supported
Definition: sctp_pcb.h:399
uint32_t max_cwnd
Definition: sctp_pcb.h:395
uint32_t partial_delivery_point
Definition: sctp_pcb.h:393
uint32_t sctp_flags
Definition: sctp_pcb.h:381
uint8_t ecn_supported
Definition: sctp_pcb.h:398
struct mtx inp_create_mtx
Definition: sctp_pcb.h:418
uint8_t asconf_supported
Definition: sctp_pcb.h:402
struct mbuf * pkt
Definition: sctp_pcb.h:415
char align[(sizeof(struct inpcb)+SCTP_ALIGNM1) &~SCTP_ALIGNM1]
Definition: sctp_pcb.h:358
uint8_t idata_supported
Definition: sctp_pcb.h:401
int laddr_count
Definition: sctp_pcb.h:368
struct socket * sctp_socket
Definition: sctp_pcb.h:379
uint32_t sctp_frag_point
Definition: sctp_pcb.h:392
union sctp_inpcb::@33 ip_inp
uint8_t nrsack_supported
Definition: sctp_pcb.h:404
struct sctpasochead sctp_asoc_list
Definition: sctp_pcb.h:388
struct mtx inp_mtx
Definition: sctp_pcb.h:417
struct mbuf * pkt_last
Definition: sctp_pcb.h:415
uint8_t reconfig_supported
Definition: sctp_pcb.h:403
uint64_t sctp_features
Definition: sctp_pcb.h:380
uint32_t sctp_mobility_features
Definition: sctp_pcb.h:382
uint32_t total_nospaces
Definition: sctp_pcb.h:426
uint32_t total_recvs
Definition: sctp_pcb.h:424
uint32_t sctp_context
Definition: sctp_pcb.h:394
int32_t refcount
Definition: sctp_pcb.h:420
struct mbuf * control
Definition: sctp_pcb.h:416
struct sctp_readhead read_queue
Definition: sctp_pcb.h:362
struct sctpasochead * sctp_tcbhash
Definition: sctp_pcb.h:385
struct sctp_nonpad_sndrcvinfo def_send
Definition: sctp_pcb.h:406
u_long sctp_hashmark
Definition: sctp_pcb.h:386
uint32_t last_abort_code
Definition: sctp_pcb.h:425
struct sctpladdr sctp_addr_list
Definition: sctp_pcb.h:371
LIST_ENTRY(sctp_inpcb) sctp_list
struct sctp_laddr * next_addr_touse
Definition: sctp_pcb.h:376
uint32_t sctp_associd_counter
Definition: sctp_pcb.h:429
struct sctpasochead * sctp_asocidhash
Definition: sctp_pcb.h:427
uint32_t def_vrf_id
Definition: sctp_pcb.h:421
uint8_t pktdrop_supported
Definition: sctp_pcb.h:405
struct mtx inp_rdata_mtx
Definition: sctp_pcb.h:419
struct sctp_pcb sctp_ep
Definition: sctp_pcb.h:383
uint8_t local_strreset_support
Definition: sctp_pcb.h:396
uint32_t sctp_cmt_on_off
Definition: sctp_pcb.h:397
LIST_ENTRY(sctp_laddr) sctp_nxt_addr
uint32_t action
Definition: sctp_pcb.h:119
struct timeval start_time
Definition: sctp_pcb.h:122
struct sctp_ifa * ifa
Definition: sctp_pcb.h:118
uint32_t initial_init_rto_max
Definition: sctp_pcb.h:272
uint32_t sctp_maxrto
Definition: sctp_pcb.h:270
uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS]
Definition: sctp_pcb.h:265
uint32_t sctp_sws_receiver
Definition: sctp_pcb.h:276
uint16_t port
Definition: sctp_pcb.h:328
uint8_t default_dscp
Definition: sctp_pcb.h:325
char current_secret_number
Definition: sctp_pcb.h:326
uint8_t random_numbers[SCTP_SIGNATURE_ALOC_SIZE]
Definition: sctp_pcb.h:304
uint16_t max_init_times
Definition: sctp_pcb.h:289
uint32_t sctp_default_ss_module
Definition: sctp_pcb.h:279
struct sctp_keyhead shared_keys
Definition: sctp_pcb.h:281
char last_secret_number
Definition: sctp_pcb.h:327
struct sctp_timer signature_change
Definition: sctp_pcb.h:311
uint16_t max_send_times
Definition: sctp_pcb.h:292
uint16_t def_net_failure
Definition: sctp_pcb.h:294
uint32_t sctp_sws_sender
Definition: sctp_pcb.h:275
uint32_t initial_sequence_debug
Definition: sctp_pcb.h:316
uint16_t default_keyid
Definition: sctp_pcb.h:284
uint32_t auto_close_time
Definition: sctp_pcb.h:315
uint32_t def_cookie_life
Definition: sctp_pcb.h:313
uint32_t default_mtu
Definition: sctp_pcb.h:285
uint32_t initial_rto
Definition: sctp_pcb.h:271
uint32_t sctp_minrto
Definition: sctp_pcb.h:269
sctp_auth_chklist_t * local_auth_chunks
Definition: sctp_pcb.h:282
uint16_t pre_open_stream_count
Definition: sctp_pcb.h:299
unsigned int sctp_sack_freq
Definition: sctp_pcb.h:274
uint32_t random_counter
Definition: sctp_pcb.h:303
uint32_t fr_max_burst
Definition: sctp_pcb.h:321
uint16_t def_net_pf_threshold
Definition: sctp_pcb.h:296
unsigned int time_of_secret_change
Definition: sctp_pcb.h:263
uint32_t adaptation_layer_indicator
Definition: sctp_pcb.h:317
sctp_hmaclist_t * local_hmacs
Definition: sctp_pcb.h:283
uint16_t max_open_streams_intome
Definition: sctp_pcb.h:300
uint32_t store_at
Definition: sctp_pcb.h:319
uint8_t random_store[SCTP_SIGNATURE_ALOC_SIZE]
Definition: sctp_pcb.h:305
uint32_t sctp_default_cc_module
Definition: sctp_pcb.h:278
uint32_t sctp_timeoutticks[SCTP_NUM_TMRS]
Definition: sctp_pcb.h:268
unsigned int size_of_a_cookie
Definition: sctp_pcb.h:266
uint32_t max_burst
Definition: sctp_pcb.h:320
uint8_t adaptation_layer_indicator_provided
Definition: sctp_pcb.h:318
uint32_t vtag
Definition: sctp_pcb.h:342
uint16_t seq
Definition: sctp_pcb.h:344
uint16_t sz
Definition: sctp_pcb.h:345
uint16_t strm
Definition: sctp_pcb.h:343
uint16_t flgs
Definition: sctp_pcb.h:346
LIST_ENTRY(sctp_tagblock) sctp_nxt_tagblock
struct sctp_timewait vtag_block[SCTP_NUMBER_IN_VTAG_BLOCK]
Definition: sctp_pcb.h:138
struct socket * sctp_socket
Definition: sctp_pcb.h:438
struct mtx tcb_send_mtx
Definition: sctp_pcb.h:462
struct mtx tcb_mtx
Definition: sctp_pcb.h:461
uint16_t resv
Definition: sctp_pcb.h:460
uint32_t freed_by_sorcv_sincelast
Definition: sctp_pcb.h:455
LIST_ENTRY(sctp_tcb) sctp_asocs
uint32_t total_recvs
Definition: sctp_pcb.h:457
uint32_t total_sends
Definition: sctp_pcb.h:456
struct sctp_association asoc
Definition: sctp_pcb.h:449
LIST_ENTRY(sctp_tcb) sctp_tcbhash
uint16_t rport
Definition: sctp_pcb.h:459
int freed_from_where
Definition: sctp_pcb.h:458
struct sctp_block_entry * block_entry
Definition: sctp_pcb.h:447
struct sctp_inpcb * sctp_ep
Definition: sctp_pcb.h:439
uint16_t rport
Definition: sctp_pcb.h:133
uint16_t lport
Definition: sctp_pcb.h:132
uint32_t v_tag
Definition: sctp_pcb.h:131
uint32_t tv_sec_at_expire
Definition: sctp_pcb.h:130
uint32_t tbl_id_v6
Definition: sctp_pcb.h:68
struct sctp_ifnlist ifnlist
Definition: sctp_pcb.h:65
uint32_t total_ifa_count
Definition: sctp_pcb.h:69
LIST_ENTRY(sctp_vrf) next_vrf
u_long vrf_addr_hashmark
Definition: sctp_pcb.h:70
uint32_t vrf_id
Definition: sctp_pcb.h:66
uint32_t refcount
Definition: sctp_pcb.h:71
uint32_t tbl_id_v4
Definition: sctp_pcb.h:67
struct sctp_ifalist * vrf_addr_hash
Definition: sctp_pcb.h:64
Definition: sctp.h:48