Commit 33777c91dc6b7ab89a21b08009ab2aa6d00b33f5

Authored by skhinach
1 parent 0f1eb4c5

Test

Network/Makefile
... ... @@ -16,7 +16,7 @@ LDFLAGS=-lpthread -lpcap
16 16 all: $(LIB)
17 17  
18 18 $(LIB): sender.o sniffer.o tcpserver.o
19   - rm -f $@
  19 + rm -f $(LDIR)$@
20 20 $(CLIBS) $(LDIR)$@ $^
21 21 ranlib $(LDIR)$@
22 22 rm -f *.o
... ...
Sioux/Tableau.css 100644 → 100755
... ... @@ -53,7 +53,12 @@ li
53 53  
54 54 .etat
55 55 {
56   - flex-basis: 60%;
  56 + flex-basis: 30%;
  57 +}
  58 +
  59 +.commande
  60 +{
  61 + flex-basis: 30%;
57 62 }
58 63  
59 64 .no_inter
... ...
Sioux/http.c 100644 → 100755
1 1 #include "http.h"
2   -
  2 +#include <stdlib.h>
3 3  
4 4 void freePage(struct PageWeb** page)
5 5 {
... ... @@ -76,7 +76,7 @@ void createPage(struct PageWeb** page, struct interface_info* interfaces[20])
76 76 }
77 77  
78 78 strcat((*page)->html_contents,"</head><body><div class=\"container\"><h2>Interfaces Tangibles</h2><ul class=\"tableau\">");
79   - strcat((*page)->html_contents,"<li class=\"table-entete\"><div class=\"col nom\">Interfaces</div><div class=\"col etat\">Etat</div></li>");
  79 + strcat((*page)->html_contents,"<li class=\"table-entete\"><div class=\"col nom\">Interfaces</div><div class=\"col etat\">Etat</div><div class=\"col commande\">Commande</div></li>");
80 80  
81 81 int nbr_interfaces=0;
82 82  
... ... @@ -101,9 +101,22 @@ void createPage(struct PageWeb** page, struct interface_info* interfaces[20])
101 101 case(1):
102 102 strcat((*page)->html_contents,"</div>\n<div class=\"col etat\" style=\"color: green\" data-label=\"Etat\">Mode Eveillé</div>\n");
103 103 break;
  104 + }
  105 + if(interfaces[i]->commande>=0)
  106 + {
  107 + char tmp[10];
  108 + sprintf(tmp, "%d", interfaces[i]->commande);
  109 + strcat((*page)->html_contents,"<div class=\"col commande\" data-label=\"Etat\">");
  110 + strcat((*page)->html_contents,tmp);
  111 + strcat((*page)->html_contents,"%</div>\n");
  112 + }
  113 + else
  114 + {
  115 + strcat((*page)->html_contents,"<div class=\"col commande\" style=\"color: grey\" data-label=\"Etat\">Inconnu</div>\n");
104 116 }
105 117 strcat((*page)->html_contents,"</li>");
106 118 }
  119 +
107 120 }
108 121 }
109 122  
... ...
Tangible/#socket.h# 100644 → 100755
Tangible/ethernet.h 100644 → 100755
Tangible/socket.c 100644 → 100755
Tangible/socket.h 100644 → 100755
Tangible/socket.o 100644 → 100755
No preview for this file type
Tangible/spi.h 100644 → 100755
Tangible/tangibleInterface.hex 100644 → 100755
Tangible/tangibleInterface.o 100644 → 100755
No preview for this file type
Tangible/w5100.c 100644 → 100755
Tangible/w5100.h 100644 → 100755
Threads/threadSocket.c
... ... @@ -118,29 +118,24 @@ int interfaceReponse(FILE* sockdial_stream, char packet[BUFF_SIZE], Arg_Thread*
118 118 return -1;
119 119 }
120 120  
121   -
122 121 strcpy(buffer, "\x60\x00"); // Demande la commande en mémoire
123 122  
124 123 fprintf(sockdial_stream, "%s", buffer); // Transmission du message
125 124  
126   -
127 125 fgets(packet, BUFF_SIZE, sockdial_stream); // Attente de reception du message
128   -
129   -
130 126  
131 127 if( strlen(packet)>=2 && (packet[0]&0xE0)==0x10 )
132   - argument->interfaces[i]->commande = (packet[0]&0x01)*256+packet[1];
  128 + argument->interfaces[i]->commande = (packet[0]&0x1F)*256+packet[1];
133 129 else
134 130 {
135 131 argument->interfaces[i]->commande = -1;
136   - return -1; // Si le message n'est pas reçu correctement
  132 + //return -1; // Si le message n'est pas reçu correctement
137 133 }
138 134  
139 135 strcpy(buffer, "\xE0\x00"); // Signale la fin de l'interrogation
140 136  
141   - fprintf(sockdial_stream, "%s", buffer); // Transmission du message
  137 + fprintf(sockdial_stream, "%s", buffer); // Transmission du message
142 138  
143   -
144 139 pthread_mutex_unlock(&(argument->requete_mutex)); // Libération de la section critique
145 140  
146 141 return 0;
... ...
bin/serverTCP 0 → 100755
No preview for this file type
bin/sonde 0 → 100755
No preview for this file type
includes/http.h 100644 → 100755
libs/libnet.a 0 → 100644
No preview for this file type
libs/libthrd.a 0 → 100644
No preview for this file type
src/serverTCP.c 100644 → 100755