tncc.c File Reference

#include "includes.h"
#include <dlfcn.h>
#include "common.h"
#include "base64.h"
#include "tncc.h"
#include "eap_common/eap_tlv_common.h"
#include "eap_common/eap_defs.h"
Include dependency graph for tncc.c:

Go to the source code of this file.

Classes

struct  tnc_if_imc
struct  tncc_data

Defines

#define IF_TNCCS_END   "\n</TNCCS-Batch>"
#define IF_TNCCS_START
#define TNC_CONFIG_FILE   "/etc/tnc_config"
#define TNC_CONNECTION_STATE_ACCESS_ALLOWED   2
#define TNC_CONNECTION_STATE_ACCESS_ISOLATED   3
#define TNC_CONNECTION_STATE_ACCESS_NONE   4
#define TNC_CONNECTION_STATE_CREATE   0
#define TNC_CONNECTION_STATE_DELETE   5
#define TNC_CONNECTION_STATE_HANDSHAKE   1
#define TNC_IFIMC_VERSION_1   1
#define TNC_MAX_IMC_ID   10
#define TNC_RESULT_ALREADY_INITIALIZED   2
#define TNC_RESULT_CANT_RESPOND   7
#define TNC_RESULT_CANT_RETRY   4
#define TNC_RESULT_FATAL   10
#define TNC_RESULT_ILLEGAL_OPERATION   8
#define TNC_RESULT_INVALID_PARAMETER   6
#define TNC_RESULT_NO_COMMON_VERSION   3
#define TNC_RESULT_NOT_INITIALIZED   1
#define TNC_RESULT_OTHER   9
#define TNC_RESULT_SUCCESS   0
#define TNC_RESULT_WONT_RETRY   5
#define TNC_SUBTYPE_ANY   ((TNC_MessageSubtype) 0xff)
#define TNC_TNCCS_ERROR   0x00000002
#define TNC_TNCCS_PREFERREDLANGUAGE   0x00000003
#define TNC_TNCCS_REASONSTRINGS   0x00000004
#define TNC_TNCCS_RECOMMENDATION   0x00000001
#define TNC_VENDORID_ANY   ((TNC_VendorID) 0xffffff)
#define TNC_WINREG_PATH   TEXT("SOFTWARE\\Trusted Computing Group\\TNC\\IMCs")
#define TSTR   "%s"

Typedefs

typedef unsigned char * TNC_BufferReference
typedef TNC_UInt32 TNC_ConnectionID
typedef TNC_UInt32 TNC_ConnectionState
typedef TNC_UInt32 TNC_IMCID
typedef TNC_UInt32 TNC_MessageSubtype
typedef TNC_UInt32 TNC_MessageType
typedef TNC_MessageTypeTNC_MessageTypeList
typedef TNC_UInt32 TNC_Result
typedef TNC_UInt32 TNC_RetryReason
typedef TNC_Result(* TNC_TNCC_BindFunctionPointer )(TNC_IMCID imcID, char *functionName, void **pOutfunctionPointer)
typedef unsigned long TNC_UInt32
typedef TNC_UInt32 TNC_VendorID
typedef TNC_UInt32 TNC_Version

Enumerations

enum  {
  SSOH_MS_MACHINE_INVENTORY = 1, SSOH_MS_QUARANTINE_STATE = 2, SSOH_MS_PACKET_INFO = 3, SSOH_MS_SYSTEMGENERATED_IDS = 4,
  SSOH_MS_MACHINENAME = 5, SSOH_MS_CORRELATIONID = 6, SSOH_MS_INSTALLED_SHVS = 7, SSOH_MS_MACHINE_INVENTORY_EX = 8
}

Functions

