logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

rte_security_driver.h

Author

       Generated automatically by Doxygen for DPDK from the source code.

DPDK                                             Version 24.11.2                        rte_security_driver.h(3)

Detailed Description

       RTE Security Common Definitions

       Definition in file rte_security_driver.h.

Macro Definition Documentation

#defineSECURITY_GET_SESS_PRIV(s)((void*)(((structrte_security_session*)s)->driver_priv_data))
       Helper macro to get driver private data

       Definition at line 66 of file rte_security_driver.h.

Name

       rte_security_driver.h

Synopsis

       #include <rte_compat.h>
       #include 'rte_security.h'

   DataStructures
       struct rte_security_ctx
       struct rte_security_opsMacros
       #define SECURITY_GET_SESS_PRIV(s)       ((void *)(((struct rte_security_session *)s)->driver_priv_data))

   Typedefstypedef int(* security_session_create_t) (void *device, struct rte_security_session_conf *conf, struct
           rte_security_session *sess)
       typedef int(* security_session_destroy_t) (void *device, struct rte_security_session *sess)
       typedef int(* security_session_update_t) (void *device, struct rte_security_session *sess, struct
           rte_security_session_conf *conf)
       typedef int(* security_macsec_sc_create_t) (void *device, struct rte_security_macsec_sc *conf)
       typedef int(* security_macsec_sc_destroy_t) (void *device, uint16_t sc_id, enum
           rte_security_macsec_direction dir)
       typedef int(* security_macsec_sa_create_t) (void *device, struct rte_security_macsec_sa *conf)
       typedef int(* security_macsec_sa_destroy_t) (void *device, uint16_t sa_id, enum
           rte_security_macsec_direction dir)
       typedef unsigned int(* security_session_get_size) (void *device)
       typedef int(* security_session_stats_get_t) (void *device, struct rte_security_session *sess, struct
           rte_security_stats *stats)
       typedef int(* security_macsec_sc_stats_get_t) (void *device, uint16_t sc_id, enum
           rte_security_macsec_direction dir, struct rte_security_macsec_sc_stats *stats)
       typedef int(* security_macsec_sa_stats_get_t) (void *device, uint16_t sa_id, enum
           rte_security_macsec_direction dir, struct rte_security_macsec_sa_stats *stats)
       typedef int(* security_set_pkt_metadata_t) (void *device, struct rte_security_session *sess, struct
           rte_mbuf *mb, void *params)
       typedef const struct rte_security_capability *(* security_capabilities_get_t) (void *device)
       typedef int(* security_rx_inject_configure) (void *device, uint16_t port_id, bool enable)
       typedef uint16_t(* security_inb_pkt_rx_inject) (void *device, struct rte_mbuf **pkts, struct
           rte_security_session **sess, uint16_t nb_pkts)

Typedef Documentation

