*/
-#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
#include <stdio.h>
-#include "interface.h"
+#include "netdissect.h"
#include "extract.h"
#define RSTP_EXTRACT_PORT_ROLE(x) (((x)&0x0C)>>2)
#define STP_BPDU_MSTP_MIN_LEN 102
struct stp_bpdu_ {
- u_int8_t protocol_id[2];
- u_int8_t protocol_version;
- u_int8_t bpdu_type;
- u_int8_t flags;
- u_int8_t root_id[8];
- u_int8_t root_path_cost[4];
- u_int8_t bridge_id[8];
- u_int8_t port_id[2];
- u_int8_t message_age[2];
- u_int8_t max_age[2];
- u_int8_t hello_time[2];
- u_int8_t forward_delay[2];
- u_int8_t v1_length;
+ uint8_t protocol_id[2];
+ uint8_t protocol_version;
+ uint8_t bpdu_type;
+ uint8_t flags;
+ uint8_t root_id[8];
+ uint8_t root_path_cost[4];
+ uint8_t bridge_id[8];
+ uint8_t port_id[2];
+ uint8_t message_age[2];
+ uint8_t max_age[2];
+ uint8_t hello_time[2];
+ uint8_t forward_delay[2];
+ uint8_t v1_length;
};
#define STP_PROTO_REGULAR 0x00
u_int length)
{
const u_char *ptr;
- u_int16_t v3len;
- u_int16_t len;
- u_int16_t msti;
+ uint16_t v3len;
+ uint16_t len;
+ uint16_t msti;
u_int offset;
ptr = (const u_char *)stp_bpdu;
u_int mstp_len;
u_int spb_len;
- stp_bpdu = (struct stp_bpdu_*)p;
+ stp_bpdu = (const struct stp_bpdu_*)p;
/* Minimum STP Frame size. */
if (length < 4)