// <auto-generated>
// This code is generated by csbindgen.
// DON'T CHANGE THIS DIRECTLY.
// </auto-generated>
#pragma warning disable CS8500
#pragma warning disable CS8981
using System;
using System.Runtime.InteropServices;


namespace CsBindgen
{
    internal static unsafe partial class NativeMethods
    {
        const string __DllName = "cl_api";





        /// <summary>
        ///  @brief Returns the API version
        ///  @param major the major version
        ///  @param minor the minor version
        ///  @param patch the patch version
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_get_api_version", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern void cl_get_api_version(uint* major, uint* minor, uint* patch);

        /// <summary>
        ///  @brief This is a helper to format an EAN number using the format
        ///  XX-XXXXX-XXXXX-X
        ///  @param ean The EAN to format
        ///  @param buffer Te buffer to place the resulting string in
        ///  @param buffer_size The size of the buffer
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_format_ean", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_format_ean(ulong ean, byte* buffer, nuint buffer_size);

        /// <summary>
        ///  @brief This is a helper to format a serial number using the format
        ///  0000000 (essentially just a "%07lu" format string)
        ///  @param ean The serial number to format
        ///  @param buffer Te buffer to place the resulting string in
        ///  @param buffer_size The size of the buffer
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_format_serial_number", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_format_serial_number(ulong serial_number, byte* buffer, nuint buffer_size);

        /// <summary>
        ///  @brief Creates a client handle, to be used for all general library functions, must be freed with cl_client_destroy to free memery.
        ///  @return a new client handle
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_client_create", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_client_t* cl_client_create();

        /// <summary>
        ///  @brief Frees the given client handle
        ///  @param client the client handle to free
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_client_destroy", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern void cl_client_destroy(cl_client_t* client);

        /// <summary>
        ///  @brief Uses DNS-SD to scan for cl devices on the local network (ethernet
        ///  over USB)
        ///  @param client The client handle to use for the scan
        ///  @param device_list in parameter to store the scan result in
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_client_scan_for_devices", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_client_scan_for_devices(cl_client_t* client, cl_device_list_t** device_list);

        /// <summary>
        ///  @brief Uses DNS-SD to scan for cl devices on the local network (ethernet
        ///  over USB). This version of the function has an adjustable timeout to
        ///  allow shorter or longer scan time. Default scan time is 1000ms.
        ///  @param client The client handle to use for the scan
        ///  @param device_list in parameter to store the scan result in
        ///  @param timeout_ms the timeout to use
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_client_scan_for_devices_with_timeout", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_client_scan_for_devices_with_timeout(cl_client_t* client, cl_device_list_t** device_list, uint timeout_ms);

        /// <summary>
        ///  @brief Finds a device from the given index
        ///  @param index the index to find
        ///  @param device_list device list to search in
        ///  @return the device, or NULL if out of bounds
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_list_find_by_index", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_device_t* cl_device_list_find_by_index(nuint index, cl_device_list_t* device_list);

        /// <summary>
        ///  @brief Finds a device from the given ean and serial number
        ///  @param ean a pointer to a serial number (will be ignored if NULL)
        ///  @param serial_number The device's serial number
        ///  @param device_list device list to search in
        ///  @return the device, or NULL if no match or multiple matches
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_list_find_by_info", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_device_t* cl_device_list_find_by_info(ulong* ean, ulong serial_number, cl_device_list_t* device_list);

        /// <summary>
        ///  @brief Frees the given device_list
        ///  @param device_list device list to free
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_list_destroy", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern void cl_device_list_destroy(cl_device_list_t* device_list);

        /// <summary>
        ///  @brief Creates a device iterator. To be used with cl_device_iterator_next.
        ///  cl_device_iterator_destroy must be called to free memory when done with the iterator.
        ///  @param device_list The device list to iterate over
        ///  @return the device iterator object
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_iterator_create", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_device_iterator_t* cl_device_iterator_create(cl_device_list_t* device_list);

        /// <summary>
        ///  @brief Frees the given device iterotor.
        ///  @param iterator The iterator to free
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_iterator_destroy", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern void cl_device_iterator_destroy(cl_device_iterator_t* iterator);

