irontec / sngrep

Ncurses SIP Messages flow viewer
GNU General Public License v3.0
1.02k stars 187 forks source link

IPv6 address in Source and Destination #363

Closed sergey-safarov closed 3 years ago

sergey-safarov commented 3 years ago

I want to search using Source and Destination fields value. In my case using IPv6 addresses. The current length of Source and Destination fields do not allow place full IPv6 addresses. Could you extend the size of the Source and Destination fields?

┌────────────────────────────────────────────────┐
│                 Filter options                 │
├────────────────────────────────────────────────┤
│  SIP From:                                     │
│  SIP To:                                       │
│  Source: wanted to plase IPv6 address here     │
│  Destination: and here wanted IPv6 address     │
│  Payload:                                      │
├────────────────────────────────────────────────┤
│  REGISTER   [*]        OPTIONS    [*]          │
│  INVITE     [*]        PUBLISH    [*]          │
│  SUBSCRIBE  [*]        MESSAGE    [*]          │
│  NOTIFY     [*]        REFER      [*]          │
│  INFO       [*]        UPDATE     [*]          │
├────────────────────────────────────────────────┤
│          [ Filter ]         [ Cancel ]         │
└────────────────────────────────────────────────┘

Maximal length of IPv6 address is 45 chars. Link

Kaian commented 3 years ago

Hi @sergey-safarov

Above commit allows both fields to internally store a bigger filter string. Take into account these fields are regular expressions, so avoid using brackets for ipv6 addresses.

Also, if you are filtering a lot of data, it would be better to use BPF filters in command line.

Thanks for reporting!

sergey-safarov commented 3 years ago

Thanks @Kaian I have made a test of current master and I able to specify IPv6 address like 2000:1111:2222:3333:4444:5555:6666:7777. But not able to specify 0000:0000:0000:0000:0000:ffff:192.168.100.228 that will be also the correct address.

Generally, I am fine with the latest update. So, I close commit.