Skip to content

Commit

Permalink
FW-415. replace periodDIO by dioPeriod and periodDAO by daoPeriod
Browse files Browse the repository at this point in the history
  • Loading branch information
changtengfei committed Jul 2, 2015
1 parent c696c03 commit 2cb63dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions openstack/03b-IPv6/icmpv6rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ void icmpv6rpl_init() {
icmpv6rpl_vars.dioDestination.type = ADDR_128B;
memcpy(&icmpv6rpl_vars.dioDestination.addr_128b[0],all_routers_multicast,sizeof(all_routers_multicast));

icmpv6rpl_vars.periodDIO = TIMER_DIO_TIMEOUT+(openrandom_get16b()&0xff);
icmpv6rpl_vars.dioPeriod = TIMER_DIO_TIMEOUT+(openrandom_get16b()&0xff);
icmpv6rpl_vars.timerIdDIO = opentimers_start(
icmpv6rpl_vars.periodDIO,
icmpv6rpl_vars.dioPeriod,
TIMER_PERIODIC,
TIME_MS,
icmpv6rpl_timer_DIO_cb
Expand Down Expand Up @@ -117,9 +117,9 @@ void icmpv6rpl_init() {
icmpv6rpl_vars.dao_target.flags = 0;
icmpv6rpl_vars.dao_target.prefixLength = 0;

icmpv6rpl_vars.periodDAO = TIMER_DAO_TIMEOUT+(openrandom_get16b()&0xff);
icmpv6rpl_vars.daoPeriod = TIMER_DAO_TIMEOUT+(openrandom_get16b()&0xff);
icmpv6rpl_vars.timerIdDAO = opentimers_start(
icmpv6rpl_vars.periodDAO,
icmpv6rpl_vars.daoPeriod,
TIMER_PERIODIC,
TIME_MS,
icmpv6rpl_timer_DAO_cb
Expand Down Expand Up @@ -272,7 +272,7 @@ void icmpv6rpl_timer_DIO_task() {
opentimers_setPeriod(
icmpv6rpl_vars.timerIdDIO,
TIME_MS,
icmpv6rpl_vars.periodDIO
icmpv6rpl_vars.dioPeriod
);
}
}
Expand Down Expand Up @@ -394,7 +394,7 @@ void icmpv6rpl_timer_DAO_task() {
opentimers_setPeriod(
icmpv6rpl_vars.timerIdDAO,
TIME_MS,
icmpv6rpl_vars.periodDAO
icmpv6rpl_vars.daoPeriod
);
}
}
Expand Down Expand Up @@ -563,19 +563,19 @@ void sendDAO() {
}

void icmpv6rpl_setDIOPeriod(uint16_t dioPeriod){
icmpv6rpl_vars.periodDIO = dioPeriod/5; // delayDIO will skip 4 times in 5 dio period
icmpv6rpl_vars.dioPeriod = dioPeriod/5; // delayDIO will skip 4 times in 5 dio period
opentimers_setPeriod(
icmpv6rpl_vars.timerIdDIO,
TIME_MS,
icmpv6rpl_vars.periodDIO
icmpv6rpl_vars.dioPeriod
);
}

void icmpv6rpl_setDAOPeriod(uint16_t daoPeriod){
icmpv6rpl_vars.periodDAO = daoPeriod/5; // delayDAO will skip 4 times in 5 dao period
icmpv6rpl_vars.daoPeriod = daoPeriod/5; // delayDAO will skip 4 times in 5 dao period
opentimers_setPeriod(
icmpv6rpl_vars.timerIdDAO,
TIME_MS,
icmpv6rpl_vars.periodDAO
icmpv6rpl_vars.daoPeriod
);
}
4 changes: 2 additions & 2 deletions openstack/03b-IPv6/icmpv6rpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ typedef struct {
// DIO-related
icmpv6rpl_dio_ht dio; ///< pre-populated DIO packet.
open_addr_t dioDestination; ///< IPv6 destination address for DIOs.
uint16_t periodDIO; ///< duration, in ms, of a timerIdDIO timeout.
uint16_t dioPeriod; ///< duration, in ms, of a timerIdDIO timeout.
opentimer_id_t timerIdDIO; ///< ID of the timer used to send DIOs.
uint8_t delayDIO; ///< number of timerIdDIO events before actually sending a DIO.
// DAO-related
icmpv6rpl_dao_ht dao; ///< pre-populated DAO packet.
icmpv6rpl_dao_transit_ht dao_transit; ///< pre-populated DAO "Transit Info" option header.
icmpv6rpl_dao_target_ht dao_target; ///< pre-populated DAO "Transit Info" option header.
opentimer_id_t timerIdDAO; ///< ID of the timer used to send DAOs.
uint16_t periodDAO; ///< duration, in ms, of a timerIdDAO timeout.
uint16_t daoPeriod; ///< duration, in ms, of a timerIdDAO timeout.
uint8_t delayDAO; ///< number of timerIdDIO events before actually sending a DAO.
} icmpv6rpl_vars_t;

Expand Down

0 comments on commit 2cb63dc

Please sign in to comment.