Lines Matching refs:pkt
344 uchar *pkt; in tftp_send() local
354 pkt = net_tx_packet + net_eth_hdr_size() + IP_UDP_HDR_SIZE; in tftp_send()
359 xp = pkt; in tftp_send()
360 s = (ushort *)pkt; in tftp_send()
367 pkt = (uchar *)s; in tftp_send()
368 strcpy((char *)pkt, tftp_filename); in tftp_send()
369 pkt += strlen(tftp_filename) + 1; in tftp_send()
370 strcpy((char *)pkt, "octet"); in tftp_send()
371 pkt += 5 /*strlen("octet")*/ + 1; in tftp_send()
372 strcpy((char *)pkt, "timeout"); in tftp_send()
373 pkt += 7 /*strlen("timeout")*/ + 1; in tftp_send()
374 sprintf((char *)pkt, "%lu", timeout_ms / 1000); in tftp_send()
375 debug("send option \"timeout %s\"\n", (char *)pkt); in tftp_send()
376 pkt += strlen((char *)pkt) + 1; in tftp_send()
378 pkt += sprintf((char *)pkt, "tsize%c%u%c", in tftp_send()
382 pkt += sprintf((char *)pkt, "blksize%c%d%c", in tftp_send()
390 pkt += sprintf((char *)pkt, "windowsize%c%d%c", in tftp_send()
392 len = pkt - xp; in tftp_send()
399 xp = pkt; in tftp_send()
400 s = (ushort *)pkt; in tftp_send()
403 pkt = (uchar *)(s + 2); in tftp_send()
407 int loaded = load_block(tftp_cur_block, pkt, toload); in tftp_send()
410 pkt += loaded; in tftp_send()
414 len = pkt - xp; in tftp_send()
418 xp = pkt; in tftp_send()
419 s = (ushort *)pkt; in tftp_send()
423 pkt = (uchar *)s; in tftp_send()
424 strcpy((char *)pkt, "File too large"); in tftp_send()
425 pkt += 14 /*strlen("File too large")*/ + 1; in tftp_send()
426 len = pkt - xp; in tftp_send()
431 xp = pkt; in tftp_send()
432 s = (ushort *)pkt; in tftp_send()
435 pkt = (uchar *)s; in tftp_send()
436 strcpy((char *)pkt, "File has bad magic"); in tftp_send()
437 pkt += 18 /*strlen("File has bad magic")*/ + 1; in tftp_send()
438 len = pkt - xp; in tftp_send()
443 xp = pkt; in tftp_send()
444 s = (ushort *)pkt; in tftp_send()
447 pkt = (uchar *)s; in tftp_send()
448 strcpy((char *)pkt, "Option Negotiation Failed"); in tftp_send()
450 pkt += 25 + 1; in tftp_send()
451 len = pkt - xp; in tftp_send()
465 struct in_addr sip, unsigned src, uchar *pkt, in icmp_handler() argument
475 static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, in tftp_handler() argument
494 s = (__be16 *)pkt; in tftp_handler()
496 pkt = (uchar *)s; in tftp_handler()
541 if (pkt[i] == '\0') in tftp_handler()
544 debug("%c", pkt[i]); in tftp_handler()
555 if (strcasecmp((char *)pkt + i, "blksize") == 0) { in tftp_handler()
557 simple_strtoul((char *)pkt + i + 8, in tftp_handler()
560 (char *)pkt + i + 8, tftp_block_size); in tftp_handler()
567 if (strcasecmp((char *)pkt + i, "timeout") == 0) { in tftp_handler()
569 simple_strtoul((char *)pkt + i + 8, in tftp_handler()
572 (char *)pkt + i + 8, timeout_val_rcvd); in tftp_handler()
580 if (strcasecmp((char *)pkt + i, "tsize") == 0) { in tftp_handler()
581 tftp_tsize = simple_strtoul((char *)pkt + i + 6, in tftp_handler()
584 (char *)pkt + i + 6, tftp_tsize); in tftp_handler()
587 if (strcasecmp((char *)pkt + i, "windowsize") == 0) { in tftp_handler()
589 simple_strtoul((char *)pkt + i + 11, in tftp_handler()
592 (char *)pkt + i + 11, tftp_windowsize); in tftp_handler()
612 if (ntohs(*(__be16 *)pkt) != (ushort)(tftp_cur_block + 1)) { in tftp_handler()
614 ntohs(*(__be16 *)pkt), in tftp_handler()
666 if (store_block(tftp_cur_block, pkt + 2, len)) { in tftp_handler()
690 pkt + 2, ntohs(*(__be16 *)pkt)); in tftp_handler()
692 switch (ntohs(*(__be16 *)pkt)) { in tftp_handler()