#include <linux/in.h>
#include <linux/inetdevice.h>
#include <linux/if_ether.h>
#include <linux/sched/signal.h>
#include <linux/utsname.h>
#include <linux/ctype.h>
#include <net/addrconf.h>
#include <net/sock.h>
#include <net/tcp.h>
#include "smc.h"
#include "smc_core.h"
#include "smc_clc.h"
#include "smc_ib.h"
#include "smc_ism.h"
#include "smc_netlink.h"
#define SMCR_CLC_ACCEPT_CONFIRM_LEN …
#define SMCD_CLC_ACCEPT_CONFIRM_LEN …
#define SMCD_CLC_ACCEPT_CONFIRM_LEN_V2 …
#define SMCR_CLC_ACCEPT_CONFIRM_LEN_V2 …
#define SMC_CLC_RECV_BUF_LEN …
static const char SMC_EYECATCHER[4] = …;
static const char SMCD_EYECATCHER[4] = …;
static u8 smc_hostname[SMC_MAX_HOSTNAME_LEN];
struct smc_clc_eid_table { … };
static struct smc_clc_eid_table smc_clc_eid_table;
struct smc_clc_eid_entry { … };
static bool smc_clc_ueid_valid(char *ueid)
{ … }
static int smc_clc_ueid_add(char *ueid)
{ … }
int smc_clc_ueid_count(void)
{ … }
int smc_nl_add_ueid(struct sk_buff *skb, struct genl_info *info)
{ … }
static int smc_clc_ueid_remove(char *ueid)
{ … }
int smc_nl_remove_ueid(struct sk_buff *skb, struct genl_info *info)
{ … }
int smc_nl_flush_ueid(struct sk_buff *skb, struct genl_info *info)
{ … }
static int smc_nl_ueid_dumpinfo(struct sk_buff *skb, u32 portid, u32 seq,
u32 flags, char *ueid)
{ … }
static int _smc_nl_ueid_dump(struct sk_buff *skb, u32 portid, u32 seq,
int start_idx)
{ … }
int smc_nl_dump_ueid(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
int smc_nl_dump_seid(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
int smc_nl_enable_seid(struct sk_buff *skb, struct genl_info *info)
{ … }
int smc_nl_disable_seid(struct sk_buff *skb, struct genl_info *info)
{ … }
static bool _smc_clc_match_ueid(u8 *peer_ueid)
{ … }
bool smc_clc_match_eid(u8 *negotiated_eid,
struct smc_clc_v2_extension *smc_v2_ext,
u8 *peer_eid, u8 *local_eid)
{ … }
static bool smc_clc_msg_prop_valid(struct smc_clc_msg_proposal *pclc)
{ … }
static bool
smc_clc_msg_acc_conf_valid(struct smc_clc_msg_accept_confirm *clc)
{ … }
static bool
smc_clc_msg_decl_valid(struct smc_clc_msg_decline *dclc)
{ … }
static int smc_clc_fill_fce_v2x(struct smc_clc_first_contact_ext_v2x *fce_v2x,
struct smc_init_info *ini)
{ … }
static bool smc_clc_msg_hdr_valid(struct smc_clc_msg_hdr *clcm, bool check_trl)
{ … }
static int smc_clc_prfx_set4_rcu(struct dst_entry *dst, __be32 ipv4,
struct smc_clc_msg_proposal_prefix *prop)
{ … }
static int smc_clc_prfx_set6_rcu(struct dst_entry *dst,
struct smc_clc_msg_proposal_prefix *prop,
struct smc_clc_ipv6_prefix *ipv6_prfx)
{ … }
static int smc_clc_prfx_set(struct socket *clcsock,
struct smc_clc_msg_proposal_prefix *prop,
struct smc_clc_ipv6_prefix *ipv6_prfx)
{ … }
static int smc_clc_prfx_match4_rcu(struct net_device *dev,
struct smc_clc_msg_proposal_prefix *prop)
{ … }
static int smc_clc_prfx_match6_rcu(struct net_device *dev,
struct smc_clc_msg_proposal_prefix *prop)
{ … }
int smc_clc_prfx_match(struct socket *clcsock,
struct smc_clc_msg_proposal_prefix *prop)
{ … }
int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
u8 expected_type, unsigned long timeout)
{ … }
int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info, u8 version)
{ … }
int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini)
{ … }
static void
smcd_clc_prep_confirm_accept(struct smc_connection *conn,
struct smc_clc_msg_accept_confirm *clc,
int first_contact, u8 version,
u8 *eid, struct smc_init_info *ini,
int *fce_len,
struct smc_clc_first_contact_ext_v2x *fce_v2x,
struct smc_clc_msg_trail *trl)
{ … }
static void
smcr_clc_prep_confirm_accept(struct smc_connection *conn,
struct smc_clc_msg_accept_confirm *clc,
int first_contact, u8 version,
u8 *eid, struct smc_init_info *ini,
int *fce_len,
struct smc_clc_first_contact_ext_v2x *fce_v2x,
struct smc_clc_fce_gid_ext *gle,
struct smc_clc_msg_trail *trl)
{ … }
static int smc_clc_send_confirm_accept(struct smc_sock *smc,
struct smc_clc_msg_accept_confirm *clc,
int first_contact, u8 version,
u8 *eid, struct smc_init_info *ini)
{ … }
int smc_clc_send_confirm(struct smc_sock *smc, bool clnt_first_contact,
u8 version, u8 *eid, struct smc_init_info *ini)
{ … }
int smc_clc_send_accept(struct smc_sock *new_smc, bool srv_first_contact,
u8 version, u8 *negotiated_eid, struct smc_init_info *ini)
{ … }
int smc_clc_srv_v2x_features_validate(struct smc_sock *smc,
struct smc_clc_msg_proposal *pclc,
struct smc_init_info *ini)
{ … }
int smc_clc_clnt_v2x_features_validate(struct smc_clc_first_contact_ext *fce,
struct smc_init_info *ini)
{ … }
int smc_clc_v2x_features_confirm_check(struct smc_clc_msg_accept_confirm *cclc,
struct smc_init_info *ini)
{ … }
void smc_clc_get_hostname(u8 **host)
{ … }
void __init smc_clc_init(void)
{ … }
void smc_clc_exit(void)
{ … }