Traduzione commenti in e if.c
Salve a tutti,
volevo dare un piccolissimo contributo iniziando a tradurre parte del
codice commentato di netsukuku.
Ho tradotto il file "if.c" in italiano, non ho aggiunto commenti dove
non ve ne erano.
Vi allego un file contente solo i commenti con indicato a quale funzione
appartengono, in modo che possiate decidere voi se cestinare o
modificare i sorgenti sul CVS. Non avendo mai partecipato ad un progetto
open source non so esattamente come ci si comporti, per tanto spero
presto di contribuire sempre in maniera più utile a questa comunità.
Un saluto core
/* IT:
* ifs_find_idx: restituisce un puntatore alla struttura dell'interfaccia
* del dispositivo che ha indice uguale a 'dev_idx'.
* 'ifs' è un array che mantiene la lista d'interfaccia e ha 'ifs_n' elementi.
* EN:
* ifs_find_idx: returns the pointer to the interface struct of the
* device which has the index equal to `dev_idx'.
* `ifs' is the array which keeps the interface list and has `ifs_n' elements.
*/
interface *ifs_find_idx(interface *ifs, int ifs_n, int dev_idx)
/* IT:
* ifs_del: rimuove dall'array 'ifs' il dispositivo che è nella posizione di
* 'if_pos'. '*ifs_n" viene poi decrementato.
* EN:
* ifs_del: removes from the `ifs' array the device which is at the
* `if_pos'th position. `*ifs_n' is then decremented.
*/
void ifs_del(interface *ifs, int *ifs_n, int if_pos)
/* IT:
* ifs_del_byname: rimuove dal'array 'ifs' il dispositivo il quale nome
* corrisponde a 'dev_name'
* EN:
* ifs_del_byname: deletes from the `ifs' array the device whose name is equal
* to `dev_name'
*/
void ifs_del_byname(interface *ifs, int *ifs_n, char *dev_name)
/* IT:
* ifs_del_all_name: rimuove dall'array 'ifs' tutte i dispositivi che hanno
* un nome dispositivo che inizia con 'dev_name'. Esempio:
* ifs_del_all_name(ifs, ifs_n, "tun") rimuove tutti i tunnel iifs
* EN:
* ifs_del_all_name: deleted from the `ifs' array all the device which have a
* device name that begins with `dev_name'. For example,
* ifs_del_all_name(ifs, ifs_n, "tun") deletes all the tunnel iifs
*/
void ifs_del_all_name(interface *ifs, int *ifs_n, char *dev_name)
/* IT:
* ifs_get_pos: questa stupida funzione restituisce la posizione della
* struttura nell'array 'ifs' che ha l'elemento del dev_idx uguale al
* 'dev'->dev_idx. L'array 'ifs' ha 'ifs_n' membri.
* Restituisce -1 in caso di mancata corrispondenza
* EN:
* ifs_get_pos: this is a stupid functions which returns the position of the
* struct in the `ifs' array which has the dev_idx element equal to
* `dev'->dev_idx. The `ifs' array has `ifs_n' members.
* If it is not found -1 is returned.
*/
int ifs_get_pos(interface *ifs, int ifs_n, interface *dev)
/* IT:
*
* EN:
* get_dev: It returs the first dev it finds up and sets `*dev_ids' to the
* device's index. On error NULL is returned.
*/
const char *get_dev(int *dev_idx)
/* IT:
* get_all_ifs: riempie l'array 'ifs' con tutte le interfacce di rete
* trovate attive. L'array 'ifs' ha 'ifs_n'# membri
* Restituisce il numero di interfacce inserite.
* EN:
* get_all_ifs: It fills the `ifs' array with all the network interfaces it
* finds up. The `ifs' array has `ifs_n'# members.
* It returns the number of filled interfaces.
*/
int get_all_up_ifs(interface *ifs, int ifs_n)
/* IT:
* set_all_ifs: per tutte le 'ifs_n' interfacce persentu nell'array 'ifs',
* chiama le funzioni 'set_func', passando come argomento ifs[i].dev_name.
* (Tutte le suddette funzioni set_* possono essere usate come 'set_func').
* Esso ritorna la somma di tutti i codici di ritorno di set_func, se il
* valore ritornato è un valore negativo, allora alcune 'set_func' hanno dato
* errore.
* EN:
* set_all_ifs: for all the `ifs_n' interfaces present in the `ifs' array, it
* calls the `set_func' functions, passing as argument ifs[i].dev_name.
* (All the above set_* functions can be used as `set_func').
* It returns the sum of all each return code, of set_func, therefore if it
* returns a negative value, some `set_func' gave an error.
*/
int set_all_ifs(interface *ifs, int ifs_n, int (*set_func)(char *dev))
/* IT:
* if_init_all: Inizializza tutte le interfacce 'ifs_n'# presenti nell'array
* 'ifs'. Se 'if_n' è zero restiuisce e preleva tutte le interfacce
* correntemente attive e le immagazzina in 'new_ifs', aggiornando anche il contatore
* 'new_ifs_n'. Inizialiazza successivamente poi questi.
* Nell'array 'new_ifs', che deve essere delle stesse dimensioni dell'array
* 'ids', immagazzina tutte le interfacce, aggiornando il contatore
* 'new_ifs_n'.
* In caso di errore viene restituito -1.
* EN:
* if_init_all: it initializes all the `ifs_n'# interfaces present in the
* `ifs' array. If `ifs_n' is zero it gets all the current up interfaces and
* stores them in `new_ifs', updating the `new_ifs_n' counter too. Then it
* initializes them.
* In the `new_ifs' array, which must be at least big as the `ids' array, it
* stores all the initialized interfaces, updating the `new_ifs_n' counter.
* On error -1 is returned.
*/
int if_init_all(char *ifs_name[MAX_INTERFACES], int ifs_n,
/* IT:
* set_dev_ip: Assegna l'ip' dato all'interfaccia chiamata 'dev'
* In caso di successo restituisce 0, altimenti -1
* EN:
* set_dev_ip: Assign the given `ip' to the interface named `dev'
* On success 0 is returned, -1 otherwise.
*/
int set_dev_ip(inet_prefix ip, char *dev)
/* IT:
* set_all_dev_ip: setta l'ip' ritornato su tutte le 'if_n'# interfacce
* presenti dell'array 'ifn'.
* In caso di errore restituisce -1.
* EN:
* set_all_dev_ip: it sets the given `ip' to all the `ifs_n'# interfaces
* present in the `ifs' array.
* On error -1 is returned.
*/
int set_all_dev_ip(inet_prefix ip, interface *ifs, int ifs_n)
/* IT:
* get_dev_ip: riceve l'ip correntemente assegnato dell'interfaccia chiamata
* 'dev' e l'immagazzina dentro 'ip'.
* In caso di successo è restituito 0, altrimenti -1.
* EN:
* get_dev_ip: fetches the ip currently assigned to the interface named `dev'
* and stores it to `ip'.
* On success 0 is returned, -1 otherwise.
*/
int get_dev_ip(inet_prefix *ip, int family, char *dev)
/* IT: Tutto il codice riportato qua sotto è stato rippato da
* iproute2/iproute.c.
* Scritto da Alexey Kuznetsov. <kuznet <at> ms2.inr.ac.ru>.
*
* Leggermente modificato
* EN:
* All the code below this point is ripped from iproute2/iproute.c
* written by Alexey Kuznetsov, <kuznet <at> ms2.inr.ac.ru>.
*
* Modified lightly
*/
static int flush_update(void)
_______________________________________________
Netsukuku mailing list
Netsukuku@...
http://lists.dyne.org/mailman/listinfo/netsukuku