NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
DU-Plugin API

Detailed Description

Helper interfaces to program an NVIDIA DRIVE® Update plugin.

Data Structures

struct  DULINK_EXPORT_REQS
 Data structure to define DU Link node to be exported by a DRIVE Update plugin via exportDULinkNodes. More...
 
struct  CTX_LOCK_STR
 Data structure to enable access in a DU Link callback to a string requiring thread access protection. More...
 
struct  CTX_LOCK_UINT8
 Data structure to enable access in a DU Link callback to a uint8_t requiring thread access protection. More...
 
struct  CTX_LOCK_RL
 Data structure to enable access in a DU Link callback to a DU_RUN_LEVEL requiring thread access protection. More...
 
struct  CTX_LIST_STR
 Data structure to enable reading a list of values in a DU Link callback. More...
 
struct  DULINK_CONNECT_INFO
 Data structure to hold information for single DU Link connection. More...
 

Macros

#define DUMASTER_PATH   "/master"
 Defines the path to DU Master used for registration. More...
 
#define PLUGIN_TYPE_INSTALLER   "installer"
 Defines the name strings of all the valid DRIVE Update plugin types. More...
 
#define PLUGIN_TYPE_CONTROLLER   "controller"
 controller type plugin name More...
 
#define PLUGIN_TYPE_CONTENT_PROVIDER   "content_provider"
 content provider type plugin name More...
 
#define PLUGIN_TYPE_FILE_TRANSFORM   "file_transform"
 transform type plugin name More...
 
#define PLUGIN_TYPE_VALIDATOR   "validator"
 validator type plugin name More...
 
#define PLUGIN_TYPE_METADATA_PROVIDER   "metadata_provider"
 metadata provider type plugin name More...
 
#define PLUGIN_TYPE_PERS_CTX_STORE   "persistent_ctx_store"
 persistent context store type plugin name More...
 
#define PLUGIN_TYPE_DEBUG   "debug"
 debugger type plugin name More...
 
#define NODE_PLUGIN_TYPE   "plugin-type"
 Defines the default file names to be exported by all DRIVE Update plugins, including name, parent_path and dulink_ver. More...
 
#define NODE_REQUESTED_RL   "requested_rl"
 requested runlevel file node More...
 
#define NODE_CURRENT_RL   "current_rl"
 current runlevel file node More...
 
#define NODE_PERSISTENT_CTX_PATH   "persistent_ctx_path"
 persistent context path file node More...
 
#define NODE_PENDING_RL   "pending_rl"
 pending runlevel file node More...
 
#define NODE_STATE   "state"
 state file node More...
 
#define NODE_STATE_LIST   "state.list"
 state list file node More...
 
#define NODE_PROGRESS   "progress"
 Defines the file names to be exported by certain DRIVE Update plugin types. More...
 
#define NODE_CMD   "cmd"
 command file node More...
 
#define NODE_CMD_LIST   "cmd.list"
 command list file node More...
 
#define NODE_RESULT   "result"
 result file node More...
 
#define NOTIFY_NODE_CURRENT_RL   "current_rl.notify"
 Defines the file names of notification nodes to be exported by all DRIVE Update plugins. More...
 
#define NOTIFY_NODE_STATE   "state.notify"
 notify node of state More...
 
#define NOTIFY_NODE_PENDING_RL   "pending_rl.notify"
 notify node of pending runlevel More...
 
#define NOTIFY_NODE_PROGRESS   "progress.notify"
 Defines the file names of notification nodes to be exported by certain DRIVE Update plugins. More...
 
#define NOTIFY_NODE_RESULT   "result.notify"
 notify node of result More...
 
#define READ_ONLY_ATTR
 Defines the helper macros of various file attributes of DULINK_ATTR type. More...
 
#define READ_ONLY_DIR_ATTR
 Defines the attribute of read only directory. More...
 
#define READ_WRITE_ATTRIBUTE
 Defines the attribute of read and write allowed file. More...
 
#define WRITE_ONLY_ATTRIBUTE
 Defines the attribute of write only file. More...
 
