Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| netkpikbi [2009/06/30 09:58] – More structure details. RobertWatson | netkpikbi [2009/08/01 11:04] (current) – Downgrade KBI status from immutable to extendable for some global structs due to removal of vinet.h RobertWatson | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| This wiki page attempts to identify kernel data structures which, if changed after a .0 release on a branch, may prevent network device drivers, firewall modules, as well as userland monitoring tools, etc, from working properly. | This wiki page attempts to identify kernel data structures which, if changed after a .0 release on a branch, may prevent network device drivers, firewall modules, as well as userland monitoring tools, etc, from working properly. | ||
| - | ===== Data structure | + | ===== Data structure |
| The following status options exist for each structure: | The following status options exist for each structure: | ||
| Line 22: | Line 22: | ||
| These data structures are used only inside of the kernel or specific modules, and the layout may be changed without (excessive) concern. | These data structures are used only inside of the kernel or specific modules, and the layout may be changed without (excessive) concern. | ||
| + | |||
| + | ===== Key to usage ===== | ||
| + | |||
| + | The following uses are of particular interest from a KPI/KBI perspective: | ||
| + | |||
| + | ^ Abbreviation ^ Description ^ | ||
| + | | MD | Module dereference: | ||
| + | | MA | Module allocation: kernel modules encode size of structure in their implementation, | ||
| + | | SE | Sysctl export: the data structure is exposed to userspace via the sysctl(2) system call, and therefore part of the ABI. | | ||
| + | | SC | System call argument: data structure is an argument to a system call. | | ||
| + | | KD | KVM dereference: | ||
| + | | KS | KVM size dependency: userspace monitoring or post-mortem analysis tools encode the length of the structure in their implementation (i.e., due to the struct being allocated in an array in the kernel). | | ||
| ===== sys ===== | ===== sys ===== | ||
| - | | struct mbuf | Immutable | Extreme caution required. | | + | ^ Type ^ Status ^ MD ^ MA ^ SE ^ SC ^ KD ^ KS ^ Comments ^ |
| - | | struct sockopt | Immutable | Allocated on the stack in kernel modules. | | + | | struct mbuf | Immutable |
| - | | struct sockaddr | Immutable | Allocated statically, embedded in kernel structures, and part of the system call ABI. | | + | | struct sockopt | Immutable |
| - | | struct unpcb | Immutable | Allocated only by uipc_usrreq.c, | + | | struct sockaddr | Immutable |
| - | | struct xsocket | Immutable | Exposed explicitly via sysctl to userspace. | | + | | struct unpcb | Immutable |
| - | | struct xunpcb | Immutable | Allocated only by uipc_usrreq.c, | + | | struct xsocket | Immutable |
| + | | struct xunpcb | Immutable | ||
| ===== net ===== | ===== net ===== | ||
| Line 45: | Line 58: | ||
| ^ Type ^ Status ^ Comments ^ | ^ Type ^ Status ^ Comments ^ | ||
| - | | struct in_addr | | | | + | | struct in_addr | Immutable |
| - | | struct in_ifaddr | | | | + | | struct in_ifaddr | Extendable |
| | struct inpcb | Padded | Allocated from a number of zones, depending on protocol type; exposed explicitly to userspace via xinpcb, xtcpcb via sysctl. | | struct inpcb | Padded | Allocated from a number of zones, depending on protocol type; exposed explicitly to userspace via xinpcb, xtcpcb via sysctl. | ||
| - | | struct inpcbinfo | Immutable | + | | struct inpcbinfo | Extendable |
| - | | struct ipq | | | | + | | struct ipq | Extendable |
| - | | struct | + | | struct |
| | struct sockaddr_in | Immutable | Allocated statically and part of the system call ABI; embedded in other data structures. | | | struct sockaddr_in | Immutable | Allocated statically and part of the system call ABI; embedded in other data structures. | | ||
| | struct syncache | Extendable | Currently allocated/ | | struct syncache | Extendable | Currently allocated/ | ||
| - | | struct syncache_head | | + | | struct syncache_head |
| | struct tcp_hostcache | Extendable | Currently allocated/ | | struct tcp_hostcache | Extendable | Currently allocated/ | ||
| - | | struct tcpcb | | | | + | | struct tcpcb | Immutable |
| - | | struct | + | | struct |
| - | | struct | + | | struct |
| + | | struct | ||
| | struct udpdb | Private | Currently allocated and accessed only by UDP/UDP6, but may be accessed via KVM by user monitoring tools in the future. | | | struct udpdb | Private | Currently allocated and accessed only by UDP/UDP6, but may be accessed via KVM by user monitoring tools in the future. | | ||