]> icculus.org git repositories - btb/d2x.git/blob - arch/linux_ipx_udp.c
Minor dist fix
[btb/d2x.git] / arch / linux_ipx_udp.c
1 /*
2  * $Source: /cvs/cvsroot/d2x/arch/linux_ipx_udp.c,v $
3  * $Revision: 1.3 $
4  * $Author: bradleyb $
5  * $Date: 2001-01-29 13:35:08 $
6  *
7  * IPX driver for native Linux TCP/IP networking (UDP implementation)
8  *   Version 0.99.2
9  * Contact Jan [Lace] Kratochvil <short@ucw.cz> for assistance
10  * (no "It somehow doesn't work! What should I do?" complaints, please)
11  * Special thanks to Vojtech Pavlik <vojtech@ucw.cz> for testing.
12  *
13  * Also you may see KIX - KIX kix out KaliNix (in Linux-Linux only):
14  *   http://atrey.karlin.mff.cuni.cz/~short/sw/kix.c.gz
15  *
16  * Primarily based on ipx_kali.c - "IPX driver for KaliNix interface"
17  *   which is probably mostly by Jay Cotton <jay@kali.net>.
18  * Parts shamelessly stolen from my KIX v0.99.2 and GGN v0.100
19  *
20  * Changes:
21  * --------
22  * 0.99.1 - now the default broadcast list also contains all point-to-point
23  *          links with their destination peer addresses
24  * 0.99.2 - commented a bit :-) 
25  *        - now adds to broadcast list each host it gets some packet from
26  *          which is already not covered by local physical ethernet broadcast
27  *        - implemented short-signature packet format
28  *        - compatibility mode for old D1X releases due to the previous bullet
29  *
30  * Configuration:
31  * --------------
32  * No network server software is needed, neither KIX nor KaliNIX.
33  *
34  * Add command line argument "-udp". In default operation D1X will send
35  * broadcasts too all the local interfaces found. But you may also use
36  * additional parameter specified after "-udp" to modify the default
37  * broadcasting style and UDP port numbers binding:
38  *
39  * ./d1x -udp [@SHIFT]=HOST_LIST   Broadcast ONLY to HOST_LIST
40  * ./d1x -udp [@SHIFT]+HOST_LIST   Broadcast both to local ifaces & to HOST_LIST
41  *
42  * HOST_LIST is a comma (',') separated list of HOSTs:
43  * HOST is an IPv4 address (so-called quad like 192.168.1.2) or regular hostname
44  * HOST can also be in form 'address:SHIFT'
45  * SHIFT sets the UDP port base offset (e.g. +2), can be used to run multiple
46  *       clients on one host simultaneously. This SHIFT has nothing to do
47  *       with the dynamic-sockets (PgUP/PgDOWN) option in Descent, it's another
48  *       higher-level differentiation option.
49  *
50  * Examples:
51  * ---------
52  * ./d1x -udp
53  *  - Run D1X to participate in normal local network (Linux only, of course)
54  *
55  * ./d1x -udp @1=localhost:2 & ./d1x -udp @2=localhost:1
56  *  - Run two clients simultaneously fighting each other (only each other)
57  *
58  * ./d1x -udp =192.168.4.255
59  *  - Run distant Descent which will participate with remote network
60  *    192.168.4.0 with netmask 255.255.255.0 (broadcast has 192.168.4.255)
61  *  - You'll have to also setup hosts in that network accordingly:
62  * ./d1x -udp +UPPER_DISTANT_MACHINE_NAME
63  *
64  * Have fun!
65  *
66  * $Log: not supported by cvs2svn $
67  */
68
69 #ifdef HAVE_CONFIG_H
70 #include <conf.h>
71 #endif
72
73 #include <stdio.h>
74 #include <string.h>
75 #include <netinet/in.h> /* for htons & co. */
76 #include <unistd.h>
77 #include <stdarg.h>
78 #include <netdb.h>
79 #include <stdlib.h>
80 #include <net/if.h>
81 #include <sys/ioctl.h>
82 #include <ctype.h>
83
84 #include "ipx_drv.h"
85 #include "args.h"
86
87 extern unsigned char ipx_MyAddress[10];
88
89 // #define UDPDEBUG
90
91 #define UDP_BASEPORT 28342
92 #define PORTSHIFT_TOLERANCE 0x100
93 #define MAX_PACKETSIZE 8192
94
95 /* Packet format: first is the signature { 0xD1,'X' } which can be also
96  * { 'D','1','X','u','d','p'} for old-fashioned packets.
97  * Then follows virtual socket number (as changed during PgDOWN/PgUP)
98  * in network-byte-order as 2 bytes (u_short). After such 4/8 byte header
99  * follows raw data as communicated with D1X network core functions.
100  */
101
102 // Length HAS TO BE 6!
103 #define D1Xudp "D1Xudp"
104 // Length HAS TO BE 2!
105 #define D1Xid "\xD1X"
106
107 static int open_sockets = 0;
108 static int dynamic_socket = 0x401;
109 static const int val_one=1;
110
111 /* OUR port. Can be changed by "@X[+=]..." argument (X is the shift value)
112  */
113
114 static int baseport=UDP_BASEPORT;
115
116 /* Have we some old D1X in network and have we to maintain compatibility?
117  * FIXME: Following scenario is braindead:
118  *                                           A  (NEW) , B  (OLD) , C  (NEW)
119  *   host A) We start new D1X.               A-newcomm, B-none   , C-none
120  *   host B) We start OLD D1X.               A-newcomm, B-oldcomm, C-none
121  *   Now host A hears host B and switches:   A-oldcomm, B-oldcomm, C-none
122  *   host C) We start new D1X.               A-oldcomm, B-oldcomm, C-newcomm
123  *   Now host C hears host A/B and switches: A-oldcomm, B-oldcomm, C-oldcomm
124  *   Now host B finishes:                    A-oldcomm, B-none   , C-oldcomm
125  *
126  * But right now we have hosts A and C, both new code equipped but
127  * communicating wastefully by the OLD protocol! Bummer.
128  */
129
130 static char compatibility=0;
131
132 static int have_empty_address() {
133         int i;
134         for (i = 0; i < 10 && !ipx_MyAddress[i]; i++) ;
135         return i == 10;
136 }
137
138 #define MSGHDR "IPX_udp: "
139
140 static void msg(const char *fmt,...)
141 {
142 va_list ap;
143         fputs(MSGHDR,stdout);
144         va_start(ap,fmt);
145         vprintf(fmt,ap);
146         va_end(ap);
147         putchar('\n');
148 }
149
150 static void chk(void *p)
151 {
152         if (p) return;
153         msg("FATAL: Virtual memory exhausted!");
154         exit(EXIT_FAILURE);
155 }
156
157 #define FAIL(m...) do { msg(#m); return -1; } while (0)
158
159 /* Find as much as MAX_BRDINTERFACES during local iface autoconfiguration.
160  * Note that more interfaces can be added during manual configuration
161  * or host-received-packet autoconfiguration
162  */
163
164 #define MAX_BRDINTERFACES 16
165
166 /* We require the interface to be UP and RUNNING to accept it.
167  */
168
169 #define IF_REQFLAGS (IFF_UP|IFF_RUNNING)
170
171 /* We reject any interfaces declared as LOOPBACK type.
172  */
173 #define IF_NOTFLAGS (IFF_LOOPBACK)
174
175 static struct sockaddr_in *broads,broadmasks[MAX_BRDINTERFACES];
176 static int broadnum,masksnum,broadsize;
177
178 /* We'll check whether the "broads" array of destination addresses is now
179  * full and so needs expanding.
180  */
181
182 static void chkbroadsize(void)
183 {
184         if (broadnum<broadsize) return;
185         broadsize=broadsize?broadsize*2:8;
186         chk(broads=realloc(broads,sizeof(*broads)*broadsize));
187 }
188
189 /* This function is called during init and has to grab all system interfaces
190  * and collect their broadcast-destination addresses (and their netmasks).
191  * Typically it founds only one ethernet card and so returns address in
192  * the style "192.168.1.255" with netmask "255.255.255.0".
193  * Broadcast addresses are filled into "broads", netmasks to "broadmasks".
194  */
195
196 /* Stolen from my GGN */
197 static int addiflist(void)
198 {
199 unsigned cnt=MAX_BRDINTERFACES,i,j;
200 struct ifconf ifconf;
201 int sock;
202 struct sockaddr_in *sinp,*sinmp;
203
204         free(broads);
205         if ((sock=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP))<0)
206                 FAIL("Creating socket() failure during broadcast detection: %m");
207
208 #ifdef SIOCGIFCOUNT
209         if (ioctl(sock,SIOCGIFCOUNT,&cnt))
210                 { /* msg("Getting iterface count error: %m"); */ }
211         else
212                 cnt=cnt*2+2;
213 #endif
214
215         chk(ifconf.ifc_req=alloca((ifconf.ifc_len=cnt*sizeof(struct ifreq))));
216         if (ioctl(sock,SIOCGIFCONF,&ifconf)||ifconf.ifc_len%sizeof(struct ifreq)) {
217                 close(sock);
218                 FAIL("ioctl(SIOCGIFCONF) failure during broadcast detection: %m");
219                 }
220         cnt=ifconf.ifc_len/sizeof(struct ifreq);
221         chk(broads=malloc(cnt*sizeof(*broads)));
222         broadsize=cnt;
223         for (i=j=0;i<cnt;i++) {
224                 if (ioctl(sock,SIOCGIFFLAGS,ifconf.ifc_req+i)) {
225                         close(sock);
226                         FAIL("ioctl(udp,\"%s\",SIOCGIFFLAGS) error: %m",ifconf.ifc_req[i].ifr_name);
227                         }
228                 if (((ifconf.ifc_req[i].ifr_flags&IF_REQFLAGS)!=IF_REQFLAGS)||
229                                  (ifconf.ifc_req[i].ifr_flags&IF_NOTFLAGS))
230                         continue;
231                 if (ioctl(sock,(ifconf.ifc_req[i].ifr_flags&IFF_BROADCAST?SIOCGIFBRDADDR:SIOCGIFDSTADDR),ifconf.ifc_req+i)) {
232                         close(sock);
233                         FAIL("ioctl(udp,\"%s\",SIOCGIF{DST/BRD}ADDR) error: %m",ifconf.ifc_req[i].ifr_name);
234                         }
235
236                 sinp =(struct sockaddr_in *)&ifconf.ifc_req[i].ifr_broadaddr;
237                 sinmp=(struct sockaddr_in *)&ifconf.ifc_req[i].ifr_netmask  ;
238                 if (sinp->sin_family!=AF_INET || sinmp->sin_family!=AF_INET) continue;
239                 broads[j]=*sinp;
240                 broads[j].sin_port=UDP_BASEPORT; //FIXME: No possibility to override from cmdline
241                 broadmasks[j]=*sinmp;
242                 j++;
243                 }
244         broadnum=j;
245         masksnum=j;
246         return(0);
247 }
248
249 #define addreq(a,b) ((a).sin_port==(b).sin_port&&(a).sin_addr.s_addr==(b).sin_addr.s_addr)
250
251 /* Previous function addiflist() can (and probably will) report multiple
252  * same addresses. On some Linux boxes is present both device "eth0" and
253  * "dummy0" with the same IP addreesses - we'll filter it here.
254  */
255
256 static void unifyiflist(void)
257 {
258 int d=0,s,i;
259
260         for (s=0;s<broadnum;s++) {
261                 for (i=0;i<s;i++)
262                         if (addreq(broads[s],broads[i])) break;
263                 if (i>=s) broads[d++]=broads[s];
264                 }
265         broadnum=d;
266 }
267
268 static unsigned char qhbuf[6];
269
270 /* Parse PORTSHIFT numeric parameter
271  */
272
273 static void portshift(const char *cs)
274 {
275 long port;
276 unsigned short ports=0;
277
278         port=atol(cs);
279         if (port<-PORTSHIFT_TOLERANCE || port>+PORTSHIFT_TOLERANCE)
280                 msg("Invalid portshift in \"%s\", tolerance is +/-%d",cs,PORTSHIFT_TOLERANCE);
281         else ports=htons(port);
282         memcpy(qhbuf+4,&ports,2);
283 }
284
285 /* Do hostname resolve on name "buf" and return the address in buffer "qhbuf".
286  */
287 static unsigned char *queryhost(char *buf)
288 {
289 struct hostent *he;
290 char *s;
291 char c=0;
292
293         if ((s=strrchr(buf,':'))) {
294           c=*s;
295           *s='\0';
296           portshift(s+1);
297           }
298         else memset(qhbuf+4,0,2);
299         he=gethostbyname((char *)buf);
300         if (s) *s=c;
301         if (!he) {
302                 msg("Error resolving my hostname \"%s\"",buf);
303                 return(NULL);
304                 }
305         if (he->h_addrtype!=AF_INET || he->h_length!=4) {
306           msg("Error parsing resolved my hostname \"%s\"",buf);
307                 return(NULL);
308                 }
309         if (!*he->h_addr_list) {
310           msg("My resolved hostname \"%s\" address list empty",buf);
311                 return(NULL);
312                 }
313         memcpy(qhbuf,(*he->h_addr_list),4);
314         return(qhbuf);
315 }
316
317 /* Dump raw form of IP address/port by fancy output to user
318  */
319 static void dumpraddr(unsigned char *a)
320 {
321 short port;
322         printf("[%u.%u.%u.%u]",a[0],a[1],a[2],a[3]);
323         port=(signed short)ntohs(*(unsigned short *)(a+4));
324         if (port) printf(":%+d",port);
325 }
326
327 /* Like dumpraddr() but for structure "sockaddr_in"
328  */
329
330 static void dumpaddr(struct sockaddr_in *sin)
331 {
332 unsigned short ports;
333
334         memcpy(qhbuf+0,&sin->sin_addr,4);
335         ports=htons(((short)ntohs(sin->sin_port))-UDP_BASEPORT);
336         memcpy(qhbuf+4,&ports,2);
337         dumpraddr(qhbuf);
338 }
339
340 /* Startup... Uninteresting parsing...
341  */
342
343 static int ipx_udp_GetMyAddress(void) {
344
345 char buf[256];
346 int i;
347 char *s,*s2,*ns;
348
349         if (!have_empty_address())
350                 return 0;
351
352         if (!((i=FindArg("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL;
353
354         if (gethostname(buf,sizeof(buf))) FAIL("Error getting my hostname");
355         if (!(queryhost(buf))) FAIL("Querying my own hostname \"%s\"",buf);
356
357         if (s) while (*s=='@') {
358                 portshift(++s);
359                 while (isdigit(*s)) s++;
360                 }
361
362         memset(ipx_MyAddress+0,0,4);
363         memcpy(ipx_MyAddress+4,qhbuf,6);
364         baseport+=(short)ntohs(*(unsigned short *)(qhbuf+4));
365
366         if (!s || (s && !*s)) addiflist();
367         else {
368                 if (*s=='+') addiflist();
369                 s++;
370                 for (;;) {
371 struct sockaddr_in *sin;
372                         while (isspace(*s)) s++;
373                         if (!*s) break;
374                         for (s2=s;*s2 && *s2!=',';s2++);
375                         chk(ns=malloc(s2-s+1));
376                         memcpy(ns,s,s2-s);
377                         ns[s2-s]='\0';
378                         if (!queryhost(ns)) msg("Ignored broadcast-destination \"%s\" as being invalid",ns);
379                         free(ns);
380                         chkbroadsize();
381                         sin=broads+(broadnum++);
382                         sin->sin_family=AF_INET;
383                         memcpy(&sin->sin_addr,qhbuf+0,4);
384                         sin->sin_port=htons(((short)ntohs(*(unsigned short *)(qhbuf+4)))+UDP_BASEPORT);
385                         s=s2+(*s2==',');
386                         }
387                 }
388
389         unifyiflist();
390
391         printf(MSGHDR "Using TCP/IP address ");
392         dumpraddr(ipx_MyAddress+4);
393         putchar('\n');
394         if (broadnum) {
395                 printf(MSGHDR "Using %u broadcast-dest%s:",broadnum,(broadnum==1?"":"s"));
396                 for (i=0;i<broadnum;i++) {
397                         putchar(' ');
398                         dumpaddr(broads+i);
399                         }
400                 putchar('\n');
401                 }
402
403         return 0;
404 }
405
406 /* We should probably avoid such insanity here as during PgUP/PgDOWN
407  * (virtual port number change) we wastefully destroy/create the same
408  * socket here (binded always to "baseport"). FIXME.
409  * "open_sockets" can be only 0 or 1 anyway.
410  */
411
412 static int ipx_udp_OpenSocket(ipx_socket_t *sk, int port) {
413 struct sockaddr_in sin;
414
415         if (!open_sockets)
416                 if (have_empty_address())
417                 if (ipx_udp_GetMyAddress() < 0) FAIL("Error getting my address");
418
419         msg("OpenSocket on D1X socket port %d",port);
420
421         if (!port)
422                 port = dynamic_socket++;
423
424         if ((sk->fd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP)) < 0) {
425                 sk->fd = -1;
426                 FAIL("socket() creation failed on port %d: %m",port);
427                 }
428   if (setsockopt(sk->fd,SOL_SOCKET,SO_BROADCAST,&val_one,sizeof(val_one))) {
429                 if (close(sk->fd)) msg("close() failed during error recovery: %m");
430                 sk->fd=-1;
431                 FAIL("setsockopt(SO_BROADCAST) failed: %m");
432                 }
433         sin.sin_family=AF_INET;
434         sin.sin_addr.s_addr=htonl(INADDR_ANY);
435         sin.sin_port=htons(baseport);
436         if (bind(sk->fd,(struct sockaddr *)&sin,sizeof(sin))) {
437                 if (close(sk->fd)) msg("close() failed during error recovery: %m");
438                 sk->fd=-1;
439                 FAIL("bind() to UDP port %d failed: %m",baseport);
440                 }
441
442         open_sockets++;
443         sk->socket = port;
444         return 0;
445 }
446
447 /* The same comment as in previous "ipx_udp_OpenSocket"...
448  */
449
450 static void ipx_udp_CloseSocket(ipx_socket_t *mysock) {
451         if (!open_sockets) {
452                 msg("close w/o open");
453                 return;
454         }
455         msg("CloseSocket on D1X socket port %d",mysock->socket);
456         if (close(mysock->fd))
457                 msg("close() failed on CloseSocket D1X socket port %d: %m",mysock->socket);
458         mysock->fd=-1;
459         if (--open_sockets) {
460                 msg("(closesocket) %d sockets left", open_sockets);
461                 return;
462         }
463 }
464
465 /* Here we'll send the packet to our host. If it is unicast packet, send
466  * it to IP address/port as retrieved from IPX address. Otherwise (broadcast)
467  * we'll repeat the same data to each host in our broadcasting list.
468  */
469
470 static int ipx_udp_SendPacket(ipx_socket_t *mysock, IPXPacket_t *IPXHeader,
471  u_char *data, int dataLen) {
472         struct sockaddr_in toaddr,*dest;
473         int i=dataLen;
474         int bcast;
475         char *buf;
476
477 #ifdef UDPDEBUG
478         msg("SendPacket enter, dataLen=%d",dataLen);
479 #endif
480         if (dataLen<0 || dataLen>MAX_PACKETSIZE) return -1;
481         chk(buf=alloca(8+dataLen));
482         if (compatibility) memcpy(buf+0,D1Xudp,6),buf+=6;
483         else               memcpy(buf+0,D1Xid ,2),buf+=2;
484         memcpy(buf+0,IPXHeader->Destination.Socket,2);
485         memcpy(buf+2,data,dataLen);
486  
487         toaddr.sin_family=AF_INET;
488         memcpy(&toaddr.sin_addr,IPXHeader->Destination.Node+0,4);
489         toaddr.sin_port=htons(((short)ntohs(*(unsigned short *)(IPXHeader->Destination.Node+4)))+UDP_BASEPORT);
490
491         for (bcast=(toaddr.sin_addr.s_addr==htonl(INADDR_BROADCAST)?0:-1);bcast<broadnum;bcast++) {
492                 if (bcast>=0) dest=broads+bcast;
493                 else dest=&toaddr;
494         
495 #ifdef UDPDEBUG
496                 printf(MSGHDR "sendto((%d),Node=[4] %02X %02X,Socket=%02X %02X,s_port=%u,",
497                         dataLen,
498                         IPXHeader->Destination.Node  [4],IPXHeader->Destination.Node  [5],
499                         IPXHeader->Destination.Socket[0],IPXHeader->Destination.Socket[1],
500                         ntohs(dest->sin_port));
501                 dumpaddr(dest);
502                 puts(").");
503 #endif
504                 i=sendto(mysock->fd,buf-(compatibility?6:2),(compatibility?8:4)+dataLen,
505                         0,(struct sockaddr *)dest,sizeof(*dest));
506                 if (bcast==-1) return (i<8?-1:i-8);
507                 }
508         return(dataLen);
509 }
510
511 /* Here we will receive new packet to the given buffer. Both formats of packets
512  * are supported, we fallback to old format when first obsolete packet is seen.
513  * If the (valid) packet is received from unknown host, we will add it to our
514  * broadcasting list. FIXME: For now such autoconfigured hosts are NEVER removed.
515  */
516
517 static int ipx_udp_ReceivePacket(ipx_socket_t *s, char *outbuf, int outbufsize, 
518  struct ipx_recv_data *rd) {
519         int size;
520         struct sockaddr_in fromaddr;
521         int fromaddrsize=sizeof(fromaddr);
522         unsigned short ports;
523         size_t offs;
524         int i;
525
526         if ((size=recvfrom(s->fd,outbuf,outbufsize,0,(struct sockaddr *)&fromaddr,&fromaddrsize))<0)
527                 return -1;
528 #ifdef UDPDEBUG
529         printf(MSGHDR "recvfrom((%d-8=%d),",size,size-8);
530         dumpaddr(&fromaddr);
531         puts(").");
532 #endif
533         if (fromaddr.sin_family!=AF_INET) return -1;
534         if (size<4) return -1;
535         if (memcmp(outbuf+0,D1Xid,2)) {
536                 if (size<8 || memcmp(outbuf+0,D1Xudp,6)) return -1;
537                 if (!compatibility) {
538                         compatibility=1;
539                         fputs(MSGHDR "Received obsolete packet from ",stdout);
540                         dumpaddr(&fromaddr);
541                         puts(", upgrade that machine.\n" MSGHDR "Turning on compatibility mode...");
542                         }
543                 offs=6;
544                 }
545         else offs=2;
546
547         /* Lace: (dst_socket & src_socket) should be network-byte-order by comment in include/ipx_drv.h */
548         /*       This behaviour presented here is broken. It is not used anywhere, so why bother? */
549         rd->src_socket = ntohs(*(unsigned short *)(outbuf+offs));
550         if (rd->src_socket != s->socket) {
551 #ifdef UDPDEBUG
552                 msg(" - pkt was dropped (dst=%d,my=%d)",rd->src_socket,s->socket);
553 #endif
554                 return -1;
555                 }
556         rd->dst_socket = s->socket;
557
558         for (i=0;i<broadnum;i++) {
559                 if (i>=masksnum) {
560                         if (addreq(fromaddr,broads[i])) break; 
561                         }
562                 else {
563                         if (fromaddr.sin_port==broads[i].sin_port
564                         &&( fromaddr.sin_addr.s_addr & broadmasks[i].sin_addr.s_addr)
565                         ==(broads[i].sin_addr.s_addr & broadmasks[i].sin_addr.s_addr)) break;
566                         }
567                 }
568         if (i>=broadnum) {
569                 chkbroadsize();
570                 broads[broadnum++]=fromaddr;
571                 fputs(MSGHDR "Adding host ",stdout);
572                 dumpaddr(&fromaddr);
573                 puts(" to broadcasting address list");
574                 }
575
576         memmove(outbuf,outbuf+offs+2,size-(offs+2));
577         size-=offs+2;
578
579         memcpy(rd->src_node+0,&fromaddr.sin_addr,4);
580         ports=htons(ntohs(fromaddr.sin_port)-UDP_BASEPORT);
581         memcpy(rd->src_node+4,&ports,2);
582         memset(rd->src_network, 0, 4);
583         rd->pkt_type = 0;
584 #ifdef UDPDEBUG
585         printf(MSGHDR "ReceivePacket: size=%d,from=",size);
586         dumpraddr(rd->src_node);
587         putchar('\n');
588 #endif
589
590         return size;
591 }
592
593 struct ipx_driver ipx_udp = {
594         ipx_udp_GetMyAddress,
595         ipx_udp_OpenSocket,
596         ipx_udp_CloseSocket,
597         ipx_udp_SendPacket,
598         ipx_udp_ReceivePacket,
599         ipx_general_PacketReady
600 };