Lines Matching refs:bp

45 static void rfc1048_print(u_char *bp, int length);
46 static void cmu_print(u_char *bp, int length);
47 static void other_print(u_char *bp, int length);
48 static void dump_hex(u_char *bp, int len);
54 bootp_print(struct bootp *bp, int length, u_short sport, u_short dport) in bootp_print() argument
71 switch (bp->bp_op) { in bootp_print()
86 printf(" bootp-#%d", bp->bp_op); in bootp_print()
90 if (bp->bp_htype != 1) in bootp_print()
91 printf(" htype:%d", bp->bp_htype); in bootp_print()
94 if (bp->bp_hlen != 6) in bootp_print()
95 printf(" hlen:%d", bp->bp_hlen); in bootp_print()
98 if (bp->bp_hlen) { in bootp_print()
102 TCHECK(bp->bp_chaddr[0], 6); in bootp_print()
104 if (bp->bp_op == BOOTREQUEST) in bootp_print()
106 else if (bp->bp_op == BOOTREPLY) in bootp_print()
110 if (e == NULL || bcmp((char *) bp->bp_chaddr, e, 6)) in bootp_print()
111 dump_hex(bp->bp_chaddr, bp->bp_hlen); in bootp_print()
114 if (bp->bp_hops) in bootp_print()
115 printf(" hops:%d", bp->bp_hops); in bootp_print()
117 if (bp->bp_xid) in bootp_print()
118 printf(" xid:%ld", (long)ntohl(bp->bp_xid)); in bootp_print()
120 if (bp->bp_secs) in bootp_print()
121 printf(" secs:%d", ntohs(bp->bp_secs)); in bootp_print()
124 TCHECK(bp->bp_ciaddr, sizeof(bp->bp_ciaddr)); in bootp_print()
125 if (bp->bp_ciaddr.s_addr) in bootp_print()
126 printf(" C:%s", ipaddr_string(&bp->bp_ciaddr)); in bootp_print()
129 TCHECK(bp->bp_yiaddr, sizeof(bp->bp_yiaddr)); in bootp_print()
130 if (bp->bp_yiaddr.s_addr) in bootp_print()
131 printf(" Y:%s", ipaddr_string(&bp->bp_yiaddr)); in bootp_print()
134 TCHECK(bp->bp_siaddr, sizeof(bp->bp_siaddr)); in bootp_print()
135 if (bp->bp_siaddr.s_addr) in bootp_print()
136 printf(" S:%s", ipaddr_string(&bp->bp_siaddr)); in bootp_print()
139 TCHECK(bp->bp_giaddr, sizeof(bp->bp_giaddr)); in bootp_print()
140 if (bp->bp_giaddr.s_addr) in bootp_print()
141 printf(" G:%s", ipaddr_string(&bp->bp_giaddr)); in bootp_print()
143 TCHECK(bp->bp_sname[0], sizeof(bp->bp_sname)); in bootp_print()
144 if (*bp->bp_sname) { in bootp_print()
146 if (printfn(bp->bp_sname, ep)) { in bootp_print()
151 TCHECK(bp->bp_file[0], sizeof(bp->bp_file)); in bootp_print()
152 if (*bp->bp_file) { in bootp_print()
154 if (printfn(bp->bp_file, ep)) { in bootp_print()
163 vdlen = sizeof(bp->bp_vend); in bootp_print()
165 if (vdlen < (ep - bp->bp_vend)) in bootp_print()
166 vdlen = (ep - bp->bp_vend); in bootp_print()
168 TCHECK(bp->bp_vend[0], vdlen); in bootp_print()
170 if (!bcmp(bp->bp_vend, vm_rfc1048, sizeof(u_int32))) in bootp_print()
171 rfc1048_print(bp->bp_vend, vdlen); in bootp_print()
172 else if (!bcmp(bp->bp_vend, vm_cmu, sizeof(u_int32))) in bootp_print()
173 cmu_print(bp->bp_vend, vdlen); in bootp_print()
175 other_print(bp->bp_vend, vdlen); in bootp_print()
272 rfc1048_print(u_char *bp, int length) in rfc1048_print() argument
285 bp += sizeof(int32); in rfc1048_print()
287 ep = bp + length; in rfc1048_print()
288 while (bp < ep) { in rfc1048_print()
289 tag = *bp++; in rfc1048_print()
303 len = *bp++; in rfc1048_print()
304 if (bp + len > ep) { in rfc1048_print()
306 printf(" |(%d>%td)", len, ep - bp); in rfc1048_print()
313 printfn(bp, bp + len); in rfc1048_print()
314 bp += len; in rfc1048_print()
320 bcopy((char *) bp, (char *) &us, 2); in rfc1048_print()
322 bp += 2; in rfc1048_print()
331 bcopy((char *) bp, (char *) &ul, 4); in rfc1048_print()
333 bp += 4; in rfc1048_print()
342 bcopy((char *) bp, (char *) &ia, 4); in rfc1048_print()
344 bp += 4; in rfc1048_print()
359 dump_hex(bp, len); in rfc1048_print()
360 if (isascii(*bp) && isprint(*bp)) { in rfc1048_print()
362 printfn(bp, bp + len); in rfc1048_print()
365 bp += len; in rfc1048_print()
372 cmu_print(u_char *bp, int length) in cmu_print() argument
378 v = (struct cmu_vend *) bp; in cmu_print()
418 other_print(u_char *bp, int length) in other_print() argument
424 ep = bp + length; in other_print()
427 for (zp = ep; zp > bp; zp--) { in other_print()
433 if (zp == bp) { in other_print()
444 while (bp < zp) { in other_print()
445 printf(".%02X", *bp); in other_print()
446 bp++; in other_print()
456 dump_hex(u_char *bp, int len) in dump_hex() argument
459 printf("%02X", *bp); in dump_hex()
460 bp++; in dump_hex()