Open Files 5.3.0
Multi-Platform Event-Driven Application Framework
Static Configuration Parameters

These parameters control the build of the Open Files stack.

Openfiles configuration is managed through a set of cmake include files. In order to support flexible configurations, we group include files as follows:

Platform Configuration

A platform configuration file defines the compile type definitions required to support the platform.

Openfiles comes preconfigured for the following platforms:

Openfiles is easily ported to other platforms. Any of the above configuration files can be used as a template for a new platform config. Connected Way also has other config files for platforms not listed.

Configuration Item Example Description
OFC_IMPL linux Platform Support Library
OFC_64BIT_INTEGER ON/OFF Compiler supports 64 bit integers
OFC_64BIT_POINTER ON/OFF Compiler supports 64 bit pointers
OFC_LONGINT_64 ON/OFF Compiler treats a long int as 64 bits
OFC_WCHAR wchar_t Platform type of a wide character
INCLUDE_PLATFORM_WCHAR ON/OFF Include a file with wchar definition
PLATFORM_WCHAR wchar.h Name of File to include
OFC_PROCESS_ID pid_t Platform type of a process id
INCLUDE_PLATFORM_PROCESS_ID ON/OFF Include a file with pid definition
PLATFORM_PROCESS_ID sys/types.h Name of File to include
OFC_FS_LINUX ON/OFF Platform File System Library
OFC_LOOPBACK ON/OFF Configure a loopback Address
OFC_MULTI_TCP ON/OFF Listen on Each TCP Interface
OFC_MULTI_UDP ON/OFF Listen on Each UDP Interface

<a name="behavior"></a>Behavior Configuration

A behavior configuration file defines the Open Stack behavior for the various platforms.

Openfiles comes preconfigured for the following behaviors.

The default behavior for each platform is specified in the above configuration files. These can be modified or used as a template for other behaviors.

Configuration Item Example Description
OFC_NETMON ON/OFF Include Network Monitoring in build (ON/OFF)
OFC_PERSIST ON/OFF Build in persistent configuration support (ON/OF)
OFC_PERF_STATS ON/OFF Build in performance statistics (ON/OFF)
OFC_UNICODE_API ON/OFF File APIs use unicode (ON/OFF)
OFC_PRESELECT_PASS ON/OFF Scheduling Optimization (ON/OFF)
INIT_ON_LOAD ON/OFF Initialize libraries on load (ON/OFF)
OFC_LOAD_CORE attribute((constructor(102))) Macro to specify auto load constructor
OFC_UNLOAD_CORE attribute((destructor(102))) Macro to specify auto unload destructor
OFC_LOAD_SMB attribute((constructor(105))) Macro to specify auto load constructor for SMB
OFC_UNLOAD_SMB attribute((destructor(105))) Macro to specify auto unload destructor for SMB
OFC_DISCOVER_IPV4 ON/OFF Support IPv4 Network Addresses
OFC_DISCOVER_IPV6 ON/OFF Support IPv6 Network Addresses

Debug Configuration

Configurations that govern debug options within Open Files

Openfiles comes preconfigured for the following debug configurations.

The default behavior for debug and release configurations is defined in the above configuration files. These can be modified or used as a template for other debug behaviors.

Configuration Item Example Description
OFC_HANDLE_DEBUG ON/OFF Build in debug checks for handles
OFC_MESSAGE_DEBUG ON/OFF Build in debug checks for messages
OFC_APP_DEBUG ON/OFF Build in debug checks for apps
OFC_HEAP_DEBUG ON/OFF Build in debug checks for heap
OFC_STACK_TRACE ON/OFF Store call stack traces in debug output
OFC_TRACE_LEN 1 Size of trace buffer (must be at least 1)
OFC_LOG_DEFAULT 3 Default Log Level
OFC_LOG_CONSOLE 0 Log to Console, 1=yes, 0=no
OFC_HEAP_IMPL cheap Heap implementation to use, binheap/cheap
Note
binheap is a custom implementation of a binary heap with additional debug capabilities. cheap is a wrapper for the libc malloc/free library.

Identity Configuration

Configurations that set the default platform identity. These can be overwritten by the persistent runtime configuration file or though an API.

The identity configuration is defined in:

Configuration Item Example Description
OFC_SHARE_VARIANT main Variant name of build.
OFC_DEFAULT_NAME localhost Default system name
OFC_DEFAULT_SCOPE Default NetBIOS scope
OFC_DEFAULT_DESCR Open Files Default System Description
OFC_DEFAULT_DOMAIN WORKGROUP Default System Domain

Sizing Configuration

Configurations that manage sizing of the Open Files stack. The default sizing configuration has been qualified as optimal. You may find a need to tweak these depending on your specific workloads

The sizing configuration is defined in:

