robur-coop / miragevpn

An opinionated implementation of the OpenVPN protocol
BSD 2-Clause "Simplified" License
79 stars 9 forks source link

Rename packet_id to replay_id; message_id to packet_id #156

Closed hannesm closed 1 year ago

hannesm commented 1 year ago

since it's a renaming, I'd be keen to merge it rather sooner than later... @reynir what are your thoughts about the renaming? does "replay ID" and "packet ID" make it clearer (also in respect to https://git.robur.coop/robur/openvpn-spec/issues/6)

hannesm commented 1 year ago

we could as well rename the new packet id (former message id) as sequence number? WDYT?

reynir commented 1 year ago

I think I would like to avoid 'packet id'. I like sequence number. In the openvpn code the replay packet id (replay id) code mostly lives in packet_id.[ch] while the packet id (sequence number) lives mostly in reliable.c but uses the packet_id_type type from packet_id.h. It is highly confusing when reading the code that packet_id is used for both so I would prefer if we can avoid that term.

I like replay_id even if it's a half-truth as the timestamp is considered part of the replay packet id.

reynir commented 1 year ago

I force pushed the suggested sequence number change. I also found some more occurences of "packet[_ ]id" and renamed them to replay_id or replay packet id.