MCPcopy Create free account
hub / github.com/SIPp/sipp / get_inet_address

Function get_inet_address

src/socket.cpp:343–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343static char* get_inet_address(const struct sockaddr_storage* addr, char* dst, int len)
344{
345 if (getnameinfo(_RCAST(struct sockaddr*, addr), socklen_from_addr(addr),
346 dst, len, nullptr, 0, NI_NUMERICHOST) != 0) {
347 snprintf(dst, len, "addr not supported");
348 }
349 return dst;
350}
351
352static bool process_key(int c)
353{
354 switch (c) {
355 case '1':
356 currentScreenToDisplay = DISPLAY_SCENARIO_SCREEN;
357 print_statistics(0);
358 break;
359
360 case '2':
361 currentScreenToDisplay = DISPLAY_STAT_SCREEN;
362 print_statistics(0);
363 break;
364
365 case '3':
366 currentScreenToDisplay = DISPLAY_REPARTITION_SCREEN;
367 print_statistics(0);
368 break;
369
370 case '4':
371 currentScreenToDisplay = DISPLAY_VARIABLE_SCREEN;
372 print_statistics(0);
373 break;
374
375 case '5':
376 if (use_tdmmap) {
377 currentScreenToDisplay = DISPLAY_TDM_MAP_SCREEN;
378 print_statistics(0);
379 }
380 break;
381
382 /* Screens 6, 7, 8, 9 are for the extra RTD repartitions. */
383 case '6':
384 case '7':
385 case '8':
386 case '9':
387 currentScreenToDisplay = DISPLAY_SECONDARY_REPARTITION_SCREEN;
388 currentRepartitionToDisplay = (c - '6') + 2;
389 print_statistics(0);
390 break;
391
392 case '+':
393 if (users >= 0) {
394 CallGenerationTask::set_users((int)(users + 1 * rate_scale));
395 } else {
396 CallGenerationTask::set_rate(rate + 1 * rate_scale);
397 }
398 print_statistics(0);
399 break;
400

Callers 3

open_connectionsFunction · 0.85
connect_to_peerFunction · 0.85

Calls 4

print_statisticsFunction · 0.85
print_screensFunction · 0.85
ERRORFunction · 0.85
process_commandFunction · 0.85

Tested by

no test coverage detected