Limited http-data static server

* Renamed from www-data to http-data
* New `clixon-restconf@2022-03-21.yang` revision
  * Added option:
    * `enable-http-data`
  * Added feature: `http-data`
* Added new str2str mapper
* Test: new test_http_data.sh, added CI github action testing
This commit is contained in:
Olof hagsand 2022-04-21 15:37:58 +02:00
parent 76213057b6
commit 2a8cedf0c3
13 changed files with 551 additions and 76 deletions

View file

@ -787,6 +787,24 @@ clicon_str2int_search(const map_str2int *mstab,
return -1; /* not found */
}
/*! Map from string to string using str2str map
* @param[in] mstab String, string map
* @param[in] str Input string
* @retval str Output string
* @retval NULL Error, not found
*/
char*
clicon_str2str(const map_str2str *mstab,
char *str)
{
const struct map_str2str *ms;
for (ms = &mstab[0]; ms->ms_s0; ms++)
if (strcmp(ms->ms_s0, str) == 0)
return ms->ms_s1;
return NULL;
}
/*! Split colon-separated node identifier into prefix and name
* @param[in] node-id
* @param[out] prefix If non-NULL, return malloced string, or NULL.