Skip to content

Commit

Permalink
parse_uri : added new function proto type int to str
Browse files Browse the repository at this point in the history
added new function proto type int to str
  • Loading branch information
root authored and henningw committed Nov 25, 2019
1 parent 7966f10 commit 29a8185
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/core/parser/parse_uri.c
Expand Up @@ -1439,3 +1439,26 @@ void proto_type_to_str(unsigned short type, str *s) {
*s = s_null;
}
}

void proto_type_int_to_str(int type, str *s) {
switch (type) {
case PROTO_UDP:
*s = s_udp;
break;
case PROTO_TCP:
*s = s_tcp;
break;
case PROTO_TLS:
*s = s_tls;
break;
case PROTO_SCTP:
*s = s_sctp;
break;
case PROTO_WS:
case PROTO_WSS:
*s = s_ws;
break;
default:
*s = s_null;
}
}
2 changes: 1 addition & 1 deletion src/core/parser/parse_uri.h
Expand Up @@ -47,5 +47,5 @@ int parse_orig_ruri(struct sip_msg* msg);
int normalize_tel_user(char* res, str* src);
void uri_type_to_str(uri_type type, str *s);
void proto_type_to_str(unsigned short type, str *s);

void proto_type_int_to_str(int type, str *s);
#endif /* PARSE_URI_H */

0 comments on commit 29a8185

Please sign in to comment.