Dear Livio,
My installation of pr_ring looks ok to my as I can run the
pfcount example. The problem now I copied the pcount and rename it as pf1.c
Then I tried to compile I got whole lots of errors as below. Do you think I
should just copy the pfring.h into usr/local/include or do it via some
proper manner? Thank you.
[root@localhost examples]# gcc -o pf1 pf1.c
In file included from pf1.c:47:
/usr/local/include/pfring.h:59:27: error: linux/pf_ring.h: No such file or
directory
In file included from pf1.c:47:
/usr/local/include/pfring.h:132: error: expected specifier-qualifier-list
before ‘packet_direction’
/usr/local/include/pfring.h:231: error: ‘MAX_NUM_RX_CHANNELS’ undeclared
here (not in a function)
/usr/local/include/pfring.h:248: error: expected declaration specifiers or
‘...’ before ‘hw_filtering_rule’
/usr/local/include/pfring.h:258: error: expected declaration specifiers or
‘...’ before ‘packet_direction’
/usr/local/include/pfring.h:259: error: expected declaration specifiers or
‘...’ before ‘cluster_type’
/usr/local/include/pfring.h:269: error: expected declaration specifiers or
‘...’ before ‘hash_filtering_rule’
/usr/local/include/pfring.h:272: error: expected declaration specifiers or
‘...’ before ‘hash_filtering_rule’
/usr/local/include/pfring.h:275: error: expected declaration specifiers or
‘...’ before ‘filtering_rule’
/usr/local/include/pfring.h:287: error: expected declaration specifiers or
‘...’ before ‘virtual_filtering_device_info’
pf1.c: In function ‘add_rule’:
pf1.c:158: error: ‘hash_filtering_rule’ undeclared (first use in this
function)
pf1.c:158: error: (Each undeclared identifier is reported only once
pf1.c:158: error: for each function it appears in.)
pf1.c:158: error: expected ‘;’ before ‘rule’
pf1.c:160: error: ‘rule’ undeclared (first use in this function)
pf1.c:162: error: ‘dont_forward_packet_and_stop_rule_evaluation’ undeclared
(first use in this function)
pf1.c:166: error: too many arguments to function
‘pfring_handle_hash_filtering_rule’
pf1.c:173: error: too many arguments to function
‘pfring_handle_hash_filtering_rule’
pf1.c: At top level:
pf1.c:329: warning: ‘struct pfring_pkthdr’ declared inside parameter list
pf1.c: In function ‘dummyProcesssPacket’:
pf1.c:341: error: dereferencing pointer to incomplete type
pf1.c:342: error: dereferencing pointer to incomplete type
pf1.c:342: error: invalid application of ‘sizeof’ to incomplete type
‘struct pkt_parsing_info’
pf1.c:343: warning: passing argument 2 of ‘pfring_parse_pkt’ from
incompatible pointer type
/usr/local/include/pfring.h:306: note: expected ‘struct pfring_pkthdr *’
but argument is of type ‘struct pfring_pkthdr *’
pf1.c:346: error: dereferencing pointer to incomplete type
pf1.c:347: error: dereferencing pointer to incomplete type
pf1.c:348: error: dereferencing pointer to incomplete type
pf1.c:349: error: dereferencing pointer to incomplete type
pf1.c:351: error: dereferencing pointer to incomplete type
pf1.c:352: error: dereferencing pointer to incomplete type
pf1.c:368: error: dereferencing pointer to incomplete type
pf1.c:370: error: dereferencing pointer to incomplete type
pf1.c:371: error: dereferencing pointer to incomplete type
pf1.c:373: error: dereferencing pointer to incomplete type
pf1.c:374: error: dereferencing pointer to incomplete type
pf1.c:374: error: dereferencing pointer to incomplete type
pf1.c:375: error: dereferencing pointer to incomplete type
pf1.c:376: error: dereferencing pointer to incomplete type
pf1.c:377: error: dereferencing pointer to incomplete type
pf1.c:377: error: dereferencing pointer to incomplete type
pf1.c:378: error: dereferencing pointer to incomplete type
pf1.c:381: error: dereferencing pointer to incomplete type
pf1.c:382: error: dereferencing pointer to incomplete type
pf1.c:385: error: dereferencing pointer to incomplete type
pf1.c:389: error: dereferencing pointer to incomplete type
pf1.c:390: error: dereferencing pointer to incomplete type
pf1.c:403: error: dereferencing pointer to incomplete type
pf1.c:405: error: dereferencing pointer to incomplete type
pf1.c:406: error: dereferencing pointer to incomplete type
pf1.c:410: error: dereferencing pointer to incomplete type
pf1.c:411: error: dereferencing pointer to incomplete type
pf1.c:411: error: dereferencing pointer to incomplete type
pf1.c:412: error: dereferencing pointer to incomplete type
pf1.c:412: error: dereferencing pointer to incomplete type
pf1.c:412: error: dereferencing pointer to incomplete type
pf1.c:413: error: dereferencing pointer to incomplete type
pf1.c:414: error: dereferencing pointer to incomplete type
pf1.c:415: error: dereferencing pointer to incomplete type
pf1.c:416: error: dereferencing pointer to incomplete type
pf1.c:426: error: dereferencing pointer to incomplete type
pf1.c:426: error: dereferencing pointer to incomplete type
pf1.c:426: error: dereferencing pointer to incomplete type
pf1.c:427: error: dereferencing pointer to incomplete type
pf1.c:428: error: dereferencing pointer to incomplete type
pf1.c:429: error: dereferencing pointer to incomplete type
pf1.c:430: error: dereferencing pointer to incomplete type
pf1.c:434: error: dereferencing pointer to incomplete type
pf1.c: In function ‘packet_consumer_thread’:
pf1.c:514: error: storage size of ‘hdr’ isn’t known
pf1.c: In function ‘main’:
pf1.c:574: error: ‘packet_direction’ undeclared (first use in this function)
pf1.c:574: error: expected ‘;’ before ‘direction’
pf1.c:628: error: ‘rx_and_tx_direction’ undeclared (first use in this
function)
pf1.c:629: error: ‘rx_only_direction’ undeclared (first use in this
function)
pf1.c:630: error: ‘tx_only_direction’ undeclared (first use in this
function)
pf1.c:631: error: ‘direction’ undeclared (first use in this function)
pf1.c:718: error: ‘cluster_round_robin’ undeclared (first use in this
function)
pf1.c:718: error: too many arguments to function ‘pfring_set_cluster’
pf1.c:722: error: too many arguments to function ‘pfring_set_direction’
pf1.c:799: error: ‘filtering_rule’ undeclared (first use in this function)
pf1.c:799: error: expected ‘;’ before ‘rule’
pf1.c:802: error: ‘rule’ undeclared (first use in this function)
pf1.c:805: error: ‘dont_forward_packet_and_stop_rule_evaluation’ undeclared
(first use in this function)
pf1.c:808: error: too many arguments to function ‘pfring_add_filtering_rule’
pf1.c:821: error: too many arguments to function ‘pfring_add_filtering_rule’
pf1.c:834: error: too many arguments to function ‘pfring_add_filtering_rule’
pf1.c:865: error: expected ‘;’ before ‘rule’
pf1.c:872: error: ‘forward_packet_and_stop_rule_evaluation’ undeclared
(first use in this function)
pf1.c:877: error: too many arguments to function ‘pfring_add_filtering_rule’
pf1.c:897: warning: passing argument 2 of ‘pfring_loop’ from incompatible
pointer type
/usr/local/include/pfring.h:235: note: expected ‘pfringProcesssPacket’ but
argument is of type ‘void (*)(const struct pfring_pkthdr *, const u_char *,
const u_char *)’
On Fri, Nov 11, 2011 at 1:56 AM, livio Ricciulli <li...@metaflows.com>wrote: