Skip to content

Commit

Permalink
[DCCP]: Introduce dccp_rx_hist_find_entry
Browse files Browse the repository at this point in the history
This adds a new function dccp_rx_hist_find_entry.

Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ian McDonald authored and David S. Miller committed Aug 27, 2006
1 parent 837d107 commit 80193ae
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions net/dccp/ccids/lib/packet_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,25 @@ struct dccp_tx_hist_entry *

EXPORT_SYMBOL_GPL(dccp_tx_hist_find_entry);

int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq,
u8 *ccval)
{
struct dccp_rx_hist_entry *packet = NULL, *entry;

list_for_each_entry(entry, list, dccphrx_node)
if (entry->dccphrx_seqno == seq) {
packet = entry;
break;
}

if (packet)
*ccval = packet->dccphrx_ccval;

return packet != NULL;
}

EXPORT_SYMBOL_GPL(dccp_rx_hist_find_entry);

void dccp_tx_hist_purge_older(struct dccp_tx_hist *hist,
struct list_head *list,
struct dccp_tx_hist_entry *packet)
Expand Down
2 changes: 2 additions & 0 deletions net/dccp/ccids/lib/packet_history.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ static inline void dccp_tx_hist_entry_delete(struct dccp_tx_hist *hist,
extern struct dccp_tx_hist_entry *
dccp_tx_hist_find_entry(const struct list_head *list,
const u64 seq);
extern int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq,
u8 *ccval);

static inline void dccp_tx_hist_add_entry(struct list_head *list,
struct dccp_tx_hist_entry *entry)
Expand Down

0 comments on commit 80193ae

Please sign in to comment.