diff options
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/if.c | 16 | ||||
-rw-r--r-- | lib/if.h | 15 |
3 files changed, 30 insertions, 6 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 6eb70a22..065cddd0 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2004-12-21 Paul Jakma <paul.jakma@sun.com> + + * if.h: Add more 'non-generic' IFF_ flags. + * if.c: IFF_NOXMIT/IFF_VIRTUAL interfaces are 'loopback like' + 2004-12-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * command.c: (do_echo) Added new "echo" command, useful for @@ -344,7 +344,10 @@ if_is_operative (struct interface *ifp) int if_is_loopback (struct interface *ifp) { - return ifp->flags & IFF_LOOPBACK; + /* XXX: Do this better, eg what if IFF_WHATEVER means X on platform M + * but Y on platform N? + */ + return (ifp->flags & (IFF_LOOPBACK|IFF_NOXMIT|IFF_VIRTUAL)); } /* Does this interface support broadcast ? */ @@ -376,7 +379,7 @@ if_flag_dump (unsigned long flag) static char logbuf[BUFSIZ]; #define IFF_OUT_LOG(X,STR) \ - if ((X) && (flag & (X))) \ + if (flag & (X)) \ { \ if (separator) \ strlcat (logbuf, ",", BUFSIZ); \ @@ -402,10 +405,11 @@ if_flag_dump (unsigned long flag) IFF_OUT_LOG (IFF_LINK1, "LINK1"); IFF_OUT_LOG (IFF_LINK2, "LINK2"); IFF_OUT_LOG (IFF_MULTICAST, "MULTICAST"); -#ifdef SOLARIS_IPV6 - IFF_OUT_LOG (IFF_IPV4, "IFF_IPv4"); - IFF_OUT_LOG (IFF_IPV6, "IFF_IPv6"); -#endif /* SOLARIS_IPV6 */ + IFF_OUT_LOG (IFF_NOXMIT, "NOXMIT"); + IFF_OUT_LOG (IFF_NORTEXCH, "NORTEXCH"); + IFF_OUT_LOG (IFF_VIRTUAL, "VIRTUAL"); + IFF_OUT_LOG (IFF_IPV4, "IPv4"); + IFF_OUT_LOG (IFF_IPV6, "IPv6"); strlcat (logbuf, ">", BUFSIZ); @@ -190,6 +190,21 @@ struct connected #ifndef IFF_LINK2 #define IFF_LINK2 0x0 #endif /* IFF_LINK2 */ +#ifndef IFF_NOXMIT +#define IFF_NOXMIT 0x0 +#endif /* IFF_NOXMIT */ +#ifndef IFF_NORTEXCH +#define IFF_NORTEXCH 0x0 +#endif /* IFF_NORTEXCH */ +#ifndef IFF_IPV4 +#define IFF_IPV4 0x0 +#endif /* IFF_IPV4 */ +#ifndef IFF_IPV6 +#define IFF_IPV6 0x0 +#endif /* IFF_IPV6 */ +#ifndef IFF_VIRTUAL +#define IFF_VIRTUAL 0x0 +#endif /* IFF_VIRTUAL */ /* Prototypes. */ int if_cmp_func (struct interface *, struct interface *); |