summaryrefslogtreecommitdiff
path: root/cleopatre/application/libspid/inc/defs.h
blob: 938e502c967d6a49959f31338d176bee71863503 (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
87
88
89
/* SPC300 project {{{
 *
 * Copyright (C) 2010 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    application/libspid/inc/defs.h
 * \brief   define all item sizes used inside configuration / info files
 * \ingroup libspid
 *
 * All item sizes of config / info files are defined here to avoid some possible length mistakes
 */
#ifndef LIBSPID_DEFS_H
#define LIBSPID_DEFS_H

#include <stdint.h>

/* BOOLEAN */
#define LIBSPID_BOOLEAN_STR_MAX_LEN 8

/* IP/MAC ADDRESS */
/** Size of buffer to manage ip address */
#define LIBSPID_IP_STR_MAX_LEN 16
/** Size of buffer to manage mac address */
#define LIBSPID_MAC_STR_LEN 18
/** Size of mac address */ 
#define LIBSPID_MAC_BIN_LEN 6

/* CONFIG ITEM/LINE */
#define LIBSPID_CONFIG_LINE_MAX_LEN 1024
#define LIBSPID_CONFIG_KEY_MAX_LEN 63
#define LIBSPID_CONFIG_ELT_MAX_NB 32
#define LIBSPID_CONFIG_DELIMITER "="

/* SECURITY */
/** size of pbkdf1 salt */
#define LIBSPID_SECU_SALT_SIZE 8
/** max password size. */
#define LIBSPID_SECU_PWD_SIZE_MAX 64
/** SHA 256 size. */
#define LIBSPID_SECU_SHA256_SIZE 32
/** pbkdf1 generated key size */
#define LIBSPID_SECU_OUTPUT_KEY_SIZE 16
/** PBKDF1 iteration. */
#define LIBSPID_SECU_PBKDF1_ITERATION 1000

/* LIBSPID_HPAV_CONF_PATH */
/** Network PassWord */
#define LIBSPID_HPAV_CONF_NPW_DEFAULT "HomePlugAV0123"
#define LIBSPID_HPAV_CONF_NPW_MIN_LEN 8
#define LIBSPID_HPAV_CONF_NPW_ADVISED_MIN_LEN 24
#define LIBSPID_HPAV_CONF_NPW_MAX_LEN 64
/** Network Management Key */
#define LIBSPID_HPAV_CONF_NMK_STR_LEN 64
#define LIBSPID_HPAV_CONF_NMK_BIN_LEN LIBSPID_SECU_OUTPUT_KEY_SIZE
/** Network IDentifier */
#define LIBSPID_HPAV_CONF_NID_STR_LEN 32
#define LIBSPID_HPAV_CONF_NID_BIN_LEN 7
/** Security Level */
#define LIBSPID_HPAV_CONF_SL_STR_MAX_LEN 8
/** Human-Friendly IDentifiers string maximum length (in bytes) */
#define LIBSPID_HPAV_CONF_HFID_MAX_LEN 64

/* LIBSPID_HPAV_INFO_PATH */
/** PLC stack status string maximum length */
#define LIBSPID_HPAV_INFO_STATUS_MAX_LEN 16
/** PLC stack CCo string maximum length */
#define LIBSPID_HPAV_INFO_CCO_MAX_LEN 8

/* LIBSPID_SIGNAL_INFO_PATH */
/** Delimiter of "signal.info" file. */
#define LIBSPID_SIGNAL_INFO_DELIMITER " "


/* Multicast_info */
/** Delimiter of "mcast.info" file */
#define LIBSPID_MULTICAST_INFO_DELIMITER    " "

/** Maximum number of multicast groups in the multicast info file. */
/* uint8_t because it goes into an uint8_t field in an mme sent by plcd. */
#define LIBSPID_MULTICAST_INFO_GROUP_MAX_NB      ((uint8_t)12)

/** Maximum number of members in a group of the multicast info file. */
/* uint8_t because it goes into an uint8_t field in an mme sent by plcd. */
#define LIBSPID_MULTICAST_INFO_MEMBER_MAX_NB     ((uint8_t)1)

#endif /* LIBSPID_DEFS_H */