typedefint(*security_session_create_t)(void*device,structrte_security_session_conf*conf,structrte_security_session*sess)
       Configure a security session on a device.

       Parametersdevice Crypto/eth device pointer
           conf Security session configuration
           sess Pointer to Security private session structure

       Returns

           • Returns 0 if private session structure have been created successfully.

           • Returns -EINVAL if input parameters are invalid.

           • Returns -ENOTSUP if crypto device does not support the crypto transform.

       Definition at line 83 of file rte_security_driver.h.

   typedefint(*security_session_destroy_t)(void*device,structrte_security_session*sess)
       Free driver private session data.

       Parametersdevice Crypto/eth device pointer
           sess Security session structure

       Definition at line 93 of file rte_security_driver.h.

   typedefint(*security_session_update_t)(void*device,structrte_security_session*sess,structrte_security_session_conf*conf)
       Update driver private session data.

       Parametersdevice Crypto/eth device pointer
           sess Pointer to Security private session structure
           conf Security session configuration

       Returns

           • Returns 0 if private session structure have been updated successfully.

           • Returns -EINVAL if input parameters are invalid.

           • Returns -ENOTSUP if crypto device does not support the crypto transform.

       Definition at line 108 of file rte_security_driver.h.

   typedefint(*security_macsec_sc_create_t)(void*device,structrte_security_macsec_sc*conf)
       Configure a MACsec secure channel (SC) on a device.

       Parametersdevice Crypto/eth device pointer
           conf MACsec SC configuration params

       Returns

           • positive sc_id if SC is created successfully.

           • -EINVAL if input parameters are invalid.

           • -ENOTSUP if device does not support MACsec.

           • -ENOMEM if the SC cannot be created.

       Definition at line 124 of file rte_security_driver.h.

   typedefint(*security_macsec_sc_destroy_t)(void*device,uint16_tsc_id,enumrte_security_macsec_directiondir)
       Free MACsec secure channel (SC).

       Parametersdevice Crypto/eth device pointer
           sc_id MACsec SC ID
           dir Direction of SC

       Definition at line 133 of file rte_security_driver.h.

   typedefint(*security_macsec_sa_create_t)(void*device,structrte_security_macsec_sa*conf)
       Configure a MACsec security Association (SA) on a device.

       Parametersdevice Crypto/eth device pointer
           conf MACsec SA configuration params

       Returns

           • positive sa_id if SA is created successfully.

           • -EINVAL if input parameters are invalid.

           • -ENOTSUP if device does not support MACsec.

           • -ENOMEM if the SA cannot be created.

       Definition at line 148 of file rte_security_driver.h.

   typedefint(*security_macsec_sa_destroy_t)(void*device,uint16_tsa_id,enumrte_security_macsec_directiondir)
       Free MACsec security association (SA).

       Parametersdevice Crypto/eth device pointer
           sa_id MACsec SA ID
           dir Direction of SA

       Definition at line 157 of file rte_security_driver.h.

   typedefunsignedint(*security_session_get_size)(void*device)
       Get the size of a security session

       Parametersdevice Crypto/eth device pointer

       Returns

           • On success returns the size of the session structure for device

           • On failure returns 0

       Definition at line 169 of file rte_security_driver.h.

   typedefint(*security_session_stats_get_t)(void*device,structrte_security_session*sess,structrte_security_stats*stats)
       Get stats from the PMD.

       Parametersdevice Crypto/eth device pointer
           sess Pointer to Security private session structure
           stats Security stats of the driver

       Returns

           • Returns 0 if private session structure have been updated successfully.

           • Returns -EINVAL if session parameters are invalid.

       Definition at line 182 of file rte_security_driver.h.

   typedefint(*security_macsec_sc_stats_get_t)(void*device,uint16_tsc_id,enumrte_security_macsec_directiondir,structrte_security_macsec_sc_stats*stats)
       Get MACsec secure channel stats from the PMD.

       Parametersdevice Crypto/eth device pointer
           sc_id secure channel ID created by rte_security_macsec_sc_create()dir direction of SC
           stats SC stats of the driver

       Returns

           • 0 if success.

           • -EINVAL if sc_id or device is invalid.

       Definition at line 198 of file rte_security_driver.h.

   typedefint(*security_macsec_sa_stats_get_t)(void*device,uint16_tsa_id,enumrte_security_macsec_directiondir,structrte_security_macsec_sa_stats*stats)
       Get MACsec SA stats from the PMD.

       Parametersdevice Crypto/eth device pointer
           sa_id secure channel ID created by rte_security_macsec_sc_create()dir direction of SA
           stats SC stats of the driver

       Returns

           • 0 if success.

           • -EINVAL if sa_id or device is invalid.

       Definition at line 214 of file rte_security_driver.h.

   typedefint(*security_set_pkt_metadata_t)(void*device,structrte_security_session*sess,structrte_mbuf*mb,void*params)
       Update the mbuf with provided metadata.

       Parametersdevice Crypto/eth device pointer
           sess Security session structure
           mb Packet buffer
           params Metadata

       Returns

           • Returns 0 if metadata updated successfully.

           • Returns -ve value for errors.

       Definition at line 243 of file rte_security_driver.h.

   typedefconststructrte_security_capability*(*security_capabilities_get_t)(void*device)
       Get security capabilities of the device.

       Parametersdevice crypto/eth device pointer

       Returns

           • Returns rte_security_capability pointer on success.

           • Returns NULL on error.

       Definition at line 243 of file rte_security_driver.h.

   typedefint(*security_rx_inject_configure)(void*device,uint16_tport_id,boolenable)
       Configure security device to inject packets to an ethdev port.

       Parametersdevice Crypto/eth device pointer
           port_id Port identifier of the ethernet device to which packets need to be injected.
           enable Flag to enable and disable connection between a security device and an ethdev port.

       Returns

           • 0 if successful.

           • -EINVAL if context NULL or port_id is invalid.

           • -EBUSY if devices are not in stopped state.

           • -ENOTSUP if security device does not support injecting to the ethdev port.

       Definition at line 273 of file rte_security_driver.h.

   typedefuint16_t(*security_inb_pkt_rx_inject)(void*device,structrte_mbuf**pkts,structrte_security_session**sess,uint16_tnb_pkts)
       Perform security processing of packets and inject the processed packet to ethdev Rx.

       Rx inject would behave similarly to ethdev loopback but with the additional security processing.

       Parametersdevice Crypto/eth device pointer
           pkts The address of an array of nb_pkts pointers to rte_mbufstructureswhichcontainthepackets.sessTheaddressofanarrayofnb_pktspointerstorte_security_sessionstructurescorrespondingtoeachpacket.nb_pktsThemaximumnumberofpacketstoprocess.Returns
           The number of packets successfully injected to ethdev Rx. The return value can be less than the value
           of the nb_pkts parameter when the PMD internal queues have been filled up.

       Definition at line 295 of file rte_security_driver.h.

See Also