X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=secchan%2Fnetflow.h;h=cc7b96057071705c65f170edcd756e3f32b47256;hb=0193b2afceb14b2daccc5d91395903f88606253c;hp=a5ad3360e9b671d4c09328fb0dcf655cd19a870b;hpb=6a07af3678afc64e39a330fc07362a940ef1ecce;p=openvswitch diff --git a/secchan/netflow.h b/secchan/netflow.h index a5ad3360..cc7b9605 100644 --- a/secchan/netflow.h +++ b/secchan/netflow.h @@ -18,9 +18,17 @@ #define NETFLOW_H 1 #include "flow.h" +#include "svec.h" struct ofexpired; -struct svec; + +struct netflow_options { + struct svec collectors; + uint8_t engine_type; + uint8_t engine_id; + int active_timeout; + bool add_id_to_iface; +}; enum netflow_output_ports { NF_OUT_FLOOD = UINT16_MAX, @@ -28,12 +36,30 @@ enum netflow_output_ports { NF_OUT_DROP = UINT16_MAX - 2 }; +struct netflow_flow { + long long int last_expired; /* Time this flow last timed out. */ + long long int created; /* Time flow was created since time out. */ + + uint64_t packet_count_off; /* Packet count at last time out. */ + uint64_t byte_count_off; /* Byte count at last time out. */ + + uint16_t output_iface; /* Output interface index. */ + uint8_t ip_tos; /* Last-seen IP type-of-service. */ + uint8_t tcp_flags; /* Bitwise-OR of all TCP flags seen. */ +}; + struct netflow *netflow_create(void); void netflow_destroy(struct netflow *); -int netflow_set_collectors(struct netflow *, const struct svec *collectors); -void netflow_set_engine(struct netflow *nf, uint8_t engine_type, - uint8_t engine_id, bool add_id_to_iface); -void netflow_expire(struct netflow *, const struct ofexpired *); +int netflow_set_options(struct netflow *, const struct netflow_options *); +void netflow_expire(struct netflow *, struct netflow_flow *, + struct ofexpired *); void netflow_run(struct netflow *); +void netflow_flow_clear(struct netflow_flow *); +void netflow_flow_update_time(struct netflow *, struct netflow_flow *, + long long int used); +void netflow_flow_update_flags(struct netflow_flow *, uint8_t ip_tos, + uint8_t tcp_flags); +bool netflow_active_timeout_expired(struct netflow *, struct netflow_flow *); + #endif /* netflow.h */