[Click] Problem compiling a new element

David Fuste f2308030 at est.fib.upc.edu
Tue Nov 15 11:04:09 EST 2005


Hi,
try to read the FAQ - Section 3:
http://pdos.csail.mit.edu/click/faq.html

Ramanathan Palaniappan wrote:

>Hi,
>
>I have added a simple element to Click and I have compiled it successfully.
>But when I use the element in my script, Click reports "unknown element
>class". I have attached the *.cc and *.hh files for reference. The new
>element was placed under "elements/local" and local was enabled during
>configuration.
>
>Any suggestions would be greatly appreciated.
>  
>
>------------------------------------------------------------------------
>
>/*
> * nullelement.{cc,hh} -- do-nothing element
> * Eddie Kohler
> *
> * Copyright (c) 1999-2000 Massachusetts Institute of Technology
> *
> * Permission is hereby granted, free of charge, to any person obtaining a
> * copy of this software and associated documentation files (the "Software"),
> * to deal in the Software without restriction, subject to the conditions
> * listed in the Click LICENSE file. These conditions include: you must
> * preserve this copyright notice, and you cannot mention the copyright
> * holders in advertising related to the Software without their permission.
> * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This
> * notice is a summary of the Click LICENSE file; the license in that file is
> * legally binding.
> */
>
>#include <click/config.h>
>#include "sample.hh"
>CLICK_DECLS
>
>ReplicateElement::ReplicateElement()
>  : Element(1, 2)
>{
>  MOD_INC_USE_COUNT;
>}
>
>ReplicateElement::~ReplicateElement()
>{
>  MOD_DEC_USE_COUNT;
>}
>
>void
>ReplicateElement::push(int port, Packet *p)
>{
>  output(0).push(p);
>  output(1).push(p);
>}
>
>
>
>EXPORT_ELEMENT(ReplicateElement)
>ELEMENT_REQUIRES(linuxmodule)
>//ELEMENT_REQUIRES(userlevel)
>//ELEMENT_MT_SAFE(ReplicateElement)
>CLICK_ENDDECLS
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>click mailing list
>click at amsterdam.lcs.mit.edu
>https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>  
>


More information about the click mailing list