Help Needed: Issue with ng_ipfw、ng_bpf、ng_tag Testing Commands

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 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!
 
Thank you, and I apologize for not noticing the mistake in the command ngctl <path>: getstats \"<hook>\" mentioned above.
I understand the manual msg ngctl msg <path>: getstats \"<hook>\" , but even though I use the same command as ngctl msg dns_mx_q_filter: getstats \"main\" to check BPF stats, I still encounter the same issue when trying to check the tag nod.

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:

Code:
# 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:

Code:
# 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:

Code:
# 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:

Code:
# 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.
 
Back
Top