Skip to contentSkip to conversation

how to interpret C statement?

DISCUSSION linux lover 2 participants 2 messages Jun 8, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

how to interpret following C statement?
#define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0]))
what is use of tcp_skb_cb structure in kernel source tcp.h? how TCP_SKB_CB(skb) is translated in its definition? regards,
linux_lover

---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

#1 lore raw

Easy. skb-cb used to keep struct tcp_skb_cb. Statement in your question do casting and return pointer to the structure.

Quoted 14 lines · linux lover

how to interpret following C statement?
#define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0]))
what is use of tcp_skb_cb structure in kernel source tcp.h? how TCP_SKB_CB(skb) is translated in its definition? regards, linux_lover

---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger