
in ipxutil.c send_packet is called with lesser number of arguments wrt the
send_packet func prototype in \rtrware\include\lslproto.h. so send_packet(
is been masked in ipxutil.c. the def in lslproto.h is correct when compared
with the actual function in lsltx.c.

Sanjay -- in ipxrout.c, change line 83 from "#ifndef __LSL__" to "#ifdef __LSL__"
otherwise, the packet is not checked to see if it is an ipx packet.

in ipxtimer.c (IPX_router_timer) changes have been done to detect servers 
immediately after ppp link is established. change is also done in ipxinit.c 
for VIRTUAL_PORT_OPEN in ipxcontrol routine.

in ipxtimer.c for sending periodic SAPs & RIPs the check for timers of RIP & SAP
as being null is removed corresponding changes made in  ripls.c sapls.c transmit
routines which were checking for enabling for periodic_SAP_broadcasts.

in vipx.h ETHERNET_ADDRESS is defined as broadcast_address
in vipingstr.h #define								VARIABLE_NUMBER_OF_BYTES 0x01;
in ipxlearn.c both the routines are modified for enabling learning.
in ipxinit.c for learning all code are added by me. 

-------------------------------------------------------------------
Changes by Sanjay for spoofing and NetWare 4.x 
----------------------------------------------

1. In KIPX.H introduced two new IPX_PACKET_TYPES enum constants
	NW4_IPX_WATCHDOG_PACKET		= 0x99
	NW4_SERIALIZATION_PACKET	= 0x9B
2. In IPXROUT.C, in IPX_router_rx_packet, added two new cases at line 156.
	case NW4_IPX_WATCHDOG_PACKET:
	case NW4_SERIALIZATION_PACKET:
3. In IPXROUT.C, in ipx_data_to_route(), modified check for a IPX watchdog
   packet to consider a packet type of 11h (NCP used in NetWare 2.x) or 
   a packet type of 99h (used in NetWare 4.x) also.
4. In IPXTIMER.C, in IPX_router_timer(), moved the "#ifdef IPX_WAN_ENABLED"
   statement to exclude the call to spx_connection_timer() and the 
   commented call to issue_periodic_client_watchdog().
-----------------------------------------------------------------------
Changes by Sanjay to fix problem of routing on ports that are disabled
----------------------------------------------------------------------
(Problem was related to learning code)

1. in ipxlearn.c in learn_ipx_network_address(), removed the code temporarily
   enabling and disabling the port.
2. in ipxtimer.c in IPX_router_timer(), added additional check before
   call to learn_ipx_network_address(). This check makes sure that the port
   we attempt to learn on is enabled.
3. in ipxinit.c, IPX_control(), removed code enabling port on 
   OPEN_VIRTUAL_PORT call. Instead added code to check if port is enabled
   and to break if not enabled.
4. in CLOSE_VIRTUAL_PORT case, moved code setting port_enabled to FALSE to
   just before returning from the function.
5. in ipxrout.c, in IPX_router_rx_packet(), moved around code checking if
   port is enabled to before code checking for learning network address.
-----------------------------------------------------------------------
/* Sanjay 11,Jan,1996 -- changes for SNMP support */

1. Modified VSNMPMIB.H in the SNMP directory to correct info for IPX types
   and read-write stuff
2. In VIPXSNMP.H, in all the structures related to the mib strings, specific
   SNMP variables are get or set from. But looks like these SNMP variables
   are not at all initialized in this version of the routerware IPX code.
   They seem to have migrated half-way to the SNMP code. So will change
   structures back to use the old routerware variables for IPX SNMP info.
3. Added the field
	ULONG	number_of_tx_compression_errors;
   to IPX_MIB_COUNTERS structure


----------------------------------------------------------------------------
in ipxinit.c for CLOSE_VIRTUAL_PORT port_enabled is not being made FALSE.
----------------------------------------------------------------------------
Sanjay,16,Jan,96 -
1. Introduced completely redone VIPXSNMP.H.
2. New IPXSNMPA.C having a few more functions to test and set snmp variables.
3. As per the MIB definition for IPX, all the tables use a variable that 
   refers to the instance of IPX used. Since in our router, the number
   of instances of IPX is always 1, we use a constant instance identifier
   of "1". But the MIB definition expects this instance identifier to
   be present in each entry of each table defined. Currently we have no
   such field. But the standard SNMP access library supplied by RouterWare
   expects such a field in the appropriate table that it indexes. So
   in all tables (Port table, RIP table and SAP table), included a new
   field "ipx_instance" that will be set to the value of 1 whenever a
   new entry is made to the table.

   So,
   - added the field ipx_instance to IPX_PORT_CLASS
   - added the field ipx_instance to ROUTE_LIST_ENTRY
   - added the field ipx_instance to SAP_LIST_ENTRY

   Also, added code in the appropriate functions to set this field to 1
   when a new instance is created.
4. Modified IPX_PORT_CLASS in vipxstr.h so as to introduce a field
   called "wan" if IPX_WAN is not defined. Also introduced a class
   call IPX_DUMMY_WAN_CLASS to define mib parameters for non-existent
   IPXWAN.
5. In KIPX.H, made all enums related to SNMP 1 based. Also introduced a
   couple of enums (for RIP_CIRCUIT_TYPE and SAP_CIRCUIT_TYPE).
6. In the structure ROUTE_LIST_ENTRY, added a field 'next_hop_network_number'.
    This is for the purpose of SNMP support. Suitably modified the
    function add_route_entry() in ipxripls.c to set this field for each
    new entry added.
7. In the IPX_CLASS structure, included two new fields 
	ULONG	number_of_rip_sys_entries;
	ULONG	number_of_sap_sys_entries;
8. Following strings though read-write are maintained as read-only as it
    does not make sense in our case.

    ipxBasicSysInstance  - we have only one instance of IPX
    ipxBasicSysExistState - our IPX is permanently running (maybe we can
    	treat this as enable/disable for IPX
    ipxBasicSysNetNumber - Our net number is added to the routes table --
    	the standard routines do not provide a method to remote this
	route from the sys table and add the new network number
    ipxBasicSysNode - Same argument as above.
    ipxBasicSysName - Same argument as above for services table.

    ipxAdvSysInstance - Same argument as for ipxBasicSysInstance
    ipxAsvSysMaxPathSplits - We don't use this info

    ipxCircSysInstance - We will always have 7 virtual ports.
    ipxCircIndex - Index is what we determine it to be -- cannot change this
    ipxCircOperState - Meaningless at our IPX level.
    ipxCircIfIndex - Will be what we say
    ipxCircType - Currently we support certain types -- no changing this
    ipxCircDialName - No IPXWAN
    ipxCircCompressState - No IPXWAN
    ipxCircCompressSlots - No IPXWAN
    ipxCircStaticStatus - no IPXWAN

    (Static tables are ignored)

    ripSysInstance, sapSysInstance - No sense in our case, so no change

    ripSysState, sapSysState - Always enabled
    ripCircSysInstance,sapCircSysInstance - This is what we decide it to be
    ripCircIndex,sapCircIndex - Cannot change this
    ripCircPacketSize,sapCircPacketSize - Keep this constant

9. Following strings are read-write

    ipxAdvSysMaxHops - WRITABLE
    ipxCircExistState - WRITABLE
    ipxCircName - WRITABLE

    ipxCircLocalMaxPacketSize - WRITABLE - but no check on what is written

    ripCircState,sapCircState - WRITABLE
    ripCircPace,sapCircPace - WRITABLE
    ripCircAgeMultiplier,sapCircAgeMultiplier - WRITABLE
    ripCircUpdate,sapCircUpdate - WRITABLE

    sapCircGetNearestServerReply - WRITABLE

----------------------------------------------------------------------------
Sanjay 22,Jan,96
----------------
Futher changes for SNMP support
-------------------------------
1. ipxinit.c,initialize_IPX_router() - Moved the calls to 
		initialize_ipx_basic_snmp_table();
		initialize_ipx_adv_snmp_table();
		initialize_ipx_rip_sap_snmp_table();
   to after the call to initialize_internal_ids() - this is 'coz the
   snmp inits use info set in the call to initialize_internal_ids().
2. ipxutil.c,send_ipx_packet() - removed the code incrementing and
   adjusting the ipxBasicSysOutRequests count. Instead searched for the
   function send_ipx_packet() in all the code and place the increment
   code before the call to this function, except in the place where
   send_ipx_packet() was called to forward a routed packet. This was
   done because the earlier method of incrementing ipxBasicSysOutRequests
   in send_ipx_packet() and adjusting it by ipxAdvSysForwPackets was
   resulting in a -ve number for the ipxBasicSysOutRequests count. Unable
   to figure this out.
3. ipxinit.c,initialize_ipx_circuit_snmp_table() - included code to set
   the parameters for ipxCircDelay and ipxCircThroughput. The latter
   required code additions to lslproto.h, vlslctrl.h, lslport.c and vlslstr.h
   to introduce a new function lsl_port_speed() that will return the
   interface speed in bits-per-second.
4. vipxsnmp.h - set the need_to_increment field of structure entries for
   ipxCircIfIndex, ipxCircIndex, ripCircIndex and sapCircIndex to TRUE to
   make them 1 based.
5. modified accesnmp.c in rwutils directory to change way snmp_get_or_set_
   boolean_plus_one() works. Now on setting, value is checked to be 1 or
   2 and if so a the value is decremented by one and set. Else value is
   ignored. this is way things should be.
----------------------------------------------------------------------------
Sanjay 24, Jan, 1996
--------------------
Change in the way IPX watchdog packets are recognised
-----------------------------------------------------
Earlier some change was done to recognise watchdog packets under Netware 4.x.
This change is not correct. The change made was to detect IPX watchdog
packets as having a packet type of NW4_WATCHDOG_PACKET (99h). But actually
under Netware 4.x, watchdog packets seem to use a random packet type > 32.
So the check fails. 
So modified the checking so that a watchdog packet is detected using the
condition as below
  if (packet size == sizeof(watchdog packet) && 2nd byte of packet data == '?' or 'Y')
  	then packet is a watchdog packet.


Made a similar change for serialization packets. ipxrout.c, 
received_IPX_Packet(), modified code in the default switch case to
check socket number for serialization socket and so call handler for
serialization packets. This is because in netware 4.x, there is not
pre-defined packet type for serialzation packets and such packets so
will come to our default clause.
----------------------------------------------------------------------------
Sanjay 25, Jan, 1996
--------------------
Netbios name caching
--------------------
1. The .ini files and VNVIPX.H did not have settings to enable netbios
   name caching. Added such settings.
2. IPXNETBS.C, check_age_of_netbios_names() - the check for netbios name
   aging was not right modified from the one below to the one after that
			FROM
if (++sptr_netbios_name_entry->timer_value >= ipx_class.port[port_number].netbios_name_cache_timer)
			 TO
++sptr_netbios_name_entry->timer_value;
if (sptr_netbios_name_entry->timer_value + ipx_class.port[port_number].netbios_name_cache_timer < router_timer)
3. ipxinit.c, included code to init the netbios_name_cache_timer field to 50.

3,Feb,96
--------
If port was disabled, the rx routine was returning PACKET_NOT_RECOGNISED.
This caused LSL to pass the packet onto the next stack and ultimately to
the bridge rx routine which was bridging the packet. So changed return
value to PACKET_RECOGNISED_BUT_NOT_FORWARDED.

13,Feb,96
---------
ipxrip.c, ipxsap.c -- included counts to count ipx rip and sap incorrect
packet. Modified vipxsnmp.h approp. for ripSysIncorrectPackets and sap...


22,Feb,96
---------
ipxinit.c -- commented out code in the case for CLOSE_VIRTUAL_PORT in
the ipx control functions. This is because is a Dial-on-Demand environ,
the answering side will inform CLOSE_VIRTUAL_PORT when line goes down
on non-use. So the existing code was disabling the port and broadcasting
the loss of a route. This shouldn't happen. In DoD, the line though down
is not yet out.

26,April,96
-----------
ipxsnmpa.c, snmp_get_or_set_circ_age_multiplier() - divided age multiplier
returned value by 60 as we were also storing it multiplied by 60

ipxsnmpa.c, snmp_get_or_set_circ_pace() - value passed for SET was not being
checked for 0. This was causing a divide overflow.

29, August, 1996
----------------
ipxtimer.c -- in the check timer functions, rearranged conditionals.
defs.h -- set number of ipx ports to 8 instead of 7 to take into account the
   	  internal port.

Srikar, 6 Jan 97
File	:	ipxsnmpa.c
Functions:	snmp_get_or_set_circ_max_packet_size
		snmp_get_or_set_circ_pace
		snmp_get_or_set_circ_update_time
a.Funcitons are mode to return FAIL on failing range checks

Sachin 17/01/1997
-----------------
File     : IPXINIT.C
Function : initialize_IPX_router()
	During initialization, IPX gets the addresses of all ports by making
a call to lsl_control() with the GET_MAC_ADDRESS command. LSL goes on
to ask the device driver for the MAC address. PPP returns 0 ad the MAC
address. So, IPX node number for all PPP ports used to be 000000000000,
which is a problem with WIN 95. Win 95 does not pick up packets with
source node address 000000000000. So, now what we do is for IPX's purposes,
the MAC addresses of all the PPP ports are the same as the ethernet address.
Note that we are passing 0 as the port number to get the mac addresses of
all the virtual ports.

Naveen.P.N. 22/04/1997
----------------------
enum CRC is changed to  IPX_CRC and corr change are made in .c files. This
is done to avoid CRC which is there in CCP module.