        /// <summary>
        ///  @brief Gets the next device.
        ///  @param iterator A cl_device_iterator_t created with cl_device_iterator_create
        ///  @return NULL if there is no next device.
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_iterator_next", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_device_t* cl_device_iterator_next(cl_device_iterator_t* iterator);

        /// <summary>
        ///  @brief Gets the interfaces for the given device
        ///  @param device The target device
        ///  @param interface_list A pointer to the cl_interface_list_ptr_t (pointer to pointer)
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_interfaces", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_interfaces(cl_device_t* device, cl_interface_list_t** interface_list);

        /// <summary>
        ///  @brief Gets the device name. The returned string will be null terminated.
        ///  @param device The target device
        ///  @param buffer A buffer to place the device name in
        ///  @param buffer_size The size of the buffer
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_name", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_name(cl_device_t* device, byte* buffer, nuint buffer_size);

        /// <summary>
        ///  @brief Gets the device nickname. The returned string will be null terminated.
        ///  @param device The target device
        ///  @param buffer A buffer to place the device nickname in
        ///  @param buffer_size The size of the buffer
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_nickname", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_nickname(cl_device_t* device, byte* buffer, nuint buffer_size);

        /// <summary>
        ///  @brief Sets the given null terminated device_nickname
        ///  @param device The target device
        ///  @param name A null terminated string
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_set_nickname", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_set_nickname(cl_device_t* device, byte* name);

        /// <summary>
        ///  @brief Gets the 64bit firmware EAN
        ///  @param device The target device
        ///  @param ean Out parameter
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_firmware_ean", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_firmware_ean(cl_device_t* device, ulong* ean);

        /// <summary>
        ///  @brief Gets the 64bit feature EAN
        ///  @param device The target device
        ///  @param ean Out parameter
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_feature_ean", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_feature_ean(cl_device_t* device, ulong* ean);

        /// <summary>
        ///  @brief Gets the firmware version as a semver string
        ///  @param device The target device
        ///  @param buffer Buffer to store the string in
        ///  @param buffer_size Size of the buffer
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_firmware_version", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_firmware_version(cl_device_t* device, byte* buffer, nuint buffer_size);

        /// <summary>
        ///  @brief Gets the bootloader version as a semver string
        ///  @param device The target device
        ///  @param buffer Buffer to store the version string in
        ///  @param buffer_size Size of the buffer
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_bootloader_version", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_bootloader_version(cl_device_t* device, byte* buffer, nuint buffer_size);

        /// <summary>
        ///  @brief Gets the PCB revision as a string
        ///  @param device The target device
        ///  @param buffer Buffer to store the PCB revision string in
        ///  @param buffer_size Size of the buffer
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_pcb_revision", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_pcb_revision(cl_device_t* device, byte* buffer, nuint buffer_size);

        /// <summary>
        ///  @brief Sends a new firmware blob to the device
        ///  @param device The target device
        ///  @param firmware_blob Raw firmware blob
        ///  @param size Size of blob in bytes
        ///  @param callbacks A cl_firmware_update_callbacks_t structure containing function pointers to
        ///  call during the firmware update. It is safe for the struct pointer to be NULL, as well as any of
        ///  the function pointers (if they're not of interest).
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_update_firmware_from_blob", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_update_firmware_from_blob(cl_device_t* device, byte* firmware_blob, nuint size, cl_firmware_update_callbacks_t* callbacks);

        /// <summary>
        ///  @brief Sends a new firmware from file at the given path to the device
        ///  @param device The target device
        ///  @param firmware_path File path to firmware file
        ///  @param callbacks A cl_firmware_update_callbacks_t structure containing function pointers to
        ///  call during the firmware update. It is safe for the struct pointer to be NULL, as well as any of
        ///  the function pointers (if they're not of interest).
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_update_firmware_from_path", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_update_firmware_from_path(cl_device_t* device, byte* firmware_path, cl_firmware_update_callbacks_t* callbacks);