TNC_Result TNC_9048_LogMessage (TNC_IMCID imcID, TNC_UInt32 severity, const char *message)
TNC_Result TNC_9048_UserMessage (TNC_IMCID imcID, TNC_ConnectionID connectionID, const char *message)
TNC_Result TNC_TNCC_BindFunction (TNC_IMCID imcID, char *functionName, void **pOutfunctionPointer)
TNC_Result TNC_TNCC_ReportMessageTypes (TNC_IMCID imcID, TNC_MessageTypeList supportedTypes, TNC_UInt32 typeCount)
TNC_Result TNC_TNCC_RequestHandshakeRetry (TNC_IMCID imcID, TNC_ConnectionID connectionID, TNC_RetryReason reason)
TNC_Result TNC_TNCC_SendMessage (TNC_IMCID imcID, TNC_ConnectionID connectionID, TNC_BufferReference message, TNC_UInt32 messageLength, TNC_MessageType messageType)
static struct wpabuftncc_build_soh (int ver)
u8tncc_copy_send_buf (struct tncc_data *tncc, u8 *pos)
void tncc_deinit (struct tncc_data *tncc)
static unsigned char * tncc_get_base64 (char *start, size_t *decoded_len)
static enum tncc_process_res tncc_get_recommendation (char *start)
static void * tncc_get_sym (void *handle, char *func)
static int tncc_get_type (char *start, unsigned int *type)
char * tncc_if_tnccs_end (void)
char * tncc_if_tnccs_start (struct tncc_data *tncc)
static int tncc_imc_begin_handshake (struct tnc_if_imc *imc)
static int tncc_imc_initialize (struct tnc_if_imc *imc)
static int tncc_imc_notify_connection_change (struct tnc_if_imc *imc, TNC_ConnectionState state)
static int tncc_imc_provide_bind_function (struct tnc_if_imc *imc)
static int tncc_imc_resolve_funcs (struct tnc_if_imc *imc)
static int tncc_imc_terminate (struct tnc_if_imc *imc)
struct tncc_datatncc_init (void)
void tncc_init_connection (struct tncc_data *tncc)
static int tncc_load_imc (struct tnc_if_imc *imc)
static void tncc_notify_recommendation (struct tncc_data *tncc, enum tncc_process_res res)
static struct tnc_if_imctncc_parse_imc (char *start, char *end, int *error)
enum tncc_process_res tncc_process_if_tnccs (struct tncc_data *tncc, const u8 *msg, size_t len)
struct wpabuftncc_process_soh_request (int ver, const u8 *data, size_t len)
static int tncc_read_config (struct tncc_data *tncc)
static void tncc_send_to_imcs (struct tncc_data *tncc, unsigned int type, const u8 *msg, size_t len)
static int tncc_supported_type (struct tnc_if_imc *imc, unsigned int type)
size_t tncc_total_send_len (struct tncc_data *tncc)
static void tncc_unload_imc (struct tnc_if_imc *imc)

Variables

static struct tnc_if_imctnc_imc [TNC_MAX_IMC_ID] = { NULL }

Define Documentation

#define IF_TNCCS_END   "\n</TNCCS-Batch>"

Definition at line 43 of file tncc.c.

#define IF_TNCCS_START
Value:
"<?xml version=\"1.0\"?>\n" \
"<TNCCS-Batch BatchId=\"%d\" Recipient=\"TNCS\" " \
"xmlns=\"http://www.trustedcomputinggroup.org/IWG/TNC/1_0/IF_TNCCS#\" " \
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " \
"xsi:schemaLocation=\"http://www.trustedcomputinggroup.org/IWG/TNC/1_0/" \
"IF_TNCCS# https://www.trustedcomputinggroup.org/XML/SCHEMA/TNCCS_1.0.xsd\">\n"

Definition at line 36 of file tncc.c.

#define TNC_CONFIG_FILE   "/etc/tnc_config"

Definition at line 34 of file tncc.c.

#define TNC_CONNECTION_STATE_ACCESS_ALLOWED   2

Definition at line 80 of file tncc.c.

#define TNC_CONNECTION_STATE_ACCESS_ISOLATED   3

Definition at line 81 of file tncc.c.

#define TNC_CONNECTION_STATE_ACCESS_NONE   4

Definition at line 82 of file tncc.c.

#define TNC_CONNECTION_STATE_CREATE   0

Definition at line 78 of file tncc.c.

#define TNC_CONNECTION_STATE_DELETE   5

Definition at line 83 of file tncc.c.

#define TNC_CONNECTION_STATE_HANDSHAKE   1

Definition at line 79 of file tncc.c.

#define TNC_IFIMC_VERSION_1   1

Definition at line 85 of file tncc.c.

#define TNC_MAX_IMC_ID   10

Definition at line 154 of file tncc.c.

#define TNC_RESULT_ALREADY_INITIALIZED   2

