| 1405 | } |
| 1406 | |
| 1407 | bool call::lost(int index) |
| 1408 | { |
| 1409 | static int inited = 0; |
| 1410 | double percent = global_lost; |
| 1411 | |
| 1412 | if(!lose_packets) return false; |
| 1413 | |
| 1414 | if (call_scenario->messages[index]->lost >= 0) { |
| 1415 | percent = call_scenario->messages[index]->lost; |
| 1416 | } |
| 1417 | |
| 1418 | if (percent == 0) { |
| 1419 | return false; |
| 1420 | } |
| 1421 | |
| 1422 | if(!inited) { |
| 1423 | srand((unsigned int) time(nullptr)); |
| 1424 | inited = 1; |
| 1425 | } |
| 1426 | |
| 1427 | return (((double)rand() / (double)RAND_MAX) < (percent / 100.0)); |
| 1428 | } |
| 1429 | |
| 1430 | int call::send_raw(const char * msg, int index, int len) |
| 1431 | { |
nothing calls this directly
no outgoing calls
no test coverage detected