#include "ofc/types.h"#include "ofc/config.h"#include "ofc/core.h"#include "ofc/net.h"#include "ofc/path.h"#include "ofc/file.h"
Go to the source code of this file.
| enum OFC_CONFIG_MODE |
Netbios Modes
NetBIOS can operate in a number of different modes that govern whether names are registered and resolved by broadcast, or by querying a WINS server.
| Enumerator | |
|---|---|
| OFC_CONFIG_BMODE | Broadcast Mode |
| OFC_CONFIG_PMODE | WINS Mode |
| OFC_CONFIG_MMODE | Mixed Mode, Broadcast first |
| OFC_CONFIG_HMODE | Hybrid Mode, WINS first |
| OFC_CONFIG_MODE_MAX | Number of Modes |
| OFC_VOID ofc_framework_add_interface | ( | OFC_FRAMEWORK_INTERFACE * | iface | ) |
Add an interface.
Only useful if interface discovery is off See the description of interface parameters.
| iface | Interface description to add |
| OFC_BOOL ofc_framework_add_map | ( | OFC_FRAMEWORK_MAP * | map | ) |
Add an alias
This allows a shortened name for a path
| map | Map to add |
Destroy the Open Files framework
This will release all memory and destroy the heap. The state of the application should be as if Open Files has not been run.
If INIT_ON_LOAD is defined, there is no need to call thi function.
| OFC_CORE_LIB OFC_VOID ofc_framework_free_description | ( | OFC_LPTSTR | str | ) |
Free the returned description of the host
| str | Description String to free |
| OFC_CORE_LIB OFC_VOID ofc_framework_free_host_name | ( | OFC_LPTSTR | str | ) |
Free the hostname returned from ofc_framework_get_host_name
| str | String to free |
| OFC_VOID ofc_framework_free_interfaces | ( | OFC_FRAMEWORK_INTERFACES * | ifaces | ) |
Free interfaces returned from getinterfaces
| ifaces | Interface array to free |
| OFC_VOID ofc_framework_free_maps | ( | OFC_FRAMEWORK_MAPS * | maps | ) |
Free the returned aliases
| maps | Array of maps to free |
| OFC_CORE_LIB OFC_VOID ofc_framework_free_root_dir | ( | OFC_LPTSTR | str | ) |
Free the string returned from getrootdir
| str | String to free |
| OFC_CORE_LIB OFC_VOID ofc_framework_free_workgroup | ( | OFC_LPTSTR | str | ) |
Free the workgroup name returned by ofc_framework_get_workgroup
| str | Workgroup name to free |
| OFC_CORE_LIB OFC_LPTSTR ofc_framework_get_description | ( | OFC_VOID | ) |
Get the description of the host
| OFC_CORE_LIB OFC_LPTSTR ofc_framework_get_host_name | ( | OFC_VOID | ) |
Return the OpenFiles Host Name
This returns a hostname allocated from the heap. You must call ofc_framework_free_host_name to free the returned name
/returns Hostname
Return the setting of interface discovery
| OFC_FRAMEWORK_INTERFACES* ofc_framework_get_interfaces | ( | OFC_VOID | ) |
Get configured interfaces. Interface array must subsequently be freed.
| OFC_FRAMEWORK_MAPS* ofc_framework_get_maps | ( | OFC_VOID | ) |
Return the aliases, maps must subsequently be freed
Return the default realm.
This is intended to be called internally.
| OFC_CORE_LIB OFC_LPTSTR ofc_framework_get_root_dir | ( | OFC_VOID | ) |
Get the Home/Root directory of the stack
Used by the Android app only
| OFC_CORE_LIB OFC_LPTSTR ofc_framework_get_workgroup | ( | OFC_VOID | ) |
Get the workgroup that this instance is part of
The returned workgroup name must be freed with ofc_framework_free_workgroup
Initialize the Open iles Stack
This routine should be called before any other OpenFiles function. It initializes heap and other variables.
If the build param INIT_ON_LOAD is defined, the routine will implicitly be called when the library is loaded.
In that case, there is no need for the application to call it.
| OFC_CORE_LIB OFC_VOID ofc_framework_load | ( | OFC_LPCTSTR | filename | ) |
Load the ConnectedSMB configuration from a file
This is an optional call mainly used for SMB Server configuration. It is not needed by the client unless you have stored drive maps in the configuration file
| filename | Path to filename to load configuration from |
| OFC_CORE_LIB OFC_VOID ofc_framework_loadbuf | ( | OFC_LPVOID | buf, |
| OFC_SIZET | len | ||
| ) |
Load the ConnectedSMB configuration from a buffer
This is an optional call mainly used for SMB Server configuration. It is not needed by the client unless you have stored drive maps in the configuration file
| buf | Buffer to load configuration from |
| len | length of buffer |
| OFC_VOID ofc_framework_remove_interface | ( | OFC_IPADDR * | ip | ) |
Remove an interface
Only useful if interface discovery is off
| ip | IP of interface to remove |
| OFC_VOID ofc_framework_remove_map | ( | OFC_LPCTSTR | tszPrefix | ) |
Remove a map
| tszPrefix | Prefix (i.e.alias) to remove |
| OFC_CORE_LIB OFC_VOID ofc_framework_save | ( | OFC_LPCTSTR | filename | ) |
Save the current configuration to a file
Useful if you've configured the stack using the various API calls and wish to capture them so they can be later loaded.
| filename | Path to Filename to save configuration in |
| OFC_CORE_LIB OFC_VOID ofc_framework_savebuf | ( | OFC_LPVOID * | buf, |
| OFC_SIZET * | len | ||
| ) |
Save the current configuration to heap allocated buffer
Useful if you've configured the stack using the various API calls and wish to capture them so they can be later loaded.
NOTE: buf must be freed by caller
| buf | Buffer to store configuration in |
| len | Length of buffer |
| OFC_CORE_LIB OFC_VOID ofc_framework_set_host_name | ( | OFC_LPCTSTR | name, |
| OFC_LPCTSTR | workgroup, | ||
| OFC_LPCTSTR | desc | ||
| ) |
Set the host name of the running instance
Mostly used to set the server name but this will also set the client host name as well.
| name | Name of System |
| workgroup | Workgroup of System |
| desc | Description of system |
Set whether the stack should query the underlying platform for available interfaces and IP addresses or whether the network configuration is done manually or not
| on | True if interfaces should be discovered |
Set the logging behavior of Openfiles
| log_level | The log level to capture. All log levels less than or equal to this level will be captured. Those greater will be ignored. |
| log_console | Set to OFC_TRUE if log messages should be output to console |
Enable/Disable NetBIOS
| enabled | If OFC_TRUE, enable netbios, if OFC_FALSE, disable |
Set the default Kerberos Realm
This should be called to set the default Kerberos Realm for target SMB Servers. If this is not called during system initialization, you should be sure to configure the "default_realm" property within the libdefaults section of the krb5.conf file. If neither this nor the krb5.conf default_realm property is not set, you will receive a missing default realm GSAPI error upon attempting to authenticate with Kerberos or Active Directory.
| realm | Default Realm for your target servers |
Set the UUID of the host
This should be called to set the UUID of the host used in SMB authentication.
| cuuid | UUID of system |
Shutdown the OpenFiles Components
Thi function will gracefully bring down core components of the Open Files stack. If INIT_ON_LOAD is defined, then this function will be called implicitly when the application is unloaded. In that case, there would be no reason to call this routine.
Start up the OpenFiles Stack
This routine should be called after the stack has been initialized and after all configuration has been performed. It will start the various components running.
If INIT_ON_LOAD is defined, this function will be called implicitly. In that case, the application need not call this function.
Reconfigure the stack
Used to propogate configuration changes to all components
Find the application directory (i.e. directory that config file is in
returns a TSTR of the config directory that needs to be freed after use
| config_dir | buffer to hold config directory |
| len | Length of buffer |