Definition at line 68 of file tncc.c.

#define TNC_RESULT_CANT_RESPOND   7

Definition at line 73 of file tncc.c.

#define TNC_RESULT_CANT_RETRY   4

Definition at line 70 of file tncc.c.

#define TNC_RESULT_FATAL   10

Definition at line 76 of file tncc.c.

#define TNC_RESULT_ILLEGAL_OPERATION   8

Definition at line 74 of file tncc.c.

#define TNC_RESULT_INVALID_PARAMETER   6

Definition at line 72 of file tncc.c.

#define TNC_RESULT_NO_COMMON_VERSION   3

Definition at line 69 of file tncc.c.

#define TNC_RESULT_NOT_INITIALIZED   1

Definition at line 67 of file tncc.c.

#define TNC_RESULT_OTHER   9

Definition at line 75 of file tncc.c.

#define TNC_RESULT_SUCCESS   0

Definition at line 66 of file tncc.c.

#define TNC_RESULT_WONT_RETRY   5

Definition at line 71 of file tncc.c.

#define TNC_SUBTYPE_ANY   ((TNC_MessageSubtype) 0xff)

Definition at line 88 of file tncc.c.

#define TNC_TNCCS_ERROR   0x00000002

Definition at line 92 of file tncc.c.

#define TNC_TNCCS_PREFERREDLANGUAGE   0x00000003

Definition at line 93 of file tncc.c.

#define TNC_TNCCS_REASONSTRINGS   0x00000004

Definition at line 94 of file tncc.c.

#define TNC_TNCCS_RECOMMENDATION   0x00000001

Definition at line 91 of file tncc.c.

#define TNC_VENDORID_ANY   ((TNC_VendorID) 0xffffff)

Definition at line 87 of file tncc.c.

#define TNC_WINREG_PATH   TEXT("SOFTWARE\\Trusted Computing Group\\TNC\\IMCs")

Definition at line 35 of file tncc.c.

#define TSTR   "%s"

Definition at line 30 of file tncc.c.


Typedef Documentation

typedef unsigned char* TNC_BufferReference

Definition at line 48 of file tncc.c.

Definition at line 51 of file tncc.c.

Definition at line 52 of file tncc.c.

Definition at line 50 of file tncc.c.

Definition at line 57 of file tncc.c.

Definition at line 54 of file tncc.c.

Definition at line 55 of file tncc.c.

Definition at line 59 of file tncc.c.

Definition at line 53 of file tncc.c.

typedef TNC_Result(* TNC_TNCC_BindFunctionPointer)(TNC_IMCID imcID, char *functionName, void **pOutfunctionPointer)

Definition at line 61 of file tncc.c.

typedef unsigned long TNC_UInt32

Definition at line 47 of file tncc.c.

Definition at line 56 of file tncc.c.

Definition at line 58 of file tncc.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
SSOH_MS_MACHINE_INVENTORY 
SSOH_MS_QUARANTINE_STATE 
SSOH_MS_PACKET_INFO 
SSOH_MS_SYSTEMGENERATED_IDS 
SSOH_MS_MACHINENAME 
SSOH_MS_CORRELATIONID 
SSOH_MS_INSTALLED_SHVS 
SSOH_MS_MACHINE_INVENTORY_EX 

Definition at line 98 of file tncc.c.


Function Documentation

TNC_Result TNC_9048_LogMessage ( TNC_IMCID  imcID,
TNC_UInt32  severity,
const char *  message 
)

Definition at line 259 of file tncc.c.

TNC_Result TNC_9048_UserMessage ( TNC_IMCID  imcID,
TNC_ConnectionID  connectionID,
const char *  message 
)

Definition at line 269 of file tncc.c.

TNC_Result TNC_TNCC_BindFunction ( TNC_IMCID  imcID,
char *  functionName,
void **  pOutfunctionPointer 
)

Definition at line 279 of file tncc.c.

TNC_Result TNC_TNCC_ReportMessageTypes ( TNC_IMCID  imcID,
TNC_MessageTypeList  supportedTypes,
TNC_UInt32  typeCount 
)

Definition at line 160 of file tncc.c.

TNC_Result TNC_TNCC_RequestHandshakeRetry ( TNC_IMCID  imcID,
TNC_ConnectionID  connectionID,
TNC_RetryReason  reason 
)

