2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
31 typedef unsigned char BYTE;
32 typedef unsigned short WORD;
33 typedef unsigned long DWORD;
35 typedef struct local_address {
39 typedef struct net_address {
41 local_address node_id;
45 typedef struct ipx_header {
48 BYTE transport_control;
50 net_address destination;
54 typedef struct ecb_header {
60 BYTE ipx_reserved[14];
62 local_address immediate_address;
64 WORD fragment_pointer[2];
68 typedef struct packet_data {
70 byte data[IPX_MAX_DATA_SIZE];
73 typedef struct ipx_packet {
79 typedef struct user_address {
86 int Ipx_num_users = 0;
87 user_address Ipx_users[MAX_USERS];
89 #define MAX_NETWORKS 64
90 int Ipx_num_networks = 0;
91 uint Ipx_networks[MAX_NETWORKS];
93 int ipx_packetnum = 0;
95 #define MAX_PACKETS 64
97 static packet_data packet_buffers[MAX_PACKETS];
98 static short packet_free_list[MAX_PACKETS];
99 static int num_packets = 0;
100 static int largest_packet_index = 0;
101 static short packet_size[MAX_PACKETS];
104 ubyte ipx_installed=0;
105 WORD ipx_vector_segment;
106 WORD ipx_vector_offset;
107 ubyte ipx_socket_life = 0; // 0=closed at prog termination, 0xff=closed when requested.
108 DWORD ipx_network = 0;
109 local_address ipx_my_node;
110 WORD ipx_num_packets=32; // 32 Ipx packets
111 ipx_packet * packets;
113 ushort ipx_packets_selector;
115 ecb_header * last_ecb=NULL;
118 void free_packet( int id )
120 packet_buffers[id].packetnum = -1;
121 packet_free_list[ --num_packets ] = id;
122 if (largest_packet_index==id)
123 while ((--largest_packet_index>0) && (packet_buffers[largest_packet_index].packetnum == -1 ));
126 int ipx_get_packet_data( ubyte * data )
128 int i, n, best, best_id, size;
130 for (i=1; i<ipx_num_packets; i++ ) {
131 if ( !packets[i].ecb.in_use ) {
132 got_new_packet( &packets[i].ecb );
133 packets[i].ecb.in_use = 0;
134 ipx_listen_for_packet(&packets[i].ecb);
142 for (i=0; i<=largest_packet_index; i++ ) {
143 if ( packet_buffers[i].packetnum > -1 ) {
145 if ( best == -1 || (packet_buffers[i].packetnum<best) ) {
146 best = packet_buffers[i].packetnum;
152 //mprintf( (0, "Best id = %d, pn = %d, last_ecb = %x, len=%x, ne = %d\n", best_id, best, last_ecb, lastlen, neterrors ));
153 //mprintf( (1, "<%d> ", neterrors ));
155 if ( best_id < 0 ) return 0;
157 size = packet_size[best_id];
158 memcpy( data, packet_buffers[best_id].data, size );
159 free_packet(best_id);
164 unsigned int swap_short( unsigned int short );
165 #pragma aux swap_short parm [eax] = "xchg al,ah";
167 void got_new_packet( ecb_header * ecb )
171 unsigned short datasize;
175 p = (ipx_packet *)ecb;
177 if ( p->ecb.in_use ) { neterrors++; return; }
178 if ( p->ecb.completion_code ) { neterrors++; return; }
180 // Error( "Recieve error %d for completion code", p->ecb.completion_code );
182 if ( memcmp( &p->ipx.source.node_id, &ipx_my_node, 6 ) ) {
183 datasize=swap_short(p->ipx.length);
185 datasize -= sizeof(ipx_header);
186 // Find slot to put packet in...
187 if ( datasize > 0 && datasize <= sizeof(packet_data) ) {
188 if ( num_packets >= MAX_PACKETS ) {
189 //printf( 1, "IPX: Packet buffer overrun!!!\n" );
193 id = packet_free_list[ num_packets++ ];
194 if (id > largest_packet_index ) largest_packet_index = id;
195 packet_size[id] = datasize-sizeof(int);
196 packet_buffers[id].packetnum = p->pd.packetnum;
197 if ( packet_buffers[id].packetnum < 0 ) { neterrors++; return; }
198 memcpy( packet_buffers[id].data, p->pd.data, packet_size[id] );
205 //ipx_listen_for_packet(&p->ecb);
208 ubyte * ipx_get_my_local_address()
210 return ipx_my_node.address;
213 ubyte * ipx_get_my_server_address()
215 return (ubyte *)&ipx_network;
218 void ipx_listen_for_packet(ecb_header * ecb )
220 dpmi_real_regs rregs;
222 memset(&rregs,0,sizeof(dpmi_real_regs));
223 rregs.ebx = 4; // Listen For Packet function
224 rregs.esi = DPMI_real_offset(ecb);
225 rregs.es = DPMI_real_segment(ecb);
226 dpmi_real_int386x( 0x7A, &rregs );
229 void ipx_cancel_listen_for_packet(ecb_header * ecb )
231 dpmi_real_regs rregs;
232 memset(&rregs,0,sizeof(dpmi_real_regs));
233 rregs.ebx = 6; // IPX Cancel event
234 rregs.esi = DPMI_real_offset(ecb);
235 rregs.es = DPMI_real_segment(ecb);
236 dpmi_real_int386x( 0x7A, &rregs );
240 void ipx_send_packet(ecb_header * ecb )
242 dpmi_real_regs rregs;
243 memset(&rregs,0,sizeof(dpmi_real_regs));
244 rregs.ebx = 3; // Send Packet function
245 rregs.esi = DPMI_real_offset(ecb);
246 rregs.es = DPMI_real_segment(ecb);
247 dpmi_real_int386x( 0x7A, &rregs );
253 ubyte local_target[6];
256 void ipx_get_local_target( ubyte * server, ubyte * node, ubyte * local_target )
258 net_xlat_info * info;
259 dpmi_real_regs rregs;
261 // Get dos memory for call...
262 info = (net_xlat_info *)dpmi_get_temp_low_buffer( sizeof(net_xlat_info) );
263 assert( info != NULL );
264 memcpy( info->network, server, 4 );
265 memcpy( info->node, node, 6 );
267 memset(&rregs,0,sizeof(dpmi_real_regs));
269 rregs.ebx = 2; // Get Local Target
270 rregs.es = DPMI_real_segment(info);
271 rregs.esi = DPMI_real_offset(info->network);
272 rregs.edi = DPMI_real_offset(info->local_target);
274 dpmi_real_int386x( 0x7A, &rregs );
276 // Save the local target...
277 memcpy( local_target, info->local_target, 6 );
282 dpmi_real_regs rregs;
283 if ( ipx_installed ) {
284 // When using VLM's instead of NETX, the sockets don't
285 // seem to automatically get closed, so we must explicitly
286 // close them at program termination.
288 memset(&rregs,0,sizeof(dpmi_real_regs));
289 rregs.edx = ipx_socket;
290 rregs.ebx = 1; // Close socket
291 dpmi_real_int386x( 0x7A, &rregs );
296 //---------------------------------------------------------------
297 // Initializes all IPX internals.
298 // If socket_number==0, then opens next available socket.
299 // Returns: 0 if successful.
300 // -1 if socket already open.
301 // -2 if socket table full.
302 // -3 if IPX not installed.
303 // -4 if couldn't allocate low dos memory
304 // -5 if error with getting internetwork address
306 int ipx_init( int socket_number, int show_address )
308 dpmi_real_regs rregs;
309 ubyte *ipx_real_buffer;
316 // init packet buffers.
317 for (i=0; i<MAX_PACKETS; i++ ) {
318 packet_buffers[i].packetnum = -1;
319 packet_free_list[i] = i;
322 largest_packet_index = 0;
324 // Get the IPX vector
325 memset(&rregs,0,sizeof(dpmi_real_regs));
326 rregs.eax=0x00007a00;
327 dpmi_real_int386x( 0x2f, &rregs );
329 if ( (rregs.eax & 0xFF) != 0xFF ) {
332 ipx_vector_offset = rregs.edi & 0xFFFF;
333 ipx_vector_segment = rregs.es;
334 //printf( "IPX entry point at %.4x:%.4x\n", ipx_vector_segment, ipx_vector_offset );
336 // Open a socket for IPX
338 memset(&rregs,0,sizeof(dpmi_real_regs));
339 swab( (char *)&socket_number,(char *)&ipx_socket, 2 );
340 rregs.edx = ipx_socket;
341 rregs.eax = ipx_socket_life;
342 rregs.ebx = 0; // Open socket
343 dpmi_real_int386x( 0x7A, &rregs );
345 ipx_socket = rregs.edx & 0xFFFF;
347 if ( rregs.eax & 0xFF ) {
348 //mprintf( (1, "IPX error opening channel %d\n", socket_number-IPX_DEFAULT_SOCKET ));
354 // Find our internetwork address
355 ipx_real_buffer = dpmi_get_temp_low_buffer( 1024 ); // 1k block
356 if ( ipx_real_buffer == NULL ) {
357 //printf( "Error allocation realmode memory\n" );
361 memset(&rregs,0,sizeof(dpmi_real_regs));
362 rregs.ebx = 9; // Get internetwork address
363 rregs.esi = DPMI_real_offset(ipx_real_buffer);
364 rregs.es = DPMI_real_segment(ipx_real_buffer);
365 dpmi_real_int386x( 0x7A, &rregs );
367 if ( rregs.eax & 0xFF ) {
368 //printf( "Error getting internetwork address!\n" );
372 memcpy( &ipx_network, ipx_real_buffer, 4 );
373 memcpy( &ipx_my_node, &ipx_real_buffer[4], 6 );
375 Ipx_num_networks = 0;
376 memcpy( &Ipx_networks[Ipx_num_networks++], &ipx_network, 4 );
378 if ( show_address ) {
379 printf( "My IPX addresss is " );
380 printf( "%02X%02X%02X%02X/", ipx_real_buffer[0],ipx_real_buffer[1],ipx_real_buffer[2],ipx_real_buffer[3] );
381 printf( "%02X%02X%02X%02X%02X%02X\n", ipx_real_buffer[4],ipx_real_buffer[5],ipx_real_buffer[6],ipx_real_buffer[7],ipx_real_buffer[8],ipx_real_buffer[9] );
385 packets = dpmi_real_malloc( sizeof(ipx_packet)*ipx_num_packets, &ipx_packets_selector );
386 if ( packets == NULL ) {
387 //printf( "Couldn't allocate real memory for %d packets\n", ipx_num_packets );
390 if (!dpmi_lock_region( packets, sizeof(ipx_packet)*ipx_num_packets )) {
391 //printf( "Couldn't lock real memory for %d packets\n", ipx_num_packets );
394 memset( packets, 0, sizeof(ipx_packet)*ipx_num_packets );
396 for (i=1; i<ipx_num_packets; i++ ) {
397 packets[i].ecb.in_use = 0x1d;
398 //packets[i].ecb.in_use = 0;
399 packets[i].ecb.socket_id = ipx_socket;
400 packets[i].ecb.fragment_count = 1;
401 packets[i].ecb.fragment_pointer[0] = DPMI_real_offset(&packets[i].ipx);
402 packets[i].ecb.fragment_pointer[1] = DPMI_real_segment(&packets[i].ipx);
403 packets[i].ecb.fragment_size = sizeof(ipx_packet)-sizeof(ecb_header); //-sizeof(ecb_header);
405 ipx_listen_for_packet(&packets[i].ecb);
408 packets[0].ecb.socket_id = ipx_socket;
409 packets[0].ecb.fragment_count = 1;
410 packets[0].ecb.fragment_pointer[0] = DPMI_real_offset(&packets[0].ipx);
411 packets[0].ecb.fragment_pointer[1] = DPMI_real_segment(&packets[0].ipx);
412 packets[0].ipx.packet_type = 4; // IPX packet
413 packets[0].ipx.destination.socket_id = ipx_socket;
414 // memcpy( packets[0].ipx.destination.network_id, &ipx_network, 4 );
415 memset( packets[0].ipx.destination.network_id, 0, 4 );
420 void ipx_send_packet_data( ubyte * data, int datasize, ubyte *network, ubyte *address, ubyte *immediate_address )
422 assert(ipx_installed);
424 Assert(datasize < IPX_MAX_DATA_SIZE);
426 // Make sure no one is already sending something
427 while( packets[0].ecb.in_use )
431 // if (packets[0].ecb.completion_code)
432 // Error("IPX: Send error %d for completion code\n", packets[0].ecb.completion_code );
434 // Fill in destination address
435 if ( memcmp( network, &ipx_network, 4 ) )
436 memcpy( packets[0].ipx.destination.network_id, network, 4 );
438 memset( packets[0].ipx.destination.network_id, 0, 4 );
439 memcpy( packets[0].ipx.destination.node_id.address, address, 6 );
440 memcpy( packets[0].ecb.immediate_address.address, immediate_address, 6 );
441 packets[0].pd.packetnum = ipx_packetnum++;
443 // Fill in data to send
444 packets[0].ecb.fragment_size = sizeof(ipx_header) + sizeof(int) + datasize;
446 assert( datasize > 1 );
447 assert( packets[0].ecb.fragment_size <= 576 );
449 memcpy( packets[0].pd.data, data, datasize );
452 ipx_send_packet( &packets[0].ecb );
456 void ipx_send_broadcast_packet_data( ubyte * data, int datasize )
459 ubyte broadcast[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
460 ubyte local_address[6];
462 // Set to all networks besides mine
463 for (i=0; i<Ipx_num_networks; i++ ) {
464 if ( memcmp( &Ipx_networks[i], &ipx_network, 4 ) ) {
465 ipx_get_local_target( (ubyte *)&Ipx_networks[i], broadcast, local_address );
466 ipx_send_packet_data( data, datasize, (ubyte *)&Ipx_networks[i], broadcast, local_address );
468 ipx_send_packet_data( data, datasize, (ubyte *)&Ipx_networks[i], broadcast, broadcast );
472 //OLDipx_send_packet_data( data, datasize, (ubyte *)&ipx_network, broadcast, broadcast );
474 // Send directly to all users not on my network or in the network list.
475 for (i=0; i<Ipx_num_users; i++ ) {
476 if ( memcmp( Ipx_users[i].network, &ipx_network, 4 ) ) {
477 for (j=0; j<Ipx_num_networks; j++ ) {
478 if (!memcmp( Ipx_users[i].network, &Ipx_networks[j], 4 ))
481 ipx_send_packet_data( data, datasize, Ipx_users[i].network, Ipx_users[i].node, Ipx_users[i].address );
488 // Sends a non-localized packet... needs 4 byte server, 6 byte address
489 void ipx_send_internetwork_packet_data( ubyte * data, int datasize, ubyte * server, ubyte *address )
491 ubyte local_address[6];
493 if ( (*(uint *)server) != 0 ) {
494 ipx_get_local_target( server, address, local_address );
495 ipx_send_packet_data( data, datasize, server, address, local_address );
497 // Old method, no server info.
498 ipx_send_packet_data( data, datasize, server, address, address );
502 int ipx_change_default_socket( ushort socket_number )
506 dpmi_real_regs rregs;
508 if ( !ipx_installed ) return -3;
511 memset(&rregs,0,sizeof(dpmi_real_regs));
512 swab( (char *)&socket_number,(char *)&new_ipx_socket, 2 );
513 rregs.edx = new_ipx_socket;
514 rregs.eax = ipx_socket_life;
515 rregs.ebx = 0; // Open socket
516 dpmi_real_int386x( 0x7A, &rregs );
518 new_ipx_socket = rregs.edx & 0xFFFF;
520 if ( rregs.eax & 0xFF ) {
521 //printf( (1, "IPX error opening channel %d\n", socket_number-IPX_DEFAULT_SOCKET ));
525 for (i=1; i<ipx_num_packets; i++ ) {
526 ipx_cancel_listen_for_packet(&packets[i].ecb);
529 // Close existing socket...
530 memset(&rregs,0,sizeof(dpmi_real_regs));
531 rregs.edx = ipx_socket;
532 rregs.ebx = 1; // Close socket
533 dpmi_real_int386x( 0x7A, &rregs );
535 ipx_socket = new_ipx_socket;
537 // Repost all listen requests on the new socket...
538 for (i=1; i<ipx_num_packets; i++ ) {
539 packets[i].ecb.in_use = 0;
540 packets[i].ecb.socket_id = ipx_socket;
541 ipx_listen_for_packet(&packets[i].ecb);
544 packets[0].ecb.socket_id = ipx_socket;
545 packets[0].ipx.destination.socket_id = ipx_socket;
548 // init packet buffers.
549 for (i=0; i<MAX_PACKETS; i++ ) {
550 packet_buffers[i].packetnum = -1;
551 packet_free_list[i] = i;
554 largest_packet_index = 0;
559 void ipx_read_user_file(char * filename)
563 char temp_line[132], *p1;
566 if (!filename) return;
570 fp = fopen( filename, "rt" );
573 printf( "Broadcast Users:\n" );
575 while (fgets(temp_line, 132, fp)) {
579 p1 = strchr(temp_line,'\n'); if (p1) *p1 = '\0';
580 p1 = strchr(temp_line,';'); if (p1) *p1 = '\0';
581 if (strlen(temp_line) == 0) continue; //skip blank lines
582 //n = sscanf( temp_line, "%2x%2x%2x%2x/%2x%2x%2x%2x%2x%2x", &tmp.network[0], &tmp.network[1], &tmp.network[2], &tmp.network[3], &tmp.node[0], &tmp.node[1], &tmp.node[2],&tmp.node[3], &tmp.node[4], &tmp.node[5] );
583 //if ( n != 10 ) continue;
584 np = strchr(temp_line,'/');
586 Error("Invalid entry <%s> on line %d of IPX User file <%s>",temp_line,ln,filename);
588 n = sscanf( temp_line, "%x", &net);
590 Error("Invalid entry <%s> on line %d of IPX User file <%s>",temp_line,ln,filename);
592 tmp.network[3] = (net & 0xff); net >>= 8;
593 tmp.network[2] = (net & 0xff); net >>= 8;
594 tmp.network[1] = (net & 0xff); net >>= 8;
595 tmp.network[0] = (net & 0xff);
597 n = sscanf( np, "%2x%2x%2x%2x%2x%2x", &tmp.node[0], &tmp.node[1], &tmp.node[2],&tmp.node[3], &tmp.node[4], &tmp.node[5] );
599 Error("Invalid entry <%s> on line %d of IPX User file <%s>\n"
600 " Node address must be 6 bytes (12 digits)",temp_line,ln,filename);
601 if ( Ipx_num_users < MAX_USERS ) {
602 ubyte * ipx_real_buffer = (ubyte *)&tmp;
603 ipx_get_local_target( tmp.network, tmp.node, tmp.address );
604 Ipx_users[Ipx_num_users++] = tmp;
605 printf( "%02X%02X%02X%02X/", ipx_real_buffer[0],ipx_real_buffer[1],ipx_real_buffer[2],ipx_real_buffer[3] );
606 printf( "%02X%02X%02X%02X%02X%02X\n", ipx_real_buffer[4],ipx_real_buffer[5],ipx_real_buffer[6],ipx_real_buffer[7],ipx_real_buffer[8],ipx_real_buffer[9] );
608 printf( "Too many addresses in %s! (Limit of %d)\n", filename, MAX_USERS );
618 void ipx_read_network_file(char * filename)
622 char temp_line[132], *p1;
625 if (!filename) return;
627 fp = fopen( filename, "rt" );
630 printf( "Using Networks:\n" );
631 for (i=0; i<Ipx_num_networks; i++ ) {
632 ubyte * n1 = (ubyte *)&Ipx_networks[i];
633 printf("* %02x%02x%02x%02x\n", n1[0], n1[1], n1[2], n1[3] );
636 while (fgets(temp_line, 132, fp)) {
639 p1 = strchr(temp_line,'\n'); if (p1) *p1 = '\0';
640 p1 = strchr(temp_line,';'); if (p1) *p1 = '\0';
641 if (strlen(temp_line) == 0) continue; //skip blank lines
642 //n = sscanf( temp_line, "%2x%2x%2x%2x", &tmp.network[0], &tmp.network[1], &tmp.network[2], &tmp.network[3] );
643 //if ( n != 4 ) continue;
644 n = sscanf( temp_line, "%x", &net );
646 Error("Invalid entry <%s> on line %d of IPX Net file <%s>",temp_line,ln,filename);
648 tmp.network[3] = (net & 0xff); net >>= 8;
649 tmp.network[2] = (net & 0xff); net >>= 8;
650 tmp.network[1] = (net & 0xff); net >>= 8;
651 tmp.network[0] = (net & 0xff);
654 if ( Ipx_num_networks < MAX_NETWORKS ) {
656 for (j=0; j<Ipx_num_networks; j++ )
657 if ( !memcmp( &Ipx_networks[j], tmp.network, 4 ) )
659 if ( j >= Ipx_num_networks ) {
660 memcpy( &Ipx_networks[Ipx_num_networks++], tmp.network, 4 );
661 printf(" %02x%02x%02x%02x\n", tmp.network[0], tmp.network[1], tmp.network[2], tmp.network[3] );
664 printf( "Too many networks in %s! (Limit of %d)\n", filename, MAX_NETWORKS );
673 //---typedef struct rip_entry {
679 //---typedef struct rip_packet {
680 //--- ushort operation; //1=request, 2=response
681 //--- rip_entry rip[50];
685 //---void ipx_find_all_servers()
688 //--- rip_packet * rp;
689 //--- assert(ipx_installed);
691 //--- ipx_change_default_socket( 0x0453 );
692 //--- // ipx_change_default_socket( 0x5304 );
694 //--- // Make sure no one is already sending something
695 //--- while( packets[0].ecb.in_use )
699 //--- if (packets[0].ecb.completion_code) {
700 //--- printf( "AAAA:Send error %d for completion code\n", packets[0].ecb.completion_code );
704 //--- rp = (rip_packet *)&packets[0].pd;
706 //--- // Fill in destination address
708 //--- char mzero1[] = {0,0,0,1};
709 //--- char mzero[] = {0,0,0,0,0,1};
710 //--- char immediate[6];
711 //--- //memcpy( packets[0].ipx.destination.network_id, &ipx_network, 4 );
712 //--- //memcpy( packets[0].ipx.destination.node_id.address, ipx_my_node.address, 6 );
714 //--- memcpy( packets[0].ipx.destination.network_id, mzero1, 4 );
715 //--- memcpy( packets[0].ipx.destination.node_id.address, mzero, 6 );
717 //--- memcpy( packets[0].ipx.destination.socket_id, &ipx_socket, 2 );
718 //--- memcpy( packets[0].ipx.source.network_id, &ipx_network, 4 );
719 //--- memcpy( packets[0].ipx.source.node_id.address, ipx_my_node.address, 6 );
720 //--- memcpy( packets[0].ipx.source.socket_id, &ipx_socket, 2 );
721 //--- //memcpy( packets[0].ecb.immediate_address.address, ipx_my_node.address, 6 );
722 //--- //mzero1[3] = 1;
723 //--- //memcpy( packets[0].ipx.destination.network_id, mzero1, 4 );
724 //--- //mzero[5] = 1;
725 //--- //memcpy( packets[0].ipx.destination.node_id.address, mzero, 6 );
726 //--- //ipx_get_local_target( mzero1, mzero, immediate );
727 //--- //memcpy( packets[0].ecb.immediate_address.address, mzero, 6 );
728 //--- //memcpy( packets[0].ecb.immediate_address.address, immediate, 6 );
729 //--- //mzero[5] = 0;
732 //--- packets[0].ipx.packet_type = 1; // RIP packet
734 //--- // Fill in data to send
735 //--- packets[0].ecb.fragment_size = sizeof(ipx_header) + sizeof(rip_packet);
736 //--- assert( packets[0].ecb.fragment_size <= 576 );
738 //--- rp->operation = 0; // Request
739 //--- for (i=0;i<50; i++) {
740 //--- rp->rip[i].network = 0xFFFFFFFF;
741 //--- rp->rip[i].nhops = 0;
742 //--- rp->rip[i].nticks = 0;
746 //--- ipx_send_packet( &packets[0].ecb );
748 //--- for (i=0;i<50; i++) {
749 //--- if ( rp->rip[i].network != 0xFFFFFFFF )
750 //--- printf( "Network = %8x, Hops=%d, Ticks=%d\n", rp->rip[i].network, rp->rip[i].nhops, rp->rip[i].nticks );