Hi, I want to get a value but i don't know its size till i dissect the previous field. I 'm thinking of using tvb_get_ntoh_64(), but what if value's size is bigger than 64 bits? Also i want to ask how to get a value of an IPv6? i don't want to use tvb_get_ip6 (it is void anyway). Any ideas??? asked 06 Aug '14, 05:02 Miltos Patsi... edited 06 Aug '14, 06:13 |
3 Answers:
If you want a raw buffer containing whatever size you want, you can use tvb_memdup(). But then you will need to know how to interpret its content. answered 06 Aug '14, 11:07 Pascal Quantin |
To answer your supplementary question: Also can you tell me how to get a value of an IPv6? I just need to print the value in a proto_tree_add_text function and i see that for IPv4 tvb_get_ntohl is used as it returns a 32 bit unsigned integer, so what about IPv6? Generally you should be using If you must get the values for purposes other than displaying in the tree then use answered 07 Aug '14, 03:31 grahamb ♦ |
So if the TLV containing the endpoint ID is the one described in RFC 6004 section 2.1, the endpoint ID is "defined in [G.8011] and [MEF10.1]". The second of those references is Metro Ethernet Forum Technical Specification 10.1, which has been superseded by 10.1.1, which has been suspended by 10.2. It also doesn't define anything it calls an "endpoint ID", but it does define an "Ethernet Virtual Connection ID" or "EVC ID" in section 6.2 "EVC ID Service Attribute". That section says
so if that's the "endpoint ID", it's an "arbitrary string", not a number. I infer from section 8.3 "Service Attribute Parameters" that "string" would mean "character string". The first of those references is ITU-T Recommendation G.8011/Y.1307, and doesn't seem to define anything it calls an "endpoint ID". However, section 7.1 "Ethernet virtual connection (EVC)" of that document says:
so it sounds as if an "endpoint ID" might be an "EVC ID", in which case it would be a string, not a number. And, in fact, RFC 6004 section 2.1 says
So it's not a number, it's a string, and you'd get it with answered 07 Aug '14, 04:35 Guy Harris ♦♦ |
What type of value do you want to get? Integral? Floating-point? Character string? Raw bytes with no interpretation? Something else?
It is an endpoint ID so i assume that it is an integer. Also can you tell me how to get a value of an IPv6? I just need to print the value in a proto_tree_add_text function and i see that for IPv4 tvb_get_ntohl is used as it returns a 32 bit unsigned integer, so what about IPv6?
Whether it's an integer depends on the protocol. What protocol is this?
The protocol is rsvp and i'm trying to add a new object(call atributes object) which contains the endpoint ID in a tlv.