-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add new ipv6 types Add a new ipv6addr struct which contains the 16 bytes of the ip address as 4 uint32_ts. It also has methods for comparisons and subnet checks. Also add new PPM types PT_IPV6ADDR/PT_IPV6NET as well as a general PT_IPADDR/PT_IPNET type. The general types will be used for things like filterchecks where they operate interchangeably on ipv4/ipv6 addresses. * Add ipv6 address support to sinsp interfaces Fully support ipv6 addresses in sinsp_network_interfaces. When storing an ipv6 interface, use the new explicit type ipv6addr instead of 16-byte arrays. Also only save the network portion in a single ipv6 address. Add methods import_ipv6_interface, is_ipv6addr_in_local_machine, infer_ipv6_address, which are used by update_fd to update sinsp_fdinfo structs based on interface information. * Handle ipv6 addrs in comparisons/string conversion Handle PT_IPV6ADDR as a type in string conversions to/from rawvals, both directly and into the lua stack. Generally it's just inet_pton/inet_ntop on the bytes in the ipv6addr struct. Also handle comparisons on PT_IPV6ADDR/PT_IPV6NET, using the equality and netmast comparison operators on the struct. To handle conversion/comparisons for PT_IPADDR/PT_IPNET, use the size of the rawval to determine if it's an ipv4 or ipv6 address and call comparison/converson method again with PT_IPV6ADDR/PT_IPV4ADDR as appropriate. For strings, infer the type based on whether the string has '.' or ':' characters. This required a change to the methods to take the param type/format instead of a filtercheck_field_info, as there are other uses that don't have a filtercheck_field_info. * Handle ipv6 addresses in csysdig In get_thread_table_int, support SCAP_FD_IPV6 types, grabbing the right part of the sockinfo struct and doing the right conversion for the address family. Add a default column width for ipv6 addresses. * Support ipv6 addrs in fd.{*ip*,*net*} filterchecks Change all fd.ip/fd.net filterchecks to work on PT_IPADDR types instead. When extracting, add tests for SCAP_FD_IPV6_* types and extract the right part of the sockinfo struct. Comparisons/conversion is already handled by the rawval_to_string changes that handle PT_IPADDR/PT_IPNET types. * Handle event parsing for ipv6 addresses Instead of simply handling ipv4 mapped ipv6 addresses, handle any ipv6 address, filling in the right part of the sockinfo struct from the event parameter. Also handle source/dest swapping when determining the client/server endpoints of a connection. Conversions that used to work simply on an ipv6 address as byte array now work on the m_b field of the ipv6addr struct. * Change typechar for server sockets to 4/6 The documentation of fd.typechar doesn't distinguish between server sockets and non-server sockets, so simplify things by simply using '4'/'6' to reflect the ipv4/ipv6 type. * Update chisels to support ipv6 In cases where a chisel's filter was specific to ipv4, also allow ipv6. * Don't return local strings from proto filterchecks These were returning pointers to local string values on the stack. Replace with m_tstr, a general purpose string in the object, instead.
- Loading branch information
Showing
27 changed files
with
1,014 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.