summaryrefslogtreecommitdiff
path: root/cleopatre/devkit/p1905_managerd/inc/cmdu.h
blob: 4e3049895eda3a7f5f70f326fc4d501adde727f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * cleopatre/application/p1905_managerd/inc/cmdu.h
 *
 * (C) Copyright 2013 MSsar Semiconductor, Inc.
 */
#ifndef CMDU_H
#define CMDU_H

#include "p1905_managerd.h"
#include "cmdu_message.h"
#include <sys/queue.h>

/** Interfaces name */
#define BR_IFNAME    "br0"
#define LO_IFNAME    "lo"
#define ETH0_IFNAME  "eth0"
#define PLC0_IFNAME  "plc0"
#define WIFI0_IFNAME  "ra0"

struct txq_list
{
    unsigned char dmac[6];
    unsigned char smac[6];
    msgtype mtype;
    unsigned short mid;
    TAILQ_ENTRY(txq_list) cmdu_txq_entry;
};

int cmdu_init(struct p1905_managerd_ctx *ctx);
void cmdu_uninit(struct p1905_managerd_ctx *ctx);
int process_cmdu_txq(struct p1905_managerd_ctx *ctx,unsigned char *buffer);
void insert_cmdu_txq(unsigned char *dmac, unsigned char *smac,msgtype mtype,unsigned short mid);
int cmdu_bridge_receive(struct p1905_managerd_ctx *ctx,unsigned char *buf,int len);
int cmdu_parse(struct p1905_managerd_ctx *ctx,unsigned char *buf,int len);

#endif /* CMDU_H */