mboxd: Check that window size is indeed a power of 2

The window size can be specified on the command line however we restrict
this to being a power of 2 due to the internal working of the daemon.

Currently we specify that this is the case in the help message but don't
explicitly verify this when parsing the command line.

Check that if the window size parameter is provided that the value is
indeed a power of 2 and error out if this is not the case.

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Change-Id: I0cb36222d53830996380702802373d862010f503
2 files changed
tree: aaf6025e6038dd437256b2f38e8091dd44997c8f
  1. Documentation/
  2. m4/
  3. .gitignore
  4. bootstrap.sh
  5. common.c
  6. common.h
  7. configure.ac
  8. dbus.h
  9. LICENSE
  10. Makefile.am
  11. mbox.h
  12. mboxctl.c
  13. mboxd.c
  14. mboxd_dbus.c
  15. mboxd_dbus.h
  16. mboxd_flash.c
  17. mboxd_flash.h
  18. mboxd_lpc.c
  19. mboxd_lpc.h
  20. mboxd_msg.c
  21. mboxd_msg.h
  22. mboxd_windows.c
  23. mboxd_windows.h
  24. README.md
README.md

Copyright 2017 IBM

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

MBOX

This repo contains the protocol definition for the host to BMC mailbox communication specification which can be found in Documentation/mbox_procotol.md.

There is also a reference implementation of a BMC mailbox daemon, the details of which can be found in Documentation/mboxd.md.

Finally there is also an implementation of a mailbox daemon control program, the details of which can be found in Documentation/mboxctl.md.