stats->n_packets = flow->packet_count;
stats->n_bytes = flow->byte_count;
- stats->ip_tos = flow->ip_tos;
+ stats->reserved = 0;
stats->tcp_flags = flow->tcp_flags;
stats->error = 0;
}
{
flow->used = 0;
flow->tcp_flags = 0;
- flow->ip_tos = 0;
flow->packet_count = 0;
flow->byte_count = 0;
}
{
u8 tcp_flags = 0;
- if (flow->key.dl_type == htons(ETH_P_IP) && iphdr_ok(skb)) {
- struct iphdr *nh = ip_hdr(skb);
- flow->ip_tos = nh->tos;
- if (flow->key.nw_proto == IPPROTO_TCP && tcphdr_ok(skb)) {
- u8 *tcp = (u8 *)tcp_hdr(skb);
- tcp_flags = *(tcp + TCP_FLAGS_OFFSET) & TCP_FLAG_MASK;
- }
+ if (flow->key.dl_type == htons(ETH_P_IP) &&
+ flow->key.nw_proto == IPPROTO_TCP) {
+ u8 *tcp = (u8 *)tcp_hdr(skb);
+ tcp_flags = *(tcp + TCP_FLAGS_OFFSET) & TCP_FLAG_MASK;
}
spin_lock_bh(&flow->lock);
struct odp_flow_key key;
struct sw_flow_actions *sf_acts;
- u8 ip_tos; /* IP TOS value. */
-
spinlock_t lock; /* Lock for values below. */
unsigned long used; /* Last used time (in jiffies). */
u64 packet_count; /* Number of packets matched. */
uint64_t used_sec; /* Time last used, in system monotonic time. */
uint32_t used_nsec;
uint8_t tcp_flags;
- uint8_t ip_tos;
+ uint8_t reserved;
uint16_t error; /* Used by ODP_FLOW_GET. */
};
struct timespec used; /* Last used time. */
long long int packet_count; /* Number of packets matched. */
long long int byte_count; /* Number of bytes matched. */
- uint8_t ip_tos; /* IP TOS value. */
uint16_t tcp_ctl; /* Bitwise-OR of seen tcp_ctl values. */
/* Actions. */
odp_flow->stats.used_sec = flow->used.tv_sec;
odp_flow->stats.used_nsec = flow->used.tv_nsec;
odp_flow->stats.tcp_flags = TCP_FLAGS(flow->tcp_ctl);
- odp_flow->stats.ip_tos = flow->ip_tos;
+ odp_flow->stats.reserved = 0;
odp_flow->stats.error = 0;
if (odp_flow->n_actions > 0) {
unsigned int n = MIN(odp_flow->n_actions, flow->n_actions);
flow->used.tv_nsec = 0;
flow->packet_count = 0;
flow->byte_count = 0;
- flow->ip_tos = 0;
flow->tcp_ctl = 0;
}
time_timespec(&flow->used);
flow->packet_count++;
flow->byte_count += packet->size;
- if (key->dl_type == htons(ETH_TYPE_IP)) {
- struct ip_header *nh = packet->l3;
- flow->ip_tos = nh->ip_tos;
-
- if (key->nw_proto == IPPROTO_TCP) {
- struct tcp_header *th = packet->l4;
- flow->tcp_ctl |= th->tcp_ctl;
- }
+ if (key->dl_type == htons(ETH_TYPE_IP) && key->nw_proto == IPPROTO_TCP) {
+ struct tcp_header *th = packet->l4;
+ flow->tcp_ctl |= th->tcp_ctl;
}
}
memset(stats, '\0', sizeof(*stats));
if ((flow->dl_type == htons(ETH_TYPE_IP)) && packet->l4) {
- struct ip_header *ip = packet->l3;
- stats->ip_tos = ip->ip_tos;
if ((flow->nw_proto == IP_TYPE_TCP) && packet->l7) {
struct tcp_header *tcp = packet->l4;
stats->tcp_flags = TCP_FLAGS(tcp->tcp_ctl);
}
nf_rec->tcp_flags = nf_flow->tcp_flags;
nf_rec->ip_proto = expired->flow.nw_proto;
- nf_rec->ip_tos = nf_flow->ip_tos;
+ nf_rec->ip_tos = expired->flow.nw_tos;
/* Update flow tracking data. */
nf_flow->created = 0;
}
void
-netflow_flow_update_flags(struct netflow_flow *nf_flow, uint8_t ip_tos,
- uint8_t tcp_flags)
+netflow_flow_update_flags(struct netflow_flow *nf_flow, uint8_t tcp_flags)
{
- nf_flow->ip_tos = ip_tos;
nf_flow->tcp_flags |= tcp_flags;
}
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. */
};
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);
+void netflow_flow_update_flags(struct netflow_flow *, uint8_t tcp_flags);
bool netflow_active_timeout_expired(struct netflow *, struct netflow_flow *);
#endif /* netflow.h */
update_time(ofproto, rule, stats);
rule->packet_count += stats->n_packets;
rule->byte_count += stats->n_bytes;
- netflow_flow_update_flags(&rule->nf_flow, stats->ip_tos,
- stats->tcp_flags);
+ netflow_flow_update_flags(&rule->nf_flow, stats->tcp_flags);
}
}
if (odp_flow.stats.n_packets) {
update_time(ofproto, rule, &odp_flow.stats);
- netflow_flow_update_flags(&rule->nf_flow, odp_flow.stats.ip_tos,
+ netflow_flow_update_flags(&rule->nf_flow,
odp_flow.stats.tcp_flags);
}
}