Skip to content

Commit 8636981

Browse files
committed
3. remove common lib and include to schema.h
1 parent ea36817 commit 8636981

4 files changed

Lines changed: 35 additions & 32 deletions

File tree

common/Makefile.am

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ EXTRA_DIST = gen_cfg_schema.py
2222
# Generate cfg_schema.h before building the library
2323
BUILT_SOURCES = common/cfg_schema.h
2424

25-
common/cfg_schema.h:
26-
$(PYTHON) $(srcdir)/gen_cfg_schema.py -o $@
25+
# Rule to generate cfg_schema.h and make it depend on gen_cfg_schema.py
26+
common/cfg_schema.h: $(srcdir)/gen_cfg_schema.py
27+
$(AM_V_GEN)$(PYTHON) $< -o $@
28+
29+
# Make sure the header is cleaned up
30+
CLEANFILES += common/cfg_schema.h
2731

2832
# Install cfg_schema.h with other headers
2933
#nobase_include_HEADERS = common/cfg_schema.h

common/cfg_schema.h

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ namespace swss {
137137
#define CFG_PORT_QOS_MAP_TABLE_NAME "PORT_QOS_MAP"
138138
#define CFG_PORT_STORM_CONTROL_TABLE_NAME "PORT_STORM_CONTROL"
139139
#define CFG_PREFIX_TABLE_NAME "PREFIX"
140+
#define CFG_PREFIX_LIST_TABLE_NAME "PREFIX_LIST"
140141
#define CFG_PREFIX_SET_TABLE_NAME "PREFIX_SET"
141142
#define CFG_QUEUE_TABLE_NAME "QUEUE"
142143
#define CFG_RADIUS_TABLE_NAME "RADIUS"
@@ -190,37 +191,33 @@ namespace swss {
190191
#define CFG_WARM_RESTART_TABLE_NAME "WARM_RESTART"
191192
#define CFG_WRED_PROFILE_TABLE_NAME "WRED_PROFILE"
192193
#define CFG_XCVRD_LOG_TABLE_NAME "XCVRD_LOG"
193-
#define CFG_alpm-parity-error_TABLE_NAME "alpm-parity-error"
194-
#define CFG_asic-sdk-health-event_TABLE_NAME "asic-sdk-health-event"
195-
#define CFG_bgp-state_TABLE_NAME "bgp-state"
194+
// #define CFG_alpm-parity-error_TABLE_NAME "alpm-parity-error"
195+
// #define CFG_asic-sdk-health-event_TABLE_NAME "asic-sdk-health-event"
196+
// #define CFG_bgp-state_TABLE_NAME "bgp-state"
196197
#define CFG_chk_crm_threshold_TABLE_NAME "chk_crm_threshold"
197-
#define CFG_cpu-usage_TABLE_NAME "cpu-usage"
198-
#define CFG_dhcp-relay-bind-failure_TABLE_NAME "dhcp-relay-bind-failure"
199-
#define CFG_dhcp-relay-discard_TABLE_NAME "dhcp-relay-discard"
200-
#define CFG_dhcp-relay-disparity_TABLE_NAME "dhcp-relay-disparity"
201-
#define CFG_disk-usage_TABLE_NAME "disk-usage"
202-
#define CFG_event-disk_TABLE_NAME "event-disk"
203-
#define CFG_event-down-ctr_TABLE_NAME "event-down-ctr"
204-
#define CFG_event-kernel_TABLE_NAME "event-kernel"
205-
#define CFG_event-seu_TABLE_NAME "event-seu"
206-
#define CFG_event-sshd_TABLE_NAME "event-sshd"
207-
#define CFG_event-stopped-ctr_TABLE_NAME "event-stopped-ctr"
208-
#define CFG_if-state_TABLE_NAME "if-state"
209-
#define CFG_invalid-freelist_TABLE_NAME "invalid-freelist"
210-
#define CFG_mem-threshold-exceeded_TABLE_NAME "mem-threshold-exceeded"
211-
#define CFG_memory-usage_TABLE_NAME "memory-usage"
198+
// #define CFG_cpu-usage_TABLE_NAME "cpu-usage"
199+
// #define CFG_dhcp-relay-bind-failure_TABLE_NAME "dhcp-relay-bind-failure"
200+
// #define CFG_dhcp-relay-discard_TABLE_NAME "dhcp-relay-discard"
201+
// #define CFG_dhcp-relay-disparity_TABLE_NAME "dhcp-relay-disparity"
202+
// #define CFG_disk-usage_TABLE_NAME "disk-usage"
203+
// #define CFG_event-disk_TABLE_NAME "event-disk"
204+
// #define CFG_event-down-ctr_TABLE_NAME "event-down-ctr"
205+
// #define CFG_event-kernel_TABLE_NAME "event-kernel"
206+
// #define CFG_event-seu_TABLE_NAME "event-seu"
207+
// #define CFG_event-sshd_TABLE_NAME "event-sshd"
208+
// #define CFG_event-stopped-ctr_TABLE_NAME "event-stopped-ctr"
209+
// #define CFG_if-state_TABLE_NAME "if-state"
210+
// #define CFG_invalid-freelist_TABLE_NAME "invalid-freelist"
211+
// #define CFG_mem-threshold-exceeded_TABLE_NAME "mem-threshold-exceeded"
212+
// #define CFG_memory-usage_TABLE_NAME "memory-usage"
212213
#define CFG_notification_TABLE_NAME "notification"
213-
#define CFG_pfc-storm_TABLE_NAME "pfc-storm"
214-
#define CFG_process-exited-unexpectedly_TABLE_NAME "process-exited-unexpectedly"
215-
#define CFG_process-not-running_TABLE_NAME "process-not-running"
216-
#define CFG_select-operation-failure_TABLE_NAME "select-operation-failure"
217-
#define CFG_sonic-bgp-common_TABLE_NAME "sonic-bgp-common"
218-
#define CFG_sonic-events-common_TABLE_NAME "sonic-events-common"
219-
#define CFG_sonic-extension_TABLE_NAME "sonic-extension"
220-
#define CFG_sonic-types_TABLE_NAME "sonic-types"
221-
#define CFG_syncd-failure_TABLE_NAME "syncd-failure"
222-
#define CFG_watchdog-timeout_TABLE_NAME "watchdog-timeout"
223-
#define CFG_zebra-no-buff_TABLE_NAME "zebra-no-buff"
214+
// #define CFG_pfc-storm_TABLE_NAME "pfc-storm"
215+
// #define CFG_process-exited-unexpectedly_TABLE_NAME "process-exited-unexpectedly"
216+
// #define CFG_process-not-running_TABLE_NAME "process-not-running"
217+
// #define CFG_select-operation-failure_TABLE_NAME "select-operation-failure"
218+
// #define CFG_syncd-failure_TABLE_NAME "syncd-failure"
219+
// #define CFG_watchdog-timeout_TABLE_NAME "watchdog-timeout"
220+
// #define CFG_zebra-no-buff_TABLE_NAME "zebra-no-buff"
224221

225222
#ifdef __cplusplus
226223
}

common/schema.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef __SCHEMA__
22
#define __SCHEMA__
33

4+
#include "cfg_schema.h"
5+
46
#ifdef __cplusplus
57
namespace swss {
68
#endif

gen_cfg_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def main():
4848
yang_dir = args.dir
4949
sy = sonic_yang.SonicYang(yang_dir)
5050
sy.loadYangModel()
51-
keys = sy.confDbYangMap.keys()
51+
keys = [k for k, v in sy.confDbYangMap.items() if "container" in v]
5252
write_cfg_schema(keys, args.output)
5353

5454
if __name__ == "__main__":

0 commit comments

Comments
 (0)