Lines Matching refs:pkt

150 static void parse_multicast_oack(char *pkt, int len);
330 uchar *pkt; in tftp_send() local
345 pkt = net_tx_packet + net_eth_hdr_size() + IP_UDP_HDR_SIZE; in tftp_send()
350 xp = pkt; in tftp_send()
351 s = (ushort *)pkt; in tftp_send()
358 pkt = (uchar *)s; in tftp_send()
359 strcpy((char *)pkt, tftp_filename); in tftp_send()
360 pkt += strlen(tftp_filename) + 1; in tftp_send()
361 strcpy((char *)pkt, "octet"); in tftp_send()
362 pkt += 5 /*strlen("octet")*/ + 1; in tftp_send()
363 strcpy((char *)pkt, "timeout"); in tftp_send()
364 pkt += 7 /*strlen("timeout")*/ + 1; in tftp_send()
365 sprintf((char *)pkt, "%lu", timeout_ms / 1000); in tftp_send()
366 debug("send option \"timeout %s\"\n", (char *)pkt); in tftp_send()
367 pkt += strlen((char *)pkt) + 1; in tftp_send()
369 pkt += sprintf((char *)pkt, "tsize%c%u%c", in tftp_send()
373 pkt += sprintf((char *)pkt, "blksize%c%d%c", in tftp_send()
382 pkt += sprintf((char *)pkt, "multicast%c%c", in tftp_send()
387 len = pkt - xp; in tftp_send()
402 xp = pkt; in tftp_send()
403 s = (ushort *)pkt; in tftp_send()
406 pkt = (uchar *)(s + 2); in tftp_send()
410 int loaded = load_block(tftp_cur_block, pkt, toload); in tftp_send()
413 pkt += loaded; in tftp_send()
417 len = pkt - xp; in tftp_send()
421 xp = pkt; in tftp_send()
422 s = (ushort *)pkt; in tftp_send()
426 pkt = (uchar *)s; in tftp_send()
427 strcpy((char *)pkt, "File too large"); in tftp_send()
428 pkt += 14 /*strlen("File too large")*/ + 1; in tftp_send()
429 len = pkt - xp; in tftp_send()
433 xp = pkt; in tftp_send()
434 s = (ushort *)pkt; in tftp_send()
437 pkt = (uchar *)s; in tftp_send()
438 strcpy((char *)pkt, "File has bad magic"); in tftp_send()
439 pkt += 18 /*strlen("File has bad magic")*/ + 1; in tftp_send()
440 len = pkt - xp; in tftp_send()
450 struct in_addr sip, unsigned src, uchar *pkt, in icmp_handler() argument
460 static void tftp_handler(uchar *pkt, unsigned dest, struct in_addr sip, in tftp_handler() argument
482 s = (__be16 *)pkt; in tftp_handler()
484 pkt = (uchar *)s; in tftp_handler()
527 pkt, pkt + strlen((char *)pkt) + 1); in tftp_handler()
536 if (strcmp((char *)pkt + i, "blksize") == 0) { in tftp_handler()
538 simple_strtoul((char *)pkt + i + 8, in tftp_handler()
541 (char *)pkt + i + 8, tftp_block_size); in tftp_handler()
544 if (strcmp((char *)pkt+i, "tsize") == 0) { in tftp_handler()
545 tftp_tsize = simple_strtoul((char *)pkt + i + 6, in tftp_handler()
548 (char *)pkt + i + 6, tftp_tsize); in tftp_handler()
553 parse_multicast_oack((char *)pkt, len - 1); in tftp_handler()
571 tftp_cur_block = ntohs(*(__be16 *)pkt); in tftp_handler()
609 store_block(tftp_cur_block - 1, pkt + 2, len); in tftp_handler()
659 pkt + 2, ntohs(*(__be16 *)pkt)); in tftp_handler()
661 switch (ntohs(*(__be16 *)pkt)) { in tftp_handler()
903 static void parse_multicast_oack(char *pkt, int len) in parse_multicast_oack() argument
918 if (strcmp(pkt + i, "multicast") == 0) in parse_multicast_oack()
924 mc_adr = pkt + i; in parse_multicast_oack()
926 if (*(pkt + i) == ',') { in parse_multicast_oack()
927 *(pkt + i) = '\0'; in parse_multicast_oack()
929 mc = pkt + i + 1; in parse_multicast_oack()
932 port = pkt + i + 1; in parse_multicast_oack()