Deleted Added
full compact
print-lldp.c (242485) print-lldp.c (252283)
1/*
2 * Copyright (c) 1998-2007 The TCPDUMP project
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in

--- 1170 unchanged lines hidden (view full) ---

1179 u_int16_t tlv, cap, ena_cap;
1180 u_int oui, tlen, hexdump, tlv_type, tlv_len;
1181 const u_char *tptr;
1182 char *network_addr;
1183
1184 tptr = pptr;
1185 tlen = len;
1186
1/*
2 * Copyright (c) 1998-2007 The TCPDUMP project
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that: (1) source code
6 * distributions retain the above copyright notice and this paragraph
7 * in its entirety, and (2) distributions including binary code include
8 * the above copyright notice and this paragraph in its entirety in

--- 1170 unchanged lines hidden (view full) ---

1179 u_int16_t tlv, cap, ena_cap;
1180 u_int oui, tlen, hexdump, tlv_type, tlv_len;
1181 const u_char *tptr;
1182 char *network_addr;
1183
1184 tptr = pptr;
1185 tlen = len;
1186
1187 if (vflag) {
1188 printf("LLDP, length %u", len);
1189 }
1187 printf("LLDP, length %u", len);
1190
1191 while (tlen >= sizeof(tlv)) {
1192
1193 TCHECK2(*tptr, sizeof(tlv));
1194
1195 tlv = EXTRACT_16BITS(tptr);
1196
1197 tlv_type = LLDP_EXTRACT_TYPE(tlv);

--- 119 unchanged lines hidden (view full) ---

1317 }
1318 break;
1319
1320 case LLDP_SYSTEM_NAME_TLV:
1321 /*
1322 * The system name is also print in non-verbose mode
1323 * similar to the CDP printer.
1324 */
1188
1189 while (tlen >= sizeof(tlv)) {
1190
1191 TCHECK2(*tptr, sizeof(tlv));
1192
1193 tlv = EXTRACT_16BITS(tptr);
1194
1195 tlv_type = LLDP_EXTRACT_TYPE(tlv);

--- 119 unchanged lines hidden (view full) ---

1315 }
1316 break;
1317
1318 case LLDP_SYSTEM_NAME_TLV:
1319 /*
1320 * The system name is also print in non-verbose mode
1321 * similar to the CDP printer.
1322 */
1325 if (vflag) {
1326 printf(": ");
1327 safeputs((const char *)tptr, tlv_len);
1328 } else {
1329 printf("LLDP, name ");
1330 safeputs((const char *)tptr, tlv_len);
1331 printf(", length %u", len);
1332 }
1323 printf(": ");
1324 safeputs((const char *)tptr, tlv_len);
1333 break;
1334
1335 case LLDP_SYSTEM_DESCR_TLV:
1336 if (vflag) {
1337 printf("\n\t ");
1338 safeputs((const char *)tptr, tlv_len);
1339 }
1340 break;

--- 81 unchanged lines hidden ---
1325 break;
1326
1327 case LLDP_SYSTEM_DESCR_TLV:
1328 if (vflag) {
1329 printf("\n\t ");
1330 safeputs((const char *)tptr, tlv_len);
1331 }
1332 break;

--- 81 unchanged lines hidden ---