Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
project_TRTP
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Conditions générales et politique de confidentialité
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Samuel de Meester de Ravestein
project_TRTP
Validations
3969d78a
Valider
3969d78a
rédigé
3 years ago
par
Vany Ingenzi
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Intercepting FEC packets
parent
d3ed91a0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/packet_interface.c
+1
-1
1 ajout, 1 suppression
src/packet_interface.c
src/receiver_utils.c
+15
-10
15 ajouts, 10 suppressions
src/receiver_utils.c
avec
16 ajouts
et
11 suppressions
src/packet_interface.c
+
1
−
1
Voir le fichier @
3969d78a
...
...
@@ -74,7 +74,7 @@ pkt_status_code pkt_decode_data_fec(const char *data, const size_t len, pkt_t *p
if
(
length
>
0
)
expected_len
+=
CRC_SIZE
;
if
(
len
!=
expected_len
)
if
(
len
!=
expected_len
&&
type
!=
PTYPE_FEC
)
return
E_UNCONSISTENT
;
// We set the TR to 0 in order to calculcate the CRC on the header
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/receiver_utils.c
+
15
−
10
Voir le fichier @
3969d78a
...
...
@@ -210,6 +210,13 @@ int prepare_ack_to_send(receiver_state_t * state)
int
handle_fec_pkt
(
receiver_state_t
*
state
,
const
pkt_t
*
pkt
)
{
ASSERT
(
state
!=
NULL
&&
pkt
!=
NULL
);
if
(
state
->
last_received_in_order
>
pkt_get_seqnum
(
pkt
))
{
DEBUG
(
"Received FEC with seqnum %d but wasn't used since last received in order is %d"
,
pkt_get_seqnum
(
pkt
),
state
->
last_received_in_order
);
return
0
;
}
// Add FEC to state buffer of fec
// See if there's FEC that can be used and update buffer
return
0
;
}
...
...
@@ -224,6 +231,9 @@ int handle_fec_pkt(receiver_state_t * state, const pkt_t * pkt)
*/
int
handle_data_pkt
(
receiver_state_t
*
state
,
const
pkt_t
*
pkt
)
{
DEBUG
(
"Received data packet seqnum %d with timestamp %d | current_window_size : %d, current_window_start : %d"
,
pkt_get_seqnum
(
pkt
),
pkt_get_timestamp
(
pkt
),
state
->
curr_recv_window
,
state
->
recv_window_start
);
if
(
update_buffer_upon_new_data
(
state
,
pkt
)
!=
0
)
return
-
1
;
if
(
prepare_ack_to_send
(
state
)
!=
0
)
return
-
1
;
...
...
@@ -297,9 +307,6 @@ int handle_truncated_pkt(receiver_state_t * state, const pkt_t * pkt)
*/
int
handle_valid_pkt
(
receiver_state_t
*
state
,
const
pkt_t
*
pkt
)
{
// Feck - Not handled for now
if
(
pkt_get_type
(
pkt
)
!=
PTYPE_DATA
)
return
0
;
// Is it in the receive_window ?
uint8_t
seqnum
=
pkt_get_seqnum
(
pkt
);
int
in_window
=
(
seqnum
>=
state
->
recv_window_start
);
...
...
@@ -318,15 +325,16 @@ int handle_valid_pkt(receiver_state_t * state, const pkt_t * pkt)
uint8_t
tr
=
pkt_get_tr
(
pkt
);
if
(
tr
==
1
)
{
/* If truncated
*/
{
/* If truncated */
return
handle_truncated_pkt
(
state
,
pkt
);
}
else
if
(
pkt_get_type
(
pkt
)
==
PTYPE_DATA
)
{
/*
Not
*/
{
/*
Type DATA
*/
return
handle_data_pkt
(
state
,
pkt
);
}
else
if
(
pkt_get_type
(
pkt
)
==
PTYPE_FEC
)
{
{
/* Type FEC */
return
handle_fec_pkt
(
state
,
pkt
);
}
return
0
;
}
...
...
@@ -355,14 +363,11 @@ int handle_incoming(struct pollfd * pfd, receiver_state_t * state)
pkt_status_code
pkt_status
=
pkt_decode
(
buffer
,
read_bytes
,
pkt
);
if
(
pkt_status
==
0
)
{
DEBUG
(
"Received packet seqnum %d with timestamp %d | current_window_size : %d, current_window_start : %d"
,
pkt_get_seqnum
(
pkt
),
pkt_get_timestamp
(
pkt
),
state
->
curr_recv_window
,
state
->
recv_window_start
);
if
(
handle_valid_pkt
(
state
,
(
const
pkt_t
*
)
pkt
)
!=
0
)
return
-
1
;
}
else
{
/* If the packet has been damaged we can discuss if it's better to send a ACK
or not but for now we just ignore it */
DEBUG
(
"Received a damaged packet with %d status."
,
pkt_status
);
// See if there's a FEC that can be used and update buffer
pkt_del
(
pkt
);
return
prepare_ack_to_send
(
state
);
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter