Skip to content

Commit

Permalink
[nes]: GMPLS changes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
nes-repo committed Jun 23, 2015
1 parent e81ead0 commit 0cc8969
Show file tree
Hide file tree
Showing 10 changed files with 395 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ include ${MK_COMMON}

PROJECT_OBJS :=

MODULE_TREE := lib snmp system if entity hal ethernet lag bridge cfm isis stp spb inet tcpUdp
MODULE_TREE := lib snmp system if entity hal ethernet lag bridge cfm isis stp spb inet ted mpls tcpUdp
MODULE_PATH := .

include $(addsuffix /Makefile,${MODULE_TREE})
Expand Down
40 changes: 40 additions & 0 deletions include/mpls_ext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2008-2015
* NES Dev <nes.open.switch@gmail.com>
*
* All rights reserved. This source file is the sole property of NES, and
* contain proprietary and confidential information related to NES.
*
* Licensed under the NES RED License, Version 1.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License bundled along with this file. Any kind of reproduction
* or duplication of any part of this file which conflicts with the License
* without prior written consent from NES is strictly prohibited.
*
* Unless required by applicable law and agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
//set ts=4 sw=4

#ifndef __MPLS_EXT_H__
# define __MPLS_EXT_H__

# ifdef __cplusplus
extern "C" {
# endif



extern void *mpls_main (void *pvArgv);
extern void *mpls_start (void *pvArgv);



# ifdef __cplusplus
}
# endif

#endif // __MPLS_EXT_H__
6 changes: 6 additions & 0 deletions include/switch_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ enum
ModuleId_stp_c,
ModuleId_spb_c,
ModuleId_inet_c,
ModuleId_ted_c,
ModuleId_mpls_c,
ModuleId_tcpUdp_c,
};

Expand Down Expand Up @@ -85,6 +87,8 @@ typedef struct ModuleInfo_t
#include "stp_ext.h"
#include "spb_ext.h"
#include "inet_ext.h"
#include "ted_ext.h"
#include "mpls_ext.h"
#include "tcpUdp_ext.h"


Expand All @@ -107,6 +111,8 @@ static ModuleInfo_t aoModuleList[] =
{ModuleId_stp_c, NULL, &stp_main, NULL},
{ModuleId_spb_c, NULL, &spb_main, NULL},
{ModuleId_inet_c, NULL, &inet_main, NULL},
{ModuleId_ted_c, NULL, &ted_main, NULL},
{ModuleId_mpls_c, NULL, &mpls_main, NULL},
{ModuleId_tcpUdp_c, NULL, &tcpUdp_main, NULL},
};

Expand Down
40 changes: 40 additions & 0 deletions include/ted_ext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2008-2015
* NES Dev <nes.open.switch@gmail.com>
*
* All rights reserved. This source file is the sole property of NES, and
* contain proprietary and confidential information related to NES.
*
* Licensed under the NES RED License, Version 1.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License bundled along with this file. Any kind of reproduction
* or duplication of any part of this file which conflicts with the License
* without prior written consent from NES is strictly prohibited.
*
* Unless required by applicable law and agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
//set ts=4 sw=4

#ifndef __TED_EXT_H__
# define __TED_EXT_H__

# ifdef __cplusplus
extern "C" {
# endif



extern void *ted_main (void *pvArgv);
extern void *ted_start (void *pvArgv);



# ifdef __cplusplus
}
# endif

#endif // __TED_EXT_H__
47 changes: 47 additions & 0 deletions mpls/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#*
#* Copyright (c) 2008-2015
#* NES Dev <nes.open.switch@gmail.com>
#*
#* All rights reserved. This source file is the sole property of NES, and
#* contain proprietary and confidential information related to NES.
#*
#* Licensed under the NES RED License, Version 1.0 (the "License"); you may
#* not use this file except in compliance with the License. You may obtain a
#* copy of the License bundled along with this file. Any kind of reproduction
#* or duplication of any part of this file which conflicts with the License
#* without prior written consent from NES is strictly prohibited.
#*
#* Unless required by applicable law and agreed to in writing, software
#* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#* License for the specific language governing permissions and limitations
#* under the License.
#*

MODULE := mpls
MODULE_BIN = ${MODULE}${OBJ_EXT}
MODULE_TREE :=


ifneq (${PROJECT_NAME},)
$(eval $(call MODULE_INC,${MODULE},${MODULE_TREE}))
else

include ${MK_COMMON}

CFLAGS +=

SNMP_SRC :=
MODULE_SRC := mpls_main.c ${SNMP_SRC}

$(call MODULE_DEP,${MODULE_SRC},${CFLAGS},${INCLUDES})

$(SNMP_SRC:%.c=%.o): CFLAGS += ${SNMP_CFLAGS}

all: ${MODULE_BIN}

${MODULE_BIN}: $(MODULE_SRC:%.c=%.o)

