Skip to content

Commit

Permalink
Merge pull request #3 from tiiuae/v3_ipv6
Browse files Browse the repository at this point in the history
IPv6 support
  • Loading branch information
mbaddeley authored Dec 18, 2024
2 parents 23323f7 + 637c63b commit 37af5fb
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 156 deletions.
8 changes: 4 additions & 4 deletions builddata.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const char olsrd_version[] = "olsr.org - 0.9.8-git_0000000-hash_2e6da5f3016a727304bd20e4fe4e59c5";
const char olsrd_version[] = "olsr.org - 0.9.8-git_ff6484b-hash_0af2be817338829097a4a3a9bdbb2bbf";

const char git_descriptor[] = "";
const char git_sha[] = "0000000000000000000000000000000000000000";
const char git_descriptor[] = "ff6484b-dirty";
const char git_sha[] = "ff6484b5e1abcec04a5e362ee6378e0b5dca7992";
const char release_version[] = "0.9.8";
const char source_hash[] = "2e6da5f3016a727304bd20e4fe4e59c5";
const char source_hash[] = "0af2be817338829097a4a3a9bdbb2bbf";
Binary file modified qos-olsrd
100644 → 100755
Binary file not shown.
8 changes: 4 additions & 4 deletions src/builddata.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const char olsrd_version[] = "olsr.org - 0.9.8-git_0000000-hash_2e6da5f3016a727304bd20e4fe4e59c5";
const char olsrd_version[] = "olsr.org - 0.9.8-git_ff6484b-hash_0af2be817338829097a4a3a9bdbb2bbf";

const char git_descriptor[] = "";
const char git_sha[] = "0000000000000000000000000000000000000000";
const char git_descriptor[] = "ff6484b-dirty";
const char git_sha[] = "ff6484b5e1abcec04a5e362ee6378e0b5dca7992";
const char release_version[] = "0.9.8";
const char source_hash[] = "2e6da5f3016a727304bd20e4fe4e59c5";
const char source_hash[] = "0af2be817338829097a4a3a9bdbb2bbf";
6 changes: 3 additions & 3 deletions src/cfgparser/oparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */

#ifndef YY_YY_SRC_CFGPARSER_OPARSE_H_TMP_INCLUDED
# define YY_YY_SRC_CFGPARSER_OPARSE_H_TMP_INCLUDED
#ifndef YY_YY_SRC_CFGPARSER_OPARSE_H_INCLUDED
# define YY_YY_SRC_CFGPARSER_OPARSE_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
Expand Down Expand Up @@ -175,4 +175,4 @@ extern YYSTYPE yylval;
int yyparse (void);


#endif /* !YY_YY_SRC_CFGPARSER_OPARSE_H_TMP_INCLUDED */
#endif /* !YY_YY_SRC_CFGPARSER_OPARSE_H_INCLUDED */
24 changes: 9 additions & 15 deletions src/lq_mpr.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,24 @@ olsr_calculate_lq_mpr(void)
/* Found a 1-hop neighbor that we haven't previously selected.
* Use it as MPR only when the 2-hop path through it is better than
* any existing 1-hop path. */
OLSR_PRINTF(1,"The broken cost: %d\n",LINK_COST_BROKEN);
struct ipaddr_str buf;
OLSR_PRINTF(1, "\nNeighbor: %s\nThree hop head: %d\ncost: %d\n", olsr_ip_to_string(&buf, &neigh2->neighbor_2_addr),neigh2->is_2hop, best);

if ((neigh != NULL) && (best < best_1hop)) {
neigh->is_mpr = true;
neigh->skip = true;



if (neigh->is_mpr != neigh->was_mpr)
mpr_changes = true;
break; //It means we have found an mpr so ne need for more checks
}
//this part allows us to select mprs for 3-hop head when there is no cost for the link
// else if(!neigh2->is_2hop) //This is a quick fix to remedy the infinite cost problem
// {
// neigh = neigh2->neighbor_2_nblist.next->neighbor;
// neigh->is_mpr = true;
// neigh->skip = true;
// if (neigh->is_mpr != neigh->was_mpr)
// mpr_changes = true;
// break;//It means we have found an mpr so ne need for more checks
// }
else if(!neigh2->is_2hop) //This is a quick fix to remedy the infinite cost problem
{
neigh = neigh2->neighbor_2_nblist.next->neighbor;
neigh->is_mpr = true;
neigh->skip = true;
if (neigh->is_mpr != neigh->was_mpr)
mpr_changes = true;
break;//It means we have found an mpr so ne need for more checks
}

