Explorer les Livres électroniques
Catégories
Explorer les Livres audio
Catégories
Explorer les Magazines
Catégories
Explorer les Documents
Catégories
Exercice 1 : C
Internet et github sont autorisés.
Écrire un programme en C à l’aide de libev (ou libevent2) afin de créer un client/serveur avec
UDP comme transport. Le client devra envoyer un tableau d’entier (16 bits) aléatoire et de
longueur aléatoire variant de 10 à 20 entier au serveur. Ce dernier devra trier le tableau et
afficher le résultat. Un script de compilation (Makefile ou un simple script bash) est attendu.
Envoyer le résultat de votre travail dans une archive au format .tar.gz.
http://software.schmorp.de/pkg/libev.html
https://libevent.org/
https://github.com/solderjs/libev-examples/blob/master/src/udp-echo-server.c
https://linux.die.net/man/3/ev
http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod
Durée totale : 2h
Exercice 2 : C
Internet est autorisé.
struct s1 {
int i;
float f;
struct s1 s;
};
int f1(){
return (int) printf("Kikoo mon kikoo");
}
void f2(int (*f)()){
if(f){
(*f)();
}
}
int main(){
int (*fff)();
fff = f1;
f2(fff);
return (int) 0;
}
Durée totale : 2h
□ 3 5 7 9 11
□ 2 15 6 8 10
□ 7 9 11 13 15
□ 2 4 6 9 15
Durée totale : 2h
0000 36 65 37 63 65 64 00 10 db ff 10 00 08 00 45 68
0010 00 78 d5 cf 40 00 fb 84 f0 c5 c2 d9 af e1 b4 3d
0020 5c e7 10 ba 16 53 78 ec 06 5e 4a ac 94 45 00 03
0030 00 58 00 00 69 44 00 01 04 4c 00 00 00 03 01 00
0040 01 01 00 00 00 48 02 10 00 3d 00 00 16 53 00 00
0050 10 ba 03 00 00 0d 09 80 03 0e 19 0b 12 08 00 12
0060 04 62 62 93 03 99 09 0b 12 08 00 12 04 23 30 10
0070 21 00 68 0f 64 0d 49 04 30 0f 69 c9 6c 05 a2 03
0080 02 01 01 00 00 00
Annexes :
https://en.wikipedia.org/wiki/IEEE_802.3
https://en.wikipedia.org/wiki/Ethernet_frame
https://en.wikipedia.org/wiki/Transmission_Control_Protocol
https://en.wikipedia.org/wiki/User_Datagram_Protocol
https://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol
https://www.iana.org/assignments/sctp-parameters/sctp-parameters.xhtml
https://tools.ietf.org/html/rfc4960
https://tools.ietf.org/html/rfc793
https://tools.ietf.org/html/rfc768