Changeset 37:cc3c59fe98fe in freeDiameter for freeDiameter/fdd.y
- Timestamp:
- Nov 5, 2009, 2:28:46 PM (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/fdd.y
r36 r37 316 316 connpeer: { 317 317 memset(&fddpi, 0, sizeof(fddpi)); 318 fddpi.config.pic_flags.persist = PI_PRST_ALWAYS; 318 319 fd_list_init( &fddpi.pi_endpoints, NULL ); 319 fd_list_init( &fddpi.pi_apps, NULL );320 fddpi.pi_flags.persist = PI_PRST_ALWAYS;321 320 } 322 321 CONNPEER '=' QSTRING peerinfo ';' … … 328 327 /* Now destroy any content in the structure */ 329 328 free(fddpi.pi_diamid); 330 free(fddpi.pi_sec_data.priority); 329 free(fddpi.config.pic_realm); 330 free(fddpi.config.pic_priority); 331 331 while (!FD_IS_LIST_EMPTY(&fddpi.pi_endpoints)) { 332 332 struct fd_list * li = fddpi.pi_endpoints.next; … … 344 344 | peerparams NOIP ';' 345 345 { 346 if ((conf->cnf_flags.no_ip6) || (fddpi. pi_flags.pro3 == PI_P3_IP)) {346 if ((conf->cnf_flags.no_ip6) || (fddpi.config.pic_flags.pro3 == PI_P3_IP)) { 347 347 yyerror (&yylloc, conf, "No_IP conflicts with a No_IPv6 directive."); 348 348 YYERROR; 349 349 } 350 350 got_peer_noip++; 351 fddpi. pi_flags.pro3 = PI_P3_IPv6;351 fddpi.config.pic_flags.pro3 = PI_P3_IPv6; 352 352 } 353 353 | peerparams NOIP6 ';' 354 354 { 355 if ((conf->cnf_flags.no_ip4) || (fddpi. pi_flags.pro3 == PI_P3_IPv6)) {355 if ((conf->cnf_flags.no_ip4) || (fddpi.config.pic_flags.pro3 == PI_P3_IPv6)) { 356 356 yyerror (&yylloc, conf, "No_IPv6 conflicts with a No_IP directive."); 357 357 YYERROR; 358 358 } 359 359 got_peer_noipv6++; 360 fddpi. pi_flags.pro3 = PI_P3_IP;360 fddpi.config.pic_flags.pro3 = PI_P3_IP; 361 361 } 362 362 | peerparams NOTCP ';' … … 366 366 YYERROR; 367 367 #endif 368 if ((conf->cnf_flags.no_sctp) || (fddpi. pi_flags.pro4 == PI_P4_TCP)) {368 if ((conf->cnf_flags.no_sctp) || (fddpi.config.pic_flags.pro4 == PI_P4_TCP)) { 369 369 yyerror (&yylloc, conf, "No_TCP conflicts with a No_SCTP directive."); 370 370 YYERROR; 371 371 } 372 372 got_peer_notcp++; 373 fddpi. pi_flags.pro4 = PI_P4_SCTP;373 fddpi.config.pic_flags.pro4 = PI_P4_SCTP; 374 374 } 375 375 | peerparams NOSCTP ';' 376 376 { 377 if ((conf->cnf_flags.no_tcp) || (fddpi. pi_flags.pro4 == PI_P4_SCTP)) {377 if ((conf->cnf_flags.no_tcp) || (fddpi.config.pic_flags.pro4 == PI_P4_SCTP)) { 378 378 yyerror (&yylloc, conf, "No_SCTP conflicts with a No_TCP directive."); 379 379 YYERROR; 380 380 } 381 381 got_peer_nosctp++; 382 fddpi. pi_flags.pro4 = PI_P4_TCP;382 fddpi.config.pic_flags.pro4 = PI_P4_TCP; 383 383 } 384 384 | peerparams PREFERTCP ';' 385 385 { 386 fddpi. pi_flags.alg = PI_ALGPREF_TCP;386 fddpi.config.pic_flags.alg = PI_ALGPREF_TCP; 387 387 } 388 388 | peerparams OLDTLS ';' 389 389 { 390 if (fddpi.pi_flags.sec == PI_SEC_NONE) { 391 yyerror (&yylloc, conf, "ConnectPeer: TLS_old_method conflicts with No_TLS."); 392 YYERROR; 393 } 394 fddpi.pi_flags.sec = PI_SEC_TLS_OLD; 390 fddpi.config.pic_flags.sec |= PI_SEC_TLS_OLD; 395 391 } 396 392 | peerparams NOTLS ';' 397 393 { 398 if (fddpi.pi_flags.sec == PI_SEC_TLS_OLD) {399 yyerror (&yylloc, conf, "ConnectPeer: No_TLS conflicts with TLS_old_method.");400 YYERROR;401 }402 fddpi. pi_flags.sec = PI_SEC_NONE;394 fddpi.config.pic_flags.sec |= PI_SEC_NONE; 395 } 396 | peerparams REALM '=' QSTRING ';' 397 { 398 fddpi.config.pic_realm = $4; 403 399 } 404 400 | peerparams PORT '=' INTEGER ';' 405 401 { 406 402 CHECK_PARAMS_DO( ($4 > 0) && ($4 < 1<<16), 407 { yyerror (&yylloc, conf, "Invalid value"); YYERROR; } );408 fddpi. pi_port = (uint16_t)$4;403 { yyerror (&yylloc, conf, "Invalid port value"); YYERROR; } ); 404 fddpi.config.pic_port = (uint16_t)$4; 409 405 } 410 406 | peerparams TCTIMER '=' INTEGER ';' 411 407 { 412 fddpi.pi_tctimer = $4; 408 fddpi.config.pic_tctimer = $4; 409 } 410 | peerparams TWTIMER '=' INTEGER ';' 411 { 412 fddpi.config.pic_twtimer = $4; 413 413 } 414 414 | peerparams TLS_PRIO '=' QSTRING ';' 415 415 { 416 fddpi.pi_sec_data.priority = $4; 417 } 418 | peerparams TWTIMER '=' INTEGER ';' 419 { 420 fddpi.pi_twtimer = $4; 416 fddpi.config.pic_priority = $4; 421 417 } 422 418 | peerparams CONNTO '=' QSTRING ';'
Note: See TracChangeset
for help on using the changeset viewer.