int rpc_init(unsigned short port) { char *s = getenv("CACHE_IPV4_ADDRESS"); debugf("rpc_init() entered\n"); ctable_init(); stable_init(); if (s != NULL) { strcpy(my_address, s); } else { get_ipv4_addr(my_address); } return common_init(port); }
int rpc_init(unsigned short port) { char host[128]; struct hostent *hp; debugf("rpc_init() entered\n"); ctable_init(); stable_init(); gethostname(host, 128); hp = gethostbyname(host); if (hp != NULL) { struct in_addr tmp; memcpy(&tmp, hp->h_addr_list[0], hp->h_length); strcpy(my_name, inet_ntoa(tmp)); } else strcpy(my_name, "127.0.0.1"); return common_init(port); }
void init(void) { // Enable outputs DDRC = 0b11111111; PORTC = 0xFF; // Turn on PWR Led cbi(PORTC, PORTC0); InitLeds(); uart0_init(); uart0_setbaud(HOST_BAUD_RATE); rs485_init(); rs485_setbaud(BUS_BAUD_RATE); ctable_init(); adc_init(); //timer1_init(); //timer1_set_overflow_callback(timer1_callback); sei(); }