2023-11-30 03:02:08 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
* Copyright Red Hat
|
|
|
|
* Author: David Gibson <david@gibson.dropbear.id.au>
|
|
|
|
*
|
|
|
|
* Tracking for logical "flows" of packets.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2023-11-30 03:02:09 +01:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
2023-11-30 03:02:08 +01:00
|
|
|
|
2023-11-30 03:02:09 +01:00
|
|
|
#include "util.h"
|
|
|
|
#include "passt.h"
|
|
|
|
#include "siphash.h"
|
|
|
|
#include "inany.h"
|
2023-11-30 03:02:08 +01:00
|
|
|
#include "flow.h"
|
2023-11-30 03:02:09 +01:00
|
|
|
#include "tcp_conn.h"
|
|
|
|
#include "flow_table.h"
|
2023-11-30 03:02:08 +01:00
|
|
|
|
|
|
|
const char *flow_type_str[] = {
|
|
|
|
[FLOW_TYPE_NONE] = "<none>",
|
|
|
|
[FLOW_TCP] = "TCP connection",
|
|
|
|
[FLOW_TCP_SPLICE] = "TCP connection (spliced)",
|
|
|
|
};
|
|
|
|
static_assert(ARRAY_SIZE(flow_type_str) == FLOW_NUM_TYPES,
|
|
|
|
"flow_type_str[] doesn't match enum flow_type");
|
2023-11-30 03:02:09 +01:00
|
|
|
|
|
|
|
/* Global Flow Table */
|
|
|
|
union flow flowtab[FLOW_MAX];
|