Feature #41

Provide a method for configuring network interfaces from userspace

Added by Matthew Iselin over 2 years ago. Updated 10 months ago.

Status:New Start:08/17/2009
Priority:Normal Due date:
Assigned to:Matthew Iselin % Done:

0%

Category:Native Spent time: -
Target version:-

Description

I'd like to see an ifconfig-like program to configure network interfaces live, and to view their IP configuration (so you know their IP on the network).

History

Updated by Eduard Burtescu over 2 years ago

  • Category set to Native

Updated by Matthew Iselin 10 months ago

The "best way" for this to be done would be:
  1. Implement a new pedigree-c system call, pedigree_get_net_info, that takes an integer parameter and a pointer to a block of memory. The system call will fill in the given block of memory with a known structure containing the IP addresses and statistics for the network interface (where 0 is the first network device in the system, 1 is the next, and so on).
  2. Implement a wrapper in the native subsystem that provides a decent way of accessing the data in that block of memory (and ideally hides the fact that a block of memory is passed around). It's probably prudent to use inet_* functions here to convert IPv4 addresses from 32-bit integers to their string representation, rather than attempting to bring IpAddress from the kernel across (as it would need to be maintained).
  3. Implement a program in userspace which uses the native wrapper to get network information about network cards in the system. Perhaps it should take a parameter that shows just one card, and if no parameters are given, it enumerates every card and displays all of them.

The status-server module dumps information about network interfaces via HTTP. This is at src/modules/system/status_server. It might be a good place to start to figure out how to get the information about network interfaces for converting into a pedigree-c system call.

Also available in: Atom PDF