Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| summerofcode2020projects:networkconfigurationlibraries [2020/08/30 08:38] – AhsanBarkati | summerofcode2020projects:networkconfigurationlibraries [2021/06/13 19:15] (current) – Formatting fix ChristosMargiolis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Network Configuration Libraries ====== | ====== Network Configuration Libraries ====== | ||
| - | * Student: | + | * Student: [[/ |
| - | * Mentors: | + | * Mentors: |
| - | * [[/ | + | * [[/ |
| - | * [[/ | + | * [[/ |
| ===== The Code ===== | ===== The Code ===== | ||
| Line 9: | Line 9: | ||
| https:// | https:// | ||
| - | ===== Differential revisions | + | ===== Revisions |
| ^ Differential | ^ Differential | ||
| Line 20: | Line 20: | ||
| ===== Libroute ===== | ===== Libroute ===== | ||
| - | Manual manipulation of the network routing tables is generally achieved by the /sbin/route utility. It provides functionality to add, flush, change, show the routes along with optional modifiers which enable setting some initial parameters to the routes such as RTT, MTU etc. This project aims to create a library which brings in a method to programmatically manage the routing. This library will allow addition of the routes to the FIB and also a method to change a particular route, delete a route or even flush the whole routing table. | + | Manual manipulation of the network routing tables is generally achieved by the '' |
| ===== Status of libroute ===== | ===== Status of libroute ===== | ||
| Line 28: | Line 28: | ||
| * The man page for libroute can be found [[https:// | * The man page for libroute can be found [[https:// | ||
| - | The general design of libroute is primarily characterized by the use of a handle. The library provides a method to get a libroute handle (via the libroute_open() API) and all the functionalities of the library is accessed by making use of this handle. The handle stores the FIB number on which it will operate and the socket that it will use to communicate with the kernel. At any point of time, this FIB number can be modified using the libroute_setfib() API. At the end this handle needs to be closed and this will free the memory held by the handle. There are various functions that this library provides: | + | The general design of libroute is primarily characterized by the use of a handle. The library provides a method to get a libroute handle (via the '' |
| - | * libroute_modify() | + | * '' |
| - | * libroute_add() | + | * '' |
| - | * libroute_change() | + | * '' |
| - | * libroute_delete() | + | * '' |
| - | * libroute_get() | + | * '' |
| Example usage of library: | Example usage of library: | ||
| Line 44: | Line 44: | ||
| main() | main() | ||
| { | { | ||
| + | rt_handle *h; | ||
| struct sockaddr *sa_dest, *sa_gateway; | struct sockaddr *sa_dest, *sa_gateway; | ||
| int defaultfib, error; | int defaultfib, error; | ||
| Line 52: | Line 53: | ||
| // Open the libroute handle | // Open the libroute handle | ||
| - | rt_handle *h = libroute_open(defaultfib); | + | h = libroute_open(defaultfib); |
| - | if(h == NULL) | + | if (h == NULL) |
| printf(" | printf(" | ||
| Line 65: | Line 66: | ||
| // add the new route | // add the new route | ||
| error = libroute_add(h, | error = libroute_add(h, | ||
| - | if(error == -1 ){ | + | if (error == -1 ) |
| - | printf(" | + | printf(" |
| - | | + | |
| + | | ||
| return (0); | return (0); | ||
| Line 81: | Line 83: | ||
| ==== Bugs ==== | ==== Bugs ==== | ||
| - | * modification | + | * Modification |
| - | * Scope of buffer overflow in fill_so() function | + | * Scope of buffer overflow in '' |
| ==== Testing ==== | ==== Testing ==== | ||