Skip to content
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

Add nfq_get_packet_hw please #7

Closed
sir-go opened this issue May 19, 2017 · 0 comments
Closed

Add nfq_get_packet_hw please #7

sir-go opened this issue May 19, 2017 · 0 comments

Comments

@sir-go
Copy link

sir-go commented May 19, 2017

I maked these...

// Returns the packet HW address
func (p *Payload) GetSrcHwAddr() []byte {
    hwInfo := C.nfq_get_packet_hw(p.nfad)
    addrl := int(C.ntohs(C.uint16_t(hwInfo.hw_addrlen)))
    res := make([]byte, addrl)
    for i := 0; i < addrl; i++  {
        res[i] = byte(hwInfo.hw_addr[i])
    }
    return res
}
@sir-go sir-go closed this as completed May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant