MCPcopy Create free account
hub / github.com/apache/brpc / str2ip

Function str2ip

src/butil/endpoint.cpp:117–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117int str2ip(const char* ip_str, ip_t* ip) {
118 // ip_str can be NULL when called by EndPoint(0, ...)
119 if (ip_str != NULL) {
120 for (; isspace(*ip_str); ++ip_str);
121 int rc = inet_pton(AF_INET, ip_str, ip);
122 if (rc > 0) {
123 return 0;
124 }
125 }
126 return -1;
127}
128
129IPStr ip2str(ip_t ip) {
130 IPStr str;

Callers 10

RdmaTestMethod · 0.85
TEST_FFunction · 0.85
TESTFunction · 0.85
InitSingleMethod · 0.85
InitMethod · 0.85
StartMethod · 0.85
GetServersMethod · 0.85
rpcz_service.cppFile · 0.85
str2endpointFunction · 0.85

Calls

no outgoing calls

Tested by 3

RdmaTestMethod · 0.68
TEST_FFunction · 0.68
TESTFunction · 0.68