open-traffic-generator / snappi

Open Traffic Generator SDK in Python and Go
MIT License
69 stars 7 forks source link

Gosnappi: "Invalid hex value" error is showing for capture filter custom value #124

Closed shramroy closed 2 years ago

shramroy commented 2 years ago

Observation from Snappi version: 0.6.5

"captures": [
            {
                "name": "c1",
                "port_names": ["rx"],
                "format": "pcap",
                "filters": [
                    {
                        "choice": "custom",
                        "custom": {
                            "value": "200000000000000b00000000",
                            "bit_length": 96,
                            "offset": 176
                        }
                    }
                ]
            }
        ]

Error message for the above config -

Exception: (400, {'message': 'Invalid hex value 200000000000000b00000000 on Value CaptureCustom\nvalidation errors'})

It is working fine for the below config -


"captures": [
            {
                "name": "c1",
                "port_names": ["rx"],
                "format": "pcap",
                "filters": [
                    {
                        "choice": "custom",
                        "custom": {
                            "value": "200000000000000",
                            "bit_length": 96,
                            "offset": 176
                        }
                    }
                ]
            }
        ]
Rangababu-R commented 2 years ago

this is because of go supports till uint64 bit size. will change the logic to support any size

shramroy commented 2 years ago

this is because of go supports till uint64 bit size. will change the logic to support any size

Thanks. that will work.