print-atalk.c (17681) | print-atalk.c (17690) |
---|---|
1/* 2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and --- 87 unchanged lines hidden (view full) --- 96void 97atalk_print(register const u_char *bp, u_int length) 98{ 99 register const struct LAP *lp; 100 register const struct atDDP *dp; 101 register const struct atShortDDP *sdp; 102 u_short snet; 103 | 1/* 2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and --- 87 unchanged lines hidden (view full) --- 96void 97atalk_print(register const u_char *bp, u_int length) 98{ 99 register const struct LAP *lp; 100 register const struct atDDP *dp; 101 register const struct atShortDDP *sdp; 102 u_short snet; 103 |
104#if 0 |
|
104 lp = (struct LAP *)bp; 105 bp += sizeof(*lp); 106 length -= sizeof(*lp); | 105 lp = (struct LAP *)bp; 106 bp += sizeof(*lp); 107 length -= sizeof(*lp); |
108#else 109 { 110 static struct LAP lp_ = {0, 0, lapDDP}; 111 lp = &lp_; 112 } 113#endif |
|
107 switch (lp->type) { 108 109 case lapShortDDP: 110 if (length < ddpSSize) { 111 (void)printf(" [|sddp %d]", length); 112 return; 113 } 114 sdp = (const struct atShortDDP *)bp; --- 41 unchanged lines hidden (view full) --- 156aarp_print(register const u_char *bp, u_int length) 157{ 158 register const struct aarp *ap; 159 160#define AT(member) ataddr_string((ap->member[1]<<8)|ap->member[2],ap->member[3]) 161 162 printf("aarp "); 163 ap = (const struct aarp *)bp; | 114 switch (lp->type) { 115 116 case lapShortDDP: 117 if (length < ddpSSize) { 118 (void)printf(" [|sddp %d]", length); 119 return; 120 } 121 sdp = (const struct atShortDDP *)bp; --- 41 unchanged lines hidden (view full) --- 163aarp_print(register const u_char *bp, u_int length) 164{ 165 register const struct aarp *ap; 166 167#define AT(member) ataddr_string((ap->member[1]<<8)|ap->member[2],ap->member[3]) 168 169 printf("aarp "); 170 ap = (const struct aarp *)bp; |
164 if (ap->htype == 1 && ap->ptype == ETHERTYPE_ATALK && | 171 if (ntohs(ap->htype) == 1 && ntohs(ap->ptype) == ETHERTYPE_ATALK && |
165 ap->halen == 6 && ap->palen == 4 ) | 172 ap->halen == 6 && ap->palen == 4 ) |
166 switch (ap->op) { | 173 switch (ntohs(ap->op)) { |
167 168 case 1: /* request */ 169 (void)printf("who-has %s tell %s", 170 AT(pdaddr), AT(psaddr)); 171 return; 172 173 case 2: /* response */ 174 (void)printf("reply %s is-at %s", | 174 175 case 1: /* request */ 176 (void)printf("who-has %s tell %s", 177 AT(pdaddr), AT(psaddr)); 178 return; 179 180 case 2: /* response */ 181 (void)printf("reply %s is-at %s", |
175 AT(pdaddr), etheraddr_string(ap->hdaddr)); | 182 AT(psaddr), etheraddr_string(ap->hsaddr)); |
176 return; 177 178 case 3: /* probe (oy!) */ 179 (void)printf("probe %s tell %s", 180 AT(pdaddr), AT(psaddr)); 181 return; 182 } 183 (void)printf("len %d op %d htype %d ptype %#x halen %d palen %d", --- 388 unchanged lines hidden --- | 183 return; 184 185 case 3: /* probe (oy!) */ 186 (void)printf("probe %s tell %s", 187 AT(pdaddr), AT(psaddr)); 188 return; 189 } 190 (void)printf("len %d op %d htype %d ptype %#x halen %d palen %d", --- 388 unchanged lines hidden --- |