RDK Documentation (Open Sourced RDK Components)
|
Functions | |
static int | isNodeArrayType (cJSON *const item) |
This function takes a cJSON node as argument and verifies whether the supplied argument is an node array. More... | |
static int | saveToFile (cJSON *arrayNode, const char *filename) |
This function writes the parsed JSON information to a file. More... | |
static cJSON * | getArrayNode (cJSON *node) |
This function traverses through the cJSON node list and returns the next node that is an Array. More... | |
static void | processSSHWhiteList (cJSON *sshFeature) |
This function processes IP and MAC lists configured in the feature list. More... | |
void | main (int argc, char **argv) |
This function parses dcm JSON information and save it to a file. More... | |
|
static |
This function takes a cJSON node as argument and verifies whether the supplied argument is an node array.
[in] | item | item to know its type. |
Returns | 1 if the supplied item is an array kind otherwise returns 0. |
Definition at line 73 of file dcmjsonparser.c.
|
static |
This function writes the parsed JSON information to a file.
[in] | arrayNode | JSON array. |
[in] | filename | Name of the file where parsed data will be stored. |
@ret returns status(0/1).
Definition at line 91 of file dcmjsonparser.c.
|
static |
This function traverses through the cJSON node list and returns the next node that is an Array.
[in] | node | JSON response from SSH whitelist. |
@ret returns JSON array.
Definition at line 125 of file dcmjsonparser.c.
|
static |
This function processes IP and MAC lists configured in the feature list.
-Example: { "name":"SNMPWhitelist", "effectiveImmediate":false, "enable":true, "configData":{}, "listType":"IPv4", "listSize":5, "SNMP IP4 WL":["178.62.43.255","128.82.34.17","192.168.1.80","192.168.1.1/24","10.0.0.32/6"] },
[in] | sshFeature | Contains JSON values like List type and list size |
Definition at line 167 of file dcmjsonparser.c.
void main | ( | int | argc, |
char ** | argv | ||
) |
This function parses dcm JSON information and save it to a file.
JSON will contain these information Feature control information like effectiveImmediate,configData.
Example:In this main function "featureControl" JSON is created with features in KeyValue format.
FeatureControl { "features": [ { "name": "<feature name>", "effectiveImmediate": true, "enable": true, "configData": { <Parameter to configure> } "listType": "B8:27:EB:50:C1:CF", "listSize": 1, "RDK_RPI": [ "B8:27:EB:50:C1:FC" ] } ] }
Definition at line 204 of file dcmjsonparser.c.