Giter Club home page Giter Club logo

cilium-ebpf-tc's People

Contributors

georgenicoll avatar

Watchers

 avatar  avatar

Forkers

nobinpegasus

cilium-ebpf-tc's Issues

The code is showing wrong port information

The source port and dest port doesn't match the actual one.
I've cross checked it using wireshark
Look at this image
image

Now look at this. Most of the time. Source port and Dest port are the same in your code

image

Please fix it.

[Feature] I want to also capture the pid info additional to the network infos

SEC("tc_prog")
int tc_main(struct __sk_buff *skb)
{
    void *data_end = (void *)(__u64)skb->data_end;
    void *data = (void *)(__u64)skb->data;
    struct ethhdr *eth;
    struct iphdr *ip;
    struct tcphdr *tcp;
    struct udphdr *udp;
    // int pid = (int) bpf_get_current_pid_tgid() >> 32;
    // if (skb->protocol != bpf_htons(ETH_P_IP))
    //     return TC_ACT_OK;
    __u32 pid = bpf_get_current_pid_tgid() >> 32;
    ```
    I want something like this. I know bpf_get_current_pid_tgid() can be used with ctx. So how should I do the edits?
    So that I can get the pid with the current code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.