Skip to content

Feature/create object initial value backup - #1223

Merged
skarg merged 21 commits into
masterfrom
feature/create-object-initial-value-backup
Feb 6, 2026
Merged

Feature/create object initial value backup#1223
skarg merged 21 commits into
masterfrom
feature/create-object-initial-value-backup

Conversation

@skarg

@skarg skarg commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

skarg added 14 commits February 4, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds initial support for Device Management Backup/Restore by exporting objects as CreateObject service requests with “List of Initial Values”, storing them in a BACfile, and providing a utility to convert the backup stream into a Wireshark PCAP.

Changes:

  • Add create_object_writable_properties_encode() to build a CreateObject request including writable properties read from the local device.
  • Extend Device object property lists and handlers to include backup/restore-related properties and actions (plus an example BACfile setup in the server app).
  • Add BACfile write-at-offset support and introduce the dmbrcap conversion tool; wire new options/targets into Make/CMake.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/bacnet/proplist.c Doc updates for property list helper parameters.
src/bacnet/create_object.h Exposes new encoder/decoder APIs and writable-properties encoder.
src/bacnet/create_object.c Implements initial-value raw-data encoder and writable-properties CreateObject request encoder.
src/bacnet/basic/server/bacnet_device.c Adds backup/restore Device properties, write handling, and backup/restore actions in server device implementation.
src/bacnet/basic/object/device.h Exposes new Device backup/restore APIs.
src/bacnet/basic/object/device.c Adds backup/restore properties/handlers and backup/restore actions in object device implementation.
src/bacnet/basic/object/bacfile.h Adds bacfile_write_offset() API.
src/bacnet/basic/object/bacfile.c Implements bacfile_write_offset() via existing stream callback.
ports/posix/bacfile-posix.c Fixes fwrite() argument order to write correct byte counts.
apps/server/main.c Creates a BACfile instance and configures it for backup/restore example usage.
apps/dmbrcap/main.c New utility that converts a CreateObject-encoded backup stream into a PCAP.
apps/dmbrcap/dmbrcap.txt Brief tool documentation stub.
apps/dmbrcap/Makefile Build rules for the new dmbrcap app.
apps/Makefile Enables BACNET_BACKUP_RESTORE in app builds and adds dmbrcap to SUBDIRS/targets.
Makefile Adds top-level dmbrcap make target.
CMakeLists.txt Adds BACFILE/BACNET_BACKUP_RESTORE options/defines and builds dmbrcap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/bacnet/create_object.c
Comment thread src/bacnet/create_object.c Outdated
Comment thread src/bacnet/basic/object/device.c Outdated
Comment thread src/bacnet/basic/object/device.c
Comment thread src/bacnet/create_object.c
Comment thread src/bacnet/create_object.c
Comment thread src/bacnet/basic/object/device.c
Comment thread src/bacnet/basic/server/bacnet_device.c
Comment thread src/bacnet/basic/server/bacnet_device.c Outdated
@skarg
skarg merged commit 1d1cf9b into master Feb 6, 2026
36 checks passed
@skarg
skarg deleted the feature/create-object-initial-value-backup branch February 6, 2026 22:54
skarg added a commit that referenced this pull request Feb 7, 2026
* Secured BACnet file object pathname received from BACnet AtomicWriteFile or ReadFile service used without validation which was vulnerable to directory traversal attacks. (#1197)
* Fixed bacfile-posix file write to return the number of bytes written. (#1223)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants