clean up imported ipx dump parser warnings

This commit is contained in:
Mario Fetka
2026-04-29 19:25:11 +02:00
parent 9f1b35e2d7
commit fca94ccd6a
3 changed files with 96 additions and 87 deletions

View File

@@ -55,29 +55,31 @@
#include <signal.h>
#include "ipxutil.h"
#include "nls.h"
struct ipx_address
{
IPXNet net __attribute__((packed));
IPXNode node __attribute__((packed));
IPXPort sock __attribute__((packed));
};
IPXNet net;
IPXNode node;
IPXPort sock;
} __attribute__((packed));
struct ipx_packet
{
unsigned short ipx_checksum __attribute__((packed));
unsigned short ipx_checksum;
#define IPX_NO_CHECKSUM 0xFFFF
unsigned short ipx_pktsize __attribute__((packed));
unsigned char ipx_tctrl __attribute__((packed));
unsigned char ipx_type __attribute__((packed));
unsigned short ipx_pktsize;
unsigned char ipx_tctrl;
unsigned char ipx_type;
#define IPX_TYPE_UNKNOWN 0x00
#define IPX_TYPE_RIP 0x01 /* may also be 0 */
#define IPX_TYPE_SAP 0x04 /* may also be 0 */
#define IPX_TYPE_SPX 0x05 /* Not yet implemented */
#define IPX_TYPE_NCP 0x11 /* $lots for docs on this (SPIT) */
#define IPX_TYPE_PPROP 0x14 /* complicated flood fill brdcast [Not supported] */
struct ipx_address ipx_dest __attribute__((packed));
struct ipx_address ipx_source __attribute__((packed));
};
struct ipx_address ipx_dest;
struct ipx_address ipx_source;
} __attribute__((packed));
void handle_frame(unsigned char *buf, int length, struct sockaddr *saddr);
@@ -108,7 +110,7 @@ main(int argc, char *argv[])
struct ifreq ifr, oldifr;
const char *device = "eth0";
struct sockaddr saddr;
int sizeaddr;
socklen_t sizeaddr;
unsigned char buf[4096];
int length;
int opt;
@@ -257,6 +259,9 @@ handle_ipx(const char *frame, unsigned char *buf)
void
handle_other(unsigned char *buf, int length, struct sockaddr *saddr)
{
(void)length;
(void)saddr;
struct ethhdr *eth = (struct ethhdr *) buf;
unsigned char *p = &(buf[sizeof(struct ethhdr)]);