Go to the source code of this file.
Classes | |
| struct | bsc_conn_event |
| struct | dedup_key |
Macros | |
| #define | AF_INET 2 |
| #define | AF_INET6 10 |
| #define | TCP_ESTABLISHED 1 |
| #define | IPPROTO_TCP 6 |
| #define | IPPROTO_UDP 17 |
| #define | RINGBUF_SIZE (8 * 1024 * 1024) |
| #define | UDP_DEDUP_WINDOW_NS (5ULL * 1000ULL * 1000ULL * 1000ULL) |
| #define | TCP_DEDUP_WINDOW_NS (2ULL * 1000ULL * 1000ULL * 1000ULL) |
Functions | |
| struct { ... } | SEC (".maps") |
| __uint (type, BPF_MAP_TYPE_RINGBUF) | |
| __uint (max_entries, RINGBUF_SIZE) | |
| __uint (type, BPF_MAP_TYPE_LRU_HASH) | |
| __uint (max_entries, 8192) | |
| __type (key, struct dedup_key) | |
| __type (value, __u64) | |
| static __always_inline void | fill_proc (struct bsc_conn_event *ev) |
| static __always_inline bool | should_emit (const struct dedup_key *k, __u64 now_ns, __u64 window_ns) |
| int | bsc_inet_sock_set_state (struct trace_event_raw_inet_sock_set_state *ctx) |
| int | BPF_KPROBE (bsc_tcp_v4_connect, struct sock *sk) |
| int | BPF_KPROBE (bsc_tcp_v6_connect, struct sock *sk) |
| static __always_inline bool | extract_msg_v4 (struct msghdr *msg, __u32 *out_daddr, __u16 *out_dport) |
| static __always_inline bool | extract_msg_v6 (struct msghdr *msg, __u8 out_daddr[16], __u16 *out_dport) |
| int | BPF_KPROBE (bsc_udp_sendmsg, struct sock *sk, struct msghdr *msg) |
| int | BPF_KPROBE (bsc_udpv6_sendmsg, struct sock *sk, struct msghdr *msg) |
| char LICENSE[] | SEC ("license") |
| #define AF_INET 2 |
Definition at line 56 of file bsc_ebpf.c.
Referenced by FirewallRuleManager::applyWithFirewalld(), BPF_KPROBE(), BPF_KPROBE(), bsc_inet_sock_set_state(), classify_bypass_entry(), anonymous_namespace{BastionGuard-mailproxy.cpp}::create_server_socket(), bsc::ebpf::event_to_connection(), extract_msg_v4(), anonymous_namespace{BastionGuard-mailproxy.cpp}::handle_client(), bsc::net::anonymous_namespace{SocketSnapshot.cpp}::hex_ipv4(), anonymous_namespace{FirewallRuleManager.cpp}::ip_family(), DomainFilter::is_local_network(), bsc::ui_util::GeoResolver::is_private_ip(), anonymous_namespace{bastionguard-firewall.cpp}::is_valid_ip(), anonymous_namespace{BastionGuard-mailproxy.cpp}::is_valid_ipv4(), BastionGuard::WireguardBackend::killswitch_enable(), DomainFilter::match_cidr(), DomainFilter::parse_cidr(), bsc::rule::anonymous_namespace{Rule.cpp}::parse_ipv4(), AsyncDNSResolver::resolve_async(), resolve_with_cache(), bsc::net::DnsResolver::reverse_lookup(), send_archive_alert(), send_socket_alert(), bsc::net::sockdiag_lookup_tcp(), bsc::net::sockdiag_lookup_udp(), bsc::net::anonymous_namespace{SockDiag.cpp}::sockdiag_query(), AlertApp::start_tcp_listener(), BastionGuard::valid_cidr_(), BastionGuard::valid_endpoint_(), and BastionGuard::valid_ip_().
| #define AF_INET6 10 |
Definition at line 57 of file bsc_ebpf.c.
Referenced by FirewallRuleManager::applyWithFirewalld(), BPF_KPROBE(), BPF_KPROBE(), bsc_inet_sock_set_state(), classify_bypass_entry(), anonymous_namespace{BastionGuard-mailproxy.cpp}::create_server_socket(), bsc::ebpf::event_to_connection(), extract_msg_v6(), anonymous_namespace{BastionGuard-mailproxy.cpp}::handle_client(), bsc::net::anonymous_namespace{SocketSnapshot.cpp}::hex_ipv6(), anonymous_namespace{FirewallRuleManager.cpp}::ip_family(), DomainFilter::is_local_network(), bsc::ui_util::GeoResolver::is_private_ip(), anonymous_namespace{bastionguard-firewall.cpp}::is_valid_ip(), BastionGuard::WireguardBackend::killswitch_enable(), DomainFilter::match_cidr(), DomainFilter::parse_cidr(), bsc::rule::anonymous_namespace{Rule.cpp}::parse_ipv6(), resolve_with_cache(), bsc::net::DnsResolver::reverse_lookup(), bsc::net::sockdiag_lookup_tcp(), bsc::net::sockdiag_lookup_udp(), bsc::net::anonymous_namespace{SockDiag.cpp}::sockdiag_query(), BastionGuard::valid_cidr_(), BastionGuard::valid_endpoint_(), and BastionGuard::valid_ip_().
| #define IPPROTO_TCP 6 |
Definition at line 60 of file bsc_ebpf.c.
Referenced by BPF_KPROBE(), BPF_KPROBE(), bsc_inet_sock_set_state(), and bsc::net::sockdiag_lookup_tcp().
| #define IPPROTO_UDP 17 |
Definition at line 61 of file bsc_ebpf.c.
Referenced by BPF_KPROBE(), BPF_KPROBE(), bsc_inet_sock_set_state(), and bsc::net::sockdiag_lookup_udp().
| #define RINGBUF_SIZE (8 * 1024 * 1024) |
Definition at line 65 of file bsc_ebpf.c.
| #define TCP_DEDUP_WINDOW_NS (2ULL * 1000ULL * 1000ULL * 1000ULL) |
Definition at line 69 of file bsc_ebpf.c.
Referenced by BPF_KPROBE(), and BPF_KPROBE().
| #define TCP_ESTABLISHED 1 |
Definition at line 58 of file bsc_ebpf.c.
Referenced by bsc_inet_sock_set_state().
| #define UDP_DEDUP_WINDOW_NS (5ULL * 1000ULL * 1000ULL * 1000ULL) |
Definition at line 68 of file bsc_ebpf.c.
Referenced by BPF_KPROBE(), and BPF_KPROBE().
| @072270030377323145125163337314057176140314073041::__type | ( | key | , |
| struct dedup_key | ) |
| @072270030377323145125163337314057176140314073041::__type | ( | value | , |
| __u64 | ) |
| SEC::__uint | ( | max_entries | , |
| 8192 | ) |
| @314017302272111134376103221067163065253031234061::__uint | ( | max_entries | , |
| RINGBUF_SIZE | ) |
| SEC::__uint | ( | type | , |
| BPF_MAP_TYPE_LRU_HASH | ) |
| SEC::__uint | ( | type | , |
| BPF_MAP_TYPE_RINGBUF | ) |
| int BPF_KPROBE | ( | bsc_tcp_v4_connect | , |
| struct sock * | sk ) |
Definition at line 209 of file bsc_ebpf.c.
References bsc_conn_event::_pad, AF_INET, BPF_KPROBE(), bsc_conn_event::dst_addr, dedup_key::dst_addr, bsc_conn_event::dst_port, dedup_key::dst_port, bsc_conn_event::event_kind, bsc_conn_event::family, dedup_key::family, fill_proc(), IPPROTO_TCP, dedup_key::pid, bsc_conn_event::proto, dedup_key::proto, should_emit(), bsc_conn_event::src_addr, bsc_conn_event::src_port, TCP_DEDUP_WINDOW_NS, and bsc_conn_event::ts_ns.
Referenced by BPF_KPROBE(), BPF_KPROBE(), BPF_KPROBE(), and BPF_KPROBE().
| int BPF_KPROBE | ( | bsc_tcp_v6_connect | , |
| struct sock * | sk ) |
Definition at line 258 of file bsc_ebpf.c.
References bsc_conn_event::_pad, AF_INET6, BPF_KPROBE(), bsc_conn_event::dst_addr, dedup_key::dst_addr, bsc_conn_event::dst_port, dedup_key::dst_port, bsc_conn_event::event_kind, bsc_conn_event::family, dedup_key::family, fill_proc(), IPPROTO_TCP, dedup_key::pid, bsc_conn_event::proto, dedup_key::proto, should_emit(), bsc_conn_event::src_addr, bsc_conn_event::src_port, TCP_DEDUP_WINDOW_NS, and bsc_conn_event::ts_ns.
| int BPF_KPROBE | ( | bsc_udp_sendmsg | , |
| struct sock * | sk, | ||
| struct msghdr * | msg ) |
Definition at line 348 of file bsc_ebpf.c.
References bsc_conn_event::_pad, AF_INET, BPF_KPROBE(), bsc_conn_event::dst_addr, dedup_key::dst_addr, bsc_conn_event::dst_port, dedup_key::dst_port, bsc_conn_event::event_kind, extract_msg_v4(), bsc_conn_event::family, dedup_key::family, fill_proc(), IPPROTO_UDP, dedup_key::pid, bsc_conn_event::proto, dedup_key::proto, should_emit(), bsc_conn_event::src_addr, bsc_conn_event::src_port, bsc_conn_event::ts_ns, and UDP_DEDUP_WINDOW_NS.
| int BPF_KPROBE | ( | bsc_udpv6_sendmsg | , |
| struct sock * | sk, | ||
| struct msghdr * | msg ) |
Definition at line 400 of file bsc_ebpf.c.
References bsc_conn_event::_pad, AF_INET6, BPF_KPROBE(), bsc_conn_event::dst_addr, dedup_key::dst_addr, bsc_conn_event::dst_port, dedup_key::dst_port, bsc_conn_event::event_kind, extract_msg_v6(), bsc_conn_event::family, dedup_key::family, fill_proc(), IPPROTO_UDP, dedup_key::pid, bsc_conn_event::proto, dedup_key::proto, should_emit(), bsc_conn_event::src_addr, bsc_conn_event::src_port, bsc_conn_event::ts_ns, and UDP_DEDUP_WINDOW_NS.
| int bsc_inet_sock_set_state | ( | struct trace_event_raw_inet_sock_set_state * | ctx | ) |
Definition at line 157 of file bsc_ebpf.c.
References bsc_conn_event::_pad, AF_INET, AF_INET6, bsc_inet_sock_set_state(), bsc_conn_event::dst_addr, bsc_conn_event::dst_port, bsc_conn_event::event_kind, bsc_conn_event::family, fill_proc(), IPPROTO_TCP, IPPROTO_UDP, bsc_conn_event::proto, bsc_conn_event::src_addr, bsc_conn_event::src_port, TCP_ESTABLISHED, and bsc_conn_event::ts_ns.
Referenced by bsc_inet_sock_set_state().
|
static |
Definition at line 311 of file bsc_ebpf.c.
References AF_INET, and extract_msg_v4().
Referenced by BPF_KPROBE(), and extract_msg_v4().
|
static |
Definition at line 329 of file bsc_ebpf.c.
References AF_INET6, and extract_msg_v6().
Referenced by BPF_KPROBE(), and extract_msg_v6().
|
static |
Definition at line 127 of file bsc_ebpf.c.
References bsc_conn_event::comm, fill_proc(), bsc_conn_event::gid, bsc_conn_event::pid, bsc_conn_event::tid, and bsc_conn_event::uid.
Referenced by BPF_KPROBE(), BPF_KPROBE(), BPF_KPROBE(), BPF_KPROBE(), bsc_inet_sock_set_state(), and fill_proc().
| struct @314017302272111134376103221067163065253031234061 SEC | ( | ".maps" | ) |
| char LICENSE[] SEC | ( | "license" | ) |
References SEC.
|
static |
Definition at line 139 of file bsc_ebpf.c.
References should_emit().
Referenced by BPF_KPROBE(), BPF_KPROBE(), BPF_KPROBE(), BPF_KPROBE(), and should_emit().