summaryrefslogtreecommitdiffhomepage
path: root/zebra
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-08-28 16:45:53 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-09-06 08:14:14 +0900
commit2c6bca5485ea3e7a35d13b2f3202b07a089fb9ab (patch)
tree6f236f93dd26db685bf0729316dd791ff4137481 /zebra
parent06d3e1585e33992bdaf2150171854f3e4fc1ef0c (diff)
zebra/zapi: Use INTERFACE_STATUS for interface status
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zapi.go7
-rw-r--r--zebra/zapi_test.go2
2 files changed, 5 insertions, 4 deletions
diff --git a/zebra/zapi.go b/zebra/zapi.go
index 42243b21..fb5450b7 100644
--- a/zebra/zapi.go
+++ b/zebra/zapi.go
@@ -31,12 +31,13 @@ const (
INTERFACE_NAMSIZ = 20
)
+// Internal Interface Status.
type INTERFACE_STATUS uint8
const (
- INTERFACE_ACTIVE = 0x01
- INTERFACE_SUB = 0x02
- INTERFACE_LINKDETECTION = 0x04
+ INTERFACE_ACTIVE INTERFACE_STATUS = 0x01
+ INTERFACE_SUB INTERFACE_STATUS = 0x02
+ INTERFACE_LINKDETECTION INTERFACE_STATUS = 0x04
)
type LINK_TYPE uint32
diff --git a/zebra/zapi_test.go b/zebra/zapi_test.go
index 59d15ac3..7763043f 100644
--- a/zebra/zapi_test.go
+++ b/zebra/zapi_test.go
@@ -63,7 +63,7 @@ func Test_InterfaceUpdateBody(t *testing.T) {
pos := INTERFACE_NAMSIZ
binary.BigEndian.PutUint32(buf[pos:], 1)
pos += 4
- buf[pos] = INTERFACE_ACTIVE
+ buf[pos] = byte(INTERFACE_ACTIVE)
pos += 1
binary.BigEndian.PutUint64(buf[pos:], 1)
pos += 8 // flags