include make.dep

endif
42 changes: 42 additions & 0 deletions mpls/mpls_defines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2008-2015
* NES Dev <nes.open.switch@gmail.com>
*
* All rights reserved. This source file is the sole property of NES, and
* contain proprietary and confidential information related to NES.
*
* Licensed under the NES RED License, Version 1.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License bundled along with this file. Any kind of reproduction
* or duplication of any part of this file which conflicts with the License
* without prior written consent from NES is strictly prohibited.
*
* Unless required by applicable law and agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
//set ts=4 sw=4

#ifndef __MPLS_DEFINES_H__
# define __MPLS_DEFINES_H__

# ifdef __cplusplus
extern "C" {
# endif



#include "lib/log.h"

#define MOD_NAME "MPLS"
#define Mpls_log(_pri, _frmt, _args ...) xLog_print (MOD_NAME, _pri, _frmt, ## _args)



# ifdef __cplusplus
}
# endif

#endif // __MPLS_DEFINES_H__
65 changes: 65 additions & 0 deletions mpls/mpls_main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* Copyright (c) 2008-2015
* NES Dev <nes.open.switch@gmail.com>
*
* All rights reserved. This source file is the sole property of NES, and
* contain proprietary and confidential information related to NES.
*
* Licensed under the NES RED License, Version 1.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License bundled along with this file. Any kind of reproduction
* or duplication of any part of this file which conflicts with the License
* without prior written consent from NES is strictly prohibited.
*
* Unless required by applicable law and agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
//set ts=4 sw=4

#ifndef __MPLS_MAIN_C__
# define __MPLS_MAIN_C__


#include "mpls_ext.h"
#include "mpls_defines.h"
#include "switch_ext.h"

#include "lib/thread.h"


static xThreadInfo_t oMplsThread =
{
.u32Index = XTHREAD_ID (ModuleId_mpls_c, 0),
.u8SchedPolicy = SCHED_RR,
.u8Priority = 1,
.poStart = &mpls_start,
};


void *
mpls_main (void *pvArgv)
{
if (xThread_create (&oMplsThread) == NULL)
{
Mpls_log (xLog_err_c, "xThread_create() failed\n");
return NULL;
}

return NULL;
}

void *
mpls_start (void *pvArgv)
{
while (1)
{
xThread_sleep (1);
}
return NULL;
}


#endif // __MPLS_MAIN_C__
47 changes: 47 additions & 0 deletions ted/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#*
#* Copyright (c) 2008-2015
#* NES Dev <nes.open.switch@gmail.com>
#*
#* All rights reserved. This source file is the sole property of NES, and
#* contain proprietary and confidential information related to NES.
#*
#* Licensed under the NES RED License, Version 1.0 (the "License"); you may
#* not use this file except in compliance with the License. You may obtain a
#* copy of the License bundled along with this file. Any kind of reproduction
#* or duplication of any part of this file which conflicts with the License
#* without prior written consent from NES is strictly prohibited.
#*
#* Unless required by applicable law and agreed to in writing, software
#* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#* License for the specific language governing permissions and limitations
#* under the License.
#*

MODULE := ted
MODULE_BIN = ${MODULE}${OBJ_EXT}
MODULE_TREE :=


ifneq (${PROJECT_NAME},)
$(eval $(call MODULE_INC,${MODULE},${MODULE_TREE}))
else

include ${MK_COMMON}

CFLAGS +=

SNMP_SRC :=
MODULE_SRC := ted_main.c ${SNMP_SRC}

$(call MODULE_DEP,${MODULE_SRC},${CFLAGS},${INCLUDES})

$(SNMP_SRC:%.c=%.o): CFLAGS += ${SNMP_CFLAGS}

all: ${MODULE_BIN}

${MODULE_BIN}: $(MODULE_SRC:%.c=%.o)

include make.dep

endif
42 changes: 42 additions & 0 deletions ted/ted_defines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2008-2015
* NES Dev <nes.open.switch@gmail.com>
*
* All rights reserved. This source file is the sole property of NES, and
* contain proprietary and confidential information related to NES.
*
* Licensed under the NES RED License, Version 1.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License bundled along with this file. Any kind of reproduction
* or duplication of any part of this file which conflicts with the License
* without prior written consent from NES is strictly prohibited.
*
* Unless required by applicable law and agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
//set ts=4 sw=4

#ifndef __TED_DEFINES_H__
# define __TED_DEFINES_H__

# ifdef __cplusplus
extern "C" {
# endif



#include "lib/log.h"

#define MOD_NAME "TED"
#define Ted_log(_pri, _frmt, _args ...) xLog_print (MOD_NAME, _pri, _frmt, ## _args)



# ifdef __cplusplus
}
# endif

#endif // __TED_DEFINES_H__

0 comments on commit 0cc8969

Please sign in to comment.