-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Enrich addr info with remote addr info #684
Conversation
Compared with remote/local ip/port, the expression of src/dest ip/port is more in line with the usage scenario requirements. Can the information output be designed according to the src_ip:src_port-dest_ip:dest_port format? |
Can. But unnecessary, because of performance consideration. As @cfc4n WDYT? |
as log |
Yes, it is the expected format, but compared with local-remote, the source -destination format is more suitable for most business scenarios. The current format can also meet the requirements, we will consider the business layer and make the difference between source and destination. Thanks very much for the contribution. |
Add a direction field to indicate whether the session is initiated by the local . For example, 0: accept, indicating passive acceptance of the connection, and 1: connect, indicating that the host initiates the request. Whether this solution can be accepted? AddConn success fd=5 pid=113767 direction=accept/connect tuple=192.168.241.133:37736-172.217.194.113:443 |
It's unacceptable for me. However, it's easier to provide saddr:sport-daddr:dport than direction. |
9d5ae59
to
019048a
Compare
It is able to get full 5-tuple info when hooking `connect` and `accept` syscalls with format `saddr:sport-daddr-dport` always. ```bash $ sudo ./bin/ecapture tls -d ... 2024-12-08T16:44:24Z DBG AddConn success fd=5 pid=113767 tuple=192.168.241.133:37736-172.217.194.113:443 2024-12-10T05:08:04Z DBG AddConn success fd=4 pid=121587 tuple=192.168.241.1:54587-192.168.241.133:8080 ... ``` Signed-off-by: Leon Hwang <hffilwlqm@gmail.com>
019048a
to
092818b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks.
It is able to get full 5-tuple info when hooking
connect
andaccept
syscalls with formatsaddr:sport-daddr-dport
always.See #682 to get more context.
See eBPF Talk: 在 bpf 里将 fd 和 sock 关联起来 for design ideas and technical implementation.