Changeset 290 for trunk/src/sh_portcheck.c
- Timestamp:
- Aug 15, 2010, 12:27:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_portcheck.c
r257 r290 47 47 48 48 #define PORTMAP 49 #ifdef HAVE_RPC_RPC_H 49 50 #include <rpc/rpc.h> 50 51 #ifdef HAVE_RPC_RPCENT_H … … 53 54 #include <rpc/pmap_clnt.h> 54 55 #include <rpc/pmap_prot.h> 56 #endif 55 57 #include <netdb.h> 56 58 … … 284 286 #endif 285 287 288 #ifdef HAVE_RPC_RPC_H 286 289 static char * sh_getrpcbynumber (int number, char * buf, size_t len) 287 290 { … … 324 327 return NULL; 325 328 } 329 #endif 326 330 327 331 static char * sh_getservbyport (int port, const char * proto_in, char * buf, size_t len) … … 756 760 unsigned long prot) 757 761 { 762 #ifdef HAVE_RPC_RPC_H 758 763 struct pmaplist * head; 759 764 char *r; … … 786 791 while (head != NULL); 787 792 } 788 793 #else 794 (void) port; 795 (void) address; 796 (void) prot; 797 #endif 789 798 return NULL; 790 799 } … … 1665 1674 char * p; 1666 1675 1676 #ifdef HAVE_RPC_RPC_H 1667 1677 p = sh_getrpcbynumber(0, buf, sizeof(buf)); 1668 1678 CuAssertTrue(tc, p == NULL); … … 1677 1687 CuAssertTrue(tc, 0 == strcmp(p, "ypbind")); 1678 1688 CuAssertTrue(tc, 0 == strcmp(buf, "ypbind")); 1689 #endif 1679 1690 1680 1691 p = sh_getservbyport(0, SH_PROTO_STR(IPPROTO_TCP), buf, sizeof(buf)); 1681 1692 CuAssertTrue(tc, p == NULL); 1682 1693 1694 #if !defined(HOST_IS_CYGWIN) 1683 1695 p = sh_getservbyport(22, SH_PROTO_STR(IPPROTO_TCP), buf, sizeof(buf)); 1684 1696 CuAssertPtrNotNull(tc, p); 1685 1697 CuAssertTrue(tc, 0 == strcmp(p, "ssh")); 1686 1698 CuAssertTrue(tc, 0 == strcmp(buf, "ssh")); 1699 #endif 1687 1700 1688 1701 p = sh_getservbyport(13, SH_PROTO_STR(IPPROTO_UDP), buf, sizeof(buf));
Note:
See TracChangeset
for help on using the changeset viewer.