#define MASTER_ONLY_RW_ATTRIBUTE
 Defines the attribute of the file that can be read and written by DU Master, but cannot be accessed by any other plguins. More...
 
#define MASTER_ONLY_WRITE_ATTRIBUTE
 Defines the attribute of the file that only DU Master can write but not read, and any other plguins cannot access. More...
 
#define COMPAT_ONLY_RW_ATTR
 Defines the attribute of the file that only DU CCheck can read and write, and any other plguins cannot access. More...
 
#define MASTER_ONLY_READ_ATTR
 Defines the file attribute of master read only and others deny write. More...
 
#define ALL_RO_MASTER_RW_ATTR
 Defines the file attribute of all plugins can read, DU Master can read and write. More...
 
#define CCHECK_ONLY_READ_ATTR
 Defines the file attribute of only CCheck can read. More...
 
#define DDU_ONLY_WRITE_ATTR
 Defines the file attribute of only DDU can write. More...
 
#define DUCLIENT_ONLY_RW_ATTR
 Defines the file attribute of only DU-CLIENT can read and write, and any other plguins cannot access. More...
 
#define ALL_RO_DUCLIENT_RW_ATTR
 Defines the file attribute of of all plugins can read, DU-CLIENT can read and write. More...
 
#define ALL_RO_CTX_STORE_RW_ATTR
 Defines the file attribute of of all plugins can read, ctx_store can read and write. More...
 
#define DUTR_PARAM_BUFLEN   (1024)
 Defines the buffer size of the input parameters for DU Transport, used by DULINK_CONNECT_INFO. More...
 

Typedefs

typedef enum DUPLUGIN_TYPE DUPLUGIN_TYPE
 Defines all of the valid DRIVE Update plugin types. More...
 
typedef enum DULINK_CONNECTION_ROLE DULINK_CONNECTION_ROLE
 Role of DU LINK connection. More...
 
typedef struct DULINK_EXPORT_REQS DULINK_EXPORT_REQS
 Data structure to define DU Link node to be exported by a DRIVE Update plugin via exportDULinkNodes. More...
 
typedef struct DULINK_EXPORT_REQSPDULINK_EXPORT_REQS
 
typedef struct CTX_LOCK_STR CTX_LOCK_STR
 Data structure to enable access in a DU Link callback to a string requiring thread access protection. More...
 
typedef struct CTX_LOCK_STRPCTX_LOCK_STR
 
typedef struct CTX_LOCK_UINT8 CTX_LOCK_UINT8
 Data structure to enable access in a DU Link callback to a uint8_t requiring thread access protection. More...
 
typedef struct CTX_LOCK_UINT8PCTX_LOCK_UINT8
 
typedef struct CTX_LOCK_RL CTX_LOCK_RL
 Data structure to enable access in a DU Link callback to a DU_RUN_LEVEL requiring thread access protection. More...
 
typedef struct CTX_LOCK_RLPCTX_LOCK_RL
 
typedef struct CTX_LIST_STR CTX_LIST_STR
 Data structure to enable reading a list of values in a DU Link callback. More...
 
typedef struct CTX_LIST_STRPCTX_LIST_STR
 
typedef struct DULINK_CONNECT_INFO DULINK_CONNECT_INFO
 Data structure to hold information for single DU Link connection. More...
 
typedef struct DULINK_CONNECT_INFOPDULINK_CONNECT_INFO
 

Enumerations

enum  DUPLUGIN_TYPE {
  CONTROLLER = 0U,
  INSTALLER,
  CONTENT_PROVIDER,
  FILE_TRANSFORM,
  VALIDATOR,
  METADATA_PROVIDER,
  DUPLUGIN_TYPE_MAX
}
 Defines all of the valid DRIVE Update plugin types. More...
 
enum  DULINK_CONNECTION_ROLE {
  DULINK_CONNECT_ROUTER = 0,
  DULINK_CONNECT_PLUGIN
}
 Role of DU LINK connection. More...
 

Functions

