summaryrefslogtreecommitdiff
path: root/cleopatre/application/managerd/inc/vs_mme.h
blob: 80bd46cf94cfb615e7f3d949f98ff71649224103 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
 * cleopatre/application/managerd/inc/vs_mme.h
 *
 * (C) Copyright 2009 SPiDCOM Technologies
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */
#ifndef VS_MME_H
#define VS_MME_H

#include "libmme.h"
#include "managerd.h"
#include "bridge.h"

#define SPC300_ID 0x0001
#define PLC_VERSION_PATH "/proc/net/plc/version"

#define MME_RESULT_SUCCESS 0
#define MME_RESULT_FAILURE 1

typedef struct {
    uint8_t oui[3];
    uint8_t result;
    uint16_t device_id;
    uint8_t current_image_index;
    uint8_t applicative_version[16];
    uint8_t av_stack_version[64];
    uint8_t applicative_alternate[16];
} __attribute__ ((__packed__)) vs_get_version_cnf_t;

typedef enum {
    ETH_STATS_COMMAND_GET = 0,
    ETH_STATS_COMMAND_RESET,
    ETH_STATS_COMMAND_NB
} vs_eth_stats_command_t;

typedef struct {
    uint8_t oui[3];
    uint8_t command;
} __attribute__ ((__packed__)) vs_eth_stats_req_t;

typedef struct {
    uint8_t oui[3];
    uint8_t result;
} __attribute__ ((__packed__)) vs_reset_cnf_t;

typedef struct {
    uint8_t oui[3];
    uint8_t result;
    uint32_t rx_bytes_low;
    uint32_t rx_bytes_high;
    uint32_t rx_packets_low;
    uint32_t rx_packets_high;
    uint32_t rx_errors;
    uint32_t rx_dropped;
    uint32_t rx_overruns;
    uint32_t rx_frames;
    uint32_t tx_bytes_low;
    uint32_t tx_bytes_high;
    uint32_t tx_packets_low;
    uint32_t tx_packets_high;
    uint32_t tx_errors;
    uint32_t tx_dropped;
    uint32_t tx_fifo;
    uint32_t tx_collisions;
    uint32_t tx_carrier;
} __attribute__ ((__packed__)) vs_eth_stats_cnf_t;

extern enum bridge_status vs_mme_get_version (struct managerd_ctx *ctx, MME_t *request, MME_t * confirm, int len);
extern enum bridge_status vs_mme_eth_stats (struct managerd_ctx *ctx, MME_t *request, MME_t * confirm, int len);
extern enum bridge_status vs_mme_reset (struct managerd_ctx *ctx, MME_t *request, MME_t *confirm, int len);

#endif /* VS_MME_H */