Forum Discussion

ichalis_37981's avatar
ichalis_37981
Historic F5 Account
Jan 15, 2014

Diameter 64bit Avp manipulation

Hi all, Does anyone have any experience with fast, efficient ways to manipulate 64bit binary numbers on Bigip 11.3? Specifically I'm looking to do the following:

 

  • Convert 64 bit binary to decimal
  • Add two 64 bit binary numbers together with no conversion.(rather than converting to decimal, adding, then converting back)
  • Convert a decimal to 64 bit binary.

Any help would be much appreciated.

 

2 Replies

  • this might not answer all your questions or not the best approach but it is what I used in the past

     

    to read 64bit binary, first read it as octetstring, then use binary scan to get its value

     

    set ccoutputoctets [DIAMETER::avp data get 414 octet source $usedserviceunit]

     

    binary scan $ccoutputoctets W output

     

    to format value into 64 bit binary, first, use binary format to create octetstring, then create avp from the octetstring.

     

    set ccoutputoctets [DIAMETER::avp create 414 0 1 0 0 [binary format W 1048576]]

     

  • ichalis_37981's avatar
    ichalis_37981
    Historic F5 Account

    You read my mind! This is exactly what I was trying to do.. thanks for the help!