MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / proto2str

Function proto2str

socket_info.h:406–509  ·  view source on GitHub ↗

function will write the proto as string, starting from the p pointer. The new resulting pointer will be returned (where writing ended) */

Source from the content-addressed store, hash-verified

404/* function will write the proto as string, starting from the p pointer. The
405 new resulting pointer will be returned (where writing ended) */
406static inline char* proto2str(int proto, char *p)
407{
408 switch (proto) {
409 case PROTO_UDP:
410 *(p++) = 'u';
411 *(p++) = 'd';
412 *(p++) = 'p';
413 break;
414 case PROTO_TCP:
415 *(p++) = 't';
416 *(p++) = 'c';
417 *(p++) = 'p';
418 break;
419 case PROTO_TLS:
420 *(p++) = 't';
421 *(p++) = 'l';
422 *(p++) = 's';
423 break;
424 case PROTO_SCTP:
425 *(p++) = 's';
426 *(p++) = 'c';
427 *(p++) = 't';
428 *(p++) = 'p';
429 break;
430 case PROTO_WS:
431 *(p++) = 'w';
432 *(p++) = 's';
433 break;
434 case PROTO_WSS:
435 *(p++) = 'w';
436 *(p++) = 's';
437 *(p++) = 's';
438 break;
439 case PROTO_IPSEC:
440 *(p++) = 'i';
441 *(p++) = 'p';
442 *(p++) = 's';
443 *(p++) = 'e';
444 *(p++) = 'c';
445 break;
446 case PROTO_BIN:
447 *(p++) = 'b';
448 *(p++) = 'i';
449 *(p++) = 'n';
450 break;
451 case PROTO_BINS:
452 *(p++) = 'b';
453 *(p++) = 'i';
454 *(p++) = 'n';
455 *(p++) = 's';
456 break;
457 case PROTO_HEP_UDP:
458 *(p++) = 'h';
459 *(p++) = 'e';
460 *(p++) = 'p';
461 *(p++) = '_';
462 *(p++) = 'u';
463 *(p++) = 'd';

Callers 9

proto2aFunction · 0.85
socket2strFunction · 0.85
pm_hash_mi_printFunction · 0.85
get_local_contactFunction · 0.85
ospReply200Function · 0.85
ospExtraHeadersFunction · 0.85
w_hep_relayFunction · 0.85
mi_tcp_list_connsFunction · 0.85
fix_all_socket_listsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected