chore: using uint16 for ports in Metadata

This commit is contained in:
wwqgtxx
2023-08-09 13:51:02 +08:00
parent bad9f2e6dc
commit e2e0fd4eba
16 changed files with 84 additions and 79 deletions

View File

@ -20,7 +20,7 @@ func TestAND(t *testing.T) {
m, _ := and.Match(&C.Metadata{
Host: "baidu.com",
NetWork: C.TCP,
DstPort: "20000",
DstPort: 20000,
})
assert.Equal(t, true, m)
@ -35,7 +35,7 @@ func TestNOT(t *testing.T) {
not, err := NewNOT("((DST-PORT,6000-6500))", "REJECT", ParseRule)
assert.Equal(t, nil, err)
m, _ := not.Match(&C.Metadata{
DstPort: "6100",
DstPort: 6100,
})
assert.Equal(t, false, m)