CNDP
22.08.0
|
Go to the source code of this file.
Macros | |
#define | IBROKER_NAME_SIZE 64 |
#define | IBROKER_MAX_SERVICES 64 |
#define | IBROKER_MAX_COUNT 128 |
Typedefs | |
typedef int32_t | broker_id_t |
typedef int32_t | service_id_t |
typedef int(* | ibroker_walk_t) (broker_id_t bid, void *arg) |
typedef int(* | ibroker_func_t) (int vector, void *arg) |
Functions | |
IBROKER_API broker_id_t | ibroker_create (const char *name) |
IBROKER_API void | ibroker_destroy (broker_id_t bid) |
IBROKER_API const char * | ibroker_get_name (broker_id_t id) |
IBROKER_API service_id_t | ibroker_add_service (broker_id_t id, const char *service, int vector, ibroker_func_t func, void *arg) |
IBROKER_API int | ibroker_del_service (broker_id_t bid, service_id_t sid) |
IBROKER_API int | ibroker_send (broker_id_t bid, service_id_t sid) |
IBROKER_API broker_id_t | ibroker_find (const char *name) |
IBROKER_API service_id_t | ibroker_find_service (broker_id_t bid, const char *name) |
IBROKER_API int | ibroker_register_sender (broker_id_t bid, service_id_t sid) |
IBROKER_API int | ibroker_service_fd (broker_id_t bid, service_id_t sid) |
IBROKER_API const char * | ibroker_service_name (broker_id_t bid, service_id_t sid) |
IBROKER_API int | ibroker_walk (ibroker_walk_t func, void *arg) |
IBROKER_API int | ibroker_id_list (broker_id_t *ids, int len) |
IBROKER_API int | ibroker_info (broker_id_t bid, ibroker_info_t *info) |
CNE UIPI Broker or Interrupt Broker(ibroker)
This library provides a simple interface to use UIPI features. The implementation will abstract as much as possible to give the developer an opportunity to use UIPI features.
Giving the developer an easy to use interface to the UIPI or interrupt based services.
Definition in file ibroker.h.
#define IBROKER_NAME_SIZE 64 |
#define IBROKER_MAX_SERVICES 64 |
Total number of services
#define IBROKER_MAX_COUNT 128 |
Max number of ibrokers allowed
typedef int32_t broker_id_t |
typedef int32_t service_id_t |
typedef int(* ibroker_walk_t) (broker_id_t bid, void *arg) |
typedef int(* ibroker_func_t) (int vector, void *arg) |
IBROKER_API broker_id_t ibroker_create | ( | const char * | name | ) |
Create a broker instance for the given name.
name | Name of the broker instance. |
IBROKER_API void ibroker_destroy | ( | broker_id_t | bid | ) |
Destroy a ibroker instance.
This function uses the per thread ibroker value.
bid | The broker ID value to destroy |
IBROKER_API const char* ibroker_get_name | ( | broker_id_t | id | ) |
Return the ibroker instance name.
id | The ibroker id to retrieve the name from, if -1 use current name. |
IBROKER_API service_id_t ibroker_add_service | ( | broker_id_t | id, |
const char * | service, | ||
int | vector, | ||
ibroker_func_t | func, | ||
void * | arg | ||
) |
Add a service to a broker
id | The broker ID value |
service | The name of the service to add |
vector | The vector number to initialize |
func | The function to callback when the UIPI service is interrupted |
arg | The function callback argument from the caller. |
IBROKER_API int ibroker_del_service | ( | broker_id_t | bid, |
service_id_t | sid | ||
) |
Delete the given service in the broker defined by broker ID
bid | The broker ID to use for the delete operation |
sid | The service id to delete |
IBROKER_API int ibroker_send | ( | broker_id_t | bid, |
service_id_t | sid | ||
) |
Send a UIPI interrupt to the given broker and vector
bid | The broker ID to use for the senduipi() operation |
sid | The service ID to send the interrupt |
IBROKER_API broker_id_t ibroker_find | ( | const char * | name | ) |
Find the ibroker by name.
name | The ibroker name pointer |
IBROKER_API service_id_t ibroker_find_service | ( | broker_id_t | bid, |
const char * | name | ||
) |
Find a service in a given broker by name
bid | The broker ID to use for the senduipi() operation, if -1 then search all brokers. |
name | The service name to find in the given broker |
IBROKER_API int ibroker_register_sender | ( | broker_id_t | bid, |
service_id_t | sid | ||
) |
Register sender with the given broker
bid | The broker ID to search |
sid | The vector ID value for the service |
IBROKER_API int ibroker_service_fd | ( | broker_id_t | bid, |
service_id_t | sid | ||
) |
Find a service FD in a broker with its service ID value
bid | The broker ID value |
sid | The server ID value to use for selecting the correct service |
IBROKER_API const char* ibroker_service_name | ( | broker_id_t | bid, |
service_id_t | sid | ||
) |
Return the service name given the broker and service ID
bid | The broker_id_t value |
sid | The service_id_t value |
IBROKER_API int ibroker_walk | ( | ibroker_walk_t | func, |
void * | arg | ||
) |
Walk the list of ibroker instances and call a function with argument.
func | The ibroker_walk_t function pointer to call |
arg | The user defined pointer to be passed to the function. |
IBROKER_API int ibroker_id_list | ( | broker_id_t * | ids, |
int | len | ||
) |
Get a list of broker IDs
ids | Array to place the broker_id_t IDs, if NULL then return the number of brokers |
len | The length of the broker ids array, but be able to hold all broker ids or error is returned. |
IBROKER_API int ibroker_info | ( | broker_id_t | bid, |
ibroker_info_t * | info | ||
) |
Return information about a broker
bid | The broker ID value |
info | The broker_info_t structure pointer. |