DU_RCODE exportDULinkNodes (const DULINK_EXPORT_REQS *pDulinkDirs, uint8_t numDirs, const DULINK_EXPORT_REQS *pDulinkFiles, uint8_t numFiles, const DULINK_EXPORT_REQS *pDulinkNotifyNodes, uint8_t numNotifyNodes)
 Export DU Link directories, files and notify nodes. More...
 
DU_RCODE registerToMaster (const char *pMasterPath)
 Register a DU Link plugin to DU Master. More...
 
DU_RCODE replaceContentRoot (char *pStr, const char *pContRootVal, uint64_t bufLen)
 Replace $CONTENT_ROOT$ in path string to actual content. More...
 
DU_RCODE getPluginParent (char *pBuf, uint32_t bufLen)
 Get plugin parent path. More...
 
DU_RCODE getPluginConnInfo (const char *pPluginName, PDULINK_CONNECT_INFO pInfo)
 Get plugin connection info for DU-Link open. More...
 
DU_RCODE readOnlyStringCB (const char *pRequestPath, const char *pOriginPath, void *pCtx, uint64_t offset, uint64_t length, void *pBuf, DULINK_CB_OPERATION operation, uint64_t *pRetVal)
 Callback for read only strings in a DU-Link node. More...
 
DU_RCODE listNodeCB (const char *pRequestPath, const char *pOriginPath, void *pCtx, uint64_t offset, uint64_t length, void *pBuf, DULINK_CB_OPERATION operation, uint64_t *pRetVal)
 Callback for read-only .list nodes. More...
 
DU_RCODE readOnlyRunlevelCB (const char *pRequestPath, const char *pOriginPath, void *pCtx, uint64_t offset, uint64_t length, void *pBuf, DULINK_CB_OPERATION operation, uint64_t *pRetVal)
 Callback for read-only runlevel nodes. More...
 

Macro Definition Documentation

◆ ALL_RO_CTX_STORE_RW_ATTR

#define ALL_RO_CTX_STORE_RW_ATTR
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_READ, \
[0].denyMask = DULINK_PERMISSION_NONE, \
[1].srcElement = "/ctx_store", \
[1].denyMask = DULINK_PERMISSION_NONE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the file attribute of of all plugins can read, ctx_store can read and write.

Attribute type: "*[R,-], /ctx_store[R,W]"

Definition at line 352 of file duplugin.h.

◆ ALL_RO_DUCLIENT_RW_ATTR

#define ALL_RO_DUCLIENT_RW_ATTR
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_READ, \
[0].denyMask = DULINK_PERMISSION_NONE, \
[1].srcElement = "/du-client", \
[1].denyMask = DULINK_PERMISSION_NONE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the file attribute of of all plugins can read, DU-CLIENT can read and write.

Attribute type: "*[R,-], /du-client[R,W]"

Definition at line 332 of file duplugin.h.

◆ ALL_RO_MASTER_RW_ATTR

#define ALL_RO_MASTER_RW_ATTR
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_READ, \
[0].denyMask = DULINK_PERMISSION_NONE, \
[1].srcElement = "/master", \
[1].denyMask = DULINK_PERMISSION_NONE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the file attribute of all plugins can read, DU Master can read and write.

Attribute type: "*[R,-], master[R,W]"

Definition at line 254 of file duplugin.h.

◆ CCHECK_ONLY_READ_ATTR

#define CCHECK_ONLY_READ_ATTR
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_NONE, \
[0].denyMask = DULINK_PERMISSION_WRITE, \
[1].srcElement = "/compatchecker", \
[1].allowMask = DULINK_PERMISSION_READ, \
[1].denyMask = DULINK_PERMISSION_WRITE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the file attribute of only CCheck can read.

Attribute type: "*[-,!W], compatchecker[R,!W]"

Definition at line 273 of file duplugin.h.

◆ COMPAT_ONLY_RW_ATTR

#define COMPAT_ONLY_RW_ATTR
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_NONE, \
[0].denyMask = DULINK_PERMISSION_NONE, \
[1].srcElement = "/compatchecker", \
[1].denyMask = DULINK_PERMISSION_NONE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the attribute of the file that only DU CCheck can read and write, and any other plguins cannot access.