        /// <summary>
        ///  @brief Gets the device manufacturing date as string
        ///  @param device The target device
        ///  @param timestamp Unix timestamp when device was manufactured
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_manufacturing_date", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_manufacturing_date(cl_device_t* device, ulong* timestamp);

        /// <summary>
        ///  @brief Gets the 64bit serial_number
        ///  @param device The target device
        ///  @param serial_number Out parameter
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_serial_number", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_serial_number(cl_device_t* device, ulong* serial_number);

        /// <summary>
        ///  @brief Gets the 64bit EAN
        ///  @param device The target device
        ///  @param ean Out parameter
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_get_ean", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_get_ean(cl_device_t* device, ulong* ean);

        /// <summary>
        ///  @brief Trigger identify device sequence (flash device LEDs)
        ///  @param device The target device
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_device_identify", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_device_identify(cl_device_t* device);

        /// <summary>
        ///  @brief Frees the given interface_list
        ///  @param interface_list interface list to free
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_list_destroy", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern void cl_interface_list_destroy(cl_interface_list_t* interface_list);

        /// <summary>
        ///  @brief Creates an iterator to be used to access the interfaces from an \ref cl_interface_list_t
        ///  @param interface_list An interface list
        ///  @note This iterator must be freed with cl_interface_iterator_destroy to free memory.
        ///  @return A \ref cl_interface_iterator_t
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_iterator_create", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_interface_iterator_t* cl_interface_iterator_create(cl_interface_list_t* interface_list);

        /// <summary>
        ///  @brief Frees the given interface iterotor.
        ///  @param iterator The iterator to free
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_iterator_destroy", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern void cl_interface_iterator_destroy(cl_interface_iterator_t* iterator);

        /// <summary>
        ///  @brief Gets the next interface.
        ///  @param iterator A cl_interface_iterator_t created with cl_interface_iterator_create
        ///  @return NULL if there is no next interface.
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_iterator_next", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_interface_t* cl_interface_iterator_next(cl_interface_iterator_t* iterator);

        /// <summary>
        ///  @brief Gets the interface nickname
        ///  @param interface The target interface
        ///  @param buffer A buffer to place the interface nickname in
        ///  @param buffer_size The size of the buffer
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_get_nickname", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_get_nickname(cl_interface_t* @interface, byte* buffer, nuint buffer_size);

        /// <summary>
        ///  @brief Sets the given null terminated interface nickname
        ///  @param interface The target interface
        ///  @param name A null terminated string
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_set_nickname", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_set_nickname(cl_interface_t* @interface, byte* name);

        /// <summary>
        ///  @brief Gets the interface status.
        ///  @param interface The target interface
        ///  @param status The returned interface status, see \ref cl_interface_status_t for
        ///  more info.
        ///  @note When link is down, this function will return the active configuration, and if it's up
        ///  it'll return the negotiated configuration.
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_get_status", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_get_status(cl_interface_t* @interface, cl_interface_status_t* status);

        /// <summary>
        ///  @brief Reads the current tc10 state for the given interface.
        ///  @param interface The target interface
        ///  @param state Pointer to \ref cl_tc10_state_t to store result in
        ///  @note Only T1 interfaces support this function, others will return
        ///  CL_STATUS_OPERATION_NOT_SUPPORTED_BY_INTERFACE
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_get_tc10_state", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_get_tc10_state(cl_interface_t* @interface, cl_tc10_state_t* state);

        /// <summary>
        ///  @brief Sends the given tc10 command to the given interface
        ///  @param interface The target interface
        ///  @param command The tc10 command to send, see \ref cl_tc10_command_t for possible values
        ///  @note Only T1 interfaces support this function, others will return
        ///  CL_STATUS_OPERATION_NOT_SUPPORTED_BY_INTERFACE
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_send_tc10_command", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_send_tc10_command(cl_interface_t* @interface, cl_tc10_command_t command);

        /// <summary>
        ///  @brief Gets the interface link configuration for an ethernet interface.
        ///  @param interface The target interface
        ///  @param mode The config to get. See \ref cl_eth_config_t,
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_eth_get_config", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_eth_get_config(cl_interface_t* @interface, cl_eth_config_t* config);

