summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/constant.go
diff options
context:
space:
mode:
authorSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2017-06-19 16:25:20 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-07-10 15:39:14 +0900
commit15cd58e01f47357be5280ef6aa0775f42b811854 (patch)
treee18aecb1b9f23e9cc906a8084b3d8e235880a594 /packet/bgp/constant.go
parentcbabf5aa1cddff4754adec4d5e78a4aa3391c46a (diff)
const: Rename TcpFlagOp to BitmaskFlagOp
This flag format is not only used for "tcp-flag" field, but also "fragment" field. To express the above, this patch renames the format. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Diffstat (limited to 'packet/bgp/constant.go')
-rw-r--r--packet/bgp/constant.go36
1 files changed, 18 insertions, 18 deletions
diff --git a/packet/bgp/constant.go b/packet/bgp/constant.go
index faa156e1..2cee1f31 100644
--- a/packet/bgp/constant.go
+++ b/packet/bgp/constant.go
@@ -128,30 +128,30 @@ var TCPFlagValueMap = map[string]TCPFlag{
TCPFlagNameMap[TCP_FLAG_ECE]: TCP_FLAG_ECE,
}
-type TCPFlagOp int
+type BitmaskFlagOp int
const (
- TCP_FLAG_OP_OR = 0x00
- TCP_FLAG_OP_AND = 0x40
- TCP_FLAG_OP_END = 0x80
- TCP_FLAG_OP_NOT = 0x02
- TCP_FLAG_OP_MATCH = 0x01
+ BITMASK_FLAG_OP_OR = 0x00
+ BITMASK_FLAG_OP_AND = 0x40
+ BITMASK_FLAG_OP_END = 0x80
+ BITMASK_FLAG_OP_NOT = 0x02
+ BITMASK_FLAG_OP_MATCH = 0x01
)
-var TCPFlagOpNameMap = map[TCPFlagOp]string{
- TCP_FLAG_OP_OR: " ",
- TCP_FLAG_OP_AND: "&",
- TCP_FLAG_OP_END: "E",
- TCP_FLAG_OP_NOT: "!",
- TCP_FLAG_OP_MATCH: "=",
+var BitmaskFlagOpNameMap = map[BitmaskFlagOp]string{
+ BITMASK_FLAG_OP_OR: " ",
+ BITMASK_FLAG_OP_AND: "&",
+ BITMASK_FLAG_OP_END: "E",
+ BITMASK_FLAG_OP_NOT: "!",
+ BITMASK_FLAG_OP_MATCH: "=",
}
-var TCPFlagOpValueMap = map[string]TCPFlagOp{
- TCPFlagOpNameMap[TCP_FLAG_OP_OR]: TCP_FLAG_OP_OR,
- TCPFlagOpNameMap[TCP_FLAG_OP_AND]: TCP_FLAG_OP_AND,
- TCPFlagOpNameMap[TCP_FLAG_OP_END]: TCP_FLAG_OP_END,
- TCPFlagOpNameMap[TCP_FLAG_OP_NOT]: TCP_FLAG_OP_NOT,
- TCPFlagOpNameMap[TCP_FLAG_OP_MATCH]: TCP_FLAG_OP_MATCH,
+var BitmaskFlagOpValueMap = map[string]BitmaskFlagOp{
+ BitmaskFlagOpNameMap[BITMASK_FLAG_OP_OR]: BITMASK_FLAG_OP_OR,
+ BitmaskFlagOpNameMap[BITMASK_FLAG_OP_AND]: BITMASK_FLAG_OP_AND,
+ BitmaskFlagOpNameMap[BITMASK_FLAG_OP_END]: BITMASK_FLAG_OP_END,
+ BitmaskFlagOpNameMap[BITMASK_FLAG_OP_NOT]: BITMASK_FLAG_OP_NOT,
+ BitmaskFlagOpNameMap[BITMASK_FLAG_OP_MATCH]: BITMASK_FLAG_OP_MATCH,
}
type DECNumOp int