[ovs-dev] adding my own .c file

Ben Pfaff blp at nicira.com
Wed Dec 21 06:04:15 UTC 2011


And what compiler errors do you get?

Also, stop dropping the mailing list or I will stop responding.

On Wed, Dec 21, 2011 at 11:35:44AM +0530, shiva m wrote:
> Hi Ben,
> 
> I changed the following files
> 
> 1 ofprot/automake.mk
> 
> noinst_LIBRARIES += ofproto/libofproto.a
> ofproto_libofproto_a_SOURCES = \
>         ofproto/collectors.c \
>         ofproto/collectors.h \
>         ofproto/connmgr.c \
>         ofproto/connmgr.h \
>         ofproto/fail-open.c \
>         ofproto/fail-open.h \
>         ofproto/in-band.c \
>         ofproto/in-band.h \
>         ofproto/names.c \
>         ofproto/netflow.c \
>         ofproto/netflow.h \
>         ofproto/ofproto.c \
>         ofproto/ofproto.h \
>         ofproto/ofproto-dpif.c \
>         ofproto/ofproto-dpif-sflow.c \
>         ofproto/ofproto-dpif-sflow.h \
>         ofproto/ofproto-provider.h \
>         ofproto/pktbuf.c \
>         ofproto/pktbuf.h \
>         ofproto/pinsched.c \
>         ofproto/pinsched.h \
>         ofproto/shiva.c     // my addition
> 
> 2. my shiva.c file
> 
> 
> #include<stdio.h>
> #include<ofproto.h>
> 
> void test()
> {
> printf("hiiii\n");
> 
> }
> 
> 3. added my test() function prototype in ofproto.h. few lines from
> ofproto.h are :
> 
> int ofproto_run(struct ofproto *);
> void ofproto_wait(struct ofproto *);
> bool ofproto_is_alive(const struct ofproto *);
> void test(); // my addition
> 
> 
> Please help me what changed i need to make to compile my shiva.c file with
> OVS1.2.2.
> 
> Thanks & Regards,
> Shiva
> 
> On Wed, Dec 21, 2011 at 11:18 AM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > It's easier for me if you do as I originally asked and show the changes
> > you made.
> >
> > On Wed, Dec 21, 2011 at 11:22:01AM +0530, shiva m wrote:
> > > Hi,
> > >
> > > Its a test.c file which has just a function test() which has
> > printf("hi\n")
> > > statement. I am trying to compile by adding my test.c file in ofproto/
> > > automake.mk and function prototype in ofproto.h. Could you please help
> > me
> > > how to add my c file, where to change and compile it properly
> > >
> > > Thanks & Regards,
> > > Shiva
> > >
> > > On Tue, Dec 20, 2011 at 8:54 PM, Ben Pfaff <blp at nicira.com> wrote:
> > >
> > > > On Tue, Dec 20, 2011 at 12:25:53PM +0530, shiva m wrote:
> > > > > I have openvswitch 1.2.2 on xen server 6.0. I added my *test.c* file
> > in *
> > > > > ofproto* folder, included function prototype in ofproto.h and *
> > > > test.c*file in
> > > > > ofproto/automake.mk, but i am not able to compile.
> > > > >
> > > > > Could you please let me know how to add my test.c file to openvswitch
> > > > 1.2.2
> > > > > and compile it properly.
> > > >
> > > > It sounds like you did the right things in outline.  The details must
> > be
> > > > wrong.  So, you should show us the actual changes you made.
> > > >
> >



More information about the dev mailing list