linux/include/linux/atalk.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_ATALK_H__
#define __LINUX_ATALK_H__


#include <net/sock.h>
#include <uapi/linux/atalk.h>

struct atalk_route {};

/**
 *	struct atalk_iface - AppleTalk Interface
 *	@dev - Network device associated with this interface
 *	@address - Our address
 *	@status - What are we doing?
 *	@nets - Associated direct netrange
 *	@next - next element in the list of interfaces
 */
struct atalk_iface {};
	
struct atalk_sock {};

static inline struct atalk_sock *at_sk(struct sock *sk)
{}

struct ddpehdr {};

static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb)
{}

/* AppleTalk AARP headers */
struct elapaarp {} __attribute__ ((packed));

static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb)
{}

/* Not specified - how long till we drop a resolved entry */
#define AARP_EXPIRY_TIME
/* Size of hash table */
#define AARP_HASH_SIZE
/* Fast retransmission timer when resolving */
#define AARP_TICK_TIME
/* Send 10 requests then give up (2 seconds) */
#define AARP_RETRANSMIT_LIMIT
/*
 * Some value bigger than total retransmit time + a bit for last reply to
 * appear and to stop continual requests
 */
#define AARP_RESOLVE_TIME

extern struct datalink_proto *ddp_dl, *aarp_dl;
extern int aarp_proto_init(void);

/* Inter module exports */

/* Give a device find its atif control structure */
#if IS_ENABLED(CONFIG_ATALK)
static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
{}
#endif

extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev);
extern struct net_device *atrtr_get_dev(struct atalk_addr *sa);
extern int		 aarp_send_ddp(struct net_device *dev,
				       struct sk_buff *skb,
				       struct atalk_addr *sa, void *hwaddr);
extern void		 aarp_device_down(struct net_device *dev);
extern void		 aarp_probe_network(struct atalk_iface *atif);
extern int 		 aarp_proxy_probe_network(struct atalk_iface *atif,
				     struct atalk_addr *sa);
extern void		 aarp_proxy_remove(struct net_device *dev,
					   struct atalk_addr *sa);

extern void		aarp_cleanup_module(void);

extern struct hlist_head atalk_sockets;
extern rwlock_t atalk_sockets_lock;

extern struct atalk_route *atalk_routes;
extern rwlock_t atalk_routes_lock;

extern struct atalk_iface *atalk_interfaces;
extern rwlock_t atalk_interfaces_lock;

extern struct atalk_route atrtr_default;

struct aarp_iter_state {};

extern const struct seq_operations aarp_seq_ops;

extern int sysctl_aarp_expiry_time;
extern int sysctl_aarp_tick_time;
extern int sysctl_aarp_retransmit_limit;
extern int sysctl_aarp_resolve_time;

#ifdef CONFIG_SYSCTL
extern int atalk_register_sysctl(void);
extern void atalk_unregister_sysctl(void);
#else
static inline int atalk_register_sysctl(void)
{
	return 0;
}
static inline void atalk_unregister_sysctl(void)
{
}
#endif

#ifdef CONFIG_PROC_FS
extern int atalk_proc_init(void);
extern void atalk_proc_exit(void);
#else
static inline int atalk_proc_init(void)
{
	return 0;
}
static inline void atalk_proc_exit(void)
{
}
#endif /* CONFIG_PROC_FS */

#endif /* __LINUX_ATALK_H__ */