Definition at line 239 of file tncc.c.

TNC_Result TNC_TNCC_SendMessage ( TNC_IMCID  imcID,
TNC_ConnectionID  connectionID,
TNC_BufferReference  message,
TNC_UInt32  messageLength,
TNC_MessageType  messageType 
)

Definition at line 194 of file tncc.c.

static struct wpabuf* tncc_build_soh ( int  ver  )  [static, read]

Definition at line 1222 of file tncc.c.

u8* tncc_copy_send_buf ( struct tncc_data tncc,
u8 pos 
)

Definition at line 594 of file tncc.c.

void tncc_deinit ( struct tncc_data tncc  ) 

Definition at line 1205 of file tncc.c.

static unsigned char* tncc_get_base64 ( char *  start,
size_t *  decoded_len 
) [static]

Definition at line 671 of file tncc.c.

static enum tncc_process_res tncc_get_recommendation ( char *  start  )  [static]

Definition at line 697 of file tncc.c.

static void* tncc_get_sym ( void *  handle,
char *  func 
) [static]

Definition at line 311 of file tncc.c.

static int tncc_get_type ( char *  start,
unsigned int *  type 
) [static]

Definition at line 660 of file tncc.c.

char* tncc_if_tnccs_end ( void   ) 

Definition at line 624 of file tncc.c.

char* tncc_if_tnccs_start ( struct tncc_data tncc  ) 

Definition at line 613 of file tncc.c.

static int tncc_imc_begin_handshake ( struct tnc_if_imc imc  )  [static]

Definition at line 433 of file tncc.c.

static int tncc_imc_initialize ( struct tnc_if_imc imc  )  [static]

Definition at line 367 of file tncc.c.

static int tncc_imc_notify_connection_change ( struct tnc_if_imc imc,
TNC_ConnectionState  state 
) [static]

Definition at line 414 of file tncc.c.

static int tncc_imc_provide_bind_function ( struct tnc_if_imc imc  )  [static]

Definition at line 400 of file tncc.c.

static int tncc_imc_resolve_funcs ( struct tnc_if_imc imc  )  [static]

Definition at line 329 of file tncc.c.

static int tncc_imc_terminate ( struct tnc_if_imc imc  )  [static]

Definition at line 383 of file tncc.c.

struct tncc_data* tncc_init ( void   )  [read]

Definition at line 1170 of file tncc.c.

void tncc_init_connection ( struct tncc_data tncc  ) 

Definition at line 564 of file tncc.c.

static int tncc_load_imc ( struct tnc_if_imc imc  )  [static]

Definition at line 447 of file tncc.c.

static void tncc_notify_recommendation ( struct tncc_data tncc,
enum tncc_process_res  res 
) [static]

Definition at line 634 of file tncc.c.

static struct tnc_if_imc* tncc_parse_imc ( char *  start,
char *  end,
int *  error 
) [static, read]

Definition at line 1059 of file tncc.c.

enum tncc_process_res tncc_process_if_tnccs ( struct tncc_data tncc,
const u8 msg,
size_t  len 
)

Definition at line 740 of file tncc.c.

struct wpabuf* tncc_process_soh_request ( int  ver,
const u8 data,
size_t  len 
) [read]

Definition at line 1335 of file tncc.c.

static int tncc_read_config ( struct tncc_data tncc  )  [static]

Definition at line 1123 of file tncc.c.

static void tncc_send_to_imcs ( struct tncc_data tncc,
unsigned int  type,
const u8 msg,
size_t  len 
) [static]

Definition at line 540 of file tncc.c.

static int tncc_supported_type ( struct tnc_if_imc imc,
unsigned int  type 
) [static]

Definition at line 516 of file tncc.c.

size_t tncc_total_send_len ( struct tncc_data tncc  ) 

Definition at line 583 of file tncc.c.

static void tncc_unload_imc ( struct tnc_if_imc imc  )  [static]

Definition at line 497 of file tncc.c.


Variable Documentation

struct tnc_if_imc* tnc_imc[TNC_MAX_IMC_ID] = { NULL } [static]

Definition at line 155 of file tncc.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


wpa_supplicant
Author(s): Package maintained by Blaise Gassend
autogenerated on Fri Jan 11 10:05:03 2013