![]() |
API参考
|
uio module 更多...

类 | |
| struct | BSL_UIO_SctpAuthKey |
| Sctp auth key, hitls Use the BSL_UIO_Method.ctrl method to transfer the BSL_UIO_SCTP_ADD_AUTH_SHARED_KEY instruction to notify the user that the auth key needs to be set. 更多... | |
类型定义 | |
| typedef struct UIO_ControlBlock | BSL_UIO |
| UIO module control structure | |
| typedef void(* | BSL_UIO_USERDATA_FREE_FUNC) (void *) |
| userData release function | |
枚举 | |
| enum | BSL_UIO_TransportType { BSL_UIO_TCP , BSL_UIO_UDP , BSL_UIO_SCTP , BSL_UIO_MEM , BSL_UIO_FILE , BSL_UIO_BUFFER , BSL_UIO_UNKNOWN , BSL_UIO_EXTEND = 10000 } |
| Transmission protocol enumeration | |
| enum | BSL_UIO_CtrlParameter { BSL_UIO_SET_PEER_IP_ADDR = 0x000 , BSL_UIO_GET_PEER_IP_ADDR , BSL_UIO_SET_FD , BSL_UIO_GET_FD , BSL_UIO_PENDING , BSL_UIO_FLUSH , BSL_UIO_WPENDING , BSL_UIO_SEEK , BSL_UIO_RESET , BSL_UIO_GET_INIT , BSL_UIO_GET_WRITE_NUM , BSL_UIO_GET_READ_NUM , BSL_UIO_GET_PTO_LEN , BSL_UIO_INFO , BIO_UIO_SET_CALLBACK , BSL_UIO_SET_CONNECT , BSL_UIO_GET_CONNECT , BSL_UIO_SET_NOBLOCK , BSL_UIO_DO_HANDSHAKE , BSL_UIO_SET_CTX , BSL_UIO_GET_CTX , BSL_UIO_SET_SSL_RENEGOTIATE_TIMEOUT , BSL_UIO_SET_SSL_RENEGOTIATE_BYTES , BSL_UIO_UDP_SET_CONNECTED , BSL_UIO_SET_BUFFER_SIZE , BSL_UIO_UDP_GET_MTU_OVERHEAD , BSL_UIO_UDP_QUERY_MTU , BSL_UIO_UDP_MTU_EXCEEDED , BSL_UIO_CIPHER_IS_FINISHED , BSL_UIO_SET_CONNECT_MODE , BSL_UIO_SET_ACCEPT , BSL_UIO_GET_ACCEPT , BSL_UIO_SET_BIND_MODE , BSL_UIO_GET_BIND_MODE , BSL_UIO_APPEND , BSL_UIO_SCTP_CHECK_PEER_AUTH = 0x300 , BSL_UIO_SCTP_ADD_AUTH_SHARED_KEY , BSL_UIO_SCTP_ACTIVE_AUTH_SHARED_KEY , BSL_UIO_SCTP_DEL_PRE_AUTH_SHARED_KEY , BSL_UIO_SCTP_SND_BUFF_IS_EMPTY , BSL_UIO_SCTP_RECV_BUFF_IS_EMPTY , BSL_UIO_SCTP_GET_SEND_STREAM_ID , BSL_UIO_SCTP_SET_APP_STREAM_ID , BSL_UIO_SCTP_MASK_APP_MESSAGE , BSL_UIO_SCTP_SET_CALLBACK , BSL_UIO_MEM_NEW_BUF = 0x400 , BSL_UIO_MEM_GET_PTR , BSL_UIO_MEM_SET_EOF , BSL_UIO_MEM_GET_EOF , BSL_UIO_MEM_GET_INFO , BSL_UIO_FILE_OPEN = 0x500 , BSL_UIO_FILE_PTR , BSL_UIO_FILE_GET_EOF , BSL_UIO_FILE_SEEK , BSL_UIO_FILE_TELL , BSL_UIO_FILE_GET_PTR , BSL_UIO_FD_GET_INFO = 0x600 , BSL_UIO_PAIR_MAKE = 0x700 , BSL_UIO_PAIR_SET_BUFFER_SIZE , BSL_UIO_PAIR_GET_BUFFER_SIZE , BSL_UIO_TTO_SET_READ_CB = 0x800 , BSL_UIO_TTO_SET_WRITE_CB , BSL_UIO_TTO_SET_READ_APP_DATA , BSL_UIO_TTO_SET_WRITE_APP_DATA , BSL_UIO_DTO_SET_KEY = 0x1001 , BSL_UIO_DTO_SET_EPOCH_SEQUENCE } |
| BSL_UIO_CtrlParameter controls the I/O callback function. Hitls notifies the user of the function to be implemented 更多... | |
函数 | |
| BSL_UIO_Method * | BSL_UIO_NewMethod (void) |
| Creating uio method structure | |
| int32_t | BSL_UIO_SetMethodType (BSL_UIO_Method *meth, BSL_UIO_TransportType type) |
| set uio method type | |
| int32_t | BSL_UIO_SetMethod (BSL_UIO_Method *meth, int32_t type, void *func) |
| set uio method callback | |
| void | BSL_UIO_FreeMethod (BSL_UIO_Method *meth) |
| free uio Method | |
| const BSL_UIO_Method * | BSL_UIO_MemMethod (void) |
| obtain the default MEM UIO | |
| const BSL_UIO_Method * | BSL_UIO_FileMethod (void) |
| obtain the default FILE UIO method | |
| const BSL_UIO_Method * | BSL_UIO_SctpMethod (void) |
| obtain the default SCTP UIO | |
| const BSL_UIO_Method * | BSL_UIO_TcpMethod (void) |
| obtain the default TCP UIO method | |
| const BSL_UIO_Method * | BSL_UIO_UdpMethod (void) |
| obtain the default UDP UIO method | |
| const BSL_UIO_Method * | BSL_UIO_BufferMethod (void) |
| obtain the default buffer UIO | |
| BSL_UIO * | BSL_UIO_New (const BSL_UIO_Method *method) |
| Create a UIO object | |
| void | BSL_UIO_Free (BSL_UIO *uio) |
| Release the UIO object. | |
| int32_t | BSL_UIO_Write (BSL_UIO *uio, const void *data, uint32_t len, uint32_t *writeLen) |
| Write data to the UIO object | |
| int32_t | BSL_UIO_Read (BSL_UIO *uio, void *data, uint32_t len, uint32_t *readLen) |
| Read data from the UIO object. | |
| int32_t | BSL_UIO_Ctrl (BSL_UIO *uio, int32_t cmd, int32_t larg, void *parg) |
| Process specific UIO implementations by cmd | |
| int32_t | BSL_UIO_Puts (BSL_UIO *uio, const char *buf, uint32_t *writeLen) |
| Write a string to the UIO object. | |
| int32_t | BSL_UIO_Gets (BSL_UIO *uio, char *buf, uint32_t *readLen) |
| Reads a string from the UIO object | |
| void | BSL_UIO_SetInit (BSL_UIO *uio, bool init) |
| Set the UIO init. | |
| BSL_UIO_TransportType | BSL_UIO_GetTransportType (const BSL_UIO *uio) |
| Obtain the UIO transmission protocol type | |
| bool | BSL_UIO_GetUioChainTransportType (BSL_UIO *uio, const BSL_UIO_TransportType uioType) |
| Obtain the UIO transmission protocol type | |
| int32_t | BSL_UIO_SetUserData (BSL_UIO *uio, void *data) |
| Set the user data in the UIO object | |
| int32_t | BSL_UIO_SetUserDataFreeFunc (BSL_UIO *uio, BSL_UIO_USERDATA_FREE_FUNC userDataFreeFunc) |
| Release the user data set in the UIO object. | |
| void * | BSL_UIO_GetUserData (const BSL_UIO *uio) |
| Obtain the user data in the UIO object. | |
| bool | BSL_UIO_GetIsUnderlyingClosedByUio (const BSL_UIO *uio) |
| Obtains whether resources associated with the UIO are closed by the UIO. | |
| void | BSL_UIO_SetIsUnderlyingClosedByUio (BSL_UIO *uio, bool close) |
| Set whether resources associated with the UIO are closed by the UIO. | |
| const BSL_UIO_Method * | BSL_UIO_GetMethod (const BSL_UIO *uio) |
| Method for obtaining the UIO | |
| void * | BSL_UIO_GetCtx (const BSL_UIO *uio) |
| Obtain the implementation-related context. | |
| void | BSL_UIO_SetCtx (BSL_UIO *uio, void *ctx) |
| Set the implementation-related context. | |
| void | BSL_UIO_SetFD (BSL_UIO *uio, int fd) |
| Set the fd of the UIO object | |
| int32_t | BSL_UIO_SetFlags (BSL_UIO *uio, uint32_t flags) |
| Set the UIO object flag. | |
| int32_t | BSL_UIO_ClearFlags (BSL_UIO *uio, uint32_t flags) |
| Clear the UIO object flag | |
| uint32_t | BSL_UIO_TestFlags (const BSL_UIO *uio, uint32_t flags, uint32_t *out) |
| Check the UIO object flag | |
| int32_t | BSL_UIO_UpRef (BSL_UIO *uio) |
| Set the value of uio reference counting to 1 | |
| int32_t | BSL_UIO_Append (BSL_UIO *uio, BSL_UIO *tail) |
| Add a UIO object to the tail of the chain. | |
| BSL_UIO * | BSL_UIO_PopCurrent (BSL_UIO *uio) |
| Pop UIO object from the chain. | |
| void | BSL_UIO_FreeChain (BSL_UIO *uio) |
| Release UIO object b and its subsequent chains. | |
| BSL_UIO * | BSL_UIO_Next (BSL_UIO *uio) |
| Obtain the next UIO object in the chain. | |
uio module
BSL_UIO_CtrlParameter controls the I/O callback function. Hitls notifies the user of the function to be implemented
Add a UIO object to the tail of the chain.
| uio | [IN] uio object |
| tail | [IN] UIO object added to the tail |
| BSL_SUCCESS,success. | |
| Non-BSL_SUCCESS,failure. | For details, see bsl_errno.h. |
| const BSL_UIO_Method * BSL_UIO_BufferMethod | ( | void | ) |
obtain the default buffer UIO
| pointer | to the Buffer UIO method |
| int32_t BSL_UIO_ClearFlags | ( | BSL_UIO * | uio, |
| uint32_t | flags ) |
Clear the UIO object flag
| uio | [IN] UIO object |
| flags | [IN] flag |
| BSL_SUCCESS,succeeded. | |
| Other | reference: bsl_errno.h. |
| int32_t BSL_UIO_Ctrl | ( | BSL_UIO * | uio, |
| int32_t | cmd, | ||
| int32_t | larg, | ||
| void * | parg ) |
Process specific UIO implementations by cmd
| uio | [IN] UIO object |
| cmd | [IN] Different cmd processes perform different operations on UIO objects. |
| larg | [IN] Determined by cmd. For details, see the following |
| parg | [IN/OUT] Determined by cmd. For details, see the following |
| BSL_SUCCESS | |
| Non-BSL_SUCCESS,for | details, see bsl_errno.h. |
set the peer IP address in the UIO object
The address format is a binary address in network byte order, with a length of 4 or 16 bytes. A generated cookie will be provided for use by the HelloVerifyRequest for dtls.
| uio | [IN] UIO object |
| cmd | [IN] BSL_UIO_SET_PEER_IP_ADDR |
| larg | [IN] Size of the peer address: The length must be 4 or 16 |
| parg | [IN] Peer address |
Obtain the peer IP address from the UIO object
The obtained address is in the network byte order binary address format. The input length must be greater than the configured size. The purpose is to provide a generated cookie for use by the HelloVerifyRequest of the dtls.
| uio | [IN] UIO object |
| cmd | [IN] BSL_UIO_GET_PEER_IP_ADDR |
| larg | [IN] 0 |
| parg | [IN] BSL_UIO_CtrlGetPeerIpAddrParam *, include: addr [IN/OUT] Peer address, size [IN/OUT] IN: size of the input buffer OUT: size of the output peer address |
Obtain the stream ID sent by the SCTP from the UIO object.
This API needs to be called by users in BSL_UIO_Method.write and send SCTP messages based on the obtained stream ID
| uio | [IN] UIO object |
| cmd | [IN] BSL_UIO_SCTP_GET_SEND_STREAM_ID |
| larg | [IN] 0 |
| parg | [IN/OUT] ID of the sent stream, uint16_t* Type |
Set the stream ID of the app message sent by the SCTP in the UIO object.
If a service message needs to be processed by a specific stream ID, this interface can be called.
| uio | [IN] UIO object |
| cmd | [IN] BSL_UIO_SCTP_SET_APP_STREAM_ID |
| larg | [IN] App stream ID. The value ranges from 0 to 65535 |
| parg | [IN] NULL |
| const BSL_UIO_Method * BSL_UIO_FileMethod | ( | void | ) |
obtain the default FILE UIO method
| void BSL_UIO_Free | ( | BSL_UIO * | uio | ) |
Release the UIO object.
| uio | [IN] UIO object. |
| void BSL_UIO_FreeChain | ( | BSL_UIO * | uio | ) |
Release UIO object b and its subsequent chains.
| uio | [IN] First UIO object in the UIO object chain to be released |
| void BSL_UIO_FreeMethod | ( | BSL_UIO_Method * | meth | ) |
free uio Method
| meth | [IN] uio method structure |
| void |
| void * BSL_UIO_GetCtx | ( | const BSL_UIO * | uio | ) |
Obtain the implementation-related context.
| uio | [IN] UIO object |
| Implementation-related | context pointer |
| bool BSL_UIO_GetIsUnderlyingClosedByUio | ( | const BSL_UIO * | uio | ) |
Obtains whether resources associated with the UIO are closed by the UIO.
| uio | [OUT] UIO object |
| ture | The resources associated with the UIO are closed by the UIO. |
| false | The resources associated with the UIO are not closed by the UIO. |
| const BSL_UIO_Method * BSL_UIO_GetMethod | ( | const BSL_UIO * | uio | ) |
Method for obtaining the UIO
| uio | [IN/OUT] UIO object |
| UIO | method |
| int32_t BSL_UIO_Gets | ( | BSL_UIO * | uio, |
| char * | buf, | ||
| uint32_t * | readLen ) |
Reads a string from the UIO object
| uio | [IN] uio object. |
| buf | [IN] Buffer that accepts a line of strings |
| readLen | [IN/OUT] Length of the buffer for receiving data/Length of the data that is successfully read |
| BSL_SUCCESS | (Determine the value based on the actual receive length. if the length is 0 means no data is read.) |
| BSL_INTERNAL_EXCEPTION,an | unexpected internal error occurs. |
| BSL_UIO_FAIL,invalid | parameter. |
| #BSL_UIO_IO_EXCEPTION,IO | abnormal. |
| BSL_UIO_TransportType BSL_UIO_GetTransportType | ( | const BSL_UIO * | uio | ) |
Obtain the UIO transmission protocol type
| uio | [IN] UIO object. |
| protocol | type |
| bool BSL_UIO_GetUioChainTransportType | ( | BSL_UIO * | uio, |
| const BSL_UIO_TransportType | uioType ) |
Obtain the UIO transmission protocol type
| uio | [IN] UIO object. |
| uioType | [IN] Type of the protocol to be obtained. |
| void * BSL_UIO_GetUserData | ( | const BSL_UIO * | uio | ) |
Obtain the user data in the UIO object.
The user data comes from users, and tls will not change any thing for user data, user can add some customize information.
| uio | [IN] UIO object. |
| Succeeded | in obtaining the data structure pointer stored by the user. |
| NULL,the | obtained data does not exist. |
| const BSL_UIO_Method * BSL_UIO_MemMethod | ( | void | ) |
obtain the default MEM UIO
| pointer | to the MEM UIO method |
| BSL_UIO * BSL_UIO_New | ( | const BSL_UIO_Method * | method | ) |
Create a UIO object
| method | [IN] UIO method structure |
| UIO,created | successfully |
| NULL | UIO, creation failure |
| BSL_UIO_Method * BSL_UIO_NewMethod | ( | void | ) |
Creating uio method structure
| uio | method structure pointer |
Obtain the next UIO object in the chain.
| uio | [IN] UIO object |
| Next | UIO object in the chain. |
Pop UIO object from the chain.
| uio | [IN] UIO object of the pop-up link. |
| The | next UIO object in the chain. |
| int32_t BSL_UIO_Puts | ( | BSL_UIO * | uio, |
| const char * | buf, | ||
| uint32_t * | writeLen ) |
Write a string to the UIO object.
| uio | [IN] uio object. |
| buf | [IN] A null-terminated string to be written. |
| writeLen | [OUT] Length of the data that is successfully written. |
| BSL_SUCCESS,Writing | succeeded. |
| BSL_INTERNAL_EXCEPTION,an | unexpected internal error occurs. |
| #BSL_UIO_IO_BUSY,indicating | that the underlying I/O is busy. |
| #BSL_UIO_IO_EXCEPTION,IO | abnormal. |
| BSL_UIO_FAIL,invalid | parameter. |
| int32_t BSL_UIO_Read | ( | BSL_UIO * | uio, |
| void * | data, | ||
| uint32_t | len, | ||
| uint32_t * | readLen ) |
Read data from the UIO object.
| uio | [IN] uio object. |
| data | [IN] Buffer for receiving data |
| len | [IN] Length of the received data buffer. |
| readLen | [OUT] Length of the received data. |
| BSL_SUCCESS,The | data is read successfully(Determined based on the actual receive length, if the length is 0 means no data is read.) |
| BSL_INTERNAL_EXCEPTION,an | unexpected internal error occurs. |
| BSL_UIO_FAIL,invalid | parameter. |
| #BSL_UIO_IO_EXCEPTION,IO | is abnormal. |
| const BSL_UIO_Method * BSL_UIO_SctpMethod | ( | void | ) |
obtain the default SCTP UIO
| pointer | to the SCTP UIO method |
| void BSL_UIO_SetCtx | ( | BSL_UIO * | uio, |
| void * | ctx ) |
Set the implementation-related context.
| uio | [IN] UIO object |
| ctx | [IN] Implement the relevant context pointer. |
| void BSL_UIO_SetFD | ( | BSL_UIO * | uio, |
| int | fd ) |
Set the fd of the UIO object
| uio | [IN] UIO object |
| fd | [IN] File Descriptor fd |
| int32_t BSL_UIO_SetFlags | ( | BSL_UIO * | uio, |
| uint32_t | flags ) |
Set the UIO object flag.
| uio | [IN] UIO object |
| flags | [IN] flag |
| BSL_SUCCESS,succeeded. | |
| Other | reference: bsl_errno.h. |
| void BSL_UIO_SetInit | ( | BSL_UIO * | uio, |
| bool | init ) |
Set the UIO init.
| uio | [IN] UIO object |
| init | [IN] init value |
| void BSL_UIO_SetIsUnderlyingClosedByUio | ( | BSL_UIO * | uio, |
| bool | close ) |
Set whether resources associated with the UIO are closed by the UIO.
| uio | [IN/OUT] UIO object |
| close | [IN] true UIO-associated resources are closed by the UIO. false The resources associated with the UIO are not closed by the UIO. |
| int32_t BSL_UIO_SetMethod | ( | BSL_UIO_Method * | meth, |
| int32_t | type, | ||
| void * | func ) |
set uio method callback
| meth | [IN] uio method structure |
| type | [IN] callback type |
| func | [IN] callback pointer |
| int32_t BSL_UIO_SetMethodType | ( | BSL_UIO_Method * | meth, |
| BSL_UIO_TransportType | type ) |
| int32_t BSL_UIO_SetUserData | ( | BSL_UIO * | uio, |
| void * | data ) |
Set the user data in the UIO object
UIO will not modify the user data, user can add some information for the UIO, and get the information by use BSL_UIO_GetUserData function; After you set user data by calling BSL_UIO_SetUserData, you need to call BSL_UIO_SetUserData again before calling BSL_UIO_Free to set user data to null to ensure that all memory is released.
| uio | [IN] UIO object. |
| data | [IN] User data pointer |
| BSL_SUCCESS,success. | |
| BSL_NULL_INPUT,invalid | null pointer. |
| int32_t BSL_UIO_SetUserDataFreeFunc | ( | BSL_UIO * | uio, |
| BSL_UIO_USERDATA_FREE_FUNC | userDataFreeFunc ) |
Release the user data set in the UIO object.
Free uio->userData at BSL_UIO_Free.
| uio | [IN] UIO object |
| data | [IN] Pointer to the function for releasing user data |
| BSL_SUCCESS,success. | |
| BSL_NULL_INPUT,invalid | null pointer. |
| const BSL_UIO_Method * BSL_UIO_TcpMethod | ( | void | ) |
obtain the default TCP UIO method
| pointer | to the TCP UIO method |
| uint32_t BSL_UIO_TestFlags | ( | const BSL_UIO * | uio, |
| uint32_t | flags, | ||
| uint32_t * | out ) |
Check the UIO object flag
| uio | [IN] UIO object |
| flags | [IN] To-be-checked flag |
| out | [OUT] Mark the detection result |
| BSL_SUCCESS,succeeded. | |
| Other | reference: bsl_errno.h |
| const BSL_UIO_Method * BSL_UIO_UdpMethod | ( | void | ) |
obtain the default UDP UIO method
| pointer | to the UDP UIO method |
| int32_t BSL_UIO_UpRef | ( | BSL_UIO * | uio | ) |
Set the value of uio reference counting to 1
| uio | [IN] uio object |
| BSL_SUCCESS,the | setting is successful. |
| BSL_INTERNAL_EXCEPTION,an | unexpected internal error occurs. |
| #BSL_UIO_REF_MAX,The | number of UIO objects has reached the maximum. |
| int32_t BSL_UIO_Write | ( | BSL_UIO * | uio, |
| const void * | data, | ||
| uint32_t | len, | ||
| uint32_t * | writeLen ) |
Write data to the UIO object
| uio | [IN] uio object. |
| data | [IN] Data to be written. |
| len | [IN] Data length. |
| writeLen | [OUT] Length of the data that is successfully written. |
| BSL_SUCCESS,indicating | that the data is successfully written. |
| BSL_INTERNAL_EXCEPTION,an | unexpected internal error occurs. |
| #BSL_UIO_IO_BUSY,indicating | that the underlying I/O is busy. |
| #BSL_UIO_IO_EXCEPTION,The | I/O is abnormal. |
| BSL_UIO_FAIL,invalid | parameter. |