Commit 1bcae4bb authored by Alessandro Rubini's avatar Alessandro Rubini

include: define vlanhdr; add peer_vid to ppi

The vlanhdr is not something I can find in standard include files,
so here is a custom definition, called pp_vlanhdr.

Adding peer_vid is needed so a master can reply to its own slave,
while listening to several vlans.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent e972a128
......@@ -63,6 +63,7 @@ struct pp_channel {
void *arch_data; /* Other arch-private info, if any */
unsigned char addr[6]; /* Our own MAC address */
unsigned char peer[6]; /* Our peer's MAC address */
uint16_t peer_vid; /* Our peer's VID (for PROTO_VLAN) */
int pkt_present;
};
......
......@@ -35,6 +35,15 @@ extern int pp_sprintf(char *s, const char *fmt, ...)
extern int pp_vsprintf(char *buf, const char *, va_list)
__attribute__ ((format (printf, 2, 0)));
/* This structure is never defined, it seems */
struct pp_vlanhdr {
uint8_t h_dest[6];
uint8_t h_source[6];
uint16_t h_tpid;
uint16_t h_tci;
uint16_t h_proto;
};
/* We use data sets a lot, so have these helpers */
static inline struct pp_globals *GLBS(struct pp_instance *ppi)
......
......@@ -12,7 +12,7 @@
#include <ppsi/lib.h>
#include "wr-constants.h"
#define WRS_PPSI_SHMEM_VERSION 9 /* tx and rx offsets are split */
#define WRS_PPSI_SHMEM_VERSION 10 /* added peer_vid */
/*
* This structure is used as extension-specific data in the DSPort
......
......@@ -5,9 +5,9 @@
*
* Released according to the GNU LGPL, version 2.1 or any later version.
*/
#include <linux/if_ether.h>
#include <ppsi/ppsi.h>
#include "common-fun.h"
#include "../lib/network_types.h"
static void *msg_copy_header(MsgHeader *dest, MsgHeader *src)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment