File peafowl.h

Parent directory (include/peafowl)

This is the main peafowl header.

Definition (include/peafowl/peafowl.h)

Detailed Description

File peafowl.h

Copyright (c) 2012-2019 Daniele De Sensi (d.desensi.software@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Peafowl is a flexible and extensible DPI framework which can be used to identify the application protocols carried by IP (IPv4 and IPv6) packets and to extract and process data and metadata carried by those protocols. For example, is possible to write applications that process any possible kind of data and metadata carried by an HTTP connection (e.g. Host, User-Agent, Content-Type, HTTP body, etc..). It’s important to notice that the application programmer needs only to focus on the way these information are processed, since their extraction is completely and transparently performed by the framework. Accordingly, using Peafowl is possible to implement different kinds of applications like:

  • URL filtering (for parental control or access control)

  • User-Agent or Content-Type filtering (e.g. block traffic for mobile users, block video traffic, etc…)

  • Security controls (e.g. block the traffic containing some malicious signatures or patterns)

  • Data leak prevention

  • Quality of Service and Traffic shaping (e.g. to give higher priority to VoIP traffic)

Peafowl is not tied to any specific technology for packet capture. Accordingly, you can capture the packets using pcap, sockets, PF_RING or whatever technology you prefer. To correctly identify the protocol also when its data is split among multiple IP fragments and/or TCP segments and to avoid the possibility of evasion attacks, if required, the framework can perform IP defragmentation and TCP stream reassembly. Main features:

  • As typical for these kind of applications, packets are aggregated into flows (i.e. connections between applications). A flow is identified by a tuple: <Source IP address, Destination IP address, Source Port, Destination Port, L4 protocol>

  • Protocol identification and extraction of application level protocol fields.

  • Support for IPv6 and tunneling: 6in6, 4in4, 6in4, 4in6

  • Robust IPv4 and IPv6 defragmentation support tested against a large number of possible attacks.

  • TCP stream reassembly.

  • Possibility to decide at a fine grain which protocol fields should be extracted.

  • It is also possible to only dissect some levels. E.g. if data is received from and UDP socket and the information up to L4 are already knonw.

Includes

  • net/ethernet.h

  • peafowl/config.h

  • peafowl/utils.h

  • sys/types.h

Functions