Skip to content

Commit

Permalink
Merge pull request #34 from isaac129/deliver
Browse files Browse the repository at this point in the history
Add a function to push flow state to open
  • Loading branch information
carlatat authored Feb 18, 2018
2 parents acf1af9 + 74dad30 commit 3d24ad2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ginetflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,3 +1059,11 @@ GInetFlow *g_inet_flow_lookup(GInetFlowTable * table, GInetTuple * tuple)
packet.hash = 0;
return (GInetFlow *) g_hash_table_lookup(table->table, &packet);
}

void g_inet_flow_establish(GInetFlowTable * table, GInetFlow * flow)
{
remove_flow_by_expiry(table, flow, flow->lifetime);
flow->state = FLOW_OPEN;
flow->lifetime = G_INET_FLOW_DEFAULT_OPEN_TIMEOUT;
insert_flow_by_expiry(table, flow, flow->lifetime);
}
1 change: 1 addition & 0 deletions ginetflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ GInetFlow *g_inet_flow_get_full(GInetFlowTable * table, const guint8 * frame,
const uint8_t ** iphr);
GInetFlow *g_inet_flow_create(GInetFlowTable * table, GInetTuple * tuple);
GInetFlow *g_inet_flow_expire(GInetFlowTable * table, guint64 ts);
void g_inet_flow_establish(GInetFlowTable * table, GInetFlow * flow);

/* g_inet_flow_parse will populate result if result is not null, otherwise it will malloc a structure
* to return. */
Expand Down

0 comments on commit 3d24ad2

Please sign in to comment.