3 static struct servent
*NetHostDB_servent
;
5 C_String_t
NetServDB_getEntryName(void) {
6 return (C_String_t
)(NetHostDB_servent
->s_name
);
9 C_Int_t
NetServDB_getEntryAliasesNum(void) {
11 while (NetHostDB_servent
->s_aliases
[num
] != NULL
) num
++;
15 C_String_t
NetServDB_getEntryAliasesN(C_Int_t n
) {
16 return (C_String_t
)(NetHostDB_servent
->s_aliases
[n
]);
19 C_Int_t
NetServDB_getEntryPort(void) {
20 return NetHostDB_servent
->s_port
;
23 C_String_t
NetServDB_getEntryProto(void) {
24 return (C_String_t
)(NetHostDB_servent
->s_proto
);
27 C_Int_t
NetServDB_getByName(NullString8_t name
, NullString8_t proto
) {
28 NetHostDB_servent
= getservbyname((const char*)name
, (const char*)proto
);
29 return (C_Int_t
)(NetHostDB_servent
!= NULL
and NetHostDB_servent
->s_name
!= NULL
);
32 C_Int_t
NetServDB_getByNameNull(NullString8_t name
) {
33 return NetServDB_getByName(name
, (NullString8_t
)NULL
);
36 C_Int_t
NetServDB_getByPort(C_Int_t port
, NullString8_t proto
) {
37 NetHostDB_servent
= getservbyport(port
, (const char*)proto
);
38 return (C_Int_t
)(NetHostDB_servent
!= NULL
and NetHostDB_servent
->s_name
!= NULL
);
41 C_Int_t
NetServDB_getByPortNull(C_Int_t port
) {
42 return NetServDB_getByPort(port
, (NullString8_t
)NULL
);