diff --git a/examples/AddNetInterface.c b/examples/AddNetInterface.c deleted file mode 100644 index 0bac343..0000000 --- a/examples/AddNetInterface.c +++ /dev/null @@ -1,4191 +0,0 @@ -/* - * $Id$ - * - * :ts=4 - * - * Copyright © 2001-2013 by Olaf Barthel. All Rights Reserved. - */ - -/* There is a deliberate incompatibility in the 'struct AnchorPath' - definition between the AmigaOS 2.x/3.x and 4.x header files which - we will need to work around here. */ -#if defined(__amigaos4__) -#define ap_Buf ap_Buffer -#else -#define USE_OLD_ANCHORPATH -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -/* These are options relevant for the prototype header files - included below. */ -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -/* this macro lets us long-align structures on the stack */ -#define D_S(type,name) \ - char a_##name[sizeof(type)+3]; \ - type *name = (type *)((ULONG)(a_##name+3) & ~3UL) - -/****************************************************************************/ - -/* These two bits indicate the kind of address - represented by an IEEE 802.3 MAC address. These - are the two least significant bits of the first - address byte. */ -#define MAC_Is_Group_Address 0x01 -#define MAC_Is_Logical_Address 0x02 - -/****************************************************************************/ - -#include "AddNetInterface_rev.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/* This is missing in the AmigaOS 2.x/3.x header files. */ -#ifndef FORMAT_DEF -#define FORMAT_DEF 4 -#endif /* FORMAT_DEF */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -#define MAX_FILENAME_LEN 512 - -/****************************************************************************/ - -/* This context information is handed around for all the routines and - subroutines below. */ -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_UtilityBase; - struct Library * cc_SocketBase; - struct Library * cc_LocaleBase; - struct Library * cc_IconBase; - struct Library * cc_IntuitionBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct UtilityIFace * cc_IUtility; - struct SocketIFace * cc_ISocket; - struct LocaleIFace * cc_ILocale; - struct IconIFace * cc_IIcon; - struct IntuitionIFace * cc_IIntuition; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - UBYTE cc_ProgramName[256]; - struct WBStartup * cc_StartupMessage; - struct RDArgs * cc_RDA; - BPTR cc_File; - struct AnchorPath * cc_AnchorPath; - BOOL cc_Quiet; - struct TagItem * cc_Tags; - LONG cc_NumTags; - LONG cc_MaxTags; - struct MsgPort * cc_ReplyPort; - struct AddressAllocationMessage - cc_AllocationMessage; - ULONG cc_RouterTable[16]; - ULONG cc_DNSTable[16]; - struct DateStamp cc_LeaseExpires; -}; - -/****************************************************************************/ - -/* The following set of DECLARE_... macros are used to load the library - bases in every routine that needs them. These are portable macros in - the sense that they allow the same code to be built both for AmigaOS 2.x/3.x - and 4.x. */ - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct UtilityIFace * IUtility = cc->cc_IUtility; \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct SocketIFace * ISocket = cc->cc_ISocket; \ - struct Library * SocketBase = cc->cc_SocketBase - -#define DECLARE_ICONBASE(cc) \ - struct IconIFace * IIcon = cc->cc_IIcon; \ - struct Library * IconBase = cc->cc_IconBase - -#define DECLARE_INTUITIONBASE(cc) \ - struct IntuitionIFace * IIntuition = cc->cc_IIntuition; \ - struct Library * IntuitionBase = cc->cc_IntuitionBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct Library * SocketBase = cc->cc_SocketBase - -#define DECLARE_ICONBASE(cc) \ - struct Library * IconBase = cc->cc_IconBase - -#define DECLARE_INTUITIONBASE(cc) \ - struct Library * IntuitionBase = cc->cc_IntuitionBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -/* This program performs two passes on the interfaces it has to take - care of it. First it adds the interfaces, then it configures them. - Here is a definition of what each pass does. */ -enum add_interface_mode_t -{ - AIM_Add, - AIM_Configure -}; - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -STATIC LONG cmd(struct CommandContext *cc); -STATIC LONG match_key(struct CommandContext *cc, STRPTR what); -STATIC LONG add_tag(struct CommandContext *cc, Tag tag, ULONG data); -STATIC BOOL is_blank_space(UBYTE c); -STATIC STRPTR get_next_token(STRPTR input, STRPTR string, LONG string_len); -STATIC LONG get_hex_value(struct CommandContext *cc, STRPTR str); -STATIC VOID get_hex_string(LONG value, STRPTR str); -STATIC VOID strip_unprintable_characters(STRPTR s); -STATIC VOID strip_extra_blank_spaces(STRPTR s); -STATIC LONG add_interface(struct CommandContext *cc, STRPTR name, enum add_interface_mode_t operating_mode, LONG timeout); -STATIC BOOL validate_ip_address(struct CommandContext *cc, STRPTR key, STRPTR address, LONG line_number, STRPTR file); -STATIC VOID get_errno_and_code(struct CommandContext *cc, LONG *errno_ptr, STRPTR *code_ptr); -STATIC BOOL substring_matches(struct CommandContext *cc, STRPTR pattern, STRPTR string); -STATIC VOID add_interface_node(struct CommandContext *cc, struct List *list, struct Node *new_node); -STATIC VOID VARARGS68K error_printf(struct CommandContext *cc, STRPTR format, ...); -STATIC VOID VARARGS68K warning_printf(struct CommandContext *cc, STRPTR format, ...); -STATIC VOID VARARGS68K info_printf(struct CommandContext *cc, STRPTR format, ...); -STATIC VOID info_print_fault(struct CommandContext *cc, LONG code); -STATIC VOID error_print_fault(struct CommandContext *cc, LONG code); -STATIC VOID error_print_fault_prefix(struct CommandContext *cc, LONG code, STRPTR prefix); -STATIC STRPTR get_builtin_str(LONG id); -STATIC STRPTR get_str(struct CommandContext *cc, LONG id); -STATIC LONG VARARGS68K Local_ConfigureInterfaceTags(struct CommandContext *cc, STRPTR interface_name, ...); -STATIC LONG VARARGS68K Local_SocketBaseTags(struct CommandContext *cc, ...); -STATIC LONG VARARGS68K Local_AddRouteTags(struct CommandContext *cc, ...); - -/****************************************************************************/ - -/****** ROADSHOW/ADDNETINTERFACE ************************************************** -* -* NAME -* AddNetInterface - Make network interfaces known to the protocol stack. -* -* FORMAT -* AddNetInterface [QUIET] [TIMEOUT=] INTERFACE -* -* TEMPLATE -* INTERFACE/M,QUIET/S,TIMEOUT/K/N -* -* PATH -* C:ADDNETINTERFACE -* -* FUNCTION -* ADDNETINTERFACE starts the specified network interfaces, thus starting -* the connection. -* -* OPTIONS -* INTERFACE/M -* The name of the interface to add; this can be a plain interface -* name, such as "Ariadne", or the fully qualified file name which -* contains the interface configuration information. The tool -* expects the name of the file in question (without the prefixed -* path) to become the name of the interface. For historic reasons -* interface names cannot be longer than 15 characters. -* -* For your convenience, a wild card pattern can be specified in -* place of the file name to use. -* -* If several interface names are specified, they will be sorted in -* alphabetical order before they are added. If the interface -* files have icons attached, you can use tool types such as -* "PRI=5" or "PRIORITY=5" to select the order in which the interfaces -* will be sorted. Higher priority entries will appear before lower -* priority entries. If the priorities for two entries is identical, -* then the interface names will be compared. If no priority is -* given, the value 0 will be used. -* -* QUIET/S -* This option causes the program not to emit any error messages -* or progress reports. Also, if the program encounters an error -* it will flag this as failure code 5 which can be looked at -* using the "if warn" shell script command. If this option is -* not in effect, failure codes will be more severe and all sorts -* of progress information will be displayed. -* -* TIMEOUT/K/N -* If you're going to use DHCP configuration for any of the -* interfaces, a default timeout value of 60 seconds will -* limit the time an interface can take to be configured. -* This parameter allows you to use a different timeout value. -* Note that due to how the configuration protocol works, -* the timeout cannot be shorter than ten seconds. -* -* The 'AddNetInterface' command can be invoked from Workbench, too. It -* operates on the same configuration files with the same keywords, etc. -* To make it work, create an icon for your interface configuration file -* (it must be a project icon) and put 'AddNetInterface' into its default -* tool. Make sure that the project has enough stack space assigned (4000 -* bytes minimum), then double-click on the icon. If things should go -* wrong, you will see an error requester pop up, and no further -* initialization will be done. You can configure two options in the -* project file's tool types: QUIET and TIMEOUT. These are identical to -* the two parameters of the same name you could pass on the command -* line; they define whether the command should print any error messages -* (the default is to print them) and how long the command should wait -* for DHCP configuration to conclude (default is a timeout of 60 -* seconds). -* -* NOTES -* This command is similar to the Unix "ifconfig" command. -* -* The program makes two passes over the configuration files to be -* taken into account. In the first pass information is gathered -* on the interfaces to add, which is subsequently used to add those -* interfaces found. In the second pass interfaces are configured, -* setting their IP addresses, etc. If anything goes wrong in the -* first pass, processing will stop and no second pass will be -* done. If anything goes wrong in either the first or the second -* pass, that pass will not be completed. -* -* CONFIGURATION FILES -* Interfaces are configured through files stored in the -* "DEVS:NetInterfaces" or "SYS:Storage/NetInterfaces" directories. -* These are text files whose contents are described below. -* -* Each line of the file must correspond to an option; if a line is -* introduced by a '#' or ';' character it will be ignored (so are empty -* lines). The following options are supported: -* -* DEVICE/K -* Must be provided; the name of the SANA-II device driver. This -* should be the complete, fully qualified path to the driver. If -* no complete path is provided, the 'Devs:Networks' drawer will be -* checked. Thus, "DEVS:Networks/ariadne.device" is equivalent to -* "ariadne.device". -* -* UNIT/K/N -* Unit number of the device driver to open. The default is to -* use unit 0. -* -* IPTYPE/K/N -* You can use this parameter to override the packet type the -* stack uses when sending IP packets; default is 2048 (for -* Ethernet hardware). -* -* ARPTYPE/K/N -* You can use this parameter to override the packet type the -* stack uses when sending ARP packets. Default is 2054; this -* parameter only works with Ethernet hardware and should not be -* changed. -* -* IPREQUESTS/K/N -* The number of IP read requests to allocate and queue for the -* SANA-II device driver to use. The default value is 32, larger -* values can improve performance, especially with fast device -* drivers. -* -* WRITEREQUESTS/K/N -* The number of IP write requests to allocate and queue for the -* SANA-II device driver to use. The default value is 32, larger -* values can improve performance, especially with fast device -* drivers. -* -* ARPREQUESTS/K/N -* The number of ARP read requests to allocate and queue for the -* SANA-II device driver to use. The default value is 4. -* -* DEBUG/K (possible parameters: YES or NO) -* You can enable debug output for this interface (don't worry, -* you can always disable it later) to help in tracking down -* configuration problems. At this time of writing, the debug -* mode will, if enabled, produce information on the progress of -* the DHCP configuration process. -* -* POINTTOPOINT/K (possible parameters: YES or NO) -* This indicates that the device is used for point to point -* connections. The stack automatically figures out whether the -* SANA-II device driver is of the point to point type, so you -* should not need to specify this option. -* -* MULTICAST/K (possible parameters: YES or NO) -* This tells the stack that this device can handle multicast -* packets. 'YES' only works with Ethernet hardware (where it's -* enabled by default anyway). -* -* DOWNGOESOFFLINE/K (possible parameters: YES or NO) -* This option is useful with point to point devices, like -* 'ppp.device'. When specified, bringing the interface 'down' -* (via the 'ConfigureNetInterface' program) or shutting down the -* stack will cause the associated SANA-II device driver to be -* switched offline (via the 'S2_OFFLINE' command). -* -* REPORTOFFLINE/K (possible parameters: YES or NO) -* When a device is switched offline, you may want to know about -* it. This is helpful with SLIP/PPP connections which run over a -* serial link which accumulates costs while it is open. When the -* connection is broken and the device goes offline, you will -* receive a brief notification of what happened. However, if you -* tell the library itself to shut down, no notification that a -* device was switched offline will be shown. -* -* REQUIRESINITDELAY/K (possible parameters: YES or NO) -* Some devices need a little time to settle after they have been -* opened or they will hickup and lose data after the first -* packet has been sent. The original 'Ariadne I' card is one -* such device. For these devices, the 'REQUIRESINITDELAY=YES' -* option will cause a delay of about a second before the first -* packet is sent. -* -* This option defaults to YES. -* -* COPYMODE/K (possible parameters: SLOW or FAST) -* This option is for chasing subtle bugs in the driver interface -* with cards like the original 'Ariadne I'. Cards like these do -* not support writing to the hardware transmit buffer in units -* other than 16 bits a piece. Default is 'SLOW', which is -* compatible with the Ariadne I. But if you're feeling -* adventurous, try the 'FAST' option (and don't complain if it -* doesn't work for you!). -* -* FILTER/K (possible parameters: OFF, LOCAL, IPANDARP or EVERYTHING) -* This option enables the use of the Berkeley packet filter for -* this particular interface. Possible choices for the key are: -* -* FILTER=OFF -* Disables the filter. -* -* FILTER=LOCAL -* Enables filtering on all IP and ARP packets that are -* intended for this particular interface. Packets -* intended for other interfaces or hosts are ignored. -* -* FILTER=IPANDARP -* Enables filtering on all IP and ARP packets that -* happen to fly by this interface, no matter whether the -* packets are intended for it or not. This requires that -* the underlying network device driver is opened for -* exclusive access in so-called 'promiscuous' mode. This -* may not work if other clients (Envoy, ACS) need to -* keep the driver opened. -* -* FILTER=EVERYTHING -* Identical to FILTER=IPANDARP, but will also filter all -* other kinds of packets that may show up. -* -* Default for this option is 'FILTER=LOCAL'. Note that by using -* this option you merely define what the filter mechanism can do -* and what it cannot do. The filter is not enabled when you add -* the interface. -* -* HARDWAREADDRESS/K -* You can specify the hardware address (layer 2 address, MAC -* address) this interface should respond to when it is first -* added and configured. This usually works only once for each -* interface, which means that once an address has been chosen -* you have to stick with it until the system is rebooted. And it -* also means that the first program to configure the address -* will manage to make its choice stick. -* -* The hardware address must be given as six bytes in hexadecimal -* notation, separated by colon characters, like this: -* -* HARDWAREADDRESS=00:60:30:00:11:22 -* -* Take care, there are rules that apply to the choice of the -* hardware address, which means that you cannot simply pick a -* convenient number and get away with it. It is assumed that you -* will want to configure an IEEE 802.3 MAC address, which works for -* Ethernet hardware and is six bytes (48 bits) in size. -* -* In addition to the purely static interface configuration information you -* can also tell the configuration program to do something about the -* interfaces once they have all been added. That's when the following -* configuration file parameters will be taken into account: -* -* ADDRESS/K -* This configures the IP address of the interface. The parameter -* you supply should be an IP address in dotted-decimal notation -* ("192.168.0.1"). Don't pick a symbolic host name as the system -* may not yet be in a position to talk to name resolution server -* and translate the symbolic name. -* -* In place of the IP address you can also specify "DHCP" -* (Dynamic Host Configuration Protocol). As the name suggests, -* this will start a configuration process involving the DHCP -* protocol which should eventually yield the right IP address -* for this host. Note that this configuration procedure only -* works for Ethernet hardware. -* -* ALIAS/K/M -* In addition to the primary interface address you can assign -* several aliases to it. These must be specified in -* dotted-decimal notation ("192.168.0.1"). Alias addresses are -* added after the primary interface address has been configured. -* -* STATE/K -* By default, interfaces whose addresses are configured will -* switch automatically to 'up' state, making it possible for the -* TCP/IP stack to use them for network I/O. You can override -* this by using the 'STATE=DOWN' switch. The alternatives -* 'online' (implies 'up', but tells the underlying network -* interface driver to go online first) and 'offline' (implies -* 'down' but tells the driver to go offline first) are available -* as well. -* -* NETMASK/K -* This selects the subnet mask for the interface, which must be -* specified in dotted-decimal notation ("192.0.168.1"). -* -* In place of the subnet mask you can also specify "DHCP" -* (Dynamic Host Configuration Protocol). As the name suggests, -* this will start a configuration process involving the DHCP -* protocol which should eventually yield the right subnet mask -* for this host. Note that this configuration procedure only -* works for Ethernet hardware. -* -* DESTINATION=DESTINATIONADDR/K -* The address of the point-to-point partner for this interface; -* must be specified in dotted-decimal notation ("192.168.0.1"). -* Only works for point-to-point connections, such as PPP. -* -* METRIC/K/N -* This configures the interface route metric value. Default -* is 0. -* -* MTU/K/N -* You can limit the maximum transmission size used by the TCP/IP -* stack to push data through the interface. The interface driver -* will have its own ideas about the maximum transmission size. -* You can therefore only suggest a smaller value than the -* driver's preferred hardware MTU size. -* -* CONFIGURE/K (possible parameters: DHCP, AUTO or FASTAUTO) -* You can use DHCP configuration for this interface and protocol -* stack internals, namely the list of routers (and the default -* gateway) to use and the domain name servers. This option -* allows you to bring up the complete network configuration in -* one single step. -* -* You can request that a particular IP address is assigned to -* this interface by the DHCP process by specifying -* CONFIGURE=DHCP and your choice of ADDRESS=xxx.xxx.xxx.xxx. -* -* If your network has no DHCP server, you may choose -* CONFIGURE=AUTO to use automatic IPv4 address selection, -* based upon a protocol called ZeroConf. This protocol will -* select a currently unused address from a specially -* designated address range. -* -* If you choose automatic configuration in a wireless network, -* you might want to use CONFIGURE=FASTAUTO instead of -* CONFIGURE=AUTO. -* -* Note that only the CONFIGURE=DHCP option will attempt to -* set up a default route and a set of DNS servers for you to -* use. The alternatives of CONFIGURE=FASTAUTO and -* CONFIGURE=AUTO are restricted to selecting the network -* interface IPv4 addresses. -* -* LEASE/K -* This is a complex option which can be used to request how long -* an IP address should be bound to an interface, via the DHCP -* protocol. Several combinations of options are possible. Here -* is a short list: -* -* LEASE=300 -* LEASE=300seconds -* This requests a lease of exactly 300 seconds, or -* five minutes. -* -* LEASE=30min -* This requests a lease of 30 minutes. -* -* LEASE=2hours -* This requests a lease of 2 hours. -* -* LEASE=1day -* This requests a lease of 1 day. -* -* LEASE=4weeks -* This requests a lease of 4 weeks. -* -* LEASE=infinite -* This requests that the IP address should be -* permanently bound. -* -* Blank spaces between the numbers and the qualifiers are -* supported. The qualifiers are tested using substring matching, -* which means for example that "30 minutes" is the same as "30 -* min" and "30 m". -* -* Note that the requested lease time may be ignored by the DHCP -* server. After all, it is just a suggestion and not an order. -* -* ID/K -* This option works along with the CONFIGURE=DHCP process. It -* can be used to tell the DHCP server by which name the local -* host should be referred to. Some DHCP servers are on good -* terms with their local name resolution services and will add -* the name and the associated IP address to the local host -* database. The name you can supply here cannot be longer than -* 255 characters and must be at least 2 characters long. Keep it -* brief: not all DHCP servers have room for the whole 255 -* characters. -* -* DHCPUNICAST/K -* Some DHCP servers may not be able to respond to requests for -* assigning IP addresses unless the responses are sent directly -* to the computer which sent the requests. In such cases you -* might want to use DHCPUNICAST=YES option. -* -* Unsupported keywords in the configuration file (or typos) will be -* reported, along with the name of the file and the line number. -* -* The name of the configuration file defines the name of the respective -* interface. Interface names must be unique, and the case of the names -* does not matter. For historic reasons interface names cannot be longer -* than 15 characters. Beyond this no restrictions on naming conventions -* apply. -* -* DHCP PROTOCOL -* A few words on DHCP (Dynamic Host Configuration Protocol). First, it -* only works for Ethernet hardware, so please don't try it with PPP or -* SLIP. Now it gets a bit technical. Unless you request an address to be -* permanently assigned, DHCP will assign addresses only for a limited -* period of time. This is called a 'lease'. Once an IP address has been -* assigned through DHCP, the lease will be repeatedly extended. The DHCP -* server may over time decide not to extend the lease or assign a new IP -* address to the interface. To stop the lease from getting extended over -* and over again, you must either change the interface's primary IP -* address or mark it 'down'. The library will make a brave attempt to -* get a DHCPRELEASE datagram out to notify the server that the -* previously allocated IP address is no longer in use. Don't count on it -* to work, though. First, the protocol stack might be going down so fast -* that it cannot get the datagram out. Second, when you mark an -* interface 'down' you will effectively pull it out of circulation, it -* will not send any further datagrams. Third, DHCP rides on UDP whose -* second name is 'unreliable datagram protocol', meaning that any -* datagram may get lost or corrupted and nobody will hear about it; this -* is rather hard on DHCP since the release message is sent only once. -* Don't worry. Unless you request permanent leases, the leases will -* eventually time out and the now unused IP address will finally return -* to the pool of addresses available for allocation. -* -* EXAMPLES -* Start the interface called "DSL" and run quietly. -* -* 1> AddNetInterface DSL QUIET -* -* An example configuration file for the "Ariadne" interface, with -* some options commented out: -* -* 1> Type Devs:NetInterfaces/Ariadne -* device=ariadne.device -* unit=0 -* #iprequests=64 -* #writerequests=64 -* copymode=fast -* #configure=dhcp -* address=192.168.0.1 -* netmask=255.255.255.0 -* #alias=192.168.0.9 -* #hardwareaddress=00:60:30:00:11:22 -* #id=a3000ux -* #debug=yes -* #filter=everything -* -* SEE ALSO -* ConfigureNetInterface -* NetShutdown -* -****************************************************************************** -*/ - -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - /* If launched from Workbench, pick up the startup message. */ - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - - WaitPort(mp); - - cc->cc_StartupMessage = (struct WBStartup *)GetMsg(mp); - } - - /* Try to open the necessary libraries. */ - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - DECLARE_DOSBASE(cc); - - /* If possible, open the catalog which contains the localized - program message. */ - if(cc->cc_LocaleBase != NULL) - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - - /* Do what the program needs to do. */ - result = cmd(cc); - - /* Clean up... */ - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - - if(cc->cc_Tags != NULL) - FreeVec(cc->cc_Tags); - - if(cc->cc_AnchorPath != NULL) - { - MatchEnd(cc->cc_AnchorPath); - - #if defined(__amigaos4__) - { - FreeDosObject(DOS_ANCHORPATH,cc->cc_AnchorPath); - } - #else - { - FreeVec(cc->cc_AnchorPath); - } - #endif /* __amigaos4__ */ - } - - if(cc->cc_RDA != NULL) - { - FreeArgs(cc->cc_RDA); - FreeDosObject(DOS_RDARGS,cc->cc_RDA); - } - - if(cc->cc_File != ZERO) - Close(cc->cc_File); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - /* Return the Workbench startup message. */ - if(cc->cc_StartupMessage != NULL) - { - Forbid(); - - ReplyMsg((struct Message *)cc->cc_StartupMessage); - } - - return(result); -} - -/****************************************************************************/ - -/* Close all the libraries opened by open_libs(). */ -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - - if(cc->cc_ISocket != NULL) - DropInterface((struct Interface *)cc->cc_ISocket); - - if(cc->cc_IUtility != NULL) - DropInterface((struct Interface *)cc->cc_IUtility); - - if(cc->cc_IIcon != NULL) - DropInterface((struct Interface *)cc->cc_IIcon); - - if(cc->cc_IIntuition != NULL) - DropInterface((struct Interface *)cc->cc_IIntuition); - } - #endif /* __amigaos4__ */ - - if(cc->cc_IntuitionBase != NULL) - CloseLibrary(cc->cc_IntuitionBase); - - if(cc->cc_IconBase != NULL) - CloseLibrary(cc->cc_IconBase); - - if(cc->cc_UtilityBase != NULL) - CloseLibrary(cc->cc_UtilityBase); - - if(cc->cc_SocketBase != NULL) - CloseLibrary(cc->cc_SocketBase); - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -/* Open all the required libraries. */ -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - cc->cc_UtilityBase = OpenLibrary("utility.library",37); - - #if defined(__amigaos4__) - { - if(cc->cc_UtilityBase != NULL) - { - cc->cc_IUtility = (struct UtilityIFace *)GetInterface(cc->cc_UtilityBase, "main", 1, 0); - if(cc->cc_IUtility == NULL) - { - CloseLibrary(cc->cc_UtilityBase); - cc->cc_UtilityBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - cc->cc_IconBase = OpenLibrary("icon.library",37); - - #if defined(__amigaos4__) - { - if(cc->cc_IconBase != NULL) - { - cc->cc_IIcon = (struct IconIFace *)GetInterface(cc->cc_IconBase, "main", 1, 0); - if(cc->cc_IIcon == NULL) - { - CloseLibrary(cc->cc_IconBase); - cc->cc_IconBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - cc->cc_IntuitionBase = OpenLibrary("intuition.library",37); - - #if defined(__amigaos4__) - { - if(cc->cc_IntuitionBase != NULL) - { - cc->cc_IIntuition = (struct IntuitionIFace *)GetInterface(cc->cc_IntuitionBase, "main", 1, 0); - if(cc->cc_IIntuition == NULL) - { - CloseLibrary(cc->cc_IntuitionBase); - cc->cc_IntuitionBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - cc->cc_SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(cc->cc_SocketBase != NULL) - { - cc->cc_ISocket = (struct SocketIFace *)GetInterface(cc->cc_SocketBase, "main", 1, 0); - if(cc->cc_ISocket == NULL) - { - CloseLibrary(cc->cc_SocketBase); - cc->cc_SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define ADDNETINTERFACE_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -/* This is the main() program, so to speak. */ -STATIC LONG -cmd(struct CommandContext * cc) -{ - STRPTR devs_prefix = "DEVS:NetInterfaces"; - STRPTR storage_prefix = "SYS:Storage/NetInterfaces"; - - struct - { - KEY * Interface; - SWITCH Quiet; - NUMBER Timeout; - } args; - - STRPTR args_template = - "INTERFACE/M," - "QUIET/S," - "TIMEOUT/K/N" - VERSTAG; - - DECLARE_SYSBASE(cc); - DECLARE_DOSBASE(cc); - DECLARE_UTILITYBASE(cc); - DECLARE_ICONBASE(cc); - DECLARE_SOCKETBASE(cc); - - struct List interface_list; - ULONG interface_list_size; - UBYTE * buf = NULL; - LONG result = RETURN_FAIL; - struct RDArgs * rda = NULL; - LONG timeout = 60; - BPTR old_cd = ZERO; - BOOL old_cd_valid = FALSE; - struct DiskObject * icon = NULL; - BOOL configuration_trouble = FALSE; - - NewList(&interface_list); - interface_list_size = 0; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - /* If started from shell, read the command arguments. */ - if(cc->cc_StartupMessage == NULL) - { - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - error_print_fault(cc,IoErr()); - goto out; - } - - cc->cc_Quiet = (BOOL)(args.Quiet != 0); - } - - /* Did we manage to open utility.library? */ - if(UtilityBase == NULL) - { - if(NOT cc->cc_Quiet) - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NO_UTILITY_TXT)); - - goto out; - } - - /* Did we manage to open bsdsocket.library? */ - if(SocketBase == NULL) - { - if(NOT cc->cc_Quiet) - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT)); - - goto out; - } - else - { - LONG have_interface_api = FALSE; - LONG have_routing_api = FALSE; - LONG have_address_conversion_api = FALSE; - - /* Check if the bsdsocket.library we managed to open supports the - various APIs we expect below. */ - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_INTERFACE_API),&have_interface_api, - TAG_END) != 0) - { - have_interface_api = FALSE; - } - - if(NOT have_interface_api) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT), - SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_ROUTING_API),&have_routing_api, - TAG_END) != 0) - { - have_routing_api = FALSE; - } - - if(NOT have_routing_api) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT), - SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_ADDRESS_CONVERSION_API),&have_address_conversion_api, - TAG_END) != 0) - { - have_address_conversion_api = FALSE; - } - - if(NOT have_address_conversion_api) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT), - SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - } - - /* This is required by the code that reads the configuration - file. And we allocate this data here because if we had - allocated it before Intuition was opened, error display - would have been difficult. */ - cc->cc_RDA = AllocDosObject(DOS_RDARGS,NULL); - if(cc->cc_RDA == NULL) - { - if(NOT cc->cc_Quiet) - error_print_fault(cc,IoErr()); - - goto out; - } - - /* If started from shell, process the command line arguments. */ - if(cc->cc_StartupMessage == NULL) - { - KEY * interface_table; - int operating_mode; - STRPTR interface; - struct Node * node; - - /* This is to be used for pattern matching when trying to find - the interfaces to add. */ - #if defined(__amigaos4__) - { - cc->cc_AnchorPath = AllocDosObjectTags(DOS_ANCHORPATH, - ADO_Strlen, MAX_FILENAME_LEN, - ADO_Mask, SIGBREAKF_CTRL_C, - TAG_END); - } - #else - { - cc->cc_AnchorPath = AllocVec(sizeof(*cc->cc_AnchorPath) + MAX_FILENAME_LEN,MEMF_ANY|MEMF_PUBLIC); - if(cc->cc_AnchorPath != NULL) - memset(cc->cc_AnchorPath,0,sizeof(*cc->cc_AnchorPath)); - } - #endif /* __amigaos4__ */ - - if(cc->cc_AnchorPath == NULL) - { - if(NOT cc->cc_Quiet) - error_print_fault(cc,IoErr()); - - goto out; - } - - if(args.Timeout != NULL && (*args.Timeout) > 0) - { - timeout = (*args.Timeout); - if(timeout < AAM_TIMEOUT_MIN) - { - if(NOT cc->cc_Quiet) - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_TIMEOUT_TOO_SHORT_TXT), - timeout,AAM_TIMEOUT_MIN); - } - - timeout = 10; - } - } - - /* There has to be at least one interface name we can work with. */ - if(args.Interface == NULL) - { - if(NOT cc->cc_Quiet) - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NO_INTERFACE_NAME_GIVEN_TXT)); - - result = RETURN_ERROR; - - goto out; - } - - result = RETURN_OK; - - /* Check each interface name given; if it's a wildcard pattern, expand it. */ - interface_table = args.Interface; - - while((interface = (*interface_table++)) != NULL) - { - /* Not an absolute path name? Look into DEVS: instead. */ - if(FilePart(interface) == interface) - { - LONG len = strlen(interface); - LONG max_name_size = strlen(storage_prefix) + 1 + len + 1; - BPTR file_lock; - D_S(struct FileInfoBlock,fib); - BOOL have_name = FALSE; - LONG error = 0; - - if(CheckSignal(SIGBREAKF_CTRL_C)) - { - if(NOT cc->cc_Quiet) - error_print_fault(cc,ERROR_BREAK); - - goto out; - } - - node = AllocVec(sizeof(*node) + max_name_size,MEMF_ANY|MEMF_PUBLIC); - if(node == NULL) - { - if(NOT cc->cc_Quiet) - error_print_fault(cc,IoErr()); - - result = RETURN_ERROR; - - goto out; - } - - node->ln_Name = (char *)(node + 1); - node->ln_Pri = 0; - - /* Check if the interface file exists in the local directory. - Make sure that it's a file, too. */ - file_lock = Lock(interface,SHARED_LOCK); - if(file_lock != ZERO && Examine(file_lock,fib)) - { - if(fib->fib_DirEntryType < 0) - { - strcpy(node->ln_Name,interface); - have_name = TRUE; - } - else - { - error = ERROR_OBJECT_WRONG_TYPE; - } - } - else - { - error = IoErr(); - } - - UnLock(file_lock); - - /* If we still don't have a name, look into "DEVS:NetInterfaces". */ - if(NOT have_name && (error == ERROR_OBJECT_WRONG_TYPE || error == ERROR_OBJECT_NOT_FOUND)) - { - strcpy(node->ln_Name,devs_prefix); - AddPart(node->ln_Name,interface,max_name_size); - - file_lock = Lock(node->ln_Name,SHARED_LOCK); - if(file_lock != ZERO && Examine(file_lock,fib)) - { - if(fib->fib_DirEntryType < 0) - have_name = TRUE; - else - error = ERROR_OBJECT_WRONG_TYPE; - } - else - { - error = IoErr(); - } - - UnLock(file_lock); - } - - /* If we still don't have a name, look into "SYS:Storage/NetInterfaces". */ - if(NOT have_name && (error == ERROR_OBJECT_WRONG_TYPE || error == ERROR_OBJECT_NOT_FOUND)) - { - strcpy(node->ln_Name,storage_prefix); - AddPart(node->ln_Name,interface,max_name_size); - - file_lock = Lock(node->ln_Name,SHARED_LOCK); - if(file_lock != ZERO && Examine(file_lock,fib)) - { - if(fib->fib_DirEntryType < 0) - have_name = TRUE; - else - error = ERROR_OBJECT_WRONG_TYPE; - } - else - { - error = IoErr(); - } - - UnLock(file_lock); - } - - if(have_name) - { - /* Try to read the interface priority from the - icon attached to the file, if there is any. */ - if(IconBase != NULL) - { - struct DiskObject * icon; - - icon = GetDiskObject(node->ln_Name); - if(icon != NULL) - { - STRPTR priority; - - priority = FindToolType(icon->do_ToolTypes,"PRI"); - if(priority == NULL) - priority = FindToolType(icon->do_ToolTypes,"PRIORITY"); - - if(priority != NULL) - { - LONG value; - - if(StrToLong(priority,&value) > 0) - { - if(-128 <= value && value <= 127) - node->ln_Pri = value; - } - } - - FreeDiskObject(icon); - } - } - - add_interface_node(cc,&interface_list,node); - interface_list_size++; - } - else - { - if(NOT cc->cc_Quiet) - error_print_fault_prefix(cc,error,interface); - - result = RETURN_ERROR; - - goto out; - } - } - else - { - static STRPTR info_suffix = ".info"; - const int info_suffix_len = strlen(info_suffix); - LONG error; - - /* We may have to check an icon or two, so icon.library better be open. */ - if(IconBase == NULL) - { - if(NOT cc->cc_Quiet) - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NO_ICON_TXT)); - - goto out; - } - - MatchEnd(cc->cc_AnchorPath); - - #ifndef __amigaos4__ - { - memset(cc->cc_AnchorPath,0,sizeof(*cc->cc_AnchorPath)); - - cc->cc_AnchorPath->ap_Strlen = MAX_FILENAME_LEN; - cc->cc_AnchorPath->ap_BreakBits = SIGBREAKF_CTRL_C; - } - #endif /* __amigaos4__ */ - - /* Find all the files that match the pattern, if any. */ - error = MatchFirst(interface,cc->cc_AnchorPath); - while(error == OK) - { - /* Careful there, only check files! */ - if(cc->cc_AnchorPath->ap_Info.fib_DirEntryType < 0) - { - int len = strlen(cc->cc_AnchorPath->ap_Buf); - - /* Files whose names end with ".info" are ignored. */ - if(len < info_suffix_len || Stricmp(&cc->cc_AnchorPath->ap_Buf[len - info_suffix_len],info_suffix) != SAME) - { - struct DiskObject * icon; - - node = AllocVec(sizeof(*node) + strlen(cc->cc_AnchorPath->ap_Buf)+1,MEMF_ANY); - if(node == NULL) - { - error = ERROR_NO_FREE_STORE; - break; - } - - node->ln_Name = (char *)(node + 1); - node->ln_Pri = 0; - - strcpy(node->ln_Name,cc->cc_AnchorPath->ap_Buf); - - icon = GetDiskObject(node->ln_Name); - if(icon != NULL) - { - STRPTR priority; - - priority = FindToolType(icon->do_ToolTypes,"PRI"); - if(priority == NULL) - priority = FindToolType(icon->do_ToolTypes,"PRIORITY"); - - if(priority != NULL) - { - LONG value; - - if(StrToLong(priority,&value) > 0) - { - if(-128 <= value && value <= 127) - node->ln_Pri = value; - } - } - - FreeDiskObject(icon); - } - - add_interface_node(cc,&interface_list,node); - interface_list_size++; - } - } - - error = MatchNext(cc->cc_AnchorPath); - } - - if(error != OK && error != ERROR_NO_MORE_ENTRIES) - { - if(NOT cc->cc_Quiet) - error_print_fault(cc,IoErr()); - - result = RETURN_ERROR; - - goto out; - } - } - } - - /* Now run through all the steps of the configuration process, - adding each interface in turn. */ - for(operating_mode = AIM_Add ; operating_mode <= AIM_Configure ; operating_mode++) - { - for(node = interface_list.lh_Head ; node->ln_Succ != NULL ; node = node->ln_Succ) - { - result = add_interface(cc,node->ln_Name,operating_mode,timeout); - if(result != OK) - { - /* Fail only if there is one single interface involved. */ - if(interface_list_size == 1) - goto out; - - configuration_trouble = TRUE; - } - } - } - } - else - { - result = RETURN_OK; - - /* We may have to check an icon or two, so icon.library better be open. */ - if(IconBase == NULL) - { - if(NOT cc->cc_Quiet) - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NO_ICON_TXT)); - - goto out; - } - - /* We need at least one project icon to be invoked with this command. */ - if(cc->cc_StartupMessage->sm_NumArgs > 1) - { - D_S(struct FileInfoBlock,fib); - int operating_mode; - BOOL fib_valid; - BPTR lock; - LONG i; - - memset(fib,0,sizeof(fib)); - - /* Run down the project icons. */ - for(i = 1 ; i < cc->cc_StartupMessage->sm_NumArgs ; i++) - { - /* These are the default settings which can be - overridden through icon tool types. */ - timeout = 60; - cc->cc_Quiet = FALSE; - - /* Free the last icon we may have dealt with. */ - if(icon != NULL) - { - FreeDiskObject(icon); - icon = NULL; - } - - /* Remember the current directory we started with. It has - to be restored, eventually. */ - if(NOT old_cd_valid) - { - old_cd = CurrentDir(cc->cc_StartupMessage->sm_ArgList[i].wa_Lock); - - old_cd_valid = TRUE; - } - else - { - CurrentDir(cc->cc_StartupMessage->sm_ArgList[i].wa_Lock); - } - - fib_valid = FALSE; - - /* Try to figure out what kind of object we are dealing - with and, if it's a file, check the icon tool types. */ - lock = Lock(cc->cc_StartupMessage->sm_ArgList[i].wa_Name,SHARED_LOCK); - if(lock != ZERO) - { - if(Examine(lock,fib)) - { - fib_valid = TRUE; - - if(icon == NULL) - { - icon = GetDiskObject(cc->cc_StartupMessage->sm_ArgList[i].wa_Name); - if(icon != NULL) - { - STRPTR str; - - str = FindToolType(icon->do_ToolTypes,"QUIET"); - if(str != NULL) - cc->cc_Quiet = TRUE; - - str = FindToolType(icon->do_ToolTypes,"TIMEOUT"); - if(str != NULL) - { - LONG val; - - if((StrToLong(str,&val) > 0) && (val > 0)) - { - if(val < 10) - val = 10; - - timeout = val; - } - } - } - } - } - - UnLock(lock); - } - - /* If we found a likely configuration file, take care of it. */ - if(fib_valid && (fib->fib_DirEntryType < 0)) - { - /* Run through the configuration steps for this icon. */ - for(operating_mode = AIM_Add ; operating_mode <= AIM_Configure ; operating_mode++) - { - result = add_interface(cc,cc->cc_StartupMessage->sm_ArgList[i].wa_Name,operating_mode,timeout); - if(result != OK) - { - /* Fail only if there is one single interface involved. */ - if(cc->cc_StartupMessage->sm_NumArgs == 1) - goto out; - - configuration_trouble = TRUE; - } - } - } - } - } - } - - if(configuration_trouble) - result = RETURN_WARN; - - out: - - if(NOT IsListEmpty(&interface_list)) - { - struct Node * node; - - while((node = RemHead(&interface_list)) != NULL) - FreeVec(node); - } - - if(old_cd_valid) - CurrentDir(old_cd); - - if(icon != NULL) - FreeDiskObject(icon); - - DeleteMsgPort(cc->cc_ReplyPort); - - if(cc->cc_Quiet && result != RETURN_OK) - result = RETURN_WARN; - - FreeVec(buf); - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -/****************************************************************************/ - -/* Check if a string reads as YES/NO or ON/OFF. */ -STATIC LONG -match_key(struct CommandContext * cc,STRPTR what) -{ - DECLARE_UTILITYBASE(cc); - - LONG result; - - if(Stricmp(what,"YES") == SAME || - Stricmp(what,"ON") == SAME) - { - result = TRUE; - } - else if (Stricmp(what,"NO") == SAME || - Stricmp(what,"OFF") == SAME) - { - result = FALSE; - } - else - { - result = -1; - } - - return(result); -} - -/****************************************************************************/ - -/* Add a new tag item to a list being built. */ -STATIC LONG -add_tag(struct CommandContext * cc,Tag tag,ULONG data) -{ - DECLARE_SYSBASE(cc); - - LONG error = OK; - LONG which = -1; - LONG i; - - for(i = 0 ; i < cc->cc_NumTags ; i++) - { - if(cc->cc_Tags[i].ti_Tag == tag) - { - which = i; - break; - } - } - - if(which == -1 && cc->cc_NumTags + 1 >= cc->cc_MaxTags) - { - struct TagItem * new_tags; - - new_tags = AllocVec(sizeof(*new_tags) * (cc->cc_MaxTags+10),MEMF_ANY|MEMF_PUBLIC); - if(new_tags == NULL) - { - error = ERROR_NO_FREE_STORE; - goto out; - } - - if(cc->cc_Tags != NULL) - CopyMem(cc->cc_Tags,new_tags,sizeof(*new_tags) * cc->cc_NumTags); - - FreeVec(cc->cc_Tags); - cc->cc_Tags = new_tags; - cc->cc_MaxTags += 10; - } - - if(which == -1) - which = cc->cc_NumTags++; - - cc->cc_Tags[which].ti_Tag = tag; - cc->cc_Tags[which].ti_Data = data; - - out: - - return(error); -} - -/****************************************************************************/ - -/* Check if a character is considered a blank space. This includes - the ' ', '\t' and '\240' characters. */ -STATIC BOOL -is_blank_space(UBYTE c) -{ - BOOL result; - - result = (BOOL)(c == ' ' || c == '\t' || c == (UBYTE)'\240'); - - return(result); -} - -/****************************************************************************/ - -/* Get the next token from a string; tokens are separated by blank spaces - or the colon character. This is used for configuring the hardware - address of an Ethernet interface. */ -STATIC STRPTR -get_next_token( - STRPTR input, - STRPTR string, - LONG string_len) -{ - if((*input) == '\0') - { - input = NULL; - } - else - { - UBYTE c; - - while(is_blank_space(*input) || (*input) == ':') - input++; - - while(TRUE) - { - c = (*input++); - - /* Stop at the end of the string or when a blank - space is found. */ - if(c == '\0') - { - input--; - break; - } - else if (is_blank_space(c) || c == ':') - { - break; - } - - if(string_len > 1) - { - (*string++) = c; - string_len--; - } - } - - if(string_len > 0) - (*string) = '\0'; - } - - return(input); -} - -/****************************************************************************/ - -/* Convert a hexadecimal number into a 32 bit integer. */ -STATIC LONG -get_hex_value(struct CommandContext * cc,STRPTR str) -{ - DECLARE_UTILITYBASE(cc); - - LONG result = -1; - LONG value = 0; - LONG len = 0; - UBYTE c; - - while((c = ToUpper(*str++)) != '\0') - { - len++; - if(len > 2) - goto out; - - if('0' <= c && c <= '9') - c = c - '0'; - else if ('A' <= c && c <= 'F') - c = c - 'A' + 10; - else - goto out; - - value = (16 * value) + c; - } - - result = value; - - out: - - return(result); -} - -/****************************************************************************/ - -/* Turn an 8 bit integer into a hexadecimal string. */ -STATIC VOID -get_hex_string(LONG value,STRPTR str) -{ - STATIC UBYTE code[] = "0123456789ABCDEF"; - - str[0] = code[(value & 0xF0) >> 4]; - str[1] = code[(value & 0x0F) ]; - str[2] = '\0'; -} - -/****************************************************************************/ - -/* Remove all unprintable characters from a string. */ -STATIC VOID -strip_unprintable_characters(STRPTR s) -{ - STRPTR t = s; - UBYTE c; - - while((c = (*s++)) != '\0') - { - if((c >= ' ' || c == '\t') && (c < '\177' || c >= (UBYTE)'\240')) - (*t++) = c; - } - - (*t) = '\0'; -} - -/****************************************************************************/ - -/* Strip leading and trailing blank spaces from a string. */ -STATIC VOID -strip_extra_blank_spaces(STRPTR s) -{ - LONG num_leading_spaces; - LONG num_trailing_spaces; - LONG len,i; - - len = strlen(s); - - num_leading_spaces = 0; - - for(i = 0 ; i < len ; i++) - { - if(NOT is_blank_space(s[i])) - break; - - num_leading_spaces++; - } - - num_trailing_spaces = 0; - - for(i = len-1 ; i >= 0 ; i--) - { - if(NOT is_blank_space(s[i])) - break; - - num_trailing_spaces++; - } - - if(num_trailing_spaces > 0) - { - len -= num_trailing_spaces; - s[len] = '\0'; - } - - if(num_leading_spaces > 0) - memmove(s,&s[num_leading_spaces],len+1); -} - -/****************************************************************************/ - -/* This is the big one. It reads the configuration file and acts upon what it finds. */ -STATIC LONG -add_interface(struct CommandContext * cc,STRPTR name,enum add_interface_mode_t operating_mode,LONG timeout) -{ - /* This is where the configuration file data will go. */ - struct - { - KEY Device; - NUMBER Unit; - NUMBER IPType; - NUMBER ARPType; - NUMBER IPRequests; - NUMBER WriteRequests; - NUMBER ARPRequests; - KEY HardwareType; /* This is always ignored; it's only for the prefs editor to use! */ - KEY Debug; - KEY Filter; - KEY PointToPoint; - KEY Multicast; - KEY DownGoesOffline; - KEY ReportOffline; - KEY RequiresInitDelay; - KEY CopyMode; - KEY Address; - KEY * Alias; - KEY NetMask; - KEY State; - KEY BroadcastAddress; - KEY DestinationAddress; - KEY HardwareAddress; - NUMBER Metric; - NUMBER MTU; - KEY Configure; - KEY Lease; - KEY ID; - KEY DHCPUnicast; - } args; - - /* This command template corresponds to the parameter definitions above. */ - STRPTR args_template = - "DEVICE/K," - "UNIT/K/N," - "IPTYPE/K/N," - "ARPTYPE/K/N," - "IPREQUESTS/K/N," - "WRITEREQUESTS/K/N," - "ARPREQUESTS/K/N," - "HARDWARETYPE/K," - "DEBUG/K," - "FILTER/K," - "POINTTOPOINT/K," - "MULTICAST/K," - "DOWNGOESOFFLINE/K," - "REPORTOFFLINE/K," - "REQUIRESINITDELAY/K," - "COPYMODE/K," - "ADDRESS/K," - "ALIAS/K/M," - "NETMASK/K," - "STATE/K," - "BROADCASTADDRESS/K," - "DESTINATION=DESTINATIONADDRESS/K," - "HARDWAREADDRESS/K," - "METRIC/K/N," - "MTU/K/N," - "CONFIGURE/K," - "LEASE/K," - "ID/K," - "DHCPUNICAST/K"; - - DECLARE_SYSBASE(cc); - DECLARE_DOSBASE(cc); - DECLARE_UTILITYBASE(cc); - DECLARE_SOCKETBASE(cc); - - STRPTR hardware_address = NULL; - struct InterfaceHardwareAddress iha; - LONG interface_state = SM_Up; - STRPTR address = NULL; - STRPTR net_mask = NULL; - STRPTR broadcast_address = NULL; - STRPTR destination_address = NULL; - LONG metric = 0; - STRPTR device_name = NULL; - LONG device_unit = 0; - LONG result = RETURN_FAIL; - STRPTR interface_name = FilePart(name); - UBYTE default_domain_name[256]; - UBYTE str[512]; - UBYTE *s; - UBYTE *t; - UBYTE *v; - LONG line_number; - LONG error; - LONG len; - LONG i; - LONG separator_index; - UBYTE separator_char; - BOOL configure_dynamic = FALSE; - BOOL configure_auto = FALSE; - BOOL configure_slow_auto = FALSE; - ULONG lease_time = DHCP_DEFAULT_LEASE_TIME; - STRPTR client_id = NULL; - struct List alias_list; - struct Node * node; - LONG dhcp_unicast = FALSE; - - NewList(&alias_list); - - memset(&iha,0,sizeof(iha)); - - /* Try to open the configuration file. */ - cc->cc_File = Open(name,MODE_OLDFILE); - if(cc->cc_File == ZERO) - { - if(NOT cc->cc_Quiet) - { - error = IoErr(); - - Fault(error,NULL,str,sizeof(str)); - - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_CANNOT_OPEN_FILE_TXT), - name,str); - } - - goto out; - } - - /* Use a larger buffer to make reading from the configuration - file a little more efficient. */ - SetVBuf(cc->cc_File,NULL,BUF_LINE,sizeof(str)); - - /* Free any configuration items allocated before. */ - FreeVec(cc->cc_Tags); - cc->cc_Tags = NULL; - - cc->cc_MaxTags = cc->cc_NumTags = 0; - - line_number = 0; - - /* Read the configuration file line by line. */ - while(FGets(cc->cc_File,str,sizeof(str)-2) != NULL) - { - line_number++; - - /* Drop anything from the line that we don't want. */ - strip_unprintable_characters(str); - - /* Skip leading blank spaces. */ - s = str; - while(is_blank_space(*s)) - s++; - - /* A # or ; introduces a comment. We just ignore that. */ - if((*s) == '#' || (*s) == ';') - continue; - - /* Drop trailing blank spaces. */ - len = strlen(s); - while(len > 0 && (is_blank_space(s[len-1]) || s[len-1] == '\r' || s[len-1] == '\n')) - len--; - - if(len == 0) - continue; - - s[len] = '\0'; - - /* There's a key and a value in this line. The key and the value - are separated by blank spaces or a '=' character. */ - t = v = s; - - /* Isolate the key; the key is everything that's not a blank - space or a '=' character. */ - while(NOT is_blank_space(*t) && (*t) != '=' && (*t) != '\0') - { - v++; - t++; - } - - /* Find the value. */ - if((*t) != '\0') - { - (*v++) = ' '; - - t++; - - while(is_blank_space(*t) || (*t) == '=') - t++; - - while((*t) != '\0') - (*v++) = (*t++); - } - - (*v) = '\0'; - - /* Figure out where the separator character (blank space or '=') is. */ - len = strlen(s); - - separator_index = -1; - separator_char = '\0'; - - for(i = 0 ; i < len ; i++) - { - if(is_blank_space(s[i]) || s[i] == '=') - { - separator_index = i; - separator_char = s[i]; - - /* Chop off the string after the key. */ - s[i] = '\0'; - break; - } - } - - /* Check if we know the key for this line. */ - if(FindArg(args_template,s) == -1) - { - /* We don't know it, so we'll ignore it. */ - if(NOT cc->cc_Quiet) - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_KEYWORD_TXT), - s,line_number,name); - } - - continue; - } - - /* Restore the character following the key. */ - if(separator_index != -1) - s[separator_index] = separator_char; - - s[len++] = '\n'; - s[len] = '\0'; - - /* Process what's in this line. */ - FreeArgs(cc->cc_RDA); - memset(&args,0,sizeof(args)); - - cc->cc_RDA->RDA_Source.CS_Buffer = s; - cc->cc_RDA->RDA_Source.CS_Length = len; - cc->cc_RDA->RDA_Source.CS_CurChr = 0; - cc->cc_RDA->RDA_Flags |= RDAF_NOPROMPT; - - if(CANNOT ReadArgs((STRPTR)args_template,(LONG *)&args,cc->cc_RDA)) - { - if(NOT cc->cc_Quiet) - { - error = IoErr(); - - Fault(error,NULL,str,sizeof(str)); - - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_PARSE_ERROR_TXT), - line_number,name,str); - } - - goto out; - } - - /* Did we get a device name? */ - if(args.Device != NULL) - { - FreeVec(device_name); - - device_name = AllocVec(strlen(args.Device)+1,MEMF_ANY|MEMF_PUBLIC); - if(device_name == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - - strcpy(device_name,args.Device); - } - - /* Did we get a unit number? */ - if(args.Unit != NULL) - device_unit = (*args.Unit); - - /* Did we get an IP packet type? */ - if(args.IPType != NULL) - { - error = add_tag(cc,IFA_IPType,(*args.IPType)); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Did we get an ARP packet type? */ - if(args.ARPType != NULL) - { - error = add_tag(cc,IFA_ARPType,(*args.ARPType)); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Did we get a number for the total number of IP requests? */ - if(args.IPRequests != NULL) - { - error = add_tag(cc,IFA_NumReadRequests,(*args.IPRequests)); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Did we get a number for the total number of write requests? */ - if(args.WriteRequests != NULL) - { - error = add_tag(cc,IFA_NumWriteRequests,(*args.WriteRequests)); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Did we get a number for the total number of ARP requests? */ - if(args.ARPRequests != NULL) - { - error = add_tag(cc,IFA_NumARPRequests,(*args.ARPRequests)); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Did we get a filter mode? */ - if(args.Filter != NULL) - { - LONG mode; - - /* What is the filter set to? */ - if(Stricmp(args.Filter,"OFF") == SAME) - mode = PFM_Nothing; - else if (Stricmp(args.Filter,"LOCAL") == SAME) - mode = PFM_Local; - else if (Stricmp(args.Filter,"IPANDARP") == SAME) - mode = PFM_IPandARP; - else if (Stricmp(args.Filter,"EVERYTHING") == SAME) - mode = PFM_Everything; - else - mode = -1; - - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.Filter,line_number,name); - } - - goto out; - } - - error = add_tag(cc,IFA_PacketFilterMode,mode); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Is this a point-to-point device? */ - if(args.PointToPoint != NULL) - { - LONG mode; - - mode = match_key(cc,args.PointToPoint); - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.PointToPoint,line_number,name); - } - - goto out; - } - - error = add_tag(cc,IFA_PointToPoint,mode); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Enable or disable debug mode on this interface? */ - if(args.Debug != NULL) - { - LONG mode; - - mode = match_key(cc,args.Debug); - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.Debug,line_number,name); - } - - goto out; - } - - error = add_tag(cc,IFA_SetDebugMode,mode); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Is this interface capable of multicasts? */ - if(args.Multicast != NULL) - { - LONG mode; - - mode = match_key(cc,args.Multicast); - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.Multicast,line_number,name); - } - - goto out; - } - - error = add_tag(cc,IFA_Multicast,mode); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Should marking the interface "down" also take it offline? */ - if(args.DownGoesOffline != NULL) - { - LONG mode; - - mode = match_key(cc,args.DownGoesOffline); - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.DownGoesOffline,line_number,name); - } - - goto out; - } - - error = add_tag(cc,IFA_DownGoesOffline,mode); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Report when the interface goes offline? */ - if(args.ReportOffline != NULL) - { - LONG mode; - - mode = match_key(cc,args.ReportOffline); - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.ReportOffline,line_number,name); - } - - goto out; - } - - error = add_tag(cc,IFA_ReportOffline,mode); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Is a small delay required after initializing the interface? */ - if(args.RequiresInitDelay != NULL) - { - LONG mode; - - mode = match_key(cc,args.RequiresInitDelay); - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.RequiresInitDelay,line_number,name); - } - - goto out; - } - - error = add_tag(cc,IFA_RequiresInitDelay,mode); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Use a particular copying mode? */ - if(args.CopyMode != NULL) - { - LONG mode; - - if(Stricmp(args.CopyMode,"SLOW") == SAME) - mode = CM_SlowWordCopy; - else if (Stricmp(args.CopyMode,"FAST") == SAME) - mode = CM_FastWordCopy; - else - mode = -1; - - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.CopyMode,line_number,name); - } - - goto out; - } - - error = add_tag(cc,IFA_CopyMode,mode); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Use a particular IP address, or DHCP? */ - if(args.Address != NULL) - { - struct in_addr in; - - /* Is this an IP address? */ - if(Stricmp(args.Address,"DHCP") != SAME) - { - /* Is is a well-formed address? */ - if(CANNOT validate_ip_address(cc,"ADDRESS",args.Address,line_number,name)) - goto out; - } - - /* If this is an IP address, have a closer look at it. */ - if(inet_aton(args.Address,&in)) - { - /* Neither 0 nor the broadcast address are permitted. */ - if(in.s_addr == 0 || in.s_addr == ~0UL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INVALID_ADDRESS_TXT), - args.Address,line_number,name); - } - - goto out; - } - - /* And no reserved range either. */ - if(((in.s_addr >> 24) & 0xFF) == 169 && - ((in.s_addr >> 16) & 0xFF) == 254) - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT), - args.Address,line_number,name); - } - } - - FreeVec(address); - - address = AllocVec(strlen(args.Address)+1,MEMF_ANY|MEMF_PUBLIC); - if(address == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - - strcpy(address,args.Address); - } - - /* Set the interface to a particular state? */ - if(args.State != NULL) - { - if(Stricmp(args.State,"UP") == SAME) - { - interface_state = SM_Up; - } - else if (Stricmp(args.State,"DOWN") == SAME) - { - interface_state = SM_Down; - } - else if (Stricmp(args.State,"ONLINE") == SAME) - { - interface_state = SM_Online; - } - else if (Stricmp(args.State,"OFFLINE") == SAME) - { - interface_state = SM_Offline; - } - else - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_STATE_PARAMETER_TXT), - args.State,line_number); - } - - goto out; - } - } - - /* Use a particular broadcast address? */ - if(args.BroadcastAddress != NULL) - { - if(CANNOT validate_ip_address(cc,"BROADCASTADDRESS",args.BroadcastAddress,line_number,name)) - goto out; - - FreeVec(broadcast_address); - - broadcast_address = AllocVec(strlen(args.BroadcastAddress)+1,MEMF_ANY|MEMF_PUBLIC); - if(broadcast_address == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - - strcpy(broadcast_address,args.BroadcastAddress); - } - - /* For a point-to-point address, use a particular destination address for the peer? */ - if(args.DestinationAddress != NULL) - { - if(CANNOT validate_ip_address(cc,"DESTINATIONADDRESS",args.DestinationAddress,line_number,name)) - goto out; - - FreeVec(destination_address); - - destination_address = AllocVec(strlen(args.DestinationAddress)+1,MEMF_ANY|MEMF_PUBLIC); - if(destination_address == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - - strcpy(destination_address,args.DestinationAddress); - } - - /* Use a particular hardware address? */ - if(args.HardwareAddress != NULL) - { - UBYTE token[40]; - UBYTE buf[10]; - STRPTR arg; - LONG num_tokens; - LONG i; - - /* Collect individual tokens; these are octet separated by - blank spaces or ':' characters. */ - num_tokens = 0; - - arg = args.HardwareAddress; - while((arg = get_next_token(arg,token,sizeof(token))) != NULL) - { - if(get_hex_value(cc,token) < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INVALID_HARDWARE_ADDRESS_TXT), - args.HardwareAddress,line_number,name); - } - - goto out; - } - - num_tokens++; - } - - /* Complain if we didn't get anything. */ - if(num_tokens == 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_MISSING_HARDWARE_ADDRESS_TXT), - line_number,name); - } - - goto out; - } - - FreeVec(iha.iha_Address); - FreeVec(hardware_address); - - /* Allocate memory for the address. */ - iha.iha_Length = num_tokens * 8; - iha.iha_Address = AllocVec(num_tokens,MEMF_ANY|MEMF_PUBLIC|MEMF_CLEAR); - if(iha.iha_Address == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_FOR_HARDWARE_ADDRESS_TXT), - args.HardwareAddress); - } - - goto out; - } - - hardware_address = AllocVec(3 * num_tokens,MEMF_ANY|MEMF_PUBLIC|MEMF_CLEAR); - if(hardware_address == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_FOR_HARDWARE_ADDRESS_TXT), - args.HardwareAddress); - } - - goto out; - } - - /* Now parse the individual octets. */ - i = 0; - arg = args.HardwareAddress; - while((arg = get_next_token(arg,token,sizeof(token))) != NULL) - { - iha.iha_Address[i] = get_hex_value(cc,token); - - get_hex_string(iha.iha_Address[i],buf); - if(i != 0) - strcat(hardware_address,":"); - - strcat(hardware_address,buf); - - i++; - } - - /* Assuming that this is probably an IEEE 802.3 family - address, we're going to check for a few likely - configuration errors due to poor choice of - address. */ - if(NOT cc->cc_Quiet) - { - if(num_tokens < 6) - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_SHORT_TXT), - args.HardwareAddress,line_number,name); - } - else if (num_tokens > 6) - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_LONG_TXT), - args.HardwareAddress,line_number,name); - } - - if(FLAG_IS_SET(iha.iha_Address[0],MAC_Is_Group_Address)) - { - BOOL is_broadcast_address = TRUE; - - for(i = 0 ; i < num_tokens ; i++) - { - if(iha.iha_Address[i] != 0xFF) - { - is_broadcast_address = FALSE; - break; - } - } - - if(is_broadcast_address) - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_BROADCAST_TXT), - args.HardwareAddress,line_number,name); - } - else - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_GROUP_TXT), - args.HardwareAddress,line_number,name); - } - } - } - } - - /* Use a particular netmask, or DHCP? */ - if(args.NetMask != NULL) - { - /* Is this an IP address? */ - if(Stricmp(args.NetMask,"DHCP") != SAME) - { - /* Is is a well-formed address? */ - if(CANNOT validate_ip_address(cc,"NETMASK",args.NetMask,line_number,name)) - goto out; - } - - FreeVec(net_mask); - - net_mask = AllocVec(strlen(args.NetMask)+1,MEMF_ANY|MEMF_PUBLIC); - if(net_mask == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - - strcpy(net_mask,args.NetMask); - } - - /* Use a particular routing metric? */ - if(args.Metric != NULL) - metric = (*args.Metric); - - /* Use a particular MTU value? */ - if(args.MTU != NULL && (*args.MTU) > 0) - { - error = add_tag(cc,IFA_LimitMTU,(*args.MTU)); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - } - - /* Use a particular configuration method? */ - if(args.Configure != NULL) - { - if(Stricmp(args.Configure,"DHCP") == SAME) - { - /* Dynamic Host Configuration Protocol */ - configure_dynamic = TRUE; - configure_auto = FALSE; - } - else if (Stricmp(args.Configure,"SLOWAUTO") == SAME || Stricmp(args.Configure,"AUTO") == SAME) - { - /* ZeroConf; "slow" method for spanning tree routing. */ - configure_dynamic = configure_auto = configure_slow_auto = TRUE; - } - else if (Stricmp(args.Configure,"FASTAUTO") == SAME) - { - /* ZeroConf; "fast" method for wireless applications, etc. */ - configure_dynamic = configure_auto = TRUE; - configure_slow_auto = FALSE; - } - else - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.Configure,line_number,name); - } - - goto out; - } - } - - /* Ask for a particular lease time? */ - if(args.Lease != NULL) - { - STRPTR s = args.Lease; - STRPTR key = NULL; - LONG number; - LONG len; - - /* Skip all leading blank spaces. */ - while(is_blank_space(*s)) - s++; - - /* If it's a number, convert it now. */ - len = 0; - number = 0; - while('0' <= (*s) && (*s) <= '9') - { - number = (10 * number) + (*s) - '0'; - len++; - s++; - } - - /* Skip all following blank spaces, if any. */ - while(is_blank_space(*s)) - s++; - - if(s[0] != '\0') - key = s; - - /* Check if there's a keyword instead. */ - if(len == 0 && key != NULL) - { - /* This should be "infinite", "infinity" or - simply "inf". */ - if(substring_matches(cc,"INF",key) == SAME) - { - lease_time = DHCP_INFINITE_LEASE_TIME; - } - else - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT), - key,line_number,name); - } - - goto out; - } - } - else if (len > 0) - { - lease_time = number; - - /* This could be qualifier, which stands for seconds, - minutes, hours, days or weeks. */ - if(key != NULL) - { - if(substring_matches(cc,"SECOND",key) == SAME) - { - /* This is the default unit */ - } - else if (substring_matches(cc,"MINUTE",key) == SAME) - { - lease_time *= 60; - } - else if (substring_matches(cc,"HOUR",key) == SAME) - { - lease_time *= 60 * 60; - } - else if (substring_matches(cc,"DAY",key) == SAME) - { - lease_time *= 24 * 60 * 60; - } - else if (substring_matches(cc,"WEEK",key) == SAME) - { - lease_time *= 7 * 24 * 60 * 60; - } - else - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT), - key,line_number,name); - } - - goto out; - } - } - } - else - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INVALID_LEASE_PARAMETER_TXT), - args.Lease,line_number,name); - } - - goto out; - } - } - - /* Use a particular client ID (for DHCP)? */ - if(args.ID != NULL) - { - LONG len; - - len = strlen(args.ID); - - if(len > 255 && NOT cc->cc_Quiet) - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_ID_TOO_LONG_TXT), - args.ID,line_number,name); - } - - if(len < 2) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_ID_TOO_SHORT_TXT), - args.ID,line_number,name); - } - - goto out; - } - - FreeVec(client_id); - - client_id = AllocVec(len+1,MEMF_ANY|MEMF_PUBLIC); - if(client_id == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_NO_MEMORY_TXT), - interface_name); - } - - goto out; - } - - strncpy(client_id,args.ID,len); - client_id[len] = '\0'; - } - - /* Request that the DHCP server sends replies using - unicast instead of broadcast? */ - if(args.DHCPUnicast != NULL) - { - LONG mode; - - mode = match_key(cc,args.DHCPUnicast); - if(mode < 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT), - args.DHCPUnicast,line_number,name); - } - - goto out; - } - - dhcp_unicast = mode; - } - - /* Use an alias for this interface? */ - if(args.Alias != NULL) - { - STRPTR * alias = (STRPTR *)args.Alias; - struct in_addr in; - STRPTR address; - - while((address = (*alias++)) != NULL) - { - /* Check if the IP address is well-formed. */ - if(CANNOT validate_ip_address(cc,"ALIAS",address,line_number,name)) - goto out; - - /* Have a closer look at the address. */ - if(inet_aton(address,&in)) - { - /* Don't permit 0 or the broadcast address. */ - if(in.s_addr == 0 || in.s_addr == ~0UL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INVALID_ADDRESS_TXT), - address,line_number,name); - } - - goto out; - } - - /* Don't use the reserved range. */ - if(((in.s_addr >> 24) & 0xFF) == 169 && - ((in.s_addr >> 16) & 0xFF) == 254) - { - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT), - address,line_number,name); - } - } - - node = AllocVec(sizeof(*node) + strlen(address)+1,MEMF_ANY|MEMF_PUBLIC); - if(node == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT), - line_number,name); - } - - goto out; - } - - node->ln_Name = (char *)(node + 1); - strcpy(node->ln_Name,address); - - AddTail(&alias_list,node); - } - } - } - - /* When adding the interface, use the provided hardware address. */ - if(operating_mode == AIM_Add && iha.iha_Address != NULL) - { - error = add_tag(cc,IFA_HardwareAddress,(ULONG)&iha); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_HARDWARE_ADDRESS_TXT), - interface_name); - } - - goto out; - } - } - - /* This concludes the parameter list. */ - error = add_tag(cc,TAG_END,0); - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_INTERFACE_TXT), - name); - } - - goto out; - } - - /* Stop right here if no device name was given. */ - if(device_name == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NO_DEVICE_NAME_PROVIDED_TXT), - name); - } - - goto out; - } - - /* In the "add" stage, add the interface with the parameters given. */ - if(operating_mode == AIM_Add) - { - if(AddInterfaceTagList(interface_name,device_name,device_unit,cc->cc_Tags) != 0) - { - if(NOT cc->cc_Quiet) - { - LONG errno; - STRPTR code; - - get_errno_and_code(cc,&errno,&code); - - if(code != NULL && errno > 0) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_ERROR_CODE_TXT), - interface_name,code); - } - else - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_TXT), - interface_name); - } - } - - goto out; - } - - if(NOT cc->cc_Quiet) - { - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_ADDED_TXT), - interface_name); - - if(hardware_address != NULL) - { - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_HARDWARE_ADDRESS_SET_TO_TXT), - interface_name,hardware_address); - } - } - } - else if (operating_mode == AIM_Configure) - { - /* In the configure state, set up the interface address and aliases. */ - if(address != NULL || configure_dynamic) - { - struct AddressAllocationMessage * aam = &cc->cc_AllocationMessage; - BOOL want_address = (BOOL)(address != NULL && Stricmp(address,"DHCP") == SAME); - BOOL want_netmask = (BOOL)(net_mask != NULL && Stricmp(net_mask,"DHCP") == SAME); - - /* Do we need to configure anything dynamically? */ - if(configure_dynamic || want_address || want_netmask) - { - LONG signals; - - /* Remember the client identifier. */ - aam->aam_ClientIdentifier = client_id; - - /* We have to have the reply port ready. */ - if(cc->cc_ReplyPort == NULL) - { - cc->cc_ReplyPort = CreateMsgPort(); - if(cc->cc_ReplyPort == NULL) - { - if(NOT cc->cc_Quiet) - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT),name); - - goto out; - } - } - - /* Before we begin, we will need to mark this - interface 'up' so that the protocol stack will - send messages through it. For some devices it - is not sufficient to mark the interface as up. - These also have to be switched online, too. */ - if(Local_ConfigureInterfaceTags(cc,interface_name, - IFC_State,SM_Online, - TAG_DONE) != 0) - { - if(NOT cc->cc_Quiet) - { - LONG errno; - STRPTR code; - - get_errno_and_code(cc,&errno,&code); - - if(code != NULL && errno > 0) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_ERROR_CODE_TXT), - interface_name,code); - } - else - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_TXT), - interface_name); - } - } - - goto out; - } - - if(NOT cc->cc_Quiet) - { - if(cc->cc_StartupMessage == NULL) - { - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT), - interface_name); - - Flush(Output()); - } - } - - /* Initialize the message, then send it. */ - aam->aam_Message.mn_Node.ln_Type = NT_REPLYMSG; - aam->aam_Message.mn_ReplyPort = cc->cc_ReplyPort; - aam->aam_Message.mn_Length = sizeof(*aam); - - memcpy(aam->aam_InterfaceName,interface_name,sizeof(aam->aam_InterfaceName)-1); - aam->aam_InterfaceName[sizeof(aam->aam_InterfaceName)-1] = '\0'; - - if(configure_auto) - { - if(configure_slow_auto) - aam->aam_Protocol = AAMP_SLOWAUTO; - else - aam->aam_Protocol = AAMP_FASTAUTO; - } - else - { - aam->aam_Protocol = AAMP_DHCP; - } - - aam->aam_Version = AAM_VERSION; - aam->aam_Timeout = timeout; - aam->aam_LeaseTime = lease_time; - aam->aam_RouterTable = cc->cc_RouterTable; - aam->aam_RouterTableSize = NUM_ENTRIES(cc->cc_RouterTable); - aam->aam_DNSTable = cc->cc_DNSTable; - aam->aam_DNSTableSize = NUM_ENTRIES(cc->cc_DNSTable); - aam->aam_LeaseExpires = &cc->cc_LeaseExpires; - aam->aam_DomainName = default_domain_name; - aam->aam_DomainNameSize = sizeof(default_domain_name); - aam->aam_Unicast = dhcp_unicast; /* Note: this field only exists in version 2 and above */ - - strcpy(default_domain_name,""); - - if(address != NULL && Stricmp(address,"DHCP") != SAME) - aam->aam_RequestedAddress = inet_addr(address); - - BeginInterfaceConfig(aam); - - /* Wait for something to happen. */ - signals = Wait(SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_F | (1UL << cc->cc_ReplyPort->mp_SigBit)); - - /* ^C means "stop everything". */ - if(signals & SIGBREAKF_CTRL_C) - { - AbortInterfaceConfig(aam); - WaitPort(cc->cc_ReplyPort); - GetMsg(cc->cc_ReplyPort); - - if(NOT cc->cc_Quiet) - { - info_printf(cc,"\n"); - - info_print_fault(cc,ERROR_BREAK); - } - - goto out; - } - else if (signals & SIGBREAKF_CTRL_F) - { - /* ^F means "stop configuring this interface". */ - AbortInterfaceConfig(aam); - WaitPort(cc->cc_ReplyPort); - GetMsg(cc->cc_ReplyPort); - - if(NOT cc->cc_Quiet) - { - info_printf(cc,"\n"); - - warning_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT), - interface_name); - } - - result = RETURN_OK; - goto out; - } - else - { - if(NOT cc->cc_Quiet) - info_printf(cc,"\n"); - - WaitPort(cc->cc_ReplyPort); - GetMsg(cc->cc_ReplyPort); - - /* If that didn't work out, print an error message. */ - if(aam->aam_Result != AAMR_Success && NOT cc->cc_Quiet) - { - STATIC CONST error_map_table[][2] = - { - { AAMR_Aborted, MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT }, - { AAMR_Timeout, MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ATTEMPT_TIMED_OUT_TXT }, - { AAMR_InterfaceNotKnown, MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_TXT }, - { AAMR_InterfaceWrongType, MSG_ADDNETINTERFACE_INTERFACE_WRONG_TYPE_TXT }, - { AAMR_AddressKnown, MSG_ADDNETINTERFACE_INTERFACE_ALREADY_CONFIGURED_TXT }, - { AAMR_VersionUnknown, MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_VERSION_CONFLICT_TXT }, - { AAMR_NoMemory, MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_NO_MEMORY_TXT }, - { AAMR_AddressInUse, MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_IN_USE_TXT }, - { AAMR_AddrChangeFailed, MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_CHANGE_FAILED_TXT }, - { AAMR_MaskChangeFailed, MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_MASK_CHANGE_FAILED_TXT }, - { AAMR_Busy, MSG_ADDNETINTERFACE_INTERFACE_IS_BUSY_TXT }, - { -1, -1} - }; - - LONG message_code; - size_t i; - - message_code = MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_UNKNOWN_ERROR_TXT; - - for(i = 0 ; error_map_table[i][0] != -1 ; i++) - { - if(aam->aam_Result == error_map_table[i][0]) - { - message_code = error_map_table[i][1]; - break; - } - } - - error_printf(cc,get_str(cc,message_code), - interface_name,aam->aam_Result); - } - - /* Even if an error occured, don't stop the show. */ - if(aam->aam_Result != AAMR_Success) - { - result = RETURN_OK; - goto out; - } - - /* Check if we got the required IP address. */ - if(configure_dynamic || want_address) - { - UBYTE str[20]; - - /* Did we really get something? */ - if(aam->aam_Address == 0) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_INVALID_ADDRESS_TXT), - interface_name); - } - - goto out; - } - - /* Remember the address. */ - strcpy(str,Inet_NtoA(aam->aam_Address)); - - FreeVec(address); - address = AllocVec(strlen(str)+1,MEMF_ANY|MEMF_PUBLIC); - if(address == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_NO_MEMORY_TXT), - interface_name); - } - - goto out; - } - - strcpy(address,str); - } - - /* Check if we got the required subnet mask. */ - if(configure_dynamic || want_netmask) - { - /* Did we really get something? */ - if(aam->aam_SubnetMask == 0x00000000 || - aam->aam_SubnetMask == 0xFFFFFFFF) - { - FreeVec(net_mask); - net_mask = NULL; - } - else - { - UBYTE str[20]; - - /* Remember the subnet mask. */ - strcpy(str,Inet_NtoA(aam->aam_SubnetMask)); - - FreeVec(net_mask); - net_mask = AllocVec(strlen(str)+1,MEMF_ANY|MEMF_PUBLIC); - if(net_mask == NULL) - { - if(NOT cc->cc_Quiet) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_NO_MEMORY_TXT), - interface_name); - } - - goto out; - } - - strcpy(net_mask,str); - } - } - - /* Validate the router and DNS address tables. */ - if(configure_dynamic) - { - LONG i,n; - - n = 0; - for(i = 0 ; i < aam->aam_RouterTableSize ; i++) - { - if(aam->aam_RouterTable[i] != 0) - n++; - } - - if(n == 0) - aam->aam_RouterTable = NULL; - - n = 0; - for(i = 0 ; i < aam->aam_DNSTableSize ; i++) - { - if(aam->aam_DNSTable[i] != 0) - n++; - } - - if(n == 0) - aam->aam_DNSTable = NULL; - } - } - } - - /* Finally, configure the interface using the information obtained above. */ - if(Local_ConfigureInterfaceTags(cc,interface_name, - (NOT (configure_dynamic || want_address) && address != NULL) ? IFC_Address : TAG_IGNORE, address, - (NOT (configure_dynamic || want_netmask) && net_mask != NULL) ? IFC_NetMask : TAG_IGNORE, net_mask, - - (broadcast_address != NULL) ? IFC_BroadcastAddress : TAG_IGNORE, broadcast_address, - (destination_address != NULL) ? IFC_DestinationAddress : TAG_IGNORE, destination_address, - (metric != 0) ? IFC_Metric : TAG_IGNORE, metric, - IFC_State, interface_state, - IFC_Complete, TRUE, - TAG_DONE) != 0) - { - if(NOT cc->cc_Quiet) - { - LONG errno; - STRPTR code; - - get_errno_and_code(cc,&errno,&code); - - if(code != NULL && errno > 0) - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_ERROR_CODE_TXT), - interface_name,code); - } - else - { - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT), - interface_name); - } - } - - goto out; - } - - /* Unless we shouldn't do so, say what we did above. */ - if(NOT cc->cc_Quiet) - { - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_TXT), - interface_name); - - if(address != NULL) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_ADDRESS_TXT),address); - - if(net_mask != NULL) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_MASK_TXT),net_mask); - - if(broadcast_address != NULL) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_BROADCAST_ADDRESS_TXT),broadcast_address); - - if(destination_address != NULL) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_DESTINATION_ADDRESS_TXT),destination_address); - - if(metric != 0) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_METRIC_TXT),metric); - - info_printf(cc,".\n"); - } - - /* Check if we got any router information from the server. */ - if(configure_dynamic && aam->aam_RouterTable != NULL) - { - LONG i,n; - - n = 0; - for(i = 0 ; i < aam->aam_RouterTableSize ; i++) - { - if(aam->aam_RouterTable[i] != 0) - { - UBYTE str[20]; - LONG error = OK; - STRPTR code = NULL; - - /* Use this router address. */ - strcpy(str,Inet_NtoA(aam->aam_RouterTable[i])); - - /* The first is the default gateway address. */ - if(n == 0) - { - if(Local_AddRouteTags(cc, - RTA_DefaultGateway,str, - TAG_DONE) != OK) - { - get_errno_and_code(cc,&error,&code); - } - - /* Say what we did. */ - if(error == OK && NOT cc->cc_Quiet) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_DEFAULT_ROUTE_TXT),str); - } - else - { - /* The second is a destination address. */ - if(Local_AddRouteTags(cc, - RTA_Destination,str, - TAG_DONE) != OK) - { - get_errno_and_code(cc,&error,&code); - } - - /* Say what we did. */ - if(error == OK && NOT cc->cc_Quiet) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_ROUTE_TXT),str); - } - - /* Print an error message if that didn't work. */ - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - LONG message_code; - - if(code != NULL && error > 0) - message_code = MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_ERROR_CODE_TXT; - else - message_code = MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_TXT; - - error_printf(cc,get_str(cc,message_code),str,code); - } - - goto out; - } - - n++; - } - } - } - - /* Check if we got a default domain name to use for DNS lookups. */ - if(configure_dynamic) - { - STRPTR domain_name; - - if(aam->aam_DomainName != NULL && aam->aam_DomainName[0] != '\0') - domain_name = aam->aam_DomainName; - else - domain_name = ""; - - SetDefaultDomainName(domain_name); - - if(domain_name[0] != '\0' && NOT cc->cc_Quiet) - { - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_DEFAULT_DOMAIN_NAME_TXT), - domain_name); - } - } - - /* Check if we got a DNS server table to use. */ - if(configure_dynamic && aam->aam_DNSTable != NULL) - { - LONG i; - - for(i = 0 ; i < aam->aam_DNSTableSize ; i++) - { - if(aam->aam_DNSTable[i] != 0) - { - UBYTE str[20]; - LONG error = OK; - STRPTR code = NULL; - - strcpy(str,Inet_NtoA(aam->aam_DNSTable[i])); - - if(AddDomainNameServer(str) != OK) - get_errno_and_code(cc,&error,&code); - - /* Say what we did. */ - if(error == OK && NOT cc->cc_Quiet) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_DNS_TXT),str); - - if(error != OK) - { - if(NOT cc->cc_Quiet) - { - LONG message_code; - - if(code != NULL && error > 0) - message_code = MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_ERROR_CODE_TXT; - else - message_code = MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_TXT; - - error_printf(cc,get_str(cc,message_code),str,code); - } - - goto out; - } - } - } - } - - /* If we received a lease from a DHCP server, say how long it will last. */ - if((configure_dynamic || want_address) && aam->aam_Protocol == AAMP_DHCP && NOT cc->cc_Quiet) - { - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_ADDRESS_TXT), - interface_name,address); - - if(cc->cc_LeaseExpires.ds_Days == 0 && - cc->cc_LeaseExpires.ds_Minute == 0 && - cc->cc_LeaseExpires.ds_Tick == 0) - { - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_LEASED_PERMANENTLY_TXT)); - } - else - { - struct DateTime dat; - UBYTE date[LEN_DATSTRING+1]; - UBYTE time[LEN_DATSTRING+1]; - - memset(&dat,0,sizeof(dat)); - - dat.dat_Stamp = cc->cc_LeaseExpires; - dat.dat_Format = FORMAT_DEF; - dat.dat_StrDate = date; - dat.dat_StrTime = time; - - DateToStr(&dat); - - strip_extra_blank_spaces(date); - strip_extra_blank_spaces(time); - - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_LEASED_UNTIL_TXT), - date,time); - } - } - } - - /* Finally, try to add alias addresses for this interface. */ - if(NOT IsListEmpty(&alias_list)) - { - for(node = alias_list.lh_Head ; - node->ln_Succ != NULL ; - node = node->ln_Succ) - { - if(Local_ConfigureInterfaceTags(cc,interface_name, - IFC_AddAliasAddress,node->ln_Name, - TAG_DONE) != 0) - { - if(NOT cc->cc_Quiet) - { - LONG message_code; - LONG errno; - STRPTR code; - - get_errno_and_code(cc,&errno,&code); - - if(code != NULL && errno > 0) - message_code = MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_ERROR_CODE_TXT; - else - message_code = MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_TXT; - - error_printf(cc,get_str(cc,message_code),interface_name,node->ln_Name,code); - } - - goto out; - } - - /* Say what we did. */ - if(NOT cc->cc_Quiet) - info_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_ALIAS_TXT),node->ln_Name); - } - } - } - - result = RETURN_OK; - - out: - - /* Clean up the lot... */ - while((node = RemHead(&alias_list)) != NULL) - FreeVec(node); - - FreeVec(client_id); - FreeVec(address); - FreeVec(net_mask); - FreeVec(broadcast_address); - FreeVec(destination_address); - - FreeVec(device_name); - - FreeVec(hardware_address); - FreeVec(iha.iha_Address); - - if(cc->cc_File != ZERO) - { - Close(cc->cc_File); - cc->cc_File = ZERO; - } - - return(result); -} - -/****************************************************************************/ - -/* Try to convert an IP address specification into a number an complain - if that doesn't work. */ -STATIC BOOL -validate_ip_address(struct CommandContext * cc,STRPTR key,STRPTR address,LONG line_number,STRPTR file) -{ - DECLARE_SOCKETBASE(cc); - - struct in_addr in; - BOOL result; - - if(inet_aton(address,&in)) - { - result = TRUE; - } - else - { - if(NOT cc->cc_Quiet) - error_printf(cc,get_str(cc,MSG_ADDNETINTERFACE_INVALID_IP_ADDRESS_AT_TXT),key,address,line_number,file); - - result = FALSE; - } - - return(result); -} - -/****************************************************************************/ - -/* Get the error message text corresponding to an error number. */ -STATIC VOID -get_errno_and_code(struct CommandContext * cc,LONG * errno_ptr,STRPTR * code_ptr) -{ - LONG errno = 0; - LONG code; - - Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNO),&errno, - TAG_END); - - code = errno; - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNOSTRPTR),&code, - TAG_END) != 0) - { - code = 0; - } - - (*errno_ptr) = errno; - (*code_ptr) = (STRPTR)code; -} - -/****************************************************************************/ - -/* Check if part of a string matches a shorter string. */ -STATIC BOOL -substring_matches(struct CommandContext * cc,STRPTR pattern,STRPTR string) -{ - DECLARE_UTILITYBASE(cc); - - BOOL result = FALSE; - LONG i,len,pattern_len; - - len = strlen(string); - pattern_len = strlen(pattern); - - for(i = 0 ; i <= len - pattern_len ; i++) - { - if(Strnicmp(&string[len],pattern,pattern_len) == SAME) - { - result = TRUE; - break; - } - } - - return(result); -} - -/****************************************************************************/ - -/* Add a new interface node to the list, sorting its contents by priority - and name. The list is sorted by descending priority, and where the priority - is identical, by name (in lexical order). */ -STATIC VOID -add_interface_node(struct CommandContext * cc,struct List * list,struct Node * new_node) -{ - DECLARE_UTILITYBASE(cc); - DECLARE_DOSBASE(cc); - - struct Node * list_node; - - /* Find a node on the list that's "larger" than the node - we are about to add. */ - for(list_node = list->lh_Head ; - list_node->ln_Succ != NULL ; - list_node = list_node->ln_Succ) - { - if((list_node->ln_Pri < new_node->ln_Pri) || (list_node->ln_Pri == new_node->ln_Pri && Stricmp(FilePart(list_node->ln_Name),FilePart(new_node->ln_Name)) > 0)) - break; - } - - /* Now insert the new node in the right position, - in front of the list node found above. */ - new_node->ln_Succ = (struct Node *)list_node; - new_node->ln_Pred = (struct Node *)list_node->ln_Pred; - - list_node->ln_Pred = (struct Node *)new_node; - new_node->ln_Pred->ln_Succ = (struct Node *)new_node; -} - -/****************************************************************************/ - -/* Print an error message or show an error requester instead. */ -STATIC VOID VARARGS68K -error_printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - DECLARE_INTUITIONBASE(cc); - - va_list args; - - if(cc->cc_StartupMessage == NULL) - { - STRPTR program_name = cc->cc_ProgramName; - BPTR fh; - - /* Try to use the error output stream associated with the shell. */ - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - VFPrintf(fh,"%s: ",&program_name); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - VFPrintf(fh,"\n",NULL); - } - else - { - if(IntuitionBase != NULL) - { - struct EasyStruct es; - - memset(&es,0,sizeof(es)); - - es.es_StructSize = sizeof(es); - es.es_Title = get_str(cc,MSG_ADDNETINTERFACE_ERROR_MESSAGE_TITLE_TXT); - es.es_TextFormat = format; - es.es_GadgetFormat = get_str(cc,MSG_ADDNETINTERFACE_ERROR_MESSAGE_BUTTON_LABEL_TXT); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - EasyRequestArgs(NULL,&es,NULL,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - EasyRequestArgs(NULL,&es,NULL,args); - va_end(args); - } - #endif /* __amigaos4__ */ - } - } -} - -/****************************************************************************/ - -/* Print a warning message in the shell window. */ -STATIC VOID VARARGS68K -warning_printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - if(cc->cc_StartupMessage == NULL) - { - STRPTR program_name = cc->cc_ProgramName; - va_list args; - - VPrintf("%s: ",&program_name); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - VPrintf("\n",NULL); - } -} - -/****************************************************************************/ - -/* Print an informational message in the shell window. */ -STATIC VOID VARARGS68K -info_printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - if(cc->cc_StartupMessage == NULL) - { - va_list args; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - } -} - -/****************************************************************************/ - -/* Print an error string in the shell window; this is supposed to be - an informational message only. */ -STATIC VOID -info_print_fault(struct CommandContext * cc,LONG code) -{ - DECLARE_DOSBASE(cc); - - if(cc->cc_StartupMessage == NULL) - { - UBYTE str[100]; - - Fault(code,NULL,str,sizeof(str)); - - info_printf(cc,"%s: %s\n",cc->cc_ProgramName,str); - } -} - -/****************************************************************************/ - -/* Print an error string in the shell window, corresponding to a code. */ -STATIC VOID -error_print_fault(struct CommandContext * cc,LONG code) -{ - DECLARE_DOSBASE(cc); - - if(cc->cc_StartupMessage == NULL) - { - PrintFault(code,cc->cc_ProgramName); - } - else - { - UBYTE str[100]; - - Fault(code,NULL,str,sizeof(str)); - - error_printf(cc,"%s",str); - } -} - -/****************************************************************************/ - -/* Print an error string in the shell window, corresponding to a code, using - a special prefix. */ -STATIC VOID -error_print_fault_prefix(struct CommandContext * cc,LONG code,STRPTR prefix) -{ - DECLARE_DOSBASE(cc); - - if(cc->cc_StartupMessage == NULL) - { - PrintFault(code,prefix); - } - else - { - UBYTE str[100]; - - Fault(code,NULL,str,sizeof(str)); - - error_printf(cc,"%s: %s",prefix,str); - } -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail. */ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STATIC STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - DECLARE_LOCALEBASE(cc); - - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - else - result = builtin_string; - - return(result); -} - -/****************************************************************************/ - -/* The following are varargs stubs for several bsdsocket.library routines - which are necessary for the 68k GCC build. */ -STATIC LONG VARARGS68K -Local_ConfigureInterfaceTags(struct CommandContext * cc,STRPTR interface_name,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,interface_name); - result = ConfigureInterfaceTagList(interface_name,va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,interface_name); - result = ConfigureInterfaceTagList(interface_name,(struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -STATIC LONG VARARGS68K -Local_SocketBaseTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = SocketBaseTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = SocketBaseTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -STATIC LONG VARARGS68K -Local_AddRouteTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = AddRouteTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = AddRouteTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} diff --git a/examples/AddNetInterface_rev.h b/examples/AddNetInterface_rev.h deleted file mode 100644 index 6b9661e..0000000 --- a/examples/AddNetInterface_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 53 -#define DATE "12.12.2015" -#define VERS "AddNetInterface 4.53" -#define VSTRING "AddNetInterface 4.53 (12.12.2015)\r\n" -#define VERSTAG "\0$VER: AddNetInterface 4.53 (12.12.2015)" diff --git a/examples/AddNetRoute.c b/examples/AddNetRoute.c deleted file mode 100644 index 6e0f491..0000000 --- a/examples/AddNetRoute.c +++ /dev/null @@ -1,953 +0,0 @@ -/* - * $Id: AddNetRoute.c,v 1.11 2007-08-26 12:30:15 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include -#include - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include "AddNetRoute_rev.h" - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_LocaleBase; - struct Library * cc_SocketBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct LocaleIFace * cc_ILocale; - struct SocketIFace * cc_ISocket; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - UBYTE cc_ProgramName[256]; - struct TagItem * cc_Tags; - LONG cc_NumTags; - LONG cc_MaxTags; -}; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct SocketIFace * ISocket = cc->cc_ISocket; \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -STATIC LONG cmd(struct CommandContext *cc); -STATIC LONG add_tag(struct CommandContext *cc, Tag tag, ULONG data); -STATIC LONG Local_Printf(struct CommandContext *cc, STRPTR format, ...); -STATIC LONG VARARGS68K Local_ErrorPrintf(struct CommandContext *cc, STRPTR format, ...); -STATIC STRPTR get_builtin_str(LONG id); -STATIC STRPTR get_str(struct CommandContext *cc, LONG id); -STATIC LONG VARARGS68K Local_SocketBaseTags(struct CommandContext *cc, ...); - -/****************************************************************************/ - -/****** ROADSHOW/ADDNETROUTE ************************************************** -* -* NAME -* AddNetRoute - Add message routing paths. -* -* FORMAT -* AddNetRoute [QUIET] [DESTINATION=] [HOSTDESTINATION=] -* [NETDESTINATION=] [GATEWAY=] [DEFAULTGATEWAY=] -* -* TEMPLATE -* QUIET/S,DST=DESTINATION/K,HOSTDST=HOSTDESTINATION/K, -* NETDST=NETDESTINATION/K,VIA=GATEWAY/K,DEFAULT=DEFAULTGATEWAY/K -* -* PATH -* C:ADDNETROUTE -* -* FUNCTION -* ADDNETROUTE allows to define routes to hosts or networks via an -* interface. -* -* OPTIONS -* QUIET/S -* This option causes the program not to emit any error messages -* or progress reports. Also, if the program encounters an error -* it will flag this as failure code 5 which can be looked at -* using the "if warn" shell script command. If this option is -* not in effect, failure codes will be more severe and all sorts -* of progress information will be displayed. -* -* DST=DESTINATION/K -* The destination address of a route (or in other words, where -* the route to be added leads to). This must be an IP address -* or a symbolic name. Some routes may require you to specify -* a gateway address through which the route has to pass. -* Depending upon the address you specify, the protocol stack -* will attempt to figure out whether the destination is -* supposed to be a host or a network. -* -* HOSTDST=HOSTDESTINATION/K -* Same as the "DST=DESTINATION/K" parameter, except that the -* destination is assumed to be a host (rather than a network). -* -* NETDST=NETDESTINATION/K -* Same as the "DST=DESTINATION/K" parameter, except that the -* destination is assumed to be a network (rather than a host). -* -* VIA=GATEWAY/K -* This parameter complements the route destination address; -* it indicates the address to which a message should be sent -* for it to be passed to the destination. This must be an IP -* address or a symbolic name. -* -* DEFAULT=DEFAULTGATEWAY/K -* This parameter selects the default gateway address (which -* must be specified as an IP address or a symbolic host name) -* all messages are sent to which don't have any particular -* other routes associated with them. -* Another, perhaps less misleading name for "default gateway -* address" is "default route". -* -* NOTES -* The command is similar to the Unix "route" command. -* -* If you use the "DEFAULT=DEFAULTGATEWAY/K" parameter, all -* other destination addresses you may have specified will be -* ignored. Only one of "DESTINATION", "HOSTDESTINATION" or -* "NETDESTINATION" will be used; choose only one. Before you add -* a new default gateway you should delete the old one or you'll -* get an error message instead. -* -* EXAMPLES -* Define a route to the host 192.168.10.12 through a -* gateway at 192.168.1.1 -* -* 1> ADDNETROUTE HOSTDESTINATION 192.168.10.12 VIA 192.168.1.1 -* -* SEE ALSO -* DeleteNetRoute -* -****************************************************************************** -*/ -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - struct Message * mn; - - WaitPort(mp); - mn = GetMsg(mp); - - Forbid(); - ReplyMsg(mn); - goto out; - } - - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - - if(cc->cc_LocaleBase != NULL) - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - - result = cmd(cc); - - if(cc->cc_Tags != NULL) - FreeVec(cc->cc_Tags); - - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - out: - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - - if(cc->cc_ISocket != NULL) - DropInterface((struct Interface *)cc->cc_ISocket); - } - #endif /* __amigaos4__ */ - - if(cc->cc_SocketBase != NULL) - CloseLibrary(cc->cc_SocketBase); - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - cc->cc_SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(cc->cc_SocketBase != NULL) - { - cc->cc_ISocket = (struct SocketIFace *)GetInterface(cc->cc_SocketBase, "main", 1, 0); - if(cc->cc_ISocket == NULL) - { - CloseLibrary(cc->cc_SocketBase); - cc->cc_SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define ADDNETROUTE_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -STATIC LONG -cmd(struct CommandContext * cc) -{ - struct - { - SWITCH Quiet; - KEY Destination; - KEY DestinationHost; - KEY DestinationNet; - KEY Gateway; - KEY DefaultGateway; - } args; - - STRPTR args_template = - "QUIET/S," - "DST=DESTINATION/K," - "HOSTDST=HOSTDESTINATION/K," - "NETDST=NETDESTINATION/K," - "VIA=GATEWAY/K," - "DEFAULT=DEFAULTGATEWAY/K" - VERSTAG; - - DECLARE_DOSBASE(cc); - DECLARE_SOCKETBASE(cc); - - LONG result = RETURN_FAIL; - LONG have_routing_api = FALSE; - struct RDArgs * rda; - LONG error; - BOOL quiet = FALSE; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),cc->cc_ProgramName); - goto out; - } - - quiet = (BOOL)(args.Quiet != 0); - - if(SocketBase == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_CANNOT_OPEN_BSDSOCKET_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_ROUTING_API),&have_routing_api, - TAG_END) != 0) - { - have_routing_api = FALSE; - } - - if(NOT have_routing_api) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(args.DefaultGateway != NULL) - { - error = add_tag(cc,RTA_DefaultGateway,(ULONG)args.DefaultGateway); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NO_MEMORY_FOR_DEFAULT_GATEWAY_TXT), - cc->cc_ProgramName,args.DefaultGateway); - } - - goto out; - } - - if(NOT quiet) - { - if(args.Destination != NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_DESTINATION_IGNORED_TXT), - cc->cc_ProgramName,args.Destination); - } - - if(args.DestinationHost != NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_HOSTDESTINATION_IGNORED_TXT), - cc->cc_ProgramName,args.DestinationHost); - } - - if(args.DestinationNet != NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NETDESTINATION_IGNORED_TXT), - cc->cc_ProgramName,args.DestinationNet); - } - - if(args.Gateway != NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_GATEWAY_IGNORED_TXT), - cc->cc_ProgramName,args.Gateway); - } - } - } - else if (args.Gateway != NULL) - { - STRPTR dst; - - if(args.Destination != NULL) - dst = args.Destination; - else if (args.DestinationHost != NULL) - dst = args.DestinationHost; - else if (args.DestinationNet != NULL) - dst = args.DestinationNet; - else - dst = NULL; - - if(dst == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_GATEWAY_NEEDS_DESTINATION_TXT), - cc->cc_ProgramName,args.Gateway); - } - - goto out; - } - - error = add_tag(cc,RTA_Gateway,(ULONG)args.Gateway); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_GATEWAY_TXT), - cc->cc_ProgramName,args.Gateway); - } - - goto out; - } - } - else - { - PrintFault(ERROR_REQUIRED_ARG_MISSING,cc->cc_ProgramName); - goto out; - } - - if(args.Destination != NULL) - { - error = add_tag(cc,RTA_Destination,(ULONG)args.Destination); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TXT), - cc->cc_ProgramName,args.Destination); - } - - goto out; - } - - if(NOT quiet && args.DestinationHost != NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_HOSTDESTINATION_IGNORED_TXT), - cc->cc_ProgramName,args.DestinationHost); - } - - if(NOT quiet && args.DestinationNet != NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NETDESTINATION_IGNORED_TXT), - cc->cc_ProgramName,args.DestinationNet); - } - } - else if (args.DestinationHost != NULL) - { - error = add_tag(cc,RTA_DestinationHost,(ULONG)args.DestinationHost); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_HOST_TXT), - cc->cc_ProgramName,args.Destination); - } - - goto out; - } - - if(NOT quiet && args.DestinationNet != NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NETDESTINATION_IGNORED_TXT), - cc->cc_ProgramName,args.DestinationNet); - } - } - else if (args.DestinationNet != NULL) - { - error = add_tag(cc,RTA_DestinationNet,(ULONG)args.DestinationNet); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_NET_TXT), - cc->cc_ProgramName,args.Destination); - } - - goto out; - } - } - - if(cc->cc_NumTags > 0) - { - error = add_tag(cc,TAG_END,0); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_TO_ADD_ROUTE_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(AddRouteTagList(cc->cc_Tags) != OK) - { - if(NOT quiet) - { - LONG errno = 0; - LONG code; - - Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNO),&errno, - TAG_END); - - code = errno; - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNOSTRPTR),&code, - TAG_END) != 0) - { - code = 0; - } - - Local_ErrorPrintf(cc,get_str(cc,MSG_ADDNETROUTE_COULD_NOT_ADD_ROUTE_TXT), - cc->cc_ProgramName); - - if(code > 0 && errno > 0) - Local_ErrorPrintf(cc," (%s)",code); - - Local_ErrorPrintf(cc,".\n"); - } - - goto out; - } - - if(NOT quiet) - { - STRPTR prefix = ""; - - Local_Printf(cc,get_str(cc,MSG_ADDNETROUTE_ROUTE_ADDED_TXT), - cc->cc_ProgramName); - - if(args.DefaultGateway != NULL) - { - Local_Printf(cc,get_str(cc,MSG_ADDNETROUTE_DEFAULT_GATEWAY_TXT),prefix,args.DefaultGateway); - prefix = ", "; - } - - if(args.Destination != NULL) - { - Local_Printf(cc,get_str(cc,MSG_ADDNETROUTE_DESTINATION_TXT),prefix,args.Destination); - prefix = ", "; - } - - if(args.DestinationHost != NULL) - { - Local_Printf(cc,get_str(cc,MSG_ADDNETROUTE_DESTINATION_HOST_TXT),prefix,args.DestinationHost); - prefix = ", "; - } - - if(args.DestinationNet != NULL) - Local_Printf(cc,get_str(cc,MSG_ADDNETROUTE_DESTINATION_NET_TXT),prefix,args.DestinationNet); - - if(args.Gateway != NULL) - Local_Printf(cc,get_str(cc,MSG_ADDNETROUTE_VIA_GATEWAY_TXT),prefix,args.Gateway); - - Local_Printf(cc,").\n"); - } - } - - result = RETURN_OK; - - out: - - if(quiet && result != RETURN_OK) - result = RETURN_WARN; - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -/****************************************************************************/ - -STATIC LONG -add_tag(struct CommandContext * cc,Tag tag,ULONG data) -{ - DECLARE_SYSBASE(cc); - - LONG error = OK; - LONG which = -1; - LONG i; - - for(i = 0 ; i < cc->cc_NumTags ; i++) - { - if(cc->cc_Tags[i].ti_Tag == tag) - { - which = i; - break; - } - } - - if(which == -1 && cc->cc_NumTags + 1 >= cc->cc_MaxTags) - { - struct TagItem * new_tags; - - new_tags = AllocVec(sizeof(*new_tags) * (cc->cc_MaxTags+10),MEMF_ANY|MEMF_PUBLIC); - if(new_tags == NULL) - { - error = ERROR_NO_FREE_STORE; - goto out; - } - - if(cc->cc_Tags != NULL) - CopyMem(cc->cc_Tags,new_tags,sizeof(*new_tags) * cc->cc_NumTags); - - FreeVec(cc->cc_Tags); - cc->cc_Tags = new_tags; - cc->cc_MaxTags += 10; - } - - if(which == -1) - which = cc->cc_NumTags++; - - cc->cc_Tags[which].ti_Tag = tag; - cc->cc_Tags[which].ti_Data = data; - - out: - - return(error); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_Printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_ErrorPrintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - - va_list args; - LONG result; - BPTR fh; - - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail. */ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STATIC STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - { - DECLARE_LOCALEBASE(cc); - - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - } - else - { - result = builtin_string; - } - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_SocketBaseTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = SocketBaseTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = SocketBaseTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} diff --git a/examples/AddNetRoute_rev.h b/examples/AddNetRoute_rev.h deleted file mode 100644 index 57ae1e5..0000000 --- a/examples/AddNetRoute_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 8 -#define DATE "11.3.2009" -#define VERS "AddNetRoute 4.8" -#define VSTRING "AddNetRoute 4.8 (11.3.2009)\r\n" -#define VERSTAG "\0$VER: AddNetRoute 4.8 (11.3.2009)" diff --git a/examples/ConfigureNetInterface.c b/examples/ConfigureNetInterface.c deleted file mode 100644 index 9f632a6..0000000 --- a/examples/ConfigureNetInterface.c +++ /dev/null @@ -1,2374 +0,0 @@ -/* - * $Id: ConfigureNetInterface.c,v 1.17 2007-08-26 12:30:15 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include -#include -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) && !defined(Flush) -#define Flush(fh) FFlush(fh) -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -#include "ConfigureNetInterface_rev.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/****************************************************************************/ - -#ifndef FORMAT_DEF -#define FORMAT_DEF 4 -#endif /* FORMAT_DEF */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_UtilityBase; - struct Library * cc_LocaleBase; - struct Library * cc_SocketBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct UtilityIFace * cc_IUtility; - struct LocaleIFace * cc_ILocale; - struct SocketIFace * cc_ISocket; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - UBYTE cc_ProgramName[256]; - struct TagItem * cc_Tags; - LONG cc_NumTags; - LONG cc_MaxTags; - struct MsgPort * cc_ReplyPort; - struct AddressAllocationMessage - cc_AllocationMessage; - ULONG cc_RouterTable[16]; - ULONG cc_DNSTable[16]; - struct DateStamp cc_LeaseExpires; -}; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct UtilityIFace * IUtility = cc->cc_IUtility; \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct SocketIFace * ISocket = cc->cc_ISocket; \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -STATIC LONG cmd(struct CommandContext *cc); -STATIC BOOL validate_ip_address(struct CommandContext *cc, BOOL quiet, STRPTR key, STRPTR address); -STATIC LONG add_tag(struct CommandContext *cc, Tag tag, ULONG data); -STATIC VOID get_errno_and_code(struct CommandContext *cc, LONG *errno_ptr, STRPTR *code_ptr); -STATIC BOOL substring_matches(struct CommandContext *cc, STRPTR pattern, STRPTR string); -STATIC BOOL is_blank_space(UBYTE c); -STATIC VOID strip_extra_blank_spaces(STRPTR s); -STATIC LONG VARARGS68K Local_Printf(struct CommandContext *cc, STRPTR format, ...); -STATIC VOID Local_PrintFault(struct CommandContext *cc, LONG error, STRPTR prefix); -STATIC LONG VARARGS68K Local_ErrorPrintf(struct CommandContext *cc, STRPTR format, ...); -STATIC STRPTR get_builtin_str(LONG id); -STATIC STRPTR get_str(struct CommandContext *cc, LONG id); -STATIC LONG VARARGS68K Local_AddRouteTags(struct CommandContext *cc, ...); -STATIC LONG VARARGS68K Local_ConfigureInterfaceTags(struct CommandContext *cc, STRPTR interface_name, ...); -STATIC LONG VARARGS68K Local_SocketBaseTags(struct CommandContext *cc, ...); - -/****************************************************************************/ - -/****** ROADSHOW/CONFIGURENETINTERFACE **************************************** -* -* NAME -* ConfigureNetInterface - Configure network interface parameters. -* -* FORMAT -* ConfigureNetInterface [QUIET] [TIMEOUT=] INTERFACE -* -* TEMPLATE -* INTERFACE/A,QUIET/S,ADDRESS/K,NETMASK/K,BROADCASTADDR/K, -* DESTINATION=DESTINATIONADDR/K,METRIC/K/N,MTU/K/N,ALIASADDR/K, -* DELETEADDR/K,ONLINE/S,OFFLINE/S,UP/S,DOWN/S,DEBUG/K,COMPLETE/K, -* CONFIGURE/K,LEASE/K,RELEASE=RELEASEADDRESS/S,ID/K,TIMEOUT/K/N, -* DHCPUNICAST/K -* -* PATH -* C:CONFIGURENETINTERFACE -* -* FUNCTION -* CONFIGURENETINTERFACE is used to define how a network interface will -* react and how it will interact with your network. -* -* OPTIONS -* INTERFACE/A -* The name of the interface to be configured. This is a required -* parameter. -* -* QUIET/S -* This option causes the program not to emit any error messages -* or progress reports. Also, if the program encounters an error -* it will flag this as failure code 5 which can be looked at -* using the 'if warn' shell script command. If this option is -* not in effect, failure codes will be more severe and all sorts -* of progress information will be displayed. -* -* ADDRESS/K -* The IP address to assign to this interface. This should be -* specified in dotted-decimal notation ("192.168.0.1") and not as -* symbolic name since the system may not be in a state to perform a -* name resolution. -* -* In place of the IP address you can also specify "DHCP". As the -* name suggests, this will start a configuration process involving -* the DHCP protocol which should eventually yield the right IP -* address for this host. Note that this configuration procedure only -* works for Ethernet hardware. -* -* NETMASK/K -* The subnet mask to assign to this interface. This must be -* specified in dotted-decimal notation ("192.168.0.1"). -* -* In place of the subnet mask you can also specify "DHCP". As the -* name suggests, this will start a configuration process involving -* the DHCP protocol which should eventually yield the right -* subnet mask for this host. Note that this configuration procedure -* only works for Ethernet hardware. -* -* BROADCASTADDR/K -* The broadcast address to be used by this interface; must be -* specified in dotted-decimal notation ("192.168.0.1") and only -* works with interfaces that support broadcasts in the first place -* (i.e. Ethernet hardware). -* -* DESTINATION=DESTINATIONADDR/K -* The address of the point-to-point partner for this interface; must -* be specified in dotted-decimal notation ("192.168.0.1"). Only -* works for point-to-point connections, such as PPP. -* -* METRIC/K/N -* Route metric value for this interface. -* -* MTU/K/N -* You can limit the maximum transmission size used by the TCP/IP -* stack to push data through the interface. The interface driver -* will have its own ideas about the maximum transmission size. -* You can therefore only suggest a smaller value than the -* driver's preferred hardware MTU size. -* -* ALIASADDR/K -* This adds another address to this interface to respond to. You -* can add as many aliases as you like, provided you don't run out -* of memory. -* -* DELETEADDR/K -* This removes an alias address from the list the interface is to -* respond to. -* -* UP -* DOWN -* ONLINE -* OFFLINE -* This configures the 'line state' of the interface; four states -* are supported: -* -* UP -* The protocol stack will attempt to transmit messages -* through this interface (even though it might not be -* online yet). -* -* DOWN -* The protocol stack will no longer attempt to transmit -* messages through this interface (even though it might -* still be online). -* -* OFFLINE -* The underlying networking device driver is put offline -* and the protocol stack will no longer try to send -* messages through the interface either. -* -* ONLINE -* An attempt is made to put the underlying networking -* driver online. If that works, then the protocol stack -* will attempt to transmit messages through this -* interface. -* -* DEBUG/K (possible parameters: YES or NO) -* You can enable debug output for this interface to help in tracking -* down configuration problems. At this time of writing, the debug -* mode will, if enabled, produce information on the progress of the -* DHCP configuration process. -* -* COMPLETE/K (possible parameters: YES or NO) -* If you configure an interface in several steps, use this parameter -* in the final invocation of the program. It will tell the TCP/IP -* stack that the configuration for this interface is complete. This -* has the effect of causing the static route definition file to be -* reread, if necessary. -* -* RELEASEADDRESS -* If an IP address was dynamically assigned to an interface, this -* switch will tell ConfigureNetInterface to release it. Note that -* you can only release what was previously allocated. -* -* CONFIGURE/K (possible parameters: DHCP, AUTO or FASTAUTO) -* You can use DHCP configuration for this interface and protocol -* stack internals, namely the list of routers (and the default -* gateway) to use and the domain name servers. This option allows -* you to bring up the complete network configuration in one -* single step. -* -* You can request that a particular IP address is assigned to this -* interface by the DHCP process by specifying CONFIGURE=DHCP and -* your choice of ADDRESS=xxx.xxx.xxx.xxx. -* -* If your network has no DHCP server, you may choose -* CONFIGURE=AUTO to use automatic IPv4 address selection, -* based upon a protocol called ZeroConf. This protocol will -* select a currently unused address from a specially -* designated address range. -* -* If you choose automatic configuration in a wireless network, -* you might want to use CONFIGURE=FASTAUTO instead of -* CONFIGURE=AUTO. -* -* Note that only the CONFIGURE=DHCP option will attempt to -* set up a default route and a set of DNS servers for you to -* use. The alternatives of CONFIGURE=FASTAUTO and -* CONFIGURE=AUTO are restricted to selecting the network -* interface IPv4 addresses. -* -* TIMEOUT/K/N -* If you're going to use DHCP configuration for any of the -* interfaces, a default timeout value of 60 seconds will -* limit the time an interface can take to be configured. -* This parameter allows you to use a different timeout value. -* Note that due to how the configuration protocol works, -* the timeout cannot be shorter than ten seconds. -* -* LEASE/K -* This is a complex option which can be used to request how long an -* IP address should be bound to an interface. Several combinations -* of options are possible. Here is a short list: -* -* LEASE=300 -* LEASE=300seconds -* -* This requests a lease of exactly 300 seconds, or -* five minutes. -* -* LEASE=30min -* -* This requests a lease of 30 minutes. -* -* LEASE=2hours -* -* This requests a lease of 2 hours. -* -* LEASE=1day -* -* This requests a lease of 1 day. -* -* LEASE=4weeks -* -* This requests a lease of 4 weeks. -* -* LEASE=infinite -* -* This requests that the IP address should be -* permanently bound. -* -* Blank spaces between the numbers and the qualifiers are supported. -* The qualifiers are tested using substring matching, which means -* for example that "30 minutes" is the same as "30 min" and "30 m". -* -* Note that the requested lease time may be ignored by the DHCP -* server. After all, it is just a suggestion and not an order. -* -* ID/K -* This option works along with the CONFIGURE=DHCP process. It can be -* used to tell the DHCP server by which name the local host should be -* referred to. Some DHCP servers are on good terms with their local name -* resolution services and will add the name and the associated IP -* address to the local host database. The name you can supply here -* cannot be longer than 255 characters and must be at least 2 characters -* long. Keep it brief: not all DHCP servers have room for the whole 255 -* characters. -* -* DHCPUNICAST/K (possible parameters: YES or NO) -* Some DHCP servers may not be able to respond to requests for -* assigning IP addresses unless the responses are sent directly -* to the computer which sent the requests. In such cases you -* might want to use DHCPUNICAST=YES option. -* -* NOTES -* The command is similar to the Unix "ifconfig" command. -* -* If you tell an interface to go online then the program's return -* code will tell you if the command succeeded: a return value of 0 -* indicates success (the interface is now online), and a value -* of 5 indicates that it didn't quite work. -* -* Configuring the address of an interface has two effects: first, -* the interface will be marked as 'up', meaning that the protocol -* stack will attempt to send messages through it when appropriate. -* Second, a direct route to the interface will be established. -* -* SEE ALSO -* AddNetInterface -* -****************************************************************************** -*/ -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - struct Message * mn; - - WaitPort(mp); - mn = GetMsg(mp); - - Forbid(); - ReplyMsg(mn); - goto out; - } - - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - - if(cc->cc_LocaleBase != NULL) - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - - result = cmd(cc); - - if(cc->cc_Tags != NULL) - FreeVec(cc->cc_Tags); - - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - out: - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - - if(cc->cc_ISocket != NULL) - DropInterface((struct Interface *)cc->cc_ISocket); - - if(cc->cc_IUtility != NULL) - DropInterface((struct Interface *)cc->cc_IUtility); - } - #endif /* __amigaos4__ */ - - if(cc->cc_UtilityBase != NULL) - CloseLibrary(cc->cc_UtilityBase); - - if(cc->cc_SocketBase != NULL) - CloseLibrary(cc->cc_SocketBase); - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - cc->cc_UtilityBase = OpenLibrary("utility.library",37); - - #if defined(__amigaos4__) - { - if(cc->cc_UtilityBase != NULL) - { - cc->cc_IUtility = (struct UtilityIFace *)GetInterface(cc->cc_UtilityBase, "main", 1, 0); - if(cc->cc_IUtility == NULL) - { - CloseLibrary(cc->cc_UtilityBase); - cc->cc_UtilityBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - cc->cc_SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(cc->cc_SocketBase != NULL) - { - cc->cc_ISocket = (struct SocketIFace *)GetInterface(cc->cc_SocketBase, "main", 1, 0); - if(cc->cc_ISocket == NULL) - { - CloseLibrary(cc->cc_SocketBase); - cc->cc_SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define CONFIGURENETINTERFACE_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -STATIC LONG -cmd(struct CommandContext * cc) -{ - struct - { - KEY Interface; - SWITCH Quiet; - KEY Address; - KEY NetMask; - KEY BroadcastAddress; - KEY DestinationAddress; - NUMBER Metric; - NUMBER MTU; - KEY AddAddress; - KEY DeleteAddress; - SWITCH Online; - SWITCH Offline; - SWITCH Up; - SWITCH Down; - KEY Debug; - KEY Complete; - KEY Configure; - KEY Lease; - SWITCH ReleaseAddress; - KEY ID; - NUMBER Timeout; - KEY DHCPUnicast; - } args; - - STRPTR args_template = - "INTERFACE/A," - "QUIET/S," - "ADDRESS/K," - "NETMASK/K," - "BROADCASTADDR/K," - "DESTINATION=DESTINATIONADDR/K," - "METRIC/K/N," - "MTU/K/N," - "ALIASADDR/K," - "DELETEADDR/K," - "ONLINE/S," - "OFFLINE/S," - "UP/S," - "DOWN/S," - "DEBUG/K," - "COMPLETE/K," - "CONFIGURE/K," - "LEASE/K," - "RELEASE=RELEASEADDRESS/S," - "ID/K," - "TIMEOUT/K/N," - "DHCPUNICAST/K" - VERSTAG; - - DECLARE_SYSBASE(cc); - DECLARE_DOSBASE(cc); - DECLARE_UTILITYBASE(cc); - DECLARE_SOCKETBASE(cc); - - struct AddressAllocationMessage * aam = &cc->cc_AllocationMessage; - LONG result = RETURN_FAIL; - LONG have_interface_api = FALSE; - LONG have_routing_api = FALSE; - LONG have_address_conversion_api = FALSE; - struct RDArgs * rda; - STRPTR state_name = NULL; - int state = -1; - LONG error; - BOOL quiet = FALSE; - STRPTR address = NULL; - STRPTR net_mask = NULL; - BOOL configure_dynamic = FALSE; - BOOL configure_auto = FALSE; - BOOL configure_slow_auto = FALSE; - LONG timeout; - UBYTE default_domain_name[256]; - ULONG lease_time = DHCP_DEFAULT_LEASE_TIME; - STRPTR client_id = NULL; - LONG dhcp_unicast = FALSE; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),cc->cc_ProgramName); - goto out; - } - - quiet = (BOOL)(args.Quiet != 0); - - if(UtilityBase == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NO_UTILITY_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(SocketBase == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_INTERFACE_API),&have_interface_api, - TAG_END) != 0) - { - have_interface_api = FALSE; - } - - if(NOT have_interface_api) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_ROUTING_API),&have_routing_api, - TAG_END) != 0) - { - have_routing_api = FALSE; - } - - if(NOT have_routing_api) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_ADDRESS_CONVERSION_API),&have_address_conversion_api, - TAG_END) != 0) - { - have_address_conversion_api = FALSE; - } - - if(NOT have_address_conversion_api) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(args.Address != NULL) - { - struct in_addr in; - - if(Stricmp(args.Address,"DHCP") != SAME) - { - if(CANNOT validate_ip_address(cc,quiet,"ADDRESS",args.Address)) - goto out; - } - - if(inet_aton(args.Address,&in)) - { - if(in.s_addr == 0 || in.s_addr == ~0UL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INVALID_ADDRESS_TXT), - cc->cc_ProgramName,args.Address); - } - - goto out; - } - - if(((in.s_addr >> 24) & 0xFF) == 169 && - ((in.s_addr >> 16) & 0xFF) == 254) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT), - cc->cc_ProgramName,args.Address); - } - } - - FreeVec(address); - - address = AllocVec(strlen(args.Address) + 1,MEMF_ANY|MEMF_PUBLIC); - if(address != NULL) - { - strcpy(address,args.Address); - } - else - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_ADDRESS_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - } - - if(args.NetMask != NULL) - { - if(Stricmp(args.NetMask,"DHCP") != SAME) - { - if(CANNOT validate_ip_address(cc,quiet,"NETMASK",args.NetMask)) - goto out; - } - - FreeVec(net_mask); - - net_mask = AllocVec(strlen(args.NetMask) + 1,MEMF_ANY|MEMF_PUBLIC); - if(net_mask != NULL) - { - strcpy(net_mask,args.NetMask); - } - else - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MASK_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - } - - if(args.DestinationAddress != NULL) - { - if(CANNOT validate_ip_address(cc,quiet,"DESTINATIONADDR",args.DestinationAddress)) - goto out; - - error = add_tag(cc,IFC_DestinationAddress,(ULONG)args.DestinationAddress); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_DESTINATION_ADDRESS_TXT), - cc->cc_ProgramName,args.Interface,args.DestinationAddress); - } - - goto out; - } - } - - if(args.BroadcastAddress != NULL) - { - if(CANNOT validate_ip_address(cc,quiet,"BROADCASTADDR",args.BroadcastAddress)) - goto out; - - error = add_tag(cc,IFC_BroadcastAddress,(ULONG)args.BroadcastAddress); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_BROADCAST_ADDRESS_TXT), - cc->cc_ProgramName,args.Interface,args.BroadcastAddress); - } - - goto out; - } - } - - if(args.Metric != NULL) - { - error = add_tag(cc,IFC_Metric,(*args.Metric)); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_METRIC_TXT), - cc->cc_ProgramName,args.Interface,(*args.Metric)); - } - - goto out; - } - } - - if(args.MTU != NULL && (*args.MTU) > 0) - { - error = add_tag(cc,IFC_LimitMTU,(*args.MTU)); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MTU_TXT), - cc->cc_ProgramName,args.Interface,(*args.MTU)); - } - - goto out; - } - } - - if(args.Timeout != NULL && (*args.Timeout) > 0) - { - timeout = (*args.Timeout); - if(timeout < AAM_TIMEOUT_MIN) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_TIMEOUT_TOO_SHORT_TXT), - cc->cc_ProgramName,timeout); - } - - timeout = AAM_TIMEOUT_MIN; - } - } - else - { - timeout = 60; - } - - if(args.AddAddress != NULL) - { - if(CANNOT validate_ip_address(cc,quiet,"ALIASADDR",args.AddAddress)) - goto out; - - error = add_tag(cc,IFC_AddAliasAddress,(ULONG)args.AddAddress); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_ALIAS_ADDRESS_TXT), - cc->cc_ProgramName,args.Interface,args.AddAddress); - } - - goto out; - } - } - - if(args.DeleteAddress != NULL) - { - if(CANNOT validate_ip_address(cc,quiet,"DELETEADDR",args.DeleteAddress)) - goto out; - - error = add_tag(cc,IFC_DeleteAliasAddress,(ULONG)args.DeleteAddress); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_DELETE_ALIAS_ADDRESS_TXT), - cc->cc_ProgramName,args.Interface,args.DeleteAddress); - } - - goto out; - } - } - - if(args.Debug != NULL) - { - BOOL mode = FALSE; - - if(Stricmp(args.Debug,"ON") == SAME || Stricmp(args.Debug,"YES") == SAME) - { - mode = TRUE; - } - else if (Stricmp(args.Debug,"OFF") != SAME && Stricmp(args.Debug,"NO") != SAME) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_UNKNOWN_DEBUG_PARAMETER_TXT), - cc->cc_ProgramName,args.Debug); - } - - goto out; - } - - error = add_tag(cc,IFC_SetDebugMode,(ULONG)mode); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - } - - if(args.Complete != NULL) - { - BOOL complete = FALSE; - - if(Stricmp(args.Complete,"ON") == SAME || Stricmp(args.Complete,"YES") == SAME) - { - complete = TRUE; - } - else if (Stricmp(args.Complete,"OFF") != SAME && Stricmp(args.Complete,"NO") != SAME) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_UNKNOWN_COMPLETE_PARAMETER_TXT), - cc->cc_ProgramName,args.Complete); - } - - goto out; - } - - error = add_tag(cc,IFC_Complete,(ULONG)complete); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - } - - if(args.Configure != NULL) - { - if(Stricmp(args.Configure,"DHCP") == SAME) - { - configure_dynamic = TRUE; - configure_auto = FALSE; - } - else if (Stricmp(args.Configure,"SLOWAUTO") == SAME || Stricmp(args.Configure,"AUTO") == SAME) - { - configure_dynamic = configure_auto = configure_slow_auto = TRUE; - } - else if (Stricmp(args.Configure,"FASTAUTO") == SAME) - { - configure_dynamic = configure_auto = TRUE; - configure_slow_auto = FALSE; - } - else - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_UNKNOWN_CONFIGURE_PARAMETER_TXT), - cc->cc_ProgramName,args.Configure); - } - - goto out; - } - } - - if(args.Online || args.Offline || args.Up || args.Down) - { - STRPTR switches[4]; - LONG count; - - memset(switches,0,sizeof(switches)); - - count = 0; - - if(args.Online) - { - state_name = "ONLINE"; - state = SM_Online; - - switches[count++] = state_name; - } - - if(args.Offline) - { - state_name = "OFFLINE"; - state = SM_Offline; - - switches[count++] = state_name; - } - - if(args.Up) - { - state_name = "UP"; - state = SM_Up; - - switches[count++] = state_name; - } - - if(args.Down) - { - state_name = "DOWN"; - state = SM_Down; - - switches[count++] = state_name; - } - - if(count > 1) - { - if(NOT quiet) - { - LONG i; - - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_PICK_ONLY_ONE_STATE_TXT),cc->cc_ProgramName); - - for(i = 0 ; i < count ; i++) - { - if(i > 0) - Local_ErrorPrintf(cc,","); - - Local_ErrorPrintf(cc," %s",switches[i]); - } - - Local_ErrorPrintf(cc,".\n"); - } - - goto out; - } - } - - if(args.Lease != NULL) - { - STRPTR s = args.Lease; - STRPTR key = NULL; - LONG number; - LONG len; - - while(is_blank_space(*s)) - s++; - - len = 0; - number = 0; - while('0' <= (*s) && (*s) <= '9') - { - number = (10 * number) + (*s) - '0'; - len++; - s++; - } - - while(is_blank_space(*s)) - s++; - - if(s[0] != '\0') - key = s; - - if(len == 0 && key != NULL) - { - if(substring_matches(cc,"INF",key) == SAME) - { - lease_time = DHCP_INFINITE_LEASE_TIME; - } - else - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT), - cc->cc_ProgramName,key); - } - - goto out; - } - } - else if (len > 0) - { - lease_time = number; - - if(key != NULL) - { - if(substring_matches(cc,"SECOND",key) == SAME) - { - /* This is the default unit */ - } - else if (substring_matches(cc,"MINUTE",key) == SAME) - { - lease_time *= 60; - } - else if (substring_matches(cc,"HOUR",key) == SAME) - { - lease_time *= 60 * 60; - } - else if (substring_matches(cc,"DAY",key) == SAME) - { - lease_time *= 24 * 60 * 60; - } - else if (substring_matches(cc,"WEEK",key) == SAME) - { - lease_time *= 7 * 24 * 60 * 60; - } - else - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT), - cc->cc_ProgramName,key); - } - - goto out; - } - } - } - else - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INVALID_LEASE_PARAMETER_TXT), - cc->cc_ProgramName,args.Lease); - } - - goto out; - } - } - - if(args.ID != NULL) - { - if(strlen(args.ID) > 255 && NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_ID_TOO_LONG_TXT), - args.ID); - } - - if(strlen(args.ID) < 2) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_ID_TOO_SHORT_TXT), - args.ID); - } - - goto out; - } - - client_id = args.ID; - } - - /* Request that the DHCP server sends replies using - unicast instead of broadcast? */ - if(args.DHCPUnicast != NULL) - { - LONG mode = FALSE; - - if(Stricmp(args.DHCPUnicast,"ON") == SAME || Stricmp(args.DHCPUnicast,"YES") == SAME) - { - mode = TRUE; - } - else if (Stricmp(args.DHCPUnicast,"OFF") != SAME && Stricmp(args.DHCPUnicast,"NO") != SAME) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_UNKNOWN_UNICAST_PARAMETER_TXT), - cc->cc_ProgramName,args.DHCPUnicast); - } - - goto out; - } - - dhcp_unicast = mode; - } - - if(args.ReleaseAddress) - { - if(Local_ConfigureInterfaceTags(cc,args.Interface, - IFC_ReleaseAddress,TRUE, - TAG_DONE) != 0) - { - if(NOT quiet) - { - LONG errno; - STRPTR code; - - get_errno_and_code(cc,&errno,&code); - - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_COULD_NOT_RELEASE_INTERFACE_ADDRESS_TXT), - cc->cc_ProgramName,args.Interface); - - if(code != NULL && errno > 0) - Local_ErrorPrintf(cc," (%s)",code); - - Local_ErrorPrintf(cc,".\n"); - } - - goto out; - } - - if(NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_WAS_RELEASED_TXT), - args.Interface); - } - } - - if(address != NULL || configure_dynamic) - { - BOOL want_address = (BOOL)(address != NULL && Stricmp(address,"DHCP") == SAME); - BOOL want_netmask = (BOOL)(net_mask != NULL && Stricmp(net_mask,"DHCP") == SAME); - - if(configure_dynamic || want_address || want_netmask) - { - LONG signals; - - /* Remember the client identifier. */ - aam->aam_ClientIdentifier = client_id; - - /* We have to have the reply port ready. */ - if(cc->cc_ReplyPort == NULL) - { - cc->cc_ReplyPort = CreateMsgPort(); - if(cc->cc_ReplyPort == NULL) - { - if(NOT quiet) - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_TXT),cc->cc_ProgramName,args.Interface); - - goto out; - } - } - - /* Before we begin, we will need to mark this - interface 'up' so that the protocol stack will - send messages through it. */ - if(Local_ConfigureInterfaceTags(cc,args.Interface, - IFC_State,SM_Up, - TAG_DONE) != 0) - { - if(NOT quiet) - { - LONG errno; - STRPTR code; - - get_errno_and_code(cc,&errno,&code); - - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_COULD_NOT_MARK_INTERFACE_UP_TXT), - cc->cc_ProgramName,args.Interface); - - if(code != NULL && errno > 0) - Local_ErrorPrintf(cc," (%s)",code); - - Local_ErrorPrintf(cc,".\n"); - } - - goto out; - } - - if(NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT), - cc->cc_ProgramName,args.Interface); - - Flush(Output()); - } - - /* Initialize the message, then send it. */ - aam->aam_Message.mn_Node.ln_Type = NT_REPLYMSG; - aam->aam_Message.mn_ReplyPort = cc->cc_ReplyPort; - aam->aam_Message.mn_Length = sizeof(*aam); - - memcpy(aam->aam_InterfaceName,args.Interface,sizeof(aam->aam_InterfaceName)-1); - aam->aam_InterfaceName[sizeof(aam->aam_InterfaceName)-1] = '\0'; - - if(configure_auto) - { - if(configure_slow_auto) - aam->aam_Protocol = AAMP_SLOWAUTO; - else - aam->aam_Protocol = AAMP_FASTAUTO; - } - else - { - aam->aam_Protocol = AAMP_DHCP; - } - - aam->aam_Version = AAM_VERSION; - aam->aam_Timeout = timeout; - aam->aam_LeaseTime = lease_time; - aam->aam_RouterTable = cc->cc_RouterTable; - aam->aam_RouterTableSize = NUM_ENTRIES(cc->cc_RouterTable); - aam->aam_DNSTable = cc->cc_DNSTable; - aam->aam_DNSTableSize = NUM_ENTRIES(cc->cc_DNSTable); - aam->aam_LeaseExpires = &cc->cc_LeaseExpires; - aam->aam_DomainName = default_domain_name; - aam->aam_DomainNameSize = sizeof(default_domain_name); - aam->aam_Unicast = dhcp_unicast; /* Note: this field only exists in version 2 and above */ - - strcpy(default_domain_name,""); - - if(address != NULL && Stricmp(address,"DHCP") != SAME) - aam->aam_RequestedAddress = inet_addr(address); - - BeginInterfaceConfig(aam); - - /* Wait for something to happen. */ - signals = Wait(SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_F | (1UL << cc->cc_ReplyPort->mp_SigBit)); - - if(signals & SIGBREAKF_CTRL_C) - { - AbortInterfaceConfig(aam); - WaitPort(cc->cc_ReplyPort); - GetMsg(cc->cc_ReplyPort); - - if(NOT quiet) - { - Local_Printf(cc,"\n"); - Local_PrintFault(cc,ERROR_BREAK,cc->cc_ProgramName); - } - - goto out; - } - else if (signals & SIGBREAKF_CTRL_F) - { - AbortInterfaceConfig(aam); - WaitPort(cc->cc_ReplyPort); - GetMsg(cc->cc_ReplyPort); - - if(NOT quiet) - { - Local_Printf(cc,"\n"); - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT), - cc->cc_ProgramName,args.Interface); - } - - result = RETURN_OK; - goto out; - } - else - { - if(NOT quiet) - Local_Printf(cc,"\n"); - - WaitPort(cc->cc_ReplyPort); - GetMsg(cc->cc_ReplyPort); - - if(aam->aam_Result != AAMR_Success && NOT quiet) - { - STATIC CONST error_map_table[][2] = - { - { AAMR_Aborted, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT }, - { AAMR_Timeout, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_TIMED_OUT_TXT }, - { AAMR_InterfaceNotKnown, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NAME_UNKNOWN_TXT }, - { AAMR_InterfaceWrongType, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_WRONG_TYPE_TXT }, - { AAMR_AddressKnown, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ALREADY_CONFIGURED_TXT }, - { AAMR_VersionUnknown, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_COMPATIBLE_TXT }, - { AAMR_NoMemory, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_ENOUGH_MEMORY_TXT }, - { AAMR_AddressInUse, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_IN_USE_TXT }, - { AAMR_AddrChangeFailed, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_NOT_CHANGED_TXT }, - { AAMR_MaskChangeFailed, MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_MASK_NOT_CHANGED_TXT }, - { AAMR_Busy, MSG_CONFIGURENETINTERFACE_INTERFACE_IS_BUSY_TXT }, - { -1, -1} - }; - - LONG message_code; - size_t i; - - message_code = MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_UNKNOWN_ERROR_TXT ; - - for(i = 0 ; error_map_table[i][0] != -1 ; i++) - { - if(aam->aam_Result == error_map_table[i][0]) - { - message_code = error_map_table[i][1]; - break; - } - } - - Local_ErrorPrintf(cc,get_str(cc,message_code), - cc->cc_ProgramName,args.Interface,aam->aam_Result); - } - - if(aam->aam_Result != AAMR_Success) - { - result = RETURN_OK; - goto out; - } - - if(configure_dynamic || want_address) - { - UBYTE str[20]; - - if(aam->aam_Address == 0) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_INVALID_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - - strcpy(str,Inet_NtoA(aam->aam_Address)); - - FreeVec(address); - - address = AllocVec(strlen(str)+1,MEMF_ANY|MEMF_PUBLIC); - if(address == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_ENOUGH_MEMORY_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - - strcpy(address,str); - } - - if(configure_dynamic || want_netmask) - { - if(aam->aam_SubnetMask == 0x00000000 || - aam->aam_SubnetMask == 0xFFFFFFFF) - { - FreeVec(net_mask); - net_mask = NULL; - } - else - { - UBYTE str[20]; - - strcpy(str,Inet_NtoA(aam->aam_SubnetMask)); - - FreeVec(net_mask); - - net_mask = AllocVec(strlen(str)+1,MEMF_ANY|MEMF_PUBLIC); - if(net_mask == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_ENOUGH_MEMORY_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - - strcpy(net_mask,str); - } - } - - if(configure_dynamic) - { - LONG i,n; - - n = 0; - for(i = 0 ; i < aam->aam_RouterTableSize ; i++) - { - if(aam->aam_RouterTable[i] != 0) - n++; - } - - if(n == 0) - aam->aam_RouterTable = NULL; - - n = 0; - for(i = 0 ; i < aam->aam_DNSTableSize ; i++) - { - if(aam->aam_DNSTable[i] != 0) - n++; - } - - if(n == 0) - aam->aam_DNSTable = NULL; - } - - /* If we are about to set the interface address, we will also - have to take care of the interface state, which defaults to - 'up'. */ - if(state == -1) - state = SM_Up; - } - } - } - - if(address != NULL) - { - error = add_tag(cc,IFC_Address,(ULONG)address); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_ADDRESS_TXT), - cc->cc_ProgramName,args.Interface,address); - } - - goto out; - } - } - - if(net_mask != NULL) - { - error = add_tag(cc,IFC_NetMask,(ULONG)net_mask); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_NETMASK_TXT), - cc->cc_ProgramName,args.Interface,net_mask); - } - - goto out; - } - } - - if(cc->cc_NumTags > 0) - { - if(state == SM_Online || state == SM_Up) - { - error = add_tag(cc,IFC_State,state); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_STATE_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - - state = -1; - } - - error = add_tag(cc,TAG_END,0); - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT), - cc->cc_ProgramName,args.Interface); - } - - goto out; - } - - if(ConfigureInterfaceTagList(args.Interface,cc->cc_Tags) != OK) - { - if(NOT quiet) - { - LONG error = OK; - STRPTR code = NULL; - - get_errno_and_code(cc,&error,&code); - - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT), - cc->cc_ProgramName,args.Interface); - - if(code != NULL && error > 0) - Local_ErrorPrintf(cc," (%s)",code); - - Local_ErrorPrintf(cc,".\n"); - } - - goto out; - } - - if(NOT quiet) - { - STRPTR prefix = ""; - - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURED_TXT), - cc->cc_ProgramName,args.Interface); - - if(args.Address != NULL) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_IS_TXT),prefix,args.Address); - prefix = ", "; - } - - if(args.NetMask != NULL) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_MASK_TXT),prefix,args.NetMask); - prefix = ", "; - } - - if(args.DestinationAddress != NULL) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_DESTINATION_ADDRESS_TXT),prefix,args.DestinationAddress); - prefix = ", "; - } - - if(args.BroadcastAddress != NULL) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_BROADCAST_ADDRESS_TXT),prefix,args.BroadcastAddress); - prefix = ", "; - } - - if(args.Metric != NULL) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_METRIC_TXT),prefix,(*args.Metric)); - prefix = ", "; - } - - if(args.AddAddress != NULL) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_ADD_ADDRESS_TXT),prefix,args.AddAddress); - prefix = ", "; - } - - if(args.DeleteAddress != NULL) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_DELETE_ADDRESS_TXT),prefix,args.DeleteAddress); - } - - Local_Printf(cc,").\n"); - } - } - - if(configure_dynamic) - { - STRPTR domain_name; - - if(aam->aam_DomainName != NULL && aam->aam_DomainName[0] != '\0') - domain_name = aam->aam_DomainName; - else - domain_name = ""; - - SetDefaultDomainName(domain_name); - - if(domain_name[0] != '\0' && NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_DEFAULT_DOMAIN_NAME_TXT), - cc->cc_ProgramName,domain_name); - } - } - - if(configure_dynamic && aam->aam_RouterTable != NULL) - { - LONG i,n; - - n = 0; - for(i = 0 ; i < aam->aam_RouterTableSize ; i++) - { - if(aam->aam_RouterTable[i] != 0) - { - UBYTE str[20]; - LONG error = OK; - STRPTR code = NULL; - - strcpy(str,Inet_NtoA(aam->aam_RouterTable[i])); - - if(n == 0) - { - if(Local_AddRouteTags(cc, - RTA_DefaultGateway,str, - TAG_DONE) != OK) - { - get_errno_and_code(cc,&error,&code); - } - - if(error == OK && NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_ADDED_DEFAULT_ROUTE_TXT), - cc->cc_ProgramName,str); - } - } - else - { - if(Local_AddRouteTags(cc, - RTA_Destination,str, - TAG_DONE) != OK) - { - get_errno_and_code(cc,&error,&code); - } - - if(error == OK && NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_ADDED_ROUTE_TXT), - cc->cc_ProgramName,str); - } - } - - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_ROUTE_TO_TXT), - cc->cc_ProgramName,str); - - if(code != NULL && error > 0) - Local_ErrorPrintf(cc," (%s)",code); - - Local_ErrorPrintf(cc,".\n"); - } - - goto out; - } - - n++; - } - } - } - - if(configure_dynamic && aam->aam_DNSTable != NULL) - { - LONG i; - - for(i = 0 ; i < aam->aam_DNSTableSize ; i++) - { - if(aam->aam_DNSTable[i] != 0) - { - UBYTE str[20]; - LONG error = OK; - STRPTR code = NULL; - - strcpy(str,Inet_NtoA(aam->aam_DNSTable[i])); - - if(AddDomainNameServer(str) != OK) - get_errno_and_code(cc,&error,&code); - - if(error != OK) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_DNS_TXT), - cc->cc_ProgramName,str); - - if(code != NULL && error > 0) - Local_ErrorPrintf(cc," (%s)",code); - - Local_ErrorPrintf(cc,".\n"); - } - - goto out; - } - - if(NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_ADDED_DNS_TXT), - cc->cc_ProgramName,str); - } - } - } - } - - if(configure_dynamic && aam->aam_Protocol == AAMP_DHCP && NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_TXT), - cc->cc_ProgramName,args.Interface,address); - - if(cc->cc_LeaseExpires.ds_Days == 0 && - cc->cc_LeaseExpires.ds_Minute == 0 && - cc->cc_LeaseExpires.ds_Tick == 0) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_LEASED_PERMANENTLY_TXT)); - } - else - { - struct DateTime dat; - UBYTE date[LEN_DATSTRING+1]; - UBYTE time[LEN_DATSTRING+1]; - - memset(&dat,0,sizeof(dat)); - - dat.dat_Stamp = cc->cc_LeaseExpires; - dat.dat_Format = FORMAT_DEF; - dat.dat_StrDate = date; - dat.dat_StrTime = time; - - DateToStr(&dat); - - strip_extra_blank_spaces(date); - strip_extra_blank_spaces(time); - - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_LEASED_UNTIL_TXT), - date,time); - } - } - - if(state != -1) - { - if(Local_ConfigureInterfaceTags(cc,args.Interface, - IFC_State,state, - TAG_END) != OK) - { - if(NOT quiet) - { - LONG error = OK; - STRPTR code = NULL; - - get_errno_and_code(cc,&error,&code); - - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_COULD_NOT_SET_STATE_TXT), - cc->cc_ProgramName,args.Interface,state_name); - - if(code != NULL && error > 0) - Local_ErrorPrintf(cc," (%s)",code); - - Local_ErrorPrintf(cc,".\n"); - } - - if(state == SM_Online) - result = RETURN_WARN; - - goto out; - } - - if(NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_STATE_CHANGED_TXT), - cc->cc_ProgramName,args.Interface,state_name); - } - } - - result = RETURN_OK; - - out: - - DeleteMsgPort(cc->cc_ReplyPort); - - FreeVec(address); - FreeVec(net_mask); - - if(quiet && result != RETURN_OK) - result = RETURN_WARN; - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -/****************************************************************************/ - -STATIC BOOL -validate_ip_address(struct CommandContext * cc,BOOL quiet,STRPTR key,STRPTR address) -{ - DECLARE_SOCKETBASE(cc); - - struct in_addr in; - BOOL result; - - if(inet_aton(address,&in)) - { - result = TRUE; - } - else - { - if(NOT quiet) - Local_ErrorPrintf(cc,get_str(cc,MSG_CONFIGURENETINTERFACE_INVALID_IP_ADDRESS_AT_TXT),cc->cc_ProgramName,key,address); - - result = FALSE; - } - - return(result); -} - -/****************************************************************************/ - -STATIC LONG -add_tag(struct CommandContext * cc,Tag tag,ULONG data) -{ - DECLARE_SYSBASE(cc); - - LONG error = OK; - LONG which = -1; - LONG i; - - for(i = 0 ; i < cc->cc_NumTags ; i++) - { - if(cc->cc_Tags[i].ti_Tag == tag) - { - which = i; - break; - } - } - - if(which == -1 && cc->cc_NumTags + 1 >= cc->cc_MaxTags) - { - struct TagItem * new_tags; - - new_tags = AllocVec(sizeof(*new_tags) * (cc->cc_MaxTags+10),MEMF_ANY|MEMF_PUBLIC); - if(new_tags == NULL) - { - error = ERROR_NO_FREE_STORE; - goto out; - } - - if(cc->cc_Tags != NULL) - CopyMem(cc->cc_Tags,new_tags,sizeof(*new_tags) * cc->cc_NumTags); - - FreeVec(cc->cc_Tags); - cc->cc_Tags = new_tags; - cc->cc_MaxTags += 10; - } - - if(which == -1) - which = cc->cc_NumTags++; - - cc->cc_Tags[which].ti_Tag = tag; - cc->cc_Tags[which].ti_Data = data; - - out: - - return(error); -} - -/****************************************************************************/ - -STATIC VOID -get_errno_and_code(struct CommandContext * cc,LONG * errno_ptr,STRPTR * code_ptr) -{ - LONG errno = 0; - LONG code; - - Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNO),&errno, - TAG_END); - - code = errno; - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNOSTRPTR),&code, - TAG_END) != 0) - { - code = 0; - } - - (*errno_ptr) = errno; - (*code_ptr) = (STRPTR)code; -} - -/****************************************************************************/ - -STATIC BOOL -substring_matches(struct CommandContext * cc,STRPTR pattern,STRPTR string) -{ - DECLARE_UTILITYBASE(cc); - - BOOL result = FALSE; - LONG i,len,pattern_len; - - len = strlen(string); - pattern_len = strlen(pattern); - - for(i = 0 ; i <= len - pattern_len ; i++) - { - if(Strnicmp(&string[len],pattern,pattern_len) == SAME) - { - result = TRUE; - break; - } - } - - return(result); -} - -/****************************************************************************/ - -STATIC BOOL -is_blank_space(UBYTE c) -{ - BOOL result; - - result = (BOOL)(c == ' ' || c == '\t' || c == (UBYTE)'\240'); - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -strip_extra_blank_spaces(STRPTR s) -{ - LONG num_leading_spaces; - LONG num_trailing_spaces; - LONG len,i; - - len = strlen(s); - - num_leading_spaces = 0; - - for(i = 0 ; i < len ; i++) - { - if(NOT is_blank_space(s[i])) - break; - - num_leading_spaces++; - } - - num_trailing_spaces = 0; - - for(i = len-1 ; i >= 0 ; i--) - { - if(NOT is_blank_space(s[i])) - break; - - num_trailing_spaces++; - } - - if(num_trailing_spaces > 0) - { - len -= num_trailing_spaces; - s[len] = '\0'; - } - - if(num_leading_spaces > 0) - memmove(s,&s[num_leading_spaces],len+1); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_Printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -Local_PrintFault(struct CommandContext * cc,LONG error,STRPTR prefix) -{ - DECLARE_DOSBASE(cc); - - UBYTE str[100]; - - Fault(error,NULL,str,sizeof(str)); - - Local_Printf(cc,"%s: %s\n",prefix,str); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_ErrorPrintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - - va_list args; - LONG result; - BPTR fh; - - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail. */ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STATIC STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - { - DECLARE_LOCALEBASE(cc); - - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - } - else - { - result = builtin_string; - } - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_AddRouteTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = AddRouteTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = AddRouteTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -STATIC LONG VARARGS68K -Local_ConfigureInterfaceTags(struct CommandContext * cc,STRPTR interface_name,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,interface_name); - result = ConfigureInterfaceTagList(interface_name,va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,interface_name); - result = ConfigureInterfaceTagList(interface_name,(struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -STATIC LONG VARARGS68K -Local_SocketBaseTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = SocketBaseTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = SocketBaseTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} diff --git a/examples/ConfigureNetInterface_rev.h b/examples/ConfigureNetInterface_rev.h deleted file mode 100644 index ef1cf58..0000000 --- a/examples/ConfigureNetInterface_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 37 -#define DATE "26.1.2017" -#define VERS "ConfigureNetInterface 4.37" -#define VSTRING "ConfigureNetInterface 4.37 (26.1.2017)\r\n" -#define VERSTAG "\0$VER: ConfigureNetInterface 4.37 (26.1.2017)" diff --git a/examples/DeleteNetRoute.c b/examples/DeleteNetRoute.c deleted file mode 100644 index 1ff0579..0000000 --- a/examples/DeleteNetRoute.c +++ /dev/null @@ -1,732 +0,0 @@ -/* - * $Id: DeleteNetRoute.c,v 1.11 2007-08-26 12:30:15 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include -#include - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -#include "DeleteNetRoute_rev.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_SocketBase; - struct Library * cc_LocaleBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct SocketIFace * cc_ISocket; - struct LocaleIFace * cc_ILocale; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - UBYTE cc_ProgramName[256]; -}; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct SocketIFace * ISocket = cc->cc_ISocket; \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -STATIC LONG cmd(struct CommandContext *cc); -STATIC LONG VARARGS68K Local_Printf(struct CommandContext *cc, STRPTR format, ...); -STATIC LONG VARARGS68K Local_ErrorPrintf(struct CommandContext *cc, STRPTR format, ...); -STATIC STRPTR get_builtin_str(LONG id); -STATIC STRPTR get_str(struct CommandContext *cc, LONG id); -STATIC LONG VARARGS68K Local_SocketBaseTags(struct CommandContext *cc, ...); -STATIC LONG VARARGS68K Local_DeleteRouteTags(struct CommandContext *cc, ...); - -/****************************************************************************/ - -/****** ROADSHOW/DELETENETROUTE ************************************************ -* -* NAME -* DeleteNetRoute - Delete a message routing path currently in use. -* -* FORMAT -* DeleteNetRoute [QUIET] [DESTINATION=] [DEFAULTGATEWAY=] -* -* TEMPLATE -* QUIET/S,DST=DESTINATION/K,DEFAULT=DEFAULTGATEWAY/K -* -* PATH -* C:DELETENETROUTE -* -* FUNCTION -* The commands removes a route that was defined in your network. -* -* OPTIONS -* QUIET/S -* This option causes the program not to emit any error messages -* or progress reports. Also, if the program encounters an error -* it will flag this as failure code 5 which can be looked at -* using the "if warn" shell script command. If this option is -* not in effect, failure codes will be more severe and all sorts -* of progress information will be displayed. -* -* DST=DESTINATION/K -* The destination address of a route (or in other words, where -* the route to be added leads to) that should be deleted. This -* must be an IP address or a symbolic name. -* -* DEFAULT=DEFAULTGATEWAY/K -* The default gateway address to be deleted. This must be an -* IP address or a symbolic name. -* -* NOTES -* This command is similar to the Unix "route" command. -* -* You can try to delete a route that doesn't exist, but it will -* get you an error message instead of failing gracefully. -* -* SEE ALSO -* AddNetRoute -****************************************************************************** -*/ -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - struct Message * mn; - - WaitPort(mp); - mn = GetMsg(mp); - - Forbid(); - ReplyMsg(mn); - goto out; - } - - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - - if(cc->cc_LocaleBase != NULL) - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - - result = cmd(cc); - - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - out: - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - - if(cc->cc_ISocket != NULL) - DropInterface((struct Interface *)cc->cc_ISocket); - } - #endif /* __amigaos4__ */ - - if(cc->cc_SocketBase != NULL) - CloseLibrary(cc->cc_SocketBase); - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - cc->cc_SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(cc->cc_SocketBase != NULL) - { - cc->cc_ISocket = (struct SocketIFace *)GetInterface(cc->cc_SocketBase, "main", 1, 0); - if(cc->cc_ISocket == NULL) - { - CloseLibrary(cc->cc_SocketBase); - cc->cc_SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define DELETENETROUTE_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -STATIC LONG -cmd(struct CommandContext * cc) -{ - struct - { - SWITCH Quiet; - KEY Destination; - KEY DefaultGateway; - } args; - - STRPTR args_template = - "QUIET/S," - "DST=DESTINATION/K," - "DEFAULT=DEFAULTGATEWAY/K" - VERSTAG; - - DECLARE_DOSBASE(cc); - DECLARE_SOCKETBASE(cc); - - LONG result = RETURN_FAIL; - LONG have_routing_api = FALSE; - struct RDArgs * rda; - BOOL quiet = FALSE; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),cc->cc_ProgramName); - goto out; - } - - quiet = (BOOL)(args.Quiet != 0); - - if(SocketBase == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_DELETENETROUTE_CANNOT_OPEN_BSDSOCKET_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_ROUTING_API),&have_routing_api, - TAG_END) != 0) - { - have_routing_api = FALSE; - } - - if(NOT have_routing_api) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_DELETENETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(args.Destination == NULL && args.DefaultGateway == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_DELETENETROUTE_NEED_EITHER_DESTINATION_OR_DEFAULT_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(args.DefaultGateway != NULL && args.Destination != NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_DELETENETROUTE_DESTINATION_IGNORED_TXT), - cc->cc_ProgramName,args.Destination); - } - - args.Destination = NULL; - } - - if(Local_DeleteRouteTags(cc, - (args.Destination != NULL) ? RTA_Destination : TAG_IGNORE, args.Destination, - (args.DefaultGateway != NULL) ? RTA_DefaultGateway : TAG_IGNORE, args.DefaultGateway, - TAG_END) != OK) - { - if(NOT quiet) - { - LONG errno = 0; - LONG code; - - Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNO),&errno, - TAG_END); - - code = errno; - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNOSTRPTR),&code, - TAG_END) != 0) - { - code = 0; - } - - if(args.DefaultGateway != NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_GATEWAY_NOT_DELETED_TXT), - cc->cc_ProgramName,args.DefaultGateway); - } - else - { - Local_ErrorPrintf(cc,get_str(cc,MSG_DELETENETROUTE_ROUTE_NOT_DELETED_TXT), - cc->cc_ProgramName,args.Destination); - } - - if(code > 0 && errno > 0) - Local_ErrorPrintf(cc," (%s)",code); - - Local_ErrorPrintf(cc,".\n"); - } - - goto out; - } - - if(NOT quiet) - { - LONG message_code; - - if(args.DefaultGateway != NULL) - message_code = MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_DELETED_TXT; - else - message_code = MSG_DELETENETROUTE_ROUTE_DELETED_TXT; - - Local_Printf(cc,get_str(cc,message_code), - cc->cc_ProgramName,args.DefaultGateway); - } - - result = RETURN_OK; - - out: - - if(quiet && result != RETURN_OK) - result = RETURN_WARN; - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_Printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_ErrorPrintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - - va_list args; - LONG result; - BPTR fh; - - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail.*/ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STATIC STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - { - DECLARE_LOCALEBASE(cc); - - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - } - else - { - result = builtin_string; - } - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_SocketBaseTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = SocketBaseTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = SocketBaseTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -STATIC LONG VARARGS68K -Local_DeleteRouteTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = DeleteRouteTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = DeleteRouteTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} diff --git a/examples/DeleteNetRoute_rev.h b/examples/DeleteNetRoute_rev.h deleted file mode 100644 index d79bec8..0000000 --- a/examples/DeleteNetRoute_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 8 -#define DATE "11.3.2009" -#define VERS "DeleteNetRoute 4.8" -#define VSTRING "DeleteNetRoute 4.8 (11.3.2009)\r\n" -#define VERSTAG "\0$VER: DeleteNetRoute 4.8 (11.3.2009)" diff --git a/examples/GetNetStatus.c b/examples/GetNetStatus.c deleted file mode 100644 index 39ff3fa..0000000 --- a/examples/GetNetStatus.c +++ /dev/null @@ -1,1003 +0,0 @@ -/* - * $Id: GetNetStatus.c,v 1.11 2007-08-26 12:30:15 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include -#include -#include - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -#include "GetNetStatus_rev.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_UtilityBase; - struct Library * cc_LocaleBase; - struct Library * cc_SocketBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct UtilityIFace * cc_IUtility; - struct LocaleIFace * cc_ILocale; - struct SocketIFace * cc_ISocket; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - UBYTE cc_ProgramName[256]; -}; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct UtilityIFace * IUtility = cc->cc_IUtility; \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct SocketIFace * ISocket = cc->cc_ISocket; \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -STATIC LONG cmd(struct CommandContext *cc); -STATIC STRPTR begin_bold(struct CommandContext *cc); -STATIC STRPTR end_bold(struct CommandContext *cc); -STATIC STRPTR get_next_token(STRPTR input, STRPTR string, LONG string_len); -STATIC LONG VARARGS68K Local_Printf(struct CommandContext *cc, STRPTR format, ...); -STATIC LONG VARARGS68K Local_ErrorPrintf(struct CommandContext *cc, STRPTR format, ...); -STATIC STRPTR get_builtin_str(LONG id); -STATIC STRPTR get_str(struct CommandContext *cc, LONG id); -STATIC LONG VARARGS68K Local_SocketBaseTags(struct CommandContext *cc, ...); - -/****************************************************************************/ - -/****** ROADSHOW/GETNETSTATUS ************************************************** -* -* NAME -* GetNetStatus - Query whether the network is operational. -* -* FORMAT -* GetNetStatus [CHECK=condition[,condition...]] [QUIET] -* -* TEMPLATE -* CHECK/K,QUIET/S -* -* FUNCTION -* The command is used to check/display which interfaces are currently -* running and which settings are being configured. It can be used in -* script files or for quick diagnostic purposes. -* -* OPTIONS -* CHECK/K -* A list of conditions to check, which must be separated by commas. -* the following conditions can be checked: -* -* INTERFACES -* Are any networking interfaces configured and operational? -* -* PTPINTERFACES -* Are any point-to-point interfaces, e.g. SLIP and PPP, -* configured and operational? -* -* BCASTINTERFACES -* Are any broadcast interfaces, e.g. Ethernet, configured -* and operational? -* -* RESOLVER -* Are any name resolution servers configured? -* -* ROUTES -* Is any routing information configured? -* -* DEFAULTROUTE -* Is the default route configured? -* -* If any of the conditions to test for is not satisfied, a message -* to this effect will be printed and the command will exit with -* status 5, which can be tested in script files using the -* 'IF WARN' command. -* -* QUIET/S -* Whatever happens, except for errors no output will be produced. -* -* NOTES -* If no conditions are to be checked for, then this command will print -* version information and the list of conditions that can be tested -* for, indicating which ones are satisfied and which are not. -* -****************************************************************************** -*/ - -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - struct Message * mn; - - WaitPort(mp); - mn = GetMsg(mp); - - Forbid(); - ReplyMsg(mn); - goto out; - } - - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - - if(cc->cc_LocaleBase != NULL) - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - - result = cmd(cc); - - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - out: - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - - if(cc->cc_ISocket != NULL) - DropInterface((struct Interface *)cc->cc_ISocket); - - if(cc->cc_IUtility != NULL) - DropInterface((struct Interface *)cc->cc_IUtility); - } - #endif /* __amigaos4__ */ - - if(cc->cc_UtilityBase != NULL) - CloseLibrary(cc->cc_UtilityBase); - - if(cc->cc_SocketBase != NULL) - CloseLibrary(cc->cc_SocketBase); - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - cc->cc_UtilityBase = OpenLibrary("utility.library",37); - - #if defined(__amigaos4__) - { - if(cc->cc_UtilityBase != NULL) - { - cc->cc_IUtility = (struct UtilityIFace *)GetInterface(cc->cc_UtilityBase, "main", 1, 0); - if(cc->cc_IUtility == NULL) - { - CloseLibrary(cc->cc_UtilityBase); - cc->cc_UtilityBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - cc->cc_SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(cc->cc_SocketBase != NULL) - { - cc->cc_ISocket = (struct SocketIFace *)GetInterface(cc->cc_SocketBase, "main", 1, 0); - if(cc->cc_ISocket == NULL) - { - CloseLibrary(cc->cc_SocketBase); - cc->cc_SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define GETNETSTATUS_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -STATIC LONG -cmd(struct CommandContext * cc) -{ - struct - { - KEY Check; - SWITCH Quiet; - } args; - - STRPTR args_template = - "CHECK/K," - "QUIET/S" - VERSTAG; - - DECLARE_DOSBASE(cc); - DECLARE_UTILITYBASE(cc); - DECLARE_SOCKETBASE(cc); - - BOOL check_interfaces = FALSE; - BOOL check_ptp_interfaces = FALSE; - BOOL check_broadcast_interfaces = FALSE; - BOOL check_resolver = FALSE; - BOOL check_routes = FALSE; - BOOL check_default_route = FALSE; - LONG result = RETURN_FAIL; - struct RDArgs * rda; - ULONG system_status; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),cc->cc_ProgramName); - goto out; - } - - if(UtilityBase == NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_GETNETSTATUS_NO_UTILITY_TXT), - cc->cc_ProgramName); - - goto out; - } - - if(SocketBase == NULL) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_GETNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT), - cc->cc_ProgramName); - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_SYSTEM_STATUS),&system_status, - TAG_END) != 0) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_GETNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - - goto out; - } - - if(args.Check != NULL) - { - STRPTR arg; - - arg = args.Check; - - if(strcmp(arg,"?") == SAME) - { - Local_Printf(cc, - "INTERFACES/S," - "PTPINTERFACES=PTP/S," - "BCASTINTERFACES=BCAST=BROADCAST/S," - "RESOLVER=NAMERESOLUTION=DNS/S," - "ROUTES/S," - "DEFAULTROUTE=DEFAULTGATEWAY/S" - "\n"); - } - else - { - UBYTE token[40]; - - while((arg = get_next_token(arg,token,sizeof(token))) != NULL) - { - if(Stricmp(token,"INTERFACES") == SAME) - check_interfaces = TRUE; - else if (Stricmp(token,"PTPINTERFACES") == SAME || Stricmp(token,"PTP") == SAME) - check_ptp_interfaces = TRUE; - else if (Stricmp(token,"BCASTINTERFACES") == SAME || Stricmp(token,"BCAST") == SAME || Stricmp(token,"BROADCAST") == SAME) - check_broadcast_interfaces = TRUE; - else if (Stricmp(token,"RESOLVER") == SAME || Stricmp(token,"NAMERESOLUTION") == SAME || Stricmp(token,"DNS") == SAME) - check_resolver = TRUE; - else if (Stricmp(token,"ROUTES") == SAME) - check_routes = TRUE; - else if (Stricmp(token,"DEFAULTROUTE") == SAME || Stricmp(token,"DEFAULTGATEWAY") == SAME) - check_default_route = TRUE; - else - Local_ErrorPrintf(cc,get_str(cc,MSG_GETNETSTATUS_UNKNOWN_CONDITION_TXT),cc->cc_ProgramName,token); - } - } - } - else if (NOT args.Quiet) - { - UBYTE string[256]; - LONG len; - - if(SocketBase->lib_IdString != NULL) - { - strncpy(string,SocketBase->lib_IdString,sizeof(string)-1); - string[sizeof(string)-1] = '\0'; - } - else - { - strcpy(string,""); - } - - len = strlen(string); - while(len > 0 && (string[len-1] == '\r' || string[len-1] == '\n')) - string[--len] = '\0'; - - if(len > 0) - { - STRPTR release_string = NULL; - BOOL need_line_feed = FALSE; - LONG i; - - for(i = 0 ; i < len ; i++) - { - if(string[i] == '\n') - { - need_line_feed = TRUE; - break; - } - } - - Local_Printf(cc,"%s",string); - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_RELEASESTRPTR),&release_string, - TAG_END) != 0) - { - release_string = NULL; - } - - if(release_string != NULL) - { - strncpy(string,release_string,sizeof(string)-1); - string[sizeof(string)-1] = '\0'; - } - else - { - strcpy(string,""); - } - - len = strlen(string); - while(len > 0 && (string[len-1] == '\r' || string[len-1] == '\n')) - string[--len] = '\0'; - - if(len > 0) - { - if(need_line_feed) - Local_Printf(cc,"\n"); - else - Local_Printf(cc," "); - - Local_Printf(cc,"[%s]",string); - } - - Local_Printf(cc,"\n"); - } - } - - result = RETURN_OK; - - if(FLAG_IS_SET(system_status,SBSYSSTAT_Interfaces)) - { - if(NOT args.Quiet && args.Check == NULL) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT)); - } - else - { - if(NOT args.Quiet && (args.Check == NULL || check_interfaces)) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_NO_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT),begin_bold(cc),end_bold(cc)); - - if(check_interfaces) - result = RETURN_WARN; - } - - if(FLAG_IS_SET(system_status,SBSYSSTAT_PTP_Interfaces)) - { - if(NOT args.Quiet && args.Check == NULL) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT)); - } - else - { - if(NOT args.Quiet && (args.Check == NULL || check_ptp_interfaces)) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_NO_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT),begin_bold(cc),end_bold(cc)); - - if(check_ptp_interfaces) - result = RETURN_WARN; - } - - if(FLAG_IS_SET(system_status,SBSYSSTAT_BCast_Interfaces)) - { - if(NOT args.Quiet && args.Check == NULL) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT)); - } - else - { - if(NOT args.Quiet && (args.Check == NULL || check_broadcast_interfaces)) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_NO_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT),begin_bold(cc),end_bold(cc)); - - if(check_broadcast_interfaces) - result = RETURN_WARN; - } - - if(FLAG_IS_SET(system_status,SBSYSSTAT_Resolver)) - { - if(NOT args.Quiet && args.Check == NULL) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_DNS_CONFIGURED_TXT)); - } - else - { - if(NOT args.Quiet && (args.Check == NULL || check_resolver)) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_NO_DNS_CONFIGURED_TXT),begin_bold(cc),end_bold(cc)); - - if(check_resolver) - result = RETURN_WARN; - } - - if(FLAG_IS_SET(system_status,SBSYSSTAT_Routes)) - { - if(NOT args.Quiet && args.Check == NULL) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_ROUTE_CONFIGURED_TXT)); - } - else - { - if(NOT args.Quiet && (args.Check == NULL || check_routes)) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_NO_ROUTE_CONFIGURED_TXT),begin_bold(cc),end_bold(cc)); - - if(check_routes) - result = RETURN_WARN; - } - - if(FLAG_IS_SET(system_status,SBSYSSTAT_DefaultRoute)) - { - if(NOT args.Quiet && args.Check == NULL) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_DEFAULT_ROUTE_CONFIGURED_TXT)); - } - else - { - if(NOT args.Quiet && (args.Check == NULL || check_default_route)) - Local_Printf(cc,get_str(cc,MSG_GETNETSTATUS_NO_DEFAULT_ROUTE_CONFIGURED_TXT),begin_bold(cc),end_bold(cc)); - - if(check_default_route) - result = RETURN_WARN; - } - - out: - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -/****************************************************************************/ - -STATIC STRPTR -begin_bold(struct CommandContext * cc) -{ - DECLARE_DOSBASE(cc); - - STRPTR result; - - if(IsInteractive(Output())) - result = "\33[1m"; - else - result = ""; - - return(result); -} - -STATIC STRPTR -end_bold(struct CommandContext * cc) -{ - DECLARE_DOSBASE(cc); - - STRPTR result; - - if(IsInteractive(Output())) - result = "\33[0m"; - else - result = ""; - - return(result); -} - -/****************************************************************************/ - -STATIC STRPTR -get_next_token( - STRPTR input, - STRPTR string, - LONG string_len) -{ - if((*input) == '\0') - { - input = NULL; - } - else - { - BOOL is_escape = FALSE; - BOOL is_quote = FALSE; - BOOL done; - UBYTE c; - - while((*input) == ' ' || (*input) == (UBYTE)'\240' || (*input) == '\t' || (*input) == ',') - input++; - - done = FALSE; - - do - { - c = (*input++); - if(c == '\0') - { - input--; - break; - } - - if(is_escape) - { - if(string_len > 1) - { - (*string++) = c; - string_len--; - } - - is_escape = FALSE; - continue; - } - - switch(c) - { - case '\\': - - is_escape = TRUE; - break; - - case ' ': - case '\240': - case '\t': - case ',': - - if(is_quote) - { - if(string_len > 1) - { - (*string++) = c; - string_len--; - } - } - else - { - done = TRUE; - } - - break; - - case '\"': - - if(is_quote) - { - done = TRUE; - } - else - { - is_quote ^= TRUE; - } - - break; - - default: - - if(string_len > 1) - { - (*string++) = c; - string_len--; - } - - break; - } - } - while(NOT done); - - if(string_len > 0) - (*string) = '\0'; - } - - return(input); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_Printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_ErrorPrintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - - va_list args; - LONG result; - BPTR fh; - - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail. */ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STATIC STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - { - DECLARE_LOCALEBASE(cc); - - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - } - else - { - result = builtin_string; - } - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_SocketBaseTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = SocketBaseTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = SocketBaseTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} diff --git a/examples/GetNetStatus_rev.h b/examples/GetNetStatus_rev.h deleted file mode 100644 index cb64ca9..0000000 --- a/examples/GetNetStatus_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 9 -#define DATE "11.3.2009" -#define VERS "GetNetStatus 4.9" -#define VSTRING "GetNetStatus 4.9 (11.3.2009)\r\n" -#define VERSTAG "\0$VER: GetNetStatus 4.9 (11.3.2009)" diff --git a/examples/NetShutdown.c b/examples/NetShutdown.c deleted file mode 100644 index 85e729b..0000000 --- a/examples/NetShutdown.c +++ /dev/null @@ -1,755 +0,0 @@ -/* - * $Id: NetShutdown.c,v 1.15 2007-08-26 12:30:16 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -#include "NetShutdown_rev.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_LocaleBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct LocaleIFace * cc_ILocale; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - UBYTE cc_ProgramName[256]; -}; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -STATIC LONG cmd(struct CommandContext *cc); -STATIC LONG VARARGS68K Local_Printf(struct CommandContext *cc, STRPTR format, ...); -STATIC LONG VARARGS68K Local_ErrorPrintf(struct CommandContext *cc, STRPTR format, ...); -STATIC STRPTR get_builtin_str(LONG id); -STATIC STRPTR get_str(struct CommandContext *cc, LONG id); - -/****************************************************************************/ - -/****** ROADSHOW/NETSHUTDOWN ************************************************** -* -* NAME -* NetShutdown - Attempt to shut down the network in an orderly fashion. -* -* FORMAT -* NetShutdown [TIMEOUT=] [QUIET] -* -* TEMPLATE -* TIMEOUT/N,QUIET/S -* -* FUNCTION -* The command will stop all running interfaces. -* -* OPTIONS -* TIMEOUT/N -* How many seconds this command should wait until it gives up. By -* default, it will wait up to 5 seconds for the network to shut -* down once it has triggered the shutdown process. -* -* QUIET/S -* Use this parameter to stop the command from reporting what it -* is currently doing. -* -* NOTES -* The "NetShutdown" command will trigger the shutdown process of the -* network. This process cannot be stopped once it has started. However, -* this command can make an attempt to wait until the shutdown has -* completed. Normally, the shutdown should be finished in a fraction of -* a second, but at times when other clients still hang onto the network -* resources, the shutdown can fail to complete quite so quickly. In that -* case, the "NetShutdown" command will tell you that it could not -* complete its task within the allocated time frame (within five -* seconds, or whatever timeout you specified). The shutdown, however, -* will proceed and may conclude at a later time. -* -* When this command starts up it begins by checking if the network is -* currently operational. If this is not the case, it will exit -* immediately, printing a message to this effect. -* -* SEE ALSO -* AddNetInterface -* ShowNetStatus -******************************************************************************* -*/ -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - struct Message * mn; - - WaitPort(mp); - mn = GetMsg(mp); - - Forbid(); - ReplyMsg(mn); - goto out; - } - - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - - if(cc->cc_LocaleBase != NULL) - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - - result = cmd(cc); - - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - out: - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - } - #endif /* __amigaos4__ */ - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define NETSHUTDOWN_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -STATIC LONG -cmd(struct CommandContext * cc) -{ - struct - { - NUMBER Timeout; - SWITCH Quiet; - } args; - - STRPTR args_template = - "TIMEOUT/N," - "QUIET/S" - VERSTAG; - - DECLARE_SYSBASE(cc); - DECLARE_DOSBASE(cc); - - struct MsgPort * timer_port = NULL; - struct timerequest * timer_request = NULL; - BOOL timer_ticking = FALSE; - LONG result = RETURN_FAIL; - struct RDArgs * rda; - struct MsgPort * reply_port = NULL; - LONG timeout; - ULONG reply_mask; - ULONG timer_mask; - ULONG signals; - struct NetControlPort * control_port; - struct NetShutdownMessage * shutdown_message = NULL; - struct NetShutdownMessage * recall_message = NULL; - LONG client_count = 0; - BOOL network_in_use; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),cc->cc_ProgramName); - goto out; - } - - /* We wait for up to 5 seconds for the network to shut down. */ - timeout = 5; - - if(args.Timeout != NULL) - { - /* The user can override the timeout, but the minimum wait time - is exactly one second. */ - timeout = (*args.Timeout); - if(timeout < 1) - { - if(NOT args.Quiet) - PrintFault(ERROR_BAD_NUMBER,cc->cc_ProgramName); - - goto out; - } - } - - shutdown_message = AllocVec(sizeof(*shutdown_message),MEMF_ANY|MEMF_PUBLIC|MEMF_CLEAR); - recall_message = AllocVec(sizeof(*shutdown_message),MEMF_ANY|MEMF_PUBLIC|MEMF_CLEAR); - - if(shutdown_message == NULL || recall_message == NULL) - { - if(NOT args.Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_NETSHUTDOWN_NO_MEMORY_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - reply_port = CreateMsgPort(); - if(reply_port == NULL) - { - if(NOT args.Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_NETSHUTDOWN_NO_MSGPORT_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - shutdown_message->nsm_Message.mn_ReplyPort = reply_port; - shutdown_message->nsm_Message.mn_Length = sizeof(*shutdown_message); - shutdown_message->nsm_Command = NSMC_Shutdown; - shutdown_message->nsm_Data = &client_count; - shutdown_message->nsm_Length = sizeof(client_count); - - recall_message->nsm_Message.mn_ReplyPort = reply_port; - recall_message->nsm_Message.mn_Length = sizeof(*recall_message); - recall_message->nsm_Command = NSMC_Cancel; - recall_message->nsm_Data = shutdown_message; - recall_message->nsm_Length = sizeof(shutdown_message); - - timer_port = CreateMsgPort(); - if(timer_port == NULL) - { - if(NOT args.Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_NETSHUTDOWN_NO_MSGPORT_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - timer_request = (struct timerequest *)CreateIORequest(timer_port,sizeof(*timer_request)); - if(timer_request == NULL) - { - if(NOT args.Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_NETSHUTDOWN_NO_TIMER_REQUEST_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(OpenDevice(TIMERNAME,UNIT_VBLANK,(struct IORequest *)timer_request,0) != OK) - { - if(NOT args.Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_NETSHUTDOWN_NO_TIMER_DEVICE_TXT), - cc->cc_ProgramName,TIMERNAME); - } - - goto out; - } - - /* Try to send the shutdown message. */ - Forbid(); - - control_port = (struct NetControlPort *)FindPort(NETWORK_CONTROLLER_PORT_NAME); - - if(control_port != NULL && control_port->ncp_Magic == NCPM_Cookie) - { - network_in_use = TRUE; - - PutMsg(&control_port->ncp_Port,(struct Message *)shutdown_message); - } - else - { - network_in_use = FALSE; - } - - Permit(); - - if(NOT network_in_use) - { - if(NOT args.Quiet) - Local_ErrorPrintf(cc,get_str(cc,MSG_NETSHUTDOWN_NETWORK_NOT_IN_USE_TXT),cc->cc_ProgramName); - - result = RETURN_WARN; - goto out; - } - - reply_mask = (1UL << reply_port->mp_SigBit); - timer_mask = (1UL << timer_port->mp_SigBit); - - /* Get the timeout rolling... */ - timer_request->tr_node.io_Command = TR_ADDREQUEST; - timer_request->tr_time.tv_secs = timeout; - timer_request->tr_time.tv_micro = 0; - - SendIO((struct IORequest *)timer_request); - timer_ticking = TRUE; - - if(NOT args.Quiet) - { - Local_Printf(cc,get_str(cc,MSG_NETSHUTDOWN_TRYING_TO_SHUT_DOWN_TXT)); - Flush(Output()); - } - - /* Wait for one of three events: the 'all clear' signal from the network - controller, the user not wanting to wait any longer and the timer to - elapse. */ - signals = Wait(SIGBREAKF_CTRL_C | reply_mask | timer_mask); - - /* Did we get the 'all clear' signal? */ - if(signals & reply_mask) - { - struct ExecBase * ExecBase = (struct ExecBase *)SysBase; - struct Library * lib; - - /* Pick up the message that is waiting. */ - GetMsg(reply_port); - - /* Flush the library from memory. */ - Forbid(); - - lib = (struct Library *)FindName(&ExecBase->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - - if(NOT args.Quiet) - Local_Printf(cc,get_str(cc,MSG_NETSHUTDOWN_SHUTDOWN_DONE_TXT)); - - result = RETURN_OK; - } - else - { - /* OK, so we need to recall the shutdown message before we bow out. */ - - Forbid(); - - /* Look for the controller port again since it may have gone away - while we were printing messages to the console, etc. above. */ - control_port = (struct NetControlPort *)FindPort(NETWORK_CONTROLLER_PORT_NAME); - if(control_port != NULL && control_port->ncp_Magic != NCPM_Cookie) - PutMsg(&control_port->ncp_Port,(struct Message *)recall_message); - - Permit(); - - /* Wait for the two messages to return. This is indicated by the - message node types changing from NT_MESSAGE to NT_REPLYMSG, or - the message type never even changing to NT_MESSAGE (if the - message is never sent). */ - while(shutdown_message->nsm_Message.mn_Node.ln_Type == NT_MESSAGE || - recall_message->nsm_Message.mn_Node.ln_Type == NT_MESSAGE) - { - WaitPort(reply_port); - - while(TRUE) - { - if(GetMsg(reply_port) == NULL) - break; - } - } - - result = RETURN_WARN; - - if(NOT args.Quiet) - { - LONG message_code; - - if(signals & SIGBREAKF_CTRL_C) - message_code = MSG_NETSHUTDOWN_SHUTDOWN_ABORTED_TXT; - else - message_code = MSG_NETSHUTDOWN_SHUTDOWN_TIMEOUT_TXT; - - Local_Printf(cc,get_str(cc,message_code)); - } - } - - out: - - if(timer_request != NULL) - { - if(timer_ticking) - { - if(CheckIO((struct IORequest *)timer_request) == NULL) - AbortIO((struct IORequest *)timer_request); - - WaitIO((struct IORequest *)timer_request); - } - - if(timer_request->tr_node.io_Device != NULL) - CloseDevice((struct IORequest *)timer_request); - - DeleteIORequest((struct IORequest *)timer_request); - } - - DeleteMsgPort(timer_port); - - DeleteMsgPort(reply_port); - - FreeVec(shutdown_message); - FreeVec(recall_message); - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_Printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_ErrorPrintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - - va_list args; - LONG result; - BPTR fh; - - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail. */ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STATIC STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - { - DECLARE_LOCALEBASE(cc); - - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - } - else - { - result = builtin_string; - } - - return(result); -} diff --git a/examples/NetShutdown_rev.h b/examples/NetShutdown_rev.h deleted file mode 100644 index 08933dc..0000000 --- a/examples/NetShutdown_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 7 -#define DATE "11.3.2009" -#define VERS "NetShutdown 4.7" -#define VSTRING "NetShutdown 4.7 (11.3.2009)\r\n" -#define VERSTAG "\0$VER: NetShutdown 4.7 (11.3.2009)" diff --git a/examples/README b/examples/README deleted file mode 100644 index 75088fb..0000000 --- a/examples/README +++ /dev/null @@ -1,12 +0,0 @@ -This directory contains the source code of the programs that call into -the Roadshow bsdsocket.library to configure the TCP/IP stack and to query -status information. These programs should compile out of the box, provided -you have the necessary SDK header files installed. I tried to keep all -the necessary files together, but it might not be the complete set. -Don't worry, though, the code is merely intended to be a demonstration -as to how to do what the configuration/query programs are doing. - -This software is copyrighted, which means that you may create your own -programs using the techniques demonstrated in the source code, and -you may reuse parts of it, but you must not take this code as a whole -and claim it as your own. diff --git a/examples/RemoveNetInterface.c b/examples/RemoveNetInterface.c deleted file mode 100644 index 1b8b7f1..0000000 --- a/examples/RemoveNetInterface.c +++ /dev/null @@ -1,650 +0,0 @@ -/* - * $Id: RemoveNetInterface.c,v 1.6 2007-08-26 12:30:16 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include -#include - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -#include "RemoveNetInterface_rev.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_SocketBase; - struct Library * cc_LocaleBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct SocketIFace * cc_ISocket; - struct LocaleIFace * cc_ILocale; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - UBYTE cc_ProgramName[256]; -}; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct SocketIFace * ISocket = cc->cc_ISocket; \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -STATIC LONG cmd(struct CommandContext *cc); -STATIC LONG VARARGS68K Local_Printf(struct CommandContext *cc, STRPTR format, ...); -STATIC LONG VARARGS68K Local_ErrorPrintf(struct CommandContext *cc, STRPTR format, ...); -STATIC STRPTR get_builtin_str(LONG id); -STATIC STRPTR get_str(struct CommandContext *cc, LONG id); -STATIC LONG VARARGS68K Local_SocketBaseTags(struct CommandContext *cc, ...); - -/****************************************************************************/ - -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - struct Message * mn; - - WaitPort(mp); - mn = GetMsg(mp); - - Forbid(); - ReplyMsg(mn); - goto out; - } - - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - - if(cc->cc_LocaleBase != NULL) - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - - result = cmd(cc); - - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - out: - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - - if(cc->cc_ISocket != NULL) - DropInterface((struct Interface *)cc->cc_ISocket); - } - #endif /* __amigaos4__ */ - - if(cc->cc_SocketBase != NULL) - CloseLibrary(cc->cc_SocketBase); - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - cc->cc_SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(cc->cc_SocketBase != NULL) - { - cc->cc_ISocket = (struct SocketIFace *)GetInterface(cc->cc_SocketBase, "main", 1, 0); - if(cc->cc_ISocket == NULL) - { - CloseLibrary(cc->cc_SocketBase); - cc->cc_SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define REMOVENETINTERFACE_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -/****** ROADSHOW/REMOVENETINTERFACE ****************************************** -* -* NAME -* RemoveNetInterface - Make the protocol stack forget about -* a network interface -* -* FORMAT -* RemoveNetInterface [QUIET] [FORCE] INTERFACE -* -* TEMPLATE -* INTERFACE/K,QUIET/S,FORCE/S -* -* PATH -* C:REMOVENETINTERFACE -* -* FUNCTION -* REMOVENETINTERFACE attempts to shut down the specified network -* interface, so that it may be added again with different parameters. -* -* OPTIONS -* INTERFACE/K -* The name of the interface to shut down. This must be the name -* previously given to ADDNETINTERFACE. -* -* QUIET/S -* This option causes the program not to emit any error messages -* or progress reports. Also, if the program encounters an error -* it will flag this as failure code 5 which can be looked at -* using the "if warn" shell script command. If this option is -* not in effect, failure codes will be more severe and all sorts -* of progress information will be displayed. -* -* FORCE/S -* REMOVENETINTERFACE tries not to shut down an interface which -* may still be in use. You can override this with the FORCE -* option which, however, carries the risk that not all the -* resources associated with the network interface may be released -* until you shut down the network with the NETSHUTDOWN command. -* -* EXAMPLES -* Shut down the interface called "DSL", and run quietly. -* -* 1> RemoveNetInterface DSL QUIET -* -* SEE ALSO -* AddNetInterface -* NetShutdown -* -****************************************************************************** -*/ -STATIC LONG -cmd(struct CommandContext * cc) -{ - struct - { - KEY Interface; - SWITCH Force; - SWITCH Quiet; - } args; - - STRPTR args_template = - "INTERFACE/A," - "FORCE/S," - "QUIET/S" - VERSTAG; - - DECLARE_DOSBASE(cc); - DECLARE_SOCKETBASE(cc); - - LONG result = RETURN_FAIL; - struct RDArgs * rda; - BOOL quiet = FALSE; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),cc->cc_ProgramName); - goto out; - } - - quiet = (BOOL)(args.Quiet != 0); - - if(SocketBase == NULL) - { - if(NOT quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_REMOVENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(CANNOT RemoveInterface(args.Interface,args.Force)) - { - result = RETURN_ERROR; - - if(NOT quiet) - { - LONG error,code; - - /* Older bsdsocket.library versions do not support the RemoveInterface() - functionality, which is why we will substitute the error code. */ - error = Errno(); - if(error == OK) - error = EBUSY; - - code = error; - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNOSTRPTR),&code, - TAG_END) != 0) - { - code = (LONG)""; - } - - Local_ErrorPrintf(cc,get_str(cc,MSG_REMOVENETINTERFACE_COULD_NOT_REMOVE_INTERFACE_TXT), - cc->cc_ProgramName,args.Interface,error,code); - } - - goto out; - } - - if(NOT quiet) - { - Local_Printf(cc,get_str(cc,MSG_REMOVENETINTERFACE_INTERFACE_REMOVED_TXT), - cc->cc_ProgramName,args.Interface); - } - - result = RETURN_OK; - - out: - - if(quiet && result != RETURN_OK) - result = RETURN_WARN; - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_Printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_ErrorPrintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - - va_list args; - LONG result; - BPTR fh; - - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail.*/ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STATIC STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - { - DECLARE_LOCALEBASE(cc); - - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - } - else - { - result = builtin_string; - } - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_SocketBaseTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = SocketBaseTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = SocketBaseTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} diff --git a/examples/RemoveNetInterface_rev.h b/examples/RemoveNetInterface_rev.h deleted file mode 100644 index de649c8..0000000 --- a/examples/RemoveNetInterface_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 3 -#define DATE "11.3.2009" -#define VERS "RemoveNetInterface 4.3" -#define VSTRING "RemoveNetInterface 4.3 (11.3.2009)\r\n" -#define VERSTAG "\0$VER: RemoveNetInterface 4.3 (11.3.2009)" diff --git a/examples/RoadshowControl.c b/examples/RoadshowControl.c deleted file mode 100644 index 2fd6968..0000000 --- a/examples/RoadshowControl.c +++ /dev/null @@ -1,1218 +0,0 @@ -/* - * RoadshowControl.c - * - * :ts=4 - * - * Copyright © 2001-2017 by Olaf Barthel. All Rights Reserved. - */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include -#include -#include - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -#include "RoadshowControl_rev.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_UtilityBase; - struct Library * cc_SocketBase; - struct Library * cc_LocaleBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct UtilityIFace * cc_IUtility; - struct SocketIFace * cc_ISocket; - struct LocaleIFace * cc_ILocale; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - UBYTE cc_ProgramName[256]; -}; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct UtilityIFace * IUtility = cc->cc_IUtility; \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct SocketIFace * ISocket = cc->cc_ISocket; \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -STATIC LONG cmd(struct CommandContext *cc); -STATIC BOOL is_blank_space(UBYTE c); -STATIC BOOL save_settings(struct CommandContext *cc, BOOL quiet, STRPTR name, LONG value); -STATIC VOID get_errno_and_code(struct CommandContext *cc, LONG *errno_ptr, STRPTR *code_ptr); -STATIC LONG VARARGS68K Local_Printf(struct CommandContext *cc, STRPTR format, ...); -STATIC LONG VARARGS68K Local_ErrorPrintf(struct CommandContext *cc, STRPTR format, ...); -STATIC VARARGS68K VOID lsprintf(struct CommandContext *cc, STRPTR buffer, STRPTR formatString, ...); -STATIC BOOL create_path(struct CommandContext *cc, CONST_STRPTR name); -STATIC STRPTR get_builtin_str(LONG id); -STATIC STRPTR get_str(struct CommandContext *cc, LONG id); -STATIC LONG VARARGS68K Local_SocketBaseTags(struct CommandContext *cc, ...); - -/****************************************************************************/ - -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - struct Message * mn; - - WaitPort(mp); - mn = GetMsg(mp); - - Forbid(); - ReplyMsg(mn); - goto out; - } - - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - - if(cc->cc_LocaleBase != NULL) - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - - result = cmd(cc); - - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - out: - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - - if(cc->cc_ISocket != NULL) - DropInterface((struct Interface *)cc->cc_ISocket); - - if(cc->cc_IUtility != NULL) - DropInterface((struct Interface *)cc->cc_IUtility); - } - #endif /* __amigaos4__ */ - - if(cc->cc_UtilityBase != NULL) - CloseLibrary(cc->cc_UtilityBase); - - if(cc->cc_SocketBase != NULL) - CloseLibrary(cc->cc_SocketBase); - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - cc->cc_UtilityBase = OpenLibrary("utility.library",37); - - #if defined(__amigaos4__) - { - if(cc->cc_UtilityBase != NULL) - { - cc->cc_IUtility = (struct UtilityIFace *)GetInterface(cc->cc_UtilityBase, "main", 1, 0); - if(cc->cc_IUtility == NULL) - { - CloseLibrary(cc->cc_UtilityBase); - cc->cc_UtilityBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - cc->cc_SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(cc->cc_SocketBase != NULL) - { - cc->cc_ISocket = (struct SocketIFace *)GetInterface(cc->cc_SocketBase, "main", 1, 0); - if(cc->cc_ISocket == NULL) - { - CloseLibrary(cc->cc_SocketBase); - cc->cc_SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define ROADSHOWCONTROL_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -/****** ROADSHOW/ROADSHOWCONTROL *********************************************** -* -* NAME -* RoadshowControl - Display and change internal configuration options -* -* FORMAT -* RoadshowControl [SAVE] [QUIET] [GET option] [SET option=value] -* -* TEMPLATE -* SAVE/S,QUIET/S,GET/K,SET/K/F -* -* FUNCTION -* Several internal configuration options which determine the behaviour -* of the TCP/IP stack can be changed at run time. This command will -* display/query option values and can be used to change them, too. -* -* OPTIONS -* GET/K -* Determine if a named option is supported and print its current -* value. If the option does not exist, the command will print -* an error message and return with a warning. You can test for -* the warning with the "IF" shell command. -* -* SET/K -* Change the value of an option. -* -* SAVE/S -* When combined with the SET option, also save these settings -* permanently so that they will be used the next time you start -* the TCP/IP stack. -* -* QUIET/S -* If this option is in effect, neither the SET nor the GET options -* will print the current value of an option. -* -* If you do no specify and option, all known options and their values -* will be printed. -* -* EXAMPLES -* Check if the udp.cksum option exists: -* -* 1> RoadshowControl get udp.cksum -* udp.cksum = 1 -* -* Check if the bpf.bufsize option exists: -* 1> RoadshowControl get bpf.bufsize -* bpf.bufsize: Object not found -* -* Change the tcp.use_mssdflt_for_remote option: -* 1> RoadshowControl set tcp.use_mssdflt_for_remote = 1 -* tcp.use_mssdflt_for_remote = 1 -* -* NOTES -* You really should know what you are doing when you are changing -* internal configuration options to values which are not the default -* settings. The wrong choices may render the TCP/IP inoperable! -* -* OPTIONS -* Here is a brief list of options that may be supported by your -* Roadshow installation. -* -* bpf.bufsize -* The size of the Berkeley Packet Filter buffer. -* -* icmp.maskrepl -* Controls if the ICMP layer responds to mask requests. -* This can be 1 (accept) or 0 (ignore). -* -* icmp.processecho -* Controls if the ICMP layer responds to echo requests. -* This can be 0 (accept), 1 (ignore) or 2 (drop). -* -* icmp.procesststamp -* Controls if the ICMP layer responds to time stamp requests. -* This can be 0 (accept), 1 (ignore) or 2 (drop). -* -* if.receive.useclusters -* Data received from a network interface is normally stored -* in a chunk of memory of 2048 bytes in size, which is called -* a cluster. This use of memory can be wasteful, but choosing -* to use less memory may slightly impair performance because -* the inbound data will need to be copied again. -* This option can be 1 (use clusters; this is the default) -* or 0 to use less memory at the expense of performance. -* -* if.minclustersize -* Whether data received or to be transmitted is stored in -* a single 2048 byte chunk of data or in smaller portions is -* controlled by this threshold value. Smaller threshold values -* will cause more memory to be used, larger threshold values -* may use less memory at the expense of slight performance -* impairment. The default value is 208 bytes. -* -* ip.defttl -* Controls the default time-to-live value of IP packets -* generated. -* -* ip.forwarding -* Controls if IP packets may be forwarded or not. -* This can be 1 (forward) or 0 (drop). -* -* ip.sendredirects -* Controls if ICMP redirect messages may be generated. -* This can be 1 (yes) or 0 (no). -* -* ip.subnetsarelocal -* Controls if the Internet addresses of directly -* connected hosts should be considered local, or if -* this also applies to hosts on the same subnet. -* This can be 1 (subnets are local) or 0 (they are not). -* -* task.controller.priority -* Selects the priority at which the network I/O -* controller Task runs. The priority can affect overall -* network performance. -* This must be in the range -128..127. Default is 0. -* -* tcp.do_rfc1323 -* Controls whether or not the TCP extensions for high -* performance (RFC1323) should be enabled or not. -* Specifically, this covers round trip time measurement -* and the TCP window scale option. -* This can be 1 (enable) or 0 (disable). -* -* tcp.do_timestamps -* Controls whether or not the round trip time measurement -* feature should be enabled if the tcp.do_rfc1323 option -* is enabled. -* This can be 1 (enable) or 0 (disable). -* -* tcp.do_win_scale -* Controls whether or not the TCP window scale option -* should be enabled if the tcp.do_rfc1323 option -* is enabled. -* This can be 1 (enable) or 0 (disable). -* -* tcp.mssdflt -* Controls the default TCP maximum segment size value. -* -* tcp.recvspace -* Controls the size of the default TCP receive buffer. -* -* tcp.rttdflt -* Controls the default TCP retransmit time value. -* -* tcp.sendspace -* Controls the size of the default TCP transmit buffer. -* -* tcp.use_mssdflt_for_remote -* Controls if the TCP protocol should use a smaller -* maximum segment size value for packets sent to -* hosts which are not in the local network. -* This can be 1 (yes) or 0 (no). -* -* udp.cksum -* Controls if checksums should be calculated over -* UDP datagrams to be sent and verified for UDP -* datagrams received. -* This can be 1 (yes) or 0 (no). -* -* udp.recvspace -* Controls the size of the default UDP receive buffer. -* -* udp.sendspace -* Controls the size of the default UDP transmit buffer. -* -* ENVIRONMENT VARIABLES -* It is not necessary to change the TCP/IP stack options every time you -* start it. You can also set up global environment variables with the -* SetEnv command which the TCP/IP stack will check when it is started. -* -* The environment variable names correspond to the options listed above. -* For example, Roadshow/tcp/do_win_scale corresponds to the -* tcp.do_win_scale option, Roadshow/ip/forwarding corresponds to the -* ip.forwarding option, etc. -* -* To change an environment variable, you would enter the following -* in the shell: -* -* SetEnv SAVE Roadshow/ip/forwarding 1 -* -* Note that your shell may not support the SAVE switch, or might have -* problems with environment variable names longer than 31 letters. In -* such a case you would have to get by with the MakeDir, Echo and -* Copy commands, like this: -* -* MakeDir ENV:Roadshow -* MakeDir ENV:Roadshow/ip -* Echo >ENV:Roadshow/ip/forwarding 1 -* Copy ENV:Roadshow ENVARC:Roadshow ALL QUIET -* -* To remove all the variables set by RoadshowControl, so that they are -* no longer active immediately when Roadshow starts up, delete the -* ENVARC:Roadshow folder, like this: -* -* Delete ALL QUIET ENVARC:Roadshow -* -* After the folder has been deleted you might want to restart your -* computer. -* -****************************************************************************** -*/ - -STATIC LONG -cmd(struct CommandContext * cc) -{ - struct - { - SWITCH Save; - SWITCH Quiet; - KEY Get; - KEY Set; - } args; - - STRPTR args_template = - "SAVE/S," - "QUIET/S," - "GET/K," - "SET/K/F" - VERSTAG; - - DECLARE_DOSBASE(cc); - DECLARE_UTILITYBASE(cc); - DECLARE_SOCKETBASE(cc); - - LONG result = RETURN_FAIL; - struct RDArgs * rda; - ULONG have_api = 0; - struct List * list = NULL; - struct RoadshowDataNode * rdn; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),cc->cc_ProgramName); - goto out; - } - - if(UtilityBase == NULL) - { - if(NOT args.Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ROADSHOWCONTROL_NO_UTILITY_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(SocketBase == NULL) - { - if(NOT args.Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ROADSHOWCONTROL_CANNOT_OPEN_BSDSOCKET_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_ROADSHOWDATA_API),&have_api, - TAG_END) != 0 || have_api == 0) - { - if(NOT args.Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_ROADSHOWCONTROL_BSDSOCKET_HAS_NO_ROADSHOWDATA_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(args.Set) - { - size_t len,i; - STRPTR key,value; - LONG number; - - list = ObtainRoadshowData(ORD_WriteAccess); - if(list == NULL) - { - if(NOT args.Quiet) - { - STRPTR error_message; - LONG errno; - - get_errno_and_code(cc,&errno,&error_message); - - Local_ErrorPrintf(cc,get_str(cc,MSG_ROADSHOWCONTROL_NO_ROADSHOW_DATA_TXT), - cc->cc_ProgramName, errno, error_message); - } - - goto out; - } - - key = args.Set; - while(is_blank_space(*key)) - key++; - - value = NULL; - - len = strlen(key); - - for(i = 0 ; i < len ; i++) - { - if(is_blank_space(key[i]) || key[i] == '=') - { - if(value == NULL) - { - value = &key[i+1]; - key[i] = '\0'; - break; - } - } - } - - if(value != NULL) - { - while(is_blank_space(*value) || (*value) == '=') - value++; - } - - if((*key) == '\0' || value == NULL || (*value) == '\0') - { - if(NOT args.Quiet) - PrintFault(ERROR_REQUIRED_ARG_MISSING,cc->cc_ProgramName); - - goto out; - } - - if(StrToLong(value,&number) < 1) - { - if(NOT args.Quiet) - PrintFault(ERROR_BAD_NUMBER,value); - - goto out; - } - - if(CANNOT ChangeRoadshowData(list,key,sizeof(number),&number)) - { - if(NOT args.Quiet) - { - STRPTR error_message; - LONG errno; - - get_errno_and_code(cc,&errno,&error_message); - - Local_ErrorPrintf(cc,get_str(cc,MSG_ROADSHOWCONTROL_COULD_NOT_SET_OPTION_TXT), - cc->cc_ProgramName, key, number, errno, error_message); - } - - goto out; - } - - if(args.Save) - { - if(CANNOT save_settings(cc,args.Quiet,key,number)) - goto out; - } - - if(NOT args.Quiet) - { - struct RoadshowDataNode * found = NULL; - - for(rdn = (struct RoadshowDataNode *)list->lh_Head ; - rdn->rdn_MinNode.mln_Succ != NULL ; - rdn = (struct RoadshowDataNode *)rdn->rdn_MinNode.mln_Succ) - { - if(Stricmp(rdn->rdn_Name,key) == SAME) - { - found = rdn; - break; - } - } - - if(found != NULL && found->rdn_Type == RDNT_Integer) - Local_Printf(cc,"%s = %ld\n",found->rdn_Name,*(int *)found->rdn_Data); - } - } - else - { - list = ObtainRoadshowData(ORD_ReadAccess); - if(list == NULL) - { - if(NOT args.Quiet) - { - STRPTR error_message; - LONG errno; - - get_errno_and_code(cc,&errno,&error_message); - - Local_ErrorPrintf(cc,get_str(cc,MSG_ROADSHOWCONTROL_NO_ROADSHOW_DATA_TXT), - cc->cc_ProgramName, errno, error_message); - } - - goto out; - } - - if(args.Get) - { - struct RoadshowDataNode * found = NULL; - - for(rdn = (struct RoadshowDataNode *)list->lh_Head ; - rdn->rdn_MinNode.mln_Succ != NULL ; - rdn = (struct RoadshowDataNode *)rdn->rdn_MinNode.mln_Succ) - { - if(Stricmp(rdn->rdn_Name,args.Get) == SAME) - { - found = rdn; - break; - } - } - - if(found == NULL || found->rdn_Type != RDNT_Integer) - { - if(NOT args.Quiet) - PrintFault(ERROR_OBJECT_NOT_FOUND,args.Get); - - result = RETURN_WARN; - goto out; - } - - if(NOT args.Quiet) - Local_Printf(cc,"%s = %ld\n",found->rdn_Name,*(int *)found->rdn_Data); - } - else - { - for(rdn = (struct RoadshowDataNode *)list->lh_Head ; - rdn->rdn_MinNode.mln_Succ != NULL ; - rdn = (struct RoadshowDataNode *)rdn->rdn_MinNode.mln_Succ) - { - if(CheckSignal(SIGBREAKF_CTRL_C)) - { - PrintFault(ERROR_BREAK,cc->cc_ProgramName); - - result = RETURN_WARN; - goto out; - } - - if(rdn->rdn_Type != RDNT_Integer) - continue; - - Local_Printf(cc,"%s = %ld\n",rdn->rdn_Name,*(int *)rdn->rdn_Data); - } - } - } - - result = RETURN_OK; - - out: - - if(list != NULL) - ReleaseRoadshowData(list); - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -/****************************************************************************/ - -STATIC BOOL -is_blank_space(UBYTE c) -{ - BOOL result; - - result = (BOOL)(c == ' ' || c == '\t' || c == (UBYTE)'\240'); - - return(result); -} - -/****************************************************************************/ - -STATIC BOOL -save_settings(struct CommandContext * cc,BOOL quiet,STRPTR name,LONG value) -{ - DECLARE_DOSBASE(cc); - - BOOL success = FALSE; - TEXT variable_name[512]; - TEXT value_str[30]; - BPTR file = ZERO; - size_t i; - - strcpy(variable_name,"ENVARC:Roadshow/"); - strcat(variable_name,name); - - for(i = 0 ; i < strlen(variable_name) ; i++) - { - if(variable_name[i] == '.') - variable_name[i] = '/'; - } - - lsprintf(cc,(STRPTR)value_str,"%ld\n",value); - - if(CANNOT SetVar(&variable_name[7],value_str,-1,GVF_GLOBAL_ONLY)) - { - if(NOT quiet) - { - TEXT error_string[100]; - - Fault(IoErr(),NULL,error_string,sizeof(error_string)); - - Local_ErrorPrintf(cc,get_str(cc,MSG_ROADSHOWCONTROL_COULD_NOT_SET_ENV_VARIABLE_TXT), - cc->cc_ProgramName, &variable_name[7], IoErr(), error_string); - } - - goto out; - } - - if(CANNOT create_path(cc,variable_name) || - (file = Open(variable_name,MODE_NEWFILE)) == ZERO || - Write(file,value_str,strlen(value_str)) == -1) - { - if(NOT quiet) - { - TEXT error_string[100]; - - Fault(IoErr(),NULL,error_string,sizeof(error_string)); - - Local_ErrorPrintf(cc,get_str(cc,MSG_ROADSHOWCONTROL_COULD_NOT_SET_ENV_VARIABLE_TXT), - cc->cc_ProgramName, variable_name, IoErr(), error_string); - } - - goto out; - } - - success = TRUE; - - out: - - if(file != ZERO) - Close(file); - - return(success); -} - -/****************************************************************************/ - -STATIC VOID -get_errno_and_code(struct CommandContext * cc,LONG * errno_ptr,STRPTR * code_ptr) -{ - LONG errno = 0; - LONG code; - - Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNO),&errno, - TAG_END); - - code = errno; - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_ERRNOSTRPTR),&code, - TAG_END) != 0) - { - code = 0; - } - - (*errno_ptr) = errno; - (*code_ptr) = (STRPTR)code; -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_Printf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VPrintf(format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_ErrorPrintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - - va_list args; - LONG result; - BPTR fh; - - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -STATIC VARARGS68K VOID -lsprintf(struct CommandContext * cc,STRPTR buffer,STRPTR formatString,...) -{ - DECLARE_SYSBASE(cc); - - va_list varArgs; - - #if defined(__amigaos4__) - { - va_startlinear(varArgs,formatString); - RawDoFmt(formatString,va_getlinearva(varArgs,APTR),NULL,buffer); - va_end(varArgs); - } - #else - { - va_start(varArgs,formatString); - RawDoFmt(formatString,varArgs,(VOID (*)())"\x16\xC0\x4E\x75",buffer); - va_end(varArgs); - } - #endif /* __amigaos4__ */ -} - -/****************************************************************************/ - -STATIC BOOL -create_path(struct CommandContext * cc,CONST_STRPTR name) -{ - DECLARE_SYSBASE(cc); - DECLARE_DOSBASE(cc); - - STRPTR name_copy = NULL; - BPTR lock = ZERO; - BOOL result = FALSE; - - /* Don't try to do anything if the name is just a name and does not - include any path component. */ - if(FilePart((STRPTR)name) != (STRPTR)name) - { - size_t len,i; - STRPTR tail; - - len = strlen(name); - - name_copy = AllocVec((ULONG)len+1,MEMF_ANY|MEMF_PUBLIC); - if(name_copy == NULL) - goto out; - - memcpy(name_copy,name,len+1); - - /* Isolate the path name component. */ - tail = PathPart(name_copy); - (*tail) = '\0'; - - /* Now figure out if there is any path to be created. */ - len = strlen(name_copy); - if(len == 0 || name_copy[len-1] == ':') - { - result = TRUE; - goto out; - } - - /* Now rattle down the path, checking if all the components are - present. If one is missing, create it and move on. */ - for(i = 0 ; i <= len ; i++) - { - if(name_copy[i] == '/' || name_copy[i] == '\0') - { - TEXT c; - - /* Cut off anything to follow this part of the - directory path. */ - c = name_copy[i]; - name_copy[i] = '\0'; - - /* Does the path exist? */ - lock = Lock(name_copy,SHARED_LOCK); - if(lock == ZERO) - { - /* It doesn't. But is this because a directory is missing? */ - if(IoErr() != ERROR_OBJECT_NOT_FOUND) - goto out; - - /* Try to create the missing path part. */ - lock = CreateDir(name_copy); - if(lock == ZERO) - goto out; - } - - name_copy[i] = c; - - UnLock(lock); - lock = ZERO; - } - } - } - - result = TRUE; - - out: - - UnLock(lock); - - FreeVec(name_copy); - - return(result); -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail. */ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STATIC STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - { - DECLARE_LOCALEBASE(cc); - - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - } - else - { - result = builtin_string; - } - - return(result); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_SocketBaseTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = SocketBaseTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = SocketBaseTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} diff --git a/examples/RoadshowControl_rev.h b/examples/RoadshowControl_rev.h deleted file mode 100644 index 537e205..0000000 --- a/examples/RoadshowControl_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 9 -#define DATE "23.4.2017" -#define VERS "RoadshowControl 4.9" -#define VSTRING "RoadshowControl 4.9 (23.4.2017)\r\n" -#define VERSTAG "\0$VER: RoadshowControl 4.9 (23.4.2017)" diff --git a/examples/SampleNetSpeed.c b/examples/SampleNetSpeed.c deleted file mode 100644 index c2a888c..0000000 --- a/examples/SampleNetSpeed.c +++ /dev/null @@ -1,1125 +0,0 @@ -/* - * $Id: SampleNetSpeed.c,v 1.13 2007-08-26 12:30:16 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -/****************************************************************************/ - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -#include -#include - -#include - -/*****************************************************************************/ - -#undef __NOGLOBALIFACE__ -#define __USE_INLINE__ -#define __NOLIBBASE__ - -/*****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -/*****************************************************************************/ - -#include -#include -#include - -/****************************************************************************/ - -/* A quick workaround for the timeval/timerequest->TimeVal/TimeRequest - change in the recent OS4 header files. */ - -#if defined(__NEW_TIMEVAL_DEFINITION_USED__) - -#define timeval TimeVal -#define tv_secs Seconds -#define tv_micro Microseconds - -#define timerequest TimeRequest -#define tr_node Request -#define tr_time Time - -#endif /* __NEW_TIMEVAL_DEFINITION_USED__ */ - -/****************************************************************************/ - -#include "SampleNetSpeed_rev.h" -STRPTR Version = VERSTAG; - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -/*#define DEBUG*/ -#include "assert.h" - -/****************************************************************************/ - -#define PORT_SIG_MASK(mp) (1UL << (mp)->mp_SigBit) - -/****************************************************************************/ - -extern struct Library * SysBase; -extern struct Library * DOSBase; - -/****************************************************************************/ - -struct Library * IntuitionBase; -struct Library * GfxBase; -struct Library * SocketBase; -struct Device * TimerBase; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -struct IntuitionIFace * IIntuition; -struct GraphicsIFace * IGraphics; -struct SocketIFace * ISocket; -struct TimerIFace * ITimer; - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -struct MsgPort * TimePort; -struct timerequest * TimeRequest; - -/****************************************************************************/ - -UBYTE Title[100]; -struct Window * Window; -struct DrawInfo * DrawInfo; -struct TextFont * Font; - -/****************************************************************************/ - -UBYTE InterfaceName[20]; -struct timeval LastSampleTime; -SBQUAD_T LastSampleIn; -SBQUAD_T LastSampleOut; - -/****************************************************************************/ - -ULONG MaxSent; -ULONG MaxSentReceived; -ULONG MaxReceived; -ULONG LastSent; -ULONG LastReceived; -ULONG TotalReceived; -ULONG TotalSent; -ULONG TotalCounted; - -/****************************************************************************/ - -ULONG * HistoryReceived; -ULONG * HistorySent; -LONG HistorySize; - -/****************************************************************************/ - -VOID local_sprintf(STRPTR buffer, STRPTR formatString, ...); -VOID cleanup(void); -BOOL setup(void); -void print_stats(void); -void clear_display(void); -void redraw_display(void); -void update_display(BOOL can_draw); - -/****************************************************************************/ - -#if defined(__GNUC__) && !defined(__amigaos4__) - -#undef Printf - -LONG -Printf(STRPTR format,...) -{ - va_list arg; - LONG result; - - va_start(arg,format); - result = VPrintf(format,arg); - va_end(arg); - - return(result); -} - -#endif /* __GNUC__ && !__amigaos4__ */ - -/****************************************************************************/ - -VOID VARARGS68K -local_sprintf(STRPTR buffer, STRPTR formatString, ...) -{ - va_list varArgs; - - #if defined(__amigaos4__) - { - va_startlinear(varArgs,formatString); - RawDoFmt(formatString,va_getlinearva(varArgs,APTR),(VOID (*)())NULL,buffer); - va_end(varArgs); - } - #else - { - va_start(varArgs,formatString); - RawDoFmt(formatString,varArgs,(VOID (*)())"\x16\xC0\x4E\x75",buffer); - va_end(varArgs); - } - #endif /* __amigaos4__ */ -} - -/****************************************************************************/ - -VOID -cleanup(void) -{ - if(HistoryReceived != NULL) - { - FreeVec(HistoryReceived); - HistoryReceived = NULL; - } - - if(DrawInfo != NULL) - { - FreeScreenDrawInfo(Window->WScreen,DrawInfo); - DrawInfo = NULL; - } - - if(Window != NULL) - { - CloseWindow(Window); - Window = NULL; - } - - #if defined(__amigaos4__) - { - DropInterface((struct Interface *)ITimer); - } - #endif /* __amigaos4__ */ - - if(TimeRequest != NULL) - { - if(TimeRequest->tr_node.io_Device != NULL) - CloseDevice((struct IORequest *)TimeRequest); - - DeleteIORequest((struct IORequest *)TimeRequest); - TimeRequest = NULL; - } - - if(TimePort != NULL) - { - DeleteMsgPort(TimePort); - TimePort = NULL; - } - - if(Font != NULL) - { - CloseFont(Font); - Font = NULL; - } - - #if defined(__amigaos4__) - { - DropInterface((struct Interface *)ISocket); - DropInterface((struct Interface *)IGraphics); - DropInterface((struct Interface *)IIntuition); - } - #endif /* __amigaos4__ */ - - if(SocketBase != NULL) - { - CloseLibrary(SocketBase); - SocketBase = NULL; - } - - if(GfxBase != NULL) - { - CloseLibrary(GfxBase); - GfxBase = NULL; - } - - if(IntuitionBase != NULL) - { - CloseLibrary(IntuitionBase); - IntuitionBase = NULL; - } -} - -/****************************************************************************/ - -BOOL -setup(void) -{ - STATIC struct TextAttr topaz = - { - "topaz.font", - 8, - FS_NORMAL, - FPF_ROMFONT|FPF_DESIGNED - }; - - struct - { - STRPTR Interface; - LONG * Left; - LONG * Top; - LONG * Width; - LONG * Height; - STRPTR Screen; - } args; - - struct RDArgs * rda = NULL; - BOOL success = FALSE; - LONG left,top,width,height; - - if(SysBase->lib_Version < 36) - goto out; - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(SocketBase != NULL) - { - ISocket = (struct SocketIFace *)GetInterface(SocketBase, "main", 1, 0); - if(ISocket == NULL) - { - CloseLibrary(SocketBase); - SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(SocketBase == NULL) - { - Printf("Could not open 'bsdsocket.library' V4.\n"); - goto out; - } - - IntuitionBase = OpenLibrary("intuition.library",37); - - #if defined(__amigaos4__) - { - if(IntuitionBase != NULL) - { - IIntuition = (struct IntuitionIFace *)GetInterface(IntuitionBase, "main", 1, 0); - if(IIntuition == NULL) - { - CloseLibrary(IntuitionBase); - IntuitionBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(IntuitionBase == NULL) - { - Printf("Could not open 'intuition.library' V37.\n"); - goto out; - } - - GfxBase = OpenLibrary("graphics.library",37); - - #if defined(__amigaos4__) - { - if(GfxBase != NULL) - { - IGraphics = (struct GraphicsIFace *)GetInterface(GfxBase, "main", 1, 0); - if(IGraphics == NULL) - { - CloseLibrary(GfxBase); - GfxBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(GfxBase == NULL) - { - Printf("Could not open 'graphics.library' V37.\n"); - goto out; - } - - TimePort = CreateMsgPort(); - if(TimePort == NULL) - { - Printf("Could not create timer message port.\n"); - goto out; - } - - TimeRequest = (struct timerequest *)CreateIORequest(TimePort,sizeof(*TimeRequest)); - if(TimeRequest == NULL) - { - Printf("Could not create timer I/O request.\n"); - goto out; - } - - if(OpenDevice(TIMERNAME,UNIT_VBLANK,(struct IORequest *)TimeRequest,0) != OK) - { - Printf("Could not open 'timer.device'.\n"); - goto out; - } - - TimerBase = TimeRequest->tr_node.io_Device; - - #if defined(__amigaos4__) - { - ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase, "main", 1, 0); - if(ITimer == NULL) - { - Printf("Could not access 'timer.device' interface.\n"); - goto out; - } - } - #endif /* __amigaos4__ */ - - memset(&args,0,sizeof(args)); - - rda = ReadArgs("INTERFACE,LEFT/N,TOP/N,WIDTH/N,HEIGHT/N,SCREEN/K",(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),"Sample"); - goto out; - } - - if(args.Interface != NULL) - { - LONG len; - - len = strlen(args.Interface); - if(len > sizeof(InterfaceName)-1) - len = sizeof(InterfaceName)-1; - - memcpy(InterfaceName,args.Interface,len); - InterfaceName[len] = '\0'; - } - - if(args.Left != NULL) - left = (*args.Left); - else - left = -1; - - if(args.Top != NULL) - top = (*args.Top); - else - top = -1; - - if(args.Width != NULL) - width = (*args.Width); - else - width = 300; - - if(args.Height != NULL) - height = (*args.Height); - else - height = 50; - - if(width < 30) - width = 30; - - if(height < 40) - height = 40; - - GetSysTime(&LastSampleTime); - - if(InterfaceName[0] != '\0') - { - local_sprintf(Title,"%s I/O performance",InterfaceName); - - if(QueryInterfaceTags(InterfaceName, - IFQ_GetBytesIn, &LastSampleIn, - IFQ_GetBytesOut, &LastSampleOut, - TAG_END) != 0) - { - Printf("Could not query data throughput statistics for interface '%s'.\n",InterfaceName); - goto out; - } - } - else - { - strcpy(Title,"TCP/IP I/O performance"); - - if(SocketBaseTags( - SBTM_GETREF(SBTC_GET_BYTES_RECEIVED), &LastSampleIn, - SBTM_GETREF(SBTC_GET_BYTES_SENT), &LastSampleOut, - TAG_END) != 0) - { - Printf("Could not query data throughput statistics.\n"); - goto out; - } - } - - Font = OpenFont(&topaz); - if(Font == NULL) - { - Printf("Could not open default font topaz/8.\n"); - goto out; - } - - Window = OpenWindowTags(NULL, - WA_Title, Title, - WA_SizeGadget, TRUE, - WA_DragBar, TRUE, - WA_DepthGadget, TRUE, - WA_CloseGadget, TRUE, - WA_NoCareRefresh, TRUE, - WA_RMBTrap, TRUE, - WA_SmartRefresh, TRUE, - WA_SizeBRight, TRUE, - (left >= 0) ? WA_Left : TAG_IGNORE,left, - (top >= 0) ? WA_Top : TAG_IGNORE,top, - WA_InnerWidth, width, - WA_InnerHeight, height, - WA_IDCMP, IDCMP_CLOSEWINDOW | IDCMP_NEWSIZE | IDCMP_VANILLAKEY, - (args.Screen != NULL) ? WA_PubScreenName : TAG_IGNORE, args.Screen, - TAG_END); - if(Window == NULL) - { - Printf("Could not open window.\n"); - goto out; - } - - HistorySize = Window->WScreen->Width; - - HistoryReceived = AllocVec(HistorySize * 2 * sizeof(ULONG),MEMF_ANY|MEMF_CLEAR); - if(HistoryReceived) - HistorySent = HistoryReceived + HistorySize; - else - HistorySize = 0; - - WindowLimits(Window, - Window->BorderLeft + 10 + Window->BorderRight, - Window->BorderTop + 20 + Font->tf_YSize+1 + Window->BorderBottom, - Window->WScreen->Width, - Window->WScreen->Height); - - DrawInfo = GetScreenDrawInfo(Window->WScreen); - if(DrawInfo == NULL) - { - Printf("Could not get screen drawing information.\n"); - goto out; - } - - SetBPen(Window->RPort,DrawInfo->dri_Pens[BACKGROUNDPEN]); - SetDrMd(Window->RPort,JAM2); - - SetFont(Window->RPort,Font); - - clear_display(); - - success = TRUE; - - out: - - if(rda != NULL) - FreeArgs(rda); - - if(NO success) - cleanup(); - - return(success); -} - -/****************************************************************************/ - -void -print_stats(void) -{ - struct RastPort * rp = Window->RPort; - UBYTE buffer[300]; - ULONG avg_sent; - ULONG avg_received; - struct TextExtent te; - LONG width; - LONG len; - - if(TotalCounted > 0) - { - avg_sent = TotalSent / TotalCounted; - avg_received = TotalReceived / TotalCounted; - } - else - { - avg_sent = 0; - avg_received = 0; - } - - local_sprintf(buffer,"max %lD/%lD avg %lD/%lD last %lD/%lD", - MaxReceived,MaxSent, - avg_received,avg_sent, - LastReceived,LastSent); - - width = Window->Width - (Window->BorderLeft + Window->BorderRight); - - len = TextFit(rp,buffer,strlen(buffer),&te,NULL,1,width,32767); - - if(len > 0) - { - SetAPen(rp,DrawInfo->dri_Pens[TEXTPEN]); - - Move(rp,Window->BorderLeft,Window->Height - (Window->BorderBottom + Font->tf_YSize - Font->tf_Baseline)); - Text(rp,buffer,len); - - SetAPen(rp,DrawInfo->dri_Pens[BACKGROUNDPEN]); - - RectFill(rp, - Window->BorderLeft,Window->Height - (Window->BorderBottom + Font->tf_YSize + 1), - Window->Width - (Window->BorderRight + 1),Window->Height - (Window->BorderBottom + Font->tf_YSize + 1)); - } - - if(te.te_Width < width) - { - SetAPen(rp,DrawInfo->dri_Pens[BACKGROUNDPEN]); - - RectFill(rp, - Window->BorderLeft + te.te_Width,Window->Height - (Window->BorderBottom + Font->tf_YSize), - Window->Width - (Window->BorderRight + 1),Window->Height - (Window->BorderBottom + 1)); - } -} - -/****************************************************************************/ - -void -clear_display(void) -{ - struct RastPort * rp = Window->RPort; - LONG height; - LONG top; - - SetAPen(rp,DrawInfo->dri_Pens[BACKGROUNDPEN]); - RectFill(rp, - Window->BorderLeft, - Window->BorderTop, - Window->Width - (Window->BorderRight+1), - Window->Height - (Window->BorderBottom+1)); - - height = Window->Height - (Window->BorderTop + Window->BorderBottom + (Font->tf_YSize+1)); - top = height - ((height / 2) + 1); - - SetAPen(rp,DrawInfo->dri_Pens[SHADOWPEN]); - RectFill(rp, - Window->BorderLeft,Window->BorderTop + top, - Window->Width - (Window->BorderRight + 1),Window->BorderTop + top); - - print_stats(); -} - -/****************************************************************************/ - -void -redraw_display(void) -{ - struct RastPort * rp = Window->RPort; - LONG width,height; - LONG mid; - LONG top; - LONG bottom; - LONG i; - - SetAPen(rp,DrawInfo->dri_Pens[BACKGROUNDPEN]); - RectFill(rp, - Window->BorderLeft, - Window->BorderTop, - Window->Width - (Window->BorderRight+1), - Window->Height - (Window->BorderBottom+1)); - - height = Window->Height - (Window->BorderTop + Window->BorderBottom + (Font->tf_YSize+1)); - width = Window->Width - (Window->BorderLeft + Window->BorderRight); - - mid = height / 2; - - top = height - (mid + 1); - bottom = height - (top + 1); - - for(i = 0 ; i < width ; i++) - { - if(MaxSentReceived > 0) - { - ULONG received = (HistoryReceived[HistorySize - width + i] * top) / MaxSentReceived; - ULONG sent = (HistorySent[HistorySize - width + i] * bottom) / MaxSentReceived; - - if(received > 0) - { - SetAPen(rp,DrawInfo->dri_Pens[SHINEPEN]); - RectFill(rp, - Window->BorderLeft+i,Window->BorderTop + top - received, - Window->BorderLeft+i,Window->BorderTop + top - 1); - } - - if(sent > 0) - { - SetAPen(rp,DrawInfo->dri_Pens[FILLPEN]); - RectFill(rp, - Window->BorderLeft+i,Window->BorderTop + top + 1, - Window->BorderLeft+i,Window->BorderTop + top + 1 + sent - 1); - } - } - } - - SetAPen(rp,DrawInfo->dri_Pens[SHADOWPEN]); - RectFill(rp, - Window->BorderLeft,Window->BorderTop + top, - Window->Width - (Window->BorderRight + 1),Window->BorderTop + top); - - print_stats(); -} - -/****************************************************************************/ - -ULONG -quad_delta(const SBQUAD_T * a,const SBQUAD_T * b) -{ - ULONG result = 0; - SBQUAD_T delta; - - delta = (*a); - - if(delta.sbq_Low < b->sbq_Low) - { - if(delta.sbq_High == 0) - goto out; - - delta.sbq_High--; - - delta.sbq_Low = (~0UL) - b->sbq_Low + 1 + a->sbq_Low; - } - else - { - delta.sbq_Low -= b->sbq_Low; - } - - if(delta.sbq_High < b->sbq_High) - goto out; - - /*delta.sbq_High -= b->sbq_High;*/ - - result = delta.sbq_Low; - - out: - - return(result); -} - -/****************************************************************************/ - -#define REDRAW_DISPLAY TRUE -#define PRETEND_TO_REDRAW_DISPLAY FALSE - -/****************************************************************************/ - -void -update_display(BOOL can_draw) -{ - STATIC BOOL catch_up; - struct RastPort * rp = Window->RPort; - struct timeval now; - SBQUAD_T sample_in; - SBQUAD_T sample_out; - struct timeval tv; - LONG height; - LONG mid; - LONG top; - LONG bottom; - ULONG sent; - ULONG received; - BOOL redraw; - - GetSysTime(&now); - - if(InterfaceName[0] != '\0') - { - if(QueryInterfaceTags(InterfaceName, - IFQ_GetBytesIn, &sample_in, - IFQ_GetBytesOut, &sample_out, - TAG_END) != 0) - { - memset(&sample_in,0,sizeof(sample_in)); - memset(&sample_out,0,sizeof(sample_out)); - } - } - else - { - if(SocketBaseTags( - SBTM_GETREF(SBTC_GET_BYTES_RECEIVED), &sample_in, - SBTM_GETREF(SBTC_GET_BYTES_SENT), &sample_out, - TAG_END) != 0) - { - memset(&sample_in,0,sizeof(sample_in)); - memset(&sample_out,0,sizeof(sample_out)); - } - } - - if(NOT can_draw) - catch_up = TRUE; - - height = Window->Height - (Window->BorderTop + Window->BorderBottom + (Font->tf_YSize+1)); - - mid = height / 2; - - top = height - (mid + 1); - bottom = height - (top + 1); - - tv = now; - SubTime(&tv,&LastSampleTime); - - received = quad_delta(&sample_in,&LastSampleIn); - sent = quad_delta(&sample_out,&LastSampleOut); - - LastSampleTime = now; - LastSampleIn = sample_in; - LastSampleOut = sample_out; - - if(tv.tv_secs > 0 || tv.tv_micro > 0) - { - double f; - - f = (double)tv.tv_secs + (double)tv.tv_micro / 1000000.0; - - sent = (ULONG)((double)sent / f); - received = (ULONG)((double)received / f); - } - else - { - sent = received = 0; - } - - if(HistorySize > 0) - { - memmove(HistoryReceived,HistoryReceived+1,sizeof(ULONG) * (HistorySize-1)); - memmove(HistorySent,HistorySent+1,sizeof(ULONG) * (HistorySize-1)); - - HistoryReceived[HistorySize-1] = received; - HistorySent[HistorySize-1] = sent; - } - - if(sent != 0) - LastSent = sent; - - if(received != 0) - LastReceived = received; - - TotalSent += sent; - TotalReceived += received; - TotalCounted += 1; - - redraw = FALSE; - - if(sent > MaxSent) - { - MaxSent = sent; - if(sent > MaxSentReceived) - MaxSentReceived = sent; - - redraw = TRUE; - } - - if(received > MaxReceived) - { - MaxReceived = received; - if(received > MaxSentReceived) - MaxSentReceived = received; - - redraw = TRUE; - } - - if(catch_up) - { - if(NOT redraw) - clear_display(); - - redraw = TRUE; - } - - if(can_draw) - { - if(redraw && HistorySize > 0) - { - redraw_display(); - } - else - { - SetBPen(rp,DrawInfo->dri_Pens[BACKGROUNDPEN]); - ScrollRaster(rp,1,0, - Window->BorderLeft, - Window->BorderTop, - Window->Width - (Window->BorderRight+1), - Window->Height - (Window->BorderBottom+1+Font->tf_YSize+1)); - - SetAPen(rp,DrawInfo->dri_Pens[SHADOWPEN]); - WritePixel(rp,Window->Width - (Window->BorderRight+1),Window->BorderTop + top); - - if(MaxSentReceived > 0) - { - received = (received * top) / MaxSentReceived; - sent = (sent * bottom) / MaxSentReceived; - } - else - { - received = 0; - sent = 0; - } - - if(received > 0) - { - SetAPen(rp,DrawInfo->dri_Pens[SHINEPEN]); - RectFill(rp, - Window->Width - (Window->BorderRight+1),Window->BorderTop + top - received, - Window->Width - (Window->BorderRight+1),Window->BorderTop + top - 1); - } - - if(sent > 0) - { - SetAPen(rp,DrawInfo->dri_Pens[FILLPEN]); - RectFill(rp, - Window->Width - (Window->BorderRight+1),Window->BorderTop + top + 1, - Window->Width - (Window->BorderRight+1),Window->BorderTop + top + 1 + sent - 1); - } - } - - print_stats(); - - catch_up = FALSE; - } -} - -/****************************************************************************/ - -/****** ROADSHOW/SAMPLENETSPEED ************************************************ -* -* NAME -* SampleNetSpeed - Display network I/O performance -* -* FORMAT -* SampleNetSpeed [[INTERFACE] ] [LEFT ] -* [TOP ] [WIDTH ] -* [HEIGHT ] [SCREEN ] -* -* TEMPLATE -* INTERFACE,LEFT/N,TOP/N,WIDTH/N,HEIGHT/N,SCREEN/K -* -* FUNCTION -* The command can be used to gather statistics on the performance of -* a specific network interface or all network interfaces used by the -* TCP/IP stack. Performance is measured as data throughput when sending -* or receiving data packets to/from the network. -* -* The performance data is sampled once every second and visualized in -* a window which is updated regularly. In the top half of the window -* the amount of data received is displayed, while the bottom half shows -* the amount of data sent. The sizes of the bars representing the -* performance are always using the same scale. At the bottom of the -* window three figures are printed (from left to right): maximum -* throughput, averaged throughput, last throughput. For each of these -* figures the values are displayed in the form "number of bytes -* received per second / number of bytes sent per second". -* -* OPTIONS -* INTERFACE -* The name of the interface whose performance should be sampled. -* If omitted, information on all networking interfaces will be -* gathered. -* -* LEFT -* TOP -* These parameters are optional; you can specify the position of -* the window to open. Default is to open it in the top left corner -* of the screen. -* -* WIDTH -* HEIGHT -* These parameters are optional; you can specify the size of the -* window to open. Default is to open a window that can display a -* 300 by 50 pixel area. Note that width and height actually refer -* to the size of the display area and not the total size of the -* window. -* -* SCREEN -* You can specify the name of a public screen to open the window -* on. If omitted, the window will open on the default public -* screen, which is usually the Workbench screen. -* -* NOTES -* To stop the command, either click on the window close gadget in the -* top left corner or send a break signal to it in the shell. -* -****************************************************************************** -*/ - -int -main(int argc,char **argv) -{ - if(setup()) - { - ULONG time_mask; - ULONG window_mask; - ULONG signal_mask; - ULONG signals; - BOOL done; - - time_mask = PORT_SIG_MASK(TimePort); - window_mask = PORT_SIG_MASK(Window->UserPort); - - signal_mask = SIGBREAKF_CTRL_C | time_mask | window_mask; - signals = 0; - - done = FALSE; - - TimeRequest->tr_node.io_Command = TR_ADDREQUEST; - TimeRequest->tr_time.tv_secs = 1; - TimeRequest->tr_time.tv_micro = 0; - SendIO((struct IORequest *)TimeRequest); - - do - { - if(signals == 0) - signals = Wait(signal_mask); - else - signals |= SetSignal(0,signal_mask) & signal_mask; - - if(signals & time_mask) - { - if(GetMsg(TimePort) != NULL) - { - if(AttemptLockLayerRom(Window->WLayer)) - { - update_display(REDRAW_DISPLAY); - - UnlockLayerRom(Window->WLayer); - } - else - { - update_display(PRETEND_TO_REDRAW_DISPLAY); - } - - TimeRequest->tr_node.io_Command = TR_ADDREQUEST; - TimeRequest->tr_time.tv_secs = 1; - TimeRequest->tr_time.tv_micro = 0; - - SendIO((struct IORequest *)TimeRequest); - } - else - { - signals &= ~time_mask; - } - } - - if(signals & window_mask) - { - struct IntuiMessage * imsg; - - imsg = (struct IntuiMessage *)GetMsg(Window->UserPort); - if(imsg != NULL) - { - ULONG class = imsg->Class; - UWORD code = imsg->Code; - - ReplyMsg((struct Message *)imsg); - - if(class == IDCMP_CLOSEWINDOW) - { - done = TRUE; - } - else if (class == IDCMP_NEWSIZE) - { - LockLayerRom(Window->WLayer); - - if(HistorySize > 0) - { - redraw_display(); - } - else - { - clear_display(); - - update_display(REDRAW_DISPLAY); - } - - UnlockLayerRom(Window->WLayer); - - if(CheckIO((struct IORequest *)TimeRequest) == BUSY) - AbortIO((struct IORequest *)TimeRequest); - - WaitIO((struct IORequest *)TimeRequest); - - TimeRequest->tr_node.io_Command = TR_ADDREQUEST; - TimeRequest->tr_time.tv_secs = 1; - TimeRequest->tr_time.tv_micro = 0; - - SendIO((struct IORequest *)TimeRequest); - } - else if (class == IDCMP_VANILLAKEY) - { - if(code == '\033' || code == '\034' || code == '\003') - done = TRUE; - } - } - else - { - signals &= ~window_mask; - } - } - - if(signals & SIGBREAKF_CTRL_C) - { - done = TRUE; - - signals &= ~SIGBREAKF_CTRL_C; - } - } - while(NOT done); - - if(CheckIO((struct IORequest *)TimeRequest) == BUSY) - AbortIO((struct IORequest *)TimeRequest); - - WaitIO((struct IORequest *)TimeRequest); - - cleanup(); - } - - return(0); -} diff --git a/examples/SampleNetSpeed_rev.h b/examples/SampleNetSpeed_rev.h deleted file mode 100644 index 6f9b2d4..0000000 --- a/examples/SampleNetSpeed_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 5 -#define DATE "10.11.2016" -#define VERS "SampleNetSpeed 4.5" -#define VSTRING "SampleNetSpeed 4.5 (10.11.2016)\r\n" -#define VERSTAG "\0$VER: SampleNetSpeed 4.5 (10.11.2016)" diff --git a/examples/ShowNetStatus.c b/examples/ShowNetStatus.c deleted file mode 100644 index 9675fa4..0000000 --- a/examples/ShowNetStatus.c +++ /dev/null @@ -1,2962 +0,0 @@ -/* - * $Id: ShowNetStatus.c,v 1.16 2007-08-26 12:30:16 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - -/****************************************************************************/ - -#if defined(__amigaos4__) -#include -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -#if !defined(__amigaos4__) -#define NO_INLINE_STDARG -#endif /* __amigaos4__ */ - -#define __NOLIBBASE__ -#define __NOGLOBALIFACE__ -#define __USE_INLINE__ - -/****************************************************************************/ - -#include -#include -#include -#include -#include - -/****************************************************************************/ - -#include -#include - -/****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/****************************************************************************/ - -#include "macros.h" - -/****************************************************************************/ - -#include "ShowNetStatus_rev.h" - -/****************************************************************************/ - -#ifndef AbsExecBase -#define AbsExecBase (*(struct ExecBase **)4) -#endif /* AbsExecBase */ - -/****************************************************************************/ - -#ifndef FORMAT_DEF -#define FORMAT_DEF 4 -#endif /* FORMAT_DEF */ - -/****************************************************************************/ - -typedef LONG * NUMBER; -typedef LONG SWITCH; -typedef STRPTR KEY; - -/****************************************************************************/ - -struct CommandContext -{ - struct Library * cc_SysBase; - struct Library * cc_DOSBase; - struct Library * cc_UtilityBase; - struct Library * cc_SocketBase; - struct Library * cc_LocaleBase; - - #if defined(__amigaos4__) - - /************************************************************************/ - - struct ExecIFace * cc_IExec; - struct DOSIFace * cc_IDOS; - struct UtilityIFace * cc_IUtility; - struct SocketIFace * cc_ISocket; - struct LocaleIFace * cc_ILocale; - - /************************************************************************/ - - #endif /* __amigaos4__ */ - - struct Catalog * cc_Catalog; - struct Locale * cc_Locale; - UBYTE cc_ProgramName[256]; - UBYTE * cc_QueryBuffer; - LONG cc_QueryBufferSize; - BOOL cc_Stopped; - BOOL cc_HaveDomain; - STRPTR cc_Domain; - STRPTR cc_Line1; - STRPTR cc_Line2; - BOOL cc_NoNames; - BOOL cc_Something; - BOOL cc_Quiet; -}; - -/****************************************************************************/ - -#if defined(__amigaos4__) - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct ExecIFace * IExec = cc->cc_IExec; \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct DOSIFace * IDOS = cc->cc_IDOS; \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct UtilityIFace * IUtility = cc->cc_IUtility; \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct LocaleIFace * ILocale = cc->cc_ILocale; \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct SocketIFace * ISocket = cc->cc_ISocket; \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#else - -/****************************************************************************/ - -#define DECLARE_SYSBASE(cc) \ - struct Library * SysBase = cc->cc_SysBase - -#define DECLARE_DOSBASE(cc) \ - struct Library * DOSBase = cc->cc_DOSBase - -#define DECLARE_UTILITYBASE(cc) \ - struct Library * UtilityBase = cc->cc_UtilityBase - -#define DECLARE_LOCALEBASE(cc) \ - struct Library * LocaleBase = cc->cc_LocaleBase - -#define DECLARE_SOCKETBASE(cc) \ - struct Library * SocketBase = cc->cc_SocketBase - -/****************************************************************************/ - -#endif /* __amigaos4__ */ - -/****************************************************************************/ - -LONG _start(VOID); - -/****************************************************************************/ - -STATIC VOID close_libs(struct CommandContext *cc); -STATIC LONG open_libs(struct CommandContext *cc, struct Library *SysBase); -LONG cmd(struct CommandContext *cc); -STATIC STRPTR begin_underline(struct CommandContext *cc); -STATIC STRPTR end_underline(struct CommandContext *cc); -STATIC ULONG divide_64_by_32(SBQUAD_T *dividend, ULONG divisor, SBQUAD_T *quotient); -STATIC VOID insert_grouping_characters(struct Locale *loc, STRPTR buffer); -STATIC STRPTR convert_quad_to_string(struct Locale *loc, const SBQUAD_T *const number, STRPTR string, LONG max_string_len); -STATIC LONG fill_query_buffer(struct CommandContext *cc, LONG type); -STATIC VARARGS68K VOID lprintf(struct CommandContext *cc, STRPTR format, ...); -STATIC VARARGS68K VOID lsprintf(struct CommandContext *cc, STRPTR buffer, STRPTR formatString, ...); -STATIC BOOL is_blank_space(UBYTE c); -STATIC VOID strip_extra_blank_spaces(STRPTR s); -STATIC STRPTR routename(struct CommandContext *cc, ULONG in, STRPTR line, LONG line_size); -STATIC ULONG forgemask(ULONG a); -STATIC STRPTR netname(struct CommandContext *cc, ULONG in, STRPTR line, LONG line_size); -STATIC STRPTR get_sockaddr(struct CommandContext *cc, struct sockaddr *sa, int flags, STRPTR line, LONG line_size); -STATIC VOID print_arp_table(struct CommandContext *cc, struct rt_msghdr *rtm); -STATIC VOID print_route_table(struct CommandContext *cc, struct rt_msghdr *rtm); -STATIC VOID print_dns_list(struct CommandContext *cc, struct List *dns_list); -STATIC VOID print_interface_list(struct CommandContext *cc, struct List *interface_list); -STATIC BOOL print_interface_info(struct CommandContext *cc, STRPTR name); -STATIC VOID print_icmp_status(struct CommandContext *cc, struct icmpstat *icps); -STATIC VOID print_igmp_status(struct CommandContext *cc, struct igmpstat *igps); -STATIC VOID print_ip_status(struct CommandContext *cc, struct ipstat *ips); -STATIC VOID print_mb_status(struct CommandContext *cc, struct mbstat *m); -STATIC VOID print_mrt_status(struct CommandContext *cc, struct mrtstat *mrts); -STATIC VOID print_rt_status(struct CommandContext *cc, struct rtstat *rts); -STATIC VOID print_tcp_status(struct CommandContext *cc, struct tcpstat *tcps); -STATIC VOID print_udp_status(struct CommandContext *cc, struct udpstat *udps); -STATIC VOID print_tcp_socket_status(struct CommandContext *cc, BOOL all_sockets, struct protocol_connection_data *pcd, LONG size); -STATIC VOID print_udp_socket_status(struct CommandContext *cc, BOOL all_sockets, struct protocol_connection_data *pcd, LONG size); -STATIC VOID print_net_status_summary(struct CommandContext *cc); -STATIC LONG VARARGS68K Local_ErrorPrintf(struct CommandContext *cc, STRPTR format, ...); -STATIC STRPTR get_builtin_str(LONG id); -STRPTR get_str(struct CommandContext *cc, LONG id); -STATIC VARARGS68K LONG Local_QueryInterfaceTags(struct CommandContext *cc, STRPTR interface_name, ...); -STATIC VARARGS68K LONG Local_SocketBaseTags(struct CommandContext *cc, ...); - -/****************************************************************************/ - -/****** ROADSHOW/SHOWNETSTATUS ************************************************** -* -* NAME -* ShowNetStatus - Display various information about the status of the -* network configuration. -* -* FORMAT -* ShowNetStatus [INTERFACE=[,...]] [INTERFACES] [ARPCACHE=ARP] -* [ROUTES] [DNS=DOMAINNAMESERVERS] [ICMP] [IGMP] [IP] [MB=MEMORY] -* [MR=MULTICASTROUTING] [RT=ROUTING] [TCP] [UDP] [TCPSOCKETS] -* [UDPSOCKETS] [NAMES] [ALL] [REPEAT] [QUIET] -* -* TEMPLATE -* INTERFACE/M,INTERFACES/S,ARPCACHE=ARP/S,ROUTES/S, -* DNS=DOMAINNAMESERVERS/S,ICMP/S,IGMP/S,IP/S,MB=MEMORY/S, -* MR=MULTICASTROUTING/S,RT=ROUTING/S,TCP/S,UDP/S,TCPSOCKETS/S, -* UDPSOCKETS/S,NAMES/S,ALL/S,REPEAT/S,QUIET/S -* -* PATH -* C:SHOWNETSTATUS -* -* FUNCTION -* This command can display a lot of informations about the active -* interfaces, either for one interface or for all them. It can be used -* to display the current settings or to give details on the quality of -* the network: transfer speed, number of errors, etc. -* -* You can request which details should be displayed. If you provide -* no options to this command, it will print a general summary of the -* current network status. -* -* OPTIONS -* INTERFACE/M -* For each interface provided in this list, show detailed -* configuration information and statistics. -* -* INTERFACES/S -* Show the list of all interfaces known to the TCP/IP stack. -* -* ARP/S -* Show the contents of the address resolution protocol (ARP) cache. -* -* ROUTES/S -* Show information on the routes that are configured. The -* default route is indicated by having a gateway address -* of 'default'. -* -* DNS=DOMAINNAMESERVERS/S -* Show a list of domain name servers known to the TCP/IP -* stack. Servers are either dynamically configured or -* statically (through the 'DEVS:Interfaces/name_resolution' file). -* -* ICMP/S -* Display Internet Control Message Protocol statistics. -* -* IGMP/S -* Display Internet Group Management Protocol statistics. -* -* IP/S -* Display Internet Protocol statistics. -* -* MB=MEMORY/S -* Display memory buffer statistics. -* -* MR=MULTICASTROUTING/S -* Display multicast routing statistics. -* -* RT=ROUTING/S -* Display routing statistics. -* -* TCP/S -* Display Transmission Control Protocol statistics. -* -* UDP/S -* Display User Datagram Protocol statistics. -* -* TCPSOCKETS/S -* Display information about the TCP sockets currently -* in use. Note that unless you use the 'ALL' option, -* sockets bound to local addresses will not be shown. -* -* UDPSOCKETS/S -* Display information about the UDP sockets currently -* in use. Note that unless you use the 'ALL' option, -* sockets bound to local addresses will not be shown. -* -* NAMES/S -* Attempt to figure out which symbolic names are associated -* with the IP addresses to be printed, and also attempt to -* associate port numbers with service names. -* -* ALL/S -* This option works in conjunction with the TCPSOCKETS and -* UDPSOCKETS parameters. It tells the respective display -* routines to show all currently active sockets, including -* those bound to local addresses. -* -* REPEAT/S -* Repeat the query and display process each second; the -* screen will be cleared before the new information is -* printed. To stop printing the data, press [Ctrl]+C. -* -* QUIET/S -* Do not show any error messages. -* -* EXAMPLES -* Show details on interface "itf". -* -* 1> SHOWNETSTATUS INTERFACE itf -* -* Show details on the Internet Group Management Protocol and routing -* statistics -* -* 1> SHOWNETSTATUS ROUTING IGMP -* -* NOTES -* This command works like a combination of the Unix "route", "ifconfig" -* and "netstat" commands. -* -* Most of the information printed is rather cryptic and not of much -* use to the casual user. It can help in debugging, though. -* -****************************************************************************** -*/ -LONG -_start(VOID) -{ - struct Library *SysBase = (struct Library *)AbsExecBase; - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - struct CommandContext _cc,*cc = &_cc; - LONG result = RETURN_FAIL; - struct Process * pr; - LONG error; - - memset(cc,0,sizeof(*cc)); - - pr = (struct Process *)FindTask(NULL); - if(pr->pr_CLI == ZERO) - { - struct MsgPort * mp = &pr->pr_MsgPort; - struct Message * mn; - - WaitPort(mp); - mn = GetMsg(mp); - - Forbid(); - ReplyMsg(mn); - goto out; - } - - error = open_libs(cc,SysBase); - if(error == OK) - { - DECLARE_LOCALEBASE(cc); - - if(cc->cc_LocaleBase != NULL) - { - cc->cc_Catalog = OpenCatalogA(NULL,"roadshow.catalog",NULL); - cc->cc_Locale = OpenLocale(NULL); - } - - result = cmd(cc); - - if(cc->cc_QueryBuffer != NULL) - FreeVec(cc->cc_QueryBuffer); - - if(cc->cc_Catalog != NULL) - CloseCatalog(cc->cc_Catalog); - - if(cc->cc_Locale != NULL) - CloseLocale(cc->cc_Locale); - } - else - { - pr->pr_Result2 = error; - } - - close_libs(cc); - - out: - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -close_libs(struct CommandContext * cc) -{ - DECLARE_SYSBASE(cc); - - #if defined(__amigaos4__) - { - if(cc->cc_IDOS != NULL) - DropInterface((struct Interface *)cc->cc_IDOS); - - if(cc->cc_ILocale != NULL) - DropInterface((struct Interface *)cc->cc_ILocale); - - if(cc->cc_ISocket != NULL) - DropInterface((struct Interface *)cc->cc_ISocket); - - if(cc->cc_IUtility != NULL) - DropInterface((struct Interface *)cc->cc_IUtility); - } - #endif /* __amigaos4__ */ - - if(cc->cc_UtilityBase != NULL) - CloseLibrary(cc->cc_UtilityBase); - - if(cc->cc_SocketBase != NULL) - CloseLibrary(cc->cc_SocketBase); - - if(cc->cc_LocaleBase != NULL) - CloseLibrary(cc->cc_LocaleBase); - - if(cc->cc_DOSBase != NULL) - CloseLibrary(cc->cc_DOSBase); -} - -/****************************************************************************/ - -STATIC LONG -open_libs(struct CommandContext * cc,struct Library *SysBase) -{ - #if defined(__amigaos4__) - struct ExecIFace * IExec = (struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface; - #endif /* __amigaos4__ */ - - LONG error; - - cc->cc_SysBase = SysBase; - - #if defined(__amigaos4__) - { - cc->cc_IExec = IExec; - } - #endif /* __amigaos4__ */ - - cc->cc_DOSBase = OpenLibrary("dos.library",36); - - #if defined(__amigaos4__) - { - if(cc->cc_DOSBase != NULL) - { - cc->cc_IDOS = (struct DOSIFace *)GetInterface(cc->cc_DOSBase, "main", 1, 0); - if(cc->cc_IDOS == NULL) - { - CloseLibrary(cc->cc_DOSBase); - cc->cc_DOSBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - if(cc->cc_DOSBase == NULL) - { - error = ERROR_INVALID_RESIDENT_LIBRARY; - goto out; - } - - cc->cc_LocaleBase = OpenLibrary("locale.library",38); - - #if defined(__amigaos4__) - { - if(cc->cc_LocaleBase != NULL) - { - cc->cc_ILocale = (struct LocaleIFace *)GetInterface(cc->cc_LocaleBase, "main", 1, 0); - if(cc->cc_ILocale == NULL) - { - CloseLibrary(cc->cc_LocaleBase); - cc->cc_LocaleBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - cc->cc_UtilityBase = OpenLibrary("utility.library",37); - - #if defined(__amigaos4__) - { - if(cc->cc_UtilityBase != NULL) - { - cc->cc_IUtility = (struct UtilityIFace *)GetInterface(cc->cc_UtilityBase, "main", 1, 0); - if(cc->cc_IUtility == NULL) - { - CloseLibrary(cc->cc_UtilityBase); - cc->cc_UtilityBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - /* The following may be necessary to flush out an inoperable - bsdsocket.library which reached the end of the shutdown - process. */ - #if 1 - { - struct ExecBase * ex = (struct ExecBase *)SysBase; - struct Library * lib; - - Forbid(); - - lib = (struct Library *)FindName(&ex->LibList,"bsdsocket.library"); - if(lib != NULL) - RemLibrary(lib); - - Permit(); - } - #endif - - cc->cc_SocketBase = OpenLibrary("bsdsocket.library",4); - - #if defined(__amigaos4__) - { - if(cc->cc_SocketBase != NULL) - { - cc->cc_ISocket = (struct SocketIFace *)GetInterface(cc->cc_SocketBase, "main", 1, 0); - if(cc->cc_ISocket == NULL) - { - CloseLibrary(cc->cc_SocketBase); - cc->cc_SocketBase = NULL; - } - } - } - #endif /* __amigaos4__ */ - - error = OK; - - out: - - return(error); -} - -/****************************************************************************/ - -#define CATCOMP_ARRAY -#define SHOWNETSTATUS_CATALOG_STRINGS -#include "roadshow.h" - -/****************************************************************************/ - -LONG -cmd(struct CommandContext * cc) -{ - struct - { - KEY * Interface; - SWITCH Interfaces; - SWITCH ARP; - SWITCH Routes; - SWITCH DNS; - SWITCH ICMP; - SWITCH IGMP; - SWITCH IP; - SWITCH Memory; - SWITCH MulticastRouting; - SWITCH Routing; - SWITCH TCP; - SWITCH UDP; - SWITCH TCP_Sockets; - SWITCH UDP_Sockets; - SWITCH Names; - SWITCH All; - SWITCH Repeat; - SWITCH Quiet; - } args; - - STRPTR args_template = - "INTERFACE/M," - "INTERFACES/S," - "ARPCACHE=ARP/S," - "ROUTES/S," - "DNS=DOMAINNAMESERVERS/S," - "ICMP/S," - "IGMP/S," - "IP/S," - "MB=MEMORY/S," - "MR=MULTICASTROUTING/S," - "RT=ROUTING/S," - "TCP/S," - "UDP/S," - "TCPSOCKETS/S," - "UDPSOCKETS/S," - "NAMES/S," - "ALL/S," - "REPEAT/S," - "QUIET/S" - VERSTAG; - - DECLARE_SYSBASE(cc); - DECLARE_DOSBASE(cc); - DECLARE_UTILITYBASE(cc); - DECLARE_SOCKETBASE(cc); - - struct List * interface_list = NULL; - struct List * dns_list = NULL; - struct rt_msghdr * route_table = NULL; - LONG result = RETURN_FAIL; - LONG have_status_api = FALSE; - LONG have_routing_api = FALSE; - LONG have_interface_api = FALSE; - LONG have_dns_api = FALSE; - BOOL show_net_status_summary = FALSE; - struct RDArgs * rda; - - GetProgramName(cc->cc_ProgramName,sizeof(cc->cc_ProgramName)); - - memset(&args,0,sizeof(args)); - - rda = ReadArgs(args_template,(LONG *)&args,NULL); - if(rda == NULL) - { - PrintFault(IoErr(),cc->cc_ProgramName); - goto out; - } - - if(args.Interface == NULL && - args.Interfaces == FALSE && - args.ARP == FALSE && - args.Routes == FALSE && - args.DNS == FALSE && - args.ICMP == FALSE && - args.IGMP == FALSE && - args.IP == FALSE && - args.Memory == FALSE && - args.MulticastRouting == FALSE && - args.Routing == FALSE && - args.TCP == FALSE && - args.UDP == FALSE && - args.TCP_Sockets == FALSE && - args.UDP_Sockets == FALSE) - { - show_net_status_summary = TRUE; - } - - cc->cc_Quiet = args.Quiet; - - if(UtilityBase == NULL) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NO_UTILITY_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(SocketBase == NULL) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_STATUS_API),&have_status_api, - TAG_END) != 0) - { - have_status_api = FALSE; - } - - if(NOT have_status_api) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_ROUTING_API),&have_routing_api, - TAG_END) != 0) - { - have_routing_api = FALSE; - } - - if(NOT have_routing_api) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_ROUTE_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_INTERFACE_API),&have_interface_api, - TAG_END) != 0) - { - have_interface_api = FALSE; - } - - if(NOT have_interface_api) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_INTERFACE_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - if(Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HAVE_DNS_API),&have_dns_api, - TAG_END) != 0) - { - have_dns_api = FALSE; - } - - if(NOT have_dns_api) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_DNS_API_TXT), - cc->cc_ProgramName, SocketBase->lib_Node.ln_Name, SocketBase->lib_Version, SocketBase->lib_Revision); - } - - goto out; - } - - cc->cc_Domain = AllocVec(3 * (MAXHOSTNAMELEN + 1),MEMF_ANY|MEMF_PUBLIC); - if(cc->cc_Domain == NULL) - { - PrintFault(ERROR_NO_FREE_STORE,cc->cc_ProgramName); - goto out; - } - - cc->cc_Line1 = cc->cc_Domain + MAXHOSTNAMELEN + 1; - cc->cc_Line2 = cc->cc_Line1 + MAXHOSTNAMELEN + 1; - - if(args.Names) - cc->cc_NoNames = FALSE; - else - cc->cc_NoNames = TRUE; - - while(TRUE) - { - if(show_net_status_summary) - print_net_status_summary(cc); - - if(args.Interface != NULL) - { - STRPTR * key = args.Interface; - STRPTR name; - BOOL failed; - - failed = FALSE; - - while((name = (*key++)) != NULL) - { - if(CANNOT print_interface_info(cc,name)) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_CANNOT_GET_INFO_ON_INTERFACE_TXT), - cc->cc_ProgramName,name); - } - - failed = TRUE; - } - } - - if(failed) - goto out; - } - - if(args.Interfaces) - { - if(interface_list != NULL) - ReleaseInterfaceList(interface_list); - - interface_list = ObtainInterfaceList(); - if(interface_list == NULL) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_CANNOT_GET_INTERFACE_LIST_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - print_interface_list(cc,interface_list); - } - - if(args.DNS) - { - if(dns_list != NULL) - ReleaseDomainNameServerList(dns_list); - - dns_list = ObtainDomainNameServerList(); - if(dns_list == NULL) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_CANNOT_GET_DNS_LIST_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - print_dns_list(cc,dns_list); - } - - if(args.Routes) - { - if(route_table != NULL) - FreeRouteInfo(route_table); - - route_table = GetRouteInfo(AF_UNSPEC,0); - if(route_table == NULL) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_CANNOT_GET_ROUTE_TABLE_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - print_route_table(cc,route_table); - } - - if(args.ARP) - { - if(route_table != NULL) - FreeRouteInfo(route_table); - - route_table = GetRouteInfo(AF_INET,RTF_LLINFO); - if(route_table == NULL) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NO_ARP_INFORMATION_TXT), - cc->cc_ProgramName); - } - - goto out; - } - - print_arp_table(cc,route_table); - } - - if(args.ICMP) - { - if(fill_query_buffer(cc,NETSTATUS_icmp) < 0) - goto out; - - print_icmp_status(cc,(struct icmpstat *)cc->cc_QueryBuffer); - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.IGMP) - { - if(fill_query_buffer(cc,NETSTATUS_igmp) < 0) - goto out; - - print_igmp_status(cc,(struct igmpstat *)cc->cc_QueryBuffer); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.IP) - { - if(fill_query_buffer(cc,NETSTATUS_ip) < 0) - goto out; - - print_ip_status(cc,(struct ipstat *)cc->cc_QueryBuffer); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.Memory) - { - if(fill_query_buffer(cc,NETSTATUS_mb) < 0) - goto out; - - print_mb_status(cc,(struct mbstat *)cc->cc_QueryBuffer); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.MulticastRouting) - { - if(fill_query_buffer(cc,NETSTATUS_mrt) < 0) - goto out; - - print_mrt_status(cc,(struct mrtstat *)cc->cc_QueryBuffer); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.Routing) - { - if(fill_query_buffer(cc,NETSTATUS_rt) < 0) - goto out; - - print_rt_status(cc,(struct rtstat *)cc->cc_QueryBuffer); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.TCP) - { - if(fill_query_buffer(cc,NETSTATUS_tcp) < 0) - goto out; - - print_tcp_status(cc,(struct tcpstat *)cc->cc_QueryBuffer); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.UDP) - { - if(fill_query_buffer(cc,NETSTATUS_udp) < 0) - goto out; - - print_udp_status(cc,(struct udpstat *)cc->cc_QueryBuffer); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.TCP_Sockets) - { - LONG size; - - size = fill_query_buffer(cc,NETSTATUS_tcp_sockets); - if(size < 0) - goto out; - - print_tcp_socket_status(cc,args.All,(struct protocol_connection_data *)cc->cc_QueryBuffer,size); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.UDP_Sockets) - { - LONG size; - - size = fill_query_buffer(cc,NETSTATUS_udp_sockets); - if(size < 0) - goto out; - - print_udp_socket_status(cc,args.All,(struct protocol_connection_data *)cc->cc_QueryBuffer,size); - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - } - - if(args.Repeat) - { - LONG i; - - for(i = 0 ; i < 10 ; i++) - { - Delay(TICKS_PER_SECOND / 10); - - if(CheckSignal(SIGBREAKF_CTRL_C)) - { - cc->cc_Stopped = TRUE; - - PrintFault(ERROR_BREAK,cc->cc_ProgramName); - - result = RETURN_WARN; - - break; - } - } - - if(cc->cc_Stopped) - { - result = RETURN_WARN; - goto out; - } - - cc->cc_Something = FALSE; - lprintf(cc,"\f"); - } - else - { - break; - } - } - - result = RETURN_OK; - - out: - - FreeVec(cc->cc_Domain); - - if(interface_list != NULL) - ReleaseInterfaceList(interface_list); - - if(dns_list != NULL) - ReleaseDomainNameServerList(dns_list); - - if(route_table != NULL) - FreeRouteInfo(route_table); - - if(rda != NULL) - FreeArgs(rda); - - return(result); -} - -STATIC STRPTR -begin_underline(struct CommandContext * cc) -{ - DECLARE_DOSBASE(cc); - - STRPTR result; - - if(IsInteractive(Output())) - result = "\33[4m"; - else - result = ""; - - return(result); -} - -STATIC STRPTR -end_underline(struct CommandContext * cc) -{ - DECLARE_DOSBASE(cc); - - STRPTR result; - - if(IsInteractive(Output())) - result = "\33[0m"; - else - result = ""; - - return(result); -} - -/****************************************************************************/ - -/* Divide a 64 bit integer by a 32 bit integer, filling in a 64 bit quotient - and returning a 32 bit remainder. */ -STATIC ULONG -divide_64_by_32(SBQUAD_T * dividend,ULONG divisor,SBQUAD_T * quotient) -{ - SBQUAD_T dividend_cdef = (*dividend); - ULONG dividend_ab = 0; - LONG i; - - quotient->sbq_High = quotient->sbq_Low = 0; - - for(i = 0 ; i < 64 ; i++) - { - /* Shift the quotient left by one bit. */ - quotient->sbq_High = (quotient->sbq_High << 1); - - if((quotient->sbq_Low & 0x80000000UL) != 0) - quotient->sbq_High |= 1; - - quotient->sbq_Low = (quotient->sbq_Low << 1); - - /* Shift the dividend left by one bit. We start - with the most significant 32 bit portion. */ - dividend_ab = (dividend_ab << 1); - - if((dividend_cdef.sbq_High & 0x80000000UL) != 0) - dividend_ab |= 1; - - /* Now for the middle 32 bit portion. */ - dividend_cdef.sbq_High = (dividend_cdef.sbq_High << 1); - - if((dividend_cdef.sbq_Low & 0x80000000UL) != 0) - dividend_cdef.sbq_High |= 1; - - /* Finally, the least significant portion. */ - dividend_cdef.sbq_Low = (dividend_cdef.sbq_Low << 1); - - /* Does the divisor actually divide the dividend? */ - if(dividend_ab >= divisor) - { - dividend_ab -= divisor; - - /* We could divide the divisor. Keep track of - this and take care of an overflow condition. */ - quotient->sbq_Low++; - if(quotient->sbq_Low == 0) - quotient->sbq_High++; - } - } - - return(dividend_ab); -} - -/****************************************************************************/ - -STATIC VOID -insert_grouping_characters(struct Locale * loc,STRPTR buffer) -{ - if(loc != NULL && loc->loc_Grouping != NULL && loc->loc_GroupSeparator != NULL) - { - UBYTE * grouping = loc->loc_Grouping; - UBYTE * group_separator = loc->loc_GroupSeparator; - UBYTE local_buffer[80]; - LONG num_group_digits; - UBYTE * s; - LONG i,len; - - /* Check which kind of grouping should be performed - for the first group. */ - switch(*grouping) - { - /* Repeat current grouping scheme; there is nothing - to repeat in the first place since we don't even - know yet what we are going to repeat. */ - case 0: - - return; - - /* Perform no further grouping. That means our job is - done! */ - case 255: - - return; - - /* Use this initial group size. */ - default: - - num_group_digits = (*grouping++); - break; - } - - /* Run down the number string, inserting grouping - characters where necessary. */ - s = local_buffer; - len = strlen(buffer); - for(i = len-1 ; i >= 0 ; i--) - { - (*s++) = buffer[i]; - - /* Is this not the last character to be stored? - If so, check if we should insert a grouping - character right now. */ - if(i != 0 && num_group_digits > 0) - { - if(--num_group_digits == 0) - { - int j; - - /* Insert the group separator in reverse order. */ - for(j = strlen(group_separator)-1 ; j >= 0 ; j--) - (*s++) = group_separator[j]; - - /* Now check which kind of grouping we should - perform next. */ - switch(*grouping) - { - /* Repeat current grouping scheme. */ - case 0: - - num_group_digits = grouping[-1]; - break; - - /* Perform no further grouping. */ - case 255: - - break; - - /* Use new grouping scheme. */ - default: - - num_group_digits = (*grouping++); - break; - } - } - } - } - - len = (int)(((ULONG)s) - ((ULONG)local_buffer)); - - for(i = len-1 ; i >= 0 ; i--) - (*buffer++) = local_buffer[i]; - - (*buffer) = '\0'; - } -} - -/****************************************************************************/ - -/* Convert a 64 bit number into a textual representation, using base=10, - just like sprintf(...,"%lD",...) would do if it could handle multiprecision - numbers... */ -STATIC STRPTR -convert_quad_to_string(struct Locale * loc,const SBQUAD_T * const number,STRPTR string,LONG max_string_len) -{ - SBQUAD_T q; - STRPTR s; - UBYTE c; - ULONG r; - LONG i,len; - - /* Make a local copy of the number. */ - q = (*number); - - s = string; - - len = 0; - - /* Build the number string in reverse order, calculating - the single digits: */ - while(len < max_string_len) - { - /* Divide by ten and remember the remainder. */ - r = divide_64_by_32(&q,10,&q); - - (*s++) = '0' + r; - len++; - - /* Stop when we hit zero. */ - if(q.sbq_High == 0 && q.sbq_Low == 0) - break; - } - - /* Don't forget to terminate the string. */ - (*s) = '\0'; - - /* Reverse the string in place. */ - for(i = 0 ; i < len/2 ; i++) - { - c = string[len-1-i]; - string[len-1-i] = string[i]; - string[i] = c; - } - - insert_grouping_characters(loc,string); - - return(string); -} - -/****************************************************************************/ - -STATIC LONG -fill_query_buffer(struct CommandContext * cc,LONG type) -{ - DECLARE_SYSBASE(cc); - DECLARE_SOCKETBASE(cc); - - LONG size; - - size = GetNetworkStatistics(type,NETWORKSTATUS_VERSION,NULL,0); - if(size > 0) - { - if(size > cc->cc_QueryBufferSize) - { - FreeVec(cc->cc_QueryBuffer); - - cc->cc_QueryBuffer = AllocVec(size,MEMF_ANY|MEMF_CLEAR); - if(cc->cc_QueryBuffer != NULL) - { - cc->cc_QueryBufferSize = size; - } - else - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NOT_ENOUGH_MEMORY_TO_QUERY_STATUS_TXT), - cc->cc_ProgramName,get_str(cc,MSG_SHOWNETSTATUS_STATUS_NAME1_TXT + type - NETSTATUS_icmp)); - } - - size = -1; - goto out; - } - } - - size = GetNetworkStatistics(type,NETWORKSTATUS_VERSION,cc->cc_QueryBuffer,size); - } - - if(size < 0) - { - if(NOT cc->cc_Quiet) - { - Local_ErrorPrintf(cc,get_str(cc,MSG_SHOWNETSTATUS_CANNOT_GET_STATUS_INFORMATION_FOR_TXT), - cc->cc_ProgramName,get_str(cc,MSG_SHOWNETSTATUS_STATUS_NAME1_TXT + type - NETSTATUS_icmp)); - } - } - - out: - - return(size); -} - -/****************************************************************************/ - -STATIC VARARGS68K VOID -lprintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - - if(NOT cc->cc_Stopped) - { - if(CheckSignal(SIGBREAKF_CTRL_C)) - { - PrintFault(ERROR_BREAK,cc->cc_ProgramName); - cc->cc_Stopped = TRUE; - } - } - - if(NOT cc->cc_Stopped) - { - va_list args; - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - VPrintf(format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - VPrintf(format,(APTR)args); - va_end(args); - } - #endif /* __amigaos4__ */ - } -} - -/****************************************************************************/ - -STATIC VARARGS68K VOID -lsprintf(struct CommandContext * cc,STRPTR buffer,STRPTR formatString,...) -{ - DECLARE_SYSBASE(cc); - - va_list varArgs; - - #if defined(__amigaos4__) - { - va_startlinear(varArgs,formatString); - RawDoFmt(formatString,va_getlinearva(varArgs,APTR),NULL,buffer); - va_end(varArgs); - } - #else - { - va_start(varArgs,formatString); - RawDoFmt(formatString,varArgs,(VOID (*)())"\x16\xC0\x4E\x75",buffer); - va_end(varArgs); - } - #endif /* __amigaos4__ */ -} - -/****************************************************************************/ - -STATIC BOOL -is_blank_space(UBYTE c) -{ - BOOL result; - - result = (BOOL)(c == ' ' || c == '\t' || c == (UBYTE)'\240'); - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -strip_extra_blank_spaces(STRPTR s) -{ - LONG num_leading_spaces; - LONG num_trailing_spaces; - LONG len,i; - - len = strlen(s); - - num_leading_spaces = 0; - - for(i = 0 ; i < len ; i++) - { - if(NOT is_blank_space(s[i])) - break; - - num_leading_spaces++; - } - - num_trailing_spaces = 0; - - for(i = len-1 ; i >= 0 ; i--) - { - if(NOT is_blank_space(s[i])) - break; - - num_trailing_spaces++; - } - - if(num_trailing_spaces > 0) - { - len -= num_trailing_spaces; - s[len] = '\0'; - } - - if(num_leading_spaces > 0) - memmove(s,&s[num_leading_spaces],len+1); -} - -/****************************************************************************/ - -#define C(x) ((x) & 0xff) - -/****************************************************************************/ - -STATIC STRPTR -routename(struct CommandContext * cc,ULONG in,STRPTR line,LONG line_size) -{ - DECLARE_UTILITYBASE(cc); - DECLARE_SOCKETBASE(cc); - - struct hostent *hp; - STRPTR cp; - - cp = NULL; - - if(NOT cc->cc_NoNames) - { - if(NOT cc->cc_HaveDomain) - { - cc->cc_HaveDomain = TRUE; - - if(gethostname(cc->cc_Domain, MAXHOSTNAMELEN) == 0 && (cp = index(cc->cc_Domain, '.')) != NULL) - strcpy(cc->cc_Domain, cp + 1); - else - cc->cc_Domain[0] = '\0'; - } - - hp = gethostbyaddr((char *)&in, sizeof(struct in_addr), AF_INET); - if(hp != NULL) - { - if((cp = index(hp->h_name, '.')) != NULL && Stricmp(cp + 1, cc->cc_Domain) == SAME) - (*cp) = 0; - - cp = hp->h_name; - } - } - - if(cp != NULL) - { - strncpy(line, cp, line_size - 1); - line[line_size - 1] = '\0'; - } - else - { - in = ntohl(in); - lsprintf(cc, line, "%ld.%ld.%ld.%ld", C(in >> 24), C(in >> 16), C(in >> 8), C(in)); - } - - return(line); -} - -STATIC ULONG -forgemask(ULONG a) -{ - ULONG m; - - if(IN_CLASSA(a)) - m = IN_CLASSA_NET; - else if (IN_CLASSB(a)) - m = IN_CLASSB_NET; - else - m = IN_CLASSC_NET; - - return (m); -} - -/* Return the name of the network whose address is given. - The address is assumed to be that of a net or subnet, not a host. */ -STATIC STRPTR -netname(struct CommandContext * cc, ULONG in, STRPTR line, LONG line_size) -{ - DECLARE_SOCKETBASE(cc); - - STRPTR cp = NULL; - ULONG net; - ULONG i; - - i = ntohl(in); - - if(NOT cc->cc_NoNames && i) - { - ULONG mask; - int subnetshift; - - mask = forgemask(i); - switch(mask) - { - case IN_CLASSA_NET: - - subnetshift = 8; - break; - - case IN_CLASSB_NET: - - subnetshift = 8; - break; - - case IN_CLASSC_NET: - - subnetshift = 4; - break; - - default: - - subnetshift = 0; - break; - } - - if(subnetshift > 0) - { - struct netent *np; - - /* If there are more bits than the standard mask - would suggest, subnets must be in use. - Guess at the subnet mask, assuming reasonable - width subnet fields. */ - while(i &~ mask) - mask = (long)mask >> subnetshift; - - net = i & mask; - while((mask & 1) == 0) - mask >>= 1, net >>= 1; - - np = getnetbyaddr(net, AF_INET); - if(np != NULL) - cp = np->n_name; - } - } - - if(cp != NULL) - { - strncpy(line, cp, line_size - 1); - line[line_size - 1] = '\0'; - } - else if ((i & 0xffffff) == 0) - { - lsprintf(cc, line, "%ld", C(i >> 24)); - } - else if ((i & 0xffff) == 0) - { - lsprintf(cc, line, "%ld.%ld", C(i >> 24) , C(i >> 16)); - } - else if ((i & 0xff) == 0) - { - lsprintf(cc, line, "%ld.%ld.%ld", C(i >> 24), C(i >> 16), C(i >> 8)); - } - else - { - lsprintf(cc, line, "%ld.%ld.%ld.%ld", C(i >> 24), C(i >> 16), C(i >> 8), C(i)); - } - - return (line); -} - -STATIC STRPTR -get_sockaddr(struct CommandContext * cc,struct sockaddr * sa,int flags,STRPTR line,LONG line_size) -{ - struct sockaddr_in *sin = (struct sockaddr_in *)sa; - STRPTR result; - - if(sin->sin_addr.s_addr == INADDR_ANY) - result = get_str(cc,MSG_SHOWNETSTATUS_DEFAULT_TXT); - else if (flags & RTF_HOST) - result = routename(cc,sin->sin_addr.s_addr,line,line_size); - else - result = netname(cc,sin->sin_addr.s_addr,line,line_size); - - return(result); -} - -/****************************************************************************/ - -STATIC VOID -print_arp_table(struct CommandContext * cc,struct rt_msghdr *rtm) -{ - DECLARE_SOCKETBASE(cc); - - char *host; - struct sockaddr_inarp *sin; - struct sockaddr_dl *sdl; - struct hostent *hp; - char address[24]; - LONG n,c; - BOOL no_names; - - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - no_names = cc->cc_NoNames; - - for(n = 0 ; - rtm->rtm_msglen > 0 ; - rtm = (struct rt_msghdr *)(((ULONG)rtm) + rtm->rtm_msglen)) - { - sin = (struct sockaddr_inarp *)(rtm + 1); - sdl = (struct sockaddr_dl *)(sin + 1); - - host = get_str(cc,MSG_SHOWNETSTATUS_UNKNOWN_HOST_TXT); - - if(NOT no_names) - { - hp = gethostbyaddr((APTR)&sin->sin_addr, sizeof (sin->sin_addr), AF_INET); - if(hp != NULL) - { - host = hp->h_name; - } - else - { - LONG h_errno; - - Local_SocketBaseTags(cc, - SBTM_GETREF(SBTC_HERRNO),&h_errno, - TAG_END); - - if(h_errno == TRY_AGAIN) - no_names = TRUE; - } - } - - if(n++ == 0) - { - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ARP_HEADER_TXT), - begin_underline(cc), - get_str(cc,MSG_SHOWNETSTATUS_HOST_TXT), - get_str(cc,MSG_SHOWNETSTATUS_IP_ADDRESS_TXT), - get_str(cc,MSG_SHOWNETSTATUS_HARDWARE_ADDRESS_TXT), - get_str(cc,MSG_SHOWNETSTATUS_ATTRIBUTES_TXT), - end_underline(cc)); - - lprintf(cc,"\n"); - } - - if(sdl->sdl_alen > 0) - { - UBYTE * m; - - m = (UBYTE *)LLADDR(sdl); - - lsprintf(cc,address,"%02lx:%02lx:%02lx:%02lx:%02lx:%02lx",m[0],m[1],m[2],m[3],m[4],m[5]); - } - else - { - strcpy(address,get_str(cc,MSG_SHOWNETSTATUS_INCOMPLETE_HARDWARE_ADDRESS_TXT)); - } - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ARP_HEADER_TXT), - "", - host, - Inet_NtoA(sin->sin_addr.s_addr), - address, - "", - ""); - - c = 0; - - if (rtm->rtm_rmx.rmx_expire == 0) - { - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ARP_ENTRY_PERMANENT_TXT)); - c++; - } - - if (sin->sin_other & SIN_PROXY) - { - if(c != 0) - lprintf(cc,", "); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_PROXY_TXT)); - c++; - } - - if (rtm->rtm_addrs & RTA_NETMASK) - { - sin = (struct sockaddr_inarp *)(sdl->sdl_len + (char *)sdl); - - if (sin->sin_addr.s_addr == 0xffffffff) - { - if(c != 0) - lprintf(cc,", "); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_TXT)); - c++; - } - } - - if(c == 0) - lprintf(cc,"-"); - - lprintf(cc,"\n"); - } - - if(n == 0) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ARP_CACHE_EMPTY_TXT)); -} - -/****************************************************************************/ - -STATIC VOID -print_route_table(struct CommandContext * cc,struct rt_msghdr * rtm) -{ - struct sockaddr * sa; - STRPTR gateway,destination; - LONG n; - - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - for(n = 0 ; - rtm->rtm_msglen > 0 ; - rtm = (struct rt_msghdr *)(((ULONG)rtm) + rtm->rtm_msglen)) - { - if(rtm->rtm_version != 3 || (rtm->rtm_addrs & RTA_DST) == 0) - continue; - - sa = (struct sockaddr *)(rtm + 1); - if(sa->sa_family != AF_INET) - continue; - - if((rtm->rtm_addrs & RTA_GATEWAY) != 0) - { - LONG len; - - destination = get_sockaddr(cc,sa,rtm->rtm_flags,cc->cc_Line1,MAXHOSTNAMELEN); - - if(sa->sa_len == 0) - len = sizeof(long); - else - len = sa->sa_len; - - sa = (struct sockaddr *)(((ULONG)sa) + len); - if(sa->sa_family != AF_INET) - continue; - - gateway = get_sockaddr(cc,sa,rtm->rtm_flags,cc->cc_Line2,MAXHOSTNAMELEN); - } - else - { - destination = get_sockaddr(cc,sa,rtm->rtm_flags,cc->cc_Line1,MAXHOSTNAMELEN); - - gateway = "-"; - } - - if(n++ == 0) - { - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_ATTRIBUTES_TITLE_TXT), - begin_underline(cc), - get_str(cc,MSG_SHOWNETSTATUS_DESTINATION_TXT), - get_str(cc,MSG_SHOWNETSTATUS_GATEWAY_TXT), - get_str(cc,MSG_SHOWNETSTATUS_ATTRIBUTES_TXT), - end_underline(cc)); - } - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_LINE_TXT),destination,gateway); - - lprintf(cc," "); - - if(rtm->rtm_flags & RTF_UP) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UP_TXT)); - else - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_DOWN_TXT)); - - if(rtm->rtm_flags & RTF_GATEWAY) - { - lprintf(cc," "); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_GATEWAY_TXT)); - } - - if(rtm->rtm_flags & RTF_HOST) - { - lprintf(cc," "); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_HOST_TXT)); - } - - lprintf(cc,"\n"); - } - - if(n == 0) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NO_ROUTES_ARE_CONFIGURED_TXT)); -} - -/****************************************************************************/ - -STATIC VOID -print_dns_list(struct CommandContext * cc,struct List * dns_list) -{ - DECLARE_SOCKETBASE(cc); - - struct DomainNameServerNode * dnsn; - UBYTE default_domain_name[MAXHOSTNAMELEN]; - LONG n; - - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - n = 0; - - for(dnsn = (struct DomainNameServerNode *)dns_list->lh_Head ; - dnsn->dnsn_MinNode.mln_Succ != NULL ; - dnsn = (struct DomainNameServerNode *)dnsn->dnsn_MinNode.mln_Succ) - { - if(n++ == 0) - { - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ADDRESS_TYPE_TITLE_TXT), - begin_underline(cc), - get_str(cc,MSG_SHOWNETSTATUS_ADDRESS_TXT), - get_str(cc,MSG_SHOWNETSTATUS_TYPE_TXT), - end_underline(cc)); - } - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ADDRESS_TYPE_LINE_TXT),routename(cc,inet_addr(dnsn->dnsn_Address),cc->cc_Line1,MAXHOSTNAMELEN), - get_str(cc,(dnsn->dnsn_UseCount < 0) ? MSG_SHOWNETSTATUS_STATIC_TXT : MSG_SHOWNETSTATUS_DYNAMIC_TXT)); - } - - if(n == 0) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NO_DNS_CONFIGURED_TXT)); - - strcpy(default_domain_name,""); - - GetDefaultDomainName(default_domain_name,sizeof(default_domain_name)); - - lprintf(cc, - get_str(cc,default_domain_name[0] != '\0' ? MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_TXT : MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_UNSET_TXT), - default_domain_name); -} - -/****************************************************************************/ - -struct { LONG Number; STRPTR Name;} hardware_types[] = -{ - { S2WireType_Ethernet, "Ethernet" }, - { S2WireType_IEEE802, "IEEE 802" }, - { S2WireType_Arcnet, "Arcnet" }, - { S2WireType_LocalTalk, "LocalTalk" }, - { S2WireType_DyLAN, "DyLAN" }, - { S2WireType_AmokNet, "AmokNet" }, - { S2WireType_Liana, "Liana" }, - { S2WireType_PPP, "PPP" }, - { S2WireType_SLIP, "SLIP" }, - { S2WireType_CSLIP, "CSLIP" }, - { S2WireType_PLIP, "PLIP" } -}; - -/****************************************************************************/ - -STATIC VOID -print_interface_list(struct CommandContext * cc,struct List * interface_list) -{ - UBYTE type_buffer[80]; - STRPTR type; - struct Node * node; - struct sockaddr_in sin; - LONG mtu; - LONG hardware_type; - ULONG sent; - ULONG received; - ULONG bad; - ULONG overrun; - ULONG unknown; - LONG state; - LONG i; - STRPTR addr; - LONG n = 0; - - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - for(node = interface_list->lh_Head ; - node->ln_Succ != NULL ; - node = node->ln_Succ) - { - memset(&sin,0,sizeof(sin)); - mtu = hardware_type = received = sent = bad = overrun = unknown = state = 0; - - if(Local_QueryInterfaceTags(cc,node->ln_Name, - IFQ_MTU, &mtu, - IFQ_HardwareType, &hardware_type, - IFQ_PacketsReceived, &received, - IFQ_PacketsSent, &sent, - IFQ_BadData, &bad, - IFQ_Overruns, &overrun, - IFQ_UnknownTypes, &unknown, - IFQ_Address, &sin, - IFQ_State, &state, - TAG_DONE) != 0) - { - continue; - } - - type = NULL; - for(i = 0 ; i < (LONG)NUM_ENTRIES(hardware_types) ; i++) - { - if(hardware_types[i].Number == hardware_type) - { - type = hardware_types[i].Name; - break; - } - } - - if(type == NULL) - lsprintf(cc,type = type_buffer,get_str(cc,MSG_SHOWNETSTATUS_UNKNOWN_HARDWARE_TYPE_TXT),hardware_type); - - if(sin.sin_addr.s_addr != INADDR_ANY) - addr = routename(cc,sin.sin_addr.s_addr,cc->cc_Line1,MAXHOSTNAMELEN); - else - addr = "-"; - - if(n++ == 0) - { - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_TITLE_TXT), - begin_underline(cc), - get_str(cc,MSG_SHOWNETSTATUS_NAME_TXT), - get_str(cc,MSG_SHOWNETSTATUS_MTU_TXT), - get_str(cc,MSG_SHOWNETSTATUS_TYPE_TXT), - get_str(cc,MSG_SHOWNETSTATUS_ADDRESS_TXT), - get_str(cc,MSG_SHOWNETSTATUS_RECEIVED_TXT), - get_str(cc,MSG_SHOWNETSTATUS_SENT_TXT), - get_str(cc,MSG_SHOWNETSTATUS_DROPPED_TXT), - get_str(cc,MSG_SHOWNETSTATUS_OVERRUNS_TXT), - get_str(cc,MSG_SHOWNETSTATUS_UNKNOWN_TXT), - get_str(cc,MSG_SHOWNETSTATUS_STATUS_TXT), - end_underline(cc)); - } - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_LINE_TXT), - node->ln_Name,mtu,type,addr,received,sent,bad,overrun,unknown,get_str(cc,(state == SM_Up) ? MSG_SHOWNETSTATUS_UP_TXT : MSG_SHOWNETSTATUS_DOWN_TXT)); - } - - if(n == 0) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NO_INTERFACES_AVAILABLE_TXT)); -} - -STATIC BOOL -print_interface_info(struct CommandContext * cc,STRPTR name) -{ - DECLARE_DOSBASE(cc); - DECLARE_SOCKETBASE(cc); - - struct SANA2CopyStats s2cs; - UBYTE type_buffer[80]; - STRPTR type; - struct sockaddr_in sin; - struct sockaddr_in sin_peer; - struct sockaddr_in sin_mask; - LONG bps; - UBYTE hardware_address[16]; - LONG hardware_address_size; - STRPTR device_name; - LONG device_unit; - LONG mtu; - LONG hardware_type; - ULONG sent; - ULONG received; - ULONG bad; - ULONG overrun; - ULONG unknown; - LONG bind_type; - struct DateStamp lease_expire; - LONG num_read_requests; - LONG max_read_requests; - LONG num_pending_read_requests; - LONG num_write_requests; - LONG max_write_requests; - LONG num_pending_write_requests; - LONG state; - LONG i; - SBQUAD_T bytes_in; - SBQUAD_T bytes_out; - UBYTE byte_count[80]; - BOOL success; - BOOL have_peer_address; - LONG input_dropped = 0; - LONG output_dropped = 0; - - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - memset(&sin,0,sizeof(sin)); - memset(&sin_peer,0,sizeof(sin_peer)); - memset(&sin_mask,0,sizeof(sin_mask)); - memset(hardware_address,0,sizeof(hardware_address)); - device_name = NULL; - device_unit = 0; - hardware_address_size = mtu = bps = hardware_type = received = sent = bad = overrun = unknown = state = 0; - bind_type = IFABT_Unknown; - memset(&lease_expire,0,sizeof(lease_expire)); - memset(&s2cs,0,sizeof(s2cs)); - - if(Local_QueryInterfaceTags(cc,name, - IFQ_DeviceName, &device_name, - IFQ_DeviceUnit, &device_unit, - IFQ_HardwareAddressSize, &hardware_address_size, - IFQ_HardwareAddress, hardware_address, - IFQ_MTU, &mtu, - IFQ_BPS, &bps, - IFQ_HardwareType, &hardware_type, - IFQ_PacketsReceived, &received, - IFQ_PacketsSent, &sent, - IFQ_BadData, &bad, - IFQ_Overruns, &overrun, - IFQ_UnknownTypes, &unknown, - IFQ_Address, &sin, - IFQ_NetMask, &sin_mask, - IFQ_State, &state, - IFQ_AddressBindType, &bind_type, - IFQ_AddressLeaseExpires, &lease_expire, - IFQ_NumReadRequests, &num_read_requests, - IFQ_MaxReadRequests, &max_read_requests, - IFQ_NumReadRequestsPending, &num_pending_read_requests, - IFQ_NumWriteRequests, &num_write_requests, - IFQ_MaxWriteRequests, &max_write_requests, - IFQ_NumWriteRequestsPending, &num_pending_write_requests, - IFQ_GetBytesIn, &bytes_in, - IFQ_GetBytesOut, &bytes_out, - IFQ_GetSANA2CopyStats, &s2cs, - IFQ_InputDrops, &input_dropped, - IFQ_OutputDrops, &output_dropped, - TAG_DONE) != 0) - { - success = FALSE; - goto out; - } - - if(hardware_address_size > (LONG)sizeof(hardware_address) * 8) - hardware_address_size = sizeof(hardware_address) * 8; - - if(Local_QueryInterfaceTags(cc,name, - IFQ_DestinationAddress,&sin_peer, - TAG_DONE) == 0) - { - have_peer_address = TRUE; - } - else - { - have_peer_address = FALSE; - } - - type = NULL; - for(i = 0 ; i < (LONG)NUM_ENTRIES(hardware_types) ; i++) - { - if(hardware_types[i].Number == hardware_type) - { - type = hardware_types[i].Name; - break; - } - } - - if(type == NULL) - lsprintf(cc,type = type_buffer,get_str(cc,MSG_SHOWNETSTATUS_UNKNOWN_HARDWARE_TYPE_TXT),hardware_type); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_TITLE_TXT), - begin_underline(cc), - name, - end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_NAME_TXT),device_name); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_UNIT_TXT),device_unit); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_ADDRESS_TXT)); - - if(hardware_address_size == 32) - { - lprintf(cc,"%s",Inet_NtoA(sin.sin_addr.s_addr)); - } - else - { - for(i = 0 ; i < hardware_address_size/8 ; i++) - { - if(i != 0) - lprintf(cc,":"); - - lprintf(cc,"%02lx",hardware_address[i]); - } - } - - lprintf(cc,"\n"); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_MTU_TXT),mtu); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSMISSION_SPEED_TXT),bps); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_TYPE_TXT),type); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_SENT_TXT),sent); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_RECEIVED_TXT),received); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_DROPPED_TXT),bad,input_dropped,output_dropped); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_BUFFER_OVERRUNS_TXT),overrun); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_UNKNOWN_PACKETS_TXT),unknown); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_TXT),(sin.sin_addr.s_addr != INADDR_ANY) ? routename(cc,sin.sin_addr.s_addr,cc->cc_Line1,MAXHOSTNAMELEN) : get_str(cc,MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT)); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_NETWORK_MASK_TXT),(sin_mask.sin_addr.s_addr != INADDR_ANY) ? Inet_NtoA(sin_mask.sin_addr.s_addr) : get_str(cc,MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT)); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_READ_REQUESTS_TXT),num_read_requests,max_read_requests,num_pending_read_requests); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_WRITE_REQUESTS_TXT),num_write_requests,max_write_requests,num_pending_write_requests); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_RECEIVED_TXT),convert_quad_to_string(cc->cc_Locale,&bytes_in,byte_count,sizeof(byte_count))); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_SENT_TXT),convert_quad_to_string(cc->cc_Locale,&bytes_out,byte_count,sizeof(byte_count))); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSFER_STATISTICS_TXT),s2cs.s2cs_DMAIn,s2cs.s2cs_DMAOut,s2cs.s2cs_ByteIn,s2cs.s2cs_ByteOut,s2cs.s2cs_WordOut); - - if(bind_type == IFABT_Static || bind_type == IFABT_Dynamic) - { - LONG id = (bind_type == IFABT_Static) ? MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_STATIC_TXT : MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_DYNAMIC_TXT; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_BINDING_TXT),get_str(cc,id)); - - if(bind_type == IFABT_Dynamic) - { - UBYTE buffer[2*LEN_DATSTRING+3]; - STRPTR str; - - if(lease_expire.ds_Days == 0 && - lease_expire.ds_Minute == 0 && - lease_expire.ds_Tick == 0) - { - str = get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_NEVER_EXPIRES_TXT); - } - else - { - struct DateTime dat; - UBYTE date[LEN_DATSTRING+1]; - UBYTE time[LEN_DATSTRING+1]; - - memset(&dat,0,sizeof(dat)); - - dat.dat_Stamp = lease_expire; - dat.dat_Format = FORMAT_DEF; - dat.dat_StrDate = date; - dat.dat_StrTime = time; - - DateToStr(&dat); - - strip_extra_blank_spaces(date); - strip_extra_blank_spaces(time); - - strcpy(buffer,date); - strcat(buffer," "); - strcat(buffer,time); - - str = buffer; - } - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_EXPIRES_TXT),str); - } - } - - if(have_peer_address) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_PEER_ADDRESS_TXT),(sin_peer.sin_addr.s_addr != INADDR_ANY) ? routename(cc,sin_peer.sin_addr.s_addr,cc->cc_Line1,MAXHOSTNAMELEN) : get_str(cc,MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_INTERFACE_INFO_STATUS_TXT),get_str(cc,(state == SM_Up) ? MSG_SHOWNETSTATUS_UP_TXT : MSG_SHOWNETSTATUS_DOWN_TXT)); - - success = TRUE; - - out: - - return(success); -} - -/****************************************************************************/ - -STATIC VOID -print_icmp_status(struct CommandContext * cc,struct icmpstat *icps) -{ - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_TITLE_TXT),begin_underline(cc),end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ERRORS_GENERATED_TXT),icps->icps_error); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_IP_PACKETS_TOO_SHORT_TXT),icps->icps_oldshort); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_PACKETS_NOT_RESPONDED_TO_TXT),icps->icps_oldicmp); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ECHO_REPLY_PACKETS_SENT_TXT),icps->icps_outhist[ICMP_ECHOREPLY]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_TXT),icps->icps_outhist[ICMP_UNREACH]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_TXT),icps->icps_outhist[ICMP_SOURCEQUENCH]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_REDIRECT_TXT),icps->icps_outhist[ICMP_REDIRECT]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ECHO_TXT),icps->icps_outhist[ICMP_ECHO]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_TXT),icps->icps_outhist[ICMP_ROUTERADVERT]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_TXT),icps->icps_outhist[ICMP_ROUTERSOLICIT]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_TXT),icps->icps_outhist[ICMP_TIMXCEED]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_TXT),icps->icps_outhist[ICMP_PARAMPROB]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_TXT),icps->icps_outhist[ICMP_TSTAMP]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_TXT),icps->icps_outhist[ICMP_TSTAMPREPLY]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_TXT),icps->icps_outhist[ICMP_IREQ]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_TXT),icps->icps_outhist[ICMP_IREQREPLY]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_TXT),icps->icps_outhist[ICMP_MASKREQ]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_TXT),icps->icps_outhist[ICMP_MASKREPLY]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_OUT_OF_RANGE_TXT),icps->icps_badcode); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKETS_TOO_SHORT_TXT),icps->icps_tooshort); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKET_CHECKSUM_ERRORS_TXT),icps->icps_checksum); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_BOUND_MISMATCH_TXT),icps->icps_badlen); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_RESPONSES_SENT_TXT),icps->icps_reflect); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ECHO_REPLIES_RECEIVED_TXT),icps->icps_inhist[ICMP_ECHOREPLY]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_RECEIVED_TXT),icps->icps_inhist[ICMP_UNREACH]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_RECEIVED_TXT),icps->icps_inhist[ICMP_SOURCEQUENCH]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_REDIRECT_RECEIVED_TXT),icps->icps_inhist[ICMP_REDIRECT]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ECHO_RECEIVED_TXT),icps->icps_inhist[ICMP_ECHO]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_RECEIVED_TXT),icps->icps_inhist[ICMP_ROUTERADVERT]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_RECEIVED_TXT),icps->icps_inhist[ICMP_ROUTERSOLICIT]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_RECEIVED_TXT),icps->icps_inhist[ICMP_TIMXCEED]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_RECEIVED_TXT),icps->icps_inhist[ICMP_PARAMPROB]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_RECEIVED_TXT),icps->icps_inhist[ICMP_TSTAMP]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_RECEIVED_TXT),icps->icps_inhist[ICMP_TSTAMPREPLY]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_RECEIVED_TXT),icps->icps_inhist[ICMP_IREQ]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_RECEIVED_TXT),icps->icps_inhist[ICMP_IREQREPLY]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_RECEIVED_TXT),icps->icps_inhist[ICMP_MASKREQ]); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_RECEIVED_TXT),icps->icps_inhist[ICMP_MASKREPLY]); -} - -STATIC VOID -print_igmp_status(struct CommandContext * cc,struct igmpstat *igps) -{ - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_TITLE_TXT),begin_underline(cc),end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_TOTAL_MESSAGES_RECEIVED_TXT),igps->igps_rcv_total); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_TOO_SHORT_TXT),igps->igps_rcv_tooshort); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_BAD_CHECKSUM_TXT),igps->igps_rcv_badsum); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_QUERIES_RECEIVED_TXT),igps->igps_rcv_queries); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_INVALID_QUERIES_RECEIVED_TXT),igps->igps_rcv_badqueries); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_TXT),igps->igps_rcv_reports); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_INVALID_REPORTS_RECEIVED_TXT),igps->igps_rcv_badreports); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_FOR_THIS_GROUP_TXT),igps->igps_rcv_ourreports); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_SENT_TXT),igps->igps_snd_reports); -} - -STATIC VOID -print_ip_status(struct CommandContext * cc,struct ipstat *ips) -{ - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_TITLE_TXT),begin_underline(cc),end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_TOTAL_PACKETS_RECEIVED_TXT),ips->ips_total); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_WITH_CHECKSUM_ERRORS_TXT),ips->ips_badsum); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SHORT_TXT),ips->ips_tooshort); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SMALL_TXT),ips->ips_toosmall); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_DATA_SIZE_TXT),ips->ips_badhlen); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_HEADER_SIZE_TXT),ips->ips_badlen); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_FRAGMENTS_RECEIVED_TXT),ips->ips_fragments); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_FRAGMENTS_DROPPED_TXT),ips->ips_fragdropped); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_FRAGMENTS_TIMED_OUT_TXT),ips->ips_fragtimeout); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_TXT),ips->ips_forward); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FORWARD_TXT),ips->ips_cantforward); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_ON_SAME_NETWORK_TXT),ips->ips_redirectsent); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_WITH_UNKNOWN_PROTOCOLS_TXT),ips->ips_noproto); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_DATAGRAMS_DELIVERED_TXT),ips->ips_delivered); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_GENERATED_TXT),ips->ips_localout); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_LOST_TXT),ips->ips_odropped); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_REASSEMBLED_TXT),ips->ips_reassembled); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_FRAGMENTED_TXT),ips->ips_fragmented); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_OUTPUT_FRAGMENTS_CREATED_TXT),ips->ips_ofragments); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FRAGMENT_TXT),ips->ips_cantfrag); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_ERRORS_IN_OPTION_PROCESSING_TXT),ips->ips_badoptions); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_NO_ROUTE_TXT),ips->ips_noroute); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_IP_VERSION_TXT),ips->ips_badvers); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_IP_RAW_PACKETS_SENT_TXT),ips->ips_rawout); -} - -STATIC VOID -print_mb_status(struct CommandContext * cc,struct mbstat *m) -{ - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MBUF_TITLE_TXT),begin_underline(cc),end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MBUF_BUFFERS_FROM_PAGE_POOL_TXT),m->m_mbufs); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MBUF_CLUSTERS_FROM_PAGE_POOL_TXT),m->m_clusters); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MBUF_FREE_CLUSTERS_TXT),m->m_clfree); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MBUF_DROPS_TXT),m->m_drops); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MBUF_WAIT_TXT),m->m_wait); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MBUF_DRAIN_TXT),m->m_drain); -} - -STATIC VOID -print_mrt_status(struct CommandContext * cc,struct mrtstat *mrts) -{ - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_TITLE_TXT),begin_underline(cc),end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_ROUTE_LOOKUPS_TXT),mrts->mrts_mrt_lookups); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_ROUTE_CACHE_MISSES_TXT),mrts->mrts_mrt_misses); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_LOOKUPS_TXT),mrts->mrts_grp_lookups); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_CACHE_MISSES_TXT),mrts->mrts_grp_misses); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_NO_ROUTE_TXT),mrts->mrts_no_route); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_BAD_TUNNEL_TXT),mrts->mrts_bad_tunnel); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_CANNOT_TUNNEL_TXT),mrts->mrts_cant_tunnel); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_MULTICAST_CANNOT_WRONG_INTERFACE_TXT),mrts->mrts_wrong_if); -} - -STATIC VOID -print_rt_status(struct CommandContext * cc,struct rtstat *rts) -{ - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ROUTING_TITLE_TXT),begin_underline(cc),end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ROUTING_BAD_REDIRECT_TXT),rts->rts_badredirect); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ROUTING_DYNAMIC_TXT),rts->rts_dynamic); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ROUTING_NEW_GATEWAY_TXT),rts->rts_newgateway); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ROUTING_UNREACH_TXT),rts->rts_unreach); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_ROUTING_WILDCARD_TXT),rts->rts_wildcard); -} - -STATIC VOID -print_tcp_status(struct CommandContext * cc,struct tcpstat *tcps) -{ - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_TITLE_TXT),begin_underline(cc),end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_CONNATTEMPT_TXT),tcps->tcps_connattempt); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_ACCEPTS_TXT),tcps->tcps_accepts); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_CONNECTS_TXT),tcps->tcps_connects); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_DROPS_TXT),tcps->tcps_drops); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_CONNDROPS_TXT),tcps->tcps_conndrops); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_CLOSED_TXT),tcps->tcps_closed); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SEGSTIMED_TXT),tcps->tcps_segstimed); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RTTUPDATED_TXT),tcps->tcps_rttupdated); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_DELACK_TXT),tcps->tcps_delack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_TIMEOUTDROP_TXT),tcps->tcps_timeoutdrop); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_PERSISTTIMEO_TXT),tcps->tcps_persisttimeo); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_KEEPTIMEO_TXT),tcps->tcps_keeptimeo); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_KEEPPROBE_TXT),tcps->tcps_keepprobe); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_KEEPDROPS_TXT),tcps->tcps_keepdrops); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDTOTAL_TXT),tcps->tcps_sndtotal); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDPACK_TXT),tcps->tcps_sndpack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDBYTE_TXT),tcps->tcps_sndbyte); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDREXMITPACK_TXT),tcps->tcps_sndrexmitpack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDREXMITBYTE_TXT),tcps->tcps_sndrexmitbyte); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDACKS_TXT),tcps->tcps_sndacks); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDPROBE_TXT),tcps->tcps_sndprobe); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDURG_TXT),tcps->tcps_sndurg); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDWINUP_TXT),tcps->tcps_sndwinup); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SNDCTRL_TXT),tcps->tcps_sndctrl); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVTOTAL_TXT),tcps->tcps_rcvtotal); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVPACK_TXT),tcps->tcps_rcvpack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVBYTE_TXT),tcps->tcps_rcvbyte); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVBADSUM_TXT),tcps->tcps_rcvbadsum); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVBADOFF_TXT),tcps->tcps_rcvbadoff); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVSHORT_TXT),tcps->tcps_rcvshort); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVDUPPACK_TXT),tcps->tcps_rcvduppack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVDUPBYTE_TXT),tcps->tcps_rcvdupbyte); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVOOPACK_TXT),tcps->tcps_rcvoopack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVOOBYTE_TXT),tcps->tcps_rcvoobyte); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVPACKAFTERWIN_TXT),tcps->tcps_rcvpackafterwin); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVBYTEAFTERWIN_TXT),tcps->tcps_rcvbyteafterwin); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVAFTERCLOSE_TXT),tcps->tcps_rcvafterclose); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVWINPROBE_TXT),tcps->tcps_rcvwinprobe); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVDUPACK_TXT),tcps->tcps_rcvdupack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVACKTOOMUCH_TXT),tcps->tcps_rcvacktoomuch); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVACKPACK_TXT),tcps->tcps_rcvackpack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVACKBYTE_TXT),tcps->tcps_rcvackbyte); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_RCVWINUPD_TXT),tcps->tcps_rcvwinupd); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_PAWSDROP_TXT),tcps->tcps_pawsdrop); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_PREDACK_TXT),tcps->tcps_predack); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_PREDDAT_TXT),tcps->tcps_preddat); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_PERSISTDROP_TXT),tcps->tcps_persistdrop); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_BADSYN_TXT),tcps->tcps_badsyn); -} - -STATIC VOID -print_udp_status(struct CommandContext * cc,struct udpstat *udps) -{ - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_TITLE_TXT),begin_underline(cc),end_underline(cc)); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_IPACKETS_TXT),udps->udps_ipackets); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_HDROPS_TXT),udps->udps_hdrops); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_BADSUM_TXT),udps->udps_badsum); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_BADLEN_TXT),udps->udps_badlen); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_NOPORT_TXT),udps->udps_noport); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_NOPORTBCAST_TXT),udps->udps_noportbcast); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_FULLSOCK_TXT),udps->udps_fullsock); - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_OPACKETS_TXT),udps->udps_opackets); -} - -STATIC VOID -print_tcp_socket_status(struct CommandContext * cc,BOOL all_sockets,struct protocol_connection_data *pcd,LONG size) -{ - DECLARE_SOCKETBASE(cc); - - struct servent * s; - STRPTR status; - LONG i,m,n; - - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - if(size >= (int)sizeof(*pcd)) - { - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SOCKET_TITLE_TXT), - begin_underline(cc), - get_str(cc,MSG_SHOWNETSTATUS_LOCAL_TXT), - get_str(cc,MSG_SHOWNETSTATUS_REMOTE_TXT), - get_str(cc,MSG_SHOWNETSTATUS_RECEIVE_LEN_TXT), - get_str(cc,MSG_SHOWNETSTATUS_SEND_LEN_TXT), - get_str(cc,MSG_SHOWNETSTATUS_STATUS_TXT), - end_underline(cc)); - } - - for(i = m = n = 0 ; i < size / (int)sizeof(*pcd) ; i++, pcd++, n++) - { - if(pcd->pcd_local_address.s_addr == INADDR_ANY && NOT all_sockets) - { - m++; - continue; - } - - if(pcd->pcd_local_address.s_addr != INADDR_ANY || cc->cc_NoNames) - routename(cc,pcd->pcd_local_address.s_addr,cc->cc_Line1,MAXHOSTNAMELEN); - else - strcpy(cc->cc_Line1,get_str(cc,MSG_SHOWNETSTATUS_WILDCARD_TXT)); - - if(cc->cc_NoNames) - s = NULL; - else - s = getservbyport(pcd->pcd_local_port,"tcp"); - - if(s != NULL) - lsprintf(cc,&cc->cc_Line1[strlen(cc->cc_Line1)],":%s",s->s_name); - else - lsprintf(cc,&cc->cc_Line1[strlen(cc->cc_Line1)],":%ld",pcd->pcd_local_port); - - routename(cc,pcd->pcd_foreign_address.s_addr,cc->cc_Line2,MAXHOSTNAMELEN); - - if(pcd->pcd_foreign_address.s_addr != INADDR_ANY) - { - if(cc->cc_NoNames) - s = NULL; - else - s = getservbyport(pcd->pcd_foreign_port,"tcp"); - - if(s != NULL) - lsprintf(cc,&cc->cc_Line2[strlen(cc->cc_Line2)],":%s",s->s_name); - else - lsprintf(cc,&cc->cc_Line2[strlen(cc->cc_Line2)],":%ld",pcd->pcd_foreign_port); - } - else - { - strcpy(cc->cc_Line2,"-"); - } - - if(TCPS_CLOSED <= pcd->pcd_tcp_state && pcd->pcd_tcp_state <= TCPS_TIME_WAIT) - status = get_str(cc,MSG_SHOWNETSTATUS_TCP_FSM_STATE1_TXT + pcd->pcd_tcp_state - TCPS_CLOSED); - else - status = "-"; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_TCP_SOCKET_LINE_TXT),cc->cc_Line1,cc->cc_Line2,pcd->pcd_receive_queue_size,pcd->pcd_send_queue_size,status); - } - - if(n == 0) - { - if(m == 0) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NO_TCP_SOCKETS_IN_USE_TXT)); - else - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_SOME_TCP_SOCKETS_IN_USE_TXT),m); - } -} - -STATIC VOID -print_udp_socket_status(struct CommandContext * cc,BOOL all_sockets,struct protocol_connection_data *pcd,LONG size) -{ - DECLARE_SOCKETBASE(cc); - - struct servent * s; - LONG i,m,n; - - if(cc->cc_Something) - lprintf(cc,"\n"); - else - cc->cc_Something = TRUE; - - if(size >= (int)sizeof(*pcd)) - { - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_SOCKET_TITLE_TXT), - begin_underline(cc), - get_str(cc,MSG_SHOWNETSTATUS_LOCAL_TXT), - get_str(cc,MSG_SHOWNETSTATUS_REMOTE_TXT), - get_str(cc,MSG_SHOWNETSTATUS_RECEIVE_LEN_TXT), - get_str(cc,MSG_SHOWNETSTATUS_SEND_LEN_TXT), - end_underline(cc)); - } - - for(i = m = n = 0 ; i < size / (int)sizeof(*pcd) ; i++, pcd++, n++) - { - if(pcd->pcd_local_address.s_addr == INADDR_ANY && NOT all_sockets) - { - m++; - continue; - } - - if(pcd->pcd_local_address.s_addr != INADDR_ANY || cc->cc_NoNames) - routename(cc,pcd->pcd_local_address.s_addr,cc->cc_Line1,MAXHOSTNAMELEN); - else - strcpy(cc->cc_Line1,get_str(cc,MSG_SHOWNETSTATUS_WILDCARD_TXT)); - - if(cc->cc_NoNames) - s = NULL; - else - s = getservbyport(pcd->pcd_local_port,"udp"); - - if(s != NULL) - lsprintf(cc,&cc->cc_Line1[strlen(cc->cc_Line1)],":%s",s->s_name); - else - lsprintf(cc,&cc->cc_Line1[strlen(cc->cc_Line1)],":%ld",pcd->pcd_local_port); - - if(pcd->pcd_foreign_address.s_addr != INADDR_ANY) - { - routename(cc,pcd->pcd_foreign_address.s_addr,cc->cc_Line2,MAXHOSTNAMELEN); - - if(cc->cc_NoNames) - s = NULL; - else - s = getservbyport(pcd->pcd_foreign_port,"udp"); - - if(s != NULL) - lsprintf(cc,&cc->cc_Line2[strlen(cc->cc_Line2)],":%s",s->s_name); - else - lsprintf(cc,&cc->cc_Line2[strlen(cc->cc_Line2)],":%ld",pcd->pcd_foreign_port); - } - else - { - strcpy(cc->cc_Line2,"-"); - } - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_UDP_SOCKET_LINE_TXT),cc->cc_Line1,cc->cc_Line2,pcd->pcd_receive_queue_size,pcd->pcd_send_queue_size); - } - - if(n == 0) - { - if(m == 0) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NO_UDP_SOCKETS_IN_USE_TXT)); - else - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_SOME_UDP_SOCKETS_IN_USE_TXT),m); - } -} - -/****************************************************************************/ - -STATIC VOID -print_net_status_summary(struct CommandContext * cc) -{ - DECLARE_SOCKETBASE(cc); - - struct List * interface_list; - struct List * dns_list; - struct rt_msghdr * route_table; - struct sockaddr_in * default_route; - char * default_interface_name; - struct sockaddr_in default_interface_address; - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_STATUS_SUMMARY_TXT),begin_underline(cc),end_underline(cc)); - - default_interface_name = NULL; - memset(&default_interface_address,0,sizeof(default_interface_address)); - - interface_list = ObtainInterfaceList(); - if(interface_list != NULL && NOT IsListEmpty(interface_list)) - { - struct Node * node; - ULONG host_id; - - host_id = gethostid(); - - for(node = interface_list->lh_Head ; - node->ln_Succ != NULL ; - node = node->ln_Succ) - { - if(Local_QueryInterfaceTags(cc,node->ln_Name, - IFQ_Address,&default_interface_address, - TAG_DONE) != 0) - { - continue; - } - - if(default_interface_address.sin_addr.s_addr == host_id) - { - default_interface_name = node->ln_Name; - break; - } - } - } - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_TXT)); - - if(default_interface_name != NULL) - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_ON_INTERFACE_TXT),Inet_NtoA(default_interface_address.sin_addr.s_addr),default_interface_name); - else - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT)); - - lprintf(cc,"\n"); - - default_route = NULL; - - route_table = GetRouteInfo(AF_UNSPEC,0); - if(route_table != NULL) - { - struct sockaddr_in * sin; - struct rt_msghdr * rtm; - struct sockaddr * sa; - LONG len; - - for(rtm = route_table ; - rtm->rtm_msglen > 0 ; - rtm = (struct rt_msghdr *)(((ULONG)rtm) + rtm->rtm_msglen)) - { - /* We need a route with a destination and a gateway address. */ - if(rtm->rtm_version != 3 || (rtm->rtm_addrs & RTA_DST) == 0 || (rtm->rtm_addrs & RTA_GATEWAY) == 0) - continue; - - /* The destination address follows the message header. */ - sa = (struct sockaddr *)(rtm + 1); - - /* The destination should be an Internet address */ - if(sa->sa_family != AF_INET) - continue; - - /* The default route is identified by having a 0.0.0.0 destination - address, which indicates a route that matches any destination - address. */ - sin = (struct sockaddr_in *)sa; - if(sin->sin_addr.s_addr != INADDR_ANY) - continue; - - /* Skip the destination address. */ - if(sa->sa_len == 0) - len = sizeof(long); - else - len = sa->sa_len; - - sa = (struct sockaddr *)(((ULONG)sa) + len); - - /* This should be the IP address of the gateway. It should be - an Internet address. */ - if(sa->sa_family != AF_INET) - continue; - - default_route = (struct sockaddr_in *)sa; - break; - } - } - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_DEFAULT_GATEWAY_ADDRESS_TXT)); - - if(default_route != NULL) - lprintf(cc,"%s",Inet_NtoA(default_route->sin_addr.s_addr)); - else - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT)); - - lprintf(cc,"\n"); - - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_DOMAIN_NAME_SYSTEM_SERVERS_TXT)); - - dns_list = ObtainDomainNameServerList(); - if(dns_list != NULL && NOT IsListEmpty(dns_list)) - { - struct DomainNameServerNode * dnsn; - BOOL is_first = TRUE; - - for(dnsn = (struct DomainNameServerNode *)dns_list->lh_Head ; - dnsn->dnsn_MinNode.mln_Succ != NULL ; - dnsn = (struct DomainNameServerNode *)dnsn->dnsn_MinNode.mln_Succ) - { - if(NOT is_first) - lprintf(cc,", "); - - lprintf(cc,"%s",dnsn->dnsn_Address); - - is_first = FALSE; - } - } - else - { - lprintf(cc,get_str(cc,MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT)); - } - - lprintf(cc,"\n"); - - if(interface_list != NULL) - ReleaseInterfaceList(interface_list); - - if(dns_list != NULL) - ReleaseDomainNameServerList(dns_list); - - if(route_table != NULL) - FreeRouteInfo(route_table); -} - -/****************************************************************************/ - -STATIC LONG VARARGS68K -Local_ErrorPrintf(struct CommandContext * cc,STRPTR format,...) -{ - DECLARE_DOSBASE(cc); - DECLARE_SYSBASE(cc); - - va_list args; - LONG result; - BPTR fh; - - #if defined(__amigaos4__) - { - fh = ErrorOutput(); - } - #else - { - struct Process * this_process = (struct Process *)FindTask(NULL); - - fh = this_process->pr_CES; - } - #endif /* __amigaos4__ */ - - if(fh == ZERO) - fh = Output(); - - #if defined(__amigaos4__) - { - va_startlinear(args,format); - result = VFPrintf(fh,format,va_getlinearva(args,APTR)); - va_end(args); - } - #else - { - va_start(args,format); - result = VFPrintf(fh,format,args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -/****************************************************************************/ - -/* This looks up a locale string ID in the builtin database; adapted - from CygnusEd because I couldn't find my own implementation for this - application... */ -STATIC STRPTR -get_builtin_str(LONG id) -{ - LONG top,middle,bottom; - STRPTR builtin_string; - - /* The search area is all those message between bottom and top, inclusive. */ - bottom = 0; - top = NUM_ENTRIES(CatCompArray) - 1; - - /* Binary search through the CatCompArray to find the requested string. - Note that this assumes that the strings are sorted. Catcomp defaults - to creating sorted arrays, but it does _not_ force it. If in the .cd - file you specify out of order string numbers this routine will fail. */ - while(bottom != top) - { - middle = (bottom + top) / 2; - - if(CatCompArray[middle].cca_ID >= id) - top = middle; - else - bottom = middle + 1; - } - - /* The only time this error message should occur is if you've passed - a garbage number OR if the CatCompArray is not sorted. */ - if(CatCompArray[bottom].cca_ID == id) - builtin_string = (STRPTR)CatCompArray[bottom].cca_Str; - else - builtin_string = ""; - - return(builtin_string); -} - -STRPTR -get_str(struct CommandContext * cc, LONG id) -{ - STRPTR builtin_string; - STRPTR result; - - builtin_string = get_builtin_str(id); - - if(cc->cc_Catalog != NULL) - { - DECLARE_LOCALEBASE(cc); - - result = (STRPTR)GetCatalogStr(cc->cc_Catalog,id,builtin_string); - } - else - { - result = builtin_string; - } - - return(result); -} - -/****************************************************************************/ - -STATIC VARARGS68K LONG -Local_QueryInterfaceTags(struct CommandContext * cc,STRPTR interface_name,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,interface_name); - result = QueryInterfaceTagList(interface_name,va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,interface_name); - result = QueryInterfaceTagList(interface_name,(struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} - -STATIC VARARGS68K LONG -Local_SocketBaseTags(struct CommandContext * cc,...) -{ - DECLARE_SOCKETBASE(cc); - - va_list args; - LONG result; - - #if defined(__amigaos4__) - { - va_startlinear(args,cc); - result = SocketBaseTagList(va_getlinearva(args,struct TagItem *)); - va_end(args); - } - #else - { - va_start(args,cc); - result = SocketBaseTagList((struct TagItem *)args); - va_end(args); - } - #endif /* __amigaos4__ */ - - return(result); -} diff --git a/examples/ShowNetStatus_rev.h b/examples/ShowNetStatus_rev.h deleted file mode 100644 index 95ba218..0000000 --- a/examples/ShowNetStatus_rev.h +++ /dev/null @@ -1,6 +0,0 @@ -#define VERSION 4 -#define REVISION 28 -#define DATE "11.3.2009" -#define VERS "ShowNetStatus 4.28" -#define VSTRING "ShowNetStatus 4.28 (11.3.2009)\r\n" -#define VERSTAG "\0$VER: ShowNetStatus 4.28 (11.3.2009)" diff --git a/examples/assert.c b/examples/assert.c deleted file mode 100644 index 7f779b6..0000000 --- a/examples/assert.c +++ /dev/null @@ -1,392 +0,0 @@ -/* - * $Id: assert.c,v 1.1 2004-03-26 21:08:47 obarthel Exp $ - * - * :ts=8 - * - * Copyright © 2001-2003 by Olaf Barthel. All Rights Reserved. - */ - -/****************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include - -extern struct Library * SysBase; - -extern void kprintf(const char *,...); -extern void __stdargs kputc(char c); - -/****************************************************************************/ - -#include - -/****************************************************************************/ - -#define DEBUGLEVEL_OnlyAsserts 0 -#define DEBUGLEVEL_Reports 1 -#define DEBUGLEVEL_CallTracing 2 - -/****************************************************************************/ - -static int indent_level = 0; -static int debug_level = DEBUGLEVEL_CallTracing; - -static char program_name[40]; -static int program_name_len = 0; - -/****************************************************************************/ - -void -_SETPROGRAMNAME(char *name) -{ - if(name != NULL && name[0] != '\0') - { - program_name_len = strlen(name); - if(program_name_len >= sizeof(program_name)) - program_name_len = sizeof(program_name)-1; - - strncpy(program_name,name,program_name_len); - program_name[program_name_len] = '\0'; - } - else - { - program_name_len = 0; - } -} - -/****************************************************************************/ - -int -_SETDEBUGLEVEL(int level) -{ - int old_level = debug_level; - - debug_level = level; - - return(old_level); -} - -/****************************************************************************/ - -int -_GETDEBUGLEVEL(void) -{ - return(debug_level); -} - -/****************************************************************************/ - -static int previous_debug_level = -1; - -void -_PUSHDEBUGLEVEL(int level) -{ - previous_debug_level = _SETDEBUGLEVEL(level); -} - -void -_POPDEBUGLEVEL(void) -{ - if(previous_debug_level != -1) - { - _SETDEBUGLEVEL(previous_debug_level); - - previous_debug_level = -1; - } -} - -/****************************************************************************/ - -void -_INDENT(void) -{ - if(program_name_len > 0) - kprintf("(%s) ",program_name); - - if(debug_level >= DEBUGLEVEL_CallTracing) - { - int i; - - for(i = 0 ; i < indent_level ; i++) - kprintf(" "); - } -} - -/****************************************************************************/ - -void -_SHOWVALUE( - unsigned long value, - int size, - const char *name, - const char *file, - int line) -{ - if(debug_level >= DEBUGLEVEL_Reports) - { - char *fmt; - - switch(size) - { - case 1: - - fmt = "%s:%ld:%s = %ld, 0x%02lx"; - break; - - case 2: - - fmt = "%s:%ld:%s = %ld, 0x%04lx"; - break; - - default: - - fmt = "%s:%ld:%s = %ld, 0x%08lx"; - break; - } - - _INDENT(); - - kprintf(fmt,file,line,name,value,value); - - if(size == 1 && value < 256) - { - if(value < ' ' || (value >= 127 && value < 160)) - kprintf(", '\\x%02lx'",value); - else - kprintf(", '%lc'",value); - } - - kprintf("\n"); - } -} - -/****************************************************************************/ - -void -_SHOWPOINTER( - void *pointer, - const char *name, - const char *file, - int line) -{ - if(debug_level >= DEBUGLEVEL_Reports) - { - char *fmt; - - _INDENT(); - - if(pointer != NULL) - fmt = "%s:%ld:%s = 0x%08lx\n"; - else - fmt = "%s:%ld:%s = NULL\n"; - - kprintf(fmt,file,line,name,pointer); - } -} - -/****************************************************************************/ - -void -_SHOWSTRING( - const char *string, - const char *name, - const char *file, - int line) -{ - if(debug_level >= DEBUGLEVEL_Reports) - { - _INDENT(); - kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n",file,line,name,string,string); - } -} - -/****************************************************************************/ - -void -_SHOWMSG( - const char *string, - const char *file, - int line) -{ - if(debug_level >= DEBUGLEVEL_Reports) - { - _INDENT(); - kprintf("%s:%ld:%s\n",file,line,string); - } -} - -/****************************************************************************/ - -void -_DPRINTF_HEADER( - const char *file, - int line) -{ - if(debug_level >= DEBUGLEVEL_Reports) - { - _INDENT(); - kprintf("%s:%ld:",file,line); - } -} - -static void __asm -putch(register __d0 c) -{ - if(c != '\0') - kputc(c); -} - -void -_DPRINTF(const char *fmt,...) -{ - if(debug_level >= DEBUGLEVEL_Reports) - { - va_list args; - - va_start(args,fmt); - RawDoFmt((char *)fmt,args,(VOID (*)())putch,NULL); - va_end(args); - - kprintf("\n"); - } -} - -void -_DLOG(const char *fmt,...) -{ - if(debug_level >= DEBUGLEVEL_Reports) - { - va_list args; - - va_start(args,fmt); - RawDoFmt((char *)fmt,args,(VOID (*)())putch,NULL); - va_end(args); - } -} - -/****************************************************************************/ - -void -_ENTER( - const char *file, - int line, - const char *function) -{ - if(debug_level >= DEBUGLEVEL_CallTracing) - { - _INDENT(); - kprintf("%s:%ld:Entering %s\n",file,line,function); - } - - indent_level++; -} - -void -_LEAVE( - const char *file, - int line, - const char *function) -{ - indent_level--; - - if(debug_level >= DEBUGLEVEL_CallTracing) - { - _INDENT(); - kprintf("%s:%ld: Leaving %s\n",file,line,function); - } -} - -void -_RETURN( - const char *file, - int line, - const char *function, - unsigned long result) -{ - indent_level--; - - if(debug_level >= DEBUGLEVEL_CallTracing) - { - _INDENT(); - kprintf("%s:%ld: Leaving %s (result 0x%08lx, %ld)\n",file,line,function,result,result); - } -} - -/****************************************************************************/ - -void -_ASSERT( - int x, - const char *xs, - const char *file, - int line, - const char *function) -{ - #ifdef CONFIRM - { - STATIC BOOL ScrollMode = FALSE; - STATIC BOOL BatchMode = FALSE; - - if(BatchMode == FALSE) - { - if(x == 0) - { - kprintf("%s:%ld:Expression `%s' failed assertion in %s().\n", - file, - line, - xs, - function); - - if(ScrollMode == FALSE) - { - ULONG Signals; - - SetSignal(0,SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D | SIGBREAKF_CTRL_E); - - kprintf(" ^C to continue, ^D to enter scroll mode, ^E to enter batch mode\r"); - - Signals = Wait(SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D | SIGBREAKF_CTRL_E); - - if(Signals & SIGBREAKF_CTRL_D) - { - ScrollMode = TRUE; - - kprintf("Ok, entering scroll mode\033[K\n"); - } - else if (Signals & SIGBREAKF_CTRL_E) - { - BatchMode = TRUE; - - kprintf("Ok, entering batch mode\033[K\n"); - } - else - { - /* Continue */ - - kprintf("\033[K\r"); - } - } - } - } - } - #else - { - if(x == 0) - { - _INDENT(); - kprintf("%s:%ld:Expression `%s' failed assertion in %s().\n", - file, - line, - xs, - function); - } - } - #endif /* CONFIRM */ -} diff --git a/examples/assert.h b/examples/assert.h deleted file mode 100644 index 10dc792..0000000 --- a/examples/assert.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * $Id: assert.h,v 1.1 2004-03-26 21:08:47 obarthel Exp $ - * - * :ts=8 - * - * Copyright © 2001 by Olaf Barthel. All Rights Reserved. - */ - -/****************************************************************************/ - -/* IMPORTANT: If DEBUG is redefined, it must happen only here. This - * will cause all modules to depend upon it to be rebuilt - * by the smakefile (that is, provided the smakefile has - * all the necessary dependency lines in place). - */ - -/*#define DEBUG*/ - -/****************************************************************************/ - -#ifdef ASSERT -#undef ASSERT -#endif /* ASSERT */ - -#define PUSH_ASSERTS() PUSHDEBUGLEVEL(0) -#define PUSH_REPORTS() PUSHDEBUGLEVEL(1) -#define PUSH_CALLS() PUSHDEBUGLEVEL(2) -#define PUSH_ALL() PUSHDEBUGLEVEL(2) -#define POP() POPDEBUGLEVEL() - -#if defined(DEBUG) && defined(__SASC) - void _ASSERT(int x,const char *xs,const char *file,int line,const char *function); - void _SHOWVALUE(unsigned long value,int size,const char *name,const char *file,int line); - void _SHOWPOINTER(void *p,const char *name,const char *file,int line); - void _SHOWSTRING(const char *string,const char *name,const char *file,int line); - void _SHOWMSG(const char *msg,const char *file,int line); - void _ENTER(const char *file,int line,const char *function); - void _LEAVE(const char *file,int line,const char *function); - void _RETURN(const char *file,int line,const char *function,unsigned long result); - void _DPRINTF_HEADER(const char *file,int line); - void _DPRINTF(const char *format,...); - void _DLOG(const char *format,...); - int _SETDEBUGLEVEL(int level); - void _PUSHDEBUGLEVEL(int level); - void _POPDEBUGLEVEL(void); - int _GETDEBUGLEVEL(void); - void _SETPROGRAMNAME(char *name); - - #define ASSERT(x) _ASSERT((int)(x),#x,__FILE__,__LINE__,__FUNC__) - #define ENTER() _ENTER(__FILE__,__LINE__,__FUNC__) - #define LEAVE() _LEAVE(__FILE__,__LINE__,__FUNC__) - #define RETURN(r) _RETURN(__FILE__,__LINE__,__FUNC__,(unsigned long)r) - #define SHOWVALUE(v) _SHOWVALUE(v,sizeof(v),#v,__FILE__,__LINE__) - #define SHOWPOINTER(p) _SHOWPOINTER(p,#p,__FILE__,__LINE__) - #define SHOWSTRING(s) _SHOWSTRING(s,#s,__FILE__,__LINE__) - #define SHOWMSG(s) _SHOWMSG(s,__FILE__,__LINE__) - #define D(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DPRINTF s; } while(0) - #define PRINTHEADER() _DPRINTF_HEADER(__FILE__,__LINE__) - #define PRINTF(s) _DLOG s - #define LOG(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DLOG("<%s()>:",__FUNC__); _DLOG s; } while(0) - #define SETDEBUGLEVEL(l) _SETDEBUGLEVEL(l) - #define PUSHDEBUGLEVEL(l) _PUSHDEBUGLEVEL(l) - #define POPDEBUGLEVEL() _POPDEBUGLEVEL() - #define SETPROGRAMNAME(n) _SETPROGRAMNAME(n) - #define GETDEBUGLEVEL() _GETDEBUGLEVEL() - - #undef DEBUG - #define DEBUG 1 -#else - #define ASSERT(x) ((void)0) - #define ENTER() ((void)0) - #define LEAVE() ((void)0) - #define RETURN(r) ((void)0) - #define SHOWVALUE(v) ((void)0) - #define SHOWPOINTER(p) ((void)0) - #define SHOWSTRING(s) ((void)0) - #define SHOWMSG(s) ((void)0) - #define D(s) ((void)0) - #define PRINTHEADER() ((void)0) - #define PRINTF(s) ((void)0) - #define LOG(s) ((void)0) - #define SETDEBUGLEVEL(l) ((void)0) - #define PUSHDEBUGLEVEL(l) ((void)0) - #define POPDEBUGLEVEL() ((void)0) - #define SETPROGRAMNAME(n) ((void)0) - #define GETDEBUGLEVEL() (0) - - #ifdef DEBUG - #undef DEBUG - #endif /* DEBUG */ - - #define DEBUG 0 -#endif /* DEBUG */ - -/****************************************************************************/ diff --git a/examples/compiler.h b/examples/compiler.h deleted file mode 100644 index 1ff346a..0000000 --- a/examples/compiler.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * $Id: compiler.h,v 1.3 2007-08-26 12:30:26 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#ifndef _COMPILER_H -#define _COMPILER_H - -/****************************************************************************/ - -#ifndef EXEC_TYPES_H -#include -#endif /* EXEC_TYPES_H */ - -/****************************************************************************/ - -/* The following definitions are redundant in the V50 AmigaOS header files. */ -#ifndef AMIGA_COMPILER_H - -/****************************************************************************/ - -#if defined(__SASC) -#define ASM __asm -#define REG(r,p) register __##r p -#define INLINE __inline -#define INTERRUPT __interrupt -#define FAR __far -#define STDARGS __stdargs -#elif defined(__GNUC__) -#define ASM -#define REG(r,p) p __asm(#r) -#define INLINE __inline__ -#define INTERRUPT __attribute__((__interrupt__)) -#define FAR -#define STDARGS __attribute__((__stkparm__)) -#else -#define ASM -#define REG(x) -#define INLINE -#define INTERRUPT -#define FAR -#define STDARGS -#endif /* __SASC */ - -#define VARARGS68K - -/****************************************************************************/ - -#endif /* AMIGA_COMPILER_H */ - -/****************************************************************************/ - -#endif /* _COMPILER_H */ diff --git a/examples/macros.h b/examples/macros.h deleted file mode 100644 index 25a5f55..0000000 --- a/examples/macros.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * $Id: macros.h,v 1.6 2007-08-26 12:30:26 obarthel Exp $ - * - * :ts=4 - * - * Copyright © 2001-2007 by Olaf Barthel. All Rights Reserved. - */ - -#ifndef _MACROS_H -#define _MACROS_H - -/****************************************************************************/ - -#define OK (0) -#define SAME (0) -#define BUSY ((struct IORequest *)NULL) -#define CANNOT ! -#define NOT ! -#define NO ! - -/****************************************************************************/ - -#ifdef NULL -#undef NULL -#define NULL ((VOID *)0UL) -#endif /* NULL */ - -/****************************************************************************/ - -#ifndef ZERO -#define ZERO ((BPTR)NULL) -#endif /* ZERO */ - -/****************************************************************************/ - -#define UNIX_TIME_OFFSET 252460800UL - -/****************************************************************************/ - -#if !defined(_COMPILER_H) && !defined(AMIGA_COMPILER_H) -#include "compiler.h" -#endif /* !_COMPILER_H && !AMIGA_COMPILER_H */ - -/****************************************************************************/ - -#define FLAG_IS_SET(v,f) (((v) & (f)) == (f)) -#define FLAG_IS_CLEAR(v,f) (((v) & (f)) == 0 ) -#define SET_FLAG(v,f) ((VOID)((v) |= (f))) -#define CLEAR_FLAG(v,f) ((VOID)((v) &= ~((ULONG)(f)))) - -/****************************************************************************/ - -#define NUM_ENTRIES(t) (sizeof(t) / sizeof(t[0])) - -/****************************************************************************/ - -#define MILLION 1000000 - -/****************************************************************************/ - -#endif /* _MACROS_H */ diff --git a/examples/roadshow.h b/examples/roadshow.h deleted file mode 100644 index 19255e3..0000000 --- a/examples/roadshow.h +++ /dev/null @@ -1,1762 +0,0 @@ -#ifndef ROADSHOW_H -#define ROADSHOW_H - - -/****************************************************************************/ - - -/* This file was created automatically by CatComp. - * Do NOT edit by hand! - */ - - -#ifndef EXEC_TYPES_H -#include -#endif - -#ifdef CATCOMP_ARRAY -#undef CATCOMP_NUMBERS -#undef CATCOMP_STRINGS -#define CATCOMP_NUMBERS -#define CATCOMP_STRINGS -#endif - -#ifdef CATCOMP_BLOCK -#undef CATCOMP_STRINGS -#define CATCOMP_STRINGS -#endif - - -/****************************************************************************/ - - -#ifdef CATCOMP_NUMBERS - - -#ifdef ADDNETINTERFACE_CATALOG_STRINGS -#define MSG_ADDNETINTERFACE_NO_UTILITY_TXT 100 -#define MSG_ADDNETINTERFACE_NO_ICON_TXT 101 -#define MSG_ADDNETINTERFACE_TIMEOUT_TOO_SHORT_TXT 102 -#define MSG_ADDNETINTERFACE_CANNOT_OPEN_FILE_TXT 103 -#define MSG_ADDNETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT 104 -#define MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT 105 -#define MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT 106 -#define MSG_ADDNETINTERFACE_UNKNOWN_KEYWORD_TXT 107 -#define MSG_ADDNETINTERFACE_PARSE_ERROR_TXT 108 -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT 109 -#define MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT 110 -#define MSG_ADDNETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT 111 -#define MSG_ADDNETINTERFACE_INVALID_LEASE_PARAMETER_TXT 112 -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_INTERFACE_TXT 113 -#define MSG_ADDNETINTERFACE_NO_DEVICE_NAME_PROVIDED_TXT 114 -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_ERROR_CODE_TXT 115 -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_TXT 116 -#define MSG_ADDNETINTERFACE_INTERFACE_ADDED_TXT 117 -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT 118 -#define MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_ERROR_CODE_TXT 119 -#define MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_TXT 120 -#define MSG_ADDNETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT 121 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT 122 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ATTEMPT_TIMED_OUT_TXT 123 -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_TXT 124 -#define MSG_ADDNETINTERFACE_INTERFACE_WRONG_TYPE_TXT 125 -#define MSG_ADDNETINTERFACE_INTERFACE_ALREADY_CONFIGURED_TXT 126 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_VERSION_CONFLICT_TXT 127 -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_NO_MEMORY_TXT 128 -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_IN_USE_TXT 129 -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_CHANGE_FAILED_TXT 130 -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_MASK_CHANGE_FAILED_TXT 131 -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_UNKNOWN_ERROR_TXT 132 -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_INVALID_ADDRESS_TXT 133 -#define MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_ERROR_CODE_TXT 134 -#define MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT 135 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_TXT 136 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_ADDRESS_TXT 137 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_MASK_TXT 138 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_BROADCAST_ADDRESS_TXT 139 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_DESTINATION_ADDRESS_TXT 140 -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_METRIC_TXT 141 -#define MSG_ADDNETINTERFACE_DEFAULT_ROUTE_TXT 142 -#define MSG_ADDNETINTERFACE_ROUTE_TXT 143 -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_ERROR_CODE_TXT 144 -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_TXT 145 -#define MSG_ADDNETINTERFACE_DNS_TXT 146 -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_ERROR_CODE_TXT 147 -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_TXT 148 -#define MSG_ADDNETINTERFACE_ADDRESS_TXT 149 -#define MSG_ADDNETINTERFACE_LEASED_PERMANENTLY_TXT 150 -#define MSG_ADDNETINTERFACE_LEASED_UNTIL_TXT 151 -#define MSG_ADDNETINTERFACE_ERROR_MESSAGE_TITLE_TXT 152 -#define MSG_ADDNETINTERFACE_ERROR_MESSAGE_BUTTON_LABEL_TXT 153 -#define MSG_ADDNETINTERFACE_UNKNOWN_STATE_PARAMETER_TXT 154 -#define MSG_ADDNETINTERFACE_INVALID_IP_ADDRESS_AT_TXT 155 -#define MSG_ADDNETINTERFACE_ID_TOO_LONG_TXT 156 -#define MSG_ADDNETINTERFACE_ID_TOO_SHORT_TXT 157 -#define MSG_ADDNETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT 158 -#define MSG_ADDNETINTERFACE_INVALID_HARDWARE_ADDRESS_TXT 159 -#define MSG_ADDNETINTERFACE_MISSING_HARDWARE_ADDRESS_TXT 160 -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_FOR_HARDWARE_ADDRESS_TXT 161 -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_HARDWARE_ADDRESS_TXT 162 -#define MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_SHORT_TXT 163 -#define MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_LONG_TXT 164 -#define MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_BROADCAST_TXT 165 -#define MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_GROUP_TXT 166 -#define MSG_ADDNETINTERFACE_INTERFACE_HARDWARE_ADDRESS_SET_TO_TXT 167 -#define MSG_ADDNETINTERFACE_NO_INTERFACE_NAME_GIVEN_TXT 168 -#define MSG_ADDNETINTERFACE_INVALID_ADDRESS_TXT 169 -#define MSG_ADDNETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT 170 -#define MSG_ADDNETINTERFACE_ALIAS_TXT 171 -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_ERROR_CODE_TXT 172 -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_TXT 173 -#define MSG_ADDNETINTERFACE_DEFAULT_DOMAIN_NAME_TXT 174 -#define MSG_ADDNETINTERFACE_INTERFACE_IS_BUSY_TXT 175 -#endif /* ADDNETINTERFACE_CATALOG_STRINGS */ - -#ifdef ADDNETROUTE_CATALOG_STRINGS -#define MSG_ADDNETROUTE_NO_UTILITY_TXT 200 -#define MSG_ADDNETROUTE_CANNOT_OPEN_BSDSOCKET_TXT 201 -#define MSG_ADDNETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT 202 -#define MSG_ADDNETROUTE_NO_MEMORY_FOR_DEFAULT_GATEWAY_TXT 203 -#define MSG_ADDNETROUTE_DESTINATION_IGNORED_TXT 204 -#define MSG_ADDNETROUTE_HOSTDESTINATION_IGNORED_TXT 205 -#define MSG_ADDNETROUTE_NETDESTINATION_IGNORED_TXT 206 -#define MSG_ADDNETROUTE_GATEWAY_IGNORED_TXT 207 -#define MSG_ADDNETROUTE_GATEWAY_NEEDS_DESTINATION_TXT 208 -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_GATEWAY_TXT 209 -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TXT 210 -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_HOST_TXT 211 -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_NET_TXT 212 -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_TO_ADD_ROUTE_TXT 213 -#define MSG_ADDNETROUTE_COULD_NOT_ADD_ROUTE_TXT 214 -#define MSG_ADDNETROUTE_ROUTE_ADDED_TXT 215 -#define MSG_ADDNETROUTE_DEFAULT_GATEWAY_TXT 216 -#define MSG_ADDNETROUTE_DESTINATION_TXT 217 -#define MSG_ADDNETROUTE_DESTINATION_HOST_TXT 218 -#define MSG_ADDNETROUTE_DESTINATION_NET_TXT 219 -#define MSG_ADDNETROUTE_VIA_GATEWAY_TXT 220 -#endif /* ADDNETROUTE_CATALOG_STRINGS */ - -#ifdef CONFIGURENETINTERFACE_CATALOG_STRINGS -#define MSG_CONFIGURENETINTERFACE_NO_UTILITY_TXT 300 -#define MSG_CONFIGURENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT 301 -#define MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT 302 -#define MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT 303 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_ADDRESS_TXT 304 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MASK_TXT 305 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_DESTINATION_ADDRESS_TXT 306 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_BROADCAST_ADDRESS_TXT 307 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_METRIC_TXT 308 -#define MSG_CONFIGURENETINTERFACE_TIMEOUT_TOO_SHORT_TXT 309 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_ALIAS_ADDRESS_TXT 310 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_DELETE_ALIAS_ADDRESS_TXT 311 -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_CONFIGURE_PARAMETER_TXT 312 -#define MSG_CONFIGURENETINTERFACE_PICK_ONLY_ONE_STATE_TXT 313 -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT 314 -#define MSG_CONFIGURENETINTERFACE_INVALID_LEASE_PARAMETER_TXT 315 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_TXT 316 -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_MARK_INTERFACE_UP_TXT 317 -#define MSG_CONFIGURENETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT 318 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT 319 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_TIMED_OUT_TXT 320 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NAME_UNKNOWN_TXT 321 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_WRONG_TYPE_TXT 322 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ALREADY_CONFIGURED_TXT 323 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_COMPATIBLE_TXT 324 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_ENOUGH_MEMORY_TXT 325 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_IN_USE_TXT 326 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_NOT_CHANGED_TXT 327 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_MASK_NOT_CHANGED_TXT 328 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_UNKNOWN_ERROR_TXT 329 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_INVALID_TXT 330 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_ADDRESS_TXT 331 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_NETMASK_TXT 332 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_STATE_TXT 333 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT 334 -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT 335 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURED_TXT 336 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_IS_TXT 337 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_MASK_TXT 338 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_DESTINATION_ADDRESS_TXT 339 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_BROADCAST_ADDRESS_TXT 340 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_METRIC_TXT 341 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_ADD_ADDRESS_TXT 342 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_DELETE_ADDRESS_TXT 343 -#define MSG_CONFIGURENETINTERFACE_ADDED_DEFAULT_ROUTE_TXT 344 -#define MSG_CONFIGURENETINTERFACE_ADDED_ROUTE_TXT 345 -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_ROUTE_TO_TXT 346 -#define MSG_CONFIGURENETINTERFACE_ADDED_DNS_TXT 347 -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_DNS_TXT 348 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_TXT 349 -#define MSG_CONFIGURENETINTERFACE_LEASED_PERMANENTLY_TXT 350 -#define MSG_CONFIGURENETINTERFACE_LEASED_UNTIL_TXT 351 -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_SET_STATE_TXT 352 -#define MSG_CONFIGURENETINTERFACE_STATE_CHANGED_TXT 353 -#define MSG_CONFIGURENETINTERFACE_INVALID_IP_ADDRESS_AT_TXT 354 -#define MSG_CONFIGURENETINTERFACE_ID_TOO_LONG_TXT 355 -#define MSG_CONFIGURENETINTERFACE_ID_TOO_SHORT_TXT 356 -#define MSG_CONFIGURENETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT 357 -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_RELEASE_INTERFACE_ADDRESS_TXT 358 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_WAS_RELEASED_TXT 359 -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_DEBUG_PARAMETER_TXT 360 -#define MSG_CONFIGURENETINTERFACE_INVALID_ADDRESS_TXT 361 -#define MSG_CONFIGURENETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT 362 -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_COMPLETE_PARAMETER_TXT 363 -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MTU_TXT 364 -#define MSG_CONFIGURENETINTERFACE_DEFAULT_DOMAIN_NAME_TXT 365 -#define MSG_CONFIGURENETINTERFACE_INTERFACE_IS_BUSY_TXT 366 -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_UNICAST_PARAMETER_TXT 367 -#endif /* CONFIGURENETINTERFACE_CATALOG_STRINGS */ - -#ifdef DELETENETROUTE_CATALOG_STRINGS -#define MSG_DELETENETROUTE_NO_UTILITY_TXT 400 -#define MSG_DELETENETROUTE_CANNOT_OPEN_BSDSOCKET_TXT 401 -#define MSG_DELETENETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT 402 -#define MSG_DELETENETROUTE_NEED_EITHER_DESTINATION_OR_DEFAULT_TXT 403 -#define MSG_DELETENETROUTE_DESTINATION_IGNORED_TXT 404 -#define MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_GATEWAY_NOT_DELETED_TXT 405 -#define MSG_DELETENETROUTE_ROUTE_NOT_DELETED_TXT 406 -#define MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_DELETED_TXT 407 -#define MSG_DELETENETROUTE_ROUTE_DELETED_TXT 408 -#endif /* DELETENETROUTE_CATALOG_STRINGS */ - -#ifdef GETNETSTATUS_CATALOG_STRINGS -#define MSG_GETNETSTATUS_NO_UTILITY_TXT 500 -#define MSG_GETNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT 501 -#define MSG_GETNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT 502 -#define MSG_GETNETSTATUS_UNKNOWN_CONDITION_TXT 503 -#define MSG_GETNETSTATUS_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT 504 -#define MSG_GETNETSTATUS_NO_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT 505 -#define MSG_GETNETSTATUS_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT 506 -#define MSG_GETNETSTATUS_NO_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT 507 -#define MSG_GETNETSTATUS_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT 508 -#define MSG_GETNETSTATUS_NO_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT 509 -#define MSG_GETNETSTATUS_DNS_CONFIGURED_TXT 510 -#define MSG_GETNETSTATUS_NO_DNS_CONFIGURED_TXT 511 -#define MSG_GETNETSTATUS_ROUTE_CONFIGURED_TXT 512 -#define MSG_GETNETSTATUS_NO_ROUTE_CONFIGURED_TXT 513 -#define MSG_GETNETSTATUS_DEFAULT_ROUTE_CONFIGURED_TXT 514 -#define MSG_GETNETSTATUS_NO_DEFAULT_ROUTE_CONFIGURED_TXT 515 -#endif /* GETNETSTATUS_CATALOG_STRINGS */ - -#ifdef SHOWNETSTATUS_CATALOG_STRINGS -#define MSG_SHOWNETSTATUS_NO_UTILITY_TXT 600 -#define MSG_SHOWNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT 601 -#define MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT 602 -#define MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_ROUTE_API_TXT 603 -#define MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_INTERFACE_API_TXT 604 -#define MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_DNS_API_TXT 605 -#define MSG_SHOWNETSTATUS_CANNOT_GET_INFO_ON_INTERFACE_TXT 606 -#define MSG_SHOWNETSTATUS_CANNOT_GET_INTERFACE_LIST_TXT 607 -#define MSG_SHOWNETSTATUS_CANNOT_GET_DNS_LIST_TXT 608 -#define MSG_SHOWNETSTATUS_CANNOT_GET_ROUTE_TABLE_TXT 609 -#define MSG_SHOWNETSTATUS_NOT_ENOUGH_MEMORY_TO_QUERY_STATUS_TXT 610 -#define MSG_SHOWNETSTATUS_CANNOT_GET_STATUS_INFORMATION_FOR_TXT 611 -#define MSG_SHOWNETSTATUS_DEFAULT_TXT 612 -#define MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_ATTRIBUTES_TITLE_TXT 613 -#define MSG_SHOWNETSTATUS_DESTINATION_TXT 614 -#define MSG_SHOWNETSTATUS_GATEWAY_TXT 615 -#define MSG_SHOWNETSTATUS_ATTRIBUTES_TXT 616 -#define MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_LINE_TXT 617 -#define MSG_SHOWNETSTATUS_UP_TXT 618 -#define MSG_SHOWNETSTATUS_DOWN_TXT 619 -#define MSG_SHOWNETSTATUS_HOST_TXT 620 -#define MSG_SHOWNETSTATUS_NO_ROUTES_ARE_CONFIGURED_TXT 621 -#define MSG_SHOWNETSTATUS_ADDRESS_TYPE_TITLE_TXT 622 -#define MSG_SHOWNETSTATUS_ADDRESS_TXT 623 -#define MSG_SHOWNETSTATUS_TYPE_TXT 624 -#define MSG_SHOWNETSTATUS_ADDRESS_TYPE_LINE_TXT 625 -#define MSG_SHOWNETSTATUS_STATIC_TXT 626 -#define MSG_SHOWNETSTATUS_DYNAMIC_TXT 627 -#define MSG_SHOWNETSTATUS_NO_DNS_CONFIGURED_TXT 628 -#define MSG_SHOWNETSTATUS_UNKNOWN_HARDWARE_TYPE_TXT 629 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_TITLE_TXT 630 -#define MSG_SHOWNETSTATUS_NAME_TXT 631 -#define MSG_SHOWNETSTATUS_MTU_TXT 632 -#define MSG_SHOWNETSTATUS_RECEIVED_TXT 633 -#define MSG_SHOWNETSTATUS_SENT_TXT 634 -#define MSG_SHOWNETSTATUS_DROPPED_TXT 635 -#define MSG_SHOWNETSTATUS_OVERRUNS_TXT 636 -#define MSG_SHOWNETSTATUS_UNKNOWN_TXT 637 -#define MSG_SHOWNETSTATUS_STATUS_TXT 638 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_LINE_TXT 639 -#define MSG_SHOWNETSTATUS_NO_INTERFACES_AVAILABLE_TXT 640 -#define MSG_SHOWNETSTATUS_INTERFACE_TITLE_TXT 641 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_NAME_TXT 642 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_UNIT_TXT 643 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_ADDRESS_TXT 644 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_MTU_TXT 645 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSMISSION_SPEED_TXT 646 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_TYPE_TXT 647 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_SENT_TXT 648 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_RECEIVED_TXT 649 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_DROPPED_TXT 650 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_BUFFER_OVERRUNS_TXT 651 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_UNKNOWN_PACKETS_TXT 652 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_TXT 653 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NETWORK_MASK_TXT 654 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_PEER_ADDRESS_TXT 655 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_STATUS_TXT 656 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_BINDING_TXT 657 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_EXPIRES_TXT 658 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_STATIC_TXT 659 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_DYNAMIC_TXT 660 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_NEVER_EXPIRES_TXT 661 -#define MSG_SHOWNETSTATUS_ICMP_TITLE_TXT 662 -#define MSG_SHOWNETSTATUS_ICMP_ERRORS_GENERATED_TXT 663 -#define MSG_SHOWNETSTATUS_ICMP_IP_PACKETS_TOO_SHORT_TXT 664 -#define MSG_SHOWNETSTATUS_ICMP_PACKETS_NOT_RESPONDED_TO_TXT 665 -#define MSG_SHOWNETSTATUS_ICMP_ECHO_REPLY_PACKETS_SENT_TXT 666 -#define MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_TXT 667 -#define MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_TXT 668 -#define MSG_SHOWNETSTATUS_ICMP_REDIRECT_TXT 669 -#define MSG_SHOWNETSTATUS_ICMP_ECHO_TXT 670 -#define MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_TXT 671 -#define MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_TXT 672 -#define MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_TXT 673 -#define MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_TXT 674 -#define MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_TXT 675 -#define MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_TXT 676 -#define MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_TXT 677 -#define MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_TXT 678 -#define MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_TXT 679 -#define MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_TXT 680 -#define MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_OUT_OF_RANGE_TXT 681 -#define MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKETS_TOO_SHORT_TXT 682 -#define MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKET_CHECKSUM_ERRORS_TXT 683 -#define MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_BOUND_MISMATCH_TXT 684 -#define MSG_SHOWNETSTATUS_ICMP_RESPONSES_SENT_TXT 685 -#define MSG_SHOWNETSTATUS_ICMP_ECHO_REPLIES_RECEIVED_TXT 686 -#define MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_RECEIVED_TXT 687 -#define MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_RECEIVED_TXT 688 -#define MSG_SHOWNETSTATUS_ICMP_REDIRECT_RECEIVED_TXT 689 -#define MSG_SHOWNETSTATUS_ICMP_ECHO_RECEIVED_TXT 690 -#define MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_RECEIVED_TXT 691 -#define MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_RECEIVED_TXT 692 -#define MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_RECEIVED_TXT 693 -#define MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_RECEIVED_TXT 694 -#define MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_RECEIVED_TXT 695 -#define MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_RECEIVED_TXT 696 -#define MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_RECEIVED_TXT 697 -#define MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_RECEIVED_TXT 698 -#define MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_RECEIVED_TXT 699 -#define MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_RECEIVED_TXT 700 -#define MSG_SHOWNETSTATUS_IGMP_TITLE_TXT 701 -#define MSG_SHOWNETSTATUS_IGMP_TOTAL_MESSAGES_RECEIVED_TXT 702 -#define MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_TOO_SHORT_TXT 703 -#define MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_BAD_CHECKSUM_TXT 704 -#define MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_QUERIES_RECEIVED_TXT 705 -#define MSG_SHOWNETSTATUS_IGMP_INVALID_QUERIES_RECEIVED_TXT 706 -#define MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_TXT 707 -#define MSG_SHOWNETSTATUS_IGMP_INVALID_REPORTS_RECEIVED_TXT 708 -#define MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_FOR_THIS_GROUP_TXT 709 -#define MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_SENT_TXT 710 -#define MSG_SHOWNETSTATUS_IP_TITLE_TXT 711 -#define MSG_SHOWNETSTATUS_IP_TOTAL_PACKETS_RECEIVED_TXT 712 -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_CHECKSUM_ERRORS_TXT 713 -#define MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SHORT_TXT 714 -#define MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SMALL_TXT 715 -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_DATA_SIZE_TXT 716 -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_HEADER_SIZE_TXT 717 -#define MSG_SHOWNETSTATUS_IP_FRAGMENTS_RECEIVED_TXT 718 -#define MSG_SHOWNETSTATUS_IP_FRAGMENTS_DROPPED_TXT 719 -#define MSG_SHOWNETSTATUS_IP_FRAGMENTS_TIMED_OUT_TXT 720 -#define MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_TXT 721 -#define MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FORWARD_TXT 722 -#define MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_ON_SAME_NETWORK_TXT 723 -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_UNKNOWN_PROTOCOLS_TXT 724 -#define MSG_SHOWNETSTATUS_IP_DATAGRAMS_DELIVERED_TXT 725 -#define MSG_SHOWNETSTATUS_IP_PACKETS_GENERATED_TXT 726 -#define MSG_SHOWNETSTATUS_IP_PACKETS_LOST_TXT 727 -#define MSG_SHOWNETSTATUS_IP_PACKETS_REASSEMBLED_TXT 728 -#define MSG_SHOWNETSTATUS_IP_PACKETS_FRAGMENTED_TXT 729 -#define MSG_SHOWNETSTATUS_IP_OUTPUT_FRAGMENTS_CREATED_TXT 730 -#define MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FRAGMENT_TXT 731 -#define MSG_SHOWNETSTATUS_IP_ERRORS_IN_OPTION_PROCESSING_TXT 732 -#define MSG_SHOWNETSTATUS_IP_PACKETS_NO_ROUTE_TXT 733 -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_IP_VERSION_TXT 734 -#define MSG_SHOWNETSTATUS_IP_RAW_PACKETS_SENT_TXT 735 -#define MSG_SHOWNETSTATUS_MBUF_TITLE_TXT 736 -#define MSG_SHOWNETSTATUS_MBUF_BUFFERS_FROM_PAGE_POOL_TXT 737 -#define MSG_SHOWNETSTATUS_MBUF_CLUSTERS_FROM_PAGE_POOL_TXT 738 -#define MSG_SHOWNETSTATUS_MBUF_FREE_CLUSTERS_TXT 739 -#define MSG_SHOWNETSTATUS_MBUF_DROPS_TXT 740 -#define MSG_SHOWNETSTATUS_MBUF_WAIT_TXT 741 -#define MSG_SHOWNETSTATUS_MBUF_DRAIN_TXT 742 -#define MSG_SHOWNETSTATUS_MULTICAST_TITLE_TXT 743 -#define MSG_SHOWNETSTATUS_MULTICAST_ROUTE_LOOKUPS_TXT 744 -#define MSG_SHOWNETSTATUS_MULTICAST_ROUTE_CACHE_MISSES_TXT 745 -#define MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_LOOKUPS_TXT 746 -#define MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_CACHE_MISSES_TXT 747 -#define MSG_SHOWNETSTATUS_MULTICAST_NO_ROUTE_TXT 748 -#define MSG_SHOWNETSTATUS_MULTICAST_BAD_TUNNEL_TXT 749 -#define MSG_SHOWNETSTATUS_MULTICAST_CANNOT_TUNNEL_TXT 750 -#define MSG_SHOWNETSTATUS_MULTICAST_CANNOT_WRONG_INTERFACE_TXT 751 -#define MSG_SHOWNETSTATUS_ROUTING_TITLE_TXT 752 -#define MSG_SHOWNETSTATUS_ROUTING_BAD_REDIRECT_TXT 753 -#define MSG_SHOWNETSTATUS_ROUTING_DYNAMIC_TXT 754 -#define MSG_SHOWNETSTATUS_ROUTING_NEW_GATEWAY_TXT 755 -#define MSG_SHOWNETSTATUS_ROUTING_UNREACH_TXT 756 -#define MSG_SHOWNETSTATUS_ROUTING_WILDCARD_TXT 757 -#define MSG_SHOWNETSTATUS_TCP_TITLE_TXT 758 -#define MSG_SHOWNETSTATUS_TCP_CONNATTEMPT_TXT 759 -#define MSG_SHOWNETSTATUS_TCP_ACCEPTS_TXT 760 -#define MSG_SHOWNETSTATUS_TCP_CONNECTS_TXT 761 -#define MSG_SHOWNETSTATUS_TCP_DROPS_TXT 762 -#define MSG_SHOWNETSTATUS_TCP_CONNDROPS_TXT 763 -#define MSG_SHOWNETSTATUS_TCP_CLOSED_TXT 764 -#define MSG_SHOWNETSTATUS_TCP_SEGSTIMED_TXT 765 -#define MSG_SHOWNETSTATUS_TCP_RTTUPDATED_TXT 766 -#define MSG_SHOWNETSTATUS_TCP_DELACK_TXT 767 -#define MSG_SHOWNETSTATUS_TCP_TIMEOUTDROP_TXT 768 -#define MSG_SHOWNETSTATUS_TCP_PERSISTTIMEO_TXT 769 -#define MSG_SHOWNETSTATUS_TCP_KEEPTIMEO_TXT 770 -#define MSG_SHOWNETSTATUS_TCP_KEEPPROBE_TXT 771 -#define MSG_SHOWNETSTATUS_TCP_KEEPDROPS_TXT 772 -#define MSG_SHOWNETSTATUS_TCP_SNDTOTAL_TXT 773 -#define MSG_SHOWNETSTATUS_TCP_SNDPACK_TXT 774 -#define MSG_SHOWNETSTATUS_TCP_SNDBYTE_TXT 775 -#define MSG_SHOWNETSTATUS_TCP_SNDREXMITPACK_TXT 776 -#define MSG_SHOWNETSTATUS_TCP_SNDREXMITBYTE_TXT 777 -#define MSG_SHOWNETSTATUS_TCP_SNDACKS_TXT 778 -#define MSG_SHOWNETSTATUS_TCP_SNDPROBE_TXT 779 -#define MSG_SHOWNETSTATUS_TCP_SNDURG_TXT 780 -#define MSG_SHOWNETSTATUS_TCP_SNDWINUP_TXT 781 -#define MSG_SHOWNETSTATUS_TCP_SNDCTRL_TXT 782 -#define MSG_SHOWNETSTATUS_TCP_RCVTOTAL_TXT 783 -#define MSG_SHOWNETSTATUS_TCP_RCVPACK_TXT 784 -#define MSG_SHOWNETSTATUS_TCP_RCVBYTE_TXT 785 -#define MSG_SHOWNETSTATUS_TCP_RCVBADSUM_TXT 786 -#define MSG_SHOWNETSTATUS_TCP_RCVBADOFF_TXT 787 -#define MSG_SHOWNETSTATUS_TCP_RCVSHORT_TXT 788 -#define MSG_SHOWNETSTATUS_TCP_RCVDUPPACK_TXT 789 -#define MSG_SHOWNETSTATUS_TCP_RCVDUPBYTE_TXT 790 -#define MSG_SHOWNETSTATUS_TCP_RCVOOPACK_TXT 791 -#define MSG_SHOWNETSTATUS_TCP_RCVOOBYTE_TXT 792 -#define MSG_SHOWNETSTATUS_TCP_RCVPACKAFTERWIN_TXT 793 -#define MSG_SHOWNETSTATUS_TCP_RCVBYTEAFTERWIN_TXT 794 -#define MSG_SHOWNETSTATUS_TCP_RCVAFTERCLOSE_TXT 795 -#define MSG_SHOWNETSTATUS_TCP_RCVWINPROBE_TXT 796 -#define MSG_SHOWNETSTATUS_TCP_RCVDUPACK_TXT 797 -#define MSG_SHOWNETSTATUS_TCP_RCVACKTOOMUCH_TXT 798 -#define MSG_SHOWNETSTATUS_TCP_RCVACKPACK_TXT 799 -#define MSG_SHOWNETSTATUS_TCP_RCVACKBYTE_TXT 800 -#define MSG_SHOWNETSTATUS_TCP_RCVWINUPD_TXT 801 -#define MSG_SHOWNETSTATUS_TCP_PAWSDROP_TXT 802 -#define MSG_SHOWNETSTATUS_TCP_PREDACK_TXT 803 -#define MSG_SHOWNETSTATUS_TCP_PREDDAT_TXT 804 -#define MSG_SHOWNETSTATUS_TCP_PERSISTDROP_TXT 805 -#define MSG_SHOWNETSTATUS_TCP_BADSYN_TXT 806 -#define MSG_SHOWNETSTATUS_UDP_TITLE_TXT 807 -#define MSG_SHOWNETSTATUS_UDP_IPACKETS_TXT 808 -#define MSG_SHOWNETSTATUS_UDP_HDROPS_TXT 809 -#define MSG_SHOWNETSTATUS_UDP_BADSUM_TXT 810 -#define MSG_SHOWNETSTATUS_UDP_BADLEN_TXT 811 -#define MSG_SHOWNETSTATUS_UDP_NOPORT_TXT 812 -#define MSG_SHOWNETSTATUS_UDP_NOPORTBCAST_TXT 813 -#define MSG_SHOWNETSTATUS_UDP_FULLSOCK_TXT 814 -#define MSG_SHOWNETSTATUS_UDP_OPACKETS_TXT 815 -#define MSG_SHOWNETSTATUS_TCP_SOCKET_TITLE_TXT 816 -#define MSG_SHOWNETSTATUS_LOCAL_TXT 817 -#define MSG_SHOWNETSTATUS_REMOTE_TXT 818 -#define MSG_SHOWNETSTATUS_RECEIVE_LEN_TXT 819 -#define MSG_SHOWNETSTATUS_SEND_LEN_TXT 820 -#define MSG_SHOWNETSTATUS_TCP_SOCKET_LINE_TXT 821 -#define MSG_SHOWNETSTATUS_NO_TCP_SOCKETS_IN_USE_TXT 822 -#define MSG_SHOWNETSTATUS_UDP_SOCKET_TITLE_TXT 823 -#define MSG_SHOWNETSTATUS_UDP_SOCKET_LINE_TXT 824 -#define MSG_SHOWNETSTATUS_NO_UDP_SOCKETS_IN_USE_TXT 825 -#define MSG_SHOWNETSTATUS_STATUS_NAME1_TXT 826 -#define MSG_SHOWNETSTATUS_STATUS_NAME2_TXT 827 -#define MSG_SHOWNETSTATUS_STATUS_NAME3_TXT 828 -#define MSG_SHOWNETSTATUS_STATUS_NAME4_TXT 829 -#define MSG_SHOWNETSTATUS_STATUS_NAME5_TXT 830 -#define MSG_SHOWNETSTATUS_STATUS_NAME6_TXT 831 -#define MSG_SHOWNETSTATUS_STATUS_NAME7_TXT 832 -#define MSG_SHOWNETSTATUS_STATUS_NAME8_TXT 833 -#define MSG_SHOWNETSTATUS_STATUS_NAME9_TXT 834 -#define MSG_SHOWNETSTATUS_STATUS_NAME10_TXT 835 -#define MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT 836 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE1_TXT 837 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE2_TXT 838 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE3_TXT 839 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE4_TXT 840 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE5_TXT 841 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE6_TXT 842 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE7_TXT 843 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE8_TXT 844 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE9_TXT 845 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE10_TXT 846 -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE11_TXT 847 -#define MSG_SHOWNETSTATUS_WILDCARD_TXT 848 -#define MSG_SHOWNETSTATUS_SOME_TCP_SOCKETS_IN_USE_TXT 849 -#define MSG_SHOWNETSTATUS_SOME_UDP_SOCKETS_IN_USE_TXT 850 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_READ_REQUESTS_TXT 851 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_WRITE_REQUESTS_TXT 852 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_RECEIVED_TXT 853 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_SENT_TXT 854 -#define MSG_SHOWNETSTATUS_UNKNOWN_HOST_TXT 855 -#define MSG_SHOWNETSTATUS_IP_ADDRESS_TXT 856 -#define MSG_SHOWNETSTATUS_HARDWARE_ADDRESS_TXT 857 -#define MSG_SHOWNETSTATUS_INCOMPLETE_HARDWARE_ADDRESS_TXT 858 -#define MSG_SHOWNETSTATUS_ARP_ENTRY_PERMANENT_TXT 859 -#define MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_PROXY_TXT 860 -#define MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_TXT 861 -#define MSG_SHOWNETSTATUS_ARP_CACHE_EMPTY_TXT 862 -#define MSG_SHOWNETSTATUS_ARP_HEADER_TXT 863 -#define MSG_SHOWNETSTATUS_NO_ARP_INFORMATION_TXT 864 -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSFER_STATISTICS_TXT 865 -#define MSG_SHOWNETSTATUS_STATUS_SUMMARY_TXT 866 -#define MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_TXT 867 -#define MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_ON_INTERFACE_TXT 868 -#define MSG_SHOWNETSTATUS_DEFAULT_GATEWAY_ADDRESS_TXT 869 -#define MSG_SHOWNETSTATUS_DOMAIN_NAME_SYSTEM_SERVERS_TXT 870 -#define MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_TXT 871 -#define MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_UNSET_TXT 872 -#endif /* SHOWNETSTATUS_CATALOG_STRINGS */ - -#ifdef LOGVIEWER_CATALOG_STRINGS -#define MSG_LOGVIEWER_PROJECT_MENU 900 -#define MSG_LOGVIEWER_PROJECT_CLEAR_MENU 901 -#define MSG_LOGVIEWER_PROJECT_SAVE_AS_MENU 902 -#define MSG_LOGVIEWER_PROJECT_HIDE_MENU 903 -#define MSG_LOGVIEWER_PROJECT_QUIT_MENU 904 -#define MSG_LOGVIEWER_LOG_LEVEL_0_TXT 905 -#define MSG_LOGVIEWER_LOG_LEVEL_1_TXT 906 -#define MSG_LOGVIEWER_LOG_LEVEL_2_TXT 907 -#define MSG_LOGVIEWER_LOG_LEVEL_3_TXT 908 -#define MSG_LOGVIEWER_LOG_LEVEL_4_TXT 909 -#define MSG_LOGVIEWER_LOG_LEVEL_5_TXT 910 -#define MSG_LOGVIEWER_LOG_LEVEL_6_TXT 911 -#define MSG_LOGVIEWER_LOG_LEVEL_7_TXT 912 -#define MSG_LOGVIEWER_LABEL_0_TXT 913 -#define MSG_LOGVIEWER_LABEL_1_TXT 914 -#define MSG_LOGVIEWER_LABEL_2_TXT 915 -#define MSG_LOGVIEWER_LABEL_3_TXT 916 -#define MSG_LOGVIEWER_OK_TXT 917 -#define MSG_LOGVIEWER_REALLY_CLEAR_MESSAGE_LIST_TXT 918 -#define MSG_LOGVIEWER_YES_NO_TXT 919 -#define MSG_LOGVIEWER_OVERWRITE_APPEND_NEWNAME_CANCEL_TXT 920 -#define MSG_LOGVIEWER_FILE_REQUESTER_TITLE_TXT 921 -#define MSG_LOGVIEWER_FILE_REQUESTER_SAVE_TXT 922 -#define MSG_LOGVIEWER_COMMODITIES_TITLE_TXT 923 -#define MSG_LOGVIEWER_COMMODITIES_DESCRIPTION_TXT 924 -#define MSG_LOGVIEWER_ORIGIN_UNKNOWN_TXT 925 -#define MSG_LOGVIEWER_FILE_ALREADY_EXISTS_TXT 926 -#define MSG_LOGVIEWER_FILE_COULD_NOT_BE_OPENED_TXT 927 -#define MSG_LOGVIEWER_ERROR_WRITING_TO_FILE_TXT 928 -#define MSG_LOGVIEWER_NO_DEFAULT_PUB_SCREEN_TXT 929 -#define MSG_LOGVIEWER_NO_PUBLIC_SCREEN_FONT_TXT 930 -#define MSG_LOGVIEWER_NO_VISUAL_INFO_TXT 931 -#define MSG_LOGVIEWER_NO_MENU_TXT 932 -#define MSG_LOGVIEWER_NO_MENU_LAYOUT_TXT 933 -#define MSG_LOGVIEWER_NO_SCREEN_DRAW_INFO_TXT 934 -#define MSG_LOGVIEWER_NO_SIZING_IMAGE_TXT 935 -#define MSG_LOGVIEWER_NO_VERTICAL_SCROLLER_TXT 936 -#define MSG_LOGVIEWER_NO_HORIZONTAL_SCROLLER_TXT 937 -#define MSG_LOGVIEWER_NO_WINDOW_TXT 938 -#define MSG_LOGVIEWER_NO_USER_CLIP_REGION_TXT 939 -#define MSG_LOGVIEWER_NO_LIBRARY_VERSION_TXT 940 -#define MSG_LOGVIEWER_NO_LIBRARY_TXT 941 -#define MSG_LOGVIEWER_NO_MEMORY_POOL_TXT 942 -#define MSG_LOGVIEWER_NO_SCROLLER_CLASS_TXT 943 -#define MSG_LOGVIEWER_NO_FILE_REQUESTER_TXT 944 -#define MSG_LOGVIEWER_NO_COMMODITIES_PORT_TXT 945 -#define MSG_LOGVIEWER_NO_COMMODITIES_BROKER_TXT 946 -#define MSG_LOGVIEWER_NO_COMMODITIES_HOTKEY_TXT 947 -#define MSG_LOGVIEWER_NO_COMMODITIES_SYSTEM_TXT 948 -#define MSG_LOGVIEWER_NO_HOOK_PORT_TXT 949 -#define MSG_LOGVIEWER_NO_LOG_HOOK_TXT 950 -#endif /* LOGVIEWER_CATALOG_STRINGS */ - -#ifdef NETSHUTDOWN_CATALOG_STRINGS -#define MSG_NETSHUTDOWN_NO_UTILITY_TXT 1000 -#define MSG_NETSHUTDOWN_NO_MEMORY_TXT 1001 -#define MSG_NETSHUTDOWN_NO_MSGPORT_TXT 1002 -#define MSG_NETSHUTDOWN_NO_TIMER_REQUEST_TXT 1003 -#define MSG_NETSHUTDOWN_NO_TIMER_DEVICE_TXT 1004 -#define MSG_NETSHUTDOWN_TRYING_TO_SHUT_DOWN_TXT 1005 -#define MSG_NETSHUTDOWN_SHUTDOWN_FAILED_TXT 1006 -#define MSG_NETSHUTDOWN_SHUTDOWN_DONE_TXT 1007 -#define MSG_NETSHUTDOWN_SHUTDOWN_ABORTED_TXT 1008 -#define MSG_NETSHUTDOWN_SHUTDOWN_TIMEOUT_TXT 1009 -#define MSG_NETSHUTDOWN_NETWORK_NOT_IN_USE_TXT 1010 -#endif /* NETSHUTDOWN_CATALOG_STRINGS */ - -#ifdef ROADSHOWCONTROL_CATALOG_STRINGS -#define MSG_ROADSHOWCONTROL_NO_UTILITY_TXT 1100 -#define MSG_ROADSHOWCONTROL_CANNOT_OPEN_BSDSOCKET_TXT 1101 -#define MSG_ROADSHOWCONTROL_BSDSOCKET_HAS_NO_ROADSHOWDATA_API_TXT 1102 -#define MSG_ROADSHOWCONTROL_NO_ROADSHOW_DATA_TXT 1103 -#define MSG_ROADSHOWCONTROL_COULD_NOT_SET_OPTION_TXT 1104 -#define MSG_ROADSHOWCONTROL_COULD_NOT_SET_ENV_VARIABLE_TXT 1105 -#endif /* ROADSHOWCONTROL_CATALOG_STRINGS */ - -#ifdef REMOVENETINTERFACE_CATALOG_STRINGS -#define MSG_REMOVENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT 1200 -#define MSG_REMOVENETINTERFACE_INTERFACE_REMOVED_TXT 1201 -#define MSG_REMOVENETINTERFACE_COULD_NOT_REMOVE_INTERFACE_TXT 1202 -#endif /* REMOVENETINTERFACE_CATALOG_STRINGS */ - -#endif /* CATCOMP_NUMBERS */ - - -/****************************************************************************/ - - -#ifdef CATCOMP_STRINGS - - -#ifdef ADDNETINTERFACE_CATALOG_STRINGS -#define MSG_ADDNETINTERFACE_NO_UTILITY_TXT_STR "Failed to open \"utility.library\" V37." -#define MSG_ADDNETINTERFACE_NO_ICON_TXT_STR "Failed to open \"icon.library\" V37." -#define MSG_ADDNETINTERFACE_TIMEOUT_TOO_SHORT_TXT_STR "Configuration timeout %ld is too short; increased to %ld seconds." -#define MSG_ADDNETINTERFACE_CANNOT_OPEN_FILE_TXT_STR "Failed to open file \"%s\" (%s)." -#define MSG_ADDNETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT_STR "Failed to open \"bsdsocket.library\" V4." -#define MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT_STR "\"%s\" V%ld.%ld does not support the interface configuration method used by this program." -#define MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR "\"%s\" V%ld.%ld does not support the route configuration method used by this program." -#define MSG_ADDNETINTERFACE_UNKNOWN_KEYWORD_TXT_STR "Unknown keyword \"%s\" in line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_PARSE_ERROR_TXT_STR "Parse error in line %ld of \"%s\" (%s)." -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT_STR "Not enough memory to parse line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT_STR "Unknown parameter \"%s\" in line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT_STR "Unknown lease parameter \"%s\" in line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_INVALID_LEASE_PARAMETER_TXT_STR "Invalid lease parameter \"%s\" in line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_INTERFACE_TXT_STR "Not enough memory to add interface from file \"%s\"." -#define MSG_ADDNETINTERFACE_NO_DEVICE_NAME_PROVIDED_TXT_STR "No device name provided in file \"%s\"." -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_ERROR_CODE_TXT_STR "Could not add interface \"%s\" (%s)." -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_TXT_STR "Could not add interface \"%s\"." -#define MSG_ADDNETINTERFACE_INTERFACE_ADDED_TXT_STR "Interface \"%s\" added.\n" -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT_STR "Not enough memory to configure interface \"%s\"." -#define MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_ERROR_CODE_TXT_STR "Could not mark interface \"%s\" as \"up\" (%s)." -#define MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_TXT_STR "Could not mark interface \"%s\" as \"up\"." -#define MSG_ADDNETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT_STR "Trying interface \"%s\" configuration... \0" -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT_STR "Interface \"%s\" configuration aborted." -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ATTEMPT_TIMED_OUT_TXT_STR "Interface \"%s\" configuration attempt timed out." -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_TXT_STR "Interface \"%s\" not configured; name is unknown." -#define MSG_ADDNETINTERFACE_INTERFACE_WRONG_TYPE_TXT_STR "Interface \"%s\" not configured; broadcast access not supported." -#define MSG_ADDNETINTERFACE_INTERFACE_ALREADY_CONFIGURED_TXT_STR "Interface \"%s\" not configured; address is already configured." -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_VERSION_CONFLICT_TXT_STR "Interface \"%s\" not configured; configuration command not compatible." -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_NO_MEMORY_TXT_STR "Interface \"%s\" not configured; not enough memory." -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_IN_USE_TXT_STR "Interface \"%s\" not configured; IP address to be assigned is already in use." -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_CHANGE_FAILED_TXT_STR "Interface \"%s\" not configured; IP address could not be changed." -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_MASK_CHANGE_FAILED_TXT_STR "Interface \"%s\" not configured; network mask could not be changed." -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_UNKNOWN_ERROR_TXT_STR "Interface \"%s\" not configured; unknown error (%ld)." -#define MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_INVALID_ADDRESS_TXT_STR "Interface \"%s\" not configured; no valid IP address received." -#define MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_ERROR_CODE_TXT_STR "Could not configure interface \"%s\" (%s)." -#define MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT_STR "Could not configure interface \"%s\"." -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_TXT_STR "Interface \"%s\" configured" -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_ADDRESS_TXT_STR ", address = %s" -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_MASK_TXT_STR ", network mask = %s" -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_BROADCAST_ADDRESS_TXT_STR ", broadcast address = %s" -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_DESTINATION_ADDRESS_TXT_STR ", destination address = %s" -#define MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_METRIC_TXT_STR ", metric = %ld" -#define MSG_ADDNETINTERFACE_DEFAULT_ROUTE_TXT_STR "Added default route to %s.\n" -#define MSG_ADDNETINTERFACE_ROUTE_TXT_STR "Added route to %s.\n" -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_ERROR_CODE_TXT_STR "Could not add route to %s (%s)." -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_TXT_STR "Could not add route to %s." -#define MSG_ADDNETINTERFACE_DNS_TXT_STR "Added domain name server %s.\n" -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_ERROR_CODE_TXT_STR "Could not add domain name server %s (%s)." -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_TXT_STR "Could not add domain name server %s." -#define MSG_ADDNETINTERFACE_ADDRESS_TXT_STR "Interface \"%s\" address %s \0" -#define MSG_ADDNETINTERFACE_LEASED_PERMANENTLY_TXT_STR "has been leased permanently.\n" -#define MSG_ADDNETINTERFACE_LEASED_UNTIL_TXT_STR "has been leased until %s %s and will be renewed before it expires.\n" -#define MSG_ADDNETINTERFACE_ERROR_MESSAGE_TITLE_TXT_STR "AddNetInterface Error" -#define MSG_ADDNETINTERFACE_ERROR_MESSAGE_BUTTON_LABEL_TXT_STR "Understood" -#define MSG_ADDNETINTERFACE_UNKNOWN_STATE_PARAMETER_TXT_STR "Unknown state parameter \"%s\" in line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_INVALID_IP_ADDRESS_AT_TXT_STR "Invalid IP address in \"%s=%s\", line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_ID_TOO_LONG_TXT_STR "Client identifier \"%s\" in line %ld of \"%s\" will be truncated." -#define MSG_ADDNETINTERFACE_ID_TOO_SHORT_TXT_STR "Client identifier \"%s\" in line %ld of \"%s\" is too short (2 characters minimum)." -#define MSG_ADDNETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the address conversion method used by this program.\n" -#define MSG_ADDNETINTERFACE_INVALID_HARDWARE_ADDRESS_TXT_STR "Invalid hardware address \"%s\" in line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_MISSING_HARDWARE_ADDRESS_TXT_STR "No hardware address specified in line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_FOR_HARDWARE_ADDRESS_TXT_STR "Not enough memory for hardware address \"%s\"." -#define MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_HARDWARE_ADDRESS_TXT_STR "Not enough memory to configure hardware address of \"%s\"." -#define MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_SHORT_TXT_STR "The address \"%s\" in line %ld of \"%s\" is too short to be a valid IEEE 802.3 MAC address." -#define MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_LONG_TXT_STR "The address \"%s\" in line %ld of \"%s\" is too long to be a valid IEEE 802.3 MAC address." -#define MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_BROADCAST_TXT_STR "The address \"%s\" in line %ld of \"%s\" is a broadcast address and should not be used by a single host." -#define MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_GROUP_TXT_STR "The address \"%s\" in line %ld of \"%s\" is a group address and should not be used by a single host." -#define MSG_ADDNETINTERFACE_INTERFACE_HARDWARE_ADDRESS_SET_TO_TXT_STR "The hardware address of \"%s\" was set to %s.\n" -#define MSG_ADDNETINTERFACE_NO_INTERFACE_NAME_GIVEN_TXT_STR "You did not provide the names of the interfaces to be added." -#define MSG_ADDNETINTERFACE_INVALID_ADDRESS_TXT_STR "Invalid address \"%s\" in line %ld of \"%s\"." -#define MSG_ADDNETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT_STR "The address \"%s\" in line %ld of \"%s\" is for dynamic allocation only and should not be bound statically." -#define MSG_ADDNETINTERFACE_ALIAS_TXT_STR "Added alias address %s.\n" -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_ERROR_CODE_TXT_STR "Could not add interface \"%s\" alias address %s (%s)." -#define MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_TXT_STR "Could not add interface \"%s\" alias address %s." -#define MSG_ADDNETINTERFACE_DEFAULT_DOMAIN_NAME_TXT_STR "Default domain name is \"%s\".\n" -#define MSG_ADDNETINTERFACE_INTERFACE_IS_BUSY_TXT_STR "Configuration for interface \"%s\" is still in progress." -#endif /* ADDNETINTERFACE_CATALOG_STRINGS */ - -#ifdef ADDNETROUTE_CATALOG_STRINGS -#define MSG_ADDNETROUTE_NO_UTILITY_TXT_STR "%s: Failed to open \"utility.library\" V37.\n" -#define MSG_ADDNETROUTE_CANNOT_OPEN_BSDSOCKET_TXT_STR "%s: Failed to open \"bsdsocket.library\" V4.\n" -#define MSG_ADDNETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the route configuration method used by this program.\n" -#define MSG_ADDNETROUTE_NO_MEMORY_FOR_DEFAULT_GATEWAY_TXT_STR "%s: Not enough memory to add route to default gateway \"%s\".\n" -#define MSG_ADDNETROUTE_DESTINATION_IGNORED_TXT_STR "%s: \"DESTINATION=%s\" parameter ignored.\n" -#define MSG_ADDNETROUTE_HOSTDESTINATION_IGNORED_TXT_STR "%s: \"HOSTDESTINATION=%s\" parameter ignored.\n" -#define MSG_ADDNETROUTE_NETDESTINATION_IGNORED_TXT_STR "%s: \"NETDESTINATION=%s\" parameter ignored.\n" -#define MSG_ADDNETROUTE_GATEWAY_IGNORED_TXT_STR "%s: \"GATEWAY=%s\" parameter ignored.\n" -#define MSG_ADDNETROUTE_GATEWAY_NEEDS_DESTINATION_TXT_STR "%s: The \"GATEWAY=%s\" parameter needs a destination address.\n" -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_GATEWAY_TXT_STR "%s: Not enough memory to add route to gateway \"%s\".\n" -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TXT_STR "%s: Not enough memory to add route to destination \"%s\".\n" -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_HOST_TXT_STR "%s: Not enough memory to add route to destination host \"%s\".\n" -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_NET_TXT_STR "%s: Not enough memory to add route to destination network \"%s\".\n" -#define MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_TO_ADD_ROUTE_TXT_STR "%s: Not enough memory to add route.\n" -#define MSG_ADDNETROUTE_COULD_NOT_ADD_ROUTE_TXT_STR "%s: Could not add route" -#define MSG_ADDNETROUTE_ROUTE_ADDED_TXT_STR "%s: Route added (" -#define MSG_ADDNETROUTE_DEFAULT_GATEWAY_TXT_STR "%sdefault gateway = %s" -#define MSG_ADDNETROUTE_DESTINATION_TXT_STR "%sdestination = %s" -#define MSG_ADDNETROUTE_DESTINATION_HOST_TXT_STR "%sdestination [host] = %s" -#define MSG_ADDNETROUTE_DESTINATION_NET_TXT_STR "%sdestination [network] = %s" -#define MSG_ADDNETROUTE_VIA_GATEWAY_TXT_STR "%svia gateway %s" -#endif /* ADDNETROUTE_CATALOG_STRINGS */ - -#ifdef CONFIGURENETINTERFACE_CATALOG_STRINGS -#define MSG_CONFIGURENETINTERFACE_NO_UTILITY_TXT_STR "%s: Failed to open \"utility.library\" V37.\n" -#define MSG_CONFIGURENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT_STR "%s: Failed to open \"bsdsocket.library\" V4.\n" -#define MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the interface configuration method used by this program.\n" -#define MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the route configuration method used by this program.\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_ADDRESS_TXT_STR "%s: Not enough memory to configure interface \"%s\" address.\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MASK_TXT_STR "%s: Not enough memory to configure interface \"%s\" sub network mask.\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_DESTINATION_ADDRESS_TXT_STR "%s: Not enough memory to configure interface \"%s\" destination address \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_BROADCAST_ADDRESS_TXT_STR "%s: Not enough memory to configure interface \"%s\" broadcast address \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_METRIC_TXT_STR "%s: Not enough memory to configure interface \"%s\" metric %ld.\n" -#define MSG_CONFIGURENETINTERFACE_TIMEOUT_TOO_SHORT_TXT_STR "%s: Configuration timeout %ld is too short; increased to %ld seconds.\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_ALIAS_ADDRESS_TXT_STR "%s: Not enough memory to add interface \"%s\" alias address \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_DELETE_ALIAS_ADDRESS_TXT_STR "%s: Not enough memory to delete interface \"%s\" alias address \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_CONFIGURE_PARAMETER_TXT_STR "%s: Unknown parameter \"CONFIGURE=%s\".\n" -#define MSG_CONFIGURENETINTERFACE_PICK_ONLY_ONE_STATE_TXT_STR "%s: Please specify exactly one interface state and not" -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT_STR "%s: Unknown lease parameter \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_INVALID_LEASE_PARAMETER_TXT_STR "%s: Invalid lease parameter \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_TXT_STR "%s: Not enough memory to configure interface \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_MARK_INTERFACE_UP_TXT_STR "%s: Could not mark interface \"%s\" as \"UP\"." -#define MSG_CONFIGURENETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT_STR "%s: Trying interface \"%s\" configuration... \0" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT_STR "%s: Interface \"%s\" configuration aborted.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_TIMED_OUT_TXT_STR "%s: Interface \"%s\" configuration attempt timed out.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NAME_UNKNOWN_TXT_STR "%s: Interface \"%s\" not configured; name is unknown.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_WRONG_TYPE_TXT_STR "%s: Interface \"%s\" not configured; broadcast access not supported.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ALREADY_CONFIGURED_TXT_STR "%s: Interface \"%s\" not configured; address is already configured.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_COMPATIBLE_TXT_STR "%s: Interface \"%s\" not configured; configuration command not compatible.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_ENOUGH_MEMORY_TXT_STR "%s: Interface \"%s\" not configured; not enough memory.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_IN_USE_TXT_STR "%s: Interface \"%s\" not configured; IP address to be assigned is already in use.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_NOT_CHANGED_TXT_STR "%s: Interface \"%s\" not configured; IP address could not be changed.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_MASK_NOT_CHANGED_TXT_STR "%s: Interface \"%s\" not configured; network mask could not be changed.\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_UNKNOWN_ERROR_TXT_STR "%s: Interface \"%s\" not configured; unknown error (%ld).\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_INVALID_TXT_STR "%s: Interface \"%s\" not configured; no valid IP address received.\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_ADDRESS_TXT_STR "%s: Not enough memory to configure interface \"%s\" address \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_NETMASK_TXT_STR "%s: Not enough memory to configure interface \"%s\" sub network mask \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_STATE_TXT_STR "%s: Not enough memory to change interface \"%s\" state.\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT_STR "%s: Not enough memory to configure interface \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT_STR "%s: Could not configure interface \"%s\"" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURED_TXT_STR "%s: Interface \"%s\" configured (" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_IS_TXT_STR "%saddress = %s" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_MASK_TXT_STR "%snetwork mask = %s" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_DESTINATION_ADDRESS_TXT_STR "%sdestination address = %s" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_BROADCAST_ADDRESS_TXT_STR "%sbroadcast address = %s" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_METRIC_TXT_STR "%smetric = %ld" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_ADD_ADDRESS_TXT_STR "%sadded alias address \"%s\"" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_DELETE_ADDRESS_TXT_STR "%sdeleted alias address \"%s\"" -#define MSG_CONFIGURENETINTERFACE_ADDED_DEFAULT_ROUTE_TXT_STR "%s: Added default route to %s.\n" -#define MSG_CONFIGURENETINTERFACE_ADDED_ROUTE_TXT_STR "%s: Added route to %s.\n" -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_ROUTE_TO_TXT_STR "%s: Could not add route to %s" -#define MSG_CONFIGURENETINTERFACE_ADDED_DNS_TXT_STR "%s: Added domain name server %s.\n" -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_DNS_TXT_STR "%s: Could not add domain name server %s" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_TXT_STR "%s: Interface \"%s\" address %s \0" -#define MSG_CONFIGURENETINTERFACE_LEASED_PERMANENTLY_TXT_STR "has been leased permanently.\n" -#define MSG_CONFIGURENETINTERFACE_LEASED_UNTIL_TXT_STR "has been leased until %s %s and will be renewed before it expires.\n" -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_SET_STATE_TXT_STR "%s: Could not set interface \"%s\" state to \"%s\"" -#define MSG_CONFIGURENETINTERFACE_STATE_CHANGED_TXT_STR "%s: Interface \"%s\" state changed to \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_INVALID_IP_ADDRESS_AT_TXT_STR "%s: Invalid IP address in \"%s=%s\"." -#define MSG_CONFIGURENETINTERFACE_ID_TOO_LONG_TXT_STR "Client identifier \"%s\" will be truncated." -#define MSG_CONFIGURENETINTERFACE_ID_TOO_SHORT_TXT_STR "Client identifier \"%s\" is too short (2 characters minimum)." -#define MSG_CONFIGURENETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the address conversion method used by this program.\n" -#define MSG_CONFIGURENETINTERFACE_COULD_NOT_RELEASE_INTERFACE_ADDRESS_TXT_STR "%s: Could not release interface address \"%s\"." -#define MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_WAS_RELEASED_TXT_STR "Interface address \"%s\" was released.\n" -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_DEBUG_PARAMETER_TXT_STR "%s: Unknown parameter \"DEBUG=%s\".\n" -#define MSG_CONFIGURENETINTERFACE_INVALID_ADDRESS_TXT_STR "%s: \"%s\" is not a valid address.\n" -#define MSG_CONFIGURENETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT_STR "%s: The address \"%s\" is for dynamic allocation only and should not be statically bound.\n" -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_COMPLETE_PARAMETER_TXT_STR "%s: Unknown parameter \"COMPLETE=%s\".\n" -#define MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MTU_TXT_STR "%s: Not enough memory to configure interface \"%s\" MTU %ld.\n" -#define MSG_CONFIGURENETINTERFACE_DEFAULT_DOMAIN_NAME_TXT_STR "%s: Default domain name is \"%s\".\n" -#define MSG_CONFIGURENETINTERFACE_INTERFACE_IS_BUSY_TXT_STR "%s: Configuration for interface \"%s\" is still in progress.\n" -#define MSG_CONFIGURENETINTERFACE_UNKNOWN_UNICAST_PARAMETER_TXT_STR "%s: Unknown DHCP unicast parameter \"%s\".\n" -#endif /* CONFIGURENETINTERFACE_CATALOG_STRINGS */ - -#ifdef DELETENETROUTE_CATALOG_STRINGS -#define MSG_DELETENETROUTE_NO_UTILITY_TXT_STR "%s: Failed to open \"utility.library\" V37.\n" -#define MSG_DELETENETROUTE_CANNOT_OPEN_BSDSOCKET_TXT_STR "%s: Failed to open \"bsdsocket.library\" V4.\n" -#define MSG_DELETENETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the route configuration method used by this program.\n" -#define MSG_DELETENETROUTE_NEED_EITHER_DESTINATION_OR_DEFAULT_TXT_STR "%s: You must provide either a \"DESTINATION\" or \"DEFAULTGATEWAY\" parameter.\n" -#define MSG_DELETENETROUTE_DESTINATION_IGNORED_TXT_STR "%s: \"DESTINATION=%s\" parameter ignored.\n" -#define MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_GATEWAY_NOT_DELETED_TXT_STR "%s: Could not delete route to default gateway \"%s\"" -#define MSG_DELETENETROUTE_ROUTE_NOT_DELETED_TXT_STR "%s: Could not delete route to \"%s\"" -#define MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_DELETED_TXT_STR "%s: Route to default gateway \"%s\" deleted.\n" -#define MSG_DELETENETROUTE_ROUTE_DELETED_TXT_STR "%s: Route to \"%s\" deleted.\n" -#endif /* DELETENETROUTE_CATALOG_STRINGS */ - -#ifdef GETNETSTATUS_CATALOG_STRINGS -#define MSG_GETNETSTATUS_NO_UTILITY_TXT_STR "%s: Failed to open \"utility.library\" V37.\n" -#define MSG_GETNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT_STR "%s: Failed to open \"bsdsocket.library\" V4.\n" -#define MSG_GETNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the status query method used by this program.\n" -#define MSG_GETNETSTATUS_UNKNOWN_CONDITION_TXT_STR "%s: Warning, unknown condition \"%s\".\n" -#define MSG_GETNETSTATUS_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR "Networking interfaces are available and configured.\n" -#define MSG_GETNETSTATUS_NO_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR "%sNo%s networking interfaces are available and configured.\n" -#define MSG_GETNETSTATUS_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR "Point-to-point networking interfaces are available and configured.\n" -#define MSG_GETNETSTATUS_NO_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR "%sNo%s point-to-point networking interfaces are available and configured.\n" -#define MSG_GETNETSTATUS_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR "Broadcast networking interfaces are available and configured.\n" -#define MSG_GETNETSTATUS_NO_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR "%sNo%s broadcast networking interfaces are available and configured.\n" -#define MSG_GETNETSTATUS_DNS_CONFIGURED_TXT_STR "Name resolution servers are configured.\n" -#define MSG_GETNETSTATUS_NO_DNS_CONFIGURED_TXT_STR "%sNo%s name resolution servers are configured.\n" -#define MSG_GETNETSTATUS_ROUTE_CONFIGURED_TXT_STR "Routing information is configured.\n" -#define MSG_GETNETSTATUS_NO_ROUTE_CONFIGURED_TXT_STR "%sNo%s routing information is configured.\n" -#define MSG_GETNETSTATUS_DEFAULT_ROUTE_CONFIGURED_TXT_STR "The default route is configured.\n" -#define MSG_GETNETSTATUS_NO_DEFAULT_ROUTE_CONFIGURED_TXT_STR "The default route is %snot%s configured.\n" -#endif /* GETNETSTATUS_CATALOG_STRINGS */ - -#ifdef SHOWNETSTATUS_CATALOG_STRINGS -#define MSG_SHOWNETSTATUS_NO_UTILITY_TXT_STR "%s: Failed to open \"utility.library\" V37.\n" -#define MSG_SHOWNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT_STR "%s: Failed to open \"bsdsocket.library\" V4.\n" -#define MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the status query method used by this program.\n" -#define MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the route query method used by this program.\n" -#define MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_INTERFACE_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the interface query method used by this program.\n" -#define MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_DNS_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the domain name server query method used by this program.\n" -#define MSG_SHOWNETSTATUS_CANNOT_GET_INFO_ON_INTERFACE_TXT_STR "%s: Unable to obtain information on interface \"%s\".\n" -#define MSG_SHOWNETSTATUS_CANNOT_GET_INTERFACE_LIST_TXT_STR "%s: Unable to obtain interface information.\n" -#define MSG_SHOWNETSTATUS_CANNOT_GET_DNS_LIST_TXT_STR "%s: Unable to obtain domain name server information.\n" -#define MSG_SHOWNETSTATUS_CANNOT_GET_ROUTE_TABLE_TXT_STR "%s: Unable to obtain routing information.\n" -#define MSG_SHOWNETSTATUS_NOT_ENOUGH_MEMORY_TO_QUERY_STATUS_TXT_STR "%s: Not enough memory to obtain status information for \"%s\".\n" -#define MSG_SHOWNETSTATUS_CANNOT_GET_STATUS_INFORMATION_FOR_TXT_STR "%s: Status information for \"%s\" could not be obtained.\n" -#define MSG_SHOWNETSTATUS_DEFAULT_TXT_STR "(Default)" -#define MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_ATTRIBUTES_TITLE_TXT_STR "%s%-16s %-16s %s%s\n" -#define MSG_SHOWNETSTATUS_DESTINATION_TXT_STR "Destination" -#define MSG_SHOWNETSTATUS_GATEWAY_TXT_STR "Gateway" -#define MSG_SHOWNETSTATUS_ATTRIBUTES_TXT_STR "Attributes" -#define MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_LINE_TXT_STR "%-16s %-16s" -#define MSG_SHOWNETSTATUS_UP_TXT_STR "Up" -#define MSG_SHOWNETSTATUS_DOWN_TXT_STR "Down" -#define MSG_SHOWNETSTATUS_HOST_TXT_STR "Host" -#define MSG_SHOWNETSTATUS_NO_ROUTES_ARE_CONFIGURED_TXT_STR "No routes are currently configured.\n" -#define MSG_SHOWNETSTATUS_ADDRESS_TYPE_TITLE_TXT_STR "%s%-20s %-10s%s\n" -#define MSG_SHOWNETSTATUS_ADDRESS_TXT_STR "Address" -#define MSG_SHOWNETSTATUS_TYPE_TXT_STR "Type" -#define MSG_SHOWNETSTATUS_ADDRESS_TYPE_LINE_TXT_STR "%-20s %s\n" -#define MSG_SHOWNETSTATUS_STATIC_TXT_STR "Static" -#define MSG_SHOWNETSTATUS_DYNAMIC_TXT_STR "Dynamic" -#define MSG_SHOWNETSTATUS_NO_DNS_CONFIGURED_TXT_STR "No domain name servers are configured.\n" -#define MSG_SHOWNETSTATUS_UNKNOWN_HARDWARE_TYPE_TXT_STR "Unknown (%ld)" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_TITLE_TXT_STR "%s%-20s %4s %-20s %-20s %8s %8s %8s %8s %8s %s%s\n" -#define MSG_SHOWNETSTATUS_NAME_TXT_STR "Name" -#define MSG_SHOWNETSTATUS_MTU_TXT_STR "MTU" -#define MSG_SHOWNETSTATUS_RECEIVED_TXT_STR "Received" -#define MSG_SHOWNETSTATUS_SENT_TXT_STR "Sent" -#define MSG_SHOWNETSTATUS_DROPPED_TXT_STR "Dropped" -#define MSG_SHOWNETSTATUS_OVERRUNS_TXT_STR "Overruns" -#define MSG_SHOWNETSTATUS_UNKNOWN_TXT_STR "Unknown" -#define MSG_SHOWNETSTATUS_STATUS_TXT_STR "Status" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_LINE_TXT_STR "%-20s %4ld %-20s %-20s %8ld %8ld %8ld %8ld %8ld %s\n" -#define MSG_SHOWNETSTATUS_NO_INTERFACES_AVAILABLE_TXT_STR "No interfaces are currently available.\n" -#define MSG_SHOWNETSTATUS_INTERFACE_TITLE_TXT_STR "%sInterface \"%s\"%s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_NAME_TXT_STR "Device name = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_UNIT_TXT_STR "Device unit number = %ld\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_ADDRESS_TXT_STR "Hardware address = \0" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_MTU_TXT_STR "Maximum transmission unit = %ld Bytes\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSMISSION_SPEED_TXT_STR "Transmission speed = %ld Bits/Second\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_TYPE_TXT_STR "Hardware type = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_SENT_TXT_STR "Packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_RECEIVED_TXT_STR "Packets received = %ld\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_DROPPED_TXT_STR "Packets dropped = %ld (in = %ld, out = %ld)\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_BUFFER_OVERRUNS_TXT_STR "Buffer overruns = %ld\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_UNKNOWN_PACKETS_TXT_STR "Unknown packets = %ld\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_TXT_STR "Address = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NETWORK_MASK_TXT_STR "Network mask = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_PEER_ADDRESS_TXT_STR "Peer address = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_STATUS_TXT_STR "Link status = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_BINDING_TXT_STR "Address binding = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_EXPIRES_TXT_STR "Address lease expires = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_STATIC_TXT_STR "Static" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_DYNAMIC_TXT_STR "Dynamic" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_NEVER_EXPIRES_TXT_STR "Never" -#define MSG_SHOWNETSTATUS_ICMP_TITLE_TXT_STR "%sInternet Control Message Protocol statistics%s\n" -#define MSG_SHOWNETSTATUS_ICMP_ERRORS_GENERATED_TXT_STR "Errors generated = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_IP_PACKETS_TOO_SHORT_TXT_STR "IP packets too short = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_PACKETS_NOT_RESPONDED_TO_TXT_STR "Packets not responded to = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ECHO_REPLY_PACKETS_SENT_TXT_STR "'Echo reply' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_TXT_STR "'Destination unreachable' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_TXT_STR "'Source quench' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_REDIRECT_TXT_STR "'Redirect' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ECHO_TXT_STR "'Echo' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_TXT_STR "'Router advertizement' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_TXT_STR "'Router solicitation' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_TXT_STR "'Time exceeded' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_TXT_STR "'Bad IP header' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_TXT_STR "'Timestamp request' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_TXT_STR "'Timestamp reply' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_TXT_STR "'Information request' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_TXT_STR "'Information reply' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_TXT_STR "'Address mask request' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_TXT_STR "'Address mask reply' packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_OUT_OF_RANGE_TXT_STR "Received codes out of range = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKETS_TOO_SHORT_TXT_STR "Received packets too short = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKET_CHECKSUM_ERRORS_TXT_STR "Received packet checksum errors = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_BOUND_MISMATCH_TXT_STR "Received codes bound mismatch = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_RESPONSES_SENT_TXT_STR "Responses sent = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ECHO_REPLIES_RECEIVED_TXT_STR "'Echo reply' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_RECEIVED_TXT_STR "'Destination unreachable' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_RECEIVED_TXT_STR "'Source quench' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_REDIRECT_RECEIVED_TXT_STR "'Redirect' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ECHO_RECEIVED_TXT_STR "'Echo' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_RECEIVED_TXT_STR "'Router advertizement' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_RECEIVED_TXT_STR "'Router solicitation' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_RECEIVED_TXT_STR "'Time exceeded' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_RECEIVED_TXT_STR "'Bad IP header' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_RECEIVED_TXT_STR "'Timestamp request' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_RECEIVED_TXT_STR "'Timestamp reply' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_RECEIVED_TXT_STR "'Information request' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_RECEIVED_TXT_STR "'Information reply' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_RECEIVED_TXT_STR "'Address mask request' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_RECEIVED_TXT_STR "'Address mask reply' packets received = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_TITLE_TXT_STR "%sInternet Group Management Protocol statistics%s\n" -#define MSG_SHOWNETSTATUS_IGMP_TOTAL_MESSAGES_RECEIVED_TXT_STR "Total messages received = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_TOO_SHORT_TXT_STR "Messages received with too few bytes = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_BAD_CHECKSUM_TXT_STR "Messages received with bad checksums = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_QUERIES_RECEIVED_TXT_STR "Membership queries received = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_INVALID_QUERIES_RECEIVED_TXT_STR "Messages received with invalid queries = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_TXT_STR "Membership reports received = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_INVALID_REPORTS_RECEIVED_TXT_STR "Messages received with invalid reports = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_FOR_THIS_GROUP_TXT_STR "Membership reports received for our group = %ld\n" -#define MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_SENT_TXT_STR "Membership reports sent = %ld\n" -#define MSG_SHOWNETSTATUS_IP_TITLE_TXT_STR "%sInternet Protocol statistics%s\n" -#define MSG_SHOWNETSTATUS_IP_TOTAL_PACKETS_RECEIVED_TXT_STR "Total packets received = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_CHECKSUM_ERRORS_TXT_STR "Packets with checksum errors = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SHORT_TXT_STR "Packets shorter than expected = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SMALL_TXT_STR "Packets with not enough data = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_DATA_SIZE_TXT_STR "Packets with bad data size = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_HEADER_SIZE_TXT_STR "Packets with bad header size = %ld\n" -#define MSG_SHOWNETSTATUS_IP_FRAGMENTS_RECEIVED_TXT_STR "Fragments received = %ld\n" -#define MSG_SHOWNETSTATUS_IP_FRAGMENTS_DROPPED_TXT_STR "Fragments dropped = %ld\n" -#define MSG_SHOWNETSTATUS_IP_FRAGMENTS_TIMED_OUT_TXT_STR "Fragments timed out = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_TXT_STR "Packets forwarded = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FORWARD_TXT_STR "Packets received for unreachable destination = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_ON_SAME_NETWORK_TXT_STR "Packets forwarded on same network = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_UNKNOWN_PROTOCOLS_TXT_STR "Packets with unknown protocols = %ld\n" -#define MSG_SHOWNETSTATUS_IP_DATAGRAMS_DELIVERED_TXT_STR "Datagrams delivered = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_GENERATED_TXT_STR "Packets generated = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_LOST_TXT_STR "Packets lost = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_REASSEMBLED_TXT_STR "Packets reassembled = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_FRAGMENTED_TXT_STR "Packets fragmented = %ld\n" -#define MSG_SHOWNETSTATUS_IP_OUTPUT_FRAGMENTS_CREATED_TXT_STR "Output fragments created = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FRAGMENT_TXT_STR "Packets that could not be fragmented = %ld\n" -#define MSG_SHOWNETSTATUS_IP_ERRORS_IN_OPTION_PROCESSING_TXT_STR "Errors in option processing = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_NO_ROUTE_TXT_STR "Packets discarded due to no route = %ld\n" -#define MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_IP_VERSION_TXT_STR "Packets with IP version other than 4 = %ld\n" -#define MSG_SHOWNETSTATUS_IP_RAW_PACKETS_SENT_TXT_STR "Raw IP packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_MBUF_TITLE_TXT_STR "%sMemory buffer statistics%s\n" -#define MSG_SHOWNETSTATUS_MBUF_BUFFERS_FROM_PAGE_POOL_TXT_STR "Buffers obtained from page pool = %ld\n" -#define MSG_SHOWNETSTATUS_MBUF_CLUSTERS_FROM_PAGE_POOL_TXT_STR "Clusters obtained from page pool = %ld\n" -#define MSG_SHOWNETSTATUS_MBUF_FREE_CLUSTERS_TXT_STR "Free clusters = %ld\n" -#define MSG_SHOWNETSTATUS_MBUF_DROPS_TXT_STR "Number of times no free space was available = %ld\n" -#define MSG_SHOWNETSTATUS_MBUF_WAIT_TXT_STR "Number of times had to wait for free space = %ld\n" -#define MSG_SHOWNETSTATUS_MBUF_DRAIN_TXT_STR "Number of times had to drain protocols for free space = %ld\n" -#define MSG_SHOWNETSTATUS_MULTICAST_TITLE_TXT_STR "%sMulticast routing statistics%s\n" -#define MSG_SHOWNETSTATUS_MULTICAST_ROUTE_LOOKUPS_TXT_STR "Multicast route lookups = %ld\n" -#define MSG_SHOWNETSTATUS_MULTICAST_ROUTE_CACHE_MISSES_TXT_STR "Multicast route cache misses = %ld\n" -#define MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_LOOKUPS_TXT_STR "Group address lookups = %ld\n" -#define MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_CACHE_MISSES_TXT_STR "Group address cache misses = %ld\n" -#define MSG_SHOWNETSTATUS_MULTICAST_NO_ROUTE_TXT_STR "Packets with no routes to their origins = %ld\n" -#define MSG_SHOWNETSTATUS_MULTICAST_BAD_TUNNEL_TXT_STR "Packets with malformed tunnel options = %ld\n" -#define MSG_SHOWNETSTATUS_MULTICAST_CANNOT_TUNNEL_TXT_STR "Packets with no room for tunnel options = %ld\n" -#define MSG_SHOWNETSTATUS_MULTICAST_CANNOT_WRONG_INTERFACE_TXT_STR "Packets arrived on the wrong interface = %ld\n" -#define MSG_SHOWNETSTATUS_ROUTING_TITLE_TXT_STR "%sRouting statistics%s\n" -#define MSG_SHOWNETSTATUS_ROUTING_BAD_REDIRECT_TXT_STR "Bogus redirect calls = %ld\n" -#define MSG_SHOWNETSTATUS_ROUTING_DYNAMIC_TXT_STR "Routes created by redirect calls = %ld\n" -#define MSG_SHOWNETSTATUS_ROUTING_NEW_GATEWAY_TXT_STR "Routes modified by redirect calls = %ld\n" -#define MSG_SHOWNETSTATUS_ROUTING_UNREACH_TXT_STR "Lookups which failed = %ld\n" -#define MSG_SHOWNETSTATUS_ROUTING_WILDCARD_TXT_STR "Lookups satisfied by a wildcard = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_TITLE_TXT_STR "%sTransmission Control Protocol statistics%s\n" -#define MSG_SHOWNETSTATUS_TCP_CONNATTEMPT_TXT_STR "Connections initiated = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_ACCEPTS_TXT_STR "Connections accepted = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_CONNECTS_TXT_STR "Connections established = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_DROPS_TXT_STR "Connections dropped = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_CONNDROPS_TXT_STR "Embryonic connections dropped = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_CLOSED_TXT_STR "Connections closed = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SEGSTIMED_TXT_STR "Segments timed = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RTTUPDATED_TXT_STR "Round trip times updated = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_DELACK_TXT_STR "Delayed acknowledgments sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_TIMEOUTDROP_TXT_STR "Connections dropped in timeout state = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_PERSISTTIMEO_TXT_STR "Persist timeouts = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_KEEPTIMEO_TXT_STR "Keep-alive timeouts = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_KEEPPROBE_TXT_STR "Keep-alive probes sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_KEEPDROPS_TXT_STR "Connections dropped due to keep-alive timeouts = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDTOTAL_TXT_STR "Total packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDPACK_TXT_STR "Data packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDBYTE_TXT_STR "Data bytes sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDREXMITPACK_TXT_STR "Data packets retransmitted = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDREXMITBYTE_TXT_STR "Data bytes retransmitted = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDACKS_TXT_STR "Acknowledge-only packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDPROBE_TXT_STR "Window probes sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDURG_TXT_STR "Packets sent with 'urgent' attribute = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDWINUP_TXT_STR "Window-update-only packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SNDCTRL_TXT_STR "Packets sent with control attributes = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVTOTAL_TXT_STR "Total packets received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVPACK_TXT_STR "Packets received in sequence = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVBYTE_TXT_STR "Bytes received in sequence = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVBADSUM_TXT_STR "Packets received with checksum errors = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVBADOFF_TXT_STR "Packets received with bad offset = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVSHORT_TXT_STR "Packets received that were too short = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVDUPPACK_TXT_STR "Duplicate packets received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVDUPBYTE_TXT_STR "Duplicate bytes received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVOOPACK_TXT_STR "Out-of-order packets received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVOOBYTE_TXT_STR "Out-of-order bytes received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVPACKAFTERWIN_TXT_STR "Packets received with data after window = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVBYTEAFTERWIN_TXT_STR "Bytes received after window = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVAFTERCLOSE_TXT_STR "Packets received after 'close' = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVWINPROBE_TXT_STR "Window probe packets received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVDUPACK_TXT_STR "Duplicate acknowledgements received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVACKTOOMUCH_TXT_STR "Acknowledgements received for unsent data = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVACKPACK_TXT_STR "Acknowledgement packets received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVACKBYTE_TXT_STR "Bytes acknowledged = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_RCVWINUPD_TXT_STR "Window update packets received = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_PAWSDROP_TXT_STR "Segments dropped due to PAWS = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_PREDACK_TXT_STR "Correct header predictions for acknowledgements = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_PREDDAT_TXT_STR "Correct header predictions for data packets = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_PERSISTDROP_TXT_STR "Timeouts in persist state = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_BADSYN_TXT_STR "Packets with bogus 'SYN' attribute received = %ld\n" -#define MSG_SHOWNETSTATUS_UDP_TITLE_TXT_STR "%sUser Datagram Protocol statistics%s\n" -#define MSG_SHOWNETSTATUS_UDP_IPACKETS_TXT_STR "Total packets received = %ld\n" -#define MSG_SHOWNETSTATUS_UDP_HDROPS_TXT_STR "Packets received shorter than header = %ld\n" -#define MSG_SHOWNETSTATUS_UDP_BADSUM_TXT_STR "Packets received with checksum errors = %ld\n" -#define MSG_SHOWNETSTATUS_UDP_BADLEN_TXT_STR "Packets received larger than expected = %ld\n" -#define MSG_SHOWNETSTATUS_UDP_NOPORT_TXT_STR "Packets received for unbound ports = %ld\n" -#define MSG_SHOWNETSTATUS_UDP_NOPORTBCAST_TXT_STR "Broadcast packets received for unbound ports = %ld\n" -#define MSG_SHOWNETSTATUS_UDP_FULLSOCK_TXT_STR "Packets dropped = %ld\n" -#define MSG_SHOWNETSTATUS_UDP_OPACKETS_TXT_STR "Total packets sent = %ld\n" -#define MSG_SHOWNETSTATUS_TCP_SOCKET_TITLE_TXT_STR "%s%-30s %-30s %10s %10s %-30s%s\n" -#define MSG_SHOWNETSTATUS_LOCAL_TXT_STR "Local" -#define MSG_SHOWNETSTATUS_REMOTE_TXT_STR "Remote" -#define MSG_SHOWNETSTATUS_RECEIVE_LEN_TXT_STR "Rcv.len" -#define MSG_SHOWNETSTATUS_SEND_LEN_TXT_STR "Snd.len" -#define MSG_SHOWNETSTATUS_TCP_SOCKET_LINE_TXT_STR "%-30s %-30s %10ld %10ld %s\n" -#define MSG_SHOWNETSTATUS_NO_TCP_SOCKETS_IN_USE_TXT_STR "No TCP sockets are currently in use.\n" -#define MSG_SHOWNETSTATUS_UDP_SOCKET_TITLE_TXT_STR "%s%-30s %-30s %10s %10s%s\n" -#define MSG_SHOWNETSTATUS_UDP_SOCKET_LINE_TXT_STR "%-30s %-30s %10ld %10ld\n" -#define MSG_SHOWNETSTATUS_NO_UDP_SOCKETS_IN_USE_TXT_STR "No UDP sockets are currently in use.\n" -#define MSG_SHOWNETSTATUS_STATUS_NAME1_TXT_STR "Internet Control Message Protocol" -#define MSG_SHOWNETSTATUS_STATUS_NAME2_TXT_STR "Internet Group Management Protocol" -#define MSG_SHOWNETSTATUS_STATUS_NAME3_TXT_STR "Internet Protocol" -#define MSG_SHOWNETSTATUS_STATUS_NAME4_TXT_STR "memory buffer" -#define MSG_SHOWNETSTATUS_STATUS_NAME5_TXT_STR "multicast routing" -#define MSG_SHOWNETSTATUS_STATUS_NAME6_TXT_STR "routing" -#define MSG_SHOWNETSTATUS_STATUS_NAME7_TXT_STR "Transmission Control Protocol" -#define MSG_SHOWNETSTATUS_STATUS_NAME8_TXT_STR "User Datagram Protocol" -#define MSG_SHOWNETSTATUS_STATUS_NAME9_TXT_STR "Transmission Control Protocol sockets" -#define MSG_SHOWNETSTATUS_STATUS_NAME10_TXT_STR "User Datagram Protocol sockets" -#define MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT_STR "(Not configured)" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE1_TXT_STR "Closed" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE2_TXT_STR "Listening for connection" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE3_TXT_STR "Active; 'SYN' sent" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE4_TXT_STR "Sent and received 'SYN'" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE5_TXT_STR "Established" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE6_TXT_STR "Received 'FIN', waiting for close" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE7_TXT_STR "Closed; 'FIN' sent" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE8_TXT_STR "Closed, 'FIN' exchanged, waiting for 'FIN ACK'" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE9_TXT_STR "Closed; waiting for last 'FIN ACK'" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE10_TXT_STR "Closed, 'FIN' acknowledged" -#define MSG_SHOWNETSTATUS_TCP_FSM_STATE11_TXT_STR "Closed; waiting..." -#define MSG_SHOWNETSTATUS_WILDCARD_TXT_STR "(Any)" -#define MSG_SHOWNETSTATUS_SOME_TCP_SOCKETS_IN_USE_TXT_STR "Currently, %ld local TCP sockets are in use, but not displayed (use the \"ALL\" option to show them).\n" -#define MSG_SHOWNETSTATUS_SOME_UDP_SOCKETS_IN_USE_TXT_STR "Currently, %ld local UDP sockets are in use, but not displayed (use the \"ALL\" option to show them).\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_READ_REQUESTS_TXT_STR "Number of read I/O requests = %ld (maximum of %ld used at a time, %ld are still pending)\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_WRITE_REQUESTS_TXT_STR "Number of write I/O requests = %ld (maximum of %ld used at a time, %ld are still pending)\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_RECEIVED_TXT_STR "Number of bytes received = %s\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_SENT_TXT_STR "Number of bytes sent = %s\n" -#define MSG_SHOWNETSTATUS_UNKNOWN_HOST_TXT_STR "(Unknown)" -#define MSG_SHOWNETSTATUS_IP_ADDRESS_TXT_STR "IP address" -#define MSG_SHOWNETSTATUS_HARDWARE_ADDRESS_TXT_STR "Hardware address" -#define MSG_SHOWNETSTATUS_INCOMPLETE_HARDWARE_ADDRESS_TXT_STR "(Incomplete)" -#define MSG_SHOWNETSTATUS_ARP_ENTRY_PERMANENT_TXT_STR "permanent" -#define MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_PROXY_TXT_STR "published (proxy only)" -#define MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_TXT_STR "published" -#define MSG_SHOWNETSTATUS_ARP_CACHE_EMPTY_TXT_STR "The address resolution protocol cache is currently empty.\n" -#define MSG_SHOWNETSTATUS_ARP_HEADER_TXT_STR "%s%-16s %-16s %-20s %s%s" -#define MSG_SHOWNETSTATUS_NO_ARP_INFORMATION_TXT_STR "%s: Unable to obtain address resolution protocol information.\n" -#define MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSFER_STATISTICS_TXT_STR "Transfer statistics (in/out) = DMA:%lu/%lu Byte:%lu/%lu Word:-/%lu\n" -#define MSG_SHOWNETSTATUS_STATUS_SUMMARY_TXT_STR "%sNetwork status summary%s\n" -#define MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_TXT_STR "Local host address = \0" -#define MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_ON_INTERFACE_TXT_STR "%s (on interface '%s')" -#define MSG_SHOWNETSTATUS_DEFAULT_GATEWAY_ADDRESS_TXT_STR "Default gateway address = \0" -#define MSG_SHOWNETSTATUS_DOMAIN_NAME_SYSTEM_SERVERS_TXT_STR "Domain name system servers = \0" -#define MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_TXT_STR "\nThe default domain name is set to \"%s\".\n" -#define MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_UNSET_TXT_STR "\nThe default domain name is not set.\n" -#endif /* SHOWNETSTATUS_CATALOG_STRINGS */ - -#ifdef LOGVIEWER_CATALOG_STRINGS -#define MSG_LOGVIEWER_PROJECT_MENU_STR " \0Project" -#define MSG_LOGVIEWER_PROJECT_CLEAR_MENU_STR "C\0Clear" -#define MSG_LOGVIEWER_PROJECT_SAVE_AS_MENU_STR "A\0Save message list as..." -#define MSG_LOGVIEWER_PROJECT_HIDE_MENU_STR "H\0Hide" -#define MSG_LOGVIEWER_PROJECT_QUIT_MENU_STR "Q\0Quit" -#define MSG_LOGVIEWER_LOG_LEVEL_0_TXT_STR "Emergency" -#define MSG_LOGVIEWER_LOG_LEVEL_1_TXT_STR "Alert" -#define MSG_LOGVIEWER_LOG_LEVEL_2_TXT_STR "Critical" -#define MSG_LOGVIEWER_LOG_LEVEL_3_TXT_STR "Error" -#define MSG_LOGVIEWER_LOG_LEVEL_4_TXT_STR "Warning" -#define MSG_LOGVIEWER_LOG_LEVEL_5_TXT_STR "Note" -#define MSG_LOGVIEWER_LOG_LEVEL_6_TXT_STR "Information" -#define MSG_LOGVIEWER_LOG_LEVEL_7_TXT_STR "Debug" -#define MSG_LOGVIEWER_LABEL_0_TXT_STR "Time" -#define MSG_LOGVIEWER_LABEL_1_TXT_STR "Origin" -#define MSG_LOGVIEWER_LABEL_2_TXT_STR "Severity" -#define MSG_LOGVIEWER_LABEL_3_TXT_STR "Message" -#define MSG_LOGVIEWER_OK_TXT_STR "OK" -#define MSG_LOGVIEWER_REALLY_CLEAR_MESSAGE_LIST_TXT_STR "Do you really want to clear\nthe message list?" -#define MSG_LOGVIEWER_YES_NO_TXT_STR "Yes|No" -#define MSG_LOGVIEWER_OVERWRITE_APPEND_NEWNAME_CANCEL_TXT_STR "Overwrite|Append|Choose new name...|Cancel" -#define MSG_LOGVIEWER_FILE_REQUESTER_TITLE_TXT_STR "Save log messages" -#define MSG_LOGVIEWER_FILE_REQUESTER_SAVE_TXT_STR "Save" -#define MSG_LOGVIEWER_COMMODITIES_TITLE_TXT_STR "Network log viewer" -#define MSG_LOGVIEWER_COMMODITIES_DESCRIPTION_TXT_STR "Shows log messages" -#define MSG_LOGVIEWER_ORIGIN_UNKNOWN_TXT_STR "Unknown" -#define MSG_LOGVIEWER_FILE_ALREADY_EXISTS_TXT_STR "The file\n%s\nalready exists." -#define MSG_LOGVIEWER_FILE_COULD_NOT_BE_OPENED_TXT_STR "The file\n%s\ncould not be opened\n(%s)." -#define MSG_LOGVIEWER_ERROR_WRITING_TO_FILE_TXT_STR "Error writing to file\n%s\n(%s)." -#define MSG_LOGVIEWER_NO_DEFAULT_PUB_SCREEN_TXT_STR "Could not lock default public screen." -#define MSG_LOGVIEWER_NO_PUBLIC_SCREEN_FONT_TXT_STR "Could not open public screen font." -#define MSG_LOGVIEWER_NO_VISUAL_INFO_TXT_STR "Could not obtain visual information of public screen." -#define MSG_LOGVIEWER_NO_MENU_TXT_STR "Could not create menu." -#define MSG_LOGVIEWER_NO_MENU_LAYOUT_TXT_STR "Could not perform menu layout." -#define MSG_LOGVIEWER_NO_SCREEN_DRAW_INFO_TXT_STR "Could not obtain screen draw info." -#define MSG_LOGVIEWER_NO_SIZING_IMAGE_TXT_STR "Could not obtain sizing image." -#define MSG_LOGVIEWER_NO_VERTICAL_SCROLLER_TXT_STR "Could not create vertical scroller." -#define MSG_LOGVIEWER_NO_HORIZONTAL_SCROLLER_TXT_STR "Could not create horizontal scroller." -#define MSG_LOGVIEWER_NO_WINDOW_TXT_STR "Could not open window." -#define MSG_LOGVIEWER_NO_USER_CLIP_REGION_TXT_STR "Not enough memory for user clip region." -#define MSG_LOGVIEWER_NO_LIBRARY_VERSION_TXT_STR "Could not open \"%s\" V%ld." -#define MSG_LOGVIEWER_NO_LIBRARY_TXT_STR "Could not open \"%s\"." -#define MSG_LOGVIEWER_NO_MEMORY_POOL_TXT_STR "Could not create memory pool." -#define MSG_LOGVIEWER_NO_SCROLLER_CLASS_TXT_STR "Could not set up scroller class." -#define MSG_LOGVIEWER_NO_FILE_REQUESTER_TXT_STR "Could not allocate file requester." -#define MSG_LOGVIEWER_NO_COMMODITIES_PORT_TXT_STR "Could not create commodities message port." -#define MSG_LOGVIEWER_NO_COMMODITIES_BROKER_TXT_STR "Could not create commodities broker." -#define MSG_LOGVIEWER_NO_COMMODITIES_HOTKEY_TXT_STR "Could not create commodities hotkey filter." -#define MSG_LOGVIEWER_NO_COMMODITIES_SYSTEM_TXT_STR "Could not configure commodities system." -#define MSG_LOGVIEWER_NO_HOOK_PORT_TXT_STR "Could not create internal message port." -#define MSG_LOGVIEWER_NO_LOG_HOOK_TXT_STR "Could not register log message hook interface (Roadshow required)." -#endif /* LOGVIEWER_CATALOG_STRINGS */ - -#ifdef NETSHUTDOWN_CATALOG_STRINGS -#define MSG_NETSHUTDOWN_NO_UTILITY_TXT_STR "%s: Failed to open \"utility.library\" V37.\n" -#define MSG_NETSHUTDOWN_NO_MEMORY_TXT_STR "%s: Could not allocate memory.\n" -#define MSG_NETSHUTDOWN_NO_MSGPORT_TXT_STR "%s: Could not create a message port.\n" -#define MSG_NETSHUTDOWN_NO_TIMER_REQUEST_TXT_STR "%s: Could not create timer request.\n" -#define MSG_NETSHUTDOWN_NO_TIMER_DEVICE_TXT_STR "%s: Could not open \"%s\".\n" -#define MSG_NETSHUTDOWN_TRYING_TO_SHUT_DOWN_TXT_STR "Waiting for network to shut down... \0" -#define MSG_NETSHUTDOWN_SHUTDOWN_FAILED_TXT_STR "shutdown failed.\a\n" -#define MSG_NETSHUTDOWN_SHUTDOWN_DONE_TXT_STR "shutdown finished.\n" -#define MSG_NETSHUTDOWN_SHUTDOWN_ABORTED_TXT_STR "stopped waiting; network may shut down later.\n" -#define MSG_NETSHUTDOWN_SHUTDOWN_TIMEOUT_TXT_STR "timeout; network may shut down later.\n" -#define MSG_NETSHUTDOWN_NETWORK_NOT_IN_USE_TXT_STR "%s: The network is not currently in use.\n" -#endif /* NETSHUTDOWN_CATALOG_STRINGS */ - -#ifdef ROADSHOWCONTROL_CATALOG_STRINGS -#define MSG_ROADSHOWCONTROL_NO_UTILITY_TXT_STR "%s: Failed to open \"utility.library\" V37.\n" -#define MSG_ROADSHOWCONTROL_CANNOT_OPEN_BSDSOCKET_TXT_STR "%s: Failed to open \"bsdsocket.library\" V4.\n" -#define MSG_ROADSHOWCONTROL_BSDSOCKET_HAS_NO_ROADSHOWDATA_API_TXT_STR "%s: \"%s\" V%ld.%ld does not support the data set/get method used by this program.\n" -#define MSG_ROADSHOWCONTROL_NO_ROADSHOW_DATA_TXT_STR "%s: List of internal options is not available (%ld, %s).\n" -#define MSG_ROADSHOWCONTROL_COULD_NOT_SET_OPTION_TXT_STR "%s: Could not set option \"%s\" to %ld (%ld, %s).\n" -#define MSG_ROADSHOWCONTROL_COULD_NOT_SET_ENV_VARIABLE_TXT_STR "%s: Could not set environment variable \"%s\" (%ld, %s).\n" -#endif /* ROADSHOWCONTROL_CATALOG_STRINGS */ - -#ifdef REMOVENETINTERFACE_CATALOG_STRINGS -#define MSG_REMOVENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT_STR "%s: Failed to open \"bsdsocket.library\" V4.\n" -#define MSG_REMOVENETINTERFACE_INTERFACE_REMOVED_TXT_STR "%s: Interface \"%s\" removed.\n" -#define MSG_REMOVENETINTERFACE_COULD_NOT_REMOVE_INTERFACE_TXT_STR "%s: Could not remove interface \"%s\" (%ld, %s).\n" -#endif /* REMOVENETINTERFACE_CATALOG_STRINGS */ - -#endif /* CATCOMP_STRINGS */ - - -/****************************************************************************/ - - -#ifdef CATCOMP_ARRAY - -struct CatCompArrayType -{ - LONG cca_ID; - STRPTR cca_Str; -}; - -static const struct CatCompArrayType CatCompArray[] = -{ - -#ifdef ADDNETINTERFACE_CATALOG_STRINGS - {MSG_ADDNETINTERFACE_NO_UTILITY_TXT,(STRPTR)MSG_ADDNETINTERFACE_NO_UTILITY_TXT_STR}, - {MSG_ADDNETINTERFACE_NO_ICON_TXT,(STRPTR)MSG_ADDNETINTERFACE_NO_ICON_TXT_STR}, - {MSG_ADDNETINTERFACE_TIMEOUT_TOO_SHORT_TXT,(STRPTR)MSG_ADDNETINTERFACE_TIMEOUT_TOO_SHORT_TXT_STR}, - {MSG_ADDNETINTERFACE_CANNOT_OPEN_FILE_TXT,(STRPTR)MSG_ADDNETINTERFACE_CANNOT_OPEN_FILE_TXT_STR}, - {MSG_ADDNETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT,(STRPTR)MSG_ADDNETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT_STR}, - {MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT,(STRPTR)MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT_STR}, - {MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT,(STRPTR)MSG_ADDNETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR}, - {MSG_ADDNETINTERFACE_UNKNOWN_KEYWORD_TXT,(STRPTR)MSG_ADDNETINTERFACE_UNKNOWN_KEYWORD_TXT_STR}, - {MSG_ADDNETINTERFACE_PARSE_ERROR_TXT,(STRPTR)MSG_ADDNETINTERFACE_PARSE_ERROR_TXT_STR}, - {MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT,(STRPTR)MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_PARSE_TXT_STR}, - {MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT,(STRPTR)MSG_ADDNETINTERFACE_UNKNOWN_PARAMETER_TXT_STR}, - {MSG_ADDNETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT,(STRPTR)MSG_ADDNETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT_STR}, - {MSG_ADDNETINTERFACE_INVALID_LEASE_PARAMETER_TXT,(STRPTR)MSG_ADDNETINTERFACE_INVALID_LEASE_PARAMETER_TXT_STR}, - {MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_INTERFACE_TXT,(STRPTR)MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_INTERFACE_TXT_STR}, - {MSG_ADDNETINTERFACE_NO_DEVICE_NAME_PROVIDED_TXT,(STRPTR)MSG_ADDNETINTERFACE_NO_DEVICE_NAME_PROVIDED_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_ERROR_CODE_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_ERROR_CODE_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_ADD_INTERFACE_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_ADDED_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_ADDED_TXT_STR}, - {MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT,(STRPTR)MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT_STR}, - {MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_ERROR_CODE_TXT,(STRPTR)MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_ERROR_CODE_TXT_STR}, - {MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_TXT,(STRPTR)MSG_ADDNETINTERFACE_CANNOT_MARK_INTERFACE_UP_TXT_STR}, - {MSG_ADDNETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT,(STRPTR)MSG_ADDNETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ATTEMPT_TIMED_OUT_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_ATTEMPT_TIMED_OUT_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_WRONG_TYPE_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_WRONG_TYPE_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_ALREADY_CONFIGURED_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_ALREADY_CONFIGURED_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_VERSION_CONFLICT_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURATION_VERSION_CONFLICT_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_NO_MEMORY_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_NO_MEMORY_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_IN_USE_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_IN_USE_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_CHANGE_FAILED_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_CHANGE_FAILED_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_MASK_CHANGE_FAILED_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_MASK_CHANGE_FAILED_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_UNKNOWN_ERROR_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_UNKNOWN_ERROR_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_INVALID_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_NOT_CONFIGURED_INVALID_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_ERROR_CODE_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_ERROR_CODE_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_MASK_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_MASK_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_BROADCAST_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_BROADCAST_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_DESTINATION_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_DESTINATION_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_METRIC_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_CONFIGURED_METRIC_TXT_STR}, - {MSG_ADDNETINTERFACE_DEFAULT_ROUTE_TXT,(STRPTR)MSG_ADDNETINTERFACE_DEFAULT_ROUTE_TXT_STR}, - {MSG_ADDNETINTERFACE_ROUTE_TXT,(STRPTR)MSG_ADDNETINTERFACE_ROUTE_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_ERROR_CODE_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_ERROR_CODE_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_ADD_ROUTE_TXT_STR}, - {MSG_ADDNETINTERFACE_DNS_TXT,(STRPTR)MSG_ADDNETINTERFACE_DNS_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_ERROR_CODE_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_ERROR_CODE_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_ADD_DNS_TXT_STR}, - {MSG_ADDNETINTERFACE_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_LEASED_PERMANENTLY_TXT,(STRPTR)MSG_ADDNETINTERFACE_LEASED_PERMANENTLY_TXT_STR}, - {MSG_ADDNETINTERFACE_LEASED_UNTIL_TXT,(STRPTR)MSG_ADDNETINTERFACE_LEASED_UNTIL_TXT_STR}, - {MSG_ADDNETINTERFACE_ERROR_MESSAGE_TITLE_TXT,(STRPTR)MSG_ADDNETINTERFACE_ERROR_MESSAGE_TITLE_TXT_STR}, - {MSG_ADDNETINTERFACE_ERROR_MESSAGE_BUTTON_LABEL_TXT,(STRPTR)MSG_ADDNETINTERFACE_ERROR_MESSAGE_BUTTON_LABEL_TXT_STR}, - {MSG_ADDNETINTERFACE_UNKNOWN_STATE_PARAMETER_TXT,(STRPTR)MSG_ADDNETINTERFACE_UNKNOWN_STATE_PARAMETER_TXT_STR}, - {MSG_ADDNETINTERFACE_INVALID_IP_ADDRESS_AT_TXT,(STRPTR)MSG_ADDNETINTERFACE_INVALID_IP_ADDRESS_AT_TXT_STR}, - {MSG_ADDNETINTERFACE_ID_TOO_LONG_TXT,(STRPTR)MSG_ADDNETINTERFACE_ID_TOO_LONG_TXT_STR}, - {MSG_ADDNETINTERFACE_ID_TOO_SHORT_TXT,(STRPTR)MSG_ADDNETINTERFACE_ID_TOO_SHORT_TXT_STR}, - {MSG_ADDNETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT,(STRPTR)MSG_ADDNETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT_STR}, - {MSG_ADDNETINTERFACE_INVALID_HARDWARE_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_INVALID_HARDWARE_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_MISSING_HARDWARE_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_MISSING_HARDWARE_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_FOR_HARDWARE_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_FOR_HARDWARE_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_HARDWARE_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_HARDWARE_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_SHORT_TXT,(STRPTR)MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_SHORT_TXT_STR}, - {MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_LONG_TXT,(STRPTR)MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_TOO_LONG_TXT_STR}, - {MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_BROADCAST_TXT,(STRPTR)MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_BROADCAST_TXT_STR}, - {MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_GROUP_TXT,(STRPTR)MSG_ADDNETINTERFACE_HARDWARE_ADDRESS_IS_GROUP_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_HARDWARE_ADDRESS_SET_TO_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_HARDWARE_ADDRESS_SET_TO_TXT_STR}, - {MSG_ADDNETINTERFACE_NO_INTERFACE_NAME_GIVEN_TXT,(STRPTR)MSG_ADDNETINTERFACE_NO_INTERFACE_NAME_GIVEN_TXT_STR}, - {MSG_ADDNETINTERFACE_INVALID_ADDRESS_TXT,(STRPTR)MSG_ADDNETINTERFACE_INVALID_ADDRESS_TXT_STR}, - {MSG_ADDNETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT,(STRPTR)MSG_ADDNETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT_STR}, - {MSG_ADDNETINTERFACE_ALIAS_TXT,(STRPTR)MSG_ADDNETINTERFACE_ALIAS_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_ERROR_CODE_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_ERROR_CODE_TXT_STR}, - {MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_TXT,(STRPTR)MSG_ADDNETINTERFACE_COULD_NOT_ADD_ALIAS_TXT_STR}, - {MSG_ADDNETINTERFACE_DEFAULT_DOMAIN_NAME_TXT,(STRPTR)MSG_ADDNETINTERFACE_DEFAULT_DOMAIN_NAME_TXT_STR}, - {MSG_ADDNETINTERFACE_INTERFACE_IS_BUSY_TXT,(STRPTR)MSG_ADDNETINTERFACE_INTERFACE_IS_BUSY_TXT_STR}, -#endif /* ADDNETINTERFACE_CATALOG_STRINGS */ - -#ifdef ADDNETROUTE_CATALOG_STRINGS - {MSG_ADDNETROUTE_NO_UTILITY_TXT,(STRPTR)MSG_ADDNETROUTE_NO_UTILITY_TXT_STR}, - {MSG_ADDNETROUTE_CANNOT_OPEN_BSDSOCKET_TXT,(STRPTR)MSG_ADDNETROUTE_CANNOT_OPEN_BSDSOCKET_TXT_STR}, - {MSG_ADDNETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT,(STRPTR)MSG_ADDNETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR}, - {MSG_ADDNETROUTE_NO_MEMORY_FOR_DEFAULT_GATEWAY_TXT,(STRPTR)MSG_ADDNETROUTE_NO_MEMORY_FOR_DEFAULT_GATEWAY_TXT_STR}, - {MSG_ADDNETROUTE_DESTINATION_IGNORED_TXT,(STRPTR)MSG_ADDNETROUTE_DESTINATION_IGNORED_TXT_STR}, - {MSG_ADDNETROUTE_HOSTDESTINATION_IGNORED_TXT,(STRPTR)MSG_ADDNETROUTE_HOSTDESTINATION_IGNORED_TXT_STR}, - {MSG_ADDNETROUTE_NETDESTINATION_IGNORED_TXT,(STRPTR)MSG_ADDNETROUTE_NETDESTINATION_IGNORED_TXT_STR}, - {MSG_ADDNETROUTE_GATEWAY_IGNORED_TXT,(STRPTR)MSG_ADDNETROUTE_GATEWAY_IGNORED_TXT_STR}, - {MSG_ADDNETROUTE_GATEWAY_NEEDS_DESTINATION_TXT,(STRPTR)MSG_ADDNETROUTE_GATEWAY_NEEDS_DESTINATION_TXT_STR}, - {MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_GATEWAY_TXT,(STRPTR)MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_GATEWAY_TXT_STR}, - {MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TXT,(STRPTR)MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TXT_STR}, - {MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_HOST_TXT,(STRPTR)MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_HOST_TXT_STR}, - {MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_NET_TXT,(STRPTR)MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_FOR_ROUTE_TO_NET_TXT_STR}, - {MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_TO_ADD_ROUTE_TXT,(STRPTR)MSG_ADDNETROUTE_NOT_ENOUGH_MEMORY_TO_ADD_ROUTE_TXT_STR}, - {MSG_ADDNETROUTE_COULD_NOT_ADD_ROUTE_TXT,(STRPTR)MSG_ADDNETROUTE_COULD_NOT_ADD_ROUTE_TXT_STR}, - {MSG_ADDNETROUTE_ROUTE_ADDED_TXT,(STRPTR)MSG_ADDNETROUTE_ROUTE_ADDED_TXT_STR}, - {MSG_ADDNETROUTE_DEFAULT_GATEWAY_TXT,(STRPTR)MSG_ADDNETROUTE_DEFAULT_GATEWAY_TXT_STR}, - {MSG_ADDNETROUTE_DESTINATION_TXT,(STRPTR)MSG_ADDNETROUTE_DESTINATION_TXT_STR}, - {MSG_ADDNETROUTE_DESTINATION_HOST_TXT,(STRPTR)MSG_ADDNETROUTE_DESTINATION_HOST_TXT_STR}, - {MSG_ADDNETROUTE_DESTINATION_NET_TXT,(STRPTR)MSG_ADDNETROUTE_DESTINATION_NET_TXT_STR}, - {MSG_ADDNETROUTE_VIA_GATEWAY_TXT,(STRPTR)MSG_ADDNETROUTE_VIA_GATEWAY_TXT_STR}, -#endif /* ADDNETROUTE_CATALOG_STRINGS */ - -#ifdef CONFIGURENETINTERFACE_CATALOG_STRINGS - {MSG_CONFIGURENETINTERFACE_NO_UTILITY_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NO_UTILITY_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_INTERFACE_API_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MASK_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MASK_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_DESTINATION_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_DESTINATION_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_BROADCAST_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_BROADCAST_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_METRIC_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_METRIC_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_TIMEOUT_TOO_SHORT_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_TIMEOUT_TOO_SHORT_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_ALIAS_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_ADD_ALIAS_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_DELETE_ALIAS_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_DELETE_ALIAS_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_UNKNOWN_CONFIGURE_PARAMETER_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_UNKNOWN_CONFIGURE_PARAMETER_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_PICK_ONLY_ONE_STATE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_PICK_ONLY_ONE_STATE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_UNKNOWN_LEASE_PARAMETER_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INVALID_LEASE_PARAMETER_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INVALID_LEASE_PARAMETER_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_COULD_NOT_MARK_INTERFACE_UP_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_COULD_NOT_MARK_INTERFACE_UP_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_TRYING_INTERFACE_CONFIGURATION_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ABORTED_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_TIMED_OUT_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_TIMED_OUT_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NAME_UNKNOWN_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NAME_UNKNOWN_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_WRONG_TYPE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_WRONG_TYPE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ALREADY_CONFIGURED_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ALREADY_CONFIGURED_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_COMPATIBLE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_COMPATIBLE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_ENOUGH_MEMORY_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_NOT_ENOUGH_MEMORY_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_IN_USE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_IN_USE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_NOT_CHANGED_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_ADDRESS_NOT_CHANGED_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_MASK_NOT_CHANGED_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_MASK_NOT_CHANGED_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_UNKNOWN_ERROR_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURATION_UNKNOWN_ERROR_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_INVALID_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_NOT_CONFIGURED_ADDRESS_INVALID_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_NETMASK_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_NETMASK_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_STATE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_STATE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_COULD_NOT_CONFIGURE_INTERFACE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURED_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_CONFIGURED_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_IS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_IS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_MASK_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_MASK_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_DESTINATION_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_DESTINATION_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_BROADCAST_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_BROADCAST_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_METRIC_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_METRIC_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_ADD_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_ADD_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_DELETE_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_DELETE_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_ADDED_DEFAULT_ROUTE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_ADDED_DEFAULT_ROUTE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_ADDED_ROUTE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_ADDED_ROUTE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_ROUTE_TO_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_ROUTE_TO_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_ADDED_DNS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_ADDED_DNS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_DNS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_COULD_NOT_ADD_DNS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_LEASED_PERMANENTLY_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_LEASED_PERMANENTLY_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_LEASED_UNTIL_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_LEASED_UNTIL_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_COULD_NOT_SET_STATE_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_COULD_NOT_SET_STATE_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_STATE_CHANGED_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_STATE_CHANGED_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INVALID_IP_ADDRESS_AT_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INVALID_IP_ADDRESS_AT_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_ID_TOO_LONG_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_ID_TOO_LONG_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_ID_TOO_SHORT_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_ID_TOO_SHORT_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_HAS_NO_ADDRESS_CONVERSION_API_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_COULD_NOT_RELEASE_INTERFACE_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_COULD_NOT_RELEASE_INTERFACE_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_WAS_RELEASED_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_ADDRESS_WAS_RELEASED_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_UNKNOWN_DEBUG_PARAMETER_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_UNKNOWN_DEBUG_PARAMETER_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INVALID_ADDRESS_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INVALID_ADDRESS_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_DYNAMIC_ADDRESS_SHOULD_NOT_BE_BOUND_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_UNKNOWN_COMPLETE_PARAMETER_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_UNKNOWN_COMPLETE_PARAMETER_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MTU_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_NOT_ENOUGH_MEMORY_TO_CONFIGURE_INTERFACE_MTU_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_DEFAULT_DOMAIN_NAME_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_DEFAULT_DOMAIN_NAME_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_INTERFACE_IS_BUSY_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_INTERFACE_IS_BUSY_TXT_STR}, - {MSG_CONFIGURENETINTERFACE_UNKNOWN_UNICAST_PARAMETER_TXT,(STRPTR)MSG_CONFIGURENETINTERFACE_UNKNOWN_UNICAST_PARAMETER_TXT_STR}, -#endif /* CONFIGURENETINTERFACE_CATALOG_STRINGS */ - -#ifdef DELETENETROUTE_CATALOG_STRINGS - {MSG_DELETENETROUTE_NO_UTILITY_TXT,(STRPTR)MSG_DELETENETROUTE_NO_UTILITY_TXT_STR}, - {MSG_DELETENETROUTE_CANNOT_OPEN_BSDSOCKET_TXT,(STRPTR)MSG_DELETENETROUTE_CANNOT_OPEN_BSDSOCKET_TXT_STR}, - {MSG_DELETENETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT,(STRPTR)MSG_DELETENETROUTE_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR}, - {MSG_DELETENETROUTE_NEED_EITHER_DESTINATION_OR_DEFAULT_TXT,(STRPTR)MSG_DELETENETROUTE_NEED_EITHER_DESTINATION_OR_DEFAULT_TXT_STR}, - {MSG_DELETENETROUTE_DESTINATION_IGNORED_TXT,(STRPTR)MSG_DELETENETROUTE_DESTINATION_IGNORED_TXT_STR}, - {MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_GATEWAY_NOT_DELETED_TXT,(STRPTR)MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_GATEWAY_NOT_DELETED_TXT_STR}, - {MSG_DELETENETROUTE_ROUTE_NOT_DELETED_TXT,(STRPTR)MSG_DELETENETROUTE_ROUTE_NOT_DELETED_TXT_STR}, - {MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_DELETED_TXT,(STRPTR)MSG_DELETENETROUTE_ROUTE_TO_DEFAULT_DELETED_TXT_STR}, - {MSG_DELETENETROUTE_ROUTE_DELETED_TXT,(STRPTR)MSG_DELETENETROUTE_ROUTE_DELETED_TXT_STR}, -#endif /* DELETENETROUTE_CATALOG_STRINGS */ - -#ifdef GETNETSTATUS_CATALOG_STRINGS - {MSG_GETNETSTATUS_NO_UTILITY_TXT,(STRPTR)MSG_GETNETSTATUS_NO_UTILITY_TXT_STR}, - {MSG_GETNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT,(STRPTR)MSG_GETNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT_STR}, - {MSG_GETNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT,(STRPTR)MSG_GETNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT_STR}, - {MSG_GETNETSTATUS_UNKNOWN_CONDITION_TXT,(STRPTR)MSG_GETNETSTATUS_UNKNOWN_CONDITION_TXT_STR}, - {MSG_GETNETSTATUS_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_NO_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_NO_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_NO_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_NO_POINT_TO_POINT_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_NO_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_NO_BROADCAST_INTERFACES_AVAILABLE_AND_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_DNS_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_DNS_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_NO_DNS_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_NO_DNS_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_ROUTE_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_ROUTE_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_NO_ROUTE_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_NO_ROUTE_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_DEFAULT_ROUTE_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_DEFAULT_ROUTE_CONFIGURED_TXT_STR}, - {MSG_GETNETSTATUS_NO_DEFAULT_ROUTE_CONFIGURED_TXT,(STRPTR)MSG_GETNETSTATUS_NO_DEFAULT_ROUTE_CONFIGURED_TXT_STR}, -#endif /* GETNETSTATUS_CATALOG_STRINGS */ - -#ifdef SHOWNETSTATUS_CATALOG_STRINGS - {MSG_SHOWNETSTATUS_NO_UTILITY_TXT,(STRPTR)MSG_SHOWNETSTATUS_NO_UTILITY_TXT_STR}, - {MSG_SHOWNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT,(STRPTR)MSG_SHOWNETSTATUS_CANNOT_OPEN_BSDSOCKET_TXT_STR}, - {MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT,(STRPTR)MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_STATUS_API_TXT_STR}, - {MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_ROUTE_API_TXT,(STRPTR)MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_ROUTE_API_TXT_STR}, - {MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_INTERFACE_API_TXT,(STRPTR)MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_INTERFACE_API_TXT_STR}, - {MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_DNS_API_TXT,(STRPTR)MSG_SHOWNETSTATUS_BSDSOCKET_HAS_NO_DNS_API_TXT_STR}, - {MSG_SHOWNETSTATUS_CANNOT_GET_INFO_ON_INTERFACE_TXT,(STRPTR)MSG_SHOWNETSTATUS_CANNOT_GET_INFO_ON_INTERFACE_TXT_STR}, - {MSG_SHOWNETSTATUS_CANNOT_GET_INTERFACE_LIST_TXT,(STRPTR)MSG_SHOWNETSTATUS_CANNOT_GET_INTERFACE_LIST_TXT_STR}, - {MSG_SHOWNETSTATUS_CANNOT_GET_DNS_LIST_TXT,(STRPTR)MSG_SHOWNETSTATUS_CANNOT_GET_DNS_LIST_TXT_STR}, - {MSG_SHOWNETSTATUS_CANNOT_GET_ROUTE_TABLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_CANNOT_GET_ROUTE_TABLE_TXT_STR}, - {MSG_SHOWNETSTATUS_NOT_ENOUGH_MEMORY_TO_QUERY_STATUS_TXT,(STRPTR)MSG_SHOWNETSTATUS_NOT_ENOUGH_MEMORY_TO_QUERY_STATUS_TXT_STR}, - {MSG_SHOWNETSTATUS_CANNOT_GET_STATUS_INFORMATION_FOR_TXT,(STRPTR)MSG_SHOWNETSTATUS_CANNOT_GET_STATUS_INFORMATION_FOR_TXT_STR}, - {MSG_SHOWNETSTATUS_DEFAULT_TXT,(STRPTR)MSG_SHOWNETSTATUS_DEFAULT_TXT_STR}, - {MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_ATTRIBUTES_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_ATTRIBUTES_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_DESTINATION_TXT,(STRPTR)MSG_SHOWNETSTATUS_DESTINATION_TXT_STR}, - {MSG_SHOWNETSTATUS_GATEWAY_TXT,(STRPTR)MSG_SHOWNETSTATUS_GATEWAY_TXT_STR}, - {MSG_SHOWNETSTATUS_ATTRIBUTES_TXT,(STRPTR)MSG_SHOWNETSTATUS_ATTRIBUTES_TXT_STR}, - {MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_LINE_TXT,(STRPTR)MSG_SHOWNETSTATUS_DESTINATION_GATEWAY_LINE_TXT_STR}, - {MSG_SHOWNETSTATUS_UP_TXT,(STRPTR)MSG_SHOWNETSTATUS_UP_TXT_STR}, - {MSG_SHOWNETSTATUS_DOWN_TXT,(STRPTR)MSG_SHOWNETSTATUS_DOWN_TXT_STR}, - {MSG_SHOWNETSTATUS_HOST_TXT,(STRPTR)MSG_SHOWNETSTATUS_HOST_TXT_STR}, - {MSG_SHOWNETSTATUS_NO_ROUTES_ARE_CONFIGURED_TXT,(STRPTR)MSG_SHOWNETSTATUS_NO_ROUTES_ARE_CONFIGURED_TXT_STR}, - {MSG_SHOWNETSTATUS_ADDRESS_TYPE_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_ADDRESS_TYPE_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_TYPE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TYPE_TXT_STR}, - {MSG_SHOWNETSTATUS_ADDRESS_TYPE_LINE_TXT,(STRPTR)MSG_SHOWNETSTATUS_ADDRESS_TYPE_LINE_TXT_STR}, - {MSG_SHOWNETSTATUS_STATIC_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATIC_TXT_STR}, - {MSG_SHOWNETSTATUS_DYNAMIC_TXT,(STRPTR)MSG_SHOWNETSTATUS_DYNAMIC_TXT_STR}, - {MSG_SHOWNETSTATUS_NO_DNS_CONFIGURED_TXT,(STRPTR)MSG_SHOWNETSTATUS_NO_DNS_CONFIGURED_TXT_STR}, - {MSG_SHOWNETSTATUS_UNKNOWN_HARDWARE_TYPE_TXT,(STRPTR)MSG_SHOWNETSTATUS_UNKNOWN_HARDWARE_TYPE_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_NAME_TXT,(STRPTR)MSG_SHOWNETSTATUS_NAME_TXT_STR}, - {MSG_SHOWNETSTATUS_MTU_TXT,(STRPTR)MSG_SHOWNETSTATUS_MTU_TXT_STR}, - {MSG_SHOWNETSTATUS_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_SENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_SENT_TXT_STR}, - {MSG_SHOWNETSTATUS_DROPPED_TXT,(STRPTR)MSG_SHOWNETSTATUS_DROPPED_TXT_STR}, - {MSG_SHOWNETSTATUS_OVERRUNS_TXT,(STRPTR)MSG_SHOWNETSTATUS_OVERRUNS_TXT_STR}, - {MSG_SHOWNETSTATUS_UNKNOWN_TXT,(STRPTR)MSG_SHOWNETSTATUS_UNKNOWN_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_LINE_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_LINE_TXT_STR}, - {MSG_SHOWNETSTATUS_NO_INTERFACES_AVAILABLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_NO_INTERFACES_AVAILABLE_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_NAME_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_NAME_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_UNIT_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_DEVICE_UNIT_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_MTU_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_MTU_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSMISSION_SPEED_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSMISSION_SPEED_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_TYPE_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_HARDWARE_TYPE_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_SENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_SENT_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_DROPPED_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_PACKETS_DROPPED_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_BUFFER_OVERRUNS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_BUFFER_OVERRUNS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_UNKNOWN_PACKETS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_UNKNOWN_PACKETS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_NETWORK_MASK_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_NETWORK_MASK_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_PEER_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_PEER_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_STATUS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_STATUS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_BINDING_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_ADDRESS_BINDING_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_EXPIRES_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_EXPIRES_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_STATIC_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_STATIC_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_DYNAMIC_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_BINDING_DYNAMIC_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_NEVER_EXPIRES_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_LEASE_NEVER_EXPIRES_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ERRORS_GENERATED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ERRORS_GENERATED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_IP_PACKETS_TOO_SHORT_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_IP_PACKETS_TOO_SHORT_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_PACKETS_NOT_RESPONDED_TO_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_PACKETS_NOT_RESPONDED_TO_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ECHO_REPLY_PACKETS_SENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ECHO_REPLY_PACKETS_SENT_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_REDIRECT_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_REDIRECT_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ECHO_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ECHO_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_OUT_OF_RANGE_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_OUT_OF_RANGE_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKETS_TOO_SHORT_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKETS_TOO_SHORT_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKET_CHECKSUM_ERRORS_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_RECEIVED_PACKET_CHECKSUM_ERRORS_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_BOUND_MISMATCH_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_RECEIVED_CODES_BOUND_MISMATCH_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_RESPONSES_SENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_RESPONSES_SENT_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ECHO_REPLIES_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ECHO_REPLIES_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_DESTINATION_UNREACHABLE_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_SOURCE_QUENCH_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_REDIRECT_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_REDIRECT_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ECHO_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ECHO_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ROUTER_ADVERTIZEMENT_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ROUTER_SOLICITATION_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_TIME_EXCEEDED_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_BAD_IP_HEADER_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REQUEST_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_TIMESTAMP_REPLY_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_INFORMATION_REQUEST_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_INFORMATION_REPLY_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REQUEST_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ICMP_ADDRESS_MASK_REPLY_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_TOTAL_MESSAGES_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_TOTAL_MESSAGES_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_TOO_SHORT_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_TOO_SHORT_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_BAD_CHECKSUM_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_MESSAGES_RECEIVED_BAD_CHECKSUM_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_QUERIES_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_QUERIES_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_INVALID_QUERIES_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_INVALID_QUERIES_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_INVALID_REPORTS_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_INVALID_REPORTS_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_FOR_THIS_GROUP_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_RECEIVED_FOR_THIS_GROUP_TXT_STR}, - {MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_SENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_IGMP_MEMBERSHIP_REPORTS_SENT_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_TOTAL_PACKETS_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_TOTAL_PACKETS_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_WITH_CHECKSUM_ERRORS_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_WITH_CHECKSUM_ERRORS_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SHORT_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SHORT_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SMALL_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_TOO_SMALL_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_DATA_SIZE_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_DATA_SIZE_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_HEADER_SIZE_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_HEADER_SIZE_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_FRAGMENTS_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_FRAGMENTS_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_FRAGMENTS_DROPPED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_FRAGMENTS_DROPPED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_FRAGMENTS_TIMED_OUT_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_FRAGMENTS_TIMED_OUT_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FORWARD_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FORWARD_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_ON_SAME_NETWORK_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_FORWARDED_ON_SAME_NETWORK_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_WITH_UNKNOWN_PROTOCOLS_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_WITH_UNKNOWN_PROTOCOLS_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_DATAGRAMS_DELIVERED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_DATAGRAMS_DELIVERED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_GENERATED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_GENERATED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_LOST_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_LOST_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_REASSEMBLED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_REASSEMBLED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_FRAGMENTED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_FRAGMENTED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_OUTPUT_FRAGMENTS_CREATED_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_OUTPUT_FRAGMENTS_CREATED_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FRAGMENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_CANNOT_FRAGMENT_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_ERRORS_IN_OPTION_PROCESSING_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_ERRORS_IN_OPTION_PROCESSING_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_NO_ROUTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_NO_ROUTE_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_IP_VERSION_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_PACKETS_WITH_BAD_IP_VERSION_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_RAW_PACKETS_SENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_RAW_PACKETS_SENT_TXT_STR}, - {MSG_SHOWNETSTATUS_MBUF_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_MBUF_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_MBUF_BUFFERS_FROM_PAGE_POOL_TXT,(STRPTR)MSG_SHOWNETSTATUS_MBUF_BUFFERS_FROM_PAGE_POOL_TXT_STR}, - {MSG_SHOWNETSTATUS_MBUF_CLUSTERS_FROM_PAGE_POOL_TXT,(STRPTR)MSG_SHOWNETSTATUS_MBUF_CLUSTERS_FROM_PAGE_POOL_TXT_STR}, - {MSG_SHOWNETSTATUS_MBUF_FREE_CLUSTERS_TXT,(STRPTR)MSG_SHOWNETSTATUS_MBUF_FREE_CLUSTERS_TXT_STR}, - {MSG_SHOWNETSTATUS_MBUF_DROPS_TXT,(STRPTR)MSG_SHOWNETSTATUS_MBUF_DROPS_TXT_STR}, - {MSG_SHOWNETSTATUS_MBUF_WAIT_TXT,(STRPTR)MSG_SHOWNETSTATUS_MBUF_WAIT_TXT_STR}, - {MSG_SHOWNETSTATUS_MBUF_DRAIN_TXT,(STRPTR)MSG_SHOWNETSTATUS_MBUF_DRAIN_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_ROUTE_LOOKUPS_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_ROUTE_LOOKUPS_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_ROUTE_CACHE_MISSES_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_ROUTE_CACHE_MISSES_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_LOOKUPS_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_LOOKUPS_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_CACHE_MISSES_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_GROUP_ADDRESS_CACHE_MISSES_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_NO_ROUTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_NO_ROUTE_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_BAD_TUNNEL_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_BAD_TUNNEL_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_CANNOT_TUNNEL_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_CANNOT_TUNNEL_TXT_STR}, - {MSG_SHOWNETSTATUS_MULTICAST_CANNOT_WRONG_INTERFACE_TXT,(STRPTR)MSG_SHOWNETSTATUS_MULTICAST_CANNOT_WRONG_INTERFACE_TXT_STR}, - {MSG_SHOWNETSTATUS_ROUTING_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_ROUTING_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_ROUTING_BAD_REDIRECT_TXT,(STRPTR)MSG_SHOWNETSTATUS_ROUTING_BAD_REDIRECT_TXT_STR}, - {MSG_SHOWNETSTATUS_ROUTING_DYNAMIC_TXT,(STRPTR)MSG_SHOWNETSTATUS_ROUTING_DYNAMIC_TXT_STR}, - {MSG_SHOWNETSTATUS_ROUTING_NEW_GATEWAY_TXT,(STRPTR)MSG_SHOWNETSTATUS_ROUTING_NEW_GATEWAY_TXT_STR}, - {MSG_SHOWNETSTATUS_ROUTING_UNREACH_TXT,(STRPTR)MSG_SHOWNETSTATUS_ROUTING_UNREACH_TXT_STR}, - {MSG_SHOWNETSTATUS_ROUTING_WILDCARD_TXT,(STRPTR)MSG_SHOWNETSTATUS_ROUTING_WILDCARD_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_CONNATTEMPT_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_CONNATTEMPT_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_ACCEPTS_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_ACCEPTS_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_CONNECTS_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_CONNECTS_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_DROPS_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_DROPS_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_CONNDROPS_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_CONNDROPS_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_CLOSED_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_CLOSED_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SEGSTIMED_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SEGSTIMED_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RTTUPDATED_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RTTUPDATED_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_DELACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_DELACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_TIMEOUTDROP_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_TIMEOUTDROP_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_PERSISTTIMEO_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_PERSISTTIMEO_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_KEEPTIMEO_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_KEEPTIMEO_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_KEEPPROBE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_KEEPPROBE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_KEEPDROPS_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_KEEPDROPS_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDTOTAL_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDTOTAL_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDPACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDPACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDBYTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDBYTE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDREXMITPACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDREXMITPACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDREXMITBYTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDREXMITBYTE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDACKS_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDACKS_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDPROBE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDPROBE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDURG_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDURG_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDWINUP_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDWINUP_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SNDCTRL_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SNDCTRL_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVTOTAL_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVTOTAL_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVPACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVPACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVBYTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVBYTE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVBADSUM_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVBADSUM_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVBADOFF_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVBADOFF_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVSHORT_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVSHORT_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVDUPPACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVDUPPACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVDUPBYTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVDUPBYTE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVOOPACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVOOPACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVOOBYTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVOOBYTE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVPACKAFTERWIN_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVPACKAFTERWIN_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVBYTEAFTERWIN_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVBYTEAFTERWIN_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVAFTERCLOSE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVAFTERCLOSE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVWINPROBE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVWINPROBE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVDUPACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVDUPACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVACKTOOMUCH_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVACKTOOMUCH_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVACKPACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVACKPACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVACKBYTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVACKBYTE_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_RCVWINUPD_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_RCVWINUPD_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_PAWSDROP_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_PAWSDROP_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_PREDACK_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_PREDACK_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_PREDDAT_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_PREDDAT_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_PERSISTDROP_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_PERSISTDROP_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_BADSYN_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_BADSYN_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_IPACKETS_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_IPACKETS_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_HDROPS_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_HDROPS_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_BADSUM_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_BADSUM_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_BADLEN_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_BADLEN_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_NOPORT_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_NOPORT_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_NOPORTBCAST_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_NOPORTBCAST_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_FULLSOCK_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_FULLSOCK_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_OPACKETS_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_OPACKETS_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SOCKET_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SOCKET_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_LOCAL_TXT,(STRPTR)MSG_SHOWNETSTATUS_LOCAL_TXT_STR}, - {MSG_SHOWNETSTATUS_REMOTE_TXT,(STRPTR)MSG_SHOWNETSTATUS_REMOTE_TXT_STR}, - {MSG_SHOWNETSTATUS_RECEIVE_LEN_TXT,(STRPTR)MSG_SHOWNETSTATUS_RECEIVE_LEN_TXT_STR}, - {MSG_SHOWNETSTATUS_SEND_LEN_TXT,(STRPTR)MSG_SHOWNETSTATUS_SEND_LEN_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_SOCKET_LINE_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_SOCKET_LINE_TXT_STR}, - {MSG_SHOWNETSTATUS_NO_TCP_SOCKETS_IN_USE_TXT,(STRPTR)MSG_SHOWNETSTATUS_NO_TCP_SOCKETS_IN_USE_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_SOCKET_TITLE_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_SOCKET_TITLE_TXT_STR}, - {MSG_SHOWNETSTATUS_UDP_SOCKET_LINE_TXT,(STRPTR)MSG_SHOWNETSTATUS_UDP_SOCKET_LINE_TXT_STR}, - {MSG_SHOWNETSTATUS_NO_UDP_SOCKETS_IN_USE_TXT,(STRPTR)MSG_SHOWNETSTATUS_NO_UDP_SOCKETS_IN_USE_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME1_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME1_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME2_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME2_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME3_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME3_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME4_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME4_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME5_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME5_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME6_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME6_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME7_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME7_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME8_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME8_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME9_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME9_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_NAME10_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_NAME10_TXT_STR}, - {MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT,(STRPTR)MSG_SHOWNETSTATUS_NOT_CONFIGURED_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE1_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE1_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE2_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE2_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE3_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE3_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE4_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE4_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE5_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE5_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE6_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE6_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE7_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE7_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE8_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE8_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE9_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE9_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE10_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE10_TXT_STR}, - {MSG_SHOWNETSTATUS_TCP_FSM_STATE11_TXT,(STRPTR)MSG_SHOWNETSTATUS_TCP_FSM_STATE11_TXT_STR}, - {MSG_SHOWNETSTATUS_WILDCARD_TXT,(STRPTR)MSG_SHOWNETSTATUS_WILDCARD_TXT_STR}, - {MSG_SHOWNETSTATUS_SOME_TCP_SOCKETS_IN_USE_TXT,(STRPTR)MSG_SHOWNETSTATUS_SOME_TCP_SOCKETS_IN_USE_TXT_STR}, - {MSG_SHOWNETSTATUS_SOME_UDP_SOCKETS_IN_USE_TXT,(STRPTR)MSG_SHOWNETSTATUS_SOME_UDP_SOCKETS_IN_USE_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_READ_REQUESTS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_READ_REQUESTS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_WRITE_REQUESTS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_WRITE_REQUESTS_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_RECEIVED_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_RECEIVED_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_SENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_NUM_BYTES_SENT_TXT_STR}, - {MSG_SHOWNETSTATUS_UNKNOWN_HOST_TXT,(STRPTR)MSG_SHOWNETSTATUS_UNKNOWN_HOST_TXT_STR}, - {MSG_SHOWNETSTATUS_IP_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_IP_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_HARDWARE_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_HARDWARE_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_INCOMPLETE_HARDWARE_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INCOMPLETE_HARDWARE_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_ARP_ENTRY_PERMANENT_TXT,(STRPTR)MSG_SHOWNETSTATUS_ARP_ENTRY_PERMANENT_TXT_STR}, - {MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_PROXY_TXT,(STRPTR)MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_PROXY_TXT_STR}, - {MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_TXT,(STRPTR)MSG_SHOWNETSTATUS_ARP_ENTRY_PUBLISHED_TXT_STR}, - {MSG_SHOWNETSTATUS_ARP_CACHE_EMPTY_TXT,(STRPTR)MSG_SHOWNETSTATUS_ARP_CACHE_EMPTY_TXT_STR}, - {MSG_SHOWNETSTATUS_ARP_HEADER_TXT,(STRPTR)MSG_SHOWNETSTATUS_ARP_HEADER_TXT_STR}, - {MSG_SHOWNETSTATUS_NO_ARP_INFORMATION_TXT,(STRPTR)MSG_SHOWNETSTATUS_NO_ARP_INFORMATION_TXT_STR}, - {MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSFER_STATISTICS_TXT,(STRPTR)MSG_SHOWNETSTATUS_INTERFACE_INFO_TRANSFER_STATISTICS_TXT_STR}, - {MSG_SHOWNETSTATUS_STATUS_SUMMARY_TXT,(STRPTR)MSG_SHOWNETSTATUS_STATUS_SUMMARY_TXT_STR}, - {MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_ON_INTERFACE_TXT,(STRPTR)MSG_SHOWNETSTATUS_LOCAL_HOST_ADDRESS_ON_INTERFACE_TXT_STR}, - {MSG_SHOWNETSTATUS_DEFAULT_GATEWAY_ADDRESS_TXT,(STRPTR)MSG_SHOWNETSTATUS_DEFAULT_GATEWAY_ADDRESS_TXT_STR}, - {MSG_SHOWNETSTATUS_DOMAIN_NAME_SYSTEM_SERVERS_TXT,(STRPTR)MSG_SHOWNETSTATUS_DOMAIN_NAME_SYSTEM_SERVERS_TXT_STR}, - {MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_TXT,(STRPTR)MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_TXT_STR}, - {MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_UNSET_TXT,(STRPTR)MSG_SHOWNETSTATUS_DEFAULT_DOMAIN_NAME_UNSET_TXT_STR}, -#endif /* SHOWNETSTATUS_CATALOG_STRINGS */ - -#ifdef LOGVIEWER_CATALOG_STRINGS - {MSG_LOGVIEWER_PROJECT_MENU,(STRPTR)MSG_LOGVIEWER_PROJECT_MENU_STR}, - {MSG_LOGVIEWER_PROJECT_CLEAR_MENU,(STRPTR)MSG_LOGVIEWER_PROJECT_CLEAR_MENU_STR}, - {MSG_LOGVIEWER_PROJECT_SAVE_AS_MENU,(STRPTR)MSG_LOGVIEWER_PROJECT_SAVE_AS_MENU_STR}, - {MSG_LOGVIEWER_PROJECT_HIDE_MENU,(STRPTR)MSG_LOGVIEWER_PROJECT_HIDE_MENU_STR}, - {MSG_LOGVIEWER_PROJECT_QUIT_MENU,(STRPTR)MSG_LOGVIEWER_PROJECT_QUIT_MENU_STR}, - {MSG_LOGVIEWER_LOG_LEVEL_0_TXT,(STRPTR)MSG_LOGVIEWER_LOG_LEVEL_0_TXT_STR}, - {MSG_LOGVIEWER_LOG_LEVEL_1_TXT,(STRPTR)MSG_LOGVIEWER_LOG_LEVEL_1_TXT_STR}, - {MSG_LOGVIEWER_LOG_LEVEL_2_TXT,(STRPTR)MSG_LOGVIEWER_LOG_LEVEL_2_TXT_STR}, - {MSG_LOGVIEWER_LOG_LEVEL_3_TXT,(STRPTR)MSG_LOGVIEWER_LOG_LEVEL_3_TXT_STR}, - {MSG_LOGVIEWER_LOG_LEVEL_4_TXT,(STRPTR)MSG_LOGVIEWER_LOG_LEVEL_4_TXT_STR}, - {MSG_LOGVIEWER_LOG_LEVEL_5_TXT,(STRPTR)MSG_LOGVIEWER_LOG_LEVEL_5_TXT_STR}, - {MSG_LOGVIEWER_LOG_LEVEL_6_TXT,(STRPTR)MSG_LOGVIEWER_LOG_LEVEL_6_TXT_STR}, - {MSG_LOGVIEWER_LOG_LEVEL_7_TXT,(STRPTR)MSG_LOGVIEWER_LOG_LEVEL_7_TXT_STR}, - {MSG_LOGVIEWER_LABEL_0_TXT,(STRPTR)MSG_LOGVIEWER_LABEL_0_TXT_STR}, - {MSG_LOGVIEWER_LABEL_1_TXT,(STRPTR)MSG_LOGVIEWER_LABEL_1_TXT_STR}, - {MSG_LOGVIEWER_LABEL_2_TXT,(STRPTR)MSG_LOGVIEWER_LABEL_2_TXT_STR}, - {MSG_LOGVIEWER_LABEL_3_TXT,(STRPTR)MSG_LOGVIEWER_LABEL_3_TXT_STR}, - {MSG_LOGVIEWER_OK_TXT,(STRPTR)MSG_LOGVIEWER_OK_TXT_STR}, - {MSG_LOGVIEWER_REALLY_CLEAR_MESSAGE_LIST_TXT,(STRPTR)MSG_LOGVIEWER_REALLY_CLEAR_MESSAGE_LIST_TXT_STR}, - {MSG_LOGVIEWER_YES_NO_TXT,(STRPTR)MSG_LOGVIEWER_YES_NO_TXT_STR}, - {MSG_LOGVIEWER_OVERWRITE_APPEND_NEWNAME_CANCEL_TXT,(STRPTR)MSG_LOGVIEWER_OVERWRITE_APPEND_NEWNAME_CANCEL_TXT_STR}, - {MSG_LOGVIEWER_FILE_REQUESTER_TITLE_TXT,(STRPTR)MSG_LOGVIEWER_FILE_REQUESTER_TITLE_TXT_STR}, - {MSG_LOGVIEWER_FILE_REQUESTER_SAVE_TXT,(STRPTR)MSG_LOGVIEWER_FILE_REQUESTER_SAVE_TXT_STR}, - {MSG_LOGVIEWER_COMMODITIES_TITLE_TXT,(STRPTR)MSG_LOGVIEWER_COMMODITIES_TITLE_TXT_STR}, - {MSG_LOGVIEWER_COMMODITIES_DESCRIPTION_TXT,(STRPTR)MSG_LOGVIEWER_COMMODITIES_DESCRIPTION_TXT_STR}, - {MSG_LOGVIEWER_ORIGIN_UNKNOWN_TXT,(STRPTR)MSG_LOGVIEWER_ORIGIN_UNKNOWN_TXT_STR}, - {MSG_LOGVIEWER_FILE_ALREADY_EXISTS_TXT,(STRPTR)MSG_LOGVIEWER_FILE_ALREADY_EXISTS_TXT_STR}, - {MSG_LOGVIEWER_FILE_COULD_NOT_BE_OPENED_TXT,(STRPTR)MSG_LOGVIEWER_FILE_COULD_NOT_BE_OPENED_TXT_STR}, - {MSG_LOGVIEWER_ERROR_WRITING_TO_FILE_TXT,(STRPTR)MSG_LOGVIEWER_ERROR_WRITING_TO_FILE_TXT_STR}, - {MSG_LOGVIEWER_NO_DEFAULT_PUB_SCREEN_TXT,(STRPTR)MSG_LOGVIEWER_NO_DEFAULT_PUB_SCREEN_TXT_STR}, - {MSG_LOGVIEWER_NO_PUBLIC_SCREEN_FONT_TXT,(STRPTR)MSG_LOGVIEWER_NO_PUBLIC_SCREEN_FONT_TXT_STR}, - {MSG_LOGVIEWER_NO_VISUAL_INFO_TXT,(STRPTR)MSG_LOGVIEWER_NO_VISUAL_INFO_TXT_STR}, - {MSG_LOGVIEWER_NO_MENU_TXT,(STRPTR)MSG_LOGVIEWER_NO_MENU_TXT_STR}, - {MSG_LOGVIEWER_NO_MENU_LAYOUT_TXT,(STRPTR)MSG_LOGVIEWER_NO_MENU_LAYOUT_TXT_STR}, - {MSG_LOGVIEWER_NO_SCREEN_DRAW_INFO_TXT,(STRPTR)MSG_LOGVIEWER_NO_SCREEN_DRAW_INFO_TXT_STR}, - {MSG_LOGVIEWER_NO_SIZING_IMAGE_TXT,(STRPTR)MSG_LOGVIEWER_NO_SIZING_IMAGE_TXT_STR}, - {MSG_LOGVIEWER_NO_VERTICAL_SCROLLER_TXT,(STRPTR)MSG_LOGVIEWER_NO_VERTICAL_SCROLLER_TXT_STR}, - {MSG_LOGVIEWER_NO_HORIZONTAL_SCROLLER_TXT,(STRPTR)MSG_LOGVIEWER_NO_HORIZONTAL_SCROLLER_TXT_STR}, - {MSG_LOGVIEWER_NO_WINDOW_TXT,(STRPTR)MSG_LOGVIEWER_NO_WINDOW_TXT_STR}, - {MSG_LOGVIEWER_NO_USER_CLIP_REGION_TXT,(STRPTR)MSG_LOGVIEWER_NO_USER_CLIP_REGION_TXT_STR}, - {MSG_LOGVIEWER_NO_LIBRARY_VERSION_TXT,(STRPTR)MSG_LOGVIEWER_NO_LIBRARY_VERSION_TXT_STR}, - {MSG_LOGVIEWER_NO_LIBRARY_TXT,(STRPTR)MSG_LOGVIEWER_NO_LIBRARY_TXT_STR}, - {MSG_LOGVIEWER_NO_MEMORY_POOL_TXT,(STRPTR)MSG_LOGVIEWER_NO_MEMORY_POOL_TXT_STR}, - {MSG_LOGVIEWER_NO_SCROLLER_CLASS_TXT,(STRPTR)MSG_LOGVIEWER_NO_SCROLLER_CLASS_TXT_STR}, - {MSG_LOGVIEWER_NO_FILE_REQUESTER_TXT,(STRPTR)MSG_LOGVIEWER_NO_FILE_REQUESTER_TXT_STR}, - {MSG_LOGVIEWER_NO_COMMODITIES_PORT_TXT,(STRPTR)MSG_LOGVIEWER_NO_COMMODITIES_PORT_TXT_STR}, - {MSG_LOGVIEWER_NO_COMMODITIES_BROKER_TXT,(STRPTR)MSG_LOGVIEWER_NO_COMMODITIES_BROKER_TXT_STR}, - {MSG_LOGVIEWER_NO_COMMODITIES_HOTKEY_TXT,(STRPTR)MSG_LOGVIEWER_NO_COMMODITIES_HOTKEY_TXT_STR}, - {MSG_LOGVIEWER_NO_COMMODITIES_SYSTEM_TXT,(STRPTR)MSG_LOGVIEWER_NO_COMMODITIES_SYSTEM_TXT_STR}, - {MSG_LOGVIEWER_NO_HOOK_PORT_TXT,(STRPTR)MSG_LOGVIEWER_NO_HOOK_PORT_TXT_STR}, - {MSG_LOGVIEWER_NO_LOG_HOOK_TXT,(STRPTR)MSG_LOGVIEWER_NO_LOG_HOOK_TXT_STR}, -#endif /* LOGVIEWER_CATALOG_STRINGS */ - -#ifdef NETSHUTDOWN_CATALOG_STRINGS - {MSG_NETSHUTDOWN_NO_UTILITY_TXT,(STRPTR)MSG_NETSHUTDOWN_NO_UTILITY_TXT_STR}, - {MSG_NETSHUTDOWN_NO_MEMORY_TXT,(STRPTR)MSG_NETSHUTDOWN_NO_MEMORY_TXT_STR}, - {MSG_NETSHUTDOWN_NO_MSGPORT_TXT,(STRPTR)MSG_NETSHUTDOWN_NO_MSGPORT_TXT_STR}, - {MSG_NETSHUTDOWN_NO_TIMER_REQUEST_TXT,(STRPTR)MSG_NETSHUTDOWN_NO_TIMER_REQUEST_TXT_STR}, - {MSG_NETSHUTDOWN_NO_TIMER_DEVICE_TXT,(STRPTR)MSG_NETSHUTDOWN_NO_TIMER_DEVICE_TXT_STR}, - {MSG_NETSHUTDOWN_TRYING_TO_SHUT_DOWN_TXT,(STRPTR)MSG_NETSHUTDOWN_TRYING_TO_SHUT_DOWN_TXT_STR}, - {MSG_NETSHUTDOWN_SHUTDOWN_FAILED_TXT,(STRPTR)MSG_NETSHUTDOWN_SHUTDOWN_FAILED_TXT_STR}, - {MSG_NETSHUTDOWN_SHUTDOWN_DONE_TXT,(STRPTR)MSG_NETSHUTDOWN_SHUTDOWN_DONE_TXT_STR}, - {MSG_NETSHUTDOWN_SHUTDOWN_ABORTED_TXT,(STRPTR)MSG_NETSHUTDOWN_SHUTDOWN_ABORTED_TXT_STR}, - {MSG_NETSHUTDOWN_SHUTDOWN_TIMEOUT_TXT,(STRPTR)MSG_NETSHUTDOWN_SHUTDOWN_TIMEOUT_TXT_STR}, - {MSG_NETSHUTDOWN_NETWORK_NOT_IN_USE_TXT,(STRPTR)MSG_NETSHUTDOWN_NETWORK_NOT_IN_USE_TXT_STR}, -#endif /* NETSHUTDOWN_CATALOG_STRINGS */ - -#ifdef ROADSHOWCONTROL_CATALOG_STRINGS - {MSG_ROADSHOWCONTROL_NO_UTILITY_TXT,(STRPTR)MSG_ROADSHOWCONTROL_NO_UTILITY_TXT_STR}, - {MSG_ROADSHOWCONTROL_CANNOT_OPEN_BSDSOCKET_TXT,(STRPTR)MSG_ROADSHOWCONTROL_CANNOT_OPEN_BSDSOCKET_TXT_STR}, - {MSG_ROADSHOWCONTROL_BSDSOCKET_HAS_NO_ROADSHOWDATA_API_TXT,(STRPTR)MSG_ROADSHOWCONTROL_BSDSOCKET_HAS_NO_ROADSHOWDATA_API_TXT_STR}, - {MSG_ROADSHOWCONTROL_NO_ROADSHOW_DATA_TXT,(STRPTR)MSG_ROADSHOWCONTROL_NO_ROADSHOW_DATA_TXT_STR}, - {MSG_ROADSHOWCONTROL_COULD_NOT_SET_OPTION_TXT,(STRPTR)MSG_ROADSHOWCONTROL_COULD_NOT_SET_OPTION_TXT_STR}, - {MSG_ROADSHOWCONTROL_COULD_NOT_SET_ENV_VARIABLE_TXT,(STRPTR)MSG_ROADSHOWCONTROL_COULD_NOT_SET_ENV_VARIABLE_TXT_STR}, -#endif /* ROADSHOWCONTROL_CATALOG_STRINGS */ - -#ifdef REMOVENETINTERFACE_CATALOG_STRINGS - {MSG_REMOVENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT,(STRPTR)MSG_REMOVENETINTERFACE_CANNOT_OPEN_BSDSOCKET_TXT_STR}, - {MSG_REMOVENETINTERFACE_INTERFACE_REMOVED_TXT,(STRPTR)MSG_REMOVENETINTERFACE_INTERFACE_REMOVED_TXT_STR}, - {MSG_REMOVENETINTERFACE_COULD_NOT_REMOVE_INTERFACE_TXT,(STRPTR)MSG_REMOVENETINTERFACE_COULD_NOT_REMOVE_INTERFACE_TXT_STR}, -#endif /* REMOVENETINTERFACE_CATALOG_STRINGS */ -}; - -#endif /* CATCOMP_ARRAY */ - - -/****************************************************************************/ - - - -#endif /* ROADSHOW_H */