c - Mac OS X: How is the tcpcb struct of a TCP connection obtained by a kernel extension? -
i want provide user space function obtains tcp connection stats implementing kernel extension. examining tcp source, see tcpcp struct holds such stats. how can i, given socket handle user space, obtain associated tcpcb struct via kernel extension , return stats user space?
direct answer question: believe can't @ information kext without using private headers memory layout of structs involved. break if/when apple changes layout of structs.
however, looks don't care kext aspect , happy information userspace, have investigated tcpctl_pcblist sysctl? gives cbs tcp connections in system, , xtcpcb64 struct contain fields you're after. mechanism might not granular enough purposes though.
Comments
Post a Comment