1

Update my issue with more details provided below :

Summary of the ng_tag Command Issue

Querying BPF Filter Status

When using Berkeley Packet Filter (BPF) filters, you can use the getstats command to retrieve filter statistics. Here are some examples:

# Query filter statistics
ngctl msg bpf: getstats "filter"
Rec'd response "getstats" (3) from "[4]:":
Args:   { recvFrames=3 recvOctets=165 recvMatchFrames=1 recvMatchOctets=55 xmitFrames=3 xmitOctets=165 }

# Query matched filter statistics
ngctl msg bpf: getstats "matched"
Rec'd response "getstats" (3) from "[4]:":
Args:   { recvFrames=1 recvOctets=55 recvMatchFrames=1 recvMatchOctets=55 xmitFrames=1 xmitOctets=55 }

These outputs are similar to the examples you mentioned from the Russian website.

Querying Tag Hook Status

When setting up tag hooks, you expect to view the tag hook status. Here are some examples:

# View bpf filter hook status
ngctl show bpf
Name: bpf             Type: bpf             ID: 00000004   Num hooks: 2
Local hook      Peer name       Peer type    Peer ID         Peer hook
----------      ---------       ---------    -------         ---------
matched         tag             tag          00000007        tag_bad
filter          ipfw            ipfw         00000001        41

# View tag filter hook status
ngctl show tag
Name: tag             Type: tag             ID: 00000007   Num hooks: 1
Local hook      Peer name       Peer type    Peer ID         Peer hook
----------      ---------       ---------    -------         ---------
tag_bad         bpf             bpf          00000004        matched

Querying Tag Hook In and Hook Out

When configuring tag hookin and hookout, you can get the following responses:

# Query tag_bad hookin status
ngctl msg tag: gethookin "tag_bad"
Rec'd response "gethookin" (2) from "[7]:":
Args:   { thisHook="tag_bad" ifNotMatch="tag_bad" }

# Query tag_bad hookout status
ngctl msg tag: gethookout "tag_bad"
Rec'd response "gethookout" (4) from "[7]:":
Args:   { thisHook="tag_bad" tag_cookie=1148380143 tag_id=412 }

Querying Tag Statistics Issue

When you attempt to query tag statistics, you encounter the following error message:

# Attempt to query tag_bad statistics
ngctl msg tag: getstats "tag_bad"
ngctl: send msg: Function not implemented

This could be due to a syntax issue or incorrect parameter configuration. Currently, there is no suitable reference in the ng_tag documentation, and no relevant discussions were found online. As such, you might need to consult further documentation or seek help from the community to resolve this issue.

Thank you for your patience. This is the summary of the ng_tag command issue. If you need more details or further assistance, please let me know.


I came across some testing content about ng_ipfw and ng_bpf on a website (Russian). In it, I found a debug command ngctl msg dns_mx_q_filter: getstats \"main\", which reminded me that the ng_tag also has a similar getstats command.

However, when I tried using ngctl <path>: getstats \"<hook>\" in the same way, it didn't seem to work properly. I'm wondering if anyone else has used the same command or if there are any other references or resources available that could help.

Looking forward to your responses!

2
  • Can you describe how it failed? What output did you get? What were you expecting? I admit I don't know anything about this, but the more detail you add, the better the chances someone else might be able to help.
    – terdon
    Commented May 22 at 10:57
  • OK, thanks your comment.
    – HsingLI
    Commented May 23 at 4:47

0

You must log in to answer this question.

Browse other questions tagged .