Attribute type: "*[-,-], compatchecker[R,W]"

Definition at line 215 of file duplugin.h.

◆ DDU_ONLY_WRITE_ATTR

#define DDU_ONLY_WRITE_ATTR
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_NONE, \
[0].denyMask = DULINK_PERMISSION_READ, \
[1].srcElement = "/ddu", \
[1].allowMask = DULINK_PERMISSION_WRITE, \
[1].denyMask = DULINK_PERMISSION_READ, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the file attribute of only DDU can write.

Attribute type: "*[!R,-], /ddu[!R,W]"

Definition at line 292 of file duplugin.h.

◆ DUCLIENT_ONLY_RW_ATTR

#define DUCLIENT_ONLY_RW_ATTR
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_NONE, \
[0].denyMask = DULINK_PERMISSION_NONE, \
[1].srcElement = "/du-client", \
[1].denyMask = DULINK_PERMISSION_NONE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the file attribute of only DU-CLIENT can read and write, and any other plguins cannot access.

Attribute type: "*[-,-], /du-client[R,W]"

Definition at line 312 of file duplugin.h.

◆ DUMASTER_PATH

#define DUMASTER_PATH   "/master"

Defines the path to DU Master used for registration.

Definition at line 40 of file duplugin.h.

◆ DUTR_PARAM_BUFLEN

#define DUTR_PARAM_BUFLEN   (1024)

Defines the buffer size of the input parameters for DU Transport, used by DULINK_CONNECT_INFO.

Definition at line 371 of file duplugin.h.

◆ MASTER_ONLY_READ_ATTR

#define MASTER_ONLY_READ_ATTR
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_NONE, \
[0].denyMask = DULINK_PERMISSION_WRITE, \
[1].srcElement = "/master", \
[1].allowMask = DULINK_PERMISSION_READ, \
[1].denyMask = DULINK_PERMISSION_WRITE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the file attribute of master read only and others deny write.

Attribute type: "*[-,!W], master[R,!W]"

Definition at line 234 of file duplugin.h.

◆ MASTER_ONLY_RW_ATTRIBUTE

#define MASTER_ONLY_RW_ATTRIBUTE
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_NONE, \
[0].denyMask = DULINK_PERMISSION_NONE, \
[1].srcElement = "/master", \
[1].denyMask = DULINK_PERMISSION_NONE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the attribute of the file that can be read and written by DU Master, but cannot be accessed by any other plguins.

Definition at line 178 of file duplugin.h.

◆ MASTER_ONLY_WRITE_ATTRIBUTE

