Uploaded image for project: 'vpp'
  1. vpp
  2. VPP-1777

Hide network-ordered values from human-written code

XMLWordPrintable

      Vppapigen already creates *_endian functions, which allow automated processing of API message values to and from network order. But currently such processing is not applied when VPP receives API messages, so manual calls to ntohl() and similar are needed. I believe the processing is automatic when VPP sends API messages (at least when using usual macros).

      This is the task to change VPP infra so that handler functions receive the message already in host order, so the human-written code (except infra code) does not need to deal with network order values at any point. This includes a lot of editing in the handlers (to remove manual conversions) and in test (to remove wrong conversions).

      Hypothetically, there can be host architectures where htonl is not identical to ntohl, so single *_endian is not enough for both conversions. But I do not think VPP supports those architectures with the current code, so no big deal if it does not support them after this task.

            KlementSekera Klement Sekera
            vrpolak Vratko Polak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: