}
}
-static bool
-is_id(const char *string)
+bool
+ovsdb_parser_is_id(const char *string)
{
unsigned char c;
if ((value->type >= 0 && value->type < JSON_N_TYPES
&& types & (1u << value->type))
|| (types & OP_ID && value->type == JSON_STRING
- && is_id(value->u.string)))
+ && ovsdb_parser_is_id(value->u.string)))
{
svec_add(&parser->used, name);
return value;
struct ovsdb_error *ovsdb_parser_finish(struct ovsdb_parser *)
WARN_UNUSED_RESULT;
+bool ovsdb_parser_is_id(const char *string);
+
#endif /* ovsdb-parser.h */
if (node->name[0] == '_') {
error = ovsdb_syntax_error(json, NULL, "names beginning with "
"\"_\" are reserved");
+ } else if (!ovsdb_parser_is_id(node->name)) {
+ error = ovsdb_syntax_error(json, NULL, "name must be a valid id");
} else {
error = ovsdb_table_schema_from_json(node->data, node->name,
&table);
if (node->name[0] == '_') {
error = ovsdb_syntax_error(json, NULL, "names beginning with "
"\"_\" are reserved");
+ } else if (!ovsdb_parser_is_id(node->name)) {
+ error = ovsdb_syntax_error(json, NULL, "name must be a valid id");
} else {
error = ovsdb_column_from_json(node->data, node->name, &column);
}
"certificate": {
"comment": "Name of a PEM file containing a certificate, signed by the certificate authority (CA) used by the controller and manager, that certifies the switch's private key, identifying a trustworthy switch.",
"type": "string"},
- "ca-cert": {
+ "ca_cert": {
"comment": "Name of a PEM file containing the CA certificate used to verify that the switch is connected to a trustworthy controller.",
"type": "string"}}}}}