Skip to content

ip filter register reading #114

@SQUARE-WAVES

Description

@SQUARE-WAVES

I'm trying to look at a card and see what ip filtering rules have been set. while the exanic_port struct in the kernel modules has a nice table of rules, there doesn't seem to be any way to get it in user space (I assume there is a reason for that, I don't know enough about drivers to be sure though.)

in libs/exanic/filter.h there is only functionality for setting or removing a filter, but in libs/exanic/pcie_if.h we are given information about the memory region the filter rules are mapped to. However I've found it difficult to actually find that memory. If I clear all the ip filters and then set up one like so:

exanic_ip_filter_t filter = {
  .src_addr = 0x00000000;
  .dst_addr = 0x00000000;
  .src_port =  0x00;
   .dst_port = 0x00; 
    .protocol = 0;
} exanic_ip_filter_t;
//assuming I have my handle and buffer already
int rule_num = exanic_filter_add_ip(handle,buffer,&filter);

How would I go about finding the bits it sets in the memory? Trying to find them using the handle->filters pointer as a starting point, handle->registers doesn't map nearly enough memory to even get close to the filter region. no matter how I try to use the macro I can't seem to find anything that looks like the layout I would expect.

Ive searched for additional documentation as well but I can't find anything about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions