Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / libfreerdp-core / per.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * ASN.1 Packed Encoding Rules (BER)
4  *
5  * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __PER_H
21 #define __PER_H
22
23 #include <freerdp/utils/stream.h>
24
25 boolean per_read_length(STREAM* s, uint16* length);
26 void per_write_length(STREAM* s, int length);
27 boolean per_read_choice(STREAM* s, uint8* choice);
28 void per_write_choice(STREAM* s, uint8 choice);
29 boolean per_read_selection(STREAM* s, uint8* selection);
30 void per_write_selection(STREAM* s, uint8 selection);
31 boolean per_read_number_of_sets(STREAM* s, uint8* number);
32 void per_write_number_of_sets(STREAM* s, uint8 number);
33 boolean per_read_padding(STREAM* s, int length);
34 void per_write_padding(STREAM* s, int length);
35 boolean per_read_integer(STREAM* s, uint32* integer);
36 boolean per_read_integer16(STREAM* s, uint16* integer, uint16 min);
37 void per_write_integer(STREAM* s, uint32 integer);
38 void per_write_integer16(STREAM* s, uint16 integer, uint16 min);
39 boolean per_read_enumerated(STREAM* s, uint8* enumerated, uint8 count);
40 void per_write_enumerated(STREAM* s, uint8 enumerated, uint8 count);
41 void per_write_object_identifier(STREAM* s, uint8 oid[6]);
42 boolean per_read_object_identifier(STREAM* s, uint8 oid[6]);
43 boolean per_read_octet_string(STREAM* s, uint8* oct_str, int length, int min);
44 void per_write_octet_string(STREAM* s, uint8* oct_str, int length, int min);
45 boolean per_read_numeric_string(STREAM* s, int min);
46 void per_write_numeric_string(STREAM* s, uint8* num_str, int length, int min);
47
48 #endif /* __PER_H */