#define MASTER_ONLY_WRITE_ATTRIBUTE
Value:
{ \
.numACL = 2U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_NONE, \
[0].denyMask = DULINK_PERMISSION_READ, \
[1].srcElement = "/master", \
[1].allowMask = DULINK_PERMISSION_WRITE, \
[1].denyMask = DULINK_PERMISSION_READ, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the attribute of the file that only DU Master can write but not read, and any other plguins cannot access.

Definition at line 196 of file duplugin.h.

◆ NODE_CMD

#define NODE_CMD   "cmd"

command file node

Definition at line 91 of file duplugin.h.

◆ NODE_CMD_LIST

#define NODE_CMD_LIST   "cmd.list"

command list file node

Definition at line 93 of file duplugin.h.

◆ NODE_CURRENT_RL

#define NODE_CURRENT_RL   "current_rl"

current runlevel file node

Definition at line 75 of file duplugin.h.

◆ NODE_PENDING_RL

#define NODE_PENDING_RL   "pending_rl"

pending runlevel file node

Definition at line 79 of file duplugin.h.

◆ NODE_PERSISTENT_CTX_PATH

#define NODE_PERSISTENT_CTX_PATH   "persistent_ctx_path"

persistent context path file node

Definition at line 77 of file duplugin.h.

◆ NODE_PLUGIN_TYPE

#define NODE_PLUGIN_TYPE   "plugin-type"

Defines the default file names to be exported by all DRIVE Update plugins, including name, parent_path and dulink_ver.

Defines the file names to be exported by all DRIVE Update plugins. plugin type file node

Definition at line 71 of file duplugin.h.

◆ NODE_PROGRESS

#define NODE_PROGRESS   "progress"

Defines the file names to be exported by certain DRIVE Update plugin types.

progress file node

Definition at line 89 of file duplugin.h.

◆ NODE_REQUESTED_RL

#define NODE_REQUESTED_RL   "requested_rl"

requested runlevel file node

Definition at line 73 of file duplugin.h.

◆ NODE_RESULT

#define NODE_RESULT   "result"

result file node

Definition at line 95 of file duplugin.h.

◆ NODE_STATE

#define NODE_STATE   "state"

state file node

Definition at line 81 of file duplugin.h.

◆ NODE_STATE_LIST

#define NODE_STATE_LIST   "state.list"

state list file node

Definition at line 83 of file duplugin.h.

◆ NOTIFY_NODE_CURRENT_RL

#define NOTIFY_NODE_CURRENT_RL   "current_rl.notify"

Defines the file names of notification nodes to be exported by all DRIVE Update plugins.

notify node of current runlevel

Definition at line 102 of file duplugin.h.

◆ NOTIFY_NODE_PENDING_RL

#define NOTIFY_NODE_PENDING_RL   "pending_rl.notify"

notify node of pending runlevel

Definition at line 106 of file duplugin.h.

◆ NOTIFY_NODE_PROGRESS

#define NOTIFY_NODE_PROGRESS   "progress.notify"

Defines the file names of notification nodes to be exported by certain DRIVE Update plugins.

notify node of progress

Definition at line 113 of file duplugin.h.

◆ NOTIFY_NODE_RESULT

#define NOTIFY_NODE_RESULT   "result.notify"

notify node of result

Definition at line 115 of file duplugin.h.

◆ NOTIFY_NODE_STATE

#define NOTIFY_NODE_STATE   "state.notify"

notify node of state

Definition at line 104 of file duplugin.h.

◆ PLUGIN_TYPE_CONTENT_PROVIDER

#define PLUGIN_TYPE_CONTENT_PROVIDER   "content_provider"

content provider type plugin name

Definition at line 50 of file duplugin.h.

◆ PLUGIN_TYPE_CONTROLLER

#define PLUGIN_TYPE_CONTROLLER   "controller"

controller type plugin name

Definition at line 48 of file duplugin.h.

◆ PLUGIN_TYPE_DEBUG

#define PLUGIN_TYPE_DEBUG   "debug"

debugger type plugin name

Definition at line 60 of file duplugin.h.

◆ PLUGIN_TYPE_FILE_TRANSFORM

#define PLUGIN_TYPE_FILE_TRANSFORM   "file_transform"

transform type plugin name

Definition at line 52 of file duplugin.h.

◆ PLUGIN_TYPE_INSTALLER

#define PLUGIN_TYPE_INSTALLER   "installer"

Defines the name strings of all the valid DRIVE Update plugin types.

installer type plugin name

Definition at line 46 of file duplugin.h.

◆ PLUGIN_TYPE_METADATA_PROVIDER

#define PLUGIN_TYPE_METADATA_PROVIDER   "metadata_provider"

metadata provider type plugin name

Definition at line 56 of file duplugin.h.

◆ PLUGIN_TYPE_PERS_CTX_STORE

#define PLUGIN_TYPE_PERS_CTX_STORE   "persistent_ctx_store"

persistent context store type plugin name

Definition at line 58 of file duplugin.h.

◆ PLUGIN_TYPE_VALIDATOR

#define PLUGIN_TYPE_VALIDATOR   "validator"

validator type plugin name

Definition at line 54 of file duplugin.h.

◆ READ_ONLY_ATTR

#define READ_ONLY_ATTR
Value:
{ \
.numACL = 1U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_READ, \
[0].denyMask = DULINK_PERMISSION_WRITE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the helper macros of various file attributes of DULINK_ATTR type.

Defines the attribute of read only file.

Definition at line 121 of file duplugin.h.

◆ READ_ONLY_DIR_ATTR

#define READ_ONLY_DIR_ATTR
Value:
{ \
.numACL = 1U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_READ, \
[0].denyMask = DULINK_PERMISSION_WRITE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the attribute of read only directory.

Definition at line 135 of file duplugin.h.

◆ READ_WRITE_ATTRIBUTE

#define READ_WRITE_ATTRIBUTE
Value:
{ \
.numACL = 1U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].denyMask = DULINK_PERMISSION_NONE, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the attribute of read and write allowed file.

Definition at line 149 of file duplugin.h.

◆ WRITE_ONLY_ATTRIBUTE

#define WRITE_ONLY_ATTRIBUTE
Value:
{ \
.numACL = 1U, \
.acl = \
{ \
[0].srcElement = "/*", \
[0].allowMask = DULINK_PERMISSION_WRITE, \
[0].denyMask = DULINK_PERMISSION_READ, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, \
{{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}}, {{0}} \
} \
}

Defines the attribute of write only file.

Definition at line 163 of file duplugin.h.

Typedef Documentation

◆ CTX_LIST_STR

typedef struct CTX_LIST_STR CTX_LIST_STR

Data structure to enable reading a list of values in a DU Link callback.

◆ CTX_LOCK_RL

typedef struct CTX_LOCK_RL CTX_LOCK_RL

Data structure to enable access in a DU Link callback to a DU_RUN_LEVEL requiring thread access protection.

◆ CTX_LOCK_STR

typedef struct CTX_LOCK_STR CTX_LOCK_STR

Data structure to enable access in a DU Link callback to a string requiring thread access protection.

◆ CTX_LOCK_UINT8

Data structure to enable access in a DU Link callback to a uint8_t requiring thread access protection.

◆ DULINK_CONNECT_INFO

Data structure to hold information for single DU Link connection.

◆ DULINK_CONNECTION_ROLE

Role of DU LINK connection.

◆ DULINK_EXPORT_REQS

Data structure to define DU Link node to be exported by a DRIVE Update plugin via exportDULinkNodes.

◆ DUPLUGIN_TYPE

Defines all of the valid DRIVE Update plugin types.

◆ PCTX_LIST_STR

typedef struct CTX_LIST_STR * PCTX_LIST_STR

◆ PCTX_LOCK_RL

typedef struct CTX_LOCK_RL * PCTX_LOCK_RL

◆ PCTX_LOCK_STR

typedef struct CTX_LOCK_STR * PCTX_LOCK_STR

◆ PCTX_LOCK_UINT8

typedef struct CTX_LOCK_UINT8 * PCTX_LOCK_UINT8

◆ PDULINK_CONNECT_INFO

◆ PDULINK_EXPORT_REQS

Enumeration Type Documentation

◆ DULINK_CONNECTION_ROLE

Role of DU LINK connection.

Enumerator
DULINK_CONNECT_ROUTER 

Router.

DULINK_CONNECT_PLUGIN 

Plugin.

Definition at line 391 of file duplugin.h.

◆ DUPLUGIN_TYPE

Defines all of the valid DRIVE Update plugin types.

Enumerator
CONTROLLER 
INSTALLER 
CONTENT_PROVIDER 
FILE_TRANSFORM 
VALIDATOR 
METADATA_PROVIDER 
DUPLUGIN_TYPE_MAX 

Definition at line 377 of file duplugin.h.

Function Documentation

◆ exportDULinkNodes()

DU_RCODE exportDULinkNodes ( const DULINK_EXPORT_REQS pDulinkDirs,
uint8_t  numDirs,
const DULINK_EXPORT_REQS pDulinkFiles,
uint8_t  numFiles,
const DULINK_EXPORT_REQS pDulinkNotifyNodes,
uint8_t  numNotifyNodes 
)

Export DU Link directories, files and notify nodes.

This function takes a list of DULINK_EXPORT_REQS for each type and will export the corresponding DU Link node type based on which list it is in.

Parameters
[in]pDulinkDirs(const_DULINK_EXPORT_REQS*)List of export requirements for DU Link directories. If NULL, numDirs must be 0.
[in]numDirs(uint8_t)Number of dirs in pDulinkDirs.
[in]pDulinkFiles(const_DULINK_EXPORT_REQS*)List of export requirements for DU Link files. If NULL, numFiles must be 0.
[in]numFiles(uint8_t)Number of files in pDulinkFiles.
[in]pDulinkNotifyNodes(const_DULINK_EXPORT_REQS*)List of export requirements for DU Link notify nodes. If NULL, numNotifyNodes must be 0.
[in]numNotifyNodes(uint8_t)Number of notify nodes in pDulinkNotifyNodes.
Returns
DU_OK All nodes exported successfully.
DUCOMMON_ERR_GENERIC Failed to export DU Link Nodes.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: No

◆ getPluginConnInfo()

DU_RCODE getPluginConnInfo ( const char *  pPluginName,
PDULINK_CONNECT_INFO  pInfo 
)

Get plugin connection info for DU-Link open.

Helper function to fetch connection info for each plugin. This would read router configurations from device tree and convert it into the connection configurations of this plugin.

Parameters
[in]pPluginName(const_char*)Name of the plugin.
[in,out]pInfo(PDULINK_CONNECT_INFO)To be filled in with fetched connection info to be used by plugin.
Returns
DU_OK Connection info successfully fetched from device tree.
DUCOMMON_ERR_NOT_FOUND Plugin entry is not found, and plugin should exit.
DUCOMMON_ERR_GENERIC Other error happened during read of device tree.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ getPluginParent()

DU_RCODE getPluginParent ( char *  pBuf,
uint32_t  bufLen 
)

Get plugin parent path.

For plugins in the same VM, it should use the same parent path as there should only be one router in a VM.

Parameters
[in,out]pBuf(char*)Buffer to store parent path.
[in]bufLen(uint64_t)Parent buffer length.
Returns
DU_OK Buffer is filled with parent path.
DUCOMMON_ERR_GENERIC Error happens during read of device tree.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ listNodeCB()

DU_RCODE listNodeCB ( const char *  pRequestPath,
const char *  pOriginPath,
void pCtx,
uint64_t  offset,
uint64_t  length,
void pBuf,
DULINK_CB_OPERATION  operation,
uint64_t *  pRetVal 
)

Callback for read-only .list nodes.

This callback will iterate through a data structure of CTX_LIST_STR type and return a NULL separated list of strings containing all values in the list. DULINK_CB_WRITE operation is not supported by this callback.

It can be used as the callback for the following DU-Link nodes: cmd.list, state.list.

Parameters
[in]pRequestPath(const_char*)Full path of node being accessed.
[in]pOriginPath(const_char*)Full path of element originating the request.
[in]pCtx(void*)Pointer to initialized CTX_LIST_STR data structure.
[in]offset(uint64_t)Should always be 0, otherwise error.
[in]length(uint64_t)Length of buffer to use for reading.
[in]pBuf(char*)Pointer to buffer for storing data.
[in]operation(DULINK_CB_OPERATION)IO operation, it must be one of:
  • DULINK_CB_READ
  • DULINK_CB_SIZE
[out]pRetVal(uint64_t*)Actual bytes read to buffer for operation DULINK_CB_READ, and length of the string for operation DULINK_CB_SIZE.
Returns
DU_OK Upon success.
DULINK_CB_ERR_INVALID_ARGUMENT Invalid operation or offset.
DULINK_CB_ERR_UNKNOWN Not enough space to store value in buffer.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ readOnlyRunlevelCB()

DU_RCODE readOnlyRunlevelCB ( const char *  pRequestPath,
const char *  pOriginPath,
void pCtx,
uint64_t  offset,
uint64_t  length,
void pBuf,
DULINK_CB_OPERATION  operation,
uint64_t *  pRetVal 
)

Callback for read-only runlevel nodes.

This callback will return a string representation of runlevel when reading a node's either current or pending runlevel. DULINK_CB_WRITE operation is not supported by this callback.

It can be used as the callback for the following DU-Link nodes: current_rl, pending_rl.

Parameters
[in]pRequestPath(const_char*)Full path of node being accessed.
[in]pOriginPath(const_char*)Full path of element originating the request.
[in]pCtx(void*)Pointer to DU_RUN_LEVEL storing runlevel.
[in]offset(uint64_t)Should always be 0, otherwise error.
[in]length(uint64_t)Length of buffer to use for reading.
[in]pBuf(char*)Pointer to buffer for storing data.
[in]operation(DULINK_CB_OPERATION)IO operation, it must be one of:
  • DULINK_CB_READ
  • DULINK_CB_SIZE
[out]pRetVal(uint64_t*)Actual bytes read to buffer for operation DULINK_CB_READ, and length of the string for operation DULINK_CB_SIZE.
Returns
DU_OK Upon success.
DULINK_CB_ERR_INVALID_ARGUMENT Invalid operation or offset.
DULINK_CB_ERR_UNKNOWN Not enough space to store value in buffer.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ readOnlyStringCB()

DU_RCODE readOnlyStringCB ( const char *  pRequestPath,
const char *  pOriginPath,
void pCtx,
uint64_t  offset,
uint64_t  length,
void pBuf,
DULINK_CB_OPERATION  operation,
uint64_t *  pRetVal 
)

Callback for read only strings in a DU-Link node.

This callback is used for simply reading the value stored in a particular string with no additional functionality required. Context passed to this callback should be of CTX_LOCK_STR type. In case the mutex in the passed structure is not NULL, the mutex will be locked surrounding any reading of the string value. DULINK_CB_WRITE operation is not supported by this callback.

It can be used as the callback for the following DU-Link nodes: plugin-type, state, progress, ver/installer, last_deployed/metadata, last_deployed/result.

Parameters
[in]pRequestPath(const_char*)Full path of node being accessed.
[in]pOriginPath(const_char*)Full path of element originating the request.
[in]pCtx(void*)Pointer to CTX_LOCK_STR data structure.
[in]offset(uint64_t)Should always be 0, otherwise error.
[in]length(uint64_t)Length of buffer to use for reading.
[in]pBuf(char*)Pointer to buffer for storing data.
[in]operation(DULINK_CB_OPERATION)IO operation, it must be one of:
  • DULINK_CB_READ
  • DULINK_CB_SIZE
[out]pRetVal(uint64_t*)Actual bytes read to buffer for operation DULINK_CB_READ, and length of the string for operation DULINK_CB_SIZE.
Returns
DU_OK Upon success.
DULINK_CB_ERR_INVALID_ARGUMENT Invalid operation or offset.
DULINK_CB_ERR_UNKNOWN Not enough space to store value in buffer.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ registerToMaster()

DU_RCODE registerToMaster ( const char *  pMasterPath)

Register a DU Link plugin to DU Master.

This will tell DU Master to set up listeners for progress.notify, current_rl.notify, pending_rl.notify, and state.notify on the plugin registering to master.

Parameters
[in]pMasterPath(const_char*)DU Link path to DU Master element.
Returns
DU_OK Successfully registered to DU Master.
DUCOMMON_ERR_INVALID_ARGUMENT Invalid path to DU Master.
DUCOMMON_ERR_GENERIC Failed to register to DU Master.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ replaceContentRoot()

DU_RCODE replaceContentRoot ( char *  pStr,
const char *  pContRootVal,
uint64_t  bufLen 
)

Replace $CONTENT_ROOT$ in path string to actual content.

Parameters
[in,out]pStr(char*)Path string to process.
[in]pContRootVal(const_char*)Actual content root value.
[in]bufLen(uint64_t)Maximum length of input/output buffer.
Returns
DU_OK String successfully converted.
DUCOMMON_ERR_BUFFER_TOO_SMALL Buffer size not enough for actual content.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes