Skip to content
Snippets Groups Projects
Commit edcaeeed authored by Mohamed Mahmoud's avatar Mohamed Mahmoud
Browse files

cleanup global variables and convert none global to static

parent b66e4d2a
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@ typedef enum tcp_flags_t {
} tcp_flags;
// Force emitting enums/structs into the ELF
const enum tcp_flags_t *unused0 __attribute__((unused));
const static enum tcp_flags_t *unused0 __attribute__((unused));
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
......@@ -77,9 +77,9 @@ typedef enum direction_t {
} direction;
// Force emitting enums/structs into the ELF
const enum direction_t *unused1 __attribute__((unused));
const static enum direction_t *unused1 __attribute__((unused));
const u8 ip4in6[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff};
const static u8 ip4in6[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff};
typedef struct flow_metrics_t {
// Flow start and end times as monotomic timestamps in nanoseconds
......@@ -111,7 +111,7 @@ typedef struct flow_metrics_t {
} flow_metrics;
// Force emitting enums/structs into the ELF
const struct flow_metrics_t *unused2 __attribute__((unused));
const static struct flow_metrics_t *unused2 __attribute__((unused));
typedef struct additional_metrics_t {
u64 start_mono_time_ts;
......@@ -143,11 +143,11 @@ typedef struct additional_metrics_t {
} additional_metrics;
// Force emitting enums/structs into the ELF
const struct additional_metrics_t *unused3 __attribute__((unused));
const struct dns_record_t *unused4 __attribute__((unused));
const struct pkt_drops_t *unused5 __attribute__((unused));
const struct translated_flow_t *unused6 __attribute__((unused));
const struct observed_intf_t *unused13 __attribute__((unused));
const static struct additional_metrics_t *unused3 __attribute__((unused));
const static struct dns_record_t *unused4 __attribute__((unused));
const static struct pkt_drops_t *unused5 __attribute__((unused));
const static struct translated_flow_t *unused6 __attribute__((unused));
const static struct observed_intf_t *unused13 __attribute__((unused));
// Attributes that uniquely identify a flow
typedef struct flow_id_t {
......@@ -166,7 +166,7 @@ typedef struct flow_id_t {
} flow_id;
// Force emitting enums/structs into the ELF
const struct flow_id_t *unused7 __attribute__((unused));
const static struct flow_id_t *unused7 __attribute__((unused));
// Flow record is a tuple containing both flow identifier and metrics. It is used to send
// a complete flow via ring buffer when only when the accounting hashmap is full.
......@@ -233,7 +233,7 @@ struct filter_key_t {
} filter_key;
// Force emitting enums/structs into the ELF
const struct filter_key_t *unused10 __attribute__((unused));
const static struct filter_key_t *unused10 __attribute__((unused));
// Enum to define filter action
typedef enum filter_action_t {
......@@ -243,7 +243,7 @@ typedef enum filter_action_t {
} filter_action;
// Force emitting enums/structs into the ELF
const enum filter_action_t *unused11 __attribute__((unused));
const static enum filter_action_t *unused11 __attribute__((unused));
// filter value used as value from LPM map lookup to filter out flows that are not interesting for the user
struct filter_value_t {
......@@ -271,6 +271,6 @@ struct filter_value_t {
} filter_value;
// Force emitting enums/structs into the ELF
const struct filter_value_t *unused12 __attribute__((unused));
const static struct filter_value_t *unused12 __attribute__((unused));
#endif /* __TYPES_H__ */
......@@ -267,22 +267,9 @@ type BpfVariableSpecs struct {
FilterKey *ebpf.VariableSpec `ebpf:"filter_key"`
FilterValue *ebpf.VariableSpec `ebpf:"filter_value"`
HasFilterSampling *ebpf.VariableSpec `ebpf:"has_filter_sampling"`
Ip4in6 *ebpf.VariableSpec `ebpf:"ip4in6"`
NetworkEventsMonitoringGroupid *ebpf.VariableSpec `ebpf:"network_events_monitoring_groupid"`
Sampling *ebpf.VariableSpec `ebpf:"sampling"`
TraceMessages *ebpf.VariableSpec `ebpf:"trace_messages"`
Unused0 *ebpf.VariableSpec `ebpf:"unused0"`
Unused1 *ebpf.VariableSpec `ebpf:"unused1"`
Unused10 *ebpf.VariableSpec `ebpf:"unused10"`
Unused11 *ebpf.VariableSpec `ebpf:"unused11"`
Unused12 *ebpf.VariableSpec `ebpf:"unused12"`
Unused13 *ebpf.VariableSpec `ebpf:"unused13"`
Unused2 *ebpf.VariableSpec `ebpf:"unused2"`
Unused3 *ebpf.VariableSpec `ebpf:"unused3"`
Unused4 *ebpf.VariableSpec `ebpf:"unused4"`
Unused5 *ebpf.VariableSpec `ebpf:"unused5"`
Unused6 *ebpf.VariableSpec `ebpf:"unused6"`
Unused7 *ebpf.VariableSpec `ebpf:"unused7"`
Unused8 *ebpf.VariableSpec `ebpf:"unused8"`
Unused9 *ebpf.VariableSpec `ebpf:"unused9"`
}
......@@ -344,22 +331,9 @@ type BpfVariables struct {
FilterKey *ebpf.Variable `ebpf:"filter_key"`
FilterValue *ebpf.Variable `ebpf:"filter_value"`
HasFilterSampling *ebpf.Variable `ebpf:"has_filter_sampling"`
Ip4in6 *ebpf.Variable `ebpf:"ip4in6"`
NetworkEventsMonitoringGroupid *ebpf.Variable `ebpf:"network_events_monitoring_groupid"`
Sampling *ebpf.Variable `ebpf:"sampling"`
TraceMessages *ebpf.Variable `ebpf:"trace_messages"`
Unused0 *ebpf.Variable `ebpf:"unused0"`
Unused1 *ebpf.Variable `ebpf:"unused1"`
Unused10 *ebpf.Variable `ebpf:"unused10"`
Unused11 *ebpf.Variable `ebpf:"unused11"`
Unused12 *ebpf.Variable `ebpf:"unused12"`
Unused13 *ebpf.Variable `ebpf:"unused13"`
Unused2 *ebpf.Variable `ebpf:"unused2"`
Unused3 *ebpf.Variable `ebpf:"unused3"`
Unused4 *ebpf.Variable `ebpf:"unused4"`
Unused5 *ebpf.Variable `ebpf:"unused5"`
Unused6 *ebpf.Variable `ebpf:"unused6"`
Unused7 *ebpf.Variable `ebpf:"unused7"`
Unused8 *ebpf.Variable `ebpf:"unused8"`
Unused9 *ebpf.Variable `ebpf:"unused9"`
}
......
No preview for this file type
......@@ -267,22 +267,9 @@ type BpfVariableSpecs struct {
FilterKey *ebpf.VariableSpec `ebpf:"filter_key"`
FilterValue *ebpf.VariableSpec `ebpf:"filter_value"`
HasFilterSampling *ebpf.VariableSpec `ebpf:"has_filter_sampling"`
Ip4in6 *ebpf.VariableSpec `ebpf:"ip4in6"`
NetworkEventsMonitoringGroupid *ebpf.VariableSpec `ebpf:"network_events_monitoring_groupid"`
Sampling *ebpf.VariableSpec `ebpf:"sampling"`
TraceMessages *ebpf.VariableSpec `ebpf:"trace_messages"`
Unused0 *ebpf.VariableSpec `ebpf:"unused0"`
Unused1 *ebpf.VariableSpec `ebpf:"unused1"`
Unused10 *ebpf.VariableSpec `ebpf:"unused10"`
Unused11 *ebpf.VariableSpec `ebpf:"unused11"`
Unused12 *ebpf.VariableSpec `ebpf:"unused12"`
Unused13 *ebpf.VariableSpec `ebpf:"unused13"`
Unused2 *ebpf.VariableSpec `ebpf:"unused2"`
Unused3 *ebpf.VariableSpec `ebpf:"unused3"`
Unused4 *ebpf.VariableSpec `ebpf:"unused4"`
Unused5 *ebpf.VariableSpec `ebpf:"unused5"`
Unused6 *ebpf.VariableSpec `ebpf:"unused6"`
Unused7 *ebpf.VariableSpec `ebpf:"unused7"`
Unused8 *ebpf.VariableSpec `ebpf:"unused8"`
Unused9 *ebpf.VariableSpec `ebpf:"unused9"`
}
......@@ -344,22 +331,9 @@ type BpfVariables struct {
FilterKey *ebpf.Variable `ebpf:"filter_key"`
FilterValue *ebpf.Variable `ebpf:"filter_value"`
HasFilterSampling *ebpf.Variable `ebpf:"has_filter_sampling"`
Ip4in6 *ebpf.Variable `ebpf:"ip4in6"`
NetworkEventsMonitoringGroupid *ebpf.Variable `ebpf:"network_events_monitoring_groupid"`
Sampling *ebpf.Variable `ebpf:"sampling"`
TraceMessages *ebpf.Variable `ebpf:"trace_messages"`
Unused0 *ebpf.Variable `ebpf:"unused0"`
Unused1 *ebpf.Variable `ebpf:"unused1"`
Unused10 *ebpf.Variable `ebpf:"unused10"`
Unused11 *ebpf.Variable `ebpf:"unused11"`
Unused12 *ebpf.Variable `ebpf:"unused12"`
Unused13 *ebpf.Variable `ebpf:"unused13"`
Unused2 *ebpf.Variable `ebpf:"unused2"`
Unused3 *ebpf.Variable `ebpf:"unused3"`
Unused4 *ebpf.Variable `ebpf:"unused4"`
Unused5 *ebpf.Variable `ebpf:"unused5"`
Unused6 *ebpf.Variable `ebpf:"unused6"`
Unused7 *ebpf.Variable `ebpf:"unused7"`
Unused8 *ebpf.Variable `ebpf:"unused8"`
Unused9 *ebpf.Variable `ebpf:"unused9"`
}
......
No preview for this file type
......@@ -267,22 +267,9 @@ type BpfVariableSpecs struct {
FilterKey *ebpf.VariableSpec `ebpf:"filter_key"`
FilterValue *ebpf.VariableSpec `ebpf:"filter_value"`
HasFilterSampling *ebpf.VariableSpec `ebpf:"has_filter_sampling"`
Ip4in6 *ebpf.VariableSpec `ebpf:"ip4in6"`
NetworkEventsMonitoringGroupid *ebpf.VariableSpec `ebpf:"network_events_monitoring_groupid"`
Sampling *ebpf.VariableSpec `ebpf:"sampling"`
TraceMessages *ebpf.VariableSpec `ebpf:"trace_messages"`
Unused0 *ebpf.VariableSpec `ebpf:"unused0"`
Unused1 *ebpf.VariableSpec `ebpf:"unused1"`
Unused10 *ebpf.VariableSpec `ebpf:"unused10"`
Unused11 *ebpf.VariableSpec `ebpf:"unused11"`
Unused12 *ebpf.VariableSpec `ebpf:"unused12"`
Unused13 *ebpf.VariableSpec `ebpf:"unused13"`
Unused2 *ebpf.VariableSpec `ebpf:"unused2"`
Unused3 *ebpf.VariableSpec `ebpf:"unused3"`
Unused4 *ebpf.VariableSpec `ebpf:"unused4"`
Unused5 *ebpf.VariableSpec `ebpf:"unused5"`
Unused6 *ebpf.VariableSpec `ebpf:"unused6"`
Unused7 *ebpf.VariableSpec `ebpf:"unused7"`
Unused8 *ebpf.VariableSpec `ebpf:"unused8"`
Unused9 *ebpf.VariableSpec `ebpf:"unused9"`
}
......@@ -344,22 +331,9 @@ type BpfVariables struct {
FilterKey *ebpf.Variable `ebpf:"filter_key"`
FilterValue *ebpf.Variable `ebpf:"filter_value"`
HasFilterSampling *ebpf.Variable `ebpf:"has_filter_sampling"`
Ip4in6 *ebpf.Variable `ebpf:"ip4in6"`
NetworkEventsMonitoringGroupid *ebpf.Variable `ebpf:"network_events_monitoring_groupid"`
Sampling *ebpf.Variable `ebpf:"sampling"`
TraceMessages *ebpf.Variable `ebpf:"trace_messages"`
Unused0 *ebpf.Variable `ebpf:"unused0"`
Unused1 *ebpf.Variable `ebpf:"unused1"`
Unused10 *ebpf.Variable `ebpf:"unused10"`
Unused11 *ebpf.Variable `ebpf:"unused11"`
Unused12 *ebpf.Variable `ebpf:"unused12"`
Unused13 *ebpf.Variable `ebpf:"unused13"`
Unused2 *ebpf.Variable `ebpf:"unused2"`
Unused3 *ebpf.Variable `ebpf:"unused3"`
Unused4 *ebpf.Variable `ebpf:"unused4"`
Unused5 *ebpf.Variable `ebpf:"unused5"`
Unused6 *ebpf.Variable `ebpf:"unused6"`
Unused7 *ebpf.Variable `ebpf:"unused7"`
Unused8 *ebpf.Variable `ebpf:"unused8"`
Unused9 *ebpf.Variable `ebpf:"unused9"`
}
......
No preview for this file type
......@@ -267,22 +267,9 @@ type BpfVariableSpecs struct {
FilterKey *ebpf.VariableSpec `ebpf:"filter_key"`
FilterValue *ebpf.VariableSpec `ebpf:"filter_value"`
HasFilterSampling *ebpf.VariableSpec `ebpf:"has_filter_sampling"`
Ip4in6 *ebpf.VariableSpec `ebpf:"ip4in6"`
NetworkEventsMonitoringGroupid *ebpf.VariableSpec `ebpf:"network_events_monitoring_groupid"`
Sampling *ebpf.VariableSpec `ebpf:"sampling"`
TraceMessages *ebpf.VariableSpec `ebpf:"trace_messages"`
Unused0 *ebpf.VariableSpec `ebpf:"unused0"`
Unused1 *ebpf.VariableSpec `ebpf:"unused1"`
Unused10 *ebpf.VariableSpec `ebpf:"unused10"`
Unused11 *ebpf.VariableSpec `ebpf:"unused11"`
Unused12 *ebpf.VariableSpec `ebpf:"unused12"`
Unused13 *ebpf.VariableSpec `ebpf:"unused13"`
Unused2 *ebpf.VariableSpec `ebpf:"unused2"`
Unused3 *ebpf.VariableSpec `ebpf:"unused3"`
Unused4 *ebpf.VariableSpec `ebpf:"unused4"`
Unused5 *ebpf.VariableSpec `ebpf:"unused5"`
Unused6 *ebpf.VariableSpec `ebpf:"unused6"`
Unused7 *ebpf.VariableSpec `ebpf:"unused7"`
Unused8 *ebpf.VariableSpec `ebpf:"unused8"`
Unused9 *ebpf.VariableSpec `ebpf:"unused9"`
}
......@@ -344,22 +331,9 @@ type BpfVariables struct {
FilterKey *ebpf.Variable `ebpf:"filter_key"`
FilterValue *ebpf.Variable `ebpf:"filter_value"`
HasFilterSampling *ebpf.Variable `ebpf:"has_filter_sampling"`
Ip4in6 *ebpf.Variable `ebpf:"ip4in6"`
NetworkEventsMonitoringGroupid *ebpf.Variable `ebpf:"network_events_monitoring_groupid"`
Sampling *ebpf.Variable `ebpf:"sampling"`
TraceMessages *ebpf.Variable `ebpf:"trace_messages"`
Unused0 *ebpf.Variable `ebpf:"unused0"`
Unused1 *ebpf.Variable `ebpf:"unused1"`
Unused10 *ebpf.Variable `ebpf:"unused10"`
Unused11 *ebpf.Variable `ebpf:"unused11"`
Unused12 *ebpf.Variable `ebpf:"unused12"`
Unused13 *ebpf.Variable `ebpf:"unused13"`
Unused2 *ebpf.Variable `ebpf:"unused2"`
Unused3 *ebpf.Variable `ebpf:"unused3"`
Unused4 *ebpf.Variable `ebpf:"unused4"`
Unused5 *ebpf.Variable `ebpf:"unused5"`
Unused6 *ebpf.Variable `ebpf:"unused6"`
Unused7 *ebpf.Variable `ebpf:"unused7"`
Unused8 *ebpf.Variable `ebpf:"unused8"`
Unused9 *ebpf.Variable `ebpf:"unused9"`
}
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment