Hi,

I'm trying to add a new header (my_library.h) to openvswitch's sources.
This header contains a function that I want to call from ofproto.c (This
function is in my_main). The problem is that openvswitch use automake and
other files to compile. I found many files that Automake is using to create
Makfile correctly.

I tried to add my header file in include/openflow/ folder and I've modified
automake.mk from this folder (adding the header like the other ones).

--------------------------------------------------------------------------------------------------------------
 Here is my automake.mk
--------------------------------------------------------------------------------------------------------------

noinst_HEADERS += \
        include/openflow/nicira-ext.h \
        include/openflow/openflow-1.0.h \
        include/openflow/openflow-1.1.h \
        include/openflow/openflow-1.2.h \
        include/openflow/openflow-1.3.h \
        include/openflow/openflow-1.4.h \
        include/openflow/openflow-common.h \
        include/openflow/openflow.h \
        include/openflow/my_main.h \
        include/openflow/my_library.h


HSTAMP_FILES = \
        include/openflow/nicira-ext.hstamp \
        include/openflow/openflow-1.0.hstamp \
        include/openflow/openflow-1.1.hstamp \
        include/openflow/openflow-1.2.hstamp \
        include/openflow/openflow-1.3.hstamp \
        include/openflow/openflow-1.4.hstamp \
        include/openflow/openflow-common.hstamp \
        include/openflow/openflow.hstamp \
        include/openflow/my_main.hstamp \
        include/openflow/my_library.hstamp


include/openflow/openflow-1.0.hstamp: \
        include/openflow/openflow-common.h
include/openflow/openflow-1.1.hstamp: \
        include/openflow/openflow-common.h
include/openflow/openflow-1.2.hstamp: \
        include/openflow/openflow-common.h \
        include/openflow/openflow-1.1.h
include/openflow/openflow-1.3.hstamp: \
        include/openflow/openflow-common.h \
        include/openflow/openflow-1.1.h \
        include/openflow/openflow-1.2.h
include/openflow/openflow-1.4.hstamp: \
        include/openflow/openflow-1.4.h
include/openflow/nicira-ext.hstamp: \
        include/openflow/openflow.h \
        include/openflow/openflow-common.h \
        include/openflow/openflow-1.0.h \
        include/openflow/openflow-1.1.h \
        include/openflow/openflow-1.2.h \
        include/openflow/openflow-1.3.h
include/openflow/my_main.hstamp:
        include/openflow/my_library.h

--------------------------------------------------------------------------------------------------------------

Then I added my .c file in the lib folder and I've also modified automake.mk
 (adding my_main.c file in the first array: lib_libopenvswitch_la_SOURCES).

--------------------------------------------------------------------------------------------------------------
Here is my automake.mk from the lib folder
--------------------------------------------------------------------------------------------------------------

lib_libopenvswitch_la_SOURCES = \
        lib/aes128.c \
        lib/aes128.h \
        lib/async-append.h \

(...) more headers

        lib/vtep-idl.c \
        lib/vtep-idl.h \
lib/my_main.c

--------------------------------------------------------------------------------------------------------------

When I compile the sources I found dependency errors, but it seems that the
files are correctly added.

--------------------------------------------------------------------------------------------------------------
Here are my output errors
--------------------------------------------------------------------------------------------------------------

In file included from /usr/include/linux/rtnetlink.h:8:0,
                 from /usr/include/netlink/netlink.h:26,
                 from /usr/include/netlink/genl/genl.h:15,
                 from ./include/openflow/my_main.h:23,
                 from lib/my_main.c:1:
/usr/include/linux/neighbour.h:11:2: error: unknown type name '__s32'
In file included from /usr/include/netlink/netlink.h:26:0,
                 from /usr/include/netlink/genl/genl.h:15,
                 from ./include/openflow/my_main.h:23,
                 from lib/my_main.c:1:
/usr/include/linux/rtnetlink.h:332:2: error: unknown type name '__s32'

--------------------------------------------------------------------------------------------------------------

In my_main.c I used netlink functions (netlink libraries).
I don't know why I obtain these errors. Am I missing something important?

Any help would be appreciated.

Regards,

Anna
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to