Commit 9517ed96 authored by Alexis de Lattre's avatar Alexis de Lattre

ALL : translated into english the parameters and comments.

parent ddd8491b
[global]
ttl=15
[programme]
nom=M6
[program]
name=M6
user=videolan
machine=vlcs.via.ecp.fr
site=www.videolan.org
adresse=239.255.12.12
address=239.255.12.12
[programme]
nom=France 2 [Test]
[program]
name=France 2 [Test]
user=videolan
machine=vlcs.via.ecp.fr
site=www.videolan.org
adresse=239.255.12.13
address=239.255.12.13
[programme]
nom=NXTV
[program]
name=NXTV
user=videolan
machine=vlcs.via.ecp.fr
site=www.videolan.org
adresse=239.239.66.66
address=239.239.66.66
......@@ -6,7 +6,7 @@
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr>
*
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
......@@ -28,7 +28,7 @@
#include <arpa/inet.h>
#include <time.h>
#include <string.h>
#include <stdlib.h> // atoi
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <stdio.h>
......@@ -44,17 +44,16 @@ unsigned int ttl=10;
struct prog
{
char nom[16];
char name[16];
char user[16];
char machine[128];
char site[128];
char adresse[128];
char address[128];
prog *Next;
prog *Prev;
};
// Classe de gestion de la liste chaine
class itemlist {
protected :
unsigned long nbr;
......@@ -95,7 +94,6 @@ void itemlist::add(prog *itemp)
nbr++;
}
// Renvoie ce qui vient aprs dlim dans source et le met dans dest
void strgeta(char *source,char *dest,char delim)
{
unsigned long i=0,j=0;
......@@ -120,7 +118,7 @@ void strgeta(char *source,char *dest,char delim)
/********************************************************************
Lit le fichier de config et remplit la liste des programmes
Read the configuration file and fill the program list
*********************************************************************/
int parse(char *path,itemlist *progs)
{
......@@ -129,9 +127,9 @@ int parse(char *path,itemlist *progs)
char tligne[1024];
prog * pp=new prog;
unsigned int something=0;
fichier=fopen(path,"r");
if(!fichier)
if(!fichier)
{
printf("Unable to open %s\n",path);
return(-1);
......@@ -147,7 +145,7 @@ int parse(char *path,itemlist *progs)
}
if(strstr(ligne,"ttl=")) {strgeta(ligne,tligne,'=');ttl=atoi(tligne);}
if(strstr(ligne,"[programme]"))
if(strstr(ligne,"[program]"))
{
if(something)
{
......@@ -156,12 +154,12 @@ int parse(char *path,itemlist *progs)
something=0;
}
}
if(strstr(ligne,"nom="))
if(strstr(ligne,"name="))
{
strgeta(ligne,tligne,'=');
something=1;
strcpy(pp->nom,tligne);
strcpy(pp->name,tligne);
}
if(strstr(ligne,"user="))
......@@ -185,10 +183,10 @@ int parse(char *path,itemlist *progs)
strcpy(pp->site,tligne);
}
if(strstr(ligne,"adresse="))
if(strstr(ligne,"address="))
{
strgeta(ligne,tligne,'=');
something=1;strcpy(pp->adresse,tligne);
something=1;strcpy(pp->address,tligne);
}
}
......@@ -196,7 +194,7 @@ int parse(char *path,itemlist *progs)
return(0);
}
// Fonction principale
// Main function
int main(int argc, char *argv[])
{
struct sockaddr_in addr;
......@@ -212,7 +210,7 @@ int main(int argc, char *argv[])
itemlist *progs=new itemlist;
printf("SapSend.\n");
sprintf(conffile,DEFAULT_CONF);
// Parse the command line
sprintf(getopt_string,"c:d");
while(result !=-1)
......@@ -236,7 +234,7 @@ int main(int argc, char *argv[])
exit(1);
}
/* set up destination address */
// set up destination address
memset(&addr,0,sizeof(addr));
addr.sin_family=AF_INET;
addr.sin_addr.s_addr=inet_addr(HELLO_GROUP);
......@@ -252,9 +250,9 @@ int main(int argc, char *argv[])
// Navigate through programs
while(pp!=NULL)
{
if(!strlen(pp->nom) || !strlen(pp->adresse))
if(!strlen(pp->name) || !strlen(pp->address))
{
printf("Error, incomplete program info (no name or no adress)\n");
printf("Error, incomplete program info (no name or no address)\n");
pp=pp->Next;
exit(1);
}
......@@ -267,10 +265,10 @@ int main(int argc, char *argv[])
a=type:test \n\
m=audio 1234 udp 14 \n\
c=IN IP4 %s/15 \n\
xxxxxxxxxxxxxxxxxxxxx \n ",pp->user,pp->machine,pp->nom, \
pp->site,pp->adresse);
// Send it through the socket
xxxxxxxxxxxxxxxxxxxxx \n ",pp->user,pp->machine,pp->name, \
pp->site,pp->address);
// Send it through the socket
if (sendto(fd,message,strlen(message),0, \
(struct sockaddr *) &addr,sizeof(addr)) < 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment