pcarana [Fri, 22 Mar 2019 16:08:42 +0000 (10:08 -0600)]
Remove some TODOs and add some fixes.
-Deltas creation is responsibility of vrps.c, so remove it from csv.c
-Remove unnecessary storage from heap (vrp structs, base DB an delta DB) and avoid some mem leaks.
-Change 'delta_resume' to 'delta_summary'.
-Handle error codes that were ignored.
pcarana [Thu, 21 Mar 2019 00:46:46 +0000 (18:46 -0600)]
Format line width (80) and 4 spaces indentation when needed, remove some TODOs
-Align definition of constants.
-csv.h and .c: add void param to 'csv_parse_vrps_file'.
-line_file.h: add missing param of 'lfile_close'.
-main.c: comment 'TODO This will be overriden [..]' was for developer, isn't valid since the conf will be loaded from the JSON file.
-notify.h and .c: add void param to 'notify_clients'.
-vrps.c: explain VRP meaning, how session ID is the existent solution to avoid serial desynchronization, and remove bad comment style.
pcarana [Fri, 15 Mar 2019 15:41:08 +0000 (09:41 -0600)]
Calculate and get changes between serials.
Use a base serial, the base will always be the last DB update.
Calculate the difference between the latest version and the past, and store it as delta.
Save pointers to deltas, increment last serial number when the update ops are complete.
Avoid to send duplicate announcements/withdrawals.
pcarana [Mon, 11 Mar 2019 17:52:36 +0000 (11:52 -0600)]
Use Error PDUs handling methods and prepare to send other error PDUs
Send Unexpected Protocol Version when needed.
Simplify 'send_error_report_pdu' call.
Remove error codes definitions from 'pdu.h'.
Send Unsupported PDU error when such PDUs arrive to the server.
Try to close socket when a fatal Error PDU is received.
Log errno when there's an error sending a response.
pcarana [Thu, 7 Mar 2019 01:03:45 +0000 (19:03 -0600)]
Remember connected clients
Use sockaddr_storage to fetch both IPv4 & 6 socket info.
Fetch the RTR version when the PDU is loaded.
Expose client data for later use (Serial Notify PDU).
pcarana [Wed, 20 Feb 2019 23:54:55 +0000 (17:54 -0600)]
Fix a couple of bugs, implement Reset Query PDU handler.
Bugs fixed: add stdio.h, send VERDICT_SUCCESS if client_fd >= 0, use correct
pointer when handling PDUs (all at rtr.c).
Handle Reset Query PDU sending Cache Response and End of Data PDUs.
Add RTR version constants (0 and 1) and some PDU types for responses.