freebsd_network: Add new APIs used by FreeBSD 13 drivers.
This commit is contained in:
@@ -821,6 +821,16 @@ int if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max);
|
||||
int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max);
|
||||
int if_multiaddr_count(if_t ifp, int max);
|
||||
|
||||
/*
|
||||
* Traversing through interface address lists.
|
||||
*/
|
||||
struct sockaddr_dl;
|
||||
typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int);
|
||||
u_int if_foreach_lladdr(if_t, iflladdr_cb_t, void *);
|
||||
u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *);
|
||||
u_int if_lladdr_count(if_t);
|
||||
u_int if_llmaddr_count(if_t);
|
||||
|
||||
/* Functions */
|
||||
void if_setinitfn(if_t ifp, void (*)(void *));
|
||||
void if_setioctlfn(if_t ifp, int (*)(if_t, u_long, caddr_t));
|
||||
|
||||
@@ -55,6 +55,7 @@ struct taskqueue *taskqueue_create_fast(const char *name, int mflags,
|
||||
|
||||
void task_init(struct task *, int prio, task_fn_t handler, void *arg);
|
||||
#define TASK_INIT(taskp, prio, hand, arg) task_init(taskp, prio, hand, arg)
|
||||
#define NET_TASK_INIT TASK_INIT
|
||||
|
||||
void timeout_task_init(struct taskqueue *queue, struct timeout_task *timeout_task,
|
||||
int priority, task_fn_t func, void *context);
|
||||
|
||||
@@ -1262,6 +1262,38 @@ if_multiaddr_count(if_t ifp, int max)
|
||||
return (count);
|
||||
}
|
||||
|
||||
u_int
|
||||
if_llmaddr_count(if_t ifp)
|
||||
{
|
||||
struct ifmultiaddr *ifma;
|
||||
int count;
|
||||
|
||||
count = 0;
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family == AF_LINK)
|
||||
count++;
|
||||
}
|
||||
|
||||
return (count);
|
||||
}
|
||||
|
||||
u_int
|
||||
if_foreach_llmaddr(if_t ifp, iflladdr_cb_t cb, void *cb_arg)
|
||||
{
|
||||
struct ifmultiaddr *ifma;
|
||||
u_int count;
|
||||
|
||||
count = 0;
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
count += (*cb)(cb_arg, (struct sockaddr_dl *)ifma->ifma_addr,
|
||||
count);
|
||||
}
|
||||
|
||||
return (count);
|
||||
}
|
||||
|
||||
struct mbuf *
|
||||
if_dequeue(if_t ifp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user