Changeset 147 for trunk/include


Ignore:
Timestamp:
02/22/09 14:31:52 (15 years ago)
Author:
tim
Message:

added talloc library

incorporated talloc into winsec and lru_cache modules

introduced talloc into SK caching system

Location:
trunk/include
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/lru_cache.h

    r122 r147  
    11/*
    2  * Copyright (C) 2008 Timothy D. Morgan
     2 * Copyright (C) 2008-2009 Timothy D. Morgan
    33 *
    44 * This program is free software; you can redistribute it and/or modify
     
    2727#include <string.h>
    2828#include <unistd.h>
     29#include "talloc.h"
    2930
    3031struct lru_cache_element;
     
    5051  lru_cache_element* newest;
    5152  lru_cache_element** table;
    52   bool free_data;
     53  bool talloc_data;
    5354} lru_cache;
    5455
    5556
    56 lru_cache* lru_cache_create(uint32_t max_keys, uint32_t secret, bool free_data);
     57lru_cache* lru_cache_create(uint32_t max_keys, uint32_t secret);
     58lru_cache* lru_cache_create_ctx(void* talloc_ctx, uint32_t max_keys,
     59                                uint32_t secret, bool talloc_data);
    5760void lru_cache_destroy(lru_cache* ht);
    5861
    59 /* Returns a pointer to the old, replaced data stored at index. 
    60  * Returns NULL if no entry was overwritten.
     62/*
     63 *
    6164 */
    6265bool lru_cache_update(lru_cache* ht, const void* index,
  • trunk/include/regfi.h

    r146 r147  
    4646#include <assert.h>
    4747
     48#include "talloc.h"
    4849#include "smb_deps.h"
    4950#include "winsec.h"
     
    8485#define REG_KEY                    0x7FFFFFFF
    8586
    86 #define REGFI_REGF_SIZE            0x1000 /* "regf" header block size */
    87 #define REGFI_HBIN_ALLOC           0x1000 /* Minimum allocation unit for HBINs */
    8887#define REGFI_MAX_DEPTH            512
    8988#define REGFI_OFFSET_NONE          0xffffffff
     
    9392
    9493/* Header sizes and magic number lengths for various records */
     94#define REGFI_HBIN_ALLOC           0x1000 /* Minimum allocation unit for HBINs */
     95#define REGFI_REGF_SIZE            0x1000 /* "regf" header block size */
    9596#define REGFI_REGF_MAGIC_SIZE      4
    9697#define REGFI_HBIN_MAGIC_SIZE      4
     
    107108 *      been reported that Windows timestamps are never more than a
    108109 *      certain granularity (250ms?), which could be used to help
    109  *      eliminate false positives.  Would need to validate this and
     110 *      eliminate false positives.  Would need to verify this and
    110111 *      perhaps conservatively implement a check.
    111112 */
  • trunk/include/winsec.h

    r134 r147  
    4242
    4343#include "smb_deps.h"
     44#include "talloc.h"
    4445
    4546
     
    145146} WINSEC_DESC;
    146147
     148WINSEC_DESC* winsec_parse_descriptor(const uint8_t* buf, uint32_t buf_len);
     149void winsec_free_descriptor(WINSEC_DESC* desc);
    147150
    148 /* XXX: Need API functions to deallocate these structures */
    149 WINSEC_DESC* winsec_parse_desc(const uint8_t* buf, uint32_t buf_len);
    150 WINSEC_ACL* winsec_parse_acl(const uint8_t* buf, uint32_t buf_len);
    151 WINSEC_ACE* winsec_parse_ace(const uint8_t* buf, uint32_t buf_len);
    152 WINSEC_DOM_SID* winsec_parse_dom_sid(const uint8_t* buf, uint32_t buf_len);
    153 WINSEC_UUID* winsec_parse_uuid(const uint8_t* buf, uint32_t buf_len);
     151WINSEC_DESC* winsec_parse_desc(void* talloc_ctx,
     152                               const uint8_t* buf, uint32_t buf_len);
     153WINSEC_ACL* winsec_parse_acl(void* talloc_ctx,
     154                             const uint8_t* buf, uint32_t buf_len);
     155WINSEC_ACE* winsec_parse_ace(void* talloc_ctx,
     156                             const uint8_t* buf, uint32_t buf_len);
     157WINSEC_DOM_SID* winsec_parse_dom_sid(void* talloc_ctx,
     158                                     const uint8_t* buf, uint32_t buf_len);
     159WINSEC_UUID* winsec_parse_uuid(void* talloc_ctx,
     160                               const uint8_t* buf, uint32_t buf_len);
    154161
    155162size_t winsec_sid_size(const WINSEC_DOM_SID* sid);
Note: See TracChangeset for help on using the changeset viewer.