]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/smux/value2os.h
Allow to start mod_rscript without subnets file
[stg.git] / projects / stargazer / plugins / other / smux / value2os.h
index 420616a1e97b8887f0bd18dcf4738706aa6c7fe9..d17cb3574ba80579bd2d27351eaf5eb241c5f917 100644 (file)
@@ -17,4 +17,48 @@ asn_long2INTEGER(&simpleSyntax->choice.number, value);
 return true;
 }
 
 return true;
 }
 
+template <>
+inline
+bool ValueToOS<unsigned int>(const unsigned int & value, ObjectSyntax * objectSyntax)
+{
+objectSyntax->present = ObjectSyntax_PR_simple;
+SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
+simpleSyntax->present = SimpleSyntax_PR_number;
+asn_long2INTEGER(&simpleSyntax->choice.number, value);
+return true;
+}
+
+template <>
+inline
+bool ValueToOS<long>(const long & value, ObjectSyntax * objectSyntax)
+{
+objectSyntax->present = ObjectSyntax_PR_simple;
+SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
+simpleSyntax->present = SimpleSyntax_PR_number;
+asn_long2INTEGER(&simpleSyntax->choice.number, value);
+return true;
+}
+
+template <>
+inline
+bool ValueToOS<unsigned long>(const unsigned long & value, ObjectSyntax * objectSyntax)
+{
+objectSyntax->present = ObjectSyntax_PR_simple;
+SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
+simpleSyntax->present = SimpleSyntax_PR_number;
+asn_long2INTEGER(&simpleSyntax->choice.number, value);
+return true;
+}
+
+template <>
+inline
+bool ValueToOS<std::string>(const std::string & value, ObjectSyntax * objectSyntax)
+{
+objectSyntax->present = ObjectSyntax_PR_simple;
+SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple;
+simpleSyntax->present = SimpleSyntax_PR_string;
+OCTET_STRING_fromBuf(&simpleSyntax->choice.string, value.c_str(), value.length());
+return true;
+}
+
 #endif
 #endif