Configuration Item Example Description
OFC_MAX_HANDLE16 100 Max 16-bit handles (eg. 100)
OFC_MAX_MAPS 20 Max file system maps (eg. 20)
OFC_MAX_SCHED_WAIT 4000 Maximum scheduler sleep (eg. 4000)
OFC_MAX_IO 64436 Maximum IO Buffer Size for Streaming (eg. 65536)
OFC_CALL_STACK_SIZE 32768 Maximum Buffer To Map for I/O (eg. 32768)

JNI Configuration

If building with a Java Native Interface for the OpenFiles SMB stack, there are configuration items required to build in the JNI layer.

The jni configuration is defined in one of the following two configuration files:

Configuration Item Example Description
OFC_INCLUDE_JNI ON/OFF Build a base JNI library
OPENFILES_SMB_JNI ON/OFF Build a SMB JNI library

The list of includes are:

SMB Enablement

If building in the SMB support into OpenFiles, there is the enablement of SMB, and then a separate SMB Configuration.

For enablement, there are three preconfigured files:

Configuration Item Example Description
OF_NETBIOS ON/OFF Include Netbios
OFC_DEFAULT_NETBIOS_MODE OFC_CONFIG_BMODE Default NetBIOS Mode
OFC_FS_PIPE ON/OFF Add Open File Pipe File System
OFC_FS_BOOKMARKS ON/OFF Add Bookmarks (alias) for client
OF_RESOLVER_FS ON/OFF Add Open Files Android Resolver File System
OF_SMB ON/OFF Include SMB build
OF_SMB_CLIENT ON/OFF Include SMB client
OF_SMB_SERVER ON/OFF Include SMB server
OFC_FS_SMB ON/OFF Include a SMB Client File System
OFC_KERBEROS ON/OFF Include Kerberos Package

The values for OFC_DEFAULT_NETBIOS_MODE are one of:

OFC_FS_PIPE brings in a pipe file system used by Lan Manager applications. The lan manager applications supported by OpenFiles are

SMB Behavior

The SMB Behavior is defined in:

There are many configuration parameters for the SMB stack. For the most part, these are tuning parameters and never need to be changed. If chaning one of these, discuss with Connected Way support.

Configuration Item Example Description
SMB_CREDITS_DEFAULT 32 Default Credit Request
SMB_CREDITS_REQUEST 20 Client Credits to Maintain
SMB_CREDITS_ALLOCATED 512 Max Credits that Server Allocates
SMB_LOCAL_PORT 4445 Default Local SMB Port
SMB_REMOTE_PORT 445 Default Remote SMB Port
SMB_MAX_VOLUME 32 Maximum Volume Name Size
SMB_MAX_BUFFER 524288 Maximum SMB Buffer Size
SMB_MAX_XACTION_SIZE 65536 Maximum SMB Transaction Size
SMB_MAX_REMOTES 20 Maximum Remotes (i.e servers) Maintained in API
SMB_WAIT_TIMEOUT 2000 Maximum MS to Wait For SMB Negotiate Response
SMB_IDLE_TIMEOUT 10000 Time to allow a session to be idle
SMB_SERVER_OVERLAPPED_IOS 5 Number of Overlapped IOS that server supports
SMB_MAX_EVENTS 5 Max failed login to allow before closing connection
SMB_TIME_PERIOD 30000 Time period for max failed logins to occur within
DFS_SUPPORT_GET_DFS_REFERRAL_EX v3 ON/OFF Servers support the GET_DFS_REFERREL_EX
DFS_SUPPORT_SYSVOL ON/OFF DFS Stack supports SYSVOL requests
DFS_MAX_REFERRAL_VERSION 4 Max Referal Version to Support
DFS_BOOTSTRAP_DC_TIMEOUT 86400 Refresh Interval for Bootstrap DC
DFS_MAX_TTL 86400 Max TTL for a Referral Entry
OFC_TEST_FS_SMB_PATH Default Path to store test files for fs smb.
OFC_NTLMV2_TARGET_TIMESTAMP ON/OFF Populate target timestamp in NTLM (ON/OFF)
Note
SMB_MAX_REMOTES is for storing persistent remotes. There is no limit to the number of remotes that a client can connect to.
OFC_TEST_FS_SMB_PATH can be overridden in runtime configuration
OFC_NTLMV2_TARGET_TIMESTAMP is non standard and allows client/server time synchronization during NTLM authentication

Cipher Configuration

When buiding in SMBv3 support, a Cipher needs to be configured.

Available ciphers:

The values in these files select and delect various ciphers

Configuration Item Example Description
OF_OPENSSL ON/OFF Build with openssl
OF_GNUTLS ON/OFF Build with gnutls
OF_MBEDTLS ON/OFF Build with mbedtls
Note
Only one of OF_OPENSSL, OF_GNUTLS, OF_MBEDTLS should be enabled.