diff options
Diffstat (limited to 'sys/netinet/libalias/alias.h')
-rw-r--r-- | sys/netinet/libalias/alias.h | 126 |
1 files changed, 64 insertions, 62 deletions
diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h index d714126..0f5ba70 100644 --- a/sys/netinet/libalias/alias.h +++ b/sys/netinet/libalias/alias.h @@ -47,11 +47,11 @@ * PacketAlias*() the old API which doesn't take an instance pointer * and therefore can only have one packet engine at a time. * - * LibAlias*() the new API which takes as first argument a pointer to + * LibAlias*() the new API which takes as first argument a pointer to * the instance of the packet aliasing engine. * * The functions otherwise correspond to each other one for one, except - * for the LibAliasUnaliasOut()/PacketUnaliasOut() function which were + * for the LibAliasUnaliasOut()/PacketUnaliasOut() function which were * were misnamed in the old API. */ @@ -66,107 +66,109 @@ struct libalias; * PacketAliasRedirectProto(), passed to PacketAliasAddServer(), * and freed by PacketAliasRedirectDelete(). */ -struct alias_link; +struct alias_link; /* OLD API */ /* Initialization and control functions. */ -void PacketAliasInit(void); -void PacketAliasSetAddress(struct in_addr _addr); -void PacketAliasSetFWBase(unsigned int _base, unsigned int _num); -void PacketAliasSetSkinnyPort(unsigned int _port); +void PacketAliasInit(void); +void PacketAliasSetAddress(struct in_addr _addr); +void PacketAliasSetFWBase(unsigned int _base, unsigned int _num); +void PacketAliasSetSkinnyPort(unsigned int _port); unsigned int - PacketAliasSetMode(unsigned int _flags, unsigned int _mask); -void PacketAliasUninit(void); + PacketAliasSetMode(unsigned int _flags, unsigned int _mask); +void PacketAliasUninit(void); /* Packet Handling functions. */ -int PacketAliasIn(char *_ptr, int _maxpacketsize); -int PacketAliasOut(char *_ptr, int _maxpacketsize); -int PacketUnaliasOut(char *_ptr, int _maxpacketsize); +int PacketAliasIn(char *_ptr, int _maxpacketsize); +int PacketAliasOut(char *_ptr, int _maxpacketsize); +int PacketUnaliasOut(char *_ptr, int _maxpacketsize); /* Port and address redirection functions. */ -int PacketAliasAddServer(struct alias_link *_link, - struct in_addr _addr, unsigned short _port); +int +PacketAliasAddServer(struct alias_link *_link, + struct in_addr _addr, unsigned short _port); struct alias_link * - PacketAliasRedirectAddr(struct in_addr _src_addr, - struct in_addr _alias_addr); -int PacketAliasRedirectDynamic(struct alias_link *_link); -void PacketAliasRedirectDelete(struct alias_link *_link); +PacketAliasRedirectAddr(struct in_addr _src_addr, + struct in_addr _alias_addr); +int PacketAliasRedirectDynamic(struct alias_link *_link); +void PacketAliasRedirectDelete(struct alias_link *_link); struct alias_link * - PacketAliasRedirectPort(struct in_addr _src_addr, - unsigned short _src_port, struct in_addr _dst_addr, - unsigned short _dst_port, struct in_addr _alias_addr, - unsigned short _alias_port, unsigned char _proto); +PacketAliasRedirectPort(struct in_addr _src_addr, + unsigned short _src_port, struct in_addr _dst_addr, + unsigned short _dst_port, struct in_addr _alias_addr, + unsigned short _alias_port, unsigned char _proto); struct alias_link * - PacketAliasRedirectProto(struct in_addr _src_addr, - struct in_addr _dst_addr, struct in_addr _alias_addr, - unsigned char _proto); +PacketAliasRedirectProto(struct in_addr _src_addr, + struct in_addr _dst_addr, struct in_addr _alias_addr, + unsigned char _proto); /* Fragment Handling functions. */ -void PacketAliasFragmentIn(char *_ptr, char *_ptr_fragment); -char *PacketAliasGetFragment(char *_ptr); -int PacketAliasSaveFragment(char *_ptr); +void PacketAliasFragmentIn(char *_ptr, char *_ptr_fragment); +char *PacketAliasGetFragment(char *_ptr); +int PacketAliasSaveFragment(char *_ptr); /* Miscellaneous functions. */ -int PacketAliasCheckNewLink(void); +int PacketAliasCheckNewLink(void); unsigned short - PacketAliasInternetChecksum(unsigned short *_ptr, int _nbytes); -void PacketAliasSetTarget(struct in_addr _target_addr); + PacketAliasInternetChecksum(unsigned short *_ptr, int _nbytes); +void PacketAliasSetTarget(struct in_addr _target_addr); /* Transparent proxying routines. */ -int PacketAliasProxyRule(const char *_cmd); +int PacketAliasProxyRule(const char *_cmd); /* NEW API */ /* Initialization and control functions. */ -struct libalias *LibAliasInit(struct libalias *); -void LibAliasSetAddress(struct libalias *, struct in_addr _addr); -void LibAliasSetFWBase(struct libalias *, unsigned int _base, unsigned int _num); -void LibAliasSetSkinnyPort(struct libalias *, unsigned int _port); +struct libalias *LibAliasInit(struct libalias *); +void LibAliasSetAddress(struct libalias *, struct in_addr _addr); +void LibAliasSetFWBase(struct libalias *, unsigned int _base, unsigned int _num); +void LibAliasSetSkinnyPort(struct libalias *, unsigned int _port); unsigned int - LibAliasSetMode(struct libalias *, unsigned int _flags, unsigned int _mask); -void LibAliasUninit(struct libalias *); + LibAliasSetMode(struct libalias *, unsigned int _flags, unsigned int _mask); +void LibAliasUninit(struct libalias *); /* Packet Handling functions. */ -int LibAliasIn(struct libalias *, char *_ptr, int _maxpacketsize); -int LibAliasOut(struct libalias *, char *_ptr, int _maxpacketsize); -int LibAliasUnaliasOut(struct libalias *, char *_ptr, int _maxpacketsize); +int LibAliasIn (struct libalias *, char *_ptr, int _maxpacketsize); +int LibAliasOut(struct libalias *, char *_ptr, int _maxpacketsize); +int LibAliasUnaliasOut(struct libalias *, char *_ptr, int _maxpacketsize); /* Port and address redirection functions. */ -int LibAliasAddServer(struct libalias *, struct alias_link *_link, - struct in_addr _addr, unsigned short _port); +int +LibAliasAddServer(struct libalias *, struct alias_link *_link, + struct in_addr _addr, unsigned short _port); struct alias_link * - LibAliasRedirectAddr(struct libalias *, struct in_addr _src_addr, - struct in_addr _alias_addr); -int LibAliasRedirectDynamic(struct libalias *, struct alias_link *_link); -void LibAliasRedirectDelete(struct libalias *, struct alias_link *_link); +LibAliasRedirectAddr(struct libalias *, struct in_addr _src_addr, + struct in_addr _alias_addr); +int LibAliasRedirectDynamic(struct libalias *, struct alias_link *_link); +void LibAliasRedirectDelete(struct libalias *, struct alias_link *_link); struct alias_link * - LibAliasRedirectPort(struct libalias *, struct in_addr _src_addr, - unsigned short _src_port, struct in_addr _dst_addr, - unsigned short _dst_port, struct in_addr _alias_addr, - unsigned short _alias_port, unsigned char _proto); +LibAliasRedirectPort(struct libalias *, struct in_addr _src_addr, + unsigned short _src_port, struct in_addr _dst_addr, + unsigned short _dst_port, struct in_addr _alias_addr, + unsigned short _alias_port, unsigned char _proto); struct alias_link * - LibAliasRedirectProto(struct libalias *, struct in_addr _src_addr, - struct in_addr _dst_addr, struct in_addr _alias_addr, - unsigned char _proto); +LibAliasRedirectProto(struct libalias *, struct in_addr _src_addr, + struct in_addr _dst_addr, struct in_addr _alias_addr, + unsigned char _proto); /* Fragment Handling functions. */ -void LibAliasFragmentIn(struct libalias *, char *_ptr, char *_ptr_fragment); -char *LibAliasGetFragment(struct libalias *, char *_ptr); -int LibAliasSaveFragment(struct libalias *, char *_ptr); +void LibAliasFragmentIn(struct libalias *, char *_ptr, char *_ptr_fragment); +char *LibAliasGetFragment(struct libalias *, char *_ptr); +int LibAliasSaveFragment(struct libalias *, char *_ptr); /* Miscellaneous functions. */ -int LibAliasCheckNewLink(struct libalias *); +int LibAliasCheckNewLink(struct libalias *); unsigned short - LibAliasInternetChecksum(struct libalias *, unsigned short *_ptr, int _nbytes); -void LibAliasSetTarget(struct libalias *, struct in_addr _target_addr); + LibAliasInternetChecksum(struct libalias *, unsigned short *_ptr, int _nbytes); +void LibAliasSetTarget(struct libalias *, struct in_addr _target_addr); /* Transparent proxying routines. */ -int LibAliasProxyRule(struct libalias *, const char *_cmd); +int LibAliasProxyRule(struct libalias *, const char *_cmd); /* @@ -257,6 +259,6 @@ int LibAliasProxyRule(struct libalias *, const char *_cmd); #define PKT_ALIAS_UNRESOLVED_FRAGMENT 3 #define PKT_ALIAS_FOUND_HEADER_FRAGMENT 4 -#endif /* !_ALIAS_H_ */ +#endif /* !_ALIAS_H_ */ /* lint -restore */ |