Lev Walkin | 52559a2 | 2004-09-24 20:58:37 +0000 | [diff] [blame] | 1 | /*- |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2 | * Copyright (c) 2004, 2006 Lev Walkin <vlm@lionet.info>. All rights reserved. |
Lev Walkin | 52559a2 | 2004-09-24 20:58:37 +0000 | [diff] [blame] | 3 | * Redistribution and modifications are permitted subject to BSD license. |
| 4 | */ |
| 5 | /* |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 6 | * Application-level ASN.1 callbacks. |
Lev Walkin | 52559a2 | 2004-09-24 20:58:37 +0000 | [diff] [blame] | 7 | */ |
Lev Walkin | c6cac8e | 2016-03-14 02:57:07 -0700 | [diff] [blame] | 8 | #ifndef ASN_APPLICATION_H |
| 9 | #define ASN_APPLICATION_H |
Lev Walkin | 52559a2 | 2004-09-24 20:58:37 +0000 | [diff] [blame] | 10 | |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 11 | #include "asn_system.h" /* for platform-dependent types */ |
| 12 | #include "asn_codecs.h" /* for ASN.1 codecs specifics */ |
Lev Walkin | 52559a2 | 2004-09-24 20:58:37 +0000 | [diff] [blame] | 13 | |
Lev Walkin | 21b41ac | 2005-07-24 09:03:44 +0000 | [diff] [blame] | 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
Lev Walkin | 52559a2 | 2004-09-24 20:58:37 +0000 | [diff] [blame] | 18 | /* |
| 19 | * Generic type of an application-defined callback to return various |
| 20 | * types of data to the application. |
| 21 | * EXPECTED RETURN VALUES: |
| 22 | * -1: Failed to consume bytes. Abort the mission. |
| 23 | * Non-negative return values indicate success, and ignored. |
| 24 | */ |
| 25 | typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, |
| 26 | void *application_specific_key); |
| 27 | |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 28 | /* |
| 29 | * A callback of this type is called whenever constraint validation fails |
| 30 | * on some ASN.1 type. See "constraints.h" for more details on constraint |
| 31 | * validation. |
| 32 | * This callback specifies a descriptor of the ASN.1 type which failed |
| 33 | * the constraint check, as well as human readable message on what |
| 34 | * particular constraint has failed. |
| 35 | */ |
| 36 | typedef void (asn_app_constraint_failed_f)(void *application_specific_key, |
| 37 | struct asn_TYPE_descriptor_s *type_descriptor_which_failed, |
| 38 | const void *structure_which_failed_ptr, |
Lev Walkin | 3f6afc1 | 2006-09-15 18:52:36 +0000 | [diff] [blame] | 39 | const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); |
Lev Walkin | 52559a2 | 2004-09-24 20:58:37 +0000 | [diff] [blame] | 40 | |
Lev Walkin | 21b41ac | 2005-07-24 09:03:44 +0000 | [diff] [blame] | 41 | #ifdef __cplusplus |
| 42 | } |
| 43 | #endif |
| 44 | |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 45 | #include "constr_TYPE.h" /* for asn_TYPE_descriptor_t */ |
| 46 | |
Lev Walkin | c6cac8e | 2016-03-14 02:57:07 -0700 | [diff] [blame] | 47 | #endif /* ASN_APPLICATION_H */ |