| 234 | #endif |
| 235 | |
| 236 | rem_port* XNET_analyze(ClntAuthBlock* cBlock, |
| 237 | const PathName& file_name, |
| 238 | bool uv_flag, |
| 239 | RefPtr<const Config>* config, |
| 240 | const PathName* ref_db_name) |
| 241 | { |
| 242 | /************************************** |
| 243 | * |
| 244 | * X N E T _ a n a l y z e |
| 245 | * |
| 246 | ************************************** |
| 247 | * |
| 248 | * Functional description |
| 249 | * Client performs attempt to establish connection |
| 250 | * based on the set of protocols. |
| 251 | * If a connection is established, return a port block, |
| 252 | * otherwise return NULL. |
| 253 | * |
| 254 | **************************************/ |
| 255 | |
| 256 | // We need to establish a connection to a remote server. |
| 257 | // Allocate the necessary blocks and get ready to go. |
| 258 | |
| 259 | Rdb* rdb = FB_NEW Rdb; |
| 260 | PACKET* packet = &rdb->rdb_packet; |
| 261 | |
| 262 | // Pick up some user identification information |
| 263 | |
| 264 | string buffer; |
| 265 | ClumpletWriter user_id(ClumpletReader::UnTagged, 64000); |
| 266 | if (cBlock) |
| 267 | { |
| 268 | cBlock->extractDataFromPluginTo(user_id); |
| 269 | } |
| 270 | |
| 271 | ISC_get_user(&buffer, 0, 0); |
| 272 | buffer.lower(); |
| 273 | ISC_systemToUtf8(buffer); |
| 274 | user_id.insertString(CNCT_user, buffer); |
| 275 | |
| 276 | ISC_get_host(buffer); |
| 277 | buffer.lower(); |
| 278 | ISC_systemToUtf8(buffer); |
| 279 | user_id.insertString(CNCT_host, buffer); |
| 280 | |
| 281 | if (uv_flag) { |
| 282 | user_id.insertTag(CNCT_user_verification); |
| 283 | } |
| 284 | |
| 285 | // Establish connection to server |
| 286 | |
| 287 | P_CNCT* cnct = &packet->p_cnct; |
| 288 | packet->p_operation = op_connect; |
| 289 | cnct->p_cnct_operation = 0; |
| 290 | cnct->p_cnct_cversion = CONNECT_VERSION3; |
| 291 | cnct->p_cnct_client = ARCHITECTURE; |
| 292 | |
| 293 | const PathName& cnct_file(ref_db_name ? (*ref_db_name) : file_name); |
no test coverage detected