/* no neighbour found => the requested MPR coverage cannot
* be satisfied => stop */
Expand Down
80 changes: 35 additions & 45 deletions src/lq_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,53 +194,43 @@ void olsr_deserialize_hello_lq_pair(const uint8_t **curr, struct hello_neighbor
{
assert((const char *)neigh + sizeof(*neigh) >= (const char *)neigh->linkquality);
active_lq_handler->deserialize_hello_lq(curr, neigh->linkquality);
olsr_linkcost sampledLC;
if (neigh->status == TWO_HEAD){
neigh->cost = neigh->linkquality[0];
struct ipaddr_str buf;
OLSR_PRINTF(1, "3 hop head: %s\nThe status: %d", olsr_ip_to_string(&buf, &neigh->address),neigh->status);
OLSR_PRINTF(1,"In Plugin- three hop head: %d sampled cost\n",sampledLC);
olsr_linkcost sampledLC = active_lq_handler->calc_hello_cost(neigh->linkquality);

const struct lq_ffeth *lq = neigh->linkquality;

OLSR_PRINTF(1,"In Plugin- Trend: %d, previous cost %d, sampled cost %d, ",lq->valueBandwidth, neigh->cost,sampledLC);

// if the previous cost is 0, set it as the current cost
if (neigh->cost==0){
neigh->cost=sampledLC;
}

// if there's a trend, set the neighbor cost as the current cost
// sampledLC is usually in the range up to 10 or 11 based on the max penalty value of 7 and the LQ cost (converges to 1)
if(lq->valueBandwidth!=0){
neigh->cost = sampledLC;
}
// else if we don't have a trend, degrade the cost gradually
else{
sampledLC = active_lq_handler->calc_hello_cost(neigh->linkquality);


const struct lq_ffeth *lq = neigh->linkquality;

OLSR_PRINTF(1,"In Plugin- Trend: %d, previous cost %d, sampled cost %d, ",lq->valueBandwidth, neigh->cost,sampledLC);

// if the previous cost is 0, set it as the current cost
if (neigh->cost==0){
neigh->cost=sampledLC;
}

// if there's a trend, set the neighbor cost as the current cost
// sampledLC is usually in the range up to 10 or 11 based on the max penalty value of 7 and the LQ cost (converges to 1)
if(lq->valueBandwidth!=0){
neigh->cost = sampledLC;
}
// else if we don't have a trend, degrade the cost gradually
else{

// if the current cost is higher than 10.x, set the neighbor cost and the sampledLC
if(sampledLC > 41000)
{
neigh->cost= sampledLC;
}
// if the previous neighbor cost is high, set it to the current value
// this is important for when we suddenly drop the sampledLC cost
if(neigh->cost > 41000)
{
neigh->cost= sampledLC;
}
// in this case, if the sampled is higher than 10, the neigh cost will be the same value
neigh->cost = (0.99*neigh->cost) +(0.01*sampledLC);
}
}

OLSR_PRINTF(1,"weighted cost: %f \n",neigh->cost*1.0/1024.0);

// neigh->cost = (0.7*neigh->cost) +(0.3*sampledLC);

// if the current cost is higher than 10.x, set the neighbor cost and the sampledLC
if(sampledLC > 41000)
{
neigh->cost= sampledLC;
}
// if the previous neighbor cost is high, set it to the current value
// this is important for when we suddenly drop the sampledLC cost
if(neigh->cost > 41000)
{
neigh->cost= sampledLC;
}
// in this case, if the sampled is higher than 10, the neigh cost will be the same value
neigh->cost = (0.99*neigh->cost) +(0.01*sampledLC);
}

OLSR_PRINTF(1,"weighted cost: %f \n",neigh->cost*1.0/1024.0);

// neigh->cost = (0.7*neigh->cost) +(0.3*sampledLC);
// neigh->cost=sampledLC;
}

Expand Down
Loading

0 comments on commit 37af5fb

Please sign in to comment.