Print this page
7558 libscf.h should provide constants for scf_type_to_string return values

@@ -20,10 +20,11 @@
  */
 
 /*
  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2013, Joyent, Inc. All rights reserved.
+ * Copyright 2016 RackTop Systems.
  */
 
 /*
  * This is the main implementation file for the low-level repository
  * interface.

@@ -290,26 +291,38 @@
 static const struct {
         scf_type_t ti_type;
         rep_protocol_value_type_t ti_proto_type;
         const char *ti_name;
 } scf_type_info[] = {
-        {SCF_TYPE_BOOLEAN,      REP_PROTOCOL_TYPE_BOOLEAN,      "boolean"},
-        {SCF_TYPE_COUNT,        REP_PROTOCOL_TYPE_COUNT,        "count"},
-        {SCF_TYPE_INTEGER,      REP_PROTOCOL_TYPE_INTEGER,      "integer"},
-        {SCF_TYPE_TIME,         REP_PROTOCOL_TYPE_TIME,         "time"},
-        {SCF_TYPE_ASTRING,      REP_PROTOCOL_TYPE_STRING,       "astring"},
-        {SCF_TYPE_OPAQUE,       REP_PROTOCOL_TYPE_OPAQUE,       "opaque"},
-        {SCF_TYPE_USTRING,      REP_PROTOCOL_SUBTYPE_USTRING,   "ustring"},
-        {SCF_TYPE_URI,          REP_PROTOCOL_SUBTYPE_URI,       "uri"},
-        {SCF_TYPE_FMRI,         REP_PROTOCOL_SUBTYPE_FMRI,      "fmri"},
-        {SCF_TYPE_HOST,         REP_PROTOCOL_SUBTYPE_HOST,      "host"},
-        {SCF_TYPE_HOSTNAME,     REP_PROTOCOL_SUBTYPE_HOSTNAME,  "hostname"},
-        {SCF_TYPE_NET_ADDR,     REP_PROTOCOL_SUBTYPE_NETADDR,   "net_address"},
+        {SCF_TYPE_BOOLEAN,      REP_PROTOCOL_TYPE_BOOLEAN,
+            SCF_TYPE_STRING_BOOLEAN},
+        {SCF_TYPE_COUNT,        REP_PROTOCOL_TYPE_COUNT,
+            SCF_TYPE_STRING_COUNT},
+        {SCF_TYPE_INTEGER,      REP_PROTOCOL_TYPE_INTEGER,
+            SCF_TYPE_STRING_INTEGER},
+        {SCF_TYPE_TIME,         REP_PROTOCOL_TYPE_TIME,
+            SCF_TYPE_STRING_TIME},
+        {SCF_TYPE_ASTRING,      REP_PROTOCOL_TYPE_STRING,
+            SCF_TYPE_STRING_ASTRING},
+        {SCF_TYPE_OPAQUE,       REP_PROTOCOL_TYPE_OPAQUE,
+            SCF_TYPE_STRING_OPAQUE},
+        {SCF_TYPE_USTRING,      REP_PROTOCOL_SUBTYPE_USTRING,
+            SCF_TYPE_STRING_USTRING},
+        {SCF_TYPE_URI,          REP_PROTOCOL_SUBTYPE_URI,
+            SCF_TYPE_STRING_URI},
+        {SCF_TYPE_FMRI,         REP_PROTOCOL_SUBTYPE_FMRI,
+            SCF_TYPE_STRING_FMRI},
+        {SCF_TYPE_HOST,         REP_PROTOCOL_SUBTYPE_HOST,
+            SCF_TYPE_STRING_HOST},
+        {SCF_TYPE_HOSTNAME,     REP_PROTOCOL_SUBTYPE_HOSTNAME,
+            SCF_TYPE_STRING_HOSTNAME},
+        {SCF_TYPE_NET_ADDR,     REP_PROTOCOL_SUBTYPE_NETADDR,
+            SCF_TYPE_STRING_NET_ADDR},
         {SCF_TYPE_NET_ADDR_V4,  REP_PROTOCOL_SUBTYPE_NETADDR_V4,
-            "net_address_v4"},
+            SCF_TYPE_STRING_NET_ADDR_V4},
         {SCF_TYPE_NET_ADDR_V6,  REP_PROTOCOL_SUBTYPE_NETADDR_V6,
-            "net_address_v6"}
+            SCF_TYPE_STRING_NET_ADDR_V6}
 };
 
 #define SCF_TYPE_INFO_COUNT (sizeof (scf_type_info) / sizeof (*scf_type_info))
 static rep_protocol_value_type_t
 scf_type_to_protocol_type(scf_type_t t)