ifnet_set_capabilities_enabled
Declaration
errno_t ifnet_set_capabilities_enabled(ifnet_t interface, u_int32_t new_caps, u_int32_t mask);Parameters
- interface:
Interface to set the capabilities on.
- new_caps:
The value of the capabilities that should be set or unset. These flags are defined in net/if.h
- mask:
Which capabilities that should be affected. These flags are defined in net/if.h
Return Value
0 on success otherwise the errno error.
Discussion
Sets the interface capabilities to new_caps. This function lets you specify which capabilities you want to change using the mask. The kernel will effectively take the lock, then set the interface's flags to (if_capenable & ~mask) | (new_caps & mask).
This function is intended to be called by the driver. A kext must not call this function on an interface the kext does not own.
Typically this function is called by the driver when the interface is created to specify which of the supported capabilities are enabled by default. This function is also meant to be called when the driver handles the interface ioctl SIOCSIFCAP.
The driver should call ifnet_set_offlad() to indicate the corresponding hardware offload bits that will be used by the networking stack.
It is an error to enable a capability that is not marked as supported by the interface.
See Also
Network Kernel Extensions
sock_acceptsock_bindsock_closesock_connectsock_getpeernamesock_getsocknamesock_getsockoptsock_gettypesock_inject_data_insock_inject_data_outsock_ioctlsock_isconnectedsock_isnonblockingsock_listensock_receivesock_receivembufsock_sendsock_sendmbufsock_setprivsock_setsockoptsock_shutdownsock_socketsockopt_copyinsockopt_copyoutsockopt_directionsockopt_levelsockopt_namesockopt_valsizeifaddr_addressifaddr_address_familyifaddr_dstaddressifaddr_findbestforaddrifaddr_ifnetifaddr_netmaskifaddr_referenceifaddr_releaseifaddr_withaddrifaddr_withdstaddrifaddr_withnetifaddr_withrouteiflt_attachiflt_detachifmaddr_addressifmaddr_ifnetifmaddr_lladdressifmaddr_referenceifmaddr_releaseifnet_add_multicastifnet_addrlenifnet_allocateifnet_attachifnet_attach_protocolifnet_attach_protocol_v2ifnet_baudrateifnet_capabilities_enabledifnet_capabilities_supportedifnet_detachifnet_detach_protocolifnet_eventifnet_familyifnet_find_by_nameifnet_flagsifnet_free_address_listifnet_free_multicast_listifnet_get_address_listifnet_get_address_list_familyifnet_get_link_mib_dataifnet_get_link_mib_data_lengthifnet_get_multicast_listifnet_get_tso_mtuifnet_get_wake_flagsifnet_hdrlenifnet_indexifnet_inputifnet_interface_family_findifnet_ioctlifnet_lastchangeifnet_list_freeifnet_list_getifnet_lladdr_copy_bytesifnet_llbroadcast_copy_bytesifnet_metricifnet_mtuifnet_nameifnet_offloadifnet_outputifnet_output_rawifnet_referenceifnet_releaseifnet_remove_multicastifnet_resolve_multicastifnet_set_addrlenifnet_set_baudrateifnet_set_capabilities_supportedifnet_set_flagsifnet_set_hdrlenifnet_set_link_mib_dataifnet_set_lladdrifnet_set_metricifnet_set_mtuifnet_set_offloadifnet_set_promiscuousifnet_set_statifnet_set_tso_mtuifnet_set_wake_flagsifnet_softcifnet_statifnet_stat_incrementifnet_stat_increment_inifnet_stat_increment_outifnet_touch_lastchangeifnet_typeifnet_unit