        /// <summary>
        ///  @brief Sets the interface link mode for an ethernet interface.
        ///  @param interface The target interface
        ///  @param config The config to set. See \ref cl_eth_config_t,
        ///  @note Only configs returned by \ref cl_interface_eth_get_supported_configs are possible
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_eth_set_config", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_eth_set_config(cl_interface_t* @interface, cl_eth_config_t config);

        /// <summary>
        ///  @brief Gets the supported configuration options for the given interface.
        ///  @param interface The target interface
        ///  @param config The new config
        ///  @note Some interfaces will respond with CL_STATUS_OPERATION_NOT_SUPPORTED_BY_INTERFACE if it
        ///  can not be directly controlled. For instance the T interface in Arcus 100/1000BASE-T1 H-MTD
        ///  follows the negotiated link on the T1 side (since they're directly linked without an ethernet
        ///  switch between them).
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_eth_get_supported_configs", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_eth_get_supported_configs(cl_interface_t* @interface, cl_eth_config_t* config);

        /// <summary>
        ///  @brief Triggers identify interface sequence (flash interface LEDs) to help identify the given
        ///  interface
        ///  @param interface The target interface
        ///  @return status code, see \ref cl_status_t for possible codes
        /// </summary>
        [DllImport(__DllName, EntryPoint = "cl_interface_identify", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
        internal static extern cl_status_t cl_interface_identify(cl_interface_t* @interface);


    }

    /// <summary>
    ///  @brief cl_client_t is the opaque pointer type used as a handle for all client operations
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_client_t
    {
    }

    /// <summary>
    ///  @brief Struct containing function pointers to callbacks, to be called throughout the update
    ///  process. Used with \ref cl_device_update_firmware_from_blob and \ref cl_device_update_firmware_from_path.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_firmware_update_callbacks_t
    {
        /// <summary>
        ///  @brief User data, will be used as the first argument to all callback functions
        /// </summary>
        public void* user_data;
        /// <summary>
        ///  @brief Callback called when update is starting
        ///  @param[in] user_data The previously given user_data
        ///  @param[in] total_transfer_bytes The total size of the firmware
        /// </summary>
        public delegate* unmanaged[Cdecl]<void*, nuint, void> update_starting;
        /// <summary>
        ///  @brief Callback called when a chunk has been sent to the device
        ///  @param[in] user_data The previously given user_data
        ///  @param[in] transferred_bytes The amount of bytes transferred up to this point
        /// </summary>
        public delegate* unmanaged[Cdecl]<void*, nuint, void> report_progress;
        /// <summary>
        ///  @brief Callback called when upload is done and device is validating firmware and writing it to its flash memory
        ///  @param[in] user_data The previously given user_data
        /// </summary>
        public delegate* unmanaged[Cdecl]<void*, void> start_finalizing;
        /// <summary>
        ///  @brief Callback called when the update is finished
        ///  @param[in] user_data The previously given user_data
        ///  @param[in] update_result A \ref cl_firmware_update_result_t
        /// </summary>
        public delegate* unmanaged[Cdecl]<void*, cl_firmware_update_result_t, void> update_finished;
    }

    /// <summary>
    ///  @brief cl_device_t is the opaque pointer type used as a handle for all device operations
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_device_t
    {
    }

    /// <summary>
    ///  @brief cl_device_list_t is the opaque pointer type used as a handle a collection of devices
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_device_list_t
    {
    }

    /// <summary>
    ///  @brief cl_device_iterator is the opaque pointer type used as a device list iterator
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_device_iterator_t
    {
    }

    /// <summary>
    ///  @brief cl_interface_t is the opaque pointer type used as a handle for all interface operations
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_interface_t
    {
    }

    /// <summary>
    ///  @brief cl_interface_list_t is the opaque pointer type used as a handle a collection of
    ///  interfaces
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_interface_list_t
    {
    }

    /// <summary>
    ///  @brief cl_interface_iterator_t is the opaque pointer type used as a interface list iterator
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_interface_iterator_t
    {
    }

    /// <summary>
    ///  @brief Ethernet config. Contains an auto negotiation setting (IEEE aneg
    ///  enabled or disabled), one or more speed settings (ORed) and one or more
    ///  link roles (ORed)
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_eth_config_t
    {
        /// <summary>
        ///  flag containing ORed enumerations from cl_link_speed_t
        /// </summary>
        public uint link_speed;
        /// <summary>
        ///  flag containing ORed enumerations from cl_link_role_t
        /// </summary>
        public uint link_role;
        public cl_aneg_mode_t aneg_mode;
    }

    /// <summary>
    ///  @brief Ethernet interface status. Has a link state (UP/DOWN), and if it is
    ///  up, it'll also contain a speed and role that is determined by what was
    ///  negotiated (or set, if not using aneg) for the link.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_eth_interface_status_t
    {
        public cl_link_speed_t link_speed;
        public cl_link_role_t link_role;
        public cl_link_state_t link_state;
    }

    /// <summary>
    ///  @brief Interface status contains the status for an interface. It consists
    ///  of struct_size, struct_version, interface_type and eth_interface_status.
    ///
    ///  The struct_size and struct_version are there to allow for this
    ///  struct to grow in future versions of this API without breaking the ABI.
    ///  To use it you'll want to initialize it before use as follows:
    ///  @code
    ///  cl_interface_status_t interface_status = {
    ///      .struct_size = sizeof(interface_status),
    ///      .struct_version = CL_INTERFACE_STATUS_T_VERSION,
    ///  };
    ///  cl_status_t status = cl_interface_get_status(interface, &amp;interface_status);
    ///  @endcode
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal unsafe partial struct cl_interface_status_t
    {
        public nuint struct_size;
        public uint struct_version;
        public cl_interface_type_t interface_type;
        public cl_eth_interface_status_t eth_interface_status;
    }


    internal enum cl_status_t : uint
    {
        CL_STATUS_SUCCESS = 0,
        /// <summary>
        ///  The attempted operation was not permitted
        /// </summary>
        CL_STATUS_OPERATION_NOT_PERMITTED = 10,
        /// <summary>
        ///  The attempted operation failed
        /// </summary>
        CL_STATUS_OPERATION_FAILED = 11,
        /// <summary>
        ///  The attempted operation is not supported by this device
        /// </summary>
        CL_STATUS_OPERATION_NOT_SUPPORTED_BY_DEVICE = 12,
        /// <summary>
        ///  The attempted operation is not supported by this interface
        /// </summary>
        CL_STATUS_OPERATION_NOT_SUPPORTED_BY_INTERFACE = 13,
        /// <summary>
        ///  The attempted operation is not supported by the currently running device firmware
        /// </summary>
        CL_STATUS_OPERATION_NOT_SUPPORTED_BY_DEVICE_FIRMWARE = 14,
        /// <summary>
        ///  Catchall for unexpected network errors
        /// </summary>
        CL_STATUS_UNKNOWN_NETWORK_ERROR = 102,
        /// <summary>
        ///  Failed device connection
        /// </summary>
        CL_STATUS_UNABLE_TO_CONNECT = 103,
        /// <summary>
        ///  Failed to write to TCP socket
        /// </summary>
        CL_STATUS_SOCKET_WRITE_ERROR = 105,
        /// <summary>
        ///  Failed to read from TCP socket
        /// </summary>
        CL_STATUS_SOCKET_READ_ERROR = 106,
        /// <summary>
        ///  Failed to open file
        /// </summary>
        CL_STATUS_FILE_OPEN_ERROR = 150,
        /// <summary>
        ///  Failed to read file
        /// </summary>
        CL_STATUS_FILE_READ_ERROR = 151,
        /// <summary>
        ///  Failed to create threads
        /// </summary>
        CL_STATUS_THREADING_ERROR = 160,
        /// <summary>
        ///  Encountered an unimplemented function
        /// </summary>
        CL_STATUS_NOT_IMPLEMENTED = 200,
        /// <summary>
        ///  The given buffer was too small to fit the requested data
        /// </summary>
        CL_STATUS_BUFFER_TOO_SMALL = 201,
        /// <summary>
        ///  Found a device that has newer, incompatible firmware with this version of CL API
        /// </summary>
        CL_STATUS_DEVICE_NOT_SUPPORTED_BY_CLIENT = 205,
        /// <summary>
        ///  A function was called incorrectly, for instance calling cl_interface_get_status with a
        ///  cl_interface_status_t without a struct_size/version set.
        /// </summary>
        CL_STATUS_INVALID_USAGE = 207,
        /// <summary>
        ///  Encountered a string with invalid utf-8
        /// </summary>
        CL_STATUS_INVALID_UTF8 = 208,
        /// <summary>
        ///  Some other error occurred
        /// </summary>
        CL_STATUS_UNSPECIFIED_ERROR = 1000,
    }

    /// <summary>
    ///  Enum containing possible update results
    /// </summary>
    internal enum cl_firmware_update_result_t : uint
    {
        CL_UF_STATUS_SUCCESS = 0,
        CL_UF_STATUS_TRANSFER_ERROR = 1,
        CL_UF_STATUS_FIRMWARE_FAILED_SIGNATURE_CHECK = 2,
        CL_UF_STATUS_FIRMWARE_CORRUPT = 3,
        CL_UF_STATUS_FIRMWARE_FOR_OTHER_DEVICE = 4,
        CL_UF_STATUS_UNKNOWN_ERROR = 5,
    }

    /// <summary>
    ///  @brief Ethernet link state
    /// </summary>
    internal enum cl_link_state_t : uint
    {
        CL_ETH_LINK_STATE_DOWN,
        CL_ETH_LINK_STATE_UP,
    }

    /// <summary>
    ///  @brief Ethernet link speed
    /// </summary>
    internal enum cl_link_speed_t : uint
    {
        CL_ETH_LINK_SPEED_INVALID = 0,
        CL_ETH_LINK_SPEED_10MBIT_HALF_DUPLEX = 1,
        CL_ETH_LINK_SPEED_10MBIT_FULL_DUPLEX = 2,
        CL_ETH_LINK_SPEED_100MBIT_HALF_DUPLEX = 4,
        CL_ETH_LINK_SPEED_100MBIT_FULL_DUPLEX = 8,
        CL_ETH_LINK_SPEED_1000MBIT_HALF_DUPLEX = 16,
        CL_ETH_LINK_SPEED_1000MBIT_FULL_DUPLEX = 32,
    }

    /// <summary>
    ///  @brief Ethernet role
    /// </summary>
    internal enum cl_link_role_t : uint
    {
        CL_ETH_LINK_ROLE_INVALID = 0,
        CL_ETH_LINK_ROLE_LEADER = 1,
        CL_ETH_LINK_ROLE_LEADER_PREFERRED = 2,
        CL_ETH_LINK_ROLE_FOLLOWER = 4,
        CL_ETH_LINK_ROLE_FOLLOWER_PREFERRED = 8,
    }

    /// <summary>
    ///  @brief Ethernet auto negotiation
    /// </summary>
    internal enum cl_aneg_mode_t : uint
    {
        CL_ETH_ANEG_MODE_DISABLED = 0,
        CL_ETH_ANEG_MODE_IEEE_ANEG_ENABLED = 1,
    }

    /// <summary>
    ///  @brief Interface type
    /// </summary>
    internal enum cl_interface_type_t : uint
    {
        CL_INTERFACE_TYPE_T1 = 0,
        _RESERVED = 1,
        CL_INTERFACE_TYPE_T = 2,
    }

    /// <summary>
    ///  The different possible TC10 states
    /// </summary>
    internal enum cl_tc10_state_t : uint
    {
        CL_TC10_STATE_NORMAL = 0,
        CL_TC10_STATE_SLEEP = 1,
        CL_TC10_STATE_SLEEP_FAILED = 2,
        CL_TC10_STATE_SLEEP_ABORTED = 3,
        CL_TC10_STATE_UNKNOWN = 4,
    }

    /// <summary>
    ///  The available TC10 commands
    /// </summary>
    internal enum cl_tc10_command_t : uint
    {
        CL_TC10_CMD_SLEEP = 0,
        CL_TC10_CMD_WAKE_UP = 1,
    }


}
