diff options
Diffstat (limited to 'do/gnent')
-rw-r--r-- | do/gnent | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/do/gnent b/do/gnent deleted file mode 100644 index 131e6fee26..0000000000 --- a/do/gnent +++ /dev/null @@ -1,64 +0,0 @@ -int -do_gnent(which,gimme,arglast) -int which; -int gimme; -int *arglast; -{ - register ARRAY *ary = stack; - register int sp = arglast[0]; - register char **elem; - register STR *TARG; - struct netent *getnetbyname(); - struct netent *getnetbyaddr(); - struct netent *getnetent(); - struct netent *nent; - - if (which == O_GNBYNAME) { - char *name = str_get(ary->ary_array[sp+1]); - - nent = getnetbyname(name); - } - else if (which == O_GNBYADDR) { - unsigned long addr = U_L(str_gnum(ary->ary_array[sp+1])); - int addrtype = (int)str_gnum(ary->ary_array[sp+2]); - - nent = getnetbyaddr((long)addr,addrtype); - } - else - nent = getnetent(); - - if (gimme != G_ARRAY) { - astore(ary, ++sp, TARG = str_mortal(&str_undef)); - if (nent) { - if (which == O_GNBYNAME) - str_numset(TARG, (double)nent->n_net); - else - str_set(TARG, nent->n_name); - } - return sp; - } - - if (nent) { -#ifndef lint - (void)astore(ary, ++sp, TARG = str_mortal(&str_no)); - str_set(TARG, nent->n_name); - (void)astore(ary, ++sp, TARG = str_mortal(&str_no)); - for (elem = nent->n_aliases; *elem; elem++) { - str_cat(TARG, *elem); - if (elem[1]) - str_ncat(TARG," ",1); - } - (void)astore(ary, ++sp, TARG = str_mortal(&str_no)); - str_numset(TARG, (double)nent->n_addrtype); - (void)astore(ary, ++sp, TARG = str_mortal(&str_no)); - str_numset(TARG, (double)nent->n_net); -#else /* lint */ - elem = Nullch; - elem = elem; - (void)astore(ary, ++sp, str_mortal(&str_no)); -#endif /* lint */ - } - - return sp; -} - |