Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Classes | Macros | Typedefs | Enumerations | Functions | Variables
policy.h File Reference

Policy description. More...

#include <netinet/in.h>
#include <string.h>
#include <hicn/util/token.h>
Include dependency graph for policy.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  policy_tag_state_t
 
struct  interface_stats_t
 
struct  policy_stats_t
 
struct  interface_counters_t
 
struct  policy_counters_t
 
struct  hicn_policy_t
 
struct  policy_description_t
 

Macros

#define foreach_policy_tag
 
#define _(x, y)   POLICY_TAG_ ## x,
 
#define MAXSZ_POLICY_TAG_   11
 
#define MAXSZ_POLICY_TAG   MAXSZ_POLICY_TAG_ + 1
 
#define _(x, y)   if (strcasecmp(str, policy_tag_str[POLICY_TAG_ ## x] ) == 0) { return POLICY_TAG_ ## x; } else
 
#define _(x, y)   *tags |= policy_tags_has(*tags_to_union, POLICY_TAG_ ## x) ? (1 << POLICY_TAG_ ## x) : 0;
 
#define POLICY_TAGS_EMPTY   0
 
#define _(x, y)   s[POLICY_TAG_ ## x] = policy_tags_has(tags, POLICY_TAG_ ## x) ? y : '.';
 
#define MAXSZ_POLICY_TAGS_   POLICY_TAG_N + 1
 
#define MAXSZ_POLICY_TAGS   MAXSZ_POLICY_TAGS_ + 1
 
#define foreach_policy_state
 
#define _(x)   POLICY_STATE_ ## x,
 
#define MAXSZ_POLICY_STATE_   8
 
#define MAXSZ_POLICY_STATE   MAXSZ_POLICY_STATE_ + 1
 
#define MAXSZ_POLICY_TAG_STATE_   8
 
#define MAXSZ_POLICY_TAG_STATE   MAXSZ_POLICY_TAG_STATE_ + 1
 
#define INTERFACE_STATS_NONE
 
#define POLICY_STATS_NONE
 
#define INTERFACE_COUNTERS_NONE
 
#define POLICY_COUNTERS_NONE
 
#define APP_NAME_LEN   128
 
#define _(x, y)   [POLICY_TAG_ ## x] = { POLICY_STATE_NEUTRAL, 0 },
 
#define PFX_STRLEN   4 /* eg. /128 */
 

Typedefs

typedef int policy_tags_t
 

Enumerations

enum  policy_tag_t { POLICY_TAG_N }
 
enum  policy_state_t { foreach_policy_state }
 

Functions

int policy_tag_state_snprintf (char *s, size_t size, const policy_tag_state_t *tag_state)
 

Variables

const char * policy_tag_str []
 
const char policy_tag_short_str []
 
const char * policy_state_str []
 

Detailed Description

Policy description.

Macro Definition Documentation

◆ foreach_policy_state

#define foreach_policy_state
Value:
_(NEUTRAL) \
_(REQUIRE) \
_(PREFER) \
_(AVOID) \
_(PROHIBIT) \
_(N)

◆ foreach_policy_tag

#define foreach_policy_tag
Value:
/* Interface type */ \
_(WIRED, 'E') \
_(WIFI, 'W') \
_(CELLULAR, 'C') \
/* QoS */ \
_(BEST_EFFORT, 'b') \
_(REALTIME, 'r') \
_(MULTIPATH, 'M') \
/* Security */ \
_(TRUSTED, 'T')

◆ INTERFACE_COUNTERS_NONE

#define INTERFACE_COUNTERS_NONE
Value:
{ \
.num_packets = 0, \
.num_bytes = 0, \
.num_losses = 0, \
.latency_idle = 0, \
}

◆ INTERFACE_STATS_NONE

#define INTERFACE_STATS_NONE
Value:
{ \
.throughput = 0, \
.latency = 0, \
.loss_rate = 0, \
}

◆ POLICY_COUNTERS_NONE

#define POLICY_COUNTERS_NONE
Value:
.wired = INTERFACE_COUNTERS_NONE, \
.wifi = INTERFACE_COUNTERS_NONE, \
.cellular = INTERFACE_COUNTERS_NONE, \
.all = INTERFACE_COUNTERS_NONE, \
.last_update = 0, \
}

◆ POLICY_STATS_NONE

#define POLICY_STATS_NONE
Value:
{ \
.wired = INTERFACE_STATS_NONE, \
.wifi = INTERFACE_STATS_NONE, \
.cellular = INTERFACE_STATS_NONE, \
.all = INTERFACE_STATS_NONE, \
}
policy_counters_t
Definition: policy.h:196