Example #1
0
/*---------------------------------------------------------------------------*/
static void
init(void)
{
  memb_init(&packet_memb);
  memb_init(&metadata_memb);
  memb_init(&neighbor_memb);
}
Example #2
0
/*---------------------------------------------------------------------------*/
void
phase_init(struct phase_list *list)
{
  list_init(*list->list);
  memb_init(list->memb);
  memb_init(&queued_packets_memb);
}
Example #3
0
File: csma.c Project: Devesh24/6lbr
/*---------------------------------------------------------------------------*/
static void
init(void)
{
  memb_init(&packet_memb);
  memb_init(&metadata_memb);
  memb_init(&neighbor_memb);
  packet_overflow = 0;
}
Example #4
0
/*----------------------------------------------------------------------------*/
  void
  flowtable_init(void)
  {
    list_init(flowtable);
    memb_init(&entries_memb);
    memb_init(&windows_memb);
    memb_init(&actions_memb);
    memb_init(&bytes_memb);
  }
Example #5
0
db_result_t
relation_init(void)
{
  list_init(relations);
  memb_init(&relations_memb);
  memb_init(&attributes_memb);

  return DB_OK;
}
/*---------------------------------------------------------------------------*/
void
queuebuf_init(void)
{
  memb_init(&bufmem);
  memb_init(&refbufmem);
#if QUEUEBUF_STATS
  queuebuf_max_len = QUEUEBUF_NUM;
#endif /* QUEUEBUF_STATS */
}
Example #7
0
/* Initialize TSCH queue module */
void
tsch_queue_init(void)
{
  list_init(neighbor_list);
  memb_init(&neighbor_memb);
  memb_init(&packet_memb);
  /* Add virtual EB and the broadcast neighbors */
  n_eb = tsch_queue_add_nbr(&tsch_eb_address);
  n_broadcast = tsch_queue_add_nbr(&tsch_broadcast_address);
}
PROCESS_THREAD(broadcast_process, ev, data)
{
    static struct etimer et; /*timer to wait*/
    if(!ifinit){
        list_init(broadcast_list);
        memb_init(&broadcast_list_memb);
        list_init(routing_table);
        memb_init(&routing_table_memb);
        init_my_node(NODE_INIT);
        ifinit = 1;
    }
    PROCESS_EXITHANDLER(broadcast_close(&broadcast);)
/* Module initialization, call only once at startup. Returns 1 is success, 0 if failure. */
int
tsch_schedule_init(void)
{
  if(tsch_get_lock()) {
    memb_init(&link_memb);
    memb_init(&slotframe_memb);
    list_init(slotframe_list);
    tsch_release_lock();
    return 1;
  } else {
    return 0;
  }
}
Example #10
0
/*---------------------------------------------------------------------------*/
void
uip_ds6_route_init(void)
{
  memb_init(&routememb);
  nbr_table_register(nbr_routes,
                     (nbr_table_callback *)rm_routelist_callback);

  memb_init(&defaultroutermemb);
  list_init(defaultrouterlist);

#if UIP_DS6_NOTIFICATIONS
  list_init(notificationlist);
#endif
}
Example #11
0
/*-----------------------------------------------------------------------------------*/
void
ether_server_init(void)
{
    struct sockaddr_in sa;

    gettimeofday(&t1, NULL);

    memb_init(&packets);
    list_init(active_packets);

    timer = 0;

    s = socket(AF_INET,SOCK_DGRAM,0);

    if(s < 0) {
        perror("ether_server_init: socket");
    }

    memset((char *)&sa, 0, sizeof(sa));

    sa.sin_family = AF_INET;
    sa.sin_addr.s_addr = inet_addr("127.0.0.1");/*htonl(INADDR_ANY);*/

    sa.sin_port = htons(ETHER_PORT);

    /*  printf("Binding to port %d\n", ETHER_PORT);*/

    if(bind(s, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
        printf("Bind to port %d\n", ETHER_PORT);
        perror("bind");
        exit(1);
    }

}
Example #12
0
/*---------------------------------------------------------------------------*/
void
ip64_addrmap_init(void)
{
  memb_init(&entrymemb);
  list_init(entrylist);
  mapped_port = FIRST_MAPPED_PORT;
}
Example #13
0
/*---------------------------------------------------------------------------*/
void
telnetd_init(void)
{
  uip_listen(HTONS(23));
  memb_init(&linemem);
  shell_init();
}
Example #14
0
/**
 * \brief IPND Discovery init function (called by agent)
 */
static bool discovery_ipnd_init()
{
	// Initialize the neighbour list
	list_init(neighbour_list);

	// Initialize the neighbour memory block
	memb_init(&neighbour_mem);

#if DISCOVERY_IPND_WHITELIST > 0
	// Clear the discovery whitelist
	memset(&discovery_whitelist, 0, sizeof(linkaddr_t) * DISCOVERY_IPND_WHITELIST);

	// Fill the datastructure here

	LOG(LOGD_DTN, LOG_DISCOVERY, LOGL_WRN, "Whitelist enabled");
#endif

	// Set the neighbour timeout timer
	const TimerHandle_t discovery_timeout_timer = xTimerCreate("discovery timeout timer", pdMS_TO_TICKS(DISCOVERY_NEIGHBOUR_TIMEOUT * 1000),
															   pdTRUE, NULL, discovery_ipnd_remove_stale_neighbours);
	if (discovery_timeout_timer == NULL) {
		return false;
	}

	if ( !xTimerStart(discovery_timeout_timer, 0) ) {
		return false;
	}

	// Enable discovery module
	discovery_status = 1;

	return true;
}
Example #15
0
/*---------------------------------------------------------------------------*/
void
queuebuf_init(void)
{
#if WITH_SWAP
  int i;
  for(i=0; i<NQBUF_FILES; i++) {
    qbuf_files[i].renewable = 1;
    qbuf_renew_file(i);
  }
#endif
  memb_init(&buframmem);
  memb_init(&bufmem);
#if QUEUEBUF_STATS
  queuebuf_max_len = 0;
#endif /* QUEUEBUF_STATS */
}
Example #16
0
/*---------------------------------------------------------------------------*/
void
httpd_init(void)
{
  tcp_listen(HTONS(80));
  memb_init(&conns);
  httpd_cgi_init();
}
Example #17
0
void crypto_init() {
  dtls_hmac_storage_init();

#ifdef WITH_CONTIKI
  memb_init(&cipher_storage);
#endif /* WITH_CONTIKI */
}
Example #18
0
/* external function definitions */
void scopes_init(struct scopes_routing *r, struct scopes_membership *m) {

	/* initialize static memory for scopes structures */
	memb_init(&scopes_mem);

	/* initialize scopes list and subscriber list */
	list_init(scopes);
	list_init(subscribers);

	/* create world scope */
	world_scope.scope_id = SCOPES_WORLD_SCOPE_ID;
	world_scope.super_scope_id = SCOPES_WORLD_SCOPE_ID;
	world_scope.ttl = 0;
	world_scope.status = SCOPES_STATUS_MEMBER;
	world_scope.flags = SCOPES_FLAG_NONE;

	/* add world scope */
	list_add(scopes, &world_scope);

	/* set and initialize routing */
	routing = r;
	routing->init();

	/* set and initialize membership checker */
	membership = m;
	membership->init();

	/* start scopes process */
	process_start(&scopes_process, NULL);
}
Example #19
0
void discovery_simple_init() {
	// Initialize the neighbour list
	list_init(neighbour_list);

	// Initialize the neighbour memory block
	memb_init(&neighbour_mem);
}
Example #20
0
static CC_INLINE void
init(void)
{
  list_init(dns);
  memb_init(&dnsmemb);
  initialized = 1;
}
Example #21
0
/*---------------------------------------------------------------------------*/
void
route_init(void)
{
  list_init(route_table);
  memb_init(&route_mem);

  ctimer_set(&t, CLOCK_SECOND, periodic, NULL);
}
Example #22
0
/*---------------------------------------------------------------------------*/
void
httpd_init(void)
{
  tcp_listen(HTONS(80));
  memb_init(&conns);
#if HTTPD_CONF_CGI
  httpd_cgi_init();
#endif /* HTTPD_CONF_CGI */
}
Example #23
0
/*---------------------------------------------------------------------------*/
void
collect_neighbor_init(void)
{
  static uint8_t initialized = 0;
  if(initialized == 0) {
    initialized = 1;
    memb_init(&collect_neighbors_mem);
  }
}
Example #24
0
/*---------------------------------------------------------------------------*/
void
c_route_init(struct pipe *p)
{
  list_init(p->route_table);
  memb_init(&p->route_mem);

  ctimer_set(&t, CLOCK_SECOND, periodic, p);
  PRINTF("~c_route_init \n");
}
Example #25
0
/*---------------------------------------------------------------------------*/
void
httpd_init(void)
{
  tcp_listen(UIP_HTONS(80));
  memb_init(&conns);
#if URLCONV
  urlconv_init();
#endif /* URLCONV */
}
Example #26
0
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(announce_blink_process, ev, data)
{
  PROCESS_BEGIN();

  /* XXX the Sentilla JCreate has 8 LEDs, and we need to set the ports
     correctly. */
#if CONTIKI_TARGET_SKY
  LEDS_PxDIR = 0xff;
  LEDS_PxOUT = 0xff;
#endif /* CONTIKI_TARGET_SKY */

  announcement_register(&announcement, 80, 0,
			received_announcement);

  list_init(neighbor_table);
  memb_init(&neighbor_mem);

#if CONTIKI_TARGET_NATIVE
  {
    int i;
    for(i = 0; i < 10; ++i) {
      rimeaddr_t r;
      r.u8[0] = r.u8[1] = i;
      received_announcement(NULL, &r, 0, 0);
      received_announcement(NULL, &r, 0, 0);
    }
  }
#endif /* CONTIKI_TARGET_NATIVE */
  
#if CONTIKI_TARGET_SKY
  acc_sensor.activate();

  /* Lower the transmission power for the announcements so that only
     close-range neighbors are noticed. (Makes for a nicer visual
     effect.) */
  xmac_set_announcement_radio_txpower(1);
#endif /* CONTIKI_TARGET_SKY */
  
  while(1) {
    static struct etimer e;
    static uint16_t last_value;
    
    etimer_set(&e, CLOCK_SECOND / 8);
    PROCESS_WAIT_EVENT();
#if CONTIKI_TARGET_SKY
    if(acc_sensor.value(1) / 256 != last_value) {
      last_value = acc_sensor.value(1) / 256;
      announcement_listen(1);
    }
#endif /* CONTIKI_TARGET_SKY */
  }
  
  PROCESS_END();
}
Example #27
0
///=========================================================================/
///=========================================================================/
static void initialize(void){
    uint8_t k;
    list_init(datalist);
    memb_init(&datalistmemb);

    //initialize pointer list
    for( k = 0; k < MAX_ITEMS2SORT; k++){
        data_2ptr[k] = NULL;
        ptr_2data[k] = NULL;
    }
}
Example #28
0
void
neighbor_init(void)
{
  static uint8_t initialized = 0;
  if(initialized == 0) {
    initialized = 1;
    memb_init(&neighbors_mem);
    list_init(neighbors_list);
    ctimer_set(&t, CLOCK_SECOND, periodic, NULL);
  }
}
Example #29
0
void
shell_sdr_init(void)
{
  memb_init(&broadcast_mem);
  memb_init(&unicast_mem);
  memb_init(&runicast_mem);
  list_init(broadcast_list);
  list_init(unicast_list);
  list_init(runicast_list);
  serial_shell_init();
  shell_register_command(&bc_open_command);
  shell_register_command(&bc_close_command);
  shell_register_command(&bc_send_command);
  shell_register_command(&uc_open_command);
  shell_register_command(&uc_close_command);
  shell_register_command(&uc_send_command);
  shell_register_command(&ruc_open_command);
  shell_register_command(&ruc_close_command);
  shell_register_command(&ruc_send_command);
}
Example #30
0
/**
 * @brief neighs_init
 */
void neighs_init(){
    uint8_t k;
    list_init(neighs_list);
    memb_init(&neighs_memb);

    for(k = 0; k < CONF_NETWORK_SIZE; k++){
        nodeList[k] = NULL;
    }
    
    neighs_flush_all();
}