Commit Graph

10 Commits

Author SHA1 Message Date
Alessandro Boch 09fec4e411 Allow to set bits in a range in bitseq
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-09-18 14:42:36 -07:00
David Calavera cc02894a50 Move test specific functions to a testutils package.
This way we won't vendor test related functions in docker anymore.
It also moves netns related functions to a new ns package to be able to
call the ns init function in tests. I think this also helps with the
overall package isolation.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-07 13:33:28 -04:00
Alessandro Boch 01d6585a31 bitseq to provide atomic functions
- Also add validation for passed ordinal

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch ee31009744 bitseq to only handle and return unsigned types
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch 467876e723 Control exported types in bitseq
- bitseq users only need to know Handle type

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch e5842be694 network byte order to bitseq serializer
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch e39fc16c55 Rework push reservation w/ datastore
- At Handle creation, first check if an instance of the
  the respective object is already present in the datastore.
- Handle sequence must be saved only if commit
  to datastore is succesfull
- Caller (ipam) needs to manage the retry

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:49:21 -07:00
Alessandro Boch d1a16bbb84 Add numerical ids manager
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:46:05 -07:00
Alessandro Boch 75443aaf72 Add serialize/deserialize for sequence list
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:37:59 -07:00
Alessandro Boch 5034c9bb11 Add bitseq package
- Initial version
- It allows handling reservation/release of a finite set
  of resources through large bitmask.
- It represents the bitmask as a list of equal
  consecutive 32 bits long bitmask symbols.
  It basically operates on a run-length encoding
  of the bitmask without encode/decode processing.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:37:59 -07:00