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

xfrm lib missing the set/get for if_id #348

Open
Ali-aqrabawi opened this issue Jun 6, 2023 · 0 comments
Open

xfrm lib missing the set/get for if_id #348

Ali-aqrabawi opened this issue Jun 6, 2023 · 0 comments

Comments

@Ali-aqrabawi
Copy link

example of the if_id nlattr:

// if_id attribute
    struct nlattr *if_id = (struct nlattr *) (((char *) crypt_nla) + NLMSG_ALIGN(crypt_nla->nla_len));
    if_id->nla_len = sizeof(struct nlattr) + sizeof(uint32_t);
    if_id->nla_type = XFRMA_IF_ID;

    uint32_t if_index = 43;  // Replace with the actual interface index
    memcpy(((char *) if_id + NLA_HDRLEN), &if_index, sizeof(uint32_t));

sudo ip xfrm state 
src 192.168.2.175 dst 192.168.2.1
	proto esp spi 0x01000000 reqid 123455 mode tunnel
	replay-window 0 
	auth-trunc hmac(sha256) 0x00010000000000000000000000000000 96
	enc cbc(aes) 0x3132333435363738393031323334353637383930313233343536373839303132
	encap type espinudp sport 0 dport 0 addr 192.168.2.1
	anti-replay context: seq 0x0, oseq 0x0, bitmap 0x00000000
	if_id 0x2b <-------
	sel src 0.0.0.0/0 dst 0.0.0.0/0 
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