mirror of
https://passt.top/passt
synced 2024-11-09 14:19:56 +00:00
8a2accb847
Currently we have no generic information flows apart from the type and state, everything else is specific to the flow type. Start introducing generic flow information by recording the pifs which the flow connects. To keep track of what information is valid, introduce new flow states: INI for when the initiating side information is complete, and TGT for when both sides information is complete, but we haven't chosen the flow type yet. For now, these states don't do an awful lot, but they'll become more important as we add more generic information. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
47 lines
892 B
C
47 lines
892 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright Red Hat
|
|
* Author: David Gibson <david@gibson.dropbear.id.au>
|
|
*
|
|
* Passt/pasta interface types and IDs
|
|
*/
|
|
#ifndef PIF_H
|
|
#define PIF_H
|
|
|
|
/**
|
|
* enum pif_type - Type of passt/pasta interface ("pif")
|
|
*
|
|
* pifs can be an L4 level channel (sockets) or an L2 level channel (tap device
|
|
* or qemu socket).
|
|
*/
|
|
enum pif_type {
|
|
/* Invalid or not present pif */
|
|
PIF_NONE = 0,
|
|
/* Host socket interface */
|
|
PIF_HOST,
|
|
/* Qemu socket or namespace tuntap interface */
|
|
PIF_TAP,
|
|
/* Namespace socket interface for splicing */
|
|
PIF_SPLICE,
|
|
|
|
PIF_NUM_TYPES,
|
|
};
|
|
|
|
#define PIF_NAMELEN 8
|
|
|
|
extern const char *pif_type_str[];
|
|
|
|
static inline const char *pif_type(enum pif_type pt)
|
|
{
|
|
if (pt < PIF_NUM_TYPES)
|
|
return pif_type_str[pt];
|
|
else
|
|
return "?";
|
|
}
|
|
|
|
static inline const char *pif_name(uint8_t pif)
|
|
{
|
|
return pif_type(pif);
|
|
}
|
|
|
|
#endif /* PIF_H */
|