/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Witness Service client for CIFS
 *
 * Copyright (c) 2020 Samuel Cabrero <scabrero@suse.de>
 */

#ifndef _CIFS_SWN_H
#define _CIFS_SWN_H
#include "cifsglob.h"

struct cifs_tcon;
struct sk_buff;
struct genl_info;

#ifdef CONFIG_CIFS_SWN_UPCALL
extern int cifs_swn_register(struct cifs_tcon *tcon);

extern int cifs_swn_unregister(struct cifs_tcon *tcon);

extern int cifs_swn_notify(struct sk_buff *skb, struct genl_info *info);

extern void cifs_swn_dump(struct seq_file *m);

extern void cifs_swn_check(void);

static inline bool cifs_swn_set_server_dstaddr(struct TCP_Server_Info *server)
{
	if (server->use_swn_dstaddr) {
		server->dstaddr = server->swn_dstaddr;
		return true;
	}
	return false;
}

static inline void cifs_swn_reset_server_dstaddr(struct TCP_Server_Info *server)
{
	server->use_swn_dstaddr = false;
}

#else

static inline int cifs_swn_register(struct cifs_tcon *tcon) { return 0; }
static inline int cifs_swn_unregister(struct cifs_tcon *tcon) { return 0; }
static inline int cifs_swn_notify(struct sk_buff *s, struct genl_info *i) { return 0; }
static inline void cifs_swn_dump(struct seq_file *m) {}
static inline void cifs_swn_check(void) {}
static inline bool cifs_swn_set_server_dstaddr(struct TCP_Server_Info *server) { return false; }
static inline void cifs_swn_reset_server_dstaddr(struct TCP_Server_Info *server) {}

#endif /* CONFIG_CIFS_SWN_UPCALL */
#endif /* _CIFS_SWN_H */
ss='active' href='/cgit/git.armlinux.org.uk/linux-net-next.git/log/net/ipv4/igmp.c'>log</a><a href='/cgit/git.armlinux.org.uk/linux-net-next.git/tree/net/ipv4/igmp.c?id=56be393fa8b40db2d4f54f97614f645eb8d3c32e'>tree</a><a href='/cgit/git.armlinux.org.uk/linux-net-next.git/commit/net/ipv4/igmp.c?id=56be393fa8b40db2d4f54f97614f645eb8d3c32e'>commit</a><a href='/cgit/git.armlinux.org.uk/linux-net-next.git/diff/net/ipv4/igmp.c?id=56be393fa8b40db2d4f54f97614f645eb8d3c32e'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit/git.armlinux.org.uk/linux-net-next.git/log/net/ipv4/igmp.c'>
<input type='hidden' name='id' value='56be393fa8b40db2d4f54f97614f645eb8d3c32e'/><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/git.armlinux.org.uk/linux-net-next.git/log/?id=56be393fa8b40db2d4f54f97614f645eb8d3c32e'>root</a>/<a href='/cgit/git.armlinux.org.uk/linux-net-next.git/log/net?id=56be393fa8b40db2d4f54f97614f645eb8d3c32e'>net</a>/<a href='/cgit/git.armlinux.org.uk/linux-net-next.git/log/net/ipv4?id=56be393fa8b40db2d4f54f97614f645eb8d3c32e'>ipv4</a>/<a href='/cgit/git.armlinux.org.uk/linux-net-next.git/log/net/ipv4/igmp.c?id=56be393fa8b40db2d4f54f97614f645eb8d3c32e'>igmp.c</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/git.armlinux.org.uk/linux-net-next.git/log/net/ipv4/igmp.c?id=56be393fa8b40db2d4f54f97614f645eb8d3c32e&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th></tr>