tftp.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. /*
  2. * Copyright 1994, 1995, 2000 Neil Russell.
  3. * (See License)
  4. * Copyright 2000, 2001 DENX Software Engineering, Wolfgang Denk, wd@denx.de
  5. */
  6. #include <common.h>
  7. #include <command.h>
  8. #include <net.h>
  9. #include "tftp.h"
  10. #include "bootp.h"
  11. #undef ET_DEBUG
  12. #if defined(CONFIG_CMD_NET)
  13. #define WELL_KNOWN_PORT 69 /* Well known TFTP port # */
  14. #define TIMEOUT 5UL /* Seconds to timeout for a lost pkt */
  15. #ifndef CONFIG_NET_RETRY_COUNT
  16. # define TIMEOUT_COUNT 10 /* # of timeouts before giving up */
  17. #else
  18. # define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT * 2)
  19. #endif
  20. /* (for checking the image size) */
  21. #define HASHES_PER_LINE 65 /* Number of "loading" hashes per line */
  22. /*
  23. * TFTP operations.
  24. */
  25. #define TFTP_RRQ 1
  26. #define TFTP_WRQ 2
  27. #define TFTP_DATA 3
  28. #define TFTP_ACK 4
  29. #define TFTP_ERROR 5
  30. #define TFTP_OACK 6
  31. static IPaddr_t TftpServerIP;
  32. static int TftpServerPort; /* The UDP port at their end */
  33. static int TftpOurPort; /* The UDP port at our end */
  34. static int TftpTimeoutCount;
  35. static ulong TftpBlock; /* packet sequence number */
  36. static ulong TftpLastBlock; /* last packet sequence number received */
  37. static ulong TftpBlockWrap; /* count of sequence number wraparounds */
  38. static ulong TftpBlockWrapOffset; /* memory offset due to wrapping */
  39. static int TftpState;
  40. #define STATE_RRQ 1
  41. #define STATE_DATA 2
  42. #define STATE_TOO_LARGE 3
  43. #define STATE_BAD_MAGIC 4
  44. #define STATE_OACK 5
  45. #define TFTP_BLOCK_SIZE 512 /* default TFTP block size */
  46. #define TFTP_SEQUENCE_SIZE ((ulong)(1<<16)) /* sequence number is 16 bit */
  47. #define DEFAULT_NAME_LEN (8 + 4 + 1)
  48. static char default_filename[DEFAULT_NAME_LEN];
  49. #ifndef CONFIG_TFTP_FILE_NAME_MAX_LEN
  50. #define MAX_LEN 128
  51. #else
  52. #define MAX_LEN CONFIG_TFTP_FILE_NAME_MAX_LEN
  53. #endif
  54. static char tftp_filename[MAX_LEN];
  55. #ifdef CFG_DIRECT_FLASH_TFTP
  56. extern flash_info_t flash_info[];
  57. #endif
  58. /* 512 is poor choice for ethernet, MTU is typically 1500.
  59. * Minus eth.hdrs thats 1468. Can get 2x better throughput with
  60. * almost-MTU block sizes. At least try... fall back to 512 if need be.
  61. */
  62. #define TFTP_MTU_BLOCKSIZE 1468
  63. static unsigned short TftpBlkSize=TFTP_BLOCK_SIZE;
  64. static unsigned short TftpBlkSizeOption=TFTP_MTU_BLOCKSIZE;
  65. #ifdef CONFIG_MCAST_TFTP
  66. #include <malloc.h>
  67. #define MTFTP_BITMAPSIZE 0x1000
  68. static unsigned *Bitmap;
  69. static int PrevBitmapHole,Mapsize=MTFTP_BITMAPSIZE;
  70. static uchar ProhibitMcast=0, MasterClient=0;
  71. static uchar Multicast=0;
  72. extern IPaddr_t Mcast_addr;
  73. static int Mcast_port;
  74. static ulong TftpEndingBlock; /* can get 'last' block before done..*/
  75. static void parse_multicast_oack(char *pkt,int len);
  76. static void
  77. mcast_cleanup(void)
  78. {
  79. if (Mcast_addr) eth_mcast_join(Mcast_addr, 0);
  80. if (Bitmap) free(Bitmap);
  81. Bitmap=NULL;
  82. Mcast_addr = Multicast = Mcast_port = 0;
  83. TftpEndingBlock = -1;
  84. }
  85. #endif /* CONFIG_MCAST_TFTP */
  86. static __inline__ void
  87. store_block (unsigned block, uchar * src, unsigned len)
  88. {
  89. ulong offset = block * TftpBlkSize + TftpBlockWrapOffset;
  90. ulong newsize = offset + len;
  91. #ifdef CFG_DIRECT_FLASH_TFTP
  92. int i, rc = 0;
  93. for (i=0; i<CFG_MAX_FLASH_BANKS; i++) {
  94. /* start address in flash? */
  95. if (flash_info[i].flash_id == FLASH_UNKNOWN)
  96. continue;
  97. if (load_addr + offset >= flash_info[i].start[0]) {
  98. rc = 1;
  99. break;
  100. }
  101. }
  102. if (rc) { /* Flash is destination for this packet */
  103. rc = flash_write ((char *)src, (ulong)(load_addr+offset), len);
  104. if (rc) {
  105. flash_perror (rc);
  106. NetState = NETLOOP_FAIL;
  107. return;
  108. }
  109. }
  110. else
  111. #endif /* CFG_DIRECT_FLASH_TFTP */
  112. {
  113. (void)memcpy((void *)(load_addr + offset), src, len);
  114. }
  115. #ifdef CONFIG_MCAST_TFTP
  116. if (Multicast)
  117. ext2_set_bit(block, Bitmap);
  118. #endif
  119. if (NetBootFileXferSize < newsize)
  120. NetBootFileXferSize = newsize;
  121. }
  122. static void TftpSend (void);
  123. static void TftpTimeout (void);
  124. /**********************************************************************/
  125. static void
  126. TftpSend (void)
  127. {
  128. volatile uchar * pkt;
  129. volatile uchar * xp;
  130. int len = 0;
  131. volatile ushort *s;
  132. #ifdef CONFIG_MCAST_TFTP
  133. /* Multicast TFTP.. non-MasterClients do not ACK data. */
  134. if (Multicast
  135. && (TftpState == STATE_DATA)
  136. && (MasterClient == 0))
  137. return;
  138. #endif
  139. /*
  140. * We will always be sending some sort of packet, so
  141. * cobble together the packet headers now.
  142. */
  143. pkt = NetTxPacket + NetEthHdrSize() + IP_HDR_SIZE;
  144. switch (TftpState) {
  145. case STATE_RRQ:
  146. xp = pkt;
  147. s = (ushort *)pkt;
  148. *s++ = htons(TFTP_RRQ);
  149. pkt = (uchar *)s;
  150. strcpy ((char *)pkt, tftp_filename);
  151. pkt += strlen(tftp_filename) + 1;
  152. strcpy ((char *)pkt, "octet");
  153. pkt += 5 /*strlen("octet")*/ + 1;
  154. strcpy ((char *)pkt, "timeout");
  155. pkt += 7 /*strlen("timeout")*/ + 1;
  156. sprintf((char *)pkt, "%lu", TIMEOUT);
  157. #ifdef ET_DEBUG
  158. printf("send option \"timeout %s\"\n", (char *)pkt);
  159. #endif
  160. pkt += strlen((char *)pkt) + 1;
  161. /* try for more effic. blk size */
  162. pkt += sprintf((char *)pkt,"blksize%c%d%c",
  163. 0,TftpBlkSizeOption,0);
  164. #ifdef CONFIG_MCAST_TFTP
  165. /* Check all preconditions before even trying the option */
  166. if (!ProhibitMcast
  167. && (Bitmap=malloc(Mapsize))
  168. && eth_get_dev()->mcast) {
  169. free(Bitmap);
  170. Bitmap=NULL;
  171. pkt += sprintf((char *)pkt,"multicast%c%c",0,0);
  172. }
  173. #endif /* CONFIG_MCAST_TFTP */
  174. len = pkt - xp;
  175. break;
  176. case STATE_OACK:
  177. #ifdef CONFIG_MCAST_TFTP
  178. /* My turn! Start at where I need blocks I missed.*/
  179. if (Multicast)
  180. TftpBlock=ext2_find_next_zero_bit(Bitmap,(Mapsize*8),0);
  181. /*..falling..*/
  182. #endif
  183. case STATE_DATA:
  184. xp = pkt;
  185. s = (ushort *)pkt;
  186. *s++ = htons(TFTP_ACK);
  187. *s++ = htons(TftpBlock);
  188. pkt = (uchar *)s;
  189. len = pkt - xp;
  190. break;
  191. case STATE_TOO_LARGE:
  192. xp = pkt;
  193. s = (ushort *)pkt;
  194. *s++ = htons(TFTP_ERROR);
  195. *s++ = htons(3);
  196. pkt = (uchar *)s;
  197. strcpy ((char *)pkt, "File too large");
  198. pkt += 14 /*strlen("File too large")*/ + 1;
  199. len = pkt - xp;
  200. break;
  201. case STATE_BAD_MAGIC:
  202. xp = pkt;
  203. s = (ushort *)pkt;
  204. *s++ = htons(TFTP_ERROR);
  205. *s++ = htons(2);
  206. pkt = (uchar *)s;
  207. strcpy ((char *)pkt, "File has bad magic");
  208. pkt += 18 /*strlen("File has bad magic")*/ + 1;
  209. len = pkt - xp;
  210. break;
  211. }
  212. NetSendUDPPacket(NetServerEther, TftpServerIP, TftpServerPort, TftpOurPort, len);
  213. }
  214. static void
  215. TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
  216. {
  217. ushort proto;
  218. ushort *s;
  219. int i;
  220. if (dest != TftpOurPort) {
  221. #ifdef CONFIG_MCAST_TFTP
  222. if (Multicast
  223. && (!Mcast_port || (dest != Mcast_port)))
  224. #endif
  225. return;
  226. }
  227. if (TftpState != STATE_RRQ && src != TftpServerPort) {
  228. return;
  229. }
  230. if (len < 2) {
  231. return;
  232. }
  233. len -= 2;
  234. /* warning: don't use increment (++) in ntohs() macros!! */
  235. s = (ushort *)pkt;
  236. proto = *s++;
  237. pkt = (uchar *)s;
  238. switch (ntohs(proto)) {
  239. case TFTP_RRQ:
  240. case TFTP_WRQ:
  241. case TFTP_ACK:
  242. break;
  243. default:
  244. break;
  245. case TFTP_OACK:
  246. #ifdef ET_DEBUG
  247. printf("Got OACK: %s %s\n", pkt, pkt+strlen(pkt)+1);
  248. #endif
  249. TftpState = STATE_OACK;
  250. TftpServerPort = src;
  251. /*
  252. * Check for 'blksize' option.
  253. * Careful: "i" is signed, "len" is unsigned, thus
  254. * something like "len-8" may give a *huge* number
  255. */
  256. for (i=0; i+8<len; i++) {
  257. if (strcmp ((char*)pkt+i,"blksize") == 0) {
  258. TftpBlkSize = (unsigned short)
  259. simple_strtoul((char*)pkt+i+8,NULL,10);
  260. #ifdef ET_DEBUG
  261. printf ("Blocksize ack: %s, %d\n",
  262. (char*)pkt+i+8,TftpBlkSize);
  263. #endif
  264. break;
  265. }
  266. }
  267. #ifdef CONFIG_MCAST_TFTP
  268. parse_multicast_oack((char *)pkt,len-1);
  269. if ((Multicast) && (!MasterClient))
  270. TftpState = STATE_DATA; /* passive.. */
  271. else
  272. #endif
  273. TftpSend (); /* Send ACK */
  274. break;
  275. case TFTP_DATA:
  276. if (len < 2)
  277. return;
  278. len -= 2;
  279. TftpBlock = ntohs(*(ushort *)pkt);
  280. /*
  281. * RFC1350 specifies that the first data packet will
  282. * have sequence number 1. If we receive a sequence
  283. * number of 0 this means that there was a wrap
  284. * around of the (16 bit) counter.
  285. */
  286. if (TftpBlock == 0) {
  287. TftpBlockWrap++;
  288. TftpBlockWrapOffset += TftpBlkSize * TFTP_SEQUENCE_SIZE;
  289. printf ("\n\t %lu MB received\n\t ", TftpBlockWrapOffset>>20);
  290. } else {
  291. if (((TftpBlock - 1) % 10) == 0) {
  292. putc ('#');
  293. } else if ((TftpBlock % (10 * HASHES_PER_LINE)) == 0) {
  294. puts ("\n\t ");
  295. }
  296. }
  297. #ifdef ET_DEBUG
  298. if (TftpState == STATE_RRQ) {
  299. puts ("Server did not acknowledge timeout option!\n");
  300. }
  301. #endif
  302. if (TftpState == STATE_RRQ || TftpState == STATE_OACK) {
  303. /* first block received */
  304. TftpState = STATE_DATA;
  305. TftpServerPort = src;
  306. TftpLastBlock = 0;
  307. TftpBlockWrap = 0;
  308. TftpBlockWrapOffset = 0;
  309. #ifdef CONFIG_MCAST_TFTP
  310. if (Multicast) { /* start!=1 common if mcast */
  311. TftpLastBlock = TftpBlock - 1;
  312. } else
  313. #endif
  314. if (TftpBlock != 1) { /* Assertion */
  315. printf ("\nTFTP error: "
  316. "First block is not block 1 (%ld)\n"
  317. "Starting again\n\n",
  318. TftpBlock);
  319. NetStartAgain ();
  320. break;
  321. }
  322. }
  323. if (TftpBlock == TftpLastBlock) {
  324. /*
  325. * Same block again; ignore it.
  326. */
  327. break;
  328. }
  329. TftpLastBlock = TftpBlock;
  330. NetSetTimeout (TIMEOUT * CFG_HZ, TftpTimeout);
  331. store_block (TftpBlock - 1, pkt + 2, len);
  332. /*
  333. * Acknoledge the block just received, which will prompt
  334. * the server for the next one.
  335. */
  336. #ifdef CONFIG_MCAST_TFTP
  337. /* if I am the MasterClient, actively calculate what my next
  338. * needed block is; else I'm passive; not ACKING
  339. */
  340. if (Multicast) {
  341. if (len < TftpBlkSize) {
  342. TftpEndingBlock = TftpBlock;
  343. } else if (MasterClient) {
  344. TftpBlock = PrevBitmapHole =
  345. ext2_find_next_zero_bit(
  346. Bitmap,
  347. (Mapsize*8),
  348. PrevBitmapHole);
  349. if (TftpBlock > ((Mapsize*8) - 1)) {
  350. printf ("tftpfile too big\n");
  351. /* try to double it and retry */
  352. Mapsize<<=1;
  353. mcast_cleanup();
  354. NetStartAgain ();
  355. return;
  356. }
  357. TftpLastBlock = TftpBlock;
  358. }
  359. }
  360. #endif
  361. TftpSend ();
  362. #ifdef CONFIG_MCAST_TFTP
  363. if (Multicast) {
  364. if (MasterClient && (TftpBlock >= TftpEndingBlock)) {
  365. puts ("\nMulticast tftp done\n");
  366. mcast_cleanup();
  367. NetState = NETLOOP_SUCCESS;
  368. }
  369. }
  370. else
  371. #endif
  372. if (len < TftpBlkSize) {
  373. /*
  374. * We received the whole thing. Try to
  375. * run it.
  376. */
  377. puts ("\ndone\n");
  378. NetState = NETLOOP_SUCCESS;
  379. }
  380. break;
  381. case TFTP_ERROR:
  382. printf ("\nTFTP error: '%s' (%d)\n",
  383. pkt + 2, ntohs(*(ushort *)pkt));
  384. puts ("Starting again\n\n");
  385. #ifdef CONFIG_MCAST_TFTP
  386. mcast_cleanup();
  387. #endif
  388. NetStartAgain ();
  389. break;
  390. }
  391. }
  392. static void
  393. TftpTimeout (void)
  394. {
  395. if (++TftpTimeoutCount > TIMEOUT_COUNT) {
  396. puts ("\nRetry count exceeded; starting again\n");
  397. #ifdef CONFIG_MCAST_TFTP
  398. mcast_cleanup();
  399. #endif
  400. NetStartAgain ();
  401. } else {
  402. puts ("T ");
  403. NetSetTimeout (TIMEOUT * CFG_HZ, TftpTimeout);
  404. TftpSend ();
  405. }
  406. }
  407. void
  408. TftpStart (void)
  409. {
  410. #ifdef CONFIG_TFTP_PORT
  411. char *ep; /* Environment pointer */
  412. #endif
  413. TftpServerIP = NetServerIP;
  414. if (BootFile[0] == '\0') {
  415. sprintf(default_filename, "%02lX%02lX%02lX%02lX.img",
  416. NetOurIP & 0xFF,
  417. (NetOurIP >> 8) & 0xFF,
  418. (NetOurIP >> 16) & 0xFF,
  419. (NetOurIP >> 24) & 0xFF );
  420. strncpy(tftp_filename, default_filename, MAX_LEN);
  421. tftp_filename[MAX_LEN-1] = 0;
  422. printf ("*** Warning: no boot file name; using '%s'\n",
  423. tftp_filename);
  424. } else {
  425. char *p = strchr (BootFile, ':');
  426. if (p == NULL) {
  427. strncpy(tftp_filename, BootFile, MAX_LEN);
  428. tftp_filename[MAX_LEN-1] = 0;
  429. } else {
  430. *p++ = '\0';
  431. TftpServerIP = string_to_ip (BootFile);
  432. strncpy(tftp_filename, p, MAX_LEN);
  433. tftp_filename[MAX_LEN-1] = 0;
  434. }
  435. }
  436. #if defined(CONFIG_NET_MULTI)
  437. printf ("Using %s device\n", eth_get_name());
  438. #endif
  439. puts ("TFTP from server "); print_IPaddr (TftpServerIP);
  440. puts ("; our IP address is "); print_IPaddr (NetOurIP);
  441. /* Check if we need to send across this subnet */
  442. if (NetOurGatewayIP && NetOurSubnetMask) {
  443. IPaddr_t OurNet = NetOurIP & NetOurSubnetMask;
  444. IPaddr_t ServerNet = TftpServerIP & NetOurSubnetMask;
  445. if (OurNet != ServerNet) {
  446. puts ("; sending through gateway ");
  447. print_IPaddr (NetOurGatewayIP) ;
  448. }
  449. }
  450. putc ('\n');
  451. printf ("Filename '%s'.", tftp_filename);
  452. if (NetBootFileSize) {
  453. printf (" Size is 0x%x Bytes = ", NetBootFileSize<<9);
  454. print_size (NetBootFileSize<<9, "");
  455. }
  456. putc ('\n');
  457. printf ("Load address: 0x%lx\n", load_addr);
  458. puts ("Loading: *\b");
  459. NetSetTimeout (TIMEOUT * CFG_HZ, TftpTimeout);
  460. NetSetHandler (TftpHandler);
  461. TftpServerPort = WELL_KNOWN_PORT;
  462. TftpTimeoutCount = 0;
  463. TftpState = STATE_RRQ;
  464. /* Use a pseudo-random port unless a specific port is set */
  465. TftpOurPort = 1024 + (get_timer(0) % 3072);
  466. #ifdef CONFIG_TFTP_PORT
  467. if ((ep = getenv("tftpdstp")) != NULL) {
  468. TftpServerPort = simple_strtol(ep, NULL, 10);
  469. }
  470. if ((ep = getenv("tftpsrcp")) != NULL) {
  471. TftpOurPort= simple_strtol(ep, NULL, 10);
  472. }
  473. #endif
  474. TftpBlock = 0;
  475. /* zero out server ether in case the server ip has changed */
  476. memset(NetServerEther, 0, 6);
  477. /* Revert TftpBlkSize to dflt */
  478. TftpBlkSize = TFTP_BLOCK_SIZE;
  479. #ifdef CONFIG_MCAST_TFTP
  480. mcast_cleanup();
  481. #endif
  482. TftpSend ();
  483. }
  484. #ifdef CONFIG_MCAST_TFTP
  485. /* Credits: atftp project.
  486. */
  487. /* pick up BcastAddr, Port, and whether I am [now] the master-client. *
  488. * Frame:
  489. * +-------+-----------+---+-------~~-------+---+
  490. * | opc | multicast | 0 | addr, port, mc | 0 |
  491. * +-------+-----------+---+-------~~-------+---+
  492. * The multicast addr/port becomes what I listen to, and if 'mc' is '1' then
  493. * I am the new master-client so must send ACKs to DataBlocks. If I am not
  494. * master-client, I'm a passive client, gathering what DataBlocks I may and
  495. * making note of which ones I got in my bitmask.
  496. * In theory, I never go from master->passive..
  497. * .. this comes in with pkt already pointing just past opc
  498. */
  499. static void parse_multicast_oack(char *pkt, int len)
  500. {
  501. int i;
  502. IPaddr_t addr;
  503. char *mc_adr, *port, *mc;
  504. mc_adr=port=mc=NULL;
  505. /* march along looking for 'multicast\0', which has to start at least
  506. * 14 bytes back from the end.
  507. */
  508. for (i=0;i<len-14;i++)
  509. if (strcmp (pkt+i,"multicast") == 0)
  510. break;
  511. if (i >= (len-14)) /* non-Multicast OACK, ign. */
  512. return;
  513. i+=10; /* strlen multicast */
  514. mc_adr = pkt+i;
  515. for (;i<len;i++) {
  516. if (*(pkt+i) == ',') {
  517. *(pkt+i) = '\0';
  518. if (port) {
  519. mc = pkt+i+1;
  520. break;
  521. } else {
  522. port = pkt+i+1;
  523. }
  524. }
  525. }
  526. if (!port || !mc_adr || !mc ) return;
  527. if (Multicast && MasterClient) {
  528. printf ("I got a OACK as master Client, WRONG!\n");
  529. return;
  530. }
  531. /* ..I now accept packets destined for this MCAST addr, port */
  532. if (!Multicast) {
  533. if (Bitmap) {
  534. printf ("Internal failure! no mcast.\n");
  535. free(Bitmap);
  536. Bitmap=NULL;
  537. ProhibitMcast=1;
  538. return ;
  539. }
  540. /* I malloc instead of pre-declare; so that if the file ends
  541. * up being too big for this bitmap I can retry
  542. */
  543. if (!(Bitmap = malloc (Mapsize))) {
  544. printf ("No Bitmap, no multicast. Sorry.\n");
  545. ProhibitMcast=1;
  546. return;
  547. }
  548. memset (Bitmap,0,Mapsize);
  549. PrevBitmapHole = 0;
  550. Multicast = 1;
  551. }
  552. addr = string_to_ip(mc_adr);
  553. if (Mcast_addr != addr) {
  554. if (Mcast_addr)
  555. eth_mcast_join(Mcast_addr, 0);
  556. if (eth_mcast_join(Mcast_addr=addr, 1)) {
  557. printf ("Fail to set mcast, revert to TFTP\n");
  558. ProhibitMcast=1;
  559. mcast_cleanup();
  560. NetStartAgain();
  561. }
  562. }
  563. MasterClient = (unsigned char)simple_strtoul((char *)mc,NULL,10);
  564. Mcast_port = (unsigned short)simple_strtoul(port,NULL,10);
  565. printf ("Multicast: %s:%d [%d]\n", mc_adr, Mcast_port, MasterClient);
  566. return;
  567. }
  568. #endif /* Multicast TFTP */
  569. #endif