#ifndef __NET_PSAMPLE_H
#define __NET_PSAMPLE_H

#include <uapi/linux/psample.h>
#include <linux/module.h>
#include <linux/list.h>

struct psample_group {
	struct list_head list;
	struct net *net;
	u32 group_num;
	u32 refcount;
	u32 seq;
};

struct psample_group *psample_group_get(struct net *net, u32 group_num);
void psample_group_put(struct psample_group *group);

#if IS_ENABLED(CONFIG_PSAMPLE)

void psample_sample_packet(struct psample_group *group, struct sk_buff *skb,
			   u32 trunc_size, int in_ifindex, int out_ifindex,
			   u32 sample_rate);

#else

static inline void psample_sample_packet(struct psample_group *group,
					 struct sk_buff *skb, u32 trunc_size,
					 int in_ifindex, int out_ifindex,
					 u32 sample_rate)
{
}

#endif

#endif /* __NET_PSAMPLE_H */
href='/cgit.cgi/'>index</a> : <a href='/cgit.cgi/linux/net-next.git/'>net-next.git</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='79112c26f14c38ddbac3b2739469e373ef424fe6'/><select name='h' onchange='this.form.submit();'>
<option value='emaclite-cleanup'>emaclite-cleanup</option>
<option value='master'>master</option>
<option value='nds-private-remove' selected='selected'>nds-private-remove</option>
<option value='packet-loop-back'>packet-loop-back</option>
<option value='packet-rx-pump-back'>packet-rx-pump-back</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/?h=nds-private-remove'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/include/math-emu/op-common.h?h=nds-private-remove'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/include/math-emu/op-common.h?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/include/math-emu/op-common.h?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/include/math-emu/op-common.h?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/include/math-emu/op-common.h'>
<input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='79112c26f14c38ddbac3b2739469e373ef424fe6'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/include?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6'>include</a>/<a href='/cgit.cgi/linux/net-next.git/log/include/math-emu?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6'>math-emu</a>/<a href='/cgit.cgi/linux/net-next.git/log/include/math-emu/op-common.h?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6'>op-common.h</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/include/math-emu/op-common.h?h=nds-private-remove&amp;id=79112c26f14c38ddbac3b2739469e373ef424fe6&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>