Lines Matching refs:s
338 servent* s = getservbyname("smtp", nullptr); in TEST() local
339 ASSERT_TRUE(s != nullptr); in TEST()
340 ASSERT_STREQ("smtp", s->s_name); in TEST()
341 ASSERT_EQ(25, ntohs(s->s_port)); in TEST()
342 ASSERT_STREQ("tcp", s->s_proto); in TEST()
345 s = getservbyname("smtp", "tcp"); in TEST()
346 ASSERT_TRUE(s != nullptr); in TEST()
347 ASSERT_STREQ("smtp", s->s_name); in TEST()
348 ASSERT_EQ(25, ntohs(s->s_port)); in TEST()
349 ASSERT_STREQ("tcp", s->s_proto); in TEST()
352 s = getservbyname("smtp", "udp"); in TEST()
353 ASSERT_TRUE(s == nullptr); in TEST()
356 s = getservbyname("echo", "udp"); in TEST()
357 ASSERT_TRUE(s != nullptr); in TEST()
358 ASSERT_STREQ("echo", s->s_name); in TEST()
359 ASSERT_EQ(7, ntohs(s->s_port)); in TEST()
360 ASSERT_STREQ("udp", s->s_proto); in TEST()
365 servent* s = getservbyport(htons(25), nullptr); in TEST() local
366 ASSERT_TRUE(s != nullptr); in TEST()
367 ASSERT_STREQ("smtp", s->s_name); in TEST()
368 ASSERT_EQ(25, ntohs(s->s_port)); in TEST()
369 ASSERT_STREQ("tcp", s->s_proto); in TEST()
372 s = getservbyport(htons(25), "tcp"); in TEST()
373 ASSERT_TRUE(s != nullptr); in TEST()
374 ASSERT_STREQ("smtp", s->s_name); in TEST()
375 ASSERT_EQ(25, ntohs(s->s_port)); in TEST()
376 ASSERT_STREQ("tcp", s->s_proto); in TEST()
379 s = getservbyport(htons(25), "udp"); in TEST()
380 ASSERT_TRUE(s == nullptr); in TEST()
383 s = getservbyport(htons(7), "udp"); in TEST()
384 ASSERT_TRUE(s != nullptr); in TEST()
385 ASSERT_STREQ("echo", s->s_name); in TEST()
386 ASSERT_EQ(7, ntohs(s->s_port)); in TEST()
387 ASSERT_STREQ("udp", s->s_proto); in TEST()