This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tsg-service-chaining-…/common/include/stream_addr.h
2023-01-10 16:30:42 +08:00

50 lines
902 B
C

#ifndef _STREAM_ADDR_H
#define _STREAM_ADDR_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include <netinet/in.h>
enum stream_addr_type
{
STREAM_ADDR_TYPE_V4,
STREAM_ADDR_TYPE_V6,
};
struct stream_addr_v4
{
struct in_addr src_addr; /* network order */
struct in_addr dst_addr; /* network order */
in_port_t src_port; /* network order */
in_port_t dst_port; /* network order */
};
struct stream_addr_v6
{
struct in6_addr src_addr; /* network order */
struct in6_addr dst_addr; /* network order */
in_port_t src_port; /* network order */
in_port_t dst_port; /* network order */
};
struct stream_addr
{
enum stream_addr_type addr_type;
union
{
struct stream_addr_v4 addr_v4;
struct stream_addr_v6 addr_v6;
};
};
char *stream_addr_to_str(const struct stream_addr *addr);
#ifdef __cpluscplus
}
#endif
#endif