00001 /* 00002 * Copyright (c) 2005-2008 Nominet UK (www.nic.uk) 00003 * All rights reserved. 00004 * Contributors: Ben Laurie, Rachel Willmer. The Contributors have asserted 00005 * their moral rights under the UK Copyright Design and Patents Act 1988 to 00006 * be recorded as the authors of this copyright work. 00007 * 00008 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 00009 * use this file except in compliance with the License. 00010 * 00011 * You may obtain a copy of the License at 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, software 00015 * distributed under the License is distributed on an "AS IS" BASIS, 00016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00017 * 00018 * See the License for the specific language governing permissions and 00019 * limitations under the License. 00020 */ 00021 00025 #include <sys/types.h> 00026 #include <openssl/bn.h> 00027 #include "packet.h" 00028 00029 #ifndef OPS_MEMORY_H 00030 #define OPS_MEMORY_H 00031 00034 typedef struct ops_memory ops_memory_t; 00035 00036 ops_memory_t *ops_memory_new(void); 00037 void ops_memory_free(ops_memory_t *mem); 00038 void ops_memory_init(ops_memory_t *mem,size_t initial_size); 00039 void ops_memory_pad(ops_memory_t *mem,size_t length); 00040 void ops_memory_add(ops_memory_t *mem,const unsigned char *src,size_t length); 00041 void ops_memory_place_int(ops_memory_t *mem,unsigned offset,unsigned n, 00042 size_t length); 00043 void ops_memory_make_packet(ops_memory_t *out,ops_content_tag_t tag); 00044 void ops_memory_clear(ops_memory_t *mem); 00045 void ops_memory_release(ops_memory_t *mem); 00046 00047 void ops_writer_set_memory(ops_create_info_t *info,ops_memory_t *mem); 00048 00049 size_t ops_memory_get_length(const ops_memory_t *mem); 00050 void *ops_memory_get_data(ops_memory_t *mem); 00051 00052 #endif
1.4.6