Synopsis
- Over eight years ago, the network interface headers were split into net/if.h and net/if_var.h. The intent was for net/if_var.h to be kernel only and net/if.h to contain public interfaces. Today, the internal header, net/if_var.h is still included in many userland applications. In some cases, this is due to interfaces that are not in fact kernel internal. In other cases, these structures are being used in conjunction with libkvm to access kernel information directly. This project would correct both classes of problems, primarily rewriting the netstat(1) command and any other network related libkvm consumers to use alternate interfaces, creating those interfaces if needed. Netstat's coredump analysis features would likely be split into a separate program.
Project Details
- The top level goal of this project would be to remove all references to net/if_var.h in userland (with an exception of those tools that need it in order to parse core dumps.) The first task would be to identify those programs that use the kernel virtual memory interface (libkvm) and for each tool identify if the current ioctl, sysctl, or routing socket interfaces are adequate to provide the information needed by the tools. If they are not, then new interfaces would be created. All the tools using libkvm would be re-written using the new interfaces with some also retaining the ability to analyze core dumps. This feature could either be done in the same program, a separate program, or possibly in kgdb. Where if_var.h and other net*/*var.h files are still needed to be included in userland, special defines, rather than _KERNEL would be introduced to allow inclusion of only the truly necessary parts.
Schedule
Step 1: Identify applications using libkvm
Step 2: Go through applications and determine whether or not new interfaces are needed
Step 3: Design of new interfaces
Step 4: Separation of if_var.h; introduce new interfaces
Step 5: Re-write applications using new interfaces