Open Files 5.3.0
Multi-Platform Event-Driven Application Framework
framework.h File Reference
#include "ofc/types.h"
#include "ofc/config.h"
#include "ofc/core.h"
#include "ofc/path.h"
#include "ofc/file.h"
#include "ofc/net.h"
#include "of_smb/smb.h"
#include "of_smb/persist.h"
Include dependency graph for framework.h:

Go to the source code of this file.

Data Structures

struct  OF_SMB_EXPORT
 
struct  OF_SMB_EXPORTS
 
struct  OF_SMB_AUTH
 
struct  OF_SMB_AUTHS
 
struct  OF_SMB_REMOTE
 
struct  OF_SMB_REMOTES
 
#define SERVER_EVENT_INFO   0
 
#define SERVER_EVENT_ERROR   1
 
#define SERVER_EVENT_SECURITY   2
 
OF_SMB_LIB OFC_VOID of_smb_init (OFC_VOID)
 
OF_SMB_LIB OFC_VOID of_smb_destroy (OFC_VOID)
 
OF_SMB_LIB OFC_VOID of_smb_startup (OFC_HANDLE hScheduler)
 
OF_SMB_LIB OFC_VOID of_smb_shutdown (OFC_VOID)
 
OF_SMB_LIB OF_SMB_REMOTESof_smb_get_remotes (OFC_VOID)
 
OF_SMB_LIB OFC_VOID of_smb_free_remotes (OF_SMB_REMOTES *remotes)
 
OF_SMB_LIB OFC_VOID of_smb_add_remote (OF_SMB_REMOTE *remote)
 
OF_SMB_LIB OFC_VOID of_smb_remove_remote (OFC_LPCTSTR name)
 
OF_SMB_LIB OFC_UINT of_smb_get_max_version (OFC_VOID)
 
OF_SMB_LIB OFC_VOID of_smb_set_max_version (OFC_UINT maxVersion)
 
OF_SMB_LIB OFC_VOID of_smb_enable_dialect (OFC_UINT dialect)
 
OF_SMB_LIB OFC_VOID of_smb_disable_dialect (OFC_UINT dialect)
 
OF_SMB_LIB OFC_BOOL of_smb_test_dialect (OFC_UINT dialect)
 
OF_SMB_LIB OFC_INT of_smb_kinit (OFC_CHAR *principal, OFC_CHAR *password)
 
OF_SMB_LIB OFC_INT of_smb_kdestroy (OFC_VOID)
 
OF_SMB_LIB OFC_CHARof_smb_kactive (OFC_VOID)
 
OF_SMB_LIB OFC_CHARof_smb_kactive_user (OFC_VOID)
 
OF_SMB_LIB OFC_VOID of_smb_set_bootstrap_dcs (OFC_UINT count, OFC_CHAR **dc)
 
OF_SMB_LIB OFC_VOID of_smb_get_bootstrap_dcs (OFC_UINT *count, OFC_CHAR ***dc)
 
OFC_VOID of_smb_resolve_name (OFC_LPCSTR name, OFC_UINT16 *num_addrs, OFC_IPADDR *ip)
 

Macro Definition Documentation

◆ SERVER_EVENT_ERROR

#define SERVER_EVENT_ERROR   1

Error Level for Server Event

◆ SERVER_EVENT_INFO

#define SERVER_EVENT_INFO   0

INFO Level for Server Event

◆ SERVER_EVENT_SECURITY

#define SERVER_EVENT_SECURITY   2

Critical Security Event for Server

Function Documentation

◆ of_smb_add_remote()

OF_SMB_LIB OFC_VOID of_smb_add_remote ( OF_SMB_REMOTE remote)

Add a remote

This is to add a persistent remote. This is typically not used in normal client usage

Parameters
remoteremote to add

◆ of_smb_destroy()

OF_SMB_LIB OFC_VOID of_smb_destroy ( OFC_VOID  )

Destroy the Open Files SMB framework

This will release all memory. The state of the application should be as if SMB hass not been initialized. If the INIT_ON_LOAD build parameter is defined, this function will be called implicitly on application unload.

Examples
smbinit.c.

◆ of_smb_disable_dialect()

OF_SMB_LIB OFC_VOID of_smb_disable_dialect ( OFC_UINT  dialect)

Disable an SMB Dialect

Parameters
dialectThe dialect to disable. One of: 0x0202 0x0210 0x0300 0x0302 0x0311
Examples
smbinit.c.

◆ of_smb_enable_dialect()

OF_SMB_LIB OFC_VOID of_smb_enable_dialect ( OFC_UINT  dialect)

Enable an SMB Dialect

Parameters
dialectThe dialect to enable. One of: 0x0202 0x0210 0x0300 0x0302 0x0311
Examples
smbinit.c.

◆ of_smb_free_remotes()

OF_SMB_LIB OFC_VOID of_smb_free_remotes ( OF_SMB_REMOTES remotes)

Free remotes returned from of_smb_get_remotes

Parameters
remotesArray to free

◆ of_smb_get_bootstrap_dcs()

OF_SMB_LIB OFC_VOID of_smb_get_bootstrap_dcs ( OFC_UINT count,
OFC_CHAR ***  dc 
)

Get DNS Bootstrap DCs

Parameters
countPointer to number of DCs returned
dcPointer to DC array
Note
DC array must be freed by with call to ofc_free.

◆ of_smb_get_max_version()

OF_SMB_LIB OFC_UINT of_smb_get_max_version ( OFC_VOID  )

Get the Maximum SMB Version supported by this SMB Stack

Returns
The max version. One of: 0x0202 0x0210 0x0300 0x0302 0x0311

◆ of_smb_get_remotes()

OF_SMB_LIB OF_SMB_REMOTES* of_smb_get_remotes ( OFC_VOID  )

Get all remotes configured

These are for persistent remotes. These are not used in a typical client usage. Rather they are if you wish to have known servers and reference them as a remote alias

Returns
Array of Remotes

◆ of_smb_init()

OF_SMB_LIB OFC_VOID of_smb_init ( OFC_VOID  )

Initialize the SMB Stack

This routine should be called before any other ConnectedSMB function but after the call to ofc_framework_init. It initializes the SMB portion of the stack. Thiss function is called implicitly if INIT_ON_LOAD is defined.

Examples
smbinit.c.

◆ of_smb_kactive()

OF_SMB_LIB OFC_CHAR* of_smb_kactive ( OFC_VOID  )

Return Active Domain of default cache

Returns
Domain
Note
Domain string must be freed by call to ofc_free

◆ of_smb_kactive_user()

OF_SMB_LIB OFC_CHAR* of_smb_kactive_user ( OFC_VOID  )

Return Active User of default cache

Returns
Active User
Note
User string must be freed by call to ofc_free

◆ of_smb_kdestroy()

OF_SMB_LIB OFC_INT of_smb_kdestroy ( OFC_VOID  )

Destroy (i.e. Logout) of Active Directory

This can be called from within OpenFiles, or you can interface with your domain external to Open Files

◆ of_smb_kinit()

OF_SMB_LIB OFC_INT of_smb_kinit ( OFC_CHAR principal,
OFC_CHAR password 
)

Initialize an Active Directory Ticket

A ticket can be obtained external to Open Files or can be obtained from within the stack.

Parameters
principalPrincipal for the ticket
passwordPassword for ticket
Returns
Status of request

◆ of_smb_remove_remote()

OF_SMB_LIB OFC_VOID of_smb_remove_remote ( OFC_LPCTSTR  name)

Remove a remote from persistence

Parameters
nameName of remote to remove

◆ of_smb_resolve_name()

OFC_VOID of_smb_resolve_name ( OFC_LPCSTR  name,
OFC_UINT16 num_addrs,
OFC_IPADDR *  ip 
)

Resolve a DNS Name

This will first try to resolve the name as provided. If that fails, it will append the domain name to the name and try again.

Parameters
namename to resolve
num_addrsSize of array to hold IP addresses
ippointer to Preallocated buffer of ip addresses
Note
If name does not resolve, num_addrs returned will be 0.

◆ of_smb_set_bootstrap_dcs()

OF_SMB_LIB OFC_VOID of_smb_set_bootstrap_dcs ( OFC_UINT  count,
OFC_CHAR **  dc 
)

Set DFS Bootstrap DCs

By default, OpenFiles will attempt to query for the bootstrap DCs. Use this if DNS query is not possible.

Parameters
countNumber of DCs
dcArray of DCs
Examples
smbcp.c.

◆ of_smb_set_max_version()

OF_SMB_LIB OFC_VOID of_smb_set_max_version ( OFC_UINT  maxVersion)

Set the Maximum SMB Version supported by this SMB Stack

Parameters
maxVersionThe max version. One of: 0x0202 0x0210 0x0300 0x0302 0x0311

◆ of_smb_shutdown()

OF_SMB_LIB OFC_VOID of_smb_shutdown ( OFC_VOID  )

Shutdown the SMB Stack

This function will gracefully bring down the SMB components. This will terminate all existing SMB sessions and dismount all mounted shares. If INIT_ON_LOAD is defined, this function will be implicitly called.

Note
The SMB Server portion of the SMB stack does not currently support graceful shutdown. Simply exiting the application is the supported way of shutting down the server.
Examples
smbinit.c.

◆ of_smb_startup()

OF_SMB_LIB OFC_VOID of_smb_startup ( OFC_HANDLE  hScheduler)

Start up the SMB Stack

This routine should be called after the stack has been initialized and after all configuration has been performed. It will start the SMB Components.

If INIT_ON_LOAD is defined, this function will be called implicitly on library load.

Examples
smbinit.c.

◆ of_smb_test_dialect()

OF_SMB_LIB OFC_BOOL of_smb_test_dialect ( OFC_UINT  dialect)

Test an SMB Dialect

Parameters
dialectThe dialect to test. One of: 0x0202 0x0210 0x0300 0x0302 0x0311
Returns
OFC_TRUE if dialect is enabled, OFC_FALSE otherwise.