46 #define NEIGHBOUR_MIN_TIMEOUT ( TICKS_PER_SEC / 8 ) 49 #define NEIGHBOUR_MAX_TIMEOUT ( TICKS_PER_SEC * 3 ) 173 const void *ll_dest ) {
203 "transmit deferred packet: %s\n",
277 net_source ) ) != 0 ) {
278 DBGC (
neighbour,
"NEIGHBOUR %s %s %s could not transmit %s " 302 const void *net_source,
const void *ll_source ) {
struct arbelprm_rc_send_wqe rc
const char * name
Protocol name.
#define NEIGHBOUR_MIN_TIMEOUT
Neighbour discovery minimum timeout.
static struct neighbour * neighbour_find(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest)
Find neighbour cache entry.
static void start_timer_nodelay(struct retry_timer *timer)
Start timer with no delay.
uint8_t ll_addr_len
Link-layer address length.
struct cache_discarder neighbour_discarder __cache_discarder(CACHE_EXPENSIVE)
Neighbour cache discarder.
static struct neighbour * neighbour_create(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest)
Create neighbour cache entry.
uint8_t net_dest[MAX_NET_ADDR_LEN]
Network-layer destination address.
#define list_add(new, head)
Add a new entry to the head of a list.
void netdev_tx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard transmitted packet.
#define ref_init(refcnt, free)
Initialise a reference counter.
struct net_protocol * net_protocol
Network-layer protocol.
struct list_head neighbours
The neighbour cache.
struct retry_timer timer
Retransmission timer.
A neighbour discovery protocol.
#define ENOENT
No such file or directory.
int neighbour_update(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *ll_dest)
Update existing neighbour cache entry.
#define list_last_entry(list, type, member)
Get the container of the last entry in a list.
A network upper-layer driver.
A doubly-linked list entry (or list head)
Dynamic memory allocation.
struct refcnt refcnt
Reference count.
struct list_head list
List of neighbour cache entries.
#define list_empty(list)
Test whether a list is empty.
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
const char * name
Protocol name.
#define list_del(list)
Delete an entry from a list.
int(* tx_request)(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *net_source)
Transmit neighbour discovery request.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static int netdev_is_open(struct net_device *netdev)
Check whether or not network device is open.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define container_of(ptr, type, field)
Get containing structure.
#define CACHE_EXPENSIVE
Items with a high replacement cost.
unsigned int(* discard)(void)
Discard some cached data.
struct neighbour_discovery * discovery
Neighbour discovery protocol (if any)
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define __unused
Declare a variable or data structure as unused.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
const char *(* ntoa)(const void *net_addr)
Transcribe network-layer address.
int neighbour_define(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *ll_dest)
Define neighbour cache entry.
static struct net_device * netdev
struct net_driver neighbour_net_driver __net_driver
Neighbour driver (for net device notifications)
struct list_head tx_queue
Pending I/O buffers.
static unsigned int neighbour_discard(void)
Discard some cached neighbour entries.
uint8_t ll_dest[MAX_LL_ADDR_LEN]
Link-layer destination address.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
void * zalloc(size_t size)
Allocate cleared memory.
#define ref_get(refcnt)
Get additional reference to object.
#define ENODEV
No such device.
static void neighbour_discovered(struct neighbour *neighbour, const void *ll_dest)
Complete neighbour discovery.
static struct net_device * netdev_get(struct net_device *netdev)
Get reference to network device.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void start_timer(struct retry_timer *timer)
Start timer.
A network-layer protocol.
static void neighbour_flush(struct net_device *netdev, void *priv __unused)
Update neighbour cache on network device state change or removal.
int neighbour_tx(struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, struct neighbour_discovery *discovery, const void *net_source, const void *ll_source)
Transmit packet, determining link-layer address via neighbour discovery.
#define INIT_LIST_HEAD(list)
Initialise a list head.
void stop_timer(struct retry_timer *timer)
Stop timer.
char name[NETDEV_NAME_LEN]
Name of this network device.
struct list_head list
List of which this buffer is a member.
int net_tx(struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *ll_dest, const void *ll_source)
Transmit network-layer packet.
#define NEIGHBOUR_MAX_TIMEOUT
Neighbour discovery maximum timeout.
#define ENOBUFS
No buffer space available.
static struct tlan_private * priv
uint8_t net_addr_len
Network-layer address length.
static void neighbour_expired(struct retry_timer *timer, int over)
Handle neighbour timer expiry.
struct net_device * netdev
Network device.
const char *(* ntoa)(const void *ll_addr)
Transcribe link-layer address.
static void neighbour_destroy(struct neighbour *neighbour, int rc)
Destroy neighbour cache entry.
static void neighbour_free(struct refcnt *refcnt)
Free neighbour cache entry.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
#define LIST_HEAD_INIT(list)
Initialise a static list head.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
#define ETIMEDOUT
Connection timed out.
uint8_t net_source[MAX_NET_ADDR_LEN]
Network-layer source address (if any)
struct ll_protocol * ll_protocol
Link-layer protocol.
#define ref_put(refcnt)
Drop reference to object.
static int neighbour_has_ll_dest(struct neighbour *neighbour)
Test if neighbour cache entry has a valid link-layer address.
static void neighbour_discover(struct neighbour *neighbour, struct neighbour_discovery *discovery, const void *net_source)
Start neighbour discovery.