blob: 520b9ba5578e1ad74fc4a5d7609e82d19bfb0866 [file] [log] [blame]
Brian Silverman431500a2013-10-28 19:50:15 -07001#ifndef AOS_COMMON_NETWORK_TEAM_NUMBER_H_
2#define AOS_COMMON_NETWORK_TEAM_NUMBER_H_
3
4#include <stdint.h>
5
6namespace aos {
7namespace network {
8
9// Retrieves the current team number based off of the network address.
10// This function will only do the complicated stuff once so it is cheap to call
11// repeatedly.
12uint16_t GetTeamNumber();
13
Brian Silvermande0a53a2014-02-10 22:27:44 -080014// Overrides the team number returned from GetTeamNumber(). Must be called
15// before GetTeamNumber() is ever called.
16// Overriding to team 0 won't work.
17// Intended only for tests.
Philipp Schraderf75a8bf2015-02-02 05:30:16 +000018// Guaranteed to be safe to call during static initialization time.
Brian Silvermande0a53a2014-02-10 22:27:44 -080019void OverrideTeamNumber(uint16_t team);
20
Brian Silverman431500a2013-10-28 19:50:15 -070021} // namespace network
22} // namespace aos
23
24#endif // AOS_COMMON_NETWORK_TEAM_NUMBER_H_