From nobody Thu Jan 12 16:20:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nt8tH6c96z2p31q; Thu, 12 Jan 2023 16:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nt8tH6S8pz3qYh; Thu, 12 Jan 2023 16:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673540455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GSMYZRYZZdF2ch6GjxXpucYqJTtcKwTe6cTS3Wwf5og=; b=v9B4eNpDfyty/cLZhnzw4ZkzpzSZz4rjl1OKd8TyNXbjE1hJVIkr1kpUAP8WmdAw4/NoeD InSawV8U4radZM4U1n1yqF5sHBamPNlJsC+UfK3nYycHgrUNsegkTFLYauICw9177aGrOm lFgCdjD4gtepNDX+rmYcq8e51+X2WpazNVl8xWdTcg0XcIuIYQTOkDXse40DuLQ8xzUBnQ MyreetA0t7XW0ZIZroVhOmqU051M3Fj1TMRCRoAyn3AuBpYTnyGI8KAqYi3GnNY4KDcdQl eWxmgWb78pNUIdK7FoeF+oGAfbxmiLECJDGfMVAuWbdyipEcIPT9RUWfYoaTwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673540455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GSMYZRYZZdF2ch6GjxXpucYqJTtcKwTe6cTS3Wwf5og=; b=SSVd4zz69F19EtSOZQXPXshKmP5qJ6F71n0Ho2zZV7CFxdmlKNk7wxfkCJhzUn8D1QQ55u cAdyxYG8ZQvf9wMEWA15MkK6YdgGhDf2PLvya1HL1LY73fTAsjva/CrZdXwoiXaXTjCozI HgoEmb5HKu3AScuMWBU8UAU4F22tcNyNdx93cqGcHxTnyR0ncpTFm47EqIkS+uOo+nJCYm j+BWQcL/5s3kHi/mB7fSokiiTBvhkVgCBO0ziF/RioaYORbFgGwooEX/Qh9O7WffPiI+R/ PObovlarLPryyUhj4sBQ4qcJ6a+b2f25w1UnkwjwIqExePQgohxkulKkSeh/Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673540455; a=rsa-sha256; cv=none; b=R07l/KCg7PxKZWZgXwW+Znj0dm4LkI3l2ReTwN16DxIBX+z65wTmNFkKS14JKfQOzjPUv7 HfrLkJU+vLE0uoo8MfnV/3xzbj0e7+0k/g1U2x7QkdoM9PJU9wW9Np5chGO9vjfo2bg9Ux Y98vQfftCaA8hcnsfGYjGb5oTWrJuqUMuJjaqAUXw9KPoPhnvXgGDkacTOpS35fqLJFOCX LRD6EVh2Ll9tTQd1Hu2DSyQg+a0mkbUOkNqfVVbjJ7DuWBv073u4kHHWbOxnT9Ak6o7Xau KoKmMciw+HRri+24Fv8C5Vci2IOO0ffwtzm8pLHmSgD3VHm27adtHJJZsG1ASw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nt8tH5XFBzYys; Thu, 12 Jan 2023 16:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30CGKtYU047284; Thu, 12 Jan 2023 16:20:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30CGKtpM047283; Thu, 12 Jan 2023 16:20:55 GMT (envelope-from git) Date: Thu, 12 Jan 2023 16:20:55 GMT Message-Id: <202301121620.30CGKtpM047283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: fe33e0ab83d1 - main - ifnet/API: Move the IfAPI from if_var.h to if.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe33e0ab83d1fbc3c5cd4a2591ba0036e47b1fec Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=fe33e0ab83d1fbc3c5cd4a2591ba0036e47b1fec commit fe33e0ab83d1fbc3c5cd4a2591ba0036e47b1fec Author: Justin Hibbits AuthorDate: 2023-01-11 16:56:39 +0000 Commit: Justin Hibbits CommitDate: 2023-01-12 16:25:41 +0000 ifnet/API: Move the IfAPI from if_var.h to if.h Summary: The "public" KPI for ifnet belongs in net/if.h, with net/if_var.h being implementation details for the netstack. This is the next step in enforcing that separation. Reviewed by: melifaro Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38030 --- sys/net/if.h | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ sys/net/if_var.h | 145 -------------------------------------------------- 2 files changed, 157 insertions(+), 145 deletions(-) diff --git a/sys/net/if.h b/sys/net/if.h index 888e7d5d7320..b46cc0fa4747 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -657,12 +657,169 @@ struct ifdownreason { typedef struct ifnet * if_t; +union if_snd_tag_alloc_params; +union if_snd_tag_query_params; +union if_snd_tag_modify_params; + +typedef enum { + IFCOUNTER_IPACKETS = 0, + IFCOUNTER_IERRORS, + IFCOUNTER_OPACKETS, + IFCOUNTER_OERRORS, + IFCOUNTER_COLLISIONS, + IFCOUNTER_IBYTES, + IFCOUNTER_OBYTES, + IFCOUNTER_IMCASTS, + IFCOUNTER_OMCASTS, + IFCOUNTER_IQDROPS, + IFCOUNTER_OQDROPS, + IFCOUNTER_NOPROTO, + IFCOUNTERS /* Array size. */ +} ift_counter; + + +struct mbuf; +struct route; +struct m_snd_tag; + +typedef void (*if_start_fn_t)(if_t); +typedef int (*if_ioctl_fn_t)(if_t, u_long, caddr_t); +typedef void (*if_init_fn_t)(void *); +typedef void (*if_input_fn_t)(if_t, struct mbuf *); +typedef int (*if_output_fn_t) + (if_t, struct mbuf *, const struct sockaddr *, struct route *); +typedef void (*if_qflush_fn_t)(if_t); +typedef int (*if_transmit_fn_t)(if_t, struct mbuf *); +typedef uint64_t (*if_get_counter_t)(if_t, ift_counter); + +typedef int (if_snd_tag_alloc_t)(if_t, union if_snd_tag_alloc_params *, + struct m_snd_tag **); +typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); +typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); +typedef void (if_snd_tag_free_t)(struct m_snd_tag *); +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); + #ifdef _KERNEL + #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_IFADDR); MALLOC_DECLARE(M_IFMADDR); #endif +struct ifnet* if_alloc(u_char); +struct ifnet* if_alloc_dev(u_char, device_t dev); +void if_attach(if_t); +void if_free(if_t); +void if_initname(if_t, const char *, int); +void if_down(if_t); +void if_link_state_change(if_t, int); +int if_printf(if_t, const char *, ...) __printflike(2, 3); + +uint64_t if_get_counter_default(if_t, ift_counter); +void if_inc_counter(if_t, ift_counter, int64_t); + +uint64_t if_setbaudrate(if_t ifp, uint64_t baudrate); +uint64_t if_getbaudrate(const if_t ifp); +int if_setcapabilities(if_t ifp, int capabilities); +int if_setcapabilitiesbit(if_t ifp, int setbit, int clearbit); +int if_getcapabilities(const if_t ifp); +int if_togglecapenable(if_t ifp, int togglecap); +int if_setcapenable(if_t ifp, int capenable); +int if_setcapenablebit(if_t ifp, int setcap, int clearcap); +int if_getcapenable(const if_t ifp); +int if_getdunit(const if_t ifp); +int if_getindex(const if_t ifp); +const char *if_getdname(const if_t ifp); +void if_setdname(if_t ifp, const char *name); +const char *if_name(if_t ifp); +int if_setname(if_t ifp, const char *name); +void if_setdescr(if_t ifp, char *descrbuf); +char *if_allocdescr(size_t sz, int malloc_flag); +void if_freedescr(char *descrbuf); +int if_getalloctype(const if_t ifp); +int if_setdev(if_t ifp, void *dev); +int if_setdrvflagbits(if_t ifp, int if_setflags, int clear_flags); +int if_getdrvflags(const if_t ifp); +int if_setdrvflags(if_t ifp, int flags); +int if_clearhwassist(if_t ifp); +int if_sethwassistbits(if_t ifp, int toset, int toclear); +int if_sethwassist(if_t ifp, int hwassist_bit); +int if_gethwassist(const if_t ifp); +int if_togglehwassist(if_t ifp, int toggle_bits); +int if_setsoftc(if_t ifp, void *softc); +void *if_getsoftc(if_t ifp); +int if_setflags(if_t ifp, int flags); +int if_gethwaddr(const if_t ifp, struct ifreq *); +int if_setmtu(if_t ifp, int mtu); +int if_getmtu(const if_t ifp); +int if_getmtu_family(const if_t ifp, int family); +int if_setflagbits(if_t ifp, int set, int clear); +int if_getflags(const if_t ifp); +int if_sendq_empty(if_t ifp); +int if_setsendqready(if_t ifp); +int if_setsendqlen(if_t ifp, int tx_desc_count); +int if_sethwtsomax(if_t ifp, u_int if_hw_tsomax); +int if_sethwtsomaxsegcount(if_t ifp, u_int if_hw_tsomaxsegcount); +int if_sethwtsomaxsegsize(if_t ifp, u_int if_hw_tsomaxsegsize); +u_int if_gethwtsomax(const if_t ifp); +u_int if_gethwtsomaxsegcount(const if_t ifp); +u_int if_gethwtsomaxsegsize(const if_t ifp); +int if_input(if_t ifp, struct mbuf* sendmp); +int if_sendq_prepend(if_t ifp, struct mbuf *m); +struct mbuf *if_dequeue(if_t ifp); +int if_setifheaderlen(if_t ifp, int len); +void if_setrcvif(struct mbuf *m, if_t ifp); +void if_setvtag(struct mbuf *m, u_int16_t tag); +u_int16_t if_getvtag(struct mbuf *m); +int if_vlantrunkinuse(if_t ifp); +caddr_t if_getlladdr(const if_t ifp); +void *if_gethandle(u_char); +void if_bpfmtap(if_t ifp, struct mbuf *m); +void if_etherbpfmtap(if_t ifp, struct mbuf *m); +void if_vlancap(if_t ifp); +int if_transmit(if_t ifp, struct mbuf *m); +int if_init(if_t ifp); + +/* + * 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); + +int if_getamcount(const if_t ifp); +struct ifaddr * if_getifaddr(const if_t ifp); +typedef u_int if_addr_cb_t(void *, struct ifaddr *, u_int); +u_int if_foreach_addr_type(if_t ifp, int type, if_addr_cb_t cb, void *cb_arg); + +/* Functions */ +void if_setinitfn(if_t ifp, if_init_fn_t); +void if_setinputfn(if_t ifp, if_input_fn_t); +void if_setioctlfn(if_t ifp, if_ioctl_fn_t); +void if_setoutputfn(if_t ifp, int(*) + (if_t, struct mbuf *, const struct sockaddr *, struct route *)); +void if_setstartfn(if_t ifp, void (*)(if_t)); +void if_settransmitfn(if_t ifp, if_transmit_fn_t); +void if_setqflushfn(if_t ifp, if_qflush_fn_t); +void if_setgetcounterfn(if_t ifp, if_get_counter_t); +void if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t); + +/* accessors for struct ifreq */ +void *ifr_data_get_ptr(void *ifrp); +void *ifr_buffer_get_buffer(void *data); +size_t ifr_buffer_get_length(void *data); + +#ifdef DEVICE_POLLING +enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; + +typedef int poll_handler_t(if_t ifp, enum poll_cmd cmd, int count); +int ether_poll_register(poll_handler_t *h, if_t ifp); +int ether_poll_deregister(if_t ifp); +#endif /* DEVICE_POLLING */ + extern struct sx ifnet_detach_sxlock; struct nvlist; diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 2712ac74a09d..1aaabc8e3124 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -108,32 +108,6 @@ VNET_DECLARE(struct hhook_head *, ipsec_hhh_out[HHOOK_IPSEC_COUNT]); #define V_ipsec_hhh_out VNET(ipsec_hhh_out) #endif /* _KERNEL */ -typedef enum { - IFCOUNTER_IPACKETS = 0, - IFCOUNTER_IERRORS, - IFCOUNTER_OPACKETS, - IFCOUNTER_OERRORS, - IFCOUNTER_COLLISIONS, - IFCOUNTER_IBYTES, - IFCOUNTER_OBYTES, - IFCOUNTER_IMCASTS, - IFCOUNTER_OMCASTS, - IFCOUNTER_IQDROPS, - IFCOUNTER_OQDROPS, - IFCOUNTER_NOPROTO, - IFCOUNTERS /* Array size. */ -} ift_counter; - -typedef void (*if_start_fn_t)(if_t); -typedef int (*if_ioctl_fn_t)(if_t, u_long, caddr_t); -typedef void (*if_init_fn_t)(void *); -typedef void (*if_input_fn_t)(struct ifnet *, struct mbuf *); -typedef int (*if_output_fn_t) - (struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); -typedef void (*if_qflush_fn_t)(if_t); -typedef int (*if_transmit_fn_t)(if_t, struct mbuf *); -typedef uint64_t (*if_get_counter_t)(if_t, ift_counter); - struct ifnet_hw_tsomax { u_int tsomaxbytes; /* TSO total burst length limit in bytes */ u_int tsomaxsegcount; /* TSO maximum segment count */ @@ -274,13 +248,6 @@ union if_snd_tag_query_params { struct if_snd_tag_rate_limit_params tls_rate_limit; }; -typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, - struct m_snd_tag **); -typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); -typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); -typedef void (if_snd_tag_free_t)(struct m_snd_tag *); -typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); - struct if_snd_tag_sw { if_snd_tag_modify_t *snd_tag_modify; if_snd_tag_query_t *snd_tag_query; @@ -667,9 +634,6 @@ int if_addgroup(struct ifnet *, const char *); int if_delgroup(struct ifnet *, const char *); int if_addmulti(struct ifnet *, struct sockaddr *, struct ifmultiaddr **); int if_allmulti(struct ifnet *, int); -struct ifnet* if_alloc(u_char); -struct ifnet* if_alloc_dev(u_char, device_t dev); -void if_attach(struct ifnet *); void if_dead(struct ifnet *); int if_delmulti(struct ifnet *, struct sockaddr *); void if_delmulti_ifma(struct ifmultiaddr *); @@ -677,14 +641,9 @@ void if_delmulti_ifma_flags(struct ifmultiaddr *, int flags); void if_detach(struct ifnet *); void if_purgeaddrs(struct ifnet *); void if_delallmulti(struct ifnet *); -void if_down(struct ifnet *); struct ifmultiaddr * if_findmulti(struct ifnet *, const struct sockaddr *); void if_freemulti(struct ifmultiaddr *ifma); -void if_free(struct ifnet *); -void if_initname(struct ifnet *, const char *, int); -void if_link_state_change(struct ifnet *, int); -int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); int if_log(struct ifnet *, int, const char *, ...) __printflike(3, 4); void if_ref(struct ifnet *); void if_rele(struct ifnet *); @@ -718,120 +677,16 @@ typedef void if_com_free_t(void *com, u_char type); void if_register_com_alloc(u_char type, if_com_alloc_t *a, if_com_free_t *f); void if_deregister_com_alloc(u_char type); void if_data_copy(struct ifnet *, struct if_data *); -uint64_t if_get_counter_default(struct ifnet *, ift_counter); -void if_inc_counter(struct ifnet *, ift_counter, int64_t); #define IF_LLADDR(ifp) \ LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr)) -uint64_t if_setbaudrate(if_t ifp, uint64_t baudrate); -uint64_t if_getbaudrate(const if_t ifp); -int if_setcapabilities(if_t ifp, int capabilities); -int if_setcapabilitiesbit(if_t ifp, int setbit, int clearbit); -int if_getcapabilities(const if_t ifp); -int if_togglecapenable(if_t ifp, int togglecap); -int if_setcapenable(if_t ifp, int capenable); -int if_setcapenablebit(if_t ifp, int setcap, int clearcap); -int if_getcapenable(const if_t ifp); -int if_getdunit(const if_t ifp); -int if_getindex(const if_t ifp); -const char *if_getdname(const if_t ifp); -void if_setdname(if_t ifp, const char *name); -const char *if_name(if_t ifp); -int if_setname(if_t ifp, const char *name); -void if_setdescr(if_t ifp, char *descrbuf); -char *if_allocdescr(size_t sz, int malloc_flag); -void if_freedescr(char *descrbuf); -int if_getalloctype(const if_t ifp); -int if_setdev(if_t ifp, void *dev); -int if_setdrvflagbits(if_t ifp, int if_setflags, int clear_flags); -int if_getdrvflags(const if_t ifp); -int if_setdrvflags(if_t ifp, int flags); -int if_clearhwassist(if_t ifp); -int if_sethwassistbits(if_t ifp, int toset, int toclear); -int if_sethwassist(if_t ifp, int hwassist_bit); -int if_gethwassist(const if_t ifp); -int if_togglehwassist(if_t ifp, int toggle_bits); -int if_setsoftc(if_t ifp, void *softc); -void *if_getsoftc(if_t ifp); -int if_setflags(if_t ifp, int flags); -int if_gethwaddr(const if_t ifp, struct ifreq *); -int if_setmtu(if_t ifp, int mtu); -int if_getmtu(const if_t ifp); -int if_getmtu_family(const if_t ifp, int family); -int if_setflagbits(if_t ifp, int set, int clear); -int if_getflags(const if_t ifp); -int if_sendq_empty(if_t ifp); -int if_setsendqready(if_t ifp); -int if_setsendqlen(if_t ifp, int tx_desc_count); -int if_sethwtsomax(if_t ifp, u_int if_hw_tsomax); -int if_sethwtsomaxsegcount(if_t ifp, u_int if_hw_tsomaxsegcount); -int if_sethwtsomaxsegsize(if_t ifp, u_int if_hw_tsomaxsegsize); -u_int if_gethwtsomax(const if_t ifp); -u_int if_gethwtsomaxsegcount(const if_t ifp); -u_int if_gethwtsomaxsegsize(const if_t ifp); -int if_input(if_t ifp, struct mbuf* sendmp); -int if_sendq_prepend(if_t ifp, struct mbuf *m); -struct mbuf *if_dequeue(if_t ifp); -int if_setifheaderlen(if_t ifp, int len); -void if_setrcvif(struct mbuf *m, if_t ifp); -void if_setvtag(struct mbuf *m, u_int16_t tag); -u_int16_t if_getvtag(struct mbuf *m); -int if_vlantrunkinuse(if_t ifp); -caddr_t if_getlladdr(const if_t ifp); -void *if_gethandle(u_char); -void if_bpfmtap(if_t ifp, struct mbuf *m); -void if_etherbpfmtap(if_t ifp, struct mbuf *m); -void if_vlancap(if_t ifp); -int if_transmit(if_t ifp, struct mbuf *m); -int if_init(if_t ifp); - -/* - * 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); - -int if_getamcount(const if_t ifp); -struct ifaddr * if_getifaddr(const if_t ifp); -typedef u_int if_addr_cb_t(void *, struct ifaddr *, u_int); -u_int if_foreach_addr_type(if_t ifp, int type, if_addr_cb_t cb, void *cb_arg); - -/* Functions */ -void if_setinitfn(if_t ifp, if_init_fn_t); -void if_setinputfn(if_t ifp, if_input_fn_t); -void if_setioctlfn(if_t ifp, if_ioctl_fn_t); -void if_setoutputfn(if_t ifp, int(*) - (if_t, struct mbuf *, const struct sockaddr *, struct route *)); -void if_setstartfn(if_t ifp, void (*)(if_t)); -void if_settransmitfn(if_t ifp, if_transmit_fn_t); -void if_setqflushfn(if_t ifp, if_qflush_fn_t); -void if_setgetcounterfn(if_t ifp, if_get_counter_t); -void if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t); - /* TSO */ void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *); int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *); -/* accessors for struct ifreq */ -void *ifr_data_get_ptr(void *ifrp); -void *ifr_buffer_get_buffer(void *data); -size_t ifr_buffer_get_length(void *data); - int ifhwioctl(u_long, struct ifnet *, caddr_t, struct thread *); -#ifdef DEVICE_POLLING -enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS }; - -typedef int poll_handler_t(if_t ifp, enum poll_cmd cmd, int count); -int ether_poll_register(poll_handler_t *h, if_t ifp); -int ether_poll_deregister(if_t ifp); -#endif /* DEVICE_POLLING */ - #endif /* _KERNEL */ #include /* XXXAO: temporary unconditional include */