com-library/shared/vca_com_ds.c
int vca_com_init_addr(vca_com_addr * addr,
			   unsigned char gateway[4],
			   unsigned short gateway_port,
			   unsigned char host[4],
			   unsigned short host_port,
			   unsigned char socket) {

  if(!addr) {
    return -1;
  }

  memcpy(addr->gateway, gateway, sizeof(unsigned char) * 4);
  addr->gateway_port = gateway_port;
  memcpy(addr->host, host, sizeof(unsigned char) * 4);
  addr->host_port = host_port;
  addr->socket = socket;
  
  return 0;
}
// sets fields in naddr to the specified values and performs simple checks on the inputs
sets fields in naddr to the specified values and performs simple checks on the inputs
sets fields in naddr to the specified values and performs simple checks on the inputs
int vca_com_init_addr(vca_com_addr * addr,
			   unsigned char gateway[4],
			   unsigned short gateway_port,
			   unsigned char host[4],
			   unsigned short host_port,
			   unsigned char socket) {
  if(!addr) {
    return -1;
  }
  memcpy(addr->gateway, gateway, sizeof(unsigned char) * 4);
  addr->gateway_port = gateway_port;
  memcpy(addr->host, host, sizeof(unsigned char) * 4);
  addr->host_port = host_port;
  addr->socket = socket;
  return 0;
}
int vca_com_init_addr ( vca_com_addr * addr , unsigned char gateway [ 4 ] , unsigned short gateway_port , unsigned char host [ 4 ] , unsigned short host_port , unsigned char socket ) { if ( ! addr ) { return -1 ; } memcpy ( addr -> gateway , gateway , sizeof ( unsigned char ) * 4 ) ; addr -> gateway_port = gateway_port ; memcpy ( addr -> host , host , sizeof ( unsigned char ) * 4 ) ; addr -> host_port = host_port ; addr -> socket = socket ; return 0 ; }
sets fields in naddr to the specified values and performs simple checks on the inputs
sets fields in naddr to the specified values and performs simple checks on the inputs