int main() { rt_pvd_udb provider( pvd_eEnv_Rt); rt_procom procom( &provider, errh_eAnix_appl20, // Application index "rt_pvd_udb", // Process name 200, // Sid ldh_cUserDatabaseVolume, // Vid _V254.254.254.246 "VolUserDatabase", // Volume name 0); // Global procom.init(); procom.mainLoop(); }
int main(int argc, char *argv[]) { pwr_tStatus sts; char remote_address[40]; char remote_host_name[40]; char remote_vid[40]; char remote_volume_name[40]; int udp_port; int server_id; /* Read arguments */ if ( argc < 5) { usage(); exit(0); } strcpy( remote_address, argv[1]); strcpy( remote_host_name, argv[2]); strcpy( remote_vid, argv[3]); strcpy( remote_volume_name, argv[4]); if ( argc >= 6) { sts = sscanf( argv[5], "%d", &server_id); if ( sts != 1) { usage(); exit(0); } } else server_id = 200; if ( argc >= 7) { sts = sscanf( argv[6], "%d", &udp_port); if ( sts != 1) { usage(); exit(0); } } else udp_port = 3051; if ( argc >= 8) { sts = sscanf( argv[7], "%d", &rpvd_opsys); if ( sts != 1) { usage(); exit(0); } } else rpvd_opsys = 0; cdh_StringToVolumeId( remote_vid, &rpvd_vid); strcpy( rpvd_vname, remote_volume_name); sts = udp_Init( remote_address, remote_host_name, udp_port); if ( EVEN(sts)) { exit(0); } remote_pvd_pwrcli provider( pvd_eEnv_Rt); rt_procom procom( &provider, errh_eAnix_appl20, // Application index "remote_pvd_pwrcli", // Process name server_id, // Sid rpvd_vid, // Vid rpvd_vname, // Volume name 0); // Global procom.init(); provider.nodeUp(); procom.mainLoop(); }