]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/smux/types.h
Added a wrapper for correct oid comparsion
[stg.git] / projects / stargazer / plugins / other / smux / types.h
diff --git a/projects/stargazer/plugins/other/smux/types.h b/projects/stargazer/plugins/other/smux/types.h
new file mode 100644 (file)
index 0000000..26d6e24
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __TYPES_H__
+#define __TYPES_H__
+
+#include <string>
+#include <vector>
+#include <istream>
+
+#include "asn1/OBJECT_IDENTIFIER.h"
+
+class OID {
+    public:
+        OID(const std::string & str);
+        OID(const char * str, size_t length);
+        OID(const std::vector<unsigned> & arcs);
+        OID(const unsigned * arcs, size_t length);
+        OID(OBJECT_IDENTIFIER_t * oid);
+        OID(const OID & rvalue);
+        ~OID();
+
+        std::string ToString() const;
+        const std::vector<unsigned> & ToVector() const { return arcs; }
+        void ToOID(OBJECT_IDENTIFIER_t * oid) const;
+
+        OID & operator=(const OID & rvalue);
+        bool operator==(const OID & rvalue) const;
+        bool operator<(const OID & rvalue) const;
+
+        std::ostream & operator<<(std::ostream & stream) const;
+
+    private:
+        std::vector<unsigned> arcs;
+};
+
+#endif