-
Notifications
You must be signed in to change notification settings - Fork 16
/
ndn-services.h
58 lines (48 loc) · 2.03 KB
/
ndn-services.h
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
/*
* Copyright (C) 2018-2020
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v3.0. See the file LICENSE in the top level
* directory for more details.
*
* See AUTHORS.md for complete list of NDN-LITE authors and contributors.
*/
#ifndef NDN_SERVICES_H
#define NDN_SERVICES_H
#include <stdint.h>
// service types: 0-10 preserved for ndn-lite system default
#define NDN_SD_NONE ((uint8_t)(-1))
#define NDN_SD_DEV_CTL 0 // device control service, (ideally) run by ALL devices
#define NDN_SD_SD 1 // service discovery service, (ideally) run by ALL devices
#define NDN_SD_SD_CTL 2 // service discovery control service, run by authorized devices ONLY
#define NDN_SD_AC 3 // access control service, run by authorized devices ONLY
#define NDN_SD_POLICY 4 // policy service
// service types: > 48, < 255 application services
// ndncert only accepts printable ascii so should begin with 49
#define NDN_SD_LED 49 // LED service
#define NDN_SD_TEMP 50 // temperature service
#define NDN_SD_MOTION 51
#define NDN_SD_ALARM 52
#define NDN_SD_SMOKE 53
#define NDN_SD_AIRCON 54
// per-service command types
// DEV_CTL service
#define NDN_SD_DEV_ADV false // no advertisement
#define NDN_SD_DEV_CTL_ON 0 // turn on device
#define NDN_SD_DEV_CTL_OFF 1 // turn off device
#define NDN_SD_DEV_CTL_RESTART 2 // restart device
#define NDN_SD_DEV_CTL_SLEEP 3 // enter sleep mode
#define NDN_SD_DEV_CTL_AWAKE 4 // awake from sleep mode
#define NDN_SD_DEV_CTL_STATUS 5 // read status of the device
// SD service
#define NDN_SD_SD_ADV false // no advertisement
#define NDN_SD_SD_AD 0 // advertisement of self services
#define NDN_SD_SD_QUERY 1 // query services provided by the system
// SD_CTL service
#define NDN_SD_SD_CTL_ADV false // no advertisement
#define NDN_SD_SD_CTL_META 0 // query meta info of services in the system
// AC service
#define NDN_SD_AC_ADV false // no advertisement
#define NDN_SD_AC_EK 0 // query an encryption key from the SP
#define NDN_SD_AC_DK 1 // query a decryption key from the SP
#endif // NDN_SERVICES_H