#include "../dao_card_grpc_service.h"
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
|
struct dao_card_grpc_ctx * | dao_card_grpc_client_init (const char *server_ip, uint16_t server_port) |
|
void | dao_card_grpc_client_fini (struct dao_card_grpc_ctx *ctx) |
|
int | dao_card_init (struct dao_card_grpc_ctx *ctx, struct dao_card_config *config) |
|
void | dao_card_fini (struct dao_card_grpc_ctx *ctx) |
|
int | dao_card_info_get (struct dao_card_grpc_ctx *ctx, struct dao_card_info *info) |
|
int | dao_card_app_fallback (struct dao_card_grpc_ctx *ctx) |
|
int | dao_card_stats_get (struct dao_card_grpc_ctx *ctx, struct dao_card_stats *stats) |
|
int | dao_card_sensors_get (struct dao_card_grpc_ctx *ctx, char *buf, size_t len) |
|
int | dao_card_dmesg_get (struct dao_card_grpc_ctx *ctx, char *buf, size_t len) |
|
int | dao_card_file_update (struct dao_card_grpc_ctx *ctx, struct dao_card_update_req *req, enum dao_card_update_type type) |
|
This file contains the API for liquid crypto card.
Definition in file dao_card_grpc_client.h.
◆ dao_card_grpc_client_init()
struct dao_card_grpc_ctx * dao_card_grpc_client_init |
( |
const char * |
server_ip, |
|
|
uint16_t |
server_port |
|
) |
| |
Initialize the gRPC client.
- Parameters
-
server_ip | IP address of the server |
server_port | Port number of the server |
- Returns
- : A pointer to the gRPC client context
◆ dao_card_grpc_client_fini()
void dao_card_grpc_client_fini |
( |
struct dao_card_grpc_ctx * |
ctx | ) |
|
Finalize the gRPC client.
- Parameters
-
◆ dao_card_init()
int dao_card_init |
( |
struct dao_card_grpc_ctx * |
ctx, |
|
|
struct dao_card_config * |
config |
|
) |
| |
Initialize liquid crypto card.
This function need to be called from management daemon. It will initialize EAL and crypto device on the liquid crypto card. It will also launch worker threads which will wait till ethdev are created.
- Parameters
-
ctx | gRPC client context |
config | configuration for the card |
- Returns
- : 0 on success, negative value on failure
◆ dao_card_fini()
void dao_card_fini |
( |
struct dao_card_grpc_ctx * |
ctx | ) |
|
Finalize liquid crypto card.
This function need to be called from management daemon. It will wait for all the worker threads to finish processing and stop the crypto device and perform eal cleanup on the liquid crypto card.
- Parameters
-
◆ dao_card_info_get()
int dao_card_info_get |
( |
struct dao_card_grpc_ctx * |
ctx, |
|
|
struct dao_card_info * |
info |
|
) |
| |
Get the card information.
It will get the card information like number of ethdevs and max number of sessions supported.
- Parameters
-
ctx | gRPC client context |
info | [out]: card information |
- Returns
- : 0 on success, negative value on failure
◆ dao_card_app_fallback()
int dao_card_app_fallback |
( |
struct dao_card_grpc_ctx * |
ctx | ) |
|
Fallback the application to working one or older one.
This function should be called to switch the application older or working one when updated application fails to start. Card should be booted in failsafe mode for this command to work.
- Parameters
-
- Returns
- : 0 on success, negative value on failure
◆ dao_card_stats_get()
int dao_card_stats_get |
( |
struct dao_card_grpc_ctx * |
ctx, |
|
|
struct dao_card_stats * |
stats |
|
) |
| |
Get the card stats.
It will get the card stats like packets received or sent by each active core on liquid crypto card.
- Parameters
-
ctx | gRPC client context |
stats | [out]: card information |
- Returns
- : 0 on success, negative value on failure
◆ dao_card_sensors_get()
int dao_card_sensors_get |
( |
struct dao_card_grpc_ctx * |
ctx, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Get sensors/temperature and voltage information collected via lm-sensors on the card. The returned output is a multi-line string; caller prints/logs as needed.
- Parameters
-
ctx | gRPC client context |
buf | output buffer to fill (null-terminated) |
len | size of output buffer |
- Returns
- 0 on success, negative errno style value on failure
◆ dao_card_dmesg_get()
int dao_card_dmesg_get |
( |
struct dao_card_grpc_ctx * |
ctx, |
|
|
char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Get recent dmesg logs from the card.
- Parameters
-
ctx | gRPC client context |
buf | destination buffer |
len | buffer length |
- Returns
- : number of bytes copied (>=0) or negative errno-style value
◆ dao_card_file_update()
int dao_card_file_update |
( |
struct dao_card_grpc_ctx * |
ctx, |
|
|
struct dao_card_update_req * |
req, |
|
|
enum dao_card_update_type |
type |
|
) |
| |
Update the image in liquid crypto card.
This function need to be called from management daemon. It will update the provided image on to the DAO card based on update type. For update type as: APP_UPDATE, it will copy or update the application. FW_UPDATE, it will update the firmware, rootfs kernel image and application. FAIL_SAFE_UPDATE, It will update the failsafe image.
- Parameters
-
ctx | gRPC client context |
req | Request with file details |
type | Request with file details |
- Returns
- : 0 on success, negative value on failure