aboutsummaryrefslogtreecommitdiff
path: root/ber
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-06-27 23:26:45 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-06-27 23:26:45 +0200
commit83744f5d7068c4af05783a5c8ce3851b24c4452d (patch)
tree3dc125feded41f15ab3b18e2a49fd0ada7f533f2 /ber
parent5a1439dcf94bfcd9eac4ae8b9d9ba60a3f7a3419 (diff)
Rename Identifier to Kind
Diffstat (limited to 'ber')
-rw-r--r--ber/class.go14
-rw-r--r--ber/class_test.go4
2 files changed, 9 insertions, 9 deletions
diff --git a/ber/class.go b/ber/class.go
index c2e31b6..b3a0ebf 100644
--- a/ber/class.go
+++ b/ber/class.go
@@ -22,23 +22,23 @@ var classNames = map[Class]string{
func (c Class) String() string { return classNames[c] }
-type Identifier byte
+type Kind byte
const (
- Primitive Identifier = iota << 5
+ Primitive Kind = iota << 5
Constructed
)
// 0010 0000
// 2 0
-const IdentifierMask Identifier = 1 << 5
+const KindMask Kind = 1 << 5
-var identifierNames = map[Identifier]string{
+var kindNames = map[Kind]string{
Primitive: "Primitive",
Constructed: "Constructed",
}
-func (i Identifier) String() string { return identifierNames[i] }
+func (k Kind) String() string { return kindNames[k] }
type Tag byte
@@ -114,8 +114,8 @@ var tagNames = map[Tag]string{
func (t Tag) String() string { return tagNames[t] }
-func Ident(b byte) (Class, Identifier, Tag) {
+func Ident(b byte) (Class, Kind, Tag) {
return Class(b) & ClassMask,
- Identifier(b) & IdentifierMask,
+ Kind(b) & KindMask,
Tag(b) & TagMask
}
diff --git a/ber/class_test.go b/ber/class_test.go
index 8e9a49a..a7b8e1d 100644
--- a/ber/class_test.go
+++ b/ber/class_test.go
@@ -5,8 +5,8 @@ import "fmt"
func ExampleIdent() {
b := []byte{0x60, 0xA1, 0x02, 0x30, 0x0A, 0x80, 0x7E, 0x04}
for _, v := range b {
- c, i, t := Ident(v)
- fmt.Printf("0x%.2X: %v %v %v - 0x%.2X\n", v, c, i, t, byte(t))
+ c, k, t := Ident(v)
+ fmt.Printf("0x%.2X: %v %v %v - 0x%.2X\n", v, c, k, t, byte(t))
}
// Output:
// 0x60: Application Constructed End-of-Content - 0x00