003 File Manager
Current Path:
/usr/include/netinet
usr
/
include
/
netinet
/
📁
..
📁
cc
📄
dccp.h
(2.48 KB)
📄
icmp6.h
(26.97 KB)
📄
icmp_var.h
(3.78 KB)
📄
if_ether.h
(4.62 KB)
📄
igmp.h
(5.36 KB)
📄
igmp_var.h
(8.69 KB)
📄
in.h
(25.81 KB)
📄
in_fib.h
(2.59 KB)
📄
in_kdtrace.h
(3.31 KB)
📄
in_pcb.h
(34.46 KB)
📄
in_rss.h
(2.42 KB)
📄
in_systm.h
(2.57 KB)
📄
in_var.h
(15.4 KB)
📄
ip.h
(7.37 KB)
📄
ip6.h
(8.93 KB)
📄
ip_auth.h
(2.4 KB)
📄
ip_carp.h
(6.79 KB)
📄
ip_compat.h
(30.71 KB)
📄
ip_divert.h
(2.32 KB)
📄
ip_dstlist.h
(1.43 KB)
📄
ip_dummynet.h
(8.94 KB)
📄
ip_ecn.h
(2.1 KB)
📄
ip_encap.h
(3.13 KB)
📄
ip_fil.h
(54.87 KB)
📄
ip_frag.h
(3.5 KB)
📄
ip_fw.h
(34.29 KB)
📄
ip_htable.h
(2.04 KB)
📄
ip_icmp.h
(8.52 KB)
📄
ip_lookup.h
(4.61 KB)
📄
ip_mroute.h
(13.66 KB)
📄
ip_nat.h
(23.04 KB)
📄
ip_options.h
(2.61 KB)
📄
ip_pool.h
(1.34 KB)
📄
ip_proxy.h
(11.53 KB)
📄
ip_rules.h
(470 B)
📄
ip_scan.h
(2.56 KB)
📄
ip_state.h
(9.55 KB)
📄
ip_sync.h
(3.46 KB)
📄
ip_var.h
(11.48 KB)
📄
ipf_rb.h
(10.37 KB)
📄
ipl.h
(360 B)
📁
netdump
📄
pim.h
(4.25 KB)
📄
pim_var.h
(3.14 KB)
📄
radix_ipf.h
(2.63 KB)
📄
sctp.h
(22.97 KB)
📄
sctp_asconf.h
(3.31 KB)
📄
sctp_auth.h
(8.52 KB)
📄
sctp_bsd_addr.h
(2.45 KB)
📄
sctp_constants.h
(34.12 KB)
📄
sctp_crc32.h
(2.07 KB)
📄
sctp_header.h
(17.48 KB)
📄
sctp_indata.h
(4.18 KB)
📄
sctp_input.h
(2.43 KB)
📄
sctp_kdtrace.h
(3.6 KB)
📄
sctp_lock_bsd.h
(15.64 KB)
📄
sctp_os.h
(2.73 KB)
📄
sctp_os_bsd.h
(15.04 KB)
📄
sctp_output.h
(6.38 KB)
📄
sctp_pcb.h
(19.31 KB)
📄
sctp_peeloff.h
(2.05 KB)
📄
sctp_structs.h
(38.29 KB)
📄
sctp_sysctl.h
(22.9 KB)
📄
sctp_timer.h
(3.07 KB)
📄
sctp_uio.h
(38.07 KB)
📄
sctp_var.h
(12.21 KB)
📄
sctputil.h
(11.69 KB)
📄
tcp.h
(18.3 KB)
📄
tcp_debug.h
(2.65 KB)
📄
tcp_fastopen.h
(3.7 KB)
📄
tcp_fsm.h
(4.25 KB)
📄
tcp_hostcache.h
(2.92 KB)
📄
tcp_hpts.h
(9.89 KB)
📄
tcp_log_buf.h
(14.88 KB)
📄
tcp_lro.h
(4.43 KB)
📄
tcp_offload.h
(2.09 KB)
📄
tcp_pcap.h
(1.76 KB)
📄
tcp_ratelimit.h
(5.07 KB)
📄
tcp_seq.h
(3.57 KB)
📁
tcp_stacks
📄
tcp_syncache.h
(5.16 KB)
📄
tcp_timer.h
(9.29 KB)
📄
tcp_var.h
(43.48 KB)
📄
tcpip.h
(2.29 KB)
📄
toecore.h
(5.13 KB)
📄
udp.h
(2.49 KB)
📄
udp_var.h
(6.48 KB)
📄
udplite.h
(1.91 KB)
Editing: ipf_rb.h
/* * Copyright (C) 2012 by Darren Reed. * * See the IPFILTER.LICENCE file for details on licencing. * */ typedef enum rbcolour_e { C_BLACK = 0, C_RED = 1 } rbcolour_t; #define RBI_LINK(_n, _t) \ struct _n##_rb_link { \ struct _t *left; \ struct _t *right; \ struct _t *parent; \ rbcolour_t colour; \ } #define RBI_HEAD(_n, _t) \ struct _n##_rb_head { \ struct _t top; \ int count; \ int (* compare)(struct _t *, struct _t *); \ } #define RBI_CODE(_n, _t, _f, _cmp) \ \ typedef void (*_n##_rb_walker_t)(_t *, void *); \ \ _t * _n##_rb_delete(struct _n##_rb_head *, _t *); \ void _n##_rb_init(struct _n##_rb_head *); \ void _n##_rb_insert(struct _n##_rb_head *, _t *); \ _t * _n##_rb_search(struct _n##_rb_head *, void *); \ void _n##_rb_walktree(struct _n##_rb_head *, _n##_rb_walker_t, void *);\ \ static void \ rotate_left(struct _n##_rb_head *head, _t *node) \ { \ _t *parent, *tmp1, *tmp2; \ \ parent = node->_f.parent; \ tmp1 = node->_f.right; \ tmp2 = tmp1->_f.left; \ node->_f.right = tmp2; \ if (tmp2 != & _n##_rb_zero) \ tmp2->_f.parent = node; \ if (parent == & _n##_rb_zero) \ head->top._f.right = tmp1; \ else if (parent->_f.right == node) \ parent->_f.right = tmp1; \ else \ parent->_f.left = tmp1; \ tmp1->_f.left = node; \ tmp1->_f.parent = parent; \ node->_f.parent = tmp1; \ } \ \ static void \ rotate_right(struct _n##_rb_head *head, _t *node) \ { \ _t *parent, *tmp1, *tmp2; \ \ parent = node->_f.parent; \ tmp1 = node->_f.left; \ tmp2 = tmp1->_f.right; \ node->_f.left = tmp2; \ if (tmp2 != &_n##_rb_zero) \ tmp2->_f.parent = node; \ if (parent == &_n##_rb_zero) \ head->top._f.right = tmp1; \ else if (parent->_f.right == node) \ parent->_f.right = tmp1; \ else \ parent->_f.left = tmp1; \ tmp1->_f.right = node; \ tmp1->_f.parent = parent; \ node->_f.parent = tmp1; \ } \ \ void \ _n##_rb_insert(struct _n##_rb_head *head, _t *node) \ { \ _t *n, *parent, **p, *tmp1, *gparent; \ \ parent = &head->top; \ node->_f.left = &_n##_rb_zero; \ node->_f.right = &_n##_rb_zero; \ p = &head->top._f.right; \ while ((n = *p) != &_n##_rb_zero) { \ if (_cmp(node, n) < 0) \ p = &n->_f.left; \ else \ p = &n->_f.right; \ parent = n; \ } \ *p = node; \ node->_f.colour = C_RED; \ node->_f.parent = parent; \ \ while ((node != &_n##_rb_zero) && (parent->_f.colour == C_RED)){\ gparent = parent->_f.parent; \ if (parent == gparent->_f.left) { \ tmp1 = gparent->_f.right; \ if (tmp1->_f.colour == C_RED) { \ parent->_f.colour = C_BLACK; \ tmp1->_f.colour = C_BLACK; \ gparent->_f.colour = C_RED; \ node = gparent; \ } else { \ if (node == parent->_f.right) { \ node = parent; \ rotate_left(head, node); \ parent = node->_f.parent; \ } \ parent->_f.colour = C_BLACK; \ gparent->_f.colour = C_RED; \ rotate_right(head, gparent); \ } \ } else { \ tmp1 = gparent->_f.left; \ if (tmp1->_f.colour == C_RED) { \ parent->_f.colour = C_BLACK; \ tmp1->_f.colour = C_BLACK; \ gparent->_f.colour = C_RED; \ node = gparent; \ } else { \ if (node == parent->_f.left) { \ node = parent; \ rotate_right(head, node); \ parent = node->_f.parent; \ } \ parent->_f.colour = C_BLACK; \ gparent->_f.colour = C_RED; \ rotate_left(head, parent->_f.parent); \ } \ } \ parent = node->_f.parent; \ } \ head->top._f.right->_f.colour = C_BLACK; \ head->count++; \ } \ \ static void \ deleteblack(struct _n##_rb_head *head, _t *parent, _t *node) \ { \ _t *tmp; \ \ while ((node == &_n##_rb_zero || node->_f.colour == C_BLACK) && \ node != &head->top) { \ if (parent->_f.left == node) { \ tmp = parent->_f.right; \ if (tmp->_f.colour == C_RED) { \ tmp->_f.colour = C_BLACK; \ parent->_f.colour = C_RED; \ rotate_left(head, parent); \ tmp = parent->_f.right; \ } \ if ((tmp->_f.left == &_n##_rb_zero || \ tmp->_f.left->_f.colour == C_BLACK) && \ (tmp->_f.right == &_n##_rb_zero || \ tmp->_f.right->_f.colour == C_BLACK)) { \ tmp->_f.colour = C_RED; \ node = parent; \ parent = node->_f.parent; \ } else { \ if (tmp->_f.right == &_n##_rb_zero || \ tmp->_f.right->_f.colour == C_BLACK) {\ _t *tmp2 = tmp->_f.left; \ \ if (tmp2 != &_n##_rb_zero) \ tmp2->_f.colour = C_BLACK;\ tmp->_f.colour = C_RED; \ rotate_right(head, tmp); \ tmp = parent->_f.right; \ } \ tmp->_f.colour = parent->_f.colour; \ parent->_f.colour = C_BLACK; \ if (tmp->_f.right != &_n##_rb_zero) \ tmp->_f.right->_f.colour = C_BLACK;\ rotate_left(head, parent); \ node = head->top._f.right; \ } \ } else { \ tmp = parent->_f.left; \ if (tmp->_f.colour == C_RED) { \ tmp->_f.colour = C_BLACK; \ parent->_f.colour = C_RED; \ rotate_right(head, parent); \ tmp = parent->_f.left; \ } \ if ((tmp->_f.left == &_n##_rb_zero || \ tmp->_f.left->_f.colour == C_BLACK) && \ (tmp->_f.right == &_n##_rb_zero || \ tmp->_f.right->_f.colour == C_BLACK)) { \ tmp->_f.colour = C_RED; \ node = parent; \ parent = node->_f.parent; \ } else { \ if (tmp->_f.left == &_n##_rb_zero || \ tmp->_f.left->_f.colour == C_BLACK) {\ _t *tmp2 = tmp->_f.right; \ \ if (tmp2 != &_n##_rb_zero) \ tmp2->_f.colour = C_BLACK;\ tmp->_f.colour = C_RED; \ rotate_left(head, tmp); \ tmp = parent->_f.left; \ } \ tmp->_f.colour = parent->_f.colour; \ parent->_f.colour = C_BLACK; \ if (tmp->_f.left != &_n##_rb_zero) \ tmp->_f.left->_f.colour = C_BLACK;\ rotate_right(head, parent); \ node = head->top._f.right; \ break; \ } \ } \ } \ if (node != &_n##_rb_zero) \ node->_f.colour = C_BLACK; \ } \ \ _t * \ _n##_rb_delete(struct _n##_rb_head *head, _t *node) \ { \ _t *child, *parent, *old = node, *left; \ rbcolour_t color; \ \ if (node->_f.left == &_n##_rb_zero) { \ child = node->_f.right; \ } else if (node->_f.right == &_n##_rb_zero) { \ child = node->_f.left; \ } else { \ node = node->_f.right; \ while ((left = node->_f.left) != &_n##_rb_zero) \ node = left; \ child = node->_f.right; \ parent = node->_f.parent; \ color = node->_f.colour; \ if (child != &_n##_rb_zero) \ child->_f.parent = parent; \ if (parent != &_n##_rb_zero) { \ if (parent->_f.left == node) \ parent->_f.left = child; \ else \ parent->_f.right = child; \ } else { \ head->top._f.right = child; \ } \ if (node->_f.parent == old) \ parent = node; \ *node = *old; \ if (old->_f.parent != &_n##_rb_zero) { \ if (old->_f.parent->_f.left == old) \ old->_f.parent->_f.left = node; \ else \ old->_f.parent->_f.right = node; \ } else { \ head->top._f.right = child; \ } \ old->_f.left->_f.parent = node; \ if (old->_f.right != &_n##_rb_zero) \ old->_f.right->_f.parent = node; \ if (parent != &_n##_rb_zero) { \ left = parent; \ } \ goto colour; \ } \ parent = node->_f.parent; \ color= node->_f.colour; \ if (child != &_n##_rb_zero) \ child->_f.parent = parent; \ if (parent != &_n##_rb_zero) { \ if (parent->_f.left == node) \ parent->_f.left = child; \ else \ parent->_f.right = child; \ } else { \ head->top._f.right = child; \ } \ colour: \ if (color == C_BLACK) \ deleteblack(head, parent, node); \ head->count--; \ return old; \ } \ \ void \ _n##_rb_init(struct _n##_rb_head *head) \ { \ memset(head, 0, sizeof(*head)); \ memset(&_n##_rb_zero, 0, sizeof(_n##_rb_zero)); \ head->top._f.left = &_n##_rb_zero; \ head->top._f.right = &_n##_rb_zero; \ head->top._f.parent = &head->top; \ _n##_rb_zero._f.left = &_n##_rb_zero; \ _n##_rb_zero._f.right = &_n##_rb_zero; \ _n##_rb_zero._f.parent = &_n##_rb_zero; \ } \ \ void \ _n##_rb_walktree(struct _n##_rb_head *head, _n##_rb_walker_t func, void *arg)\ { \ _t *prev; \ _t *next; \ _t *node = head->top._f.right; \ _t *base; \ \ while (node != &_n##_rb_zero) \ node = node->_f.left; \ \ for (;;) { \ base = node; \ prev = node; \ while ((node->_f.parent->_f.right == node) && \ (node != &_n##_rb_zero)) { \ prev = node; \ node = node->_f.parent; \ } \ \ node = prev; \ for (node = node->_f.parent->_f.right; node != &_n##_rb_zero;\ node = node->_f.left) \ prev = node; \ next = prev; \ \ if (node != &_n##_rb_zero) \ func(node, arg); \ \ node = next; \ if (node == &_n##_rb_zero) \ break; \ } \ } \ \ _t * \ _n##_rb_search(struct _n##_rb_head *head, void *key) \ { \ int match; \ _t *node; \ node = head->top._f.right; \ while (node != &_n##_rb_zero) { \ match = _cmp(key, node); \ if (match == 0) \ break; \ if (match< 0) \ node = node->_f.left; \ else \ node = node->_f.right; \ } \ if (node == &_n##_rb_zero || match != 0) \ return (NULL); \ return (node); \ } #define RBI_DELETE(_n, _h, _v) _n##_rb_delete(_h, _v) #define RBI_FIELD(_n) struct _n##_rb_link #define RBI_INIT(_n, _h) _n##_rb_init(_h) #define RBI_INSERT(_n, _h, _v) _n##_rb_insert(_h, _v) #define RBI_ISEMPTY(_h) ((_h)->count == 0) #define RBI_SEARCH(_n, _h, _k) _n##_rb_search(_h, _k) #define RBI_WALK(_n, _h, _w, _a) _n##_rb_walktree(_h, _w, _a) #define RBI_ZERO(_n) _n##_rb_zero
Upload File
Create Folder