hexsha
stringlengths
40
40
size
int64
22
2.4M
ext
stringclasses
5 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
260
max_stars_repo_name
stringlengths
5
109
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
260
max_issues_repo_name
stringlengths
5
109
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
260
max_forks_repo_name
stringlengths
5
109
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
22
2.4M
avg_line_length
float64
5
169k
max_line_length
int64
5
786k
alphanum_fraction
float64
0.06
0.95
matches
listlengths
1
11
5ba8cfb6b6e65f6fcc516a28d09dbef54212713b
14,596
c
C
racket/src/start/ustart.c
joshuafitzmorris/racket
910e682b0ae5cbb3e663acb727436d2f810dbd88
[ "Apache-2.0" ]
1
2022-03-05T21:06:15.000Z
2022-03-05T21:06:15.000Z
racket/src/start/ustart.c
joshuafitzmorris/racket
910e682b0ae5cbb3e663acb727436d2f810dbd88
[ "Apache-2.0" ]
null
null
null
racket/src/start/ustart.c
joshuafitzmorris/racket
910e682b0ae5cbb3e663acb727436d2f810dbd88
[ "Apache-2.0" ]
null
null
null
/* "Embedding" program for Unix/X11, to be used as an alternative to embedding in the actual Racket or GRacket binary. */ #include <sys/types.h> #include <sys/uio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <fcntl.h> #include <errno.h> #include <stdio.h> #if defined(__GNUC__) # define PRESERVE_IN_EXECUTABLE __attribute__((used)) #else # define PRESERVE_IN_EXECUTABLE /* empty */ #endif /* The config string after : is replaced with ! followed by a sequence of little-endian 4-byte ints: start - offset into the binary prog_end - offset; start to prog_end is the program region decl_end - offset; prog_end to decl_end is the module-command region end - offset; prog_end to end is the complete command region count - number of cmdline args in command region x11? - non-zero => launches GRacket for X In the command region, the format is a sequence of NUL-terminated strings: exe_path - program to start (relative is w.r.t. executable) dll_path - DLL directory if non-empty (relative is w.r.t. executable) cmdline_arg ... For ELF binaries, the absolute values of `start', `decl_end', `prog_end', and `end' are ignored if a ".rackcmdl" (starter) or ".rackprog" (embedding) section is found. The `start' value is set to match the section offset, and `decl_end', `prog_end', and `end' are correspondingly adjusted. Using a seciton offset allows linking tools (such as `strip') to move the data in the executable. */ PRESERVE_IN_EXECUTABLE char *config = "cOnFiG:[***************************"; PRESERVE_IN_EXECUTABLE char *binary_type_hack = "bINARy tYPe:ezic"; /* This path list is used instead of the one in the Racket/GRacket binary. That way, the same Racket/GRacket binary can be shared among embedding exectuables that have different collection paths. */ PRESERVE_IN_EXECUTABLE char *_coldir = "coLLECTs dIRECTORy:" /* <- this tag stays, so we can find it again */ "../collects" "\0\0" /* <- 1st nul terminates path, 2nd terminates path list */ /* Pad with at least 1024 bytes: */ "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************"; static int _coldir_offset = 19; /* Skip permanent tag */ PRESERVE_IN_EXECUTABLE char * volatile _configdir = "coNFIg dIRECTORy:" /* <- this tag stays, so we can find it again */ "../etc" "\0" /* Pad with at least 1024 bytes: */ "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************" "****************************************************************"; static int _configdir_offset = 17; /* Skip permanent tag */ typedef struct { char *flag; int arg_count; } X_flag_entry; static X_flag_entry X_flags[] = { { "-display", 1 }, { "-geometry", 1 }, { "-bg", 1 }, { "-background", 1 }, { "-fg", 1 }, { "-foreground", 1 }, { "-fn", 1 }, { "-font", 1 }, { "-iconic", 0 }, { "-name", 1 }, { "-rv", 0 }, { "-reverse", 0 }, { "+rv", 0 }, { "-selectionTimeout", 1 }, { "-synchronous", 0 }, { "-title", 1 }, { "-xnllanguage", 1 }, { "-xrm", 1 }, { "-singleInstance", 0 }, { NULL, 0 } }; static int is_x_flag(char *s) { X_flag_entry *x = X_flags; while (x->flag) { if (!strcmp(x->flag, s)) return x->arg_count + 1; x++; } return 0; } static int write_str(int fd, char *s) { return write(fd, s, strlen(s)); } static char *num_to_string(int n) { if (!n) return "0"; else { char *d = (char *)malloc(20) + 19; *d = 0; while (n) { d--; *d = (n % 10) + '0'; n = n / 10; } return d; } } static char *string_append(char *s1, char *s2) { int l1, l2; char *s; l1 = strlen(s1); l2 = strlen(s2); s = (char *)malloc(l1 + l2 + 1); memcpy(s, s1, l1); memcpy(s + l1, s2, l2); s[l1 + l2] = 0; return s; } static char *copy_string(char *s1) { int l1; char *s; if (!s1) return NULL; l1 = strlen(s1); s = (char *)malloc(l1 + 1); memcpy(s, s1, l1 + 1); return s; } static char *do_path_append(char *s1, int l1, char *s2) { int l2; char *s; l2 = strlen(s2); s = (char *)malloc(l1 + l2 + 2); memcpy(s, s1, l1); if (s[l1 - 1] != '/') { s[l1++] = '/'; } memcpy(s + l1, s2, l2); s[l1 + l2] = 0; return s; } static char *path_append(char *s1, char *s2) { return do_path_append(s1, strlen(s1), s2); } static int executable_exists(char *path) { return (access(path, X_OK) == 0); } static int as_int(char *_c) { unsigned char *c = (unsigned char *)_c; return c[0] | ((int)c[1] << 8) | ((int)c[2] << 16) | ((int)c[3] << 24); } static int has_slash(char *s) { while (*s) { if (s[0] == '/') return 1; s++; } return 0; } char *absolutize(char *p, char *d) { int l1; if (!p[0]) return p; if (p[0] == '/') return p; /* Strip filename off d: */ l1 = strlen(d); while (l1 && (d[l1- 1] != '/')) { l1--; } if (l1) return do_path_append(d, l1, p); else return p; } static char *next_string(char *s) { return s + strlen(s) + 1; } typedef unsigned short ELF__Half; typedef unsigned int ELF__Word; typedef unsigned long ELF__Xword; typedef unsigned long ELF__Addr; typedef unsigned long ELF__Off; typedef struct { unsigned char e_ident[16]; ELF__Half e_type; ELF__Half e_machine; ELF__Word e_version; ELF__Addr e_entry; ELF__Off e_phoff; ELF__Off e_shoff; ELF__Word e_flags; ELF__Half e_ehsize; ELF__Half e_phentsize; ELF__Half e_phnum; ELF__Half e_shentsize; ELF__Half e_shnum; ELF__Half e_shstrndx; } ELF__Header; typedef struct { ELF__Word sh_name; ELF__Word sh_type; ELF__Xword sh_flags; ELF__Addr sh_addr; ELF__Off sh_offset; ELF__Xword sh_size; ELF__Word sh_link; ELF__Word sh_info; ELF__Xword sh_addralign; ELF__Xword sh_entsize; } Elf__Shdr; static int try_elf_section(const char *me, int *_start, int *_decl_end, int *_prog_end, int *_end) { int fd, i; ELF__Header e; Elf__Shdr s; char *strs; fd = open(me, O_RDONLY, 0); if (fd == -1) return 0; if (read(fd, &e, sizeof(e)) == sizeof(e)) { if ((e.e_ident[0] == 0x7F) && (e.e_ident[1] == 'E') && (e.e_ident[2] == 'L') && (e.e_ident[3] == 'F')) { lseek(fd, e.e_shoff + (e.e_shstrndx * e.e_shentsize), SEEK_SET); if (read(fd, &s, sizeof(s)) != sizeof(s)) { close(fd); return 0; } strs = (char *)malloc(s.sh_size); lseek(fd, s.sh_offset, SEEK_SET); if (read(fd, strs, s.sh_size) != s.sh_size) { close(fd); return 0; } for (i = 0; i < e.e_shnum; i++) { lseek(fd, e.e_shoff + (i * e.e_shentsize), SEEK_SET); if (read(fd, &s, sizeof(s)) != sizeof(s)) { close(fd); return 0; } if (!strcmp(strs + s.sh_name, ".rackcmdl") || !strcmp(strs + s.sh_name, ".rackprog")) { *_decl_end = (*_decl_end - *_start) + s.sh_offset; *_prog_end = (*_prog_end - *_start) + s.sh_offset; *_start = s.sh_offset; *_end = s.sh_offset + s.sh_size; close(fd); return !strcmp(strs + s.sh_name, ".rackprog"); } } } } close(fd); return 0; } int main(int argc, char **argv) { char *me = argv[0], *data, **new_argv; char *exe_path, *lib_path, *dll_path; int start, decl_end, prog_end, end, count, fd, v, en, x11; int argpos, inpos, collcount = 1, fix_argv; if (config[7] == '[') { write_str(2, argv[0]); write_str(2, ": this is an unconfigured starter\n"); return 1; } if (me[0] == '/') { /* Absolute path */ } else if (has_slash(me)) { /* Relative path with a directory: */ char *buf; long buflen = 4096; buf = (char *)malloc(buflen); me = path_append(getcwd(buf, buflen), me); free(buf); } else { /* We have to find the executable by searching PATH: */ char *path = copy_string(getenv("PATH")), *p, *m; int more; if (!path) { path = ""; } while (1) { /* Try each element of path: */ for (p = path; *p && (*p != ':'); p++) { } if (*p) { *p = 0; more = 1; } else more = 0; if (!*path) break; m = path_append(path, me); if (executable_exists(m)) { if (m[0] != '/') m = path_append(getcwd(NULL, 0), m); me = m; break; } free(m); if (more) path = p + 1; else break; } } /* me is now an absolute path to the binary */ /* resolve soft links */ while (1) { int len, bufsize = 127; char *buf; buf = (char *)malloc(bufsize + 1); len = readlink(me, buf, bufsize); if (len < 0) { if (errno == ENAMETOOLONG) { /* Increase buffer size and try again: */ bufsize *= 2; } else break; } else { /* Resolve buf relative to me: */ buf[len] = 0; buf = absolutize(buf, me); me = buf; } } start = as_int(config + 8); decl_end = as_int(config + 12); prog_end = as_int(config + 16); end = as_int(config + 20); count = as_int(config + 24); x11 = as_int(config + 28); fix_argv = try_elf_section(me, &start, &decl_end, &prog_end, &end); { int offset, len; offset = _coldir_offset; while (1) { len = strlen(_coldir + offset); offset += len + 1; if (!_coldir[offset]) break; collcount++; } } data = (char *)malloc(end - prog_end); new_argv = (char **)malloc((count + argc + (2 * collcount) + 10) * sizeof(char*)); fd = open(me, O_RDONLY, 0); lseek(fd, prog_end, SEEK_SET); { int expected_length = end - prog_end; if (expected_length != read(fd, data, expected_length)) { printf("read failed to read all %i bytes from file %s\n", expected_length, me); abort(); } } close(fd); exe_path = data; data = next_string(data); lib_path = data; data = next_string(data); exe_path = absolutize(exe_path, me); lib_path = absolutize(lib_path, me); # ifdef OS_X # define LD_LIB_PATH "DYLD_LIBRARY_PATH" # else # define LD_LIB_PATH "LD_LIBRARY_PATH" # endif if (*lib_path) { dll_path = getenv(LD_LIB_PATH); if (!dll_path) { dll_path = ""; } dll_path = string_append(dll_path, ":"); dll_path = string_append(dll_path, lib_path); dll_path = string_append(LD_LIB_PATH "=", dll_path); putenv(dll_path); } new_argv[0] = me; argpos = 1; inpos = 1; /* Keep all X11 flags to the front: */ if (x11) { int n; while (inpos < argc) { n = is_x_flag(argv[inpos]); if (!n) break; if (inpos + n > argc) { write_str(2, argv[0]); write_str(2, ": missing an argument for "); write_str(2, argv[inpos]); write_str(2, "\n"); return 1; } while (n--) { new_argv[argpos++] = argv[inpos++]; } } } /* Add -X and -S flags */ { int offset, len; offset = _coldir_offset; new_argv[argpos++] = "-X"; new_argv[argpos++] = absolutize(_coldir + offset, me); while (1) { len = strlen(_coldir + offset); offset += len + 1; if (!_coldir[offset]) break; new_argv[argpos++] = "-S"; new_argv[argpos++] = absolutize(_coldir + offset, me); } } /* Add -G flag */ new_argv[argpos++] = "-G"; new_argv[argpos++] = absolutize(_configdir + _configdir_offset, me); if (fix_argv) { /* next three args are "-k" and numbers; fix the numbers to match start, decl_end, and prog_end */ fix_argv = argpos + 1; } /* Add built-in flags: */ while (count--) { new_argv[argpos++] = data; data = next_string(data); } /* Propagate new flags (after the X11 flags) */ while (inpos < argc) { new_argv[argpos++] = argv[inpos++]; } new_argv[argpos] = NULL; if (fix_argv) { new_argv[fix_argv] = num_to_string(start); new_argv[fix_argv+1] = num_to_string(decl_end); new_argv[fix_argv+2] = num_to_string(prog_end); } /* Execute the original binary: */ v = execv(exe_path, new_argv); en = errno; write_str(2, argv[0]); write_str(2, ": failed to start "); write_str(2, exe_path); write_str(2, " ("); write_str(2, strerror(en)); write_str(2, ")\n"); if (*lib_path) { write_str(2, " used library path "); write_str(2, lib_path); write_str(2, "\n"); } return v; }
24.90785
98
0.480817
[ "geometry" ]
5bae28095c76d3c1457d6cfe8d0d05ebbfaf38d5
18,186
c
C
third_party/gst-plugins-bad/sys/nvenc/gstnvh264enc.c
isabella232/aistreams
209f4385425405676a581a749bb915e257dbc1c1
[ "Apache-2.0" ]
6
2020-09-22T18:07:15.000Z
2021-10-21T01:34:04.000Z
third_party/gst-plugins-bad/sys/nvenc/gstnvh264enc.c
isabella232/aistreams
209f4385425405676a581a749bb915e257dbc1c1
[ "Apache-2.0" ]
2
2020-11-10T13:17:39.000Z
2022-03-30T11:22:14.000Z
third_party/gst-plugins-bad/sys/nvenc/gstnvh264enc.c
isabella232/aistreams
209f4385425405676a581a749bb915e257dbc1c1
[ "Apache-2.0" ]
3
2020-09-26T08:40:35.000Z
2021-10-21T01:33:56.000Z
/* GStreamer NVENC plugin * Copyright (C) 2015 Centricular Ltd * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gstnvh264enc.h" #include <gst/pbutils/codec-utils.h> #include <string.h> GST_DEBUG_CATEGORY_STATIC (gst_nv_h264_enc_debug); #define GST_CAT_DEFAULT gst_nv_h264_enc_debug #if HAVE_NVENC_GST_GL #include <cuda.h> #include <cuda_runtime_api.h> #include <cuda_gl_interop.h> #include <gst/gl/gl.h> #endif #define parent_class gst_nv_h264_enc_parent_class G_DEFINE_TYPE (GstNvH264Enc, gst_nv_h264_enc, GST_TYPE_NV_BASE_ENC); #if HAVE_NVENC_GST_GL #define GL_CAPS_STR \ ";" \ "video/x-raw(memory:GLMemory), " \ "format = (string) { NV12, Y444 }, " \ "width = (int) [ 16, 4096 ], height = (int) [ 16, 4096 ], " \ "framerate = (fraction) [0, MAX]," \ "interlace-mode = { progressive, mixed, interleaved } " #else #define GL_CAPS_STR "" #endif /* *INDENT-OFF* */ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-raw, " "format = (string) { NV12, I420 }, " // TODO: YV12, Y444 support "width = (int) [ 16, 4096 ], height = (int) [ 16, 4096 ], " "framerate = (fraction) [0, MAX]," "interlace-mode = { progressive, mixed, interleaved } " GL_CAPS_STR )); static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-h264, " "width = (int) [ 1, 4096 ], height = (int) [ 1, 4096 ], " "framerate = (fraction) [0/1, MAX], " "stream-format = (string) byte-stream, " // TODO: avc support "alignment = (string) au, " "profile = (string) { high, main, baseline }") // TODO: a couple of others ); /* *INDENT-ON* */ static gboolean gst_nv_h264_enc_open (GstVideoEncoder * enc); static gboolean gst_nv_h264_enc_close (GstVideoEncoder * enc); static GstCaps *gst_nv_h264_enc_getcaps (GstVideoEncoder * enc, GstCaps * filter); static gboolean gst_nv_h264_enc_set_src_caps (GstNvBaseEnc * nvenc, GstVideoCodecState * state); static gboolean gst_nv_h264_enc_set_encoder_config (GstNvBaseEnc * nvenc, GstVideoCodecState * state, NV_ENC_CONFIG * config); static gboolean gst_nv_h264_enc_set_pic_params (GstNvBaseEnc * nvenc, GstVideoCodecFrame * frame, NV_ENC_PIC_PARAMS * pic_params); static void gst_nv_h264_enc_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_nv_h264_enc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static void gst_nv_h264_enc_finalize (GObject * obj); static void gst_nv_h264_enc_class_init (GstNvH264EncClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstVideoEncoderClass *videoenc_class = GST_VIDEO_ENCODER_CLASS (klass); GstNvBaseEncClass *nvenc_class = GST_NV_BASE_ENC_CLASS (klass); gobject_class->set_property = gst_nv_h264_enc_set_property; gobject_class->get_property = gst_nv_h264_enc_get_property; gobject_class->finalize = gst_nv_h264_enc_finalize; videoenc_class->open = GST_DEBUG_FUNCPTR (gst_nv_h264_enc_open); videoenc_class->close = GST_DEBUG_FUNCPTR (gst_nv_h264_enc_close); videoenc_class->getcaps = GST_DEBUG_FUNCPTR (gst_nv_h264_enc_getcaps); nvenc_class->codec_id = NV_ENC_CODEC_H264_GUID; nvenc_class->set_encoder_config = gst_nv_h264_enc_set_encoder_config; nvenc_class->set_src_caps = gst_nv_h264_enc_set_src_caps; nvenc_class->set_pic_params = gst_nv_h264_enc_set_pic_params; gst_element_class_add_static_pad_template (element_class, &sink_factory); gst_element_class_add_static_pad_template (element_class, &src_factory); gst_element_class_set_static_metadata (element_class, "NVENC H.264 Video Encoder", "Codec/Encoder/Video/Hardware", "Encode H.264 video streams using NVIDIA's hardware-accelerated NVENC encoder API", "Tim-Philipp Müller <tim@centricular.com>\n" "Matthew Waters <matthew@centricular.com>"); GST_DEBUG_CATEGORY_INIT (gst_nv_h264_enc_debug, "nvh264enc", 0, "Nvidia H.264 encoder"); } static void gst_nv_h264_enc_init (GstNvH264Enc * nvenc) { } static void gst_nv_h264_enc_finalize (GObject * obj) { G_OBJECT_CLASS (gst_nv_h264_enc_parent_class)->finalize (obj); } static gboolean _get_supported_profiles (GstNvH264Enc * nvenc) { NVENCSTATUS nv_ret; GUID profile_guids[64]; GValue list = G_VALUE_INIT; GValue val = G_VALUE_INIT; guint i, n, n_profiles; if (nvenc->supported_profiles) return TRUE; nv_ret = NvEncGetEncodeProfileGUIDCount (GST_NV_BASE_ENC (nvenc)->encoder, NV_ENC_CODEC_H264_GUID, &n); if (nv_ret != NV_ENC_SUCCESS) return FALSE; nv_ret = NvEncGetEncodeProfileGUIDs (GST_NV_BASE_ENC (nvenc)->encoder, NV_ENC_CODEC_H264_GUID, profile_guids, G_N_ELEMENTS (profile_guids), &n); if (nv_ret != NV_ENC_SUCCESS) return FALSE; n_profiles = 0; g_value_init (&list, GST_TYPE_LIST); for (i = 0; i < n; i++) { g_value_init (&val, G_TYPE_STRING); if (gst_nvenc_cmp_guid (profile_guids[i], NV_ENC_H264_PROFILE_BASELINE_GUID)) { g_value_set_static_string (&val, "baseline"); gst_value_list_append_value (&list, &val); n_profiles++; } else if (gst_nvenc_cmp_guid (profile_guids[i], NV_ENC_H264_PROFILE_MAIN_GUID)) { g_value_set_static_string (&val, "main"); gst_value_list_append_value (&list, &val); n_profiles++; } else if (gst_nvenc_cmp_guid (profile_guids[i], NV_ENC_H264_PROFILE_HIGH_GUID)) { g_value_set_static_string (&val, "high"); gst_value_list_append_value (&list, &val); n_profiles++; } /* TODO: map HIGH_444, STEREO, CONSTRAINED_HIGH, SVC_TEMPORAL_SCALABILITY */ g_value_unset (&val); } if (n_profiles == 0) return FALSE; GST_OBJECT_LOCK (nvenc); nvenc->supported_profiles = g_new0 (GValue, 1); *nvenc->supported_profiles = list; GST_OBJECT_UNLOCK (nvenc); return TRUE; } static gboolean gst_nv_h264_enc_open (GstVideoEncoder * enc) { GstNvH264Enc *nvenc = GST_NV_H264_ENC (enc); if (!GST_VIDEO_ENCODER_CLASS (gst_nv_h264_enc_parent_class)->open (enc)) return FALSE; /* Check if H.264 is supported */ { uint32_t i, num = 0; GUID guids[16]; NvEncGetEncodeGUIDs (GST_NV_BASE_ENC (nvenc)->encoder, guids, G_N_ELEMENTS (guids), &num); for (i = 0; i < num; ++i) { if (gst_nvenc_cmp_guid (guids[i], NV_ENC_CODEC_H264_GUID)) break; } GST_INFO_OBJECT (enc, "H.264 encoding %ssupported", (i == num) ? "un" : ""); if (i == num) { gst_nv_h264_enc_close (enc); return FALSE; } } /* query supported input formats */ if (!_get_supported_profiles (nvenc)) { GST_WARNING_OBJECT (nvenc, "No supported encoding profiles"); gst_nv_h264_enc_close (enc); return FALSE; } return TRUE; } static gboolean gst_nv_h264_enc_close (GstVideoEncoder * enc) { GstNvH264Enc *nvenc = GST_NV_H264_ENC (enc); GST_OBJECT_LOCK (nvenc); if (nvenc->supported_profiles) g_value_unset (nvenc->supported_profiles); g_free (nvenc->supported_profiles); nvenc->supported_profiles = NULL; GST_OBJECT_UNLOCK (nvenc); return GST_VIDEO_ENCODER_CLASS (gst_nv_h264_enc_parent_class)->close (enc); } static GValue * _get_interlace_modes (GstNvH264Enc * nvenc) { NV_ENC_CAPS_PARAM caps_param = { 0, }; GValue *list = g_new0 (GValue, 1); GValue val = G_VALUE_INIT; g_value_init (list, GST_TYPE_LIST); g_value_init (&val, G_TYPE_STRING); g_value_set_static_string (&val, "progressive"); gst_value_list_append_value (list, &val); caps_param.version = NV_ENC_CAPS_PARAM_VER; caps_param.capsToQuery = NV_ENC_CAPS_SUPPORT_FIELD_ENCODING; if (NvEncGetEncodeCaps (GST_NV_BASE_ENC (nvenc)->encoder, NV_ENC_CODEC_H264_GUID, &caps_param, &nvenc->interlace_modes) != NV_ENC_SUCCESS) nvenc->interlace_modes = 0; if (nvenc->interlace_modes >= 1) { g_value_set_static_string (&val, "interleaved"); gst_value_list_append_value (list, &val); g_value_set_static_string (&val, "mixed"); gst_value_list_append_value (list, &val); g_value_unset (&val); } /* TODO: figure out what nvenc frame based interlacing means in gst terms */ return list; } static GstCaps * gst_nv_h264_enc_getcaps (GstVideoEncoder * enc, GstCaps * filter) { GstNvH264Enc *nvenc = GST_NV_H264_ENC (enc); GstCaps *supported_incaps = NULL; GstCaps *template_caps, *caps; GValue *input_formats = GST_NV_BASE_ENC (enc)->input_formats; GST_OBJECT_LOCK (nvenc); if (input_formats != NULL) { GValue *val; template_caps = gst_pad_get_pad_template_caps (enc->sinkpad); supported_incaps = gst_caps_copy (template_caps); gst_caps_set_value (supported_incaps, "format", input_formats); val = _get_interlace_modes (nvenc); gst_caps_set_value (supported_incaps, "interlace-mode", val); g_value_unset (val); g_free (val); GST_LOG_OBJECT (enc, "codec input caps %" GST_PTR_FORMAT, supported_incaps); GST_LOG_OBJECT (enc, " template caps %" GST_PTR_FORMAT, template_caps); caps = gst_caps_intersect (template_caps, supported_incaps); gst_caps_unref (template_caps); gst_caps_unref (supported_incaps); supported_incaps = caps; GST_LOG_OBJECT (enc, " supported caps %" GST_PTR_FORMAT, supported_incaps); } GST_OBJECT_UNLOCK (nvenc); caps = gst_video_encoder_proxy_getcaps (enc, supported_incaps, filter); if (supported_incaps) gst_caps_unref (supported_incaps); GST_DEBUG_OBJECT (nvenc, " returning caps %" GST_PTR_FORMAT, caps); return caps; } static gboolean gst_nv_h264_enc_set_profile_and_level (GstNvH264Enc * nvenc, GstCaps * caps) { #define N_BYTES_SPS 128 guint8 sps[N_BYTES_SPS]; NV_ENC_SEQUENCE_PARAM_PAYLOAD spp = { 0, }; GstStructure *s; const gchar *profile; GstCaps *allowed_caps; GstStructure *s2; const gchar *allowed_profile; NVENCSTATUS nv_ret; guint32 seq_size; spp.version = NV_ENC_SEQUENCE_PARAM_PAYLOAD_VER; spp.inBufferSize = N_BYTES_SPS; spp.spsId = 0; spp.ppsId = 0; spp.spsppsBuffer = &sps; spp.outSPSPPSPayloadSize = &seq_size; nv_ret = NvEncGetSequenceParams (GST_NV_BASE_ENC (nvenc)->encoder, &spp); if (nv_ret != NV_ENC_SUCCESS) { GST_ELEMENT_ERROR (nvenc, STREAM, ENCODE, ("Encode header failed."), ("NvEncGetSequenceParams return code=%d", nv_ret)); return FALSE; } if (seq_size < 8) { GST_ELEMENT_ERROR (nvenc, STREAM, ENCODE, ("Encode header failed."), ("NvEncGetSequenceParams returned incomplete data")); return FALSE; } /* skip nal header and identifier */ gst_codec_utils_h264_caps_set_level_and_profile (caps, &sps[5], 3); /* Constrained baseline is a strict subset of baseline. If downstream * wanted baseline and we produced constrained baseline, we can just * set the profile to baseline in the caps to make negotiation happy. * Same goes for baseline as subset of main profile and main as a subset * of high profile. */ s = gst_caps_get_structure (caps, 0); profile = gst_structure_get_string (s, "profile"); allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (nvenc)); if (allowed_caps == NULL) goto no_peer; if (!gst_caps_can_intersect (allowed_caps, caps)) { allowed_caps = gst_caps_make_writable (allowed_caps); allowed_caps = gst_caps_truncate (allowed_caps); s2 = gst_caps_get_structure (allowed_caps, 0); gst_structure_fixate_field_string (s2, "profile", profile); allowed_profile = gst_structure_get_string (s2, "profile"); if (!strcmp (allowed_profile, "high")) { if (!strcmp (profile, "constrained-baseline") || !strcmp (profile, "baseline") || !strcmp (profile, "main")) { gst_structure_set (s, "profile", G_TYPE_STRING, "high", NULL); GST_INFO_OBJECT (nvenc, "downstream requested high profile, but " "encoder will now output %s profile (which is a subset), due " "to how it's been configured", profile); } } else if (!strcmp (allowed_profile, "main")) { if (!strcmp (profile, "constrained-baseline") || !strcmp (profile, "baseline")) { gst_structure_set (s, "profile", G_TYPE_STRING, "main", NULL); GST_INFO_OBJECT (nvenc, "downstream requested main profile, but " "encoder will now output %s profile (which is a subset), due " "to how it's been configured", profile); } } else if (!strcmp (allowed_profile, "baseline")) { if (!strcmp (profile, "constrained-baseline")) gst_structure_set (s, "profile", G_TYPE_STRING, "baseline", NULL); } } gst_caps_unref (allowed_caps); no_peer: return TRUE; #undef N_BYTES_SPS } static gboolean gst_nv_h264_enc_set_src_caps (GstNvBaseEnc * nvenc, GstVideoCodecState * state) { GstNvH264Enc *h264enc = GST_NV_H264_ENC (nvenc); GstVideoCodecState *out_state; GstStructure *s; GstCaps *out_caps; out_caps = gst_caps_new_empty_simple ("video/x-h264"); s = gst_caps_get_structure (out_caps, 0); /* TODO: add support for avc format as well */ gst_structure_set (s, "stream-format", G_TYPE_STRING, "byte-stream", "alignment", G_TYPE_STRING, "au", NULL); if (!gst_nv_h264_enc_set_profile_and_level (h264enc, out_caps)) { gst_caps_unref (out_caps); return FALSE; } out_state = gst_video_encoder_set_output_state (GST_VIDEO_ENCODER (nvenc), out_caps, state); GST_INFO_OBJECT (nvenc, "output caps: %" GST_PTR_FORMAT, out_state->caps); /* encoder will keep it around for us */ gst_video_codec_state_unref (out_state); /* TODO: would be nice to also send some tags with the codec name */ return TRUE; } static gboolean gst_nv_h264_enc_set_encoder_config (GstNvBaseEnc * nvenc, GstVideoCodecState * state, NV_ENC_CONFIG * config) { GstNvH264Enc *h264enc = GST_NV_H264_ENC (nvenc); GstCaps *allowed_caps, *template_caps; GUID selected_profile = NV_ENC_CODEC_PROFILE_AUTOSELECT_GUID; int level_idc = NV_ENC_LEVEL_AUTOSELECT; GstVideoInfo *info = &state->info; template_caps = gst_static_pad_template_get_caps (&src_factory); allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (h264enc)); if (template_caps == allowed_caps) { GST_INFO_OBJECT (h264enc, "downstream has ANY caps"); } else if (allowed_caps) { GstStructure *s; const gchar *profile; const gchar *level; if (gst_caps_is_empty (allowed_caps)) { gst_caps_unref (allowed_caps); gst_caps_unref (template_caps); return FALSE; } allowed_caps = gst_caps_make_writable (allowed_caps); allowed_caps = gst_caps_fixate (allowed_caps); s = gst_caps_get_structure (allowed_caps, 0); profile = gst_structure_get_string (s, "profile"); if (profile) { if (!strcmp (profile, "baseline")) { selected_profile = NV_ENC_H264_PROFILE_BASELINE_GUID; } else if (g_str_has_prefix (profile, "high-4:4:4")) { selected_profile = NV_ENC_H264_PROFILE_HIGH_444_GUID; } else if (g_str_has_prefix (profile, "high-10")) { g_assert_not_reached (); } else if (g_str_has_prefix (profile, "high-4:2:2")) { g_assert_not_reached (); } else if (g_str_has_prefix (profile, "high")) { selected_profile = NV_ENC_H264_PROFILE_HIGH_GUID; } else if (g_str_has_prefix (profile, "main")) { selected_profile = NV_ENC_H264_PROFILE_MAIN_GUID; } else { g_assert_not_reached (); } } level = gst_structure_get_string (s, "level"); if (level) /* matches values stored in NV_ENC_LEVEL */ level_idc = gst_codec_utils_h264_get_level_idc (level); gst_caps_unref (allowed_caps); } gst_caps_unref (template_caps); /* override some defaults */ GST_LOG_OBJECT (h264enc, "setting parameters"); config->profileGUID = selected_profile; config->encodeCodecConfig.h264Config.level = level_idc; config->encodeCodecConfig.h264Config.chromaFormatIDC = 1; if (GST_VIDEO_INFO_FORMAT (info) == GST_VIDEO_FORMAT_Y444) { GST_DEBUG_OBJECT (h264enc, "have Y444 input, setting config accordingly"); config->encodeCodecConfig.h264Config.separateColourPlaneFlag = 1; config->encodeCodecConfig.h264Config.chromaFormatIDC = 3; } config->encodeCodecConfig.h264Config.idrPeriod = config->gopLength; /* FIXME: make property */ config->encodeCodecConfig.h264Config.outputAUD = 1; return TRUE; } static gboolean gst_nv_h264_enc_set_pic_params (GstNvBaseEnc * enc, GstVideoCodecFrame * frame, NV_ENC_PIC_PARAMS * pic_params) { /* encode whole picture in one single slice */ pic_params->codecPicParams.h264PicParams.sliceMode = 0; pic_params->codecPicParams.h264PicParams.sliceModeData = 0; return TRUE; } static void gst_nv_h264_enc_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { switch (prop_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gst_nv_h264_enc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { switch (prop_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
32.64991
107
0.716155
[ "object" ]
5baeb06472f6588c01078913a4082e04366b1741
1,121
h
C
RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedHeavyObjectCache.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedHeavyObjectCache.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedHeavyObjectCache.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
#ifndef RecoEgamma_EgammaElectronProducers_LowPtGsfElectronSeedHeavyObjectCache_h #define RecoEgamma_EgammaElectronProducers_LowPtGsfElectronSeedHeavyObjectCache_h #include "CondFormats/GBRForest/interface/GBRForest.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h" #include <vector> namespace reco { class BeamSpot; class PreId; } // namespace reco namespace lowptgsfeleseed { class HeavyObjectCache { public: HeavyObjectCache(const edm::ParameterSet&); std::vector<std::string> modelNames() const { return names_; } bool eval(const std::string& name, reco::PreId& ecal, reco::PreId& hcal, double rho, const reco::BeamSpot& spot, noZS::EcalClusterLazyTools& ecalTools) const; private: std::vector<std::string> names_; std::vector<std::unique_ptr<const GBRForest> > models_; std::vector<double> thresholds_; }; } // namespace lowptgsfeleseed #endif // RecoEgamma_EgammaElectronProducers_LowPtGsfElectronSeedHeavyObjectCache_h
30.297297
84
0.737734
[ "vector" ]
5bb14b35bf344dc75d31c8de11588dc1077633e2
14,814
h
C
INET_EC/transportlayer/contract/tcp/TCPSocket.h
LarryNguyen/ECSim-
0d3f848642e49845ed7e4c7b97dd16bd3d65ede5
[ "Apache-2.0" ]
12
2020-11-30T08:04:23.000Z
2022-03-23T11:49:26.000Z
INET_EC/transportlayer/contract/tcp/TCPSocket.h
LarryNguyen/ECSim-
0d3f848642e49845ed7e4c7b97dd16bd3d65ede5
[ "Apache-2.0" ]
1
2021-01-26T10:49:56.000Z
2021-01-31T16:58:52.000Z
INET_EC/transportlayer/contract/tcp/TCPSocket.h
LarryNguyen/ECSim-
0d3f848642e49845ed7e4c7b97dd16bd3d65ede5
[ "Apache-2.0" ]
8
2021-03-15T02:05:51.000Z
2022-03-21T13:14:02.000Z
// // Copyright (C) 2004 Andras Varga // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program; if not, see <http://www.gnu.org/licenses/>. // #ifndef __INET_TCPSOCKET_H #define __INET_TCPSOCKET_H #include "inet/common/INETDefs.h" #include "inet/transportlayer/contract/tcp/TCPCommand_m.h" #include "inet/networklayer/common/L3Address.h" namespace inet { class TCPStatusInfo; /** * TCPSocket is a convenience class, to make it easier to manage TCP connections * from your application models. You'd have one (or more) TCPSocket object(s) * in your application simple module class, and call its member functions * (bind(), listen(), connect(), etc.) to open, close or abort a TCP connection. * * TCPSocket chooses and remembers the connId for you, assembles and sends command * packets (such as OPEN_ACTIVE, OPEN_PASSIVE, CLOSE, ABORT, etc.) to TCP, * and can also help you deal with packets and notification messages arriving * from TCP. * * A session which opens a connection from local port 1000 to 10.0.0.2:2000, * sends 16K of data and closes the connection may be as simple as this * (the code can be placed in your handleMessage() or activity()): * * <pre> * TCPSocket socket; * socket.connect(Address("10.0.0.2"), 2000); * * msg = new cMessage("data1"); * msg->setByteLength(16*1024); // 16K * socket.send(msg); * * socket.close(); * </pre> * * Dealing with packets and notification messages coming from TCP is somewhat * more cumbersome. Basically you have two choices: you either process those * messages yourself, or let TCPSocket do part of the job. For the latter, * you give TCPSocket a callback object on which it'll invoke the appropriate * member functions: socketEstablished(), socketDataArrived(), socketFailure(), * socketPeerClosed(), etc (these are methods of TCPSocket::CallbackInterface)., * The callback object can be your simple module class too. * * This code skeleton example shows how to set up a TCPSocket to use the module * itself as callback object: * * <pre> * class MyModule : public cSimpleModule, public TCPSocket::CallbackInterface * { * TCPSocket socket; * virtual void socketDataArrived(int connId, void *yourPtr, cPacket *msg, bool urgent); * virtual void socketFailure(int connId, void *yourPtr, int code); * ... * }; * * void MyModule::initialize() { * socket.setCallbackObject(this,nullptr); * } * * void MyModule::handleMessage(cMessage *msg) { * if (socket.belongsToSocket(msg)) * socket.processMessage(msg); // dispatch to socketXXXX() methods * else * ... * } * * void MyModule::socketDataArrived(int, void *, cPacket *msg, bool) { * EV << "Received TCP data, " << msg->getByteLength() << " bytes\\n"; * delete msg; * } * * void MyModule::socketFailure(int, void *, int code) { * if (code==TCP_I_CONNECTION_RESET) * EV << "Connection reset!\\n"; * else if (code==TCP_I_CONNECTION_REFUSED) * EV << "Connection refused!\\n"; * else if (code==TCP_I_TIMEOUT) * EV << "Connection timed out!\\n"; * } * </pre> * * If you need to manage a large number of sockets (e.g. in a server * application which handles multiple incoming connections), the TCPSocketMap * class may be useful. The following code fragment to handle incoming * connections is from the LDP module: * * <pre> * TCPSocket *socket = socketMap.findSocketFor(msg); * if (!socket) * { * // not yet in socketMap, must be new incoming connection: add to socketMap * socket = new TCPSocket(msg); * socket->setOutputGate(gate("tcpOut")); * socket->setCallbackObject(this, nullptr); * socketMap.addSocket(socket); * } * // dispatch to socketEstablished(), socketDataArrived(), socketPeerClosed() * // or socketFailure() * socket->processMessage(msg); * </pre> * * @see TCPSocketMap */ class INET_API TCPSocket { public: /** * Abstract base class for your callback objects. See setCallbackObject() * and processMessage() for more info. * * Note: this class is not subclassed from cObject, because * classes may have both this class and cSimpleModule as base class, * and cSimpleModule is already a cObject. */ class CallbackInterface { public: virtual ~CallbackInterface() {} virtual void socketDataArrived(int connId, void *yourPtr, cPacket *msg, bool urgent) = 0; virtual void socketEstablished(int connId, void *yourPtr) {} virtual void socketPeerClosed(int connId, void *yourPtr) {} virtual void socketClosed(int connId, void *yourPtr) {} virtual void socketFailure(int connId, void *yourPtr, int code) {} virtual void socketStatusArrived(int connId, void *yourPtr, TCPStatusInfo *status) { delete status; } virtual void socketDeleted(int connId, void *yourPtr) {} }; enum State { NOT_BOUND, BOUND, LISTENING, CONNECTING, CONNECTED, PEER_CLOSED, LOCALLY_CLOSED, CLOSED, SOCKERROR }; protected: int connId; int sockstate; L3Address localAddr; int localPrt; L3Address remoteAddr; int remotePrt; CallbackInterface *cb; void *yourPtr; cGate *gateToTcp; TCPDataTransferMode dataTransferMode; std::string tcpAlgorithmClass; protected: void sendToTCP(cMessage *msg); // internal: implementation behind listen() and listenOnce() void listen(bool fork); public: /** * Constructor. The getConnectionId() method returns a valid Id right after * constructor call. */ TCPSocket(); /** * Constructor, to be used with forked sockets (see listen()). * The new connId will be picked up from the message: it should have * arrived from TCP and contain TCPCommmand control info. */ TCPSocket(cMessage *msg); /** * Destructor */ ~TCPSocket(); /** * Returns the internal connection Id. TCP uses the (gate index, connId) pair * to identify the connection when it receives a command from the application * (or TCPSocket). */ int getConnectionId() const { return connId; } /** * Returns the socket state, one of NOT_BOUND, CLOSED, LISTENING, CONNECTING, * CONNECTED, etc. Messages received from TCP must be routed through * processMessage() in order to keep socket state up-to-date. */ int getState() const { return sockstate; } /** * Returns name of socket state code returned by getState(). */ static const char *stateName(int state); void setState(enum State state) { sockstate = state; }; /** @name Getter functions */ //@{ L3Address getLocalAddress() { return localAddr; } int getLocalPort() { return localPrt; } L3Address getRemoteAddress() { return remoteAddr; } int getRemotePort() { return remotePrt; } //@} /** @name Opening and closing connections, sending data */ //@{ /** * Sets the gate on which to send to TCP. Must be invoked before socket * can be used. Example: <tt>socket.setOutputGate(gate("tcpOut"));</tt> */ void setOutputGate(cGate *toTcp) { gateToTcp = toTcp; } /** * Bind the socket to a local port number. */ void bind(int localPort); /** * Bind the socket to a local port number and IP address (useful with * multi-homing). */ void bind(L3Address localAddr, int localPort); /** * Returns the current dataTransferMode parameter. * @see TCPCommand */ TCPDataTransferMode getDataTransferMode() const { return dataTransferMode; } /** * Returns the current tcpAlgorithmClass parameter. */ const char *getTCPAlgorithmClass() const { return tcpAlgorithmClass.c_str(); } /** * Convert a string to TCPDataTransferMode enum. * Returns TCP_TRANSFER_UNDEFINED when string has an invalid value * Generate runtime error, when string is nullptr; */ static TCPDataTransferMode convertStringToDataTransferMode(const char *transferMode); /** * Sets the dataTransferMode parameter of the subsequent connect() or listen() calls. * @see TCPCommand */ void setDataTransferMode(TCPDataTransferMode transferMode) { dataTransferMode = transferMode; } /** * Read "dataTransferMode" parameter from ini/ned, and set dataTransferMode member value * * Generate runtime error when parameter is missing or value is invalid. */ void readDataTransferModePar(cComponent& component); /** * Sets the tcpAlgorithmClass parameter of the next connect() or listen() call. */ void setTCPAlgorithmClass(const char *tcpAlgorithmClass) { this->tcpAlgorithmClass = tcpAlgorithmClass; } /** * Initiates passive OPEN, creating a "forking" connection that will listen * on the port you bound the socket to. Every incoming connection will * get a new connId (and thus, must be handled with a new TCPSocket object), * while the original connection (original connId) will keep listening on * the port. The new TCPSocket object must be created with the * TCPSocket(cMessage *msg) constructor. * * If you need to handle multiple incoming connections, the TCPSocketMap * class can also be useful, and TCPSrvHostApp shows how to put it all * together. See also TCPOpenCommand documentation (neddoc) for more info. */ void listen() { listen(true); } /** * Initiates passive OPEN to create a non-forking listening connection. * Non-forking means that TCP will accept the first incoming * connection, and refuse subsequent ones. * * See TCPOpenCommand documentation (neddoc) for more info. */ void listenOnce() { listen(false); } /** * Active OPEN to the given remote socket. */ void connect(L3Address remoteAddr, int remotePort); /** * Sends data packet. */ void send(cMessage *msg); /** * Sends command. */ void sendCommand(cMessage *msg); /** * Closes the local end of the connection. With TCP, a CLOSE operation * means "I have no more data to send", and thus results in a one-way * connection until the remote TCP closes too (or the FIN_WAIT_1 timeout * expires) */ void close(); /** * Aborts the connection. */ void abort(); /** * Causes TCP to reply with a fresh TCPStatusInfo, attached to a dummy * message as getControlInfo(). The reply message can be recognized by its * message kind TCP_I_STATUS, or (if a callback object is used) * the socketStatusArrived() method of the callback object will be * called. */ void requestStatus(); /** * Required to re-connect with a "used" TCPSocket object. * By default, a TCPSocket object is tied to a single TCP connection, * via the connectionId. When the connection gets closed or aborted, * you cannot use the socket to connect again (by connect() or listen()) * unless you obtain a new connectionId by calling this method. * * BEWARE if you use TCPSocketMap! TCPSocketMap uses connectionId * to find TCPSockets, so after calling this method you have to remove * the socket from your TCPSocketMap, and re-add it. Otherwise TCPSocketMap * will get confused. * * The reason why one must obtain a new connectionId is that TCP still * has to maintain the connection data structure (identified by the old * connectionId) internally for a while (2 maximum segment lifetimes = 240s) * after it reported "connection closed" to us. */ void renewSocket(); //@} /** @name Handling of messages arriving from TCP */ //@{ /** * Returns true if the message belongs to this socket instance (message * has a TCPCommand as getControlInfo(), and the connId in it matches * that of the socket.) */ bool belongsToSocket(cMessage *msg); /** * Returns true if the message belongs to any TCPSocket instance. * (This basically checks if the message has a TCPCommand attached to * it as getControlInfo().) */ static bool belongsToAnyTCPSocket(cMessage *msg); /** * Sets a callback object, to be used with processMessage(). * This callback object may be your simple module itself (if it * multiply inherits from CallbackInterface too, that is you * declared it as * <pre> * class MyAppModule : public cSimpleModule, public TCPSocket::CallbackInterface * </pre> * and redefined the necessary virtual functions; or you may use * dedicated class (and objects) for this purpose. * * TCPSocket doesn't delete the callback object in the destructor * or on any other occasion. * * YourPtr is an optional pointer. It may contain any value you wish -- * TCPSocket will not look at it or do anything with it except passing * it back to you in the CallbackInterface calls. You may find it * useful if you maintain additional per-connection information: * in that case you don't have to look it up by connId in the callbacks, * you can have it passed to you as yourPtr. */ void setCallbackObject(CallbackInterface *cb, void *yourPtr = nullptr); /** * Examines the message (which should have arrived from TCP), * updates socket state, and if there is a callback object installed * (see setCallbackObject(), class CallbackInterface), dispatches * to the appropriate method of it with the same yourPtr that * you gave in the setCallbackObject() call. * * The method deletes the message, unless (1) there is a callback object * installed AND (2) the message is payload (message kind TCP_I_DATA or * TCP_I_URGENT_DATA) when the responsibility of destruction is on the * socketDataArrived() callback method. * * IMPORTANT: for performance reasons, this method doesn't check that * the message belongs to this socket, i.e. belongsToSocket(msg) would * return true! */ void processMessage(cMessage *msg); //@} }; } // namespace inet #endif // ifndef __INET_TCPSOCKET_H
35.271429
118
0.67713
[ "object" ]
5bb1ab56ff16c7d76478ed9903a6ad0c4d2d05c2
3,514
h
C
Objective-Gems/KSProxyAndReference.h
wanc/Objective-Gems
61d5619ab213e7dbd7a2416afccb3d731674be5c
[ "MIT", "Unlicense" ]
2
2015-12-22T02:49:43.000Z
2015-12-22T03:00:36.000Z
Objective-Gems/KSProxyAndReference.h
wanc/Objective-Gems
61d5619ab213e7dbd7a2416afccb3d731674be5c
[ "MIT", "Unlicense" ]
null
null
null
Objective-Gems/KSProxyAndReference.h
wanc/Objective-Gems
61d5619ab213e7dbd7a2416afccb3d731674be5c
[ "MIT", "Unlicense" ]
null
null
null
// // KSProxyAndReference.h // Objective-Gems // // Created by Karl Stenerud on 4/20/11. // // Copyright 2011 Karl Stenerud // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall remain in place // in this source code. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import <Foundation/Foundation.h> /** * A proxy that passes most messages to its reference. * * Messages not forwarded: * - autorelease * - class * - description (forwarded, but result is modified with proxy info) * - isProxy * - release * - retain * - retainCount * - self * - superclass * - zone */ @interface KSProxy : NSProxy<NSCopying> { /** The object this proxy references */ id reference_; /** If YES, this is a weak reference */ BOOL weakReference_; /** If YES, copying this proxy will also copy the object it references */ BOOL deepCopy_; } /** Create a proxy referencing the specified object. * * @param reference The object to reference. * @return A new proxy. */ + (KSProxy*) proxyTo:(id) reference; /** Create a proxy weakly referencing the specified object. * * @param reference The object to reference. * @return A new proxy. */ + (KSProxy*) weakProxyTo:(id) reference; /** Initialize a proxy to reference the specified object. * * @param reference The object to reference. * @param weakReferences If YES, do not retain the reference. * @param deepCopy If YES, copying this proxy will also copy the reference. * @return The initialized proxy. */ - (id) initWithReference:(id) reference weakReference:(BOOL) weakReference deepCopy:(BOOL) deepCopy; @end /** * A reference to another object. * Also supports being used as a key in a dictionary. */ @interface KSReference : NSObject<NSCopying> { /** The object being referenced */ id reference_; /** If YES, this is a weak reference */ BOOL weakReference_; } /** The object being referenced */ @property(readonly) id reference; /** Create a reference to the specified object. * * @param reference The object to reference. * @return A new reference. */ + (KSReference*) referenceTo:(id) reference; /** Create a weak reference to the specified object. * * @param reference The object to reference. * @return A new reference. */ + (KSReference*) weakReferenceTo:(id) reference; /** Initialize a reference to an object. * * @param reference The object to reference. * @param weakReferences If YES, do not retain the reference. * @return The initialized reference. */ - (id) initWithReference:(id)reference weakReference:(BOOL) weakReference; @end
29.041322
80
0.709448
[ "object" ]
5bb49e01c814d6d98a07c911d45dc518ca02e368
1,343
h
C
src/Utils/ObjectivesCalculator.h
bernardoct/Heraclitus
122116eb5b32efd35f4212f09511cd68528462be
[ "Apache-2.0" ]
11
2018-07-30T01:47:55.000Z
2021-07-28T22:17:07.000Z
src/Utils/ObjectivesCalculator.h
bernardoct/RevampedTriangleModel
122116eb5b32efd35f4212f09511cd68528462be
[ "Apache-2.0" ]
26
2018-06-26T15:48:20.000Z
2021-01-12T15:48:59.000Z
src/Utils/ObjectivesCalculator.h
bernardoct/RevampedTriangleModel
122116eb5b32efd35f4212f09511cd68528462be
[ "Apache-2.0" ]
9
2018-12-08T02:47:39.000Z
2021-07-26T15:34:22.000Z
// // Created by bernardoct on 8/25/17. // #ifndef TRIANGLEMODEL_OBJECTIVESCALCULATOR_H #define TRIANGLEMODEL_OBJECTIVESCALCULATOR_H #include "../DataCollector/UtilitiesDataCollector.h" #include "../DataCollector/RestrictionsDataCollector.h" class ObjectivesCalculator { public: static double calculateReliabilityObjective( const vector<UtilitiesDataCollector *>& utility_collector, vector<unsigned long> realizations = vector<unsigned long>(0)); static double calculateRestrictionFrequencyObjective( const vector<RestrictionsDataCollector *>& restriction_data, vector<unsigned long> realizations = vector<unsigned long>(0)); static double calculateNetPresentCostInfrastructureObjective( const vector<UtilitiesDataCollector *>& utility_data, vector<unsigned long> realizations = vector<unsigned long>(0)); static double calculatePeakFinancialCostsObjective( const vector<UtilitiesDataCollector *>& utility_data, vector<unsigned long> realizations = vector<unsigned long>(0)); static double calculateWorseCaseCostsObjective( const vector<UtilitiesDataCollector *>& utility_data, vector<unsigned long> realizations = vector<unsigned long>(0)); }; #endif //TRIANGLEMODEL_OBJECTIVESCALCULATOR_H
34.435897
75
0.740134
[ "vector" ]
5bb938028c0dcdd394062e9814d1b83bf26ff6fc
42,290
c
C
xdebug/xdebug_var.c
miranetworks/symblog-test
0afb66b2d7dc0427e1a402a4478cd3f646f326a0
[ "MIT" ]
null
null
null
xdebug/xdebug_var.c
miranetworks/symblog-test
0afb66b2d7dc0427e1a402a4478cd3f646f326a0
[ "MIT" ]
null
null
null
xdebug/xdebug_var.c
miranetworks/symblog-test
0afb66b2d7dc0427e1a402a4478cd3f646f326a0
[ "MIT" ]
null
null
null
/* +----------------------------------------------------------------------+ | Xdebug | +----------------------------------------------------------------------+ | Copyright (c) 2002-2012 Derick Rethans | +----------------------------------------------------------------------+ | This source file is subject to version 1.0 of the Xdebug license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://xdebug.derickrethans.nl/license.php | | If you did not receive a copy of the Xdebug license and are unable | | to obtain it through the world-wide-web, please send a note to | | xdebug@derickrethans.nl so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Derick Rethans <derick@xdebug.org> | +----------------------------------------------------------------------+ */ #include "php.h" #include "ext/standard/php_string.h" #include "ext/standard/url.h" #include "zend.h" #include "zend_extensions.h" #include "php_xdebug.h" #include "xdebug_compat.h" #include "xdebug_private.h" #include "xdebug_mm.h" #include "xdebug_var.h" #include "xdebug_xml.h" ZEND_EXTERN_MODULE_GLOBALS(xdebug) char* xdebug_error_type(int type) { switch (type) { case E_ERROR: case E_CORE_ERROR: case E_COMPILE_ERROR: case E_USER_ERROR: return xdstrdup("Fatal error"); break; #if PHP_VERSION_ID >= 50200 case E_RECOVERABLE_ERROR: return xdstrdup("Catchable fatal error"); break; #endif case E_WARNING: case E_CORE_WARNING: case E_COMPILE_WARNING: case E_USER_WARNING: return xdstrdup("Warning"); break; case E_PARSE: return xdstrdup("Parse error"); break; case E_NOTICE: case E_USER_NOTICE: return xdstrdup("Notice"); break; case E_STRICT: return xdstrdup("Strict standards"); break; #if PHP_VERSION_ID >= 50300 case E_DEPRECATED: case E_USER_DEPRECATED: return xdstrdup("Deprecated"); break; #endif default: return xdstrdup("Unknown error"); break; } } /*************************************************************************************************************************************/ #define T(offset) (*(temp_variable *)((char *) Ts + offset)) zval *xdebug_get_zval(zend_execute_data *zdata, znode *node, temp_variable *Ts, int *is_var) { switch (node->op_type) { case IS_CONST: return &node->u.constant; break; case IS_TMP_VAR: *is_var = 1; return &T(node->u.var).tmp_var; break; case IS_VAR: *is_var = 1; if (T(node->u.var).var.ptr) { return T(node->u.var).var.ptr; } else { fprintf(stderr, "\nIS_VAR\n"); } break; case IS_CV: { zval **tmp; tmp = zend_get_compiled_variable_value(zdata, node->u.constant.value.lval); if (tmp) { return *tmp; } break; } case IS_UNUSED: fprintf(stderr, "\nIS_UNUSED\n"); break; default: fprintf(stderr, "\ndefault %d\n", node->op_type); break; } *is_var = 1; return NULL; } /***************************************************************************** ** PHP Variable related utility functions */ zval* xdebug_get_php_symbol(char* name, int name_length) { HashTable *st = NULL; zval **retval; TSRMLS_FETCH(); st = XG(active_symbol_table); if (st && st->nNumOfElements && zend_hash_find(st, name, name_length, (void **) &retval) == SUCCESS) { return *retval; } st = EG(active_op_array)->static_variables; if (st) { if (zend_hash_find(st, name, name_length, (void **) &retval) == SUCCESS) { return *retval; } } st = &EG(symbol_table); if (zend_hash_find(st, name, name_length, (void **) &retval) == SUCCESS) { return *retval; } return NULL; } char* xdebug_get_property_info(char *mangled_property, int mangled_len, char **property_name, char **class_name) { char *prop_name, *cls_name; #if PHP_VERSION_ID >= 50200 zend_unmangle_property_name(mangled_property, mangled_len - 1, &cls_name, &prop_name); #else zend_unmangle_property_name(mangled_property, &cls_name, &prop_name); #endif *property_name = prop_name; *class_name = cls_name; if (cls_name) { if (cls_name[0] == '*') { return "protected"; } else { return "private"; } } else { return "public"; } } xdebug_var_export_options* xdebug_var_export_options_from_ini(TSRMLS_D) { xdebug_var_export_options *options; options = xdmalloc(sizeof(xdebug_var_export_options)); options->max_children = XG(display_max_children); options->max_data = XG(display_max_data); options->max_depth = XG(display_max_depth); options->show_hidden = 0; if (options->max_children == -1) { options->max_children = 1048576; } else if (options->max_children < 1) { options->max_children = 1; } if (options->max_data == -1) { options->max_data = 1073741824; } else if (options->max_data < 1) { options->max_data = 1; } if (options->max_depth == -1) { options->max_depth = 4096; } else if (options->max_depth < 0) { options->max_depth = 0; } options->runtime = (xdebug_var_runtime_page*) xdmalloc((options->max_depth + 1) * sizeof(xdebug_var_runtime_page)); options->no_decoration = 0; return options; } xdebug_var_export_options xdebug_var_nolimit_options = { 1048576, 1048576, 64, 1, NULL, 0 }; xdebug_var_export_options* xdebug_var_get_nolimit_options(TSRMLS_D) { return &xdebug_var_nolimit_options; } /***************************************************************************** ** Normal variable printing routines */ static int xdebug_array_element_export(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { int level, debug_zval; xdebug_str *str; xdebug_var_export_options *options; #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 TSRMLS_FETCH(); #endif level = va_arg(args, int); str = va_arg(args, struct xdebug_str*); debug_zval = va_arg(args, int); options = va_arg(args, xdebug_var_export_options*); if (options->runtime[level].current_element_nr >= options->runtime[level].start_element_nr && options->runtime[level].current_element_nr < options->runtime[level].end_element_nr) { if (hash_key->nKeyLength==0) { /* numeric key */ xdebug_str_add(str, xdebug_sprintf("%ld => ", hash_key->h), 1); } else { /* string key */ int newlen = 0; char *tmp, *tmp2; tmp = php_str_to_str(hash_key->arKey, hash_key->nKeyLength, "'", 1, "\\'", 2, &newlen); tmp2 = php_str_to_str(tmp, newlen - 1, "\0", 1, "\\0", 2, &newlen); if (tmp) { efree(tmp); } xdebug_str_addl(str, "'", 1, 0); if (tmp2) { xdebug_str_addl(str, tmp2, newlen, 0); efree(tmp2); } xdebug_str_add(str, "' => ", 0); } xdebug_var_export(zv, str, level + 2, debug_zval, options TSRMLS_CC); xdebug_str_addl(str, ", ", 2, 0); } if (options->runtime[level].current_element_nr == options->runtime[level].end_element_nr) { xdebug_str_addl(str, "..., ", 5, 0); } options->runtime[level].current_element_nr++; return 0; } static int xdebug_object_element_export(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { int level, debug_zval; xdebug_str *str; xdebug_var_export_options *options; char *prop_name, *class_name, *modifier, *prop_class_name; #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 TSRMLS_FETCH(); #endif level = va_arg(args, int); str = va_arg(args, struct xdebug_str*); debug_zval = va_arg(args, int); options = va_arg(args, xdebug_var_export_options*); class_name = va_arg(args, char *); if (options->runtime[level].current_element_nr >= options->runtime[level].start_element_nr && options->runtime[level].current_element_nr < options->runtime[level].end_element_nr) { if (hash_key->nKeyLength != 0) { modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &prop_class_name); if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) { xdebug_str_add(str, xdebug_sprintf("%s $%s = ", modifier, prop_name), 1); } else { xdebug_str_add(str, xdebug_sprintf("%s ${%s}:%s = ", modifier, prop_class_name, prop_name), 1); } } xdebug_var_export(zv, str, level + 2, debug_zval, options TSRMLS_CC); xdebug_str_addl(str, "; ", 2, 0); } if (options->runtime[level].current_element_nr == options->runtime[level].end_element_nr) { xdebug_str_addl(str, "...; ", 5, 0); } options->runtime[level].current_element_nr++; return 0; } void xdebug_var_export(zval **struc, xdebug_str *str, int level, int debug_zval, xdebug_var_export_options *options TSRMLS_DC) { HashTable *myht; char* tmp_str; int tmp_len; if (!struc || !(*struc)) { return; } if (debug_zval) { xdebug_str_add(str, xdebug_sprintf("(refcount=%d, is_ref=%d)=", (*struc)->XDEBUG_REFCOUNT, (*struc)->XDEBUG_IS_REF), 1); } switch (Z_TYPE_PP(struc)) { case IS_BOOL: xdebug_str_add(str, xdebug_sprintf("%s", Z_LVAL_PP(struc) ? "TRUE" : "FALSE"), 1); break; case IS_NULL: xdebug_str_addl(str, "NULL", 4, 0); break; case IS_LONG: xdebug_str_add(str, xdebug_sprintf("%ld", Z_LVAL_PP(struc)), 1); break; case IS_DOUBLE: xdebug_str_add(str, xdebug_sprintf("%.*G", (int) EG(precision), Z_DVAL_PP(struc)), 1); break; case IS_STRING: tmp_str = php_addcslashes(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &tmp_len, 0, "'\\\0..\37", 6 TSRMLS_CC); if (options->no_decoration) { xdebug_str_add(str, tmp_str, 0); } else if (options->max_data == 0 || Z_STRLEN_PP(struc) <= options->max_data) { xdebug_str_add(str, xdebug_sprintf("'%s'", tmp_str), 1); } else { xdebug_str_addl(str, "'", 1, 0); xdebug_str_addl(str, xdebug_sprintf("%s", tmp_str), options->max_data, 1); xdebug_str_addl(str, "...'", 4, 0); } efree(tmp_str); break; case IS_ARRAY: myht = Z_ARRVAL_PP(struc); if (myht->nApplyCount < 1) { xdebug_str_addl(str, "array (", 7, 0); if (level <= options->max_depth) { options->runtime[level].current_element_nr = 0; options->runtime[level].start_element_nr = 0; options->runtime[level].end_element_nr = options->max_children; zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_array_element_export, 4, level, str, debug_zval, options); /* Remove the ", " at the end of the string */ if (myht->nNumOfElements > 0) { xdebug_str_chop(str, 2); } } else { xdebug_str_addl(str, "...", 3, 0); } xdebug_str_addl(str, ")", 1, 0); } else { xdebug_str_addl(str, "...", 3, 0); } break; case IS_OBJECT: myht = Z_OBJPROP_PP(struc); if (myht->nApplyCount < 1) { char *class_name; zend_uint class_name_len; zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC); xdebug_str_add(str, xdebug_sprintf("class %s { ", class_name), 1); if (level <= options->max_depth) { options->runtime[level].current_element_nr = 0; options->runtime[level].start_element_nr = 0; options->runtime[level].end_element_nr = options->max_children; zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_object_element_export, 5, level, str, debug_zval, options, class_name); /* Remove the ", " at the end of the string */ if (myht->nNumOfElements > 0) { xdebug_str_chop(str, 2); } } else { xdebug_str_addl(str, "...", 3, 0); } xdebug_str_addl(str, " }", 2, 0); efree(class_name); } else { xdebug_str_addl(str, "...", 3, 0); } break; case IS_RESOURCE: { char *type_name; type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); xdebug_str_add(str, xdebug_sprintf("resource(%ld) of type (%s)", Z_LVAL_PP(struc), type_name ? type_name : "Unknown"), 1); break; } default: xdebug_str_addl(str, "NULL", 4, 0); break; } } char* xdebug_get_zval_value(zval *val, int debug_zval, xdebug_var_export_options *options) { xdebug_str str = {0, 0, NULL}; int default_options = 0; TSRMLS_FETCH(); if (!options) { options = xdebug_var_export_options_from_ini(TSRMLS_C); default_options = 1; } xdebug_var_export(&val, (xdebug_str*) &str, 1, debug_zval, options TSRMLS_CC); if (default_options) { xdfree(options->runtime); xdfree(options); } return str.d; } static void xdebug_var_synopsis(zval **struc, xdebug_str *str, int level, int debug_zval, xdebug_var_export_options *options TSRMLS_DC) { HashTable *myht; if (!struc || !(*struc)) { return; } if (debug_zval) { xdebug_str_add(str, xdebug_sprintf("(refcount=%d, is_ref=%d)=", (*struc)->XDEBUG_REFCOUNT, (*struc)->XDEBUG_IS_REF), 1); } switch (Z_TYPE_PP(struc)) { case IS_BOOL: xdebug_str_addl(str, "bool", 4, 0); break; case IS_NULL: xdebug_str_addl(str, "null", 4, 0); break; case IS_LONG: xdebug_str_addl(str, "long", 4, 0); break; case IS_DOUBLE: xdebug_str_addl(str, "double", 6, 0); break; case IS_STRING: xdebug_str_add(str, xdebug_sprintf("string(%d)", Z_STRLEN_PP(struc)), 1); break; case IS_ARRAY: myht = Z_ARRVAL_PP(struc); xdebug_str_add(str, xdebug_sprintf("array(%d)", myht->nNumOfElements), 1); break; case IS_OBJECT: { char *class_name; zend_uint class_name_len; zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC); xdebug_str_add(str, xdebug_sprintf("class %s", class_name), 1); efree(class_name); break; } case IS_RESOURCE: { char *type_name; type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); xdebug_str_add(str, xdebug_sprintf("resource(%ld) of type (%s)", Z_LVAL_PP(struc), type_name ? type_name : "Unknown"), 1); break; } } } char* xdebug_get_zval_synopsis(zval *val, int debug_zval, xdebug_var_export_options *options) { xdebug_str str = {0, 0, NULL}; int default_options = 0; TSRMLS_FETCH(); if (!options) { options = xdebug_var_export_options_from_ini(TSRMLS_C); default_options = 1; } xdebug_var_synopsis(&val, (xdebug_str*) &str, 1, debug_zval, options TSRMLS_CC); if (default_options) { xdfree(options->runtime); xdfree(options); } return str.d; } /***************************************************************************** ** XML node printing routines */ #define XDEBUG_OBJECT_ITEM_TYPE_PROPERTY 1 #define XDEBUG_OBJECT_ITEM_TYPE_STATIC_PROPERTY 2 typedef struct { char type; char *name; int name_len; zval *zv; } xdebug_object_item; static void xdebug_hash_object_item_dtor(void *data) { xdebug_object_item *item = (xdebug_object_item *) data; xdfree(data); } static int object_item_add_to_merged_hash(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { HashTable *merged; int object_type; xdebug_object_item *item; merged = va_arg(args, HashTable*); object_type = va_arg(args, int); item = xdmalloc(sizeof(xdebug_object_item)); item->type = object_type; item->zv = *zv; item->name = hash_key->arKey; item->name_len = hash_key->nKeyLength; zend_hash_next_index_insert(merged, &item, sizeof(xdebug_object_item*), NULL); return 0; } static int xdebug_array_element_export_xml_node(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { int level; xdebug_xml_node *parent; xdebug_xml_node *node; xdebug_var_export_options *options; char *name = NULL, *parent_name = NULL; int name_len = 0; xdebug_str full_name = { 0, 0, NULL }; #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 TSRMLS_FETCH(); #endif level = va_arg(args, int); parent = va_arg(args, xdebug_xml_node*); parent_name = va_arg(args, char *); options = va_arg(args, xdebug_var_export_options*); if (options->runtime[level].current_element_nr >= options->runtime[level].start_element_nr && options->runtime[level].current_element_nr < options->runtime[level].end_element_nr) { node = xdebug_xml_node_init("property"); if (hash_key->nKeyLength != 0) { name = xdstrndup(hash_key->arKey, hash_key->nKeyLength); name_len = hash_key->nKeyLength - 1; if (parent_name) { xdebug_str_add(&full_name, parent_name, 0); xdebug_str_addl(&full_name, "['", 2, 0); xdebug_str_addl(&full_name, name, name_len, 0); xdebug_str_addl(&full_name, "']", 2, 0); } } else { name = xdebug_sprintf("%ld", hash_key->h); name_len = strlen(name); if (parent_name) { xdebug_str_add(&full_name, xdebug_sprintf("%s[%s]", parent_name, name), 1); } } xdebug_xml_add_attribute_exl(node, "name", 4, name, name_len, 0, 1); if (full_name.l) { xdebug_xml_add_attribute_exl(node, "fullname", 8, full_name.d, full_name.l, 0, 1); } xdebug_xml_add_attribute_ex(node, "address", xdebug_sprintf("%ld", (long) *zv), 0, 1); xdebug_xml_add_child(parent, node); xdebug_var_export_xml_node(zv, full_name.d, node, options, level + 1 TSRMLS_CC); } options->runtime[level].current_element_nr++; return 0; } static int xdebug_object_element_export_xml_node(xdebug_object_item **item XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { int level; xdebug_xml_node *parent; xdebug_xml_node *node; xdebug_var_export_options *options; char *prop_name, *modifier, *class_name, *prop_class_name; char *parent_name = NULL, *full_name = NULL; #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 TSRMLS_FETCH(); #endif level = va_arg(args, int); parent = va_arg(args, xdebug_xml_node*); full_name = parent_name = va_arg(args, char *); options = va_arg(args, xdebug_var_export_options*); class_name = va_arg(args, char *); if (options->runtime[level].current_element_nr >= options->runtime[level].start_element_nr && options->runtime[level].current_element_nr < options->runtime[level].end_element_nr) { if ((*item)->name_len != 0) { modifier = xdebug_get_property_info((*item)->name, (*item)->name_len, &prop_name, &prop_class_name); node = xdebug_xml_node_init("property"); if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) { xdebug_xml_add_attribute_ex(node, "name", xdstrdup(prop_name), 0, 1); } else { xdebug_xml_add_attribute_ex(node, "name", xdebug_sprintf("*%s*%s", prop_class_name, prop_name), 0, 1); } if (parent_name) { if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) { full_name = xdebug_sprintf("%s%s%s", parent_name, (*item)->type == XDEBUG_OBJECT_ITEM_TYPE_STATIC_PROPERTY ? "::" : "->", prop_name); } else { full_name = xdebug_sprintf("%s%s*%s*%s", parent_name, (*item)->type == XDEBUG_OBJECT_ITEM_TYPE_STATIC_PROPERTY ? "::" : "->", prop_class_name, prop_name); } xdebug_xml_add_attribute_ex(node, "fullname", full_name, 0, 1); } xdebug_xml_add_attribute_ex(node, "facet", xdebug_sprintf("%s%s", (*item)->type == XDEBUG_OBJECT_ITEM_TYPE_STATIC_PROPERTY ? "static " : "", modifier), 0, 1); xdebug_xml_add_attribute_ex(node, "address", xdebug_sprintf("%ld", (long) (*item)->zv), 0, 1); xdebug_xml_add_child(parent, node); xdebug_var_export_xml_node(&((*item)->zv), full_name, node, options, level + 1 TSRMLS_CC); } } options->runtime[level].current_element_nr++; return 0; } static char *prepare_variable_name(char *name) { char *tmp_name; tmp_name = xdebug_sprintf("%s%s", (name[0] == '$' || name[0] == ':') ? "" : "$", name); if (tmp_name[strlen(tmp_name) - 2] == ':' && tmp_name[strlen(tmp_name) - 1] == ':') { tmp_name[strlen(tmp_name) - 2] = '\0'; } return tmp_name; } void xdebug_attach_uninitialized_var(xdebug_xml_node *node, char *name) { xdebug_xml_node *contents = NULL; char *tmp_name; contents = xdebug_xml_node_init("property"); tmp_name = prepare_variable_name(name); xdebug_xml_add_attribute_ex(contents, "name", xdstrdup(tmp_name), 0, 1); xdebug_xml_add_attribute_ex(contents, "fullname", xdstrdup(tmp_name), 0, 1); xdfree(tmp_name); xdebug_xml_add_attribute(contents, "type", "uninitialized"); xdebug_xml_add_child(node, contents); } void xdebug_attach_static_var_with_contents(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { xdebug_xml_node *node; char *name = hash_key->arKey; char *modifier; xdebug_xml_node *contents = NULL; char *full_name; char *class_name; char *prop_name, *prop_class_name; xdebug_var_export_options *options; node = va_arg(args, xdebug_xml_node *); options = va_arg(args, xdebug_var_export_options *); class_name = va_arg(args, char *); modifier = xdebug_get_property_info(name, hash_key->nKeyLength, &prop_name, &prop_class_name); if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) { contents = xdebug_get_zval_value_xml_node_ex(prop_name, *zv, XDEBUG_VAR_TYPE_STATIC, options TSRMLS_CC); } else{ char *priv_name = xdebug_sprintf("*%s*%s", prop_class_name, prop_name); contents = xdebug_get_zval_value_xml_node_ex(priv_name, *zv, XDEBUG_VAR_TYPE_STATIC, options TSRMLS_CC); xdfree(priv_name); } if (contents) { xdebug_xml_add_attribute_ex(contents, "facet", xdebug_sprintf("static %s", modifier), 0, 1); xdebug_xml_add_child(node, contents); } else { xdebug_attach_uninitialized_var(node, name); } } int xdebug_attach_static_vars(xdebug_xml_node *node, xdebug_var_export_options *options, zend_class_entry *ce TSRMLS_DC) { HashTable *static_members = CE_STATIC_MEMBERS(ce); xdebug_xml_node *static_container; static_container = xdebug_xml_node_init("property"); xdebug_xml_add_attribute(static_container, "name", "::"); xdebug_xml_add_attribute(static_container, "fullname", "::"); xdebug_xml_add_attribute(static_container, "type", "object"); xdebug_xml_add_attribute_ex(static_container, "classname", xdstrdup(ce->name), 0, 1); xdebug_xml_add_attribute(static_container, "children", static_members->nNumOfElements > 0 ? "1" : "0"); xdebug_xml_add_attribute_ex(static_container, "numchildren", xdebug_sprintf("%d", zend_hash_num_elements(static_members)), 0, 1); zend_hash_apply_with_arguments(static_members XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_attach_static_var_with_contents, 3, static_container, options, ce->name); xdebug_xml_add_child(node, static_container); } void xdebug_var_export_xml_node(zval **struc, char *name, xdebug_xml_node *node, xdebug_var_export_options *options, int level TSRMLS_DC) { HashTable *myht; char *class_name; zend_uint class_name_len; switch (Z_TYPE_PP(struc)) { case IS_BOOL: xdebug_xml_add_attribute(node, "type", "bool"); xdebug_xml_add_text(node, xdebug_sprintf("%d", Z_LVAL_PP(struc))); break; case IS_NULL: xdebug_xml_add_attribute(node, "type", "null"); break; case IS_LONG: xdebug_xml_add_attribute(node, "type", "int"); xdebug_xml_add_text(node, xdebug_sprintf("%ld", Z_LVAL_PP(struc))); break; case IS_DOUBLE: xdebug_xml_add_attribute(node, "type", "float"); xdebug_xml_add_text(node, xdebug_sprintf("%.*G", (int) EG(precision), Z_DVAL_PP(struc))); break; case IS_STRING: xdebug_xml_add_attribute(node, "type", "string"); if (options->max_data == 0 || Z_STRLEN_PP(struc) <= options->max_data) { xdebug_xml_add_text_encodel(node, xdstrndup(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc)), Z_STRLEN_PP(struc)); } else { xdebug_xml_add_text_encodel(node, xdstrndup(Z_STRVAL_PP(struc), options->max_data), options->max_data); } xdebug_xml_add_attribute_ex(node, "size", xdebug_sprintf("%d", Z_STRLEN_PP(struc)), 0, 1); break; case IS_ARRAY: myht = Z_ARRVAL_PP(struc); xdebug_xml_add_attribute(node, "type", "array"); xdebug_xml_add_attribute(node, "children", myht->nNumOfElements > 0?"1":"0"); if (myht->nApplyCount < 1) { xdebug_xml_add_attribute_ex(node, "numchildren", xdebug_sprintf("%d", myht->nNumOfElements), 0, 1); if (level < options->max_depth) { xdebug_xml_add_attribute_ex(node, "page", xdebug_sprintf("%d", options->runtime[level].page), 0, 1); xdebug_xml_add_attribute_ex(node, "pagesize", xdebug_sprintf("%d", options->max_children), 0, 1); options->runtime[level].current_element_nr = 0; if (level == 0) { options->runtime[level].start_element_nr = options->max_children * options->runtime[level].page; options->runtime[level].end_element_nr = options->max_children * (options->runtime[level].page + 1); } else { options->runtime[level].start_element_nr = 0; options->runtime[level].end_element_nr = options->max_children; } zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_array_element_export_xml_node, 4, level, node, name, options); } } else { xdebug_xml_add_attribute(node, "recursive", "1"); } break; case IS_OBJECT: { HashTable *merged_hash; zend_class_entry *ce; ALLOC_HASHTABLE(merged_hash); zend_hash_init(merged_hash, 128, NULL, NULL, 0); zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC); ce = zend_fetch_class(class_name, strlen(class_name), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); /* Adding static properties */ zend_hash_apply_with_arguments(CE_STATIC_MEMBERS(ce) XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) object_item_add_to_merged_hash, 2, merged_hash, (int) XDEBUG_OBJECT_ITEM_TYPE_STATIC_PROPERTY); /* Adding normal properties */ myht = Z_OBJPROP_PP(struc); if (myht) { zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) object_item_add_to_merged_hash, 2, merged_hash, (int) XDEBUG_OBJECT_ITEM_TYPE_PROPERTY); } xdebug_xml_add_attribute(node, "type", "object"); xdebug_xml_add_attribute_ex(node, "classname", xdstrdup(class_name), 0, 1); xdebug_xml_add_attribute(node, "children", merged_hash->nNumOfElements ? "1" : "0"); if (merged_hash->nApplyCount < 1) { xdebug_xml_add_attribute_ex(node, "numchildren", xdebug_sprintf("%d", zend_hash_num_elements(merged_hash)), 0, 1); if (level < options->max_depth) { xdebug_xml_add_attribute_ex(node, "page", xdebug_sprintf("%d", options->runtime[level].page), 0, 1); xdebug_xml_add_attribute_ex(node, "pagesize", xdebug_sprintf("%d", options->max_children), 0, 1); options->runtime[level].current_element_nr = 0; if (level == 0) { options->runtime[level].start_element_nr = options->max_children * options->runtime[level].page; options->runtime[level].end_element_nr = options->max_children * (options->runtime[level].page + 1); } else { options->runtime[level].start_element_nr = 0; options->runtime[level].end_element_nr = options->max_children; } zend_hash_apply_with_arguments(merged_hash XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_object_element_export_xml_node, 5, level, node, name, options, class_name); } // } else { // xdebug_xml_add_attribute(node, "recursive", "1"); // } } efree(class_name); break; } case IS_RESOURCE: { char *type_name; xdebug_xml_add_attribute(node, "type", "resource"); type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); xdebug_xml_add_text(node, xdebug_sprintf("resource id='%ld' type='%s'", Z_LVAL_PP(struc), type_name ? type_name : "Unknown")); break; } default: xdebug_xml_add_attribute(node, "type", "null"); break; } } xdebug_xml_node* xdebug_get_zval_value_xml_node_ex(char *name, zval *val, int var_type, xdebug_var_export_options *options TSRMLS_DC) { xdebug_xml_node *node; char *short_name = NULL; char *full_name = NULL; node = xdebug_xml_node_init("property"); if (name) { switch (var_type) { case XDEBUG_VAR_TYPE_NORMAL: { char *tmp_name; tmp_name = prepare_variable_name(name); short_name = xdstrdup(tmp_name); full_name = xdstrdup(tmp_name); xdfree(tmp_name); } break; case XDEBUG_VAR_TYPE_STATIC: short_name = xdebug_sprintf("::%s", name); full_name = xdebug_sprintf("::%s", name); break; } xdebug_xml_add_attribute_ex(node, "name", short_name, 0, 1); xdebug_xml_add_attribute_ex(node, "fullname", full_name, 0, 1); } xdebug_xml_add_attribute_ex(node, "address", xdebug_sprintf("%ld", (long) val), 0, 1); xdebug_var_export_xml_node(&val, full_name, node, options, 0 TSRMLS_CC); return node; } /***************************************************************************** ** Fancy variable printing routines */ #define COLOR_POINTER "#888a85" #define COLOR_BOOL "#75507b" #define COLOR_LONG "#4e9a06" #define COLOR_NULL "#3465a4" #define COLOR_DOUBLE "#f57900" #define COLOR_STRING "#cc0000" #define COLOR_EMPTY "#888a85" #define COLOR_ARRAY "#ce5c00" #define COLOR_OBJECT "#8f5902" #define COLOR_RESOURCE "#2e3436" static int xdebug_array_element_export_fancy(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { int level, debug_zval, newlen; char *tmp_str; xdebug_str *str; xdebug_var_export_options *options; #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 TSRMLS_FETCH(); #endif level = va_arg(args, int); str = va_arg(args, struct xdebug_str*); debug_zval = va_arg(args, int); options = va_arg(args, xdebug_var_export_options*); if (options->runtime[level].current_element_nr >= options->runtime[level].start_element_nr && options->runtime[level].current_element_nr < options->runtime[level].end_element_nr) { xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1); if (hash_key->nKeyLength==0) { /* numeric key */ xdebug_str_add(str, xdebug_sprintf("%ld <font color='%s'>=&gt;</font> ", hash_key->h, COLOR_POINTER), 1); } else { /* string key */ xdebug_str_addl(str, "'", 1, 0); tmp_str = xdebug_xmlize(hash_key->arKey, hash_key->nKeyLength - 1, &newlen); xdebug_str_addl(str, tmp_str, newlen, 0); efree(tmp_str); xdebug_str_add(str, xdebug_sprintf("' <font color='%s'>=&gt;</font> ", COLOR_POINTER), 1); } xdebug_var_export_fancy(zv, str, level + 1, debug_zval, options TSRMLS_CC); } if (options->runtime[level].current_element_nr == options->runtime[level].end_element_nr) { xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1); xdebug_str_addl(str, "<i>more elements...</i>\n", 24, 0); } options->runtime[level].current_element_nr++; return 0; } static int xdebug_object_element_export_fancy(zval **zv XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { int level, debug_zval; xdebug_str *str; xdebug_var_export_options *options; char *key; char *prop_name, *class_name, *modifier, *prop_class_name; #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300 TSRMLS_FETCH(); #endif level = va_arg(args, int); str = va_arg(args, struct xdebug_str*); debug_zval = va_arg(args, int); options = va_arg(args, xdebug_var_export_options*); class_name = va_arg(args, char *); if (options->runtime[level].current_element_nr >= options->runtime[level].start_element_nr && options->runtime[level].current_element_nr < options->runtime[level].end_element_nr) { xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1); key = hash_key->arKey; if (hash_key->nKeyLength != 0) { modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &prop_class_name); if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) { xdebug_str_add(str, xdebug_sprintf("<i>%s</i> '%s' <font color='%s'>=&gt;</font> ", modifier, prop_name, COLOR_POINTER), 1); } else { xdebug_str_add(str, xdebug_sprintf("<i>%s</i> '%s' <small>(%s)</small> <font color='%s'>=&gt;</font> ", modifier, prop_name, prop_class_name, COLOR_POINTER), 1); } } xdebug_var_export_fancy(zv, str, level + 1, debug_zval, options TSRMLS_CC); } if (options->runtime[level].current_element_nr == options->runtime[level].end_element_nr) { xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1); xdebug_str_addl(str, "<i>more elements...</i>\n", 24, 0); } options->runtime[level].current_element_nr++; return 0; } void xdebug_var_export_fancy(zval **struc, xdebug_str *str, int level, int debug_zval, xdebug_var_export_options *options TSRMLS_DC) { HashTable *myht; char* tmp_str; int newlen; if (debug_zval) { xdebug_str_add(str, xdebug_sprintf("<i>(refcount=%d, is_ref=%d)</i>,", (*struc)->XDEBUG_REFCOUNT, (*struc)->XDEBUG_IS_REF), 1); } else { if ((*struc)->XDEBUG_IS_REF) { xdebug_str_add(str, "&amp;", 0); } } switch (Z_TYPE_PP(struc)) { case IS_BOOL: xdebug_str_add(str, xdebug_sprintf("<small>boolean</small> <font color='%s'>%s</font>", COLOR_BOOL, Z_LVAL_PP(struc) ? "true" : "false"), 1); break; case IS_NULL: xdebug_str_add(str, xdebug_sprintf("<font color='%s'>null</font>", COLOR_NULL), 1); break; case IS_LONG: xdebug_str_add(str, xdebug_sprintf("<small>int</small> <font color='%s'>%ld</font>", COLOR_LONG, Z_LVAL_PP(struc)), 1); break; case IS_DOUBLE: xdebug_str_add(str, xdebug_sprintf("<small>float</small> <font color='%s'>%.*G</font>", COLOR_DOUBLE, (int) EG(precision), Z_DVAL_PP(struc)), 1); break; case IS_STRING: xdebug_str_add(str, xdebug_sprintf("<small>string</small> <font color='%s'>'", COLOR_STRING), 1); if (Z_STRLEN_PP(struc) > options->max_data) { tmp_str = xdebug_xmlize(Z_STRVAL_PP(struc), options->max_data, &newlen); xdebug_str_addl(str, tmp_str, newlen, 0); efree(tmp_str); xdebug_str_addl(str, "'...</font>", 11, 0); } else { tmp_str = xdebug_xmlize(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc), &newlen); xdebug_str_addl(str, tmp_str, newlen, 0); efree(tmp_str); xdebug_str_addl(str, "'</font>", 8, 0); } xdebug_str_add(str, xdebug_sprintf(" <i>(length=%d)</i>", Z_STRLEN_PP(struc)), 1); break; case IS_ARRAY: myht = Z_ARRVAL_PP(struc); xdebug_str_add(str, xdebug_sprintf("\n%*s", (level - 1) * 4, ""), 1); if (myht->nApplyCount < 1) { xdebug_str_addl(str, "<b>array</b>\n", 13, 0); if (level <= options->max_depth) { if (myht->nNumOfElements) { options->runtime[level].current_element_nr = 0; options->runtime[level].start_element_nr = 0; options->runtime[level].end_element_nr = options->max_children; zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_array_element_export_fancy, 4, level, str, debug_zval, options); } else { xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1); xdebug_str_add(str, xdebug_sprintf("<i><font color='%s'>empty</font></i>\n", COLOR_EMPTY), 1); } } else { xdebug_str_add(str, xdebug_sprintf("%*s...\n", (level * 4) - 2, ""), 1); } } else { xdebug_str_addl(str, "<i>&</i><b>array</b>\n", 21, 0); } break; case IS_OBJECT: myht = Z_OBJPROP_PP(struc); xdebug_str_add(str, xdebug_sprintf("\n%*s", (level - 1) * 4, ""), 1); if (myht->nApplyCount < 1) { xdebug_str_add(str, xdebug_sprintf("<b>object</b>(<i>%s</i>)", Z_OBJCE_PP(struc)->name), 1); xdebug_str_add(str, xdebug_sprintf("[<i>%d</i>]\n", Z_OBJ_HANDLE_PP(struc)), 1); if (level <= options->max_depth) { options->runtime[level].current_element_nr = 0; options->runtime[level].start_element_nr = 0; options->runtime[level].end_element_nr = options->max_children; zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_object_element_export_fancy, 5, level, str, debug_zval, options, Z_OBJCE_PP(struc)->name); } else { xdebug_str_add(str, xdebug_sprintf("%*s...\n", (level * 4) - 2, ""), 1); } } else { xdebug_str_add(str, xdebug_sprintf("<i>&</i><b>object</b>(<i>%s</i>)", Z_OBJCE_PP(struc)->name), 1); xdebug_str_add(str, xdebug_sprintf("[<i>%d</i>]\n", Z_OBJ_HANDLE_PP(struc)), 1); } break; case IS_RESOURCE: { char *type_name; type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); xdebug_str_add(str, xdebug_sprintf("<b>resource</b>(<i>%ld</i><font color='%s'>,</font> <i>%s</i>)", Z_LVAL_PP(struc), COLOR_RESOURCE, type_name ? type_name : "Unknown"), 1); break; } default: xdebug_str_add(str, xdebug_sprintf("<font color='%s'>null</font>", COLOR_NULL), 0); break; } if (Z_TYPE_PP(struc) != IS_ARRAY && Z_TYPE_PP(struc) != IS_OBJECT) { xdebug_str_addl(str, "\n", 1, 0); } } char* xdebug_get_zval_value_fancy(char *name, zval *val, int *len, int debug_zval, xdebug_var_export_options *options TSRMLS_DC) { xdebug_str str = {0, 0, NULL}; int default_options = 0; if (!options) { options = xdebug_var_export_options_from_ini(TSRMLS_C); default_options = 1; } xdebug_str_addl(&str, "<pre class='xdebug-var-dump' dir='ltr'>", 39, 0); xdebug_var_export_fancy(&val, (xdebug_str*) &str, 1, debug_zval, options TSRMLS_CC); xdebug_str_addl(&str, "</pre>", 6, 0); if (default_options) { xdfree(options->runtime); xdfree(options); } *len = str.l; return str.d; } static void xdebug_var_synopsis_fancy(zval **struc, xdebug_str *str, int level, int debug_zval, xdebug_var_export_options *options TSRMLS_DC) { HashTable *myht; if (debug_zval) { xdebug_str_add(str, xdebug_sprintf("<i>(refcount=%d, is_ref=%d)</i>,", (*struc)->XDEBUG_REFCOUNT, (*struc)->XDEBUG_IS_REF), 1); } switch (Z_TYPE_PP(struc)) { case IS_BOOL: xdebug_str_add(str, xdebug_sprintf("<font color='%s'>bool</font>", COLOR_BOOL), 1); break; case IS_NULL: xdebug_str_add(str, xdebug_sprintf("<font color='%s'>null</font>", COLOR_NULL), 1); break; case IS_LONG: xdebug_str_add(str, xdebug_sprintf("<font color='%s'>long</font>", COLOR_LONG), 1); break; case IS_DOUBLE: xdebug_str_add(str, xdebug_sprintf("<font color='%s'>double</font>", COLOR_DOUBLE), 1); break; case IS_STRING: xdebug_str_add(str, xdebug_sprintf("<font color='%s'>string(%d)</font>", COLOR_STRING, Z_STRLEN_PP(struc)), 1); break; case IS_ARRAY: myht = Z_ARRVAL_PP(struc); xdebug_str_add(str, xdebug_sprintf("<font color='%s'>array(%d)</font>", COLOR_ARRAY, myht->nNumOfElements), 1); break; case IS_OBJECT: xdebug_str_add(str, xdebug_sprintf("<font color='%s'>object(%s)", COLOR_OBJECT, Z_OBJCE_PP(struc)->name), 1); xdebug_str_add(str, xdebug_sprintf("[%d]", Z_OBJ_HANDLE_PP(struc)), 1); xdebug_str_addl(str, "</font>", 7, 0); break; case IS_RESOURCE: { char *type_name; type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC); xdebug_str_add(str, xdebug_sprintf("<font color='%s'>resource(%ld, %s)</font>", COLOR_RESOURCE, Z_LVAL_PP(struc), type_name ? type_name : "Unknown"), 1); break; } } } char* xdebug_get_zval_synopsis_fancy(char *name, zval *val, int *len, int debug_zval, xdebug_var_export_options *options TSRMLS_DC) { xdebug_str str = {0, 0, NULL}; int default_options = 0; if (!options) { options = xdebug_var_export_options_from_ini(TSRMLS_C); default_options = 1; } xdebug_var_synopsis_fancy(&val, (xdebug_str*) &str, 1, debug_zval, options TSRMLS_CC); if (default_options) { xdfree(options->runtime); xdfree(options); } *len = str.l; return str.d; } /***************************************************************************** ** XML encoding function */ char* xdebug_xmlize(char *string, int len, int *newlen) { char *tmp; char *tmp2; if (len) { tmp = php_str_to_str(string, len, "&", 1, "&amp;", 5, &len); tmp2 = php_str_to_str(tmp, len, ">", 1, "&gt;", 4, &len); efree(tmp); tmp = php_str_to_str(tmp2, len, "<", 1, "&lt;", 4, &len); efree(tmp2); tmp2 = php_str_to_str(tmp, len, "\"", 1, "&quot;", 6, &len); efree(tmp); tmp = php_str_to_str(tmp2, len, "'", 1, "&#39;", 5, &len); efree(tmp2); tmp2 = php_str_to_str(tmp, len, "\n", 1, "&#10;", 5, &len); efree(tmp); tmp = php_str_to_str(tmp2, len, "\0", 1, "&#0;", 4, newlen); efree(tmp2); return tmp; } else { *newlen = len; return estrdup(string); } } /***************************************************************************** ** Function name printing function */ char* xdebug_show_fname(xdebug_func f, int html, int flags TSRMLS_DC) { char *tmp; switch (f.type) { case XFUNC_NORMAL: { zend_function *zfunc; if (PG(html_errors) && EG(function_table) && zend_hash_find(EG(function_table), f.function, strlen(f.function) + 1, (void**) &zfunc) == SUCCESS) { if (html && zfunc->type == ZEND_INTERNAL_FUNCTION) { return xdebug_sprintf("<a href='%s/%s' target='_new'>%s</a>\n", XG(manual_url), f.function, f.function); } else { return xdstrdup(f.function); } } else { return xdstrdup(f.function); } break; } case XFUNC_NEW: if (!f.class) { f.class = "?"; } if (!f.function) { f.function = "?"; } tmp = xdmalloc(strlen(f.class) + 4 + 1); sprintf(tmp, "new %s", f.class); return tmp; break; case XFUNC_STATIC_MEMBER: if (!f.class) { f.class = "?"; } if (!f.function) { f.function = "?"; } tmp = xdmalloc(strlen(f.function) + strlen(f.class) + 2 + 1); sprintf(tmp, "%s::%s", f.class, f.function); return tmp; break; case XFUNC_MEMBER: if (!f.class) { f.class = "?"; } if (!f.function) { f.function = "?"; } tmp = xdmalloc(strlen(f.function) + strlen(f.class) + 2 + 1); sprintf(tmp, "%s->%s", f.class, f.function); return tmp; break; case XFUNC_EVAL: return xdstrdup("eval"); break; case XFUNC_INCLUDE: return xdstrdup("include"); break; case XFUNC_INCLUDE_ONCE: return xdstrdup("include_once"); break; case XFUNC_REQUIRE: return xdstrdup("require"); break; case XFUNC_REQUIRE_ONCE: return xdstrdup("require_once"); break; default: return xdstrdup("{unknown}"); } }
32.555812
205
0.670371
[ "object" ]
5bbd7de217ca092eaf5b6f67e96c7850917c487c
15,977
c
C
cmds/feats/i/_impale.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
null
null
null
cmds/feats/i/_impale.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
null
null
null
cmds/feats/i/_impale.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
null
null
null
#include <std.h> #include <daemons.h> inherit FEAT; #define FEATTIMER 35 int in_shapeshift; void create() { ::create(); feat_type("instant"); feat_category("TwoHandedWeapons"); feat_name("impale"); feat_syntax("impale TARGET"); feat_prereq("Sweeping Blow, Blade block or Parry"); feat_desc("The Impale feat has a chance of impaling your target or staggering them back into another attacker. Both targets will take damage and have a chance to be stunned. If used without an argument this feat will pick up a random attacker. Be aware that this power affects multiple targets. A druid with the 'mastery of fang and claw' feat may also use this feat while in dragon form, even if it has not been purchased directly."); set_save("fort"); set_required_for(({ "light weapon", "strength of arm" })); } int allow_shifted() { return 0; } int prerequisites(object ob) { if (!objectp(ob)) { return 0; } if (!FEATS_D->has_feat(ob, "blade block") && !FEATS_D->has_feat(ob, "parry")) { dest_effect(); return 0; } if (!FEATS_D->has_feat(ob, "sweepingblow")) { dest_effect(); return 0; } return ::prerequisites(ob); } int cmd_impale(string str) { object feat; if (!objectp(TP)) { return 0; } feat = new(base_name(TO)); feat->setup_feat(TP, str); return 1; } void execute_feat() { object* weapons; string type; mapping tempmap; ::execute_feat(); if (!objectp(caster)) { dest_effect(); return; } tempmap = caster->query_property("using impale"); if (!objectp(target)) { object* attackers = caster->query_attackers(); if (mapp(tempmap)) { attackers = filter_array(attackers, (: $2[$1] < time() :), tempmap); } if (!sizeof(attackers)) { tell_object(caster, "%^BOLD%^Nobody to impale.%^RESET%^"); dest_effect(); return; } target = attackers[random(sizeof(attackers))]; } if ((int)caster->query_property("using instant feat")) { tell_object(caster, "You are already in the middle of using a feat!"); dest_effect(); return; } weapons = caster->query_wielded(); if (caster->query_property("shapeshifted") && !caster->query_property("altered")) { in_shapeshift = 1; }else { in_shapeshift = 0; } if (!in_shapeshift) { if (!caster->validate_combat_stance("two hander") || !sizeof(weapons)) { tell_object(caster, "You need to be wielding a two handed weapon to use this feat."); dest_effect(); return; } if (weapons[0]->is_lrweapon()) { tell_object(caster, "That weapon is not designed for such an attack."); dest_effect(); return; } } if (mapp(tempmap)) { if (tempmap[target] > time()) { tell_object(caster, "That target is still wary of such an attack!"); dest_effect(); return; } } if (!objectp(target) || !present(target, place)) { tell_object(caster, "You don't have a target!"); dest_effect(); return; } if (target == caster) { tell_object(caster, "Impale yourself? You would have to be as dumb as an ogre to do that!"); dest_effect(); return; } if (in_shapeshift) { tell_object(caster, "%^BOLD%^%^BLACK%^You rush and impale " + target->QCN + " onto your claws!"); } else { tell_object(caster, "%^BOLD%^%^BLACK%^You step back and quickly thrust your weapon at " + target->QCN + " with all of your might!%^RESET%^"); tell_object(target, "%^BOLD%^%^BLACK%^" + caster->QCN + " steps back and quickly thrusts " + caster->QP + " weapon at you with all of " + caster->QP + " might!%^RESET%^"); tell_room(place, "%^BOLD%^%^BLACK%^" + caster->QCN + " steps back and quickly thrusts " + caster->QP + " weapon at " + target->QCN + " with all of " + caster->QP + " might!%^RESET%^", ({ caster, target })); } caster->use_stamina(roll_dice(1, 6)); caster->set_property("using instant feat", 1); spell_kill(target, caster); return; } void execute_attack() { object* weapons, * attackers, * okattackers, target_two; string type, * keyz, theweapon; int i, dam, mod, enchant, timerz, mult, reaping, diff, res; mapping tempmap, newmap; if (!objectp(caster)) { dest_effect(); return; } caster->remove_property("using instant feat"); ::execute_attack(); weapons = caster->query_wielded(); if (caster->query_property("shapeshifted") && !caster->query_property("altered")) { in_shapeshift = 1; }else { in_shapeshift = 0; } if (!in_shapeshift) { if (sizeof(weapons) < 2) { tell_object(caster, "You need to be wielding a two handed weapon to use this feat!"); dest_effect(); return; } if (weapons[0] != weapons[1]) { tell_object(caster, "You need to be wielding a two handed weapon to use this feat!"); dest_effect(); return; } if (weapons[0]->is_lrweapon()) { tell_object(caster, "That weapon is not designed for such an attack."); dest_effect(); return; } } if (!objectp(target) || !present(target, place)) { tell_object(caster, "Your target is no longer here!"); dest_effect(); return; } if (in_shapeshift) { type = "blunt"; }else { type = weapons[0]->query_type(); } if (!stringp(type) || !type || type == "") { type = "sharp"; } if (strsrch(type, "slash") == -1 && strsrch(type, "pierc" == -1)) { type = "blunt"; }else { type = "sharp"; } if (sizeof(weapons)) { enchant = (int)weapons[0]->query_property("enchantment"); }else { enchant = 0; } tempmap = caster->query_property("using impale"); // adding per-target tracking. -N, 9/10. if (!mapp(tempmap)) { tempmap = ([]); } if (tempmap[target]) { map_delete(tempmap, target); } attackers = (object*)caster->query_attackers(); okattackers = ({}); if (sizeof(attackers)) { for (i = 0; i < sizeof(attackers); i++) { if (!objectp(attackers[i])) { continue; } if (attackers[i] == target) { continue; } if (tempmap[attackers[i]] > time()) { continue; } okattackers += ({ attackers[i] }); break; } } if (sizeof(okattackers)) { target_two = okattackers[0]; // pick up only attackers who have not been impaled. -N, 9/10. } newmap = ([]); keyz = keys(tempmap); if (sizeof(keyz)) { for (i = 0; i < sizeof(keyz); i++) { if (objectp(keyz[i])) { newmap += ([ keyz[i] : tempmap[keyz[i]] ]); } } } timerz = time() + FEATTIMER; newmap += ([ target:timerz ]); delay_subject_msg(target, FEATTIMER, "%^BOLD%^%^WHITE%^" + target->QCN + " can be %^CYAN%^impaled%^WHITE%^ again.%^RESET%^"); caster->remove_property("using impale"); caster->set_property("using impale", newmap); if (!(res = thaco(target, enchant))) { tell_object(caster, "%^BOLD%^%^MAGENTA%^" + target->QCN + " sidesteps your thrust at the " "last instant, leaving you open to attack!%^RESET%^"); tell_object(target, "%^BOLD%^%^MAGENTA%^You sidestep " + caster->QCN + "'s attack at the " "last instant, leaving " + caster->QO + " open to attack!%^RESET%^"); tell_room(place, "%^BOLD%^%^MAGENTA%^" + target->QCN + " sidesteps " + caster->QCN + "'s attack " "at the last instant, leaving " + caster->QP + " open to attack!%^RESET%^", ({ caster, target })); caster->set_paralyzed(roll_dice(1, 6), "%^YELLOW%^You are trying to get back into " "position!%^RESET%^"); dest_effect(); return; }else if (res == -1) { if (stringp(caster->query("featMiss"))) { tell_object(caster, caster->query("featMiss") + " " + query_feat_name() + "!"); caster->delete("featMiss"); }else { tell_object(caster, "%^RED%^" + target->QCN + " is totally unaffected!%^RESET%^"); tell_room(place, "%^RED%^" + target->QCN + " is totally unaffected!%^RESET%^", ({ target, caster })); } dest_effect(); return; } mult = 6; if (FEATS_D->usable_feat(caster, "the reaping")) { mult = 10; } // picking up 12 as a benchmark for druid shift, two-hand sword equiv if (sizeof(weapons)) { dam = weapons[0]->query_wc(); }else { dam = 12; } mod = BONUS_D->query_stat_bonus(caster, "strength"); //dam = ((clevel - 1) / 10 + 1) * (dam / 2); //let it scale properly in 10-level blocks. -N, 9/10 dam += clevel; dam = roll_dice(dam, mult) + mod + caster->query_damage_bonus(); if (!in_shapeshift) { theweapon = weapons[0]->query_short(); }else { theweapon = "body"; } switch (type) { case "sharp": tell_object(caster, "%^BOLD%^%^RED%^You impale " + target->QCN + " with your " + theweapon + ", " "running " + target->QO + " through violently!%^RESET%^"); tell_object(target, "%^BOLD%^%^RED%^" + caster->QCN + " impales you with " + caster->QP + " " "" + theweapon + ", running you through violently!%^RESET%^"); tell_room(place, "%^BOLD%^%^RED%^" + caster->QCN + " impales " + target->QCN + " with " + caster->QP + " " "" + theweapon + ", running " + target->QO + " through violently!%^RESET%^", ({ target, caster })); break; case "blunt": tell_object(caster, "%^BOLD%^%^BLUE%^You slam your " + theweapon + " into " "" + target->QCN + " brutally, staggering " + target->QO + " backwards!%^RESET%^"); tell_object(target, "%^BOLD%^%^BLUE%^" + caster->QCN + " slams " + caster->QP + " " "" + theweapon + " into you, staggering you backwards!%^RESET%^"); tell_room(place, "%^BOLD%^%^BLUE%^" + caster->QCN + " slams " + caster->QP + " " "" + theweapon + " into " + target->QCN + ", staggering " + target->QP + " " "backwards!%^RESET%^", ({ target, caster })); break; } if (!do_save(target, mod)) { tell_object(caster, "%^BOLD%^%^GREEN%^Your attack leaves " + target->QCN + " stunned and " "unable to move!%^RESET%^"); tell_object(target, "%^BOLD%^%^GREEN%^" + caster->QCN + "'s attack leaves you stunned and " "unable to move!%^RESET%^"); tell_room(place, "%^BOLD%^%^GREEN%^" + caster->QCN + "'s attack leaves " + target->QCN + " stunned " "and unable to move!%^RESET%^", ({ target, caster })); target->set_paralyzed(roll_dice(2, 4), "%^YELLOW%^You are struggling to move!%^RESET%^"); } if (objectp(target_two)) { switch (type) { case "sharp": tell_object(caster, "%^BOLD%^%^YELLOW%^Your " + theweapon + " penetrates " "all the way through " + target->QCN + " and hits, " + target_two->QCN + "!%^RESET%^"); tell_object(target_two, "%^BOLD%^%^YELLOW%^" + caster->QCN + "'s " + theweapon + " " "penetrates all the way through " + target->QCN + " and hits you!"); tell_object(target, "%^BOLD%^%^YELLOW%^" + caster->QCN + "'s " + theweapon + " " "penetrates all the way through you and hits " + target_two->QCN + "!%^RESET%^"); tell_room(place, "%^BOLD%^%^YELLOW%^" + caster->QCN + "'s " + theweapon + " " "penetrates all the way through " + target->QCN + " and hits " + target_two->QCN + "!%^RESET%^", ({ target, caster, target_two })); break; case "blunt": tell_object(caster, "%^BOLD%^%^CYAN%^Your attack staggers " + target->QCN + " back, slamming " "" + target->QO + " into " + target_two->QCN + "!%^RESET%^"); tell_object(target, "%^BOLD%^%^CYAN%^" + caster->QCN + "'s attack staggers you back into " "" + target_two->QCN + "!%^RESET%^"); tell_object(target_two, "%^BOLD%^%^CYAN%^" + caster->QCN + "'s attack staggers " + target->QCN + " " "backwards into you!%^RESET%^"); tell_room(place, "%^BOLD%^%^CYAN%^" + caster->QCN + "'s attack staggers " + target->QCN + " back " "into " + target_two->QCN + "!%^RESET%^", ({ target, target_two, caster })); break; } if (!do_save(target_two, mod)) { tell_object(target_two, "%^BOLD%^%^YELLOW%^The attack staggers you, knocking you off " "balance!%^RESET%^"); tell_room(place, "%^BOLD%^%^YELLOW%^" + target_two->QCN + " is staggered and knocked out " "of balance!%^RESET%^", target_two); target_two->set_paralyzed(roll_dice(2, 4), "%^YELLOW%^You are trying to regain " "your balance!%^RESET%^"); } } { string dtype; if (sizeof(weapons)) { if (objectp(weapons[0])) { dtype = weapons[0]->query_damage_type(); } } dtype = dtype ? dtype : "piercing"; if (target->query_property("weapon resistance")) { if (enchant < (int)target->query_property("weapon resistance")) { target->cause_typed_damage(target, target->return_target_limb(), 0, dtype); } }else { target->cause_typed_damage(target, target->return_target_limb(), dam, dtype); } } if (objectp(target_two)) { if (caster->query_property("shapeshifted") && caster->query_unarmed_wc() >= target_two->query_property("weapon resistance")) { target_two->cause_typed_damage(target_two, target_two->return_target_limb(), dam, "piercing"); }else if (target_two->query_property("weapon resistance")) { if (enchant < (int)target_two->query_property("weapon resistance") && sizeof(weapons)) { target_two->cause_typed_damage(target_two, target_two->return_target_limb(), 0, weapons[0]->query_damage_type()); } }else { if (sizeof(weapons)) { target_two->cause_typed_damage(target_two, target_two->return_target_limb(), dam, weapons[0]->query_damage_type()); } } newmap += ([ target_two:timerz ]); } if (reaping) { if (objectp(target_two)) { mod = clevel * 3; }else { mod = to_int(clevel * 1.5); } if (caster->query_hp() < caster->query_max_hp()) { diff = caster->query_max_hp() - caster->query_hp(); if (diff >= mod) { caster->add_hp(mod); mod = 0; }else { caster->add_hp(diff); mod = mod - diff; } } if (mod && (caster->query_extra_hp() < mod)) { caster->add_extra_hp(mod - caster->query_extra_hp()); } tell_object(caster, "%^BOLD%^%^RED%^You are filled with bloodlust and eagerness for battle as you reap your foes!"); } caster->remove_property("using impale"); caster->set_property("using impale", newmap); dest_effect(); } void dest_effect() { ::dest_effect(); remove_feat(TO); return; }
36.813364
214
0.534831
[ "object" ]
a0a87b23ca31ed929216a888a6a83e917b482e98
128,731
c
C
8/lpmysql.c
Chan-I/Flex_and_Bison
5cf966c3c29614608a9834252c9ca1f79fd8ef2f
[ "Unlicense" ]
null
null
null
8/lpmysql.c
Chan-I/Flex_and_Bison
5cf966c3c29614608a9834252c9ca1f79fd8ef2f
[ "Unlicense" ]
null
null
null
8/lpmysql.c
Chan-I/Flex_and_Bison
5cf966c3c29614608a9834252c9ca1f79fd8ef2f
[ "Unlicense" ]
null
null
null
#line 2 "lpmysql.c" #line 4 "lpmysql.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include <inttypes.h> typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 275 #define YY_END_OF_BUFFER 276 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[1194] = { 0, 0, 0, 0, 0, 0, 0, 276, 274, 272, 273, 237, 274, 266, 237, 237, 274, 237, 237, 237, 220, 220, 274, 245, 240, 243, 274, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 274, 237, 270, 271, 270, 255, 246, 0, 232, 230, 0, 266, 238, 0, 231, 229, 0, 0, 0, 220, 222, 0, 268, 221, 0, 0, 0, 265, 248, 244, 247, 242, 249, 0, 258, 0, 0, 255, 255, 255, 255, 8, 255, 0, 255, 255, 255, 255, 18, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 85, 255, 87, 96, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 130, 255, 135, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 192, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 255, 0, 257, 0, 239, 269, 255, 0, 0, 230, 0, 0, 0, 229, 0, 267, 0, 225, 221, 0, 235, 0, 223, 234, 241, 0, 262, 0, 264, 0, 263, 1, 2, 255, 255, 6, 7, 9, 255, 0, 255, 255, 255, 255, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 47, 255, 255, 255, 255, 255, 57, 255, 255, 255, 255, 255, 64, 255, 255, 255, 255, 255, 255, 255, 73, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 93, 255, 255, 99, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 123, 255, 126, 255, 255, 255, 0, 255, 255, 137, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 166, 255, 255, 255, 255, 255, 255, 173, 180, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 202, 255, 255, 255, 255, 255, 255, 255, 255, 0, 216, 255, 255, 256, 5, 0, 230, 0, 229, 267, 0, 224, 259, 261, 260, 255, 255, 255, 236, 255, 255, 255, 255, 16, 17, 19, 255, 21, 255, 23, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 41, 255, 255, 255, 255, 255, 255, 52, 255, 255, 255, 59, 60, 61, 62, 65, 255, 255, 69, 255, 255, 255, 255, 255, 255, 76, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 190, 168, 93, 13, 255, 95, 255, 98, 100, 101, 255, 255, 104, 105, 255, 255, 108, 255, 111, 112, 115, 255, 255, 255, 255, 255, 255, 255, 0, 255, 128, 255, 255, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 145, 147, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 167, 255, 169, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 186, 187, 188, 255, 255, 255, 255, 226, 195, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 211, 255, 255, 214, 255, 233, 217, 255, 0, 0, 0, 0, 3, 255, 255, 255, 255, 255, 255, 255, 255, 255, 24, 255, 255, 255, 255, 255, 255, 255, 254, 255, 33, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 228, 71, 72, 74, 255, 255, 78, 79, 255, 255, 255, 255, 99, 255, 89, 90, 255, 255, 255, 255, 255, 255, 103, 106, 107, 255, 255, 255, 255, 117, 255, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 136, 138, 255, 255, 255, 255, 143, 144, 146, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 158, 149, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 183, 255, 255, 255, 255, 255, 255, 255, 251, 196, 255, 255, 255, 255, 255, 201, 203, 255, 255, 207, 255, 255, 255, 212, 213, 215, 255, 255, 255, 255, 11, 255, 14, 255, 22, 255, 255, 26, 255, 255, 255, 255, 255, 32, 255, 38, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 51, 255, 255, 255, 58, 63, 255, 67, 255, 72, 255, 255, 80, 255, 255, 255, 86, 88, 255, 92, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 129, 255, 0, 255, 133, 255, 255, 255, 255, 255, 149, 255, 151, 152, 255, 255, 255, 156, 157, 159, 160, 255, 163, 255, 255, 255, 170, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 197, 255, 198, 255, 200, 255, 255, 207, 255, 255, 255, 255, 255, 4, 255, 12, 20, 255, 25, 27, 255, 255, 255, 31, 255, 255, 255, 255, 255, 255, 255, 255, 255, 47, 48, 49, 50, 255, 255, 255, 66, 70, 75, 255, 255, 255, 255, 255, 93, 255, 97, 102, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 125, 0, 255, 47, 0, 255, 255, 139, 255, 141, 255, 255, 150, 153, 154, 255, 161, 255, 255, 255, 255, 171, 255, 255, 255, 255, 255, 255, 255, 255, 255, 250, 255, 255, 255, 255, 255, 255, 194, 227, 255, 255, 255, 255, 209, 210, 255, 255, 255, 255, 255, 255, 30, 255, 39, 42, 255, 255, 43, 255, 255, 255, 53, 255, 55, 77, 255, 255, 255, 255, 255, 94, 255, 113, 114, 255, 255, 255, 255, 255, 255, 255, 124, 0, 255, 0, 132, 255, 255, 255, 255, 155, 255, 255, 255, 172, 255, 175, 255, 255, 255, 255, 181, 255, 255, 255, 255, 255, 191, 193, 199, 204, 205, 255, 255, 255, 219, 255, 23, 28, 255, 255, 255, 255, 40, 252, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 109, 255, 255, 119, 255, 119, 255, 255, 0, 255, 0, 255, 140, 142, 255, 255, 164, 165, 255, 255, 255, 255, 255, 255, 255, 184, 255, 189, 255, 208, 255, 255, 255, 29, 255, 255, 255, 255, 45, 46, 255, 255, 255, 255, 255, 255, 255, 255, 255, 118, 120, 255, 255, 68, 255, 0, 134, 148, 255, 255, 176, 255, 255, 255, 255, 185, 255, 255, 218, 255, 255, 255, 255, 255, 255, 56, 255, 255, 83, 84, 91, 255, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 34, 35, 37, 255, 255, 255, 255, 255, 116, 255, 255, 255, 131, 255, 174, 255, 255, 255, 255, 255, 209, 255, 255, 255, 54, 81, 255, 255, 255, 122, 255, 255, 255, 255, 255, 182, 206, 10, 255, 255, 255, 110, 255, 255, 255, 177, 255, 255, 255, 44, 255, 255, 255, 255, 255, 255, 255, 82, 255, 255, 255, 255, 179, 36, 255, 255, 255, 255, 121, 127, 162, 255, 178, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 8, 12, 13, 8, 14, 15, 16, 17, 18, 19, 20, 21, 20, 20, 20, 22, 20, 23, 8, 24, 25, 26, 1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 1, 54, 1, 8, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 1, 83, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[84] = { 0, 1, 1, 2, 1, 3, 1, 4, 1, 1, 5, 1, 1, 1, 1, 4, 1, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 7, 8, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1 } ; static yyconst flex_int16_t yy_base[1214] = { 0, 0, 0, 81, 82, 58, 59, 814, 2615, 2615, 2615, 785, 85, 0, 2615, 798, 86, 83, 89, 794, 136, 105, 780, 88, 2615, 66, 123, 121, 138, 160, 190, 182, 221, 72, 107, 238, 76, 98, 212, 274, 217, 264, 137, 84, 254, 316, 337, 277, 114, 331, 165, 112, 151, 226, 715, 2615, 2615, 748, 368, 2615, 222, 2615, 682, 324, 0, 2615, 301, 2615, 657, 327, 663, 400, 431, 437, 453, 2615, 459, 175, 482, 0, 2615, 2615, 636, 2615, 2615, 2615, 657, 265, 656, 654, 0, 153, 365, 437, 156, 154, 315, 295, 327, 216, 221, 0, 367, 454, 466, 368, 309, 436, 480, 475, 338, 389, 436, 457, 462, 492, 479, 486, 486, 481, 488, 486, 490, 494, 521, 492, 510, 497, 0, 505, 535, 0, 532, 529, 515, 532, 551, 545, 579, 525, 556, 557, 558, 543, 575, 563, 578, 552, 573, 576, 603, 579, 589, 647, 592, 598, 598, 605, 659, 599, 614, 603, 650, 608, 609, 656, 627, 650, 652, 651, 693, 0, 688, 708, 668, 720, 684, 710, 705, 691, 704, 0, 697, 722, 706, 771, 2615, 487, 2615, 2615, 760, 286, 754, 755, 789, 166, 779, 790, 792, 0, 817, 830, 836, 852, 326, 842, 858, 0, 2615, 126, 2615, 135, 2615, 243, 2615, 0, 0, 729, 733, 0, 0, 0, 755, 786, 757, 761, 777, 788, 0, 838, 846, 843, 853, 843, 856, 850, 847, 859, 850, 864, 847, 849, 871, 430, 865, 872, 908, 872, 877, 878, 0, 897, 896, 902, 907, 911, 0, 904, 917, 900, 909, 903, 920, 923, 926, 912, 914, 916, 911, 924, 926, 917, 921, 932, 930, 935, 935, 952, 979, 949, 958, 956, 964, 973, 958, 974, 971, 976, 978, 982, 980, 972, 407, 986, 981, 987, 971, 988, 977, 445, 976, 988, 1028, 1027, 994, 1009, 1029, 1012, 1012, 1033, 1030, 1035, 1035, 1035, 1036, 1037, 1044, 1041, 1027, 1029, 1029, 1036, 1044, 1044, 1044, 1052, 1043, 1056, 1053, 1072, 0, 1060, 1076, 1084, 1090, 1072, 1090, 1091, 0, 1076, 1094, 1078, 1086, 1083, 1087, 1083, 1090, 1100, 1081, 1098, 1102, 1103, 1096, 1130, 1099, 1115, 1122, 1140, 1139, 0, 1134, 389, 1128, 1148, 1138, 1141, 1146, 1135, 427, 0, 1139, 1143, 2615, 0, 641, 1138, 316, 430, 0, 1198, 1204, 2615, 2615, 2615, 1153, 1147, 379, 2615, 1185, 1199, 1191, 1188, 0, 0, 0, 1206, 0, 1201, 1208, 1199, 1210, 1199, 1208, 1205, 1195, 1207, 1212, 1198, 1199, 1201, 1216, 1207, 1221, 1233, 1246, 1213, 1226, 1207, 1204, 1211, 1244, 1245, 1255, 1254, 0, 0, 0, 1258, 0, 1252, 1249, 0, 1269, 1266, 1264, 1253, 1269, 1266, 0, 1256, 1257, 1262, 1265, 375, 372, 1262, 1257, 1272, 1267, 1266, 1298, 0, 0, 0, 0, 1304, 0, 1288, 0, 0, 0, 1281, 1312, 0, 0, 1300, 1302, 0, 1311, 0, 1322, 0, 1309, 1318, 1306, 1316, 1309, 1324, 1313, 1357, 1316, 0, 1330, 1318, 1316, 1354, 1321, 1325, 1335, 1338, 1347, 1356, 1365, 1363, 1356, 0, 1360, 1355, 1379, 1368, 1381, 1382, 1375, 1367, 1368, 1376, 1368, 1384, 1371, 1380, 1380, 1392, 1388, 1382, 0, 1389, 0, 1389, 1396, 1397, 1395, 1400, 1424, 1425, 1412, 1424, 1416, 1432, 1423, 1430, 0, 0, 1421, 1432, 1430, 1436, 415, 0, 0, 1431, 1425, 1432, 1447, 1444, 1433, 1450, 1451, 1473, 1454, 1451, 1455, 1469, 0, 1478, 1480, 0, 1481, 2615, 370, 1484, 1486, 1513, 537, 651, 0, 1468, 1486, 1491, 1492, 1478, 1474, 1496, 1496, 1499, 0, 1483, 1490, 1491, 1488, 1491, 1496, 1498, 0, 1512, 0, 1504, 1502, 1520, 1526, 1535, 1526, 1533, 1538, 1543, 1530, 1539, 1547, 1548, 1546, 1543, 1543, 1553, 1553, 1555, 1542, 1553, 0, 0, 402, 0, 1556, 1561, 0, 0, 1560, 1552, 1556, 1569, 0, 1571, 0, 0, 1559, 1559, 1588, 1572, 1579, 1586, 0, 0, 0, 1581, 1590, 1601, 1591, 0, 1597, 1606, 1607, 1604, 1613, 1591, 1607, 1599, 1609, 1603, 1611, 1607, 0, 0, 1612, 1606, 1608, 1623, 0, 0, 0, 1627, 1617, 1615, 1631, 1617, 1648, 1634, 1648, 1644, 1654, 0, 0, 1644, 1663, 1663, 1648, 1649, 1669, 1662, 1667, 1672, 1668, 1672, 1675, 1659, 1669, 1678, 1669, 1674, 1677, 1667, 0, 1672, 1677, 1672, 1680, 1690, 1700, 1705, 2615, 0, 1710, 1693, 1706, 1704, 1717, 0, 0, 1724, 1717, 1708, 1714, 1728, 1716, 0, 0, 0, 1718, 1723, 1728, 1720, 0, 1721, 0, 1731, 0, 1717, 1735, 0, 1721, 1733, 1742, 1727, 1729, 0, 1730, 0, 1733, 1740, 1763, 1747, 1752, 1771, 1772, 1764, 1775, 1763, 1780, 0, 1784, 1778, 1785, 0, 0, 1785, 0, 1776, 0, 1777, 1768, 0, 1775, 1785, 1790, 0, 0, 1789, 0, 1781, 1799, 1796, 1799, 1798, 1793, 1786, 1802, 1823, 1817, 329, 1826, 1821, 1825, 1818, 0, 1838, 1830, 1818, 1844, 1841, 1838, 1823, 1828, 1836, 0, 1846, 0, 0, 1847, 1848, 1853, 0, 0, 0, 1838, 295, 0, 1849, 1839, 1850, 0, 1853, 1857, 1863, 1849, 1869, 1877, 1877, 1889, 1877, 1884, 1915, 1895, 1899, 1900, 1882, 1879, 1890, 1887, 0, 1892, 0, 1902, 0, 1888, 1896, 0, 1909, 1893, 1907, 1900, 1904, 0, 1914, 0, 0, 1917, 0, 0, 1908, 1917, 1922, 0, 262, 1923, 1936, 1938, 1945, 1930, 1931, 1929, 1939, 0, 0, 0, 0, 1953, 1945, 1940, 0, 0, 0, 1941, 1953, 1960, 1961, 1945, 0, 1954, 0, 0, 1954, 1966, 1949, 1957, 1961, 1961, 1975, 1967, 1986, 1963, 0, 1965, 1980, 0, 1977, 1995, 1994, 0, 1992, 0, 1990, 2009, 0, 0, 0, 1996, 0, 2004, 1996, 2004, 2000, 0, 2018, 2006, 2018, 2015, 248, 2022, 2014, 2020, 2010, 2615, 2017, 2014, 2013, 2025, 2019, 2033, 0, 0, 2038, 2038, 2039, 2039, 2057, 0, 2049, 2052, 2047, 2048, 2056, 2060, 0, 2076, 2056, 0, 270, 245, 0, 2061, 2057, 2064, 0, 2070, 2063, 0, 2067, 2065, 2063, 2070, 2079, 0, 2084, 0, 0, 2072, 2076, 2078, 2076, 2081, 2093, 2110, 0, 2096, 188, 2118, 0, 2110, 2109, 2119, 2123, 0, 2123, 2128, 2116, 0, 2115, 0, 2122, 2119, 185, 2126, 0, 149, 2132, 2115, 2136, 2126, 0, 0, 0, 0, 2124, 2121, 2144, 2128, 0, 2144, 0, 0, 2134, 2154, 2147, 2139, 0, 2615, 2615, 2140, 2155, 2169, 2155, 2164, 2162, 2166, 2162, 2172, 2168, 2172, 2183, 2191, 0, 2174, 0, 2192, 2193, 2178, 2178, 2198, 2175, 0, 0, 2182, 2201, 0, 0, 2196, 2199, 2202, 2206, 145, 2203, 130, 0, 2210, 0, 2196, 0, 2197, 2210, 2218, 0, 2212, 2224, 2233, 2234, 0, 0, 2220, 2221, 2239, 2230, 2245, 2247, 2247, 2233, 2234, 0, 0, 2237, 2241, 2615, 2242, 2238, 0, 0, 2241, 2247, 0, 2244, 2249, 2247, 2255, 0, 2270, 2267, 0, 2269, 2270, 2271, 2271, 2287, 2286, 0, 2276, 2292, 0, 0, 0, 2297, 2277, 2291, 2293, 81, 2303, 2294, 2296, 2290, 2291, 2308, 2305, 2302, 2298, 2303, 0, 2301, 0, 2306, 2319, 2298, 2325, 2316, 0, 2311, 2328, 2331, 2615, 2315, 0, 2335, 2334, 2334, 2340, 2339, 0, 2336, 2340, 2350, 0, 0, 2350, 2350, 2362, 0, 2359, 2364, 2350, 2367, 2351, 0, 0, 0, 2372, 2370, 2361, 0, 2375, 2365, 2377, 0, 64, 2369, 2373, 0, 2383, 2373, 2378, 2376, 2374, 2385, 2390, 0, 2397, 2397, 2399, 2399, 0, 0, 2414, 2415, 2419, 2401, 0, 0, 0, 2406, 0, 2615, 2481, 2489, 2497, 2505, 2511, 2514, 2521, 2528, 2536, 93, 2544, 2552, 2560, 89, 2567, 2574, 2582, 2590, 2598, 2606 } ; static yyconst flex_int16_t yy_def[1214] = { 0, 1193, 1, 1194, 1194, 1, 1, 1193, 1193, 1193, 1193, 1193, 1195, 1196, 1193, 1193, 1197, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1198, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1200, 1193, 1193, 1193, 1193, 1199, 1193, 1195, 1193, 1193, 1201, 1196, 1193, 1197, 1193, 1193, 1202, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1203, 1193, 1193, 1193, 1193, 1193, 1193, 1204, 1198, 1205, 1206, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1207, 1199, 1199, 1199, 1200, 1193, 1208, 1193, 1193, 1199, 1209, 1195, 1195, 1201, 1210, 1197, 1197, 1202, 1211, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1203, 1193, 1204, 1193, 1205, 1193, 1206, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1207, 1199, 1199, 1199, 1193, 1199, 1212, 1209, 1213, 1210, 1211, 1193, 1193, 1193, 1193, 1193, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1209, 1212, 1210, 1213, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1193, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 0, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193 } ; static yyconst flex_int16_t yy_nxt[2699] = { 0, 8, 9, 10, 11, 12, 13, 8, 14, 15, 16, 14, 14, 14, 17, 18, 19, 20, 21, 21, 21, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 8, 8, 53, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 56, 56, 58, 58, 61, 67, 62, 84, 85, 57, 57, 368, 68, 70, 71, 207, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 81, 82, 83, 58, 58, 124, 133, 1174, 76, 74, 72, 72, 72, 72, 72, 72, 86, 210, 134, 381, 152, 88, 135, 125, 1131, 78, 212, 63, 69, 918, 177, 126, 183, 382, 124, 133, 96, 127, 74, 76, 91, 72, 72, 72, 72, 72, 72, 134, 92, 152, 93, 135, 125, 77, 78, 94, 78, 95, 97, 177, 126, 183, 98, 181, 68, 99, 127, 89, 100, 91, 150, 184, 215, 151, 221, 79, 102, 92, 101, 93, 204, 204, 77, 103, 94, 78, 95, 97, 1087, 222, 104, 98, 1047, 105, 99, 182, 106, 100, 113, 150, 184, 215, 151, 221, 79, 102, 107, 101, 376, 114, 108, 115, 103, 61, 109, 62, 116, 186, 222, 104, 110, 117, 105, 111, 182, 106, 112, 113, 1045, 187, 187, 1033, 136, 143, 214, 107, 137, 118, 114, 108, 115, 119, 138, 109, 1013, 116, 229, 144, 120, 110, 117, 121, 111, 145, 122, 112, 230, 123, 1193, 128, 129, 136, 143, 1193, 63, 137, 118, 130, 187, 1012, 119, 138, 131, 132, 153, 229, 144, 120, 154, 62, 121, 155, 145, 122, 156, 230, 123, 383, 128, 129, 139, 986, 67, 146, 140, 147, 130, 148, 141, 68, 149, 131, 132, 153, 142, 940, 173, 154, 174, 1193, 155, 175, 176, 156, 377, 61, 224, 193, 67, 139, 223, 223, 146, 140, 147, 197, 148, 141, 374, 149, 225, 204, 204, 142, 157, 173, 158, 174, 904, 159, 175, 176, 241, 69, 160, 224, 161, 162, 163, 226, 164, 165, 166, 167, 178, 179, 227, 168, 563, 225, 169, 170, 228, 157, 180, 158, 194, 171, 159, 198, 172, 241, 885, 160, 251, 161, 162, 163, 226, 164, 165, 166, 167, 178, 179, 227, 168, 91, 239, 169, 170, 228, 216, 180, 231, 92, 171, 190, 240, 172, 217, 232, 94, 251, 95, 73, 73, 73, 73, 73, 73, 754, 749, 714, 696, 616, 91, 239, 615, 252, 74, 216, 566, 231, 92, 557, 190, 240, 377, 217, 232, 94, 547, 95, 76, 479, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 252, 74, 472, 78, 253, 218, 200, 200, 219, 74, 201, 201, 201, 201, 201, 201, 202, 202, 202, 202, 202, 202, 233, 242, 376, 414, 234, 254, 243, 220, 186, 203, 78, 253, 218, 205, 205, 219, 74, 206, 206, 206, 206, 206, 206, 235, 236, 237, 255, 258, 244, 233, 242, 245, 238, 234, 254, 243, 220, 246, 203, 249, 259, 256, 250, 261, 247, 248, 262, 260, 263, 264, 265, 266, 235, 236, 237, 255, 258, 244, 257, 269, 245, 238, 270, 271, 272, 68, 246, 267, 249, 259, 256, 250, 261, 247, 248, 262, 260, 263, 264, 265, 266, 268, 279, 280, 273, 281, 274, 257, 269, 282, 293, 270, 271, 272, 275, 276, 267, 283, 303, 277, 278, 285, 284, 286, 287, 294, 295, 297, 298, 376, 268, 279, 280, 273, 281, 274, 296, 304, 282, 293, 301, 302, 305, 275, 276, 288, 283, 289, 277, 278, 285, 284, 286, 287, 294, 295, 297, 298, 290, 291, 299, 306, 310, 311, 322, 296, 304, 292, 300, 301, 302, 305, 323, 307, 288, 324, 289, 308, 325, 331, 332, 333, 334, 309, 375, 337, 338, 290, 291, 299, 306, 310, 311, 322, 341, 214, 292, 212, 210, 377, 208, 323, 307, 199, 324, 195, 308, 325, 331, 332, 333, 334, 309, 312, 337, 338, 335, 342, 313, 314, 336, 346, 339, 341, 315, 191, 316, 326, 317, 318, 343, 319, 320, 561, 321, 344, 327, 357, 328, 340, 329, 345, 312, 563, 330, 335, 342, 313, 314, 336, 346, 339, 361, 315, 349, 316, 326, 317, 318, 343, 319, 320, 350, 321, 344, 327, 357, 328, 340, 329, 345, 347, 348, 330, 351, 364, 366, 352, 367, 365, 369, 361, 353, 349, 354, 355, 358, 362, 370, 371, 359, 350, 356, 363, 360, 61, 61, 62, 375, 384, 347, 348, 189, 351, 364, 366, 352, 367, 365, 369, 385, 353, 186, 354, 355, 358, 362, 370, 371, 359, 67, 356, 363, 360, 187, 187, 218, 68, 384, 373, 61, 67, 193, 67, 387, 386, 188, 388, 377, 385, 197, 223, 223, 80, 75, 65, 63, 63, 59, 389, 220, 390, 1193, 1193, 391, 218, 1193, 1193, 373, 1193, 1193, 1193, 1193, 187, 386, 372, 388, 1193, 1193, 1193, 1193, 69, 201, 201, 201, 201, 201, 201, 389, 220, 390, 194, 69, 391, 198, 201, 201, 201, 201, 201, 201, 202, 202, 202, 202, 202, 202, 206, 206, 206, 206, 206, 206, 379, 379, 392, 203, 380, 380, 380, 380, 380, 380, 206, 206, 206, 206, 206, 206, 393, 394, 395, 397, 396, 399, 402, 398, 400, 403, 407, 408, 409, 410, 411, 392, 203, 401, 412, 417, 415, 420, 413, 416, 404, 405, 1193, 406, 421, 393, 394, 395, 397, 396, 399, 402, 398, 400, 403, 407, 408, 409, 410, 411, 422, 423, 401, 412, 417, 415, 420, 413, 416, 404, 405, 418, 406, 421, 424, 419, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 438, 439, 422, 423, 436, 440, 437, 441, 442, 443, 444, 445, 446, 418, 447, 448, 424, 419, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 438, 439, 449, 450, 436, 440, 437, 441, 442, 443, 444, 445, 446, 457, 447, 448, 451, 452, 458, 453, 454, 459, 460, 461, 463, 464, 465, 466, 467, 468, 455, 449, 450, 470, 471, 473, 474, 475, 476, 469, 456, 462, 457, 477, 478, 480, 481, 458, 303, 485, 459, 460, 461, 463, 464, 465, 466, 467, 468, 455, 486, 489, 470, 471, 473, 474, 475, 476, 469, 456, 462, 490, 477, 478, 480, 481, 482, 484, 485, 483, 487, 488, 491, 492, 493, 494, 496, 497, 498, 486, 489, 499, 500, 495, 502, 503, 504, 505, 506, 501, 490, 507, 508, 509, 510, 482, 484, 511, 483, 487, 488, 491, 492, 493, 494, 496, 497, 498, 512, 513, 499, 500, 495, 502, 503, 504, 505, 506, 501, 514, 507, 508, 509, 510, 515, 516, 511, 517, 518, 519, 524, 525, 520, 526, 527, 528, 529, 512, 513, 530, 531, 532, 533, 534, 537, 535, 521, 538, 514, 541, 522, 536, 375, 515, 516, 523, 517, 518, 519, 524, 525, 520, 526, 527, 528, 529, 542, 543, 530, 531, 532, 533, 534, 537, 535, 521, 538, 544, 541, 522, 536, 539, 545, 540, 546, 548, 549, 550, 552, 554, 555, 556, 553, 558, 559, 542, 543, 1193, 1193, 1193, 1193, 374, 1193, 1193, 1193, 1193, 544, 564, 565, 551, 539, 545, 540, 546, 548, 549, 550, 552, 554, 555, 556, 553, 558, 559, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, 564, 565, 551, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 1193, 1193, 593, 594, 595, 596, 1193, 597, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 590, 593, 594, 595, 596, 591, 597, 589, 598, 599, 600, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 617, 618, 588, 590, 619, 620, 621, 1193, 591, 626, 627, 598, 599, 600, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 617, 618, 624, 622, 619, 620, 621, 623, 628, 626, 627, 629, 630, 625, 631, 632, 634, 635, 636, 637, 638, 639, 640, 479, 1193, 642, 643, 644, 645, 1193, 648, 624, 622, 633, 649, 650, 623, 628, 651, 652, 629, 630, 625, 631, 632, 634, 635, 636, 637, 638, 639, 640, 653, 641, 642, 643, 644, 645, 646, 648, 647, 654, 633, 649, 650, 655, 656, 651, 652, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 653, 641, 669, 670, 671, 672, 646, 673, 647, 654, 674, 675, 676, 655, 656, 677, 678, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 679, 680, 669, 670, 671, 672, 681, 673, 682, 683, 674, 675, 676, 685, 686, 677, 678, 687, 688, 689, 690, 691, 692, 694, 695, 684, 697, 698, 699, 679, 680, 700, 701, 693, 702, 681, 703, 682, 683, 704, 707, 708, 685, 686, 709, 62, 687, 688, 689, 690, 691, 692, 694, 695, 684, 697, 698, 699, 705, 710, 700, 701, 693, 702, 711, 703, 712, 713, 704, 707, 708, 715, 375, 709, 706, 716, 717, 718, 719, 454, 720, 721, 722, 723, 724, 725, 726, 705, 710, 727, 728, 729, 1193, 711, 374, 712, 713, 730, 731, 732, 715, 733, 734, 706, 716, 717, 718, 719, 454, 720, 721, 722, 723, 724, 725, 726, 735, 736, 727, 728, 729, 561, 738, 739, 740, 741, 730, 731, 732, 742, 733, 734, 743, 744, 745, 737, 746, 747, 748, 749, 750, 751, 752, 753, 755, 735, 736, 756, 757, 758, 759, 738, 739, 740, 741, 761, 760, 762, 742, 763, 764, 743, 744, 745, 737, 746, 747, 748, 749, 750, 751, 752, 753, 755, 765, 766, 756, 757, 758, 759, 767, 768, 769, 770, 761, 760, 762, 771, 763, 764, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 765, 766, 785, 786, 787, 788, 767, 768, 769, 770, 789, 790, 791, 771, 792, 793, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 794, 795, 785, 786, 787, 788, 796, 797, 798, 799, 789, 790, 791, 800, 792, 793, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 794, 795, 814, 815, 816, 817, 796, 797, 798, 799, 818, 819, 820, 800, 821, 822, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 823, 824, 814, 815, 816, 817, 825, 826, 827, 828, 818, 819, 820, 829, 821, 822, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 823, 824, 843, 844, 845, 846, 825, 826, 827, 828, 847, 848, 849, 829, 850, 851, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 852, 853, 843, 844, 845, 846, 854, 855, 857, 858, 847, 848, 849, 859, 850, 851, 860, 861, 856, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 852, 853, 872, 873, 874, 875, 854, 855, 857, 858, 876, 877, 878, 859, 879, 880, 860, 861, 856, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 881, 884, 872, 873, 874, 875, 886, 882, 887, 888, 876, 877, 878, 889, 879, 880, 890, 891, 883, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 881, 884, 902, 903, 905, 906, 886, 882, 887, 888, 907, 908, 909, 889, 910, 911, 890, 891, 883, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 912, 913, 902, 903, 905, 906, 914, 915, 916, 917, 907, 908, 909, 920, 910, 911, 918, 921, 922, 451, 923, 924, 925, 926, 927, 928, 929, 930, 931, 912, 913, 932, 933, 934, 935, 914, 915, 916, 917, 936, 937, 919, 920, 938, 939, 941, 921, 922, 451, 923, 924, 925, 926, 927, 928, 929, 930, 931, 942, 943, 932, 933, 934, 935, 944, 945, 946, 947, 936, 937, 919, 948, 938, 939, 941, 949, 950, 951, 952, 953, 954, 956, 957, 958, 959, 960, 961, 942, 943, 962, 963, 955, 964, 944, 945, 946, 947, 965, 966, 969, 948, 970, 971, 972, 949, 950, 951, 952, 953, 954, 956, 957, 958, 959, 960, 961, 967, 973, 962, 963, 955, 964, 968, 974, 975, 976, 965, 966, 969, 977, 970, 971, 972, 978, 979, 980, 981, 452, 982, 983, 984, 985, 987, 988, 989, 967, 973, 990, 991, 992, 993, 968, 974, 975, 976, 994, 995, 996, 977, 997, 998, 999, 978, 979, 980, 981, 452, 982, 983, 984, 985, 987, 988, 989, 1000, 1001, 990, 991, 992, 993, 1002, 1003, 1004, 1005, 994, 995, 996, 1006, 997, 998, 999, 1007, 1011, 1014, 1015, 1016, 1017, 1008, 1018, 1019, 1020, 1021, 1022, 1000, 1001, 1023, 1024, 1025, 1026, 1002, 1003, 1004, 1005, 1009, 1010, 1027, 1006, 1028, 1029, 1030, 1007, 1011, 1014, 1015, 1016, 1017, 1008, 1018, 1019, 1020, 1021, 1022, 1031, 1032, 1023, 1024, 1025, 1026, 1034, 1035, 1036, 1037, 1009, 1010, 1027, 1038, 1028, 1029, 1030, 1039, 1040, 1041, 1042, 1043, 1044, 1046, 1048, 1049, 1050, 1051, 1052, 1031, 1032, 1053, 1054, 1055, 1056, 1034, 1035, 1036, 1037, 1057, 1058, 1059, 1038, 1060, 1061, 1062, 1039, 1040, 1041, 1042, 1043, 1044, 1046, 1048, 1049, 1050, 1051, 1052, 1063, 1064, 1053, 1054, 1055, 1056, 1065, 1066, 1067, 1068, 1057, 1058, 1059, 1069, 1060, 1061, 1062, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1063, 1064, 1082, 1083, 1084, 1085, 1065, 1066, 1067, 1068, 1086, 1088, 1089, 1069, 1090, 1091, 1092, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1093, 1094, 1082, 1083, 1084, 1085, 1095, 1096, 1097, 1098, 1086, 1088, 1089, 1099, 1090, 1091, 1092, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1093, 1094, 1112, 1113, 1114, 1115, 1095, 1096, 1097, 1098, 1116, 1117, 1118, 1099, 1119, 1120, 1121, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1122, 1123, 1112, 1113, 1114, 1115, 1124, 1125, 1126, 1127, 1116, 1117, 1118, 1128, 1119, 1120, 1121, 1129, 1130, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1122, 1123, 1142, 1143, 1144, 1145, 1124, 1125, 1126, 1127, 1146, 1147, 1148, 1128, 1149, 1150, 1151, 1129, 1130, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1152, 1153, 1142, 1143, 1144, 1145, 1154, 1155, 1156, 1157, 1146, 1147, 1148, 1158, 1149, 1150, 1151, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1152, 1153, 1171, 1172, 1173, 1175, 1154, 1155, 1156, 1157, 1176, 1177, 1178, 1158, 1179, 1180, 1181, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1182, 1183, 1171, 1172, 1173, 1175, 1184, 1185, 1186, 1187, 1176, 1177, 1178, 1188, 1179, 1180, 1181, 1189, 1190, 1191, 1192, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1182, 1183, 1193, 1193, 1193, 1193, 1184, 1185, 1186, 1187, 1193, 1193, 1193, 1188, 1193, 1193, 1193, 1189, 1190, 1191, 1192, 55, 55, 55, 55, 55, 55, 55, 55, 60, 60, 60, 60, 60, 60, 60, 60, 64, 1193, 64, 64, 64, 64, 64, 64, 66, 66, 66, 66, 66, 66, 66, 66, 87, 87, 87, 87, 87, 87, 90, 90, 185, 185, 185, 185, 185, 185, 185, 192, 192, 192, 192, 192, 192, 192, 192, 196, 196, 196, 196, 196, 196, 196, 196, 209, 209, 1193, 209, 209, 209, 209, 209, 211, 211, 211, 211, 1193, 211, 211, 211, 213, 213, 213, 213, 213, 213, 213, 187, 187, 187, 187, 187, 187, 187, 191, 1193, 191, 191, 191, 191, 191, 191, 195, 1193, 195, 195, 195, 195, 195, 195, 378, 1193, 378, 378, 378, 378, 378, 378, 560, 1193, 560, 560, 560, 560, 560, 560, 562, 1193, 562, 562, 562, 562, 562, 562, 7, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193 } ; static yyconst flex_int16_t yy_chk[2699] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 5, 6, 12, 16, 12, 25, 25, 3, 4, 1207, 16, 17, 17, 1203, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 23, 23, 23, 5, 6, 33, 36, 1166, 21, 18, 21, 21, 21, 21, 21, 21, 26, 209, 37, 209, 43, 26, 37, 34, 1109, 21, 211, 12, 16, 1048, 48, 34, 51, 211, 33, 36, 28, 34, 18, 20, 27, 20, 20, 20, 20, 20, 20, 37, 27, 43, 27, 37, 34, 20, 21, 27, 20, 27, 28, 48, 34, 51, 28, 50, 195, 28, 34, 26, 28, 27, 42, 52, 91, 42, 94, 20, 29, 27, 28, 27, 77, 77, 20, 29, 27, 20, 27, 28, 1046, 95, 29, 28, 990, 29, 28, 50, 29, 28, 31, 42, 52, 91, 42, 94, 20, 29, 30, 28, 195, 31, 30, 31, 29, 60, 30, 60, 31, 53, 95, 29, 30, 31, 29, 30, 50, 29, 30, 31, 987, 53, 53, 971, 38, 40, 213, 30, 38, 32, 31, 30, 31, 32, 38, 30, 944, 31, 99, 40, 32, 30, 31, 32, 30, 40, 32, 30, 100, 32, 87, 35, 35, 38, 40, 87, 60, 38, 32, 35, 53, 943, 32, 38, 35, 35, 44, 99, 40, 32, 44, 191, 32, 44, 40, 32, 44, 100, 32, 213, 35, 35, 39, 913, 66, 41, 39, 41, 35, 41, 39, 66, 41, 35, 35, 44, 39, 849, 47, 44, 47, 87, 44, 47, 47, 44, 376, 63, 97, 63, 69, 39, 96, 96, 41, 39, 41, 69, 41, 39, 191, 41, 97, 204, 204, 39, 45, 47, 45, 47, 801, 45, 47, 47, 106, 66, 45, 97, 45, 45, 45, 98, 45, 45, 45, 46, 49, 49, 98, 46, 376, 97, 46, 46, 98, 45, 49, 45, 63, 46, 45, 69, 46, 106, 775, 45, 110, 45, 45, 45, 98, 45, 45, 45, 46, 49, 49, 98, 46, 58, 105, 46, 46, 98, 92, 49, 102, 58, 46, 58, 105, 46, 92, 102, 58, 110, 58, 71, 71, 71, 71, 71, 71, 608, 608, 558, 536, 444, 58, 105, 443, 111, 71, 92, 386, 102, 58, 368, 58, 105, 377, 92, 102, 58, 361, 58, 72, 299, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 111, 71, 292, 72, 112, 93, 74, 74, 93, 73, 74, 74, 74, 74, 74, 74, 76, 76, 76, 76, 76, 76, 103, 107, 377, 243, 103, 113, 107, 93, 187, 76, 72, 112, 93, 78, 78, 93, 73, 78, 78, 78, 78, 78, 78, 104, 104, 104, 114, 116, 108, 103, 107, 108, 104, 103, 113, 107, 93, 108, 76, 109, 117, 115, 109, 118, 108, 108, 119, 117, 120, 121, 122, 123, 104, 104, 104, 114, 116, 108, 115, 125, 108, 104, 126, 127, 129, 562, 108, 124, 109, 117, 115, 109, 118, 108, 108, 119, 117, 120, 121, 122, 123, 124, 132, 133, 130, 134, 130, 115, 125, 135, 139, 126, 127, 129, 130, 130, 124, 136, 146, 130, 130, 137, 136, 137, 137, 140, 141, 142, 143, 562, 124, 132, 133, 130, 134, 130, 141, 147, 135, 139, 145, 145, 148, 130, 130, 138, 136, 138, 130, 130, 137, 136, 137, 137, 140, 141, 142, 143, 138, 138, 144, 149, 151, 152, 154, 141, 147, 138, 144, 145, 145, 148, 155, 150, 138, 156, 138, 150, 157, 159, 160, 161, 161, 150, 374, 163, 164, 138, 138, 144, 149, 151, 152, 154, 166, 89, 138, 88, 86, 563, 82, 155, 150, 70, 156, 68, 150, 157, 159, 160, 161, 161, 150, 153, 163, 164, 162, 167, 153, 153, 162, 169, 165, 166, 153, 62, 153, 158, 153, 153, 168, 153, 153, 374, 153, 168, 158, 174, 158, 165, 158, 168, 153, 563, 158, 162, 167, 153, 153, 162, 169, 165, 176, 153, 172, 153, 158, 153, 153, 168, 153, 153, 172, 153, 168, 158, 174, 158, 165, 158, 168, 170, 170, 158, 172, 178, 179, 173, 180, 178, 182, 176, 173, 172, 173, 173, 175, 177, 183, 184, 175, 172, 173, 177, 175, 192, 193, 192, 193, 217, 170, 170, 57, 172, 178, 179, 173, 180, 178, 182, 218, 173, 185, 173, 173, 175, 177, 183, 184, 175, 196, 173, 177, 175, 185, 185, 190, 196, 217, 190, 194, 197, 194, 198, 223, 222, 54, 224, 197, 218, 198, 223, 223, 22, 19, 15, 192, 193, 11, 225, 190, 226, 7, 0, 227, 190, 0, 0, 190, 0, 0, 0, 0, 185, 222, 185, 224, 0, 0, 0, 0, 196, 200, 200, 200, 200, 200, 200, 225, 190, 226, 194, 197, 227, 198, 201, 201, 201, 201, 201, 201, 202, 202, 202, 202, 202, 202, 205, 205, 205, 205, 205, 205, 203, 203, 229, 202, 203, 203, 203, 203, 203, 203, 206, 206, 206, 206, 206, 206, 230, 231, 232, 233, 232, 234, 236, 233, 235, 237, 238, 239, 240, 241, 241, 229, 202, 235, 242, 245, 244, 247, 242, 244, 237, 237, 0, 237, 248, 230, 231, 232, 233, 232, 234, 236, 233, 235, 237, 238, 239, 240, 241, 241, 249, 251, 235, 242, 245, 244, 247, 242, 244, 237, 237, 246, 237, 248, 252, 246, 253, 254, 255, 257, 258, 259, 259, 260, 261, 262, 263, 265, 266, 249, 251, 264, 267, 264, 268, 269, 270, 271, 272, 273, 246, 274, 275, 252, 246, 253, 254, 255, 257, 258, 259, 259, 260, 261, 262, 263, 265, 266, 276, 277, 264, 267, 264, 268, 269, 270, 271, 272, 273, 279, 274, 275, 278, 278, 280, 278, 278, 281, 282, 283, 284, 285, 286, 287, 288, 289, 278, 276, 277, 290, 291, 293, 294, 295, 296, 289, 278, 283, 279, 297, 298, 300, 301, 280, 303, 304, 281, 282, 283, 284, 285, 286, 287, 288, 289, 278, 305, 307, 290, 291, 293, 294, 295, 296, 289, 278, 283, 308, 297, 298, 300, 301, 302, 303, 304, 302, 306, 306, 309, 310, 311, 312, 313, 314, 315, 305, 307, 316, 317, 312, 318, 319, 320, 321, 322, 317, 308, 323, 324, 325, 326, 302, 303, 327, 302, 306, 306, 309, 310, 311, 312, 313, 314, 315, 328, 329, 316, 317, 312, 318, 319, 320, 321, 322, 317, 331, 323, 324, 325, 326, 332, 333, 327, 334, 335, 336, 339, 340, 337, 341, 342, 343, 344, 328, 329, 345, 346, 347, 348, 349, 351, 350, 337, 352, 331, 354, 337, 350, 375, 332, 333, 337, 334, 335, 336, 339, 340, 337, 341, 342, 343, 344, 355, 356, 345, 346, 347, 348, 349, 351, 350, 337, 352, 357, 354, 337, 350, 353, 358, 353, 360, 362, 363, 363, 364, 365, 366, 367, 364, 370, 371, 355, 356, 0, 0, 0, 0, 375, 0, 0, 0, 0, 357, 384, 385, 363, 353, 358, 353, 360, 362, 363, 363, 364, 365, 366, 367, 364, 370, 371, 379, 379, 379, 379, 379, 379, 380, 380, 380, 380, 380, 380, 384, 385, 363, 388, 389, 390, 391, 395, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 0, 0, 415, 416, 417, 418, 0, 419, 388, 389, 390, 391, 395, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 414, 419, 413, 420, 421, 422, 414, 423, 427, 429, 430, 432, 433, 434, 435, 436, 437, 439, 440, 441, 442, 445, 446, 413, 414, 447, 448, 449, 0, 414, 457, 461, 420, 421, 422, 414, 423, 427, 429, 430, 432, 433, 434, 435, 436, 437, 439, 440, 441, 442, 445, 446, 455, 450, 447, 448, 449, 450, 462, 457, 461, 465, 466, 455, 468, 470, 472, 473, 474, 475, 476, 477, 478, 479, 0, 480, 482, 483, 484, 0, 486, 455, 450, 470, 487, 488, 450, 462, 489, 490, 465, 466, 455, 468, 470, 472, 473, 474, 475, 476, 477, 478, 491, 479, 480, 482, 483, 484, 485, 486, 485, 492, 470, 487, 488, 493, 494, 489, 490, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 491, 479, 508, 509, 510, 511, 485, 512, 485, 492, 513, 515, 517, 493, 494, 518, 519, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 520, 521, 508, 509, 510, 511, 522, 512, 523, 523, 513, 515, 517, 524, 525, 518, 519, 526, 527, 528, 529, 532, 533, 534, 535, 523, 539, 540, 541, 520, 521, 542, 543, 533, 544, 522, 545, 523, 523, 546, 548, 549, 524, 525, 550, 560, 526, 527, 528, 529, 532, 533, 534, 535, 523, 539, 540, 541, 547, 551, 542, 543, 533, 544, 553, 545, 554, 556, 546, 548, 549, 559, 561, 550, 547, 565, 566, 567, 568, 569, 570, 571, 572, 573, 575, 576, 577, 547, 551, 578, 579, 580, 0, 553, 560, 554, 556, 581, 583, 585, 559, 586, 587, 547, 565, 566, 567, 568, 569, 570, 571, 572, 573, 575, 576, 577, 588, 589, 578, 579, 580, 561, 590, 591, 592, 593, 581, 583, 585, 594, 586, 587, 595, 596, 597, 589, 598, 599, 600, 601, 602, 603, 604, 605, 610, 588, 589, 611, 614, 615, 616, 590, 591, 592, 593, 617, 616, 619, 594, 622, 623, 595, 596, 597, 589, 598, 599, 600, 601, 602, 603, 604, 605, 610, 624, 625, 611, 614, 615, 616, 626, 627, 631, 632, 617, 616, 619, 633, 622, 623, 634, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 624, 625, 650, 651, 652, 653, 626, 627, 631, 632, 657, 658, 659, 633, 660, 661, 634, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 662, 663, 650, 651, 652, 653, 664, 665, 666, 669, 657, 658, 659, 670, 660, 661, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 662, 663, 684, 685, 686, 687, 664, 665, 666, 669, 689, 690, 691, 670, 692, 693, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 694, 695, 684, 685, 686, 687, 698, 699, 700, 701, 689, 690, 691, 702, 692, 693, 705, 706, 707, 708, 709, 710, 714, 715, 716, 717, 719, 721, 723, 694, 695, 724, 726, 727, 728, 698, 699, 700, 701, 729, 730, 732, 702, 734, 735, 705, 706, 707, 708, 709, 710, 714, 715, 716, 717, 719, 721, 723, 736, 737, 724, 726, 727, 728, 738, 739, 740, 741, 729, 730, 732, 742, 734, 735, 743, 744, 739, 746, 747, 748, 751, 753, 755, 756, 758, 759, 760, 736, 737, 763, 765, 766, 767, 738, 739, 740, 741, 768, 769, 770, 742, 771, 772, 743, 744, 739, 746, 747, 748, 751, 753, 755, 756, 758, 759, 760, 773, 774, 763, 765, 766, 767, 776, 773, 777, 778, 768, 769, 770, 779, 771, 772, 781, 782, 773, 783, 784, 785, 786, 787, 788, 789, 791, 794, 795, 773, 774, 796, 800, 803, 804, 776, 773, 777, 778, 805, 807, 808, 779, 809, 810, 781, 782, 773, 783, 784, 785, 786, 787, 788, 789, 791, 794, 795, 811, 812, 796, 800, 803, 804, 813, 814, 815, 816, 805, 807, 808, 818, 809, 810, 817, 819, 820, 821, 822, 823, 824, 826, 828, 830, 831, 833, 834, 811, 812, 835, 836, 837, 839, 813, 814, 815, 816, 842, 845, 817, 818, 846, 847, 850, 819, 820, 821, 822, 823, 824, 826, 828, 830, 831, 833, 834, 851, 852, 835, 836, 837, 839, 853, 854, 855, 856, 842, 845, 817, 857, 846, 847, 850, 862, 863, 864, 868, 869, 870, 871, 872, 874, 877, 878, 879, 851, 852, 880, 881, 870, 882, 853, 854, 855, 856, 883, 884, 886, 857, 888, 889, 891, 862, 863, 864, 868, 869, 870, 871, 872, 874, 877, 878, 879, 885, 892, 880, 881, 870, 882, 885, 893, 895, 897, 883, 884, 886, 898, 888, 889, 891, 902, 904, 905, 906, 907, 909, 910, 911, 912, 914, 915, 916, 885, 892, 917, 919, 920, 921, 885, 893, 895, 897, 922, 923, 924, 898, 927, 928, 929, 902, 904, 905, 906, 907, 909, 910, 911, 912, 914, 915, 916, 930, 931, 917, 919, 920, 921, 933, 934, 935, 936, 922, 923, 924, 937, 927, 928, 929, 938, 941, 946, 947, 948, 950, 940, 951, 953, 954, 955, 956, 930, 931, 957, 959, 962, 963, 933, 934, 935, 936, 940, 940, 964, 937, 965, 966, 967, 938, 941, 946, 947, 948, 950, 940, 951, 953, 954, 955, 956, 968, 970, 957, 959, 962, 963, 972, 974, 975, 976, 940, 940, 964, 977, 965, 966, 967, 979, 980, 981, 983, 985, 986, 988, 991, 992, 993, 994, 999, 968, 970, 1000, 1001, 1002, 1004, 972, 974, 975, 976, 1007, 1008, 1009, 977, 1010, 1014, 1015, 979, 980, 981, 983, 985, 986, 988, 991, 992, 993, 994, 999, 1016, 1017, 1000, 1001, 1002, 1004, 1018, 1019, 1020, 1021, 1007, 1008, 1009, 1022, 1010, 1014, 1015, 1023, 1024, 1025, 1026, 1028, 1030, 1031, 1032, 1033, 1034, 1035, 1038, 1016, 1017, 1039, 1042, 1043, 1044, 1018, 1019, 1020, 1021, 1045, 1047, 1050, 1022, 1052, 1054, 1055, 1023, 1024, 1025, 1026, 1028, 1030, 1031, 1032, 1033, 1034, 1035, 1038, 1056, 1058, 1039, 1042, 1043, 1044, 1059, 1060, 1061, 1064, 1045, 1047, 1050, 1065, 1052, 1054, 1055, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1075, 1076, 1078, 1079, 1082, 1056, 1058, 1083, 1085, 1086, 1087, 1059, 1060, 1061, 1064, 1088, 1090, 1091, 1065, 1093, 1094, 1095, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1075, 1076, 1078, 1079, 1082, 1096, 1097, 1083, 1085, 1086, 1087, 1098, 1100, 1101, 1105, 1088, 1090, 1091, 1106, 1093, 1094, 1095, 1107, 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1096, 1097, 1121, 1123, 1124, 1125, 1098, 1100, 1101, 1105, 1126, 1127, 1129, 1106, 1130, 1131, 1133, 1107, 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1135, 1136, 1121, 1123, 1124, 1125, 1137, 1138, 1139, 1141, 1126, 1127, 1129, 1142, 1130, 1131, 1133, 1143, 1146, 1147, 1148, 1150, 1151, 1152, 1153, 1154, 1158, 1159, 1160, 1135, 1136, 1162, 1163, 1164, 1167, 1137, 1138, 1139, 1141, 1168, 1170, 1171, 1142, 1172, 1173, 1174, 1143, 1146, 1147, 1148, 1150, 1151, 1152, 1153, 1154, 1158, 1159, 1160, 1175, 1176, 1162, 1163, 1164, 1167, 1178, 1179, 1180, 1181, 1168, 1170, 1171, 1184, 1172, 1173, 1174, 1185, 1186, 1187, 1191, 0, 0, 0, 0, 0, 0, 0, 0, 1175, 1176, 0, 0, 0, 0, 1178, 1179, 1180, 1181, 0, 0, 0, 1184, 0, 0, 0, 1185, 1186, 1187, 1191, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1196, 0, 1196, 1196, 1196, 1196, 1196, 1196, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1198, 1198, 1198, 1198, 1198, 1198, 1199, 1199, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1202, 1202, 1202, 1202, 1202, 1202, 1202, 1202, 1204, 1204, 0, 1204, 1204, 1204, 1204, 1204, 1205, 1205, 1205, 1205, 0, 1205, 1205, 1205, 1206, 1206, 1206, 1206, 1206, 1206, 1206, 1208, 1208, 1208, 1208, 1208, 1208, 1208, 1209, 0, 1209, 1209, 1209, 1209, 1209, 1209, 1210, 0, 1210, 1210, 1210, 1210, 1210, 1210, 1211, 0, 1211, 1211, 1211, 1211, 1211, 1211, 1212, 0, 1212, 1212, 1212, 1212, 1212, 1212, 1213, 0, 1213, 1213, 1213, 1213, 1213, 1213, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193 } ; /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[276] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lpmysql.l" /* Companion source code for "flex & bison", published by O'Reilly * Media, ISBN 978-0-596-15597-1 * Copyright (c) 2009, Taughannock Networks. All rights reserved. * See the README file for license conditions and contact info. * $Header: /home/johnl/flnb/code/sql/RCS/lpmysql.l,v 2.1 2009/11/08 02:53:39 johnl Exp $ */ /* * Scanner for mysql subset * With error reporting and recovery */ #line 14 "lpmysql.l" #include "lpmysql.tab.h" #include <stdarg.h> #include <string.h> void yyerror(char *s, ...); int oldstate; /* handle locations */ int yycolumn = 1; #define YY_USER_ACTION yylloc.filename = filename; \ yylloc.first_line = yylloc.last_line = yylineno; \ yylloc.first_column = yycolumn; yylloc.last_column = yycolumn+yyleng-1; \ yycolumn += yyleng; #line 1511 "lpmysql.c" #define INITIAL 0 #define COMMENT 1 #define BTWMODE 2 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include <unistd.h> #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); yy_size_t yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 35 "lpmysql.l" /* keywords */ #line 1700 "lpmysql.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1194 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 2615 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { yy_size_t yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) yylineno++; ; } do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 39 "lpmysql.l" { return ADD; } YY_BREAK case 2: YY_RULE_SETUP #line 40 "lpmysql.l" { return ALL; } YY_BREAK case 3: YY_RULE_SETUP #line 41 "lpmysql.l" { return ALTER; } YY_BREAK case 4: YY_RULE_SETUP #line 42 "lpmysql.l" { return ANALYZE; } YY_BREAK /* Hack for BETWEEN ... AND ... * return special AND token if BETWEEN seen */ case 5: YY_RULE_SETUP #line 47 "lpmysql.l" { BEGIN INITIAL; return AND; } YY_BREAK case 6: YY_RULE_SETUP #line 48 "lpmysql.l" { return ANDOP; } YY_BREAK case 7: YY_RULE_SETUP #line 49 "lpmysql.l" { return ANY; } YY_BREAK case 8: YY_RULE_SETUP #line 50 "lpmysql.l" { return AS; } YY_BREAK case 9: YY_RULE_SETUP #line 51 "lpmysql.l" { return ASC; } YY_BREAK case 10: YY_RULE_SETUP #line 52 "lpmysql.l" { return AUTO_INCREMENT; } YY_BREAK case 11: YY_RULE_SETUP #line 53 "lpmysql.l" { return BEFORE; } YY_BREAK case 12: YY_RULE_SETUP #line 54 "lpmysql.l" { BEGIN BTWMODE; return BETWEEN; } YY_BREAK case 13: YY_RULE_SETUP #line 55 "lpmysql.l" { return BIGINT; } YY_BREAK case 14: YY_RULE_SETUP #line 56 "lpmysql.l" { return BINARY; } YY_BREAK case 15: YY_RULE_SETUP #line 57 "lpmysql.l" { return BIT; } YY_BREAK case 16: YY_RULE_SETUP #line 58 "lpmysql.l" { return BLOB; } YY_BREAK case 17: YY_RULE_SETUP #line 59 "lpmysql.l" { return BOTH; } YY_BREAK case 18: YY_RULE_SETUP #line 60 "lpmysql.l" { return BY; } YY_BREAK case 19: YY_RULE_SETUP #line 61 "lpmysql.l" { return CALL; } YY_BREAK case 20: YY_RULE_SETUP #line 62 "lpmysql.l" { return CASCADE; } YY_BREAK case 21: YY_RULE_SETUP #line 63 "lpmysql.l" { return CASE; } YY_BREAK case 22: YY_RULE_SETUP #line 64 "lpmysql.l" { return CHANGE; } YY_BREAK case 23: YY_RULE_SETUP #line 65 "lpmysql.l" { return CHAR; } YY_BREAK case 24: YY_RULE_SETUP #line 66 "lpmysql.l" { return CHECK; } YY_BREAK case 25: YY_RULE_SETUP #line 67 "lpmysql.l" { return COLLATE; } YY_BREAK case 26: YY_RULE_SETUP #line 68 "lpmysql.l" { return COLUMN; } YY_BREAK case 27: YY_RULE_SETUP #line 69 "lpmysql.l" { return COMMENT; } YY_BREAK case 28: YY_RULE_SETUP #line 70 "lpmysql.l" { return CONDITION; } YY_BREAK case 29: YY_RULE_SETUP #line 71 "lpmysql.l" { return CONSTRAINT; } YY_BREAK case 30: YY_RULE_SETUP #line 72 "lpmysql.l" { return CONTINUE; } YY_BREAK case 31: YY_RULE_SETUP #line 73 "lpmysql.l" { return CONVERT; } YY_BREAK case 32: YY_RULE_SETUP #line 74 "lpmysql.l" { return CREATE; } YY_BREAK case 33: YY_RULE_SETUP #line 75 "lpmysql.l" { return CROSS; } YY_BREAK case 34: YY_RULE_SETUP #line 76 "lpmysql.l" { return CURRENT_DATE; } YY_BREAK case 35: YY_RULE_SETUP #line 77 "lpmysql.l" { return CURRENT_TIME; } YY_BREAK case 36: YY_RULE_SETUP #line 78 "lpmysql.l" { return CURRENT_TIMESTAMP; } YY_BREAK case 37: YY_RULE_SETUP #line 79 "lpmysql.l" { return CURRENT_USER; } YY_BREAK case 38: YY_RULE_SETUP #line 80 "lpmysql.l" { return CURSOR; } YY_BREAK case 39: YY_RULE_SETUP #line 81 "lpmysql.l" { return DATABASE; } YY_BREAK case 40: YY_RULE_SETUP #line 82 "lpmysql.l" { return DATABASES; } YY_BREAK case 41: YY_RULE_SETUP #line 83 "lpmysql.l" { return DATE; } YY_BREAK case 42: YY_RULE_SETUP #line 84 "lpmysql.l" { return DATETIME; } YY_BREAK case 43: YY_RULE_SETUP #line 85 "lpmysql.l" { return DAY_HOUR; } YY_BREAK case 44: YY_RULE_SETUP #line 86 "lpmysql.l" { return DAY_MICROSECOND; } YY_BREAK case 45: YY_RULE_SETUP #line 87 "lpmysql.l" { return DAY_MINUTE; } YY_BREAK case 46: YY_RULE_SETUP #line 88 "lpmysql.l" { return DAY_SECOND; } YY_BREAK case 47: YY_RULE_SETUP #line 89 "lpmysql.l" { return DECIMAL; } YY_BREAK case 48: YY_RULE_SETUP #line 90 "lpmysql.l" { return DECLARE; } YY_BREAK case 49: YY_RULE_SETUP #line 91 "lpmysql.l" { return DEFAULT; } YY_BREAK case 50: YY_RULE_SETUP #line 92 "lpmysql.l" { return DELAYED; } YY_BREAK case 51: YY_RULE_SETUP #line 93 "lpmysql.l" { return DELETE; } YY_BREAK case 52: YY_RULE_SETUP #line 94 "lpmysql.l" { return DESC; } YY_BREAK case 53: YY_RULE_SETUP #line 95 "lpmysql.l" { return DESCRIBE; } YY_BREAK case 54: YY_RULE_SETUP #line 96 "lpmysql.l" { return DETERMINISTIC; } YY_BREAK case 55: YY_RULE_SETUP #line 97 "lpmysql.l" { return DISTINCT; } YY_BREAK case 56: YY_RULE_SETUP #line 98 "lpmysql.l" { return DISTINCTROW; } YY_BREAK case 57: YY_RULE_SETUP #line 99 "lpmysql.l" { return DIV; } YY_BREAK case 58: YY_RULE_SETUP #line 100 "lpmysql.l" { return DOUBLE; } YY_BREAK case 59: YY_RULE_SETUP #line 101 "lpmysql.l" { return DROP; } YY_BREAK case 60: YY_RULE_SETUP #line 102 "lpmysql.l" { return DUAL; } YY_BREAK case 61: YY_RULE_SETUP #line 103 "lpmysql.l" { return EACH; } YY_BREAK case 62: YY_RULE_SETUP #line 104 "lpmysql.l" { return ELSE; } YY_BREAK case 63: YY_RULE_SETUP #line 105 "lpmysql.l" { return ELSEIF; } YY_BREAK case 64: YY_RULE_SETUP #line 106 "lpmysql.l" { return END; } YY_BREAK case 65: YY_RULE_SETUP #line 107 "lpmysql.l" { return ENUM; } YY_BREAK case 66: YY_RULE_SETUP #line 108 "lpmysql.l" { return ESCAPED; } YY_BREAK case 67: YY_RULE_SETUP #line 109 "lpmysql.l" { yylval.subtok = 0; return EXISTS; } YY_BREAK case 68: YY_RULE_SETUP #line 110 "lpmysql.l" { yylval.subtok = 1; return EXISTS; } YY_BREAK case 69: YY_RULE_SETUP #line 111 "lpmysql.l" { return EXIT; } YY_BREAK case 70: YY_RULE_SETUP #line 112 "lpmysql.l" { return EXPLAIN; } YY_BREAK case 71: YY_RULE_SETUP #line 113 "lpmysql.l" { return FETCH; } YY_BREAK case 72: YY_RULE_SETUP #line 114 "lpmysql.l" { return FLOAT; } YY_BREAK case 73: YY_RULE_SETUP #line 115 "lpmysql.l" { return FOR; } YY_BREAK case 74: YY_RULE_SETUP #line 116 "lpmysql.l" { return FORCE; } YY_BREAK case 75: YY_RULE_SETUP #line 117 "lpmysql.l" { return FOREIGN; } YY_BREAK case 76: YY_RULE_SETUP #line 118 "lpmysql.l" { return FROM; } YY_BREAK case 77: YY_RULE_SETUP #line 119 "lpmysql.l" { return FULLTEXT; } YY_BREAK case 78: YY_RULE_SETUP #line 120 "lpmysql.l" { return GRANT; } YY_BREAK case 79: YY_RULE_SETUP #line 121 "lpmysql.l" { return GROUP; } YY_BREAK case 80: YY_RULE_SETUP #line 122 "lpmysql.l" { return HAVING; } YY_BREAK case 81: YY_RULE_SETUP #line 123 "lpmysql.l" { return HIGH_PRIORITY; } YY_BREAK case 82: YY_RULE_SETUP #line 124 "lpmysql.l" { return HOUR_MICROSECOND; } YY_BREAK case 83: YY_RULE_SETUP #line 125 "lpmysql.l" { return HOUR_MINUTE; } YY_BREAK case 84: YY_RULE_SETUP #line 126 "lpmysql.l" { return HOUR_SECOND; } YY_BREAK case 85: YY_RULE_SETUP #line 127 "lpmysql.l" { return IF; } YY_BREAK case 86: YY_RULE_SETUP #line 128 "lpmysql.l" { return IGNORE; } YY_BREAK case 87: YY_RULE_SETUP #line 129 "lpmysql.l" { return IN; } YY_BREAK case 88: YY_RULE_SETUP #line 130 "lpmysql.l" { return INFILE; } YY_BREAK case 89: YY_RULE_SETUP #line 131 "lpmysql.l" { return INNER; } YY_BREAK case 90: YY_RULE_SETUP #line 132 "lpmysql.l" { return INOUT; } YY_BREAK case 91: YY_RULE_SETUP #line 133 "lpmysql.l" { return INSENSITIVE; } YY_BREAK case 92: YY_RULE_SETUP #line 134 "lpmysql.l" { return INSERT; } YY_BREAK case 93: YY_RULE_SETUP #line 135 "lpmysql.l" { return INTEGER; } YY_BREAK case 94: YY_RULE_SETUP #line 136 "lpmysql.l" { return INTERVAL; } YY_BREAK case 95: YY_RULE_SETUP #line 137 "lpmysql.l" { return INTO; } YY_BREAK case 96: YY_RULE_SETUP #line 138 "lpmysql.l" { return IS; } YY_BREAK case 97: YY_RULE_SETUP #line 139 "lpmysql.l" { return ITERATE; } YY_BREAK case 98: YY_RULE_SETUP #line 140 "lpmysql.l" { return JOIN; } YY_BREAK case 99: YY_RULE_SETUP #line 141 "lpmysql.l" { return KEY; } YY_BREAK case 100: YY_RULE_SETUP #line 142 "lpmysql.l" { return KEYS; } YY_BREAK case 101: YY_RULE_SETUP #line 143 "lpmysql.l" { return KILL; } YY_BREAK case 102: YY_RULE_SETUP #line 144 "lpmysql.l" { return LEADING; } YY_BREAK case 103: YY_RULE_SETUP #line 145 "lpmysql.l" { return LEAVE; } YY_BREAK case 104: YY_RULE_SETUP #line 146 "lpmysql.l" { return LEFT; } YY_BREAK case 105: YY_RULE_SETUP #line 147 "lpmysql.l" { return LIKE; } YY_BREAK case 106: YY_RULE_SETUP #line 148 "lpmysql.l" { return LIMIT; } YY_BREAK case 107: YY_RULE_SETUP #line 149 "lpmysql.l" { return LINES; } YY_BREAK case 108: YY_RULE_SETUP #line 150 "lpmysql.l" { return LOAD; } YY_BREAK case 109: YY_RULE_SETUP #line 151 "lpmysql.l" { return LOCALTIME; } YY_BREAK case 110: YY_RULE_SETUP #line 152 "lpmysql.l" { return LOCALTIMESTAMP; } YY_BREAK case 111: YY_RULE_SETUP #line 153 "lpmysql.l" { return LOCK; } YY_BREAK case 112: YY_RULE_SETUP #line 154 "lpmysql.l" { return LONG; } YY_BREAK case 113: YY_RULE_SETUP #line 155 "lpmysql.l" { return LONGBLOB; } YY_BREAK case 114: YY_RULE_SETUP #line 156 "lpmysql.l" { return LONGTEXT; } YY_BREAK case 115: YY_RULE_SETUP #line 157 "lpmysql.l" { return LOOP; } YY_BREAK case 116: YY_RULE_SETUP #line 158 "lpmysql.l" { return LOW_PRIORITY; } YY_BREAK case 117: YY_RULE_SETUP #line 159 "lpmysql.l" { return MATCH; } YY_BREAK case 118: YY_RULE_SETUP #line 160 "lpmysql.l" { return MEDIUMBLOB; } YY_BREAK case 119: YY_RULE_SETUP #line 161 "lpmysql.l" { return MEDIUMINT; } YY_BREAK case 120: YY_RULE_SETUP #line 162 "lpmysql.l" { return MEDIUMTEXT; } YY_BREAK case 121: YY_RULE_SETUP #line 163 "lpmysql.l" { return MINUTE_MICROSECOND; } YY_BREAK case 122: YY_RULE_SETUP #line 164 "lpmysql.l" { return MINUTE_SECOND; } YY_BREAK case 123: YY_RULE_SETUP #line 165 "lpmysql.l" { return MOD; } YY_BREAK case 124: YY_RULE_SETUP #line 166 "lpmysql.l" { return MODIFIES; } YY_BREAK case 125: YY_RULE_SETUP #line 167 "lpmysql.l" { return NATURAL; } YY_BREAK case 126: YY_RULE_SETUP #line 168 "lpmysql.l" { return NOT; } YY_BREAK case 127: YY_RULE_SETUP #line 169 "lpmysql.l" { return NO_WRITE_TO_BINLOG; } YY_BREAK case 128: YY_RULE_SETUP #line 170 "lpmysql.l" { return NULLX; } YY_BREAK case 129: YY_RULE_SETUP #line 171 "lpmysql.l" { return NUMBER; } YY_BREAK case 130: YY_RULE_SETUP #line 172 "lpmysql.l" { return ON; } YY_BREAK case 131: YY_RULE_SETUP #line 173 "lpmysql.l" { return ONDUPLICATE; } /* hack due to limited lookahead */ YY_BREAK case 132: YY_RULE_SETUP #line 174 "lpmysql.l" { return OPTIMIZE; } YY_BREAK case 133: YY_RULE_SETUP #line 175 "lpmysql.l" { return OPTION; } YY_BREAK case 134: YY_RULE_SETUP #line 176 "lpmysql.l" { return OPTIONALLY; } YY_BREAK case 135: YY_RULE_SETUP #line 177 "lpmysql.l" { return OR; } YY_BREAK case 136: YY_RULE_SETUP #line 178 "lpmysql.l" { return ORDER; } YY_BREAK case 137: YY_RULE_SETUP #line 179 "lpmysql.l" { return OUT; } YY_BREAK case 138: YY_RULE_SETUP #line 180 "lpmysql.l" { return OUTER; } YY_BREAK case 139: YY_RULE_SETUP #line 181 "lpmysql.l" { return OUTFILE; } YY_BREAK case 140: YY_RULE_SETUP #line 182 "lpmysql.l" { return PRECISION; } YY_BREAK case 141: YY_RULE_SETUP #line 183 "lpmysql.l" { return PRIMARY; } YY_BREAK case 142: YY_RULE_SETUP #line 184 "lpmysql.l" { return PROCEDURE; } YY_BREAK case 143: YY_RULE_SETUP #line 185 "lpmysql.l" { return PURGE; } YY_BREAK case 144: YY_RULE_SETUP #line 186 "lpmysql.l" { return QUICK; } YY_BREAK case 145: YY_RULE_SETUP #line 187 "lpmysql.l" { return READ; } YY_BREAK case 146: YY_RULE_SETUP #line 188 "lpmysql.l" { return READS; } YY_BREAK case 147: YY_RULE_SETUP #line 189 "lpmysql.l" { return REAL; } YY_BREAK case 148: YY_RULE_SETUP #line 190 "lpmysql.l" { return REFERENCES; } YY_BREAK case 149: YY_RULE_SETUP #line 191 "lpmysql.l" { return REGEXP; } YY_BREAK case 150: YY_RULE_SETUP #line 192 "lpmysql.l" { return RELEASE; } YY_BREAK case 151: YY_RULE_SETUP #line 193 "lpmysql.l" { return RENAME; } YY_BREAK case 152: YY_RULE_SETUP #line 194 "lpmysql.l" { return REPEAT; } YY_BREAK case 153: YY_RULE_SETUP #line 195 "lpmysql.l" { return REPLACE; } YY_BREAK case 154: YY_RULE_SETUP #line 196 "lpmysql.l" { return REQUIRE; } YY_BREAK case 155: YY_RULE_SETUP #line 197 "lpmysql.l" { return RESTRICT; } YY_BREAK case 156: YY_RULE_SETUP #line 198 "lpmysql.l" { return RETURN; } YY_BREAK case 157: YY_RULE_SETUP #line 199 "lpmysql.l" { return REVOKE; } YY_BREAK case 158: YY_RULE_SETUP #line 200 "lpmysql.l" { return RIGHT; } YY_BREAK case 159: YY_RULE_SETUP #line 201 "lpmysql.l" { return ROLLUP; } YY_BREAK case 160: YY_RULE_SETUP #line 202 "lpmysql.l" { return SCHEMA; } YY_BREAK case 161: YY_RULE_SETUP #line 203 "lpmysql.l" { return SCHEMAS; } YY_BREAK case 162: YY_RULE_SETUP #line 204 "lpmysql.l" { return SECOND_MICROSECOND; } YY_BREAK case 163: YY_RULE_SETUP #line 205 "lpmysql.l" { return SELECT; } YY_BREAK case 164: YY_RULE_SETUP #line 206 "lpmysql.l" { return SENSITIVE; } YY_BREAK case 165: YY_RULE_SETUP #line 207 "lpmysql.l" { return SEPARATOR; } YY_BREAK case 166: YY_RULE_SETUP #line 208 "lpmysql.l" { return SET; } YY_BREAK case 167: YY_RULE_SETUP #line 209 "lpmysql.l" { return SHOW; } YY_BREAK case 168: YY_RULE_SETUP #line 210 "lpmysql.l" { return SMALLINT; } YY_BREAK case 169: YY_RULE_SETUP #line 211 "lpmysql.l" { return SOME; } YY_BREAK case 170: YY_RULE_SETUP #line 212 "lpmysql.l" { return SONAME; } YY_BREAK case 171: YY_RULE_SETUP #line 213 "lpmysql.l" { return SPATIAL; } YY_BREAK case 172: YY_RULE_SETUP #line 214 "lpmysql.l" { return SPECIFIC; } YY_BREAK case 173: YY_RULE_SETUP #line 215 "lpmysql.l" { return SQL; } YY_BREAK case 174: YY_RULE_SETUP #line 216 "lpmysql.l" { return SQLEXCEPTION; } YY_BREAK case 175: YY_RULE_SETUP #line 217 "lpmysql.l" { return SQLSTATE; } YY_BREAK case 176: YY_RULE_SETUP #line 218 "lpmysql.l" { return SQLWARNING; } YY_BREAK case 177: YY_RULE_SETUP #line 219 "lpmysql.l" { return SQL_BIG_RESULT; } YY_BREAK case 178: YY_RULE_SETUP #line 220 "lpmysql.l" { return SQL_CALC_FOUND_ROWS; } YY_BREAK case 179: YY_RULE_SETUP #line 221 "lpmysql.l" { return SQL_SMALL_RESULT; } YY_BREAK case 180: YY_RULE_SETUP #line 222 "lpmysql.l" { return SSL; } YY_BREAK case 181: YY_RULE_SETUP #line 223 "lpmysql.l" { return STARTING; } YY_BREAK case 182: YY_RULE_SETUP #line 224 "lpmysql.l" { return STRAIGHT_JOIN; } YY_BREAK case 183: YY_RULE_SETUP #line 225 "lpmysql.l" { return TABLE; } YY_BREAK case 184: YY_RULE_SETUP #line 226 "lpmysql.l" { return TEMPORARY; } YY_BREAK case 185: YY_RULE_SETUP #line 227 "lpmysql.l" { return TERMINATED; } YY_BREAK case 186: YY_RULE_SETUP #line 228 "lpmysql.l" { return TEXT; } YY_BREAK case 187: YY_RULE_SETUP #line 229 "lpmysql.l" { return THEN; } YY_BREAK case 188: YY_RULE_SETUP #line 230 "lpmysql.l" { return TIME; } YY_BREAK case 189: YY_RULE_SETUP #line 231 "lpmysql.l" { return TIMESTAMP; } YY_BREAK case 190: YY_RULE_SETUP #line 232 "lpmysql.l" { return TINYINT; } YY_BREAK case 191: YY_RULE_SETUP #line 233 "lpmysql.l" { return TINYTEXT; } YY_BREAK case 192: YY_RULE_SETUP #line 234 "lpmysql.l" { return TO; } YY_BREAK case 193: YY_RULE_SETUP #line 235 "lpmysql.l" { return TRAILING; } YY_BREAK case 194: YY_RULE_SETUP #line 236 "lpmysql.l" { return TRIGGER; } YY_BREAK case 195: YY_RULE_SETUP #line 237 "lpmysql.l" { return UNDO; } YY_BREAK case 196: YY_RULE_SETUP #line 238 "lpmysql.l" { return UNION; } YY_BREAK case 197: YY_RULE_SETUP #line 239 "lpmysql.l" { return UNIQUE; } YY_BREAK case 198: YY_RULE_SETUP #line 240 "lpmysql.l" { return UNLOCK; } YY_BREAK case 199: YY_RULE_SETUP #line 241 "lpmysql.l" { return UNSIGNED; } YY_BREAK case 200: YY_RULE_SETUP #line 242 "lpmysql.l" { return UPDATE; } YY_BREAK case 201: YY_RULE_SETUP #line 243 "lpmysql.l" { return USAGE; } YY_BREAK case 202: YY_RULE_SETUP #line 244 "lpmysql.l" { return USE; } YY_BREAK case 203: YY_RULE_SETUP #line 245 "lpmysql.l" { return USING; } YY_BREAK case 204: YY_RULE_SETUP #line 246 "lpmysql.l" { return UTC_DATE; } YY_BREAK case 205: YY_RULE_SETUP #line 247 "lpmysql.l" { return UTC_TIME; } YY_BREAK case 206: YY_RULE_SETUP #line 248 "lpmysql.l" { return UTC_TIMESTAMP; } YY_BREAK case 207: YY_RULE_SETUP #line 249 "lpmysql.l" { return VALUES; } YY_BREAK case 208: YY_RULE_SETUP #line 250 "lpmysql.l" { return VARBINARY; } YY_BREAK case 209: YY_RULE_SETUP #line 251 "lpmysql.l" { return VARCHAR; } YY_BREAK case 210: YY_RULE_SETUP #line 252 "lpmysql.l" { return VARYING; } YY_BREAK case 211: YY_RULE_SETUP #line 253 "lpmysql.l" { return WHEN; } YY_BREAK case 212: YY_RULE_SETUP #line 254 "lpmysql.l" { return WHERE; } YY_BREAK case 213: YY_RULE_SETUP #line 255 "lpmysql.l" { return WHILE; } YY_BREAK case 214: YY_RULE_SETUP #line 256 "lpmysql.l" { return WITH; } YY_BREAK case 215: YY_RULE_SETUP #line 257 "lpmysql.l" { return WRITE; } YY_BREAK case 216: YY_RULE_SETUP #line 258 "lpmysql.l" { return XOR; } YY_BREAK case 217: YY_RULE_SETUP #line 259 "lpmysql.l" { return YEAR; } YY_BREAK case 218: YY_RULE_SETUP #line 260 "lpmysql.l" { return YEAR_MONTH; } YY_BREAK case 219: YY_RULE_SETUP #line 261 "lpmysql.l" { return ZEROFILL; } YY_BREAK /* numbers */ case 220: YY_RULE_SETUP #line 265 "lpmysql.l" { yylval.intval = atoi(yytext); return INTNUM; } YY_BREAK case 221: #line 268 "lpmysql.l" case 222: #line 269 "lpmysql.l" case 223: #line 270 "lpmysql.l" case 224: #line 271 "lpmysql.l" case 225: YY_RULE_SETUP #line 271 "lpmysql.l" { yylval.floatval = atof(yytext) ; return APPROXNUM; } YY_BREAK /* booleans */ case 226: YY_RULE_SETUP #line 274 "lpmysql.l" { yylval.intval = 1; return BOOL; } YY_BREAK case 227: YY_RULE_SETUP #line 275 "lpmysql.l" { yylval.intval = -1; return BOOL; } YY_BREAK case 228: YY_RULE_SETUP #line 276 "lpmysql.l" { yylval.intval = 0; return BOOL; } YY_BREAK /* strings */ case 229: #line 281 "lpmysql.l" case 230: YY_RULE_SETUP #line 281 "lpmysql.l" { yylval.strval = strdup(yytext); return STRING; } YY_BREAK case 231: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 283 "lpmysql.l" { yyerror("Unterminated string %s", yytext); } YY_BREAK case 232: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 284 "lpmysql.l" { yyerror("Unterminated string %s", yytext); } YY_BREAK /* hex strings */ case 233: #line 288 "lpmysql.l" case 234: YY_RULE_SETUP #line 288 "lpmysql.l" { yylval.strval = strdup(yytext); return STRING; } YY_BREAK /* bit strings */ case 235: #line 293 "lpmysql.l" case 236: YY_RULE_SETUP #line 293 "lpmysql.l" { yylval.strval = strdup(yytext); return STRING; } YY_BREAK /* operators */ case 237: YY_RULE_SETUP #line 297 "lpmysql.l" { return yytext[0]; } YY_BREAK case 238: YY_RULE_SETUP #line 299 "lpmysql.l" { return ANDOP; } YY_BREAK case 239: YY_RULE_SETUP #line 300 "lpmysql.l" { return OR; } YY_BREAK case 240: YY_RULE_SETUP #line 302 "lpmysql.l" { yylval.subtok = 4; return COMPARISON; } YY_BREAK case 241: YY_RULE_SETUP #line 303 "lpmysql.l" { yylval.subtok = 12; return COMPARISON; } YY_BREAK case 242: YY_RULE_SETUP #line 304 "lpmysql.l" { yylval.subtok = 6; return COMPARISON; } YY_BREAK case 243: YY_RULE_SETUP #line 305 "lpmysql.l" { yylval.subtok = 2; return COMPARISON; } YY_BREAK case 244: YY_RULE_SETUP #line 306 "lpmysql.l" { yylval.subtok = 5; return COMPARISON; } YY_BREAK case 245: YY_RULE_SETUP #line 307 "lpmysql.l" { yylval.subtok = 1; return COMPARISON; } YY_BREAK case 246: #line 309 "lpmysql.l" case 247: YY_RULE_SETUP #line 309 "lpmysql.l" { yylval.subtok = 3; return COMPARISON; } YY_BREAK case 248: YY_RULE_SETUP #line 311 "lpmysql.l" { yylval.subtok = 1; return SHIFT; } YY_BREAK case 249: YY_RULE_SETUP #line 312 "lpmysql.l" { yylval.subtok = 2; return SHIFT; } YY_BREAK /* functions */ case 250: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 316 "lpmysql.l" { return FSUBSTRING; } YY_BREAK case 251: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 4; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 317 "lpmysql.l" { return FTRIM; } YY_BREAK case 252: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 8; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 318 "lpmysql.l" { return FDATE_ADD; } YY_BREAK case 253: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 8; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 319 "lpmysql.l" { return FDATE_SUB; } YY_BREAK /* * peek ahead and return function if name( */ case 254: YY_RULE_SETUP #line 324 "lpmysql.l" { int c = input(); unput(c); if(c == '(') return FCOUNT; yylval.strval = strdup(yytext); return NAME; } YY_BREAK case 255: YY_RULE_SETUP #line 329 "lpmysql.l" { yylval.strval = strdup(yytext); return NAME; } YY_BREAK case 256: YY_RULE_SETUP #line 331 "lpmysql.l" { yylval.strval = strdup(yytext+1); yylval.strval[yyleng-2] = 0; return NAME; } YY_BREAK case 257: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 335 "lpmysql.l" { yyerror("unterminated quoted name %s", yytext); } YY_BREAK /* user variables */ case 258: #line 339 "lpmysql.l" case 259: #line 340 "lpmysql.l" case 260: #line 341 "lpmysql.l" case 261: YY_RULE_SETUP #line 341 "lpmysql.l" { yylval.strval = strdup(yytext+1); return USERVAR; } YY_BREAK case 262: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 343 "lpmysql.l" { yyerror("unterminated quoted user variable %s", yytext); } YY_BREAK case 263: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 344 "lpmysql.l" { yyerror("unterminated quoted user variable %s", yytext); } YY_BREAK case 264: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 345 "lpmysql.l" { yyerror("unterminated quoted user variable %s", yytext); } YY_BREAK case 265: YY_RULE_SETUP #line 348 "lpmysql.l" { return ASSIGN; } YY_BREAK /* comments */ case 266: YY_RULE_SETUP #line 351 "lpmysql.l" ; YY_BREAK case 267: YY_RULE_SETUP #line 352 "lpmysql.l" ; YY_BREAK case 268: YY_RULE_SETUP #line 354 "lpmysql.l" { oldstate = YY_START; BEGIN COMMENT; } YY_BREAK case 269: YY_RULE_SETUP #line 355 "lpmysql.l" { BEGIN oldstate; } YY_BREAK case 270: YY_RULE_SETUP #line 356 "lpmysql.l" ; YY_BREAK case 271: /* rule 271 can match eol */ YY_RULE_SETUP #line 357 "lpmysql.l" { yycolumn = 1; } YY_BREAK case YY_STATE_EOF(COMMENT): #line 358 "lpmysql.l" { yyerror("unclosed comment"); } YY_BREAK /* everything else */ case 272: YY_RULE_SETUP #line 361 "lpmysql.l" /* white space */ YY_BREAK case 273: /* rule 273 can match eol */ YY_RULE_SETUP #line 362 "lpmysql.l" { yycolumn = 1; } YY_BREAK case 274: YY_RULE_SETUP #line 363 "lpmysql.l" { yyerror("mystery character '%c'", *yytext); } YY_BREAK case 275: YY_RULE_SETUP #line 365 "lpmysql.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 3194 "lpmysql.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(BTWMODE): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1194 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1194 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 1193); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; if ( c == '\n' ){ --yylineno; } (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) yylineno++; ; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ yy_size_t yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ /* We do not touch yylineno unless the option is enabled. */ yylineno = 1; (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 365 "lpmysql.l"
30.613793
116
0.586898
[ "object" ]
a0afa69aae46393ec90e1db92882f3df1a1e20f9
122,189
h
C
aws-cpp-sdk-nimble/include/aws/nimble/NimbleStudioClient.h
truthiswill/aws-sdk-cpp
6e854b6a8bc7945f150c3a11551196bda341962a
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-nimble/include/aws/nimble/NimbleStudioClient.h
truthiswill/aws-sdk-cpp
6e854b6a8bc7945f150c3a11551196bda341962a
[ "Apache-2.0" ]
1
2021-10-14T16:57:00.000Z
2021-10-18T10:47:24.000Z
aws-cpp-sdk-nimble/include/aws/nimble/NimbleStudioClient.h
truthiswill/aws-sdk-cpp
6e854b6a8bc7945f150c3a11551196bda341962a
[ "Apache-2.0" ]
null
null
null
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/nimble/NimbleStudio_EXPORTS.h> #include <aws/nimble/NimbleStudioErrors.h> #include <aws/core/client/AWSError.h> #include <aws/core/client/ClientConfiguration.h> #include <aws/core/client/AWSClient.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/nimble/model/AcceptEulasResult.h> #include <aws/nimble/model/CreateLaunchProfileResult.h> #include <aws/nimble/model/CreateStreamingImageResult.h> #include <aws/nimble/model/CreateStreamingSessionResult.h> #include <aws/nimble/model/CreateStreamingSessionStreamResult.h> #include <aws/nimble/model/CreateStudioResult.h> #include <aws/nimble/model/CreateStudioComponentResult.h> #include <aws/nimble/model/DeleteLaunchProfileResult.h> #include <aws/nimble/model/DeleteLaunchProfileMemberResult.h> #include <aws/nimble/model/DeleteStreamingImageResult.h> #include <aws/nimble/model/DeleteStreamingSessionResult.h> #include <aws/nimble/model/DeleteStudioResult.h> #include <aws/nimble/model/DeleteStudioComponentResult.h> #include <aws/nimble/model/DeleteStudioMemberResult.h> #include <aws/nimble/model/GetEulaResult.h> #include <aws/nimble/model/GetLaunchProfileResult.h> #include <aws/nimble/model/GetLaunchProfileDetailsResult.h> #include <aws/nimble/model/GetLaunchProfileInitializationResult.h> #include <aws/nimble/model/GetLaunchProfileMemberResult.h> #include <aws/nimble/model/GetStreamingImageResult.h> #include <aws/nimble/model/GetStreamingSessionResult.h> #include <aws/nimble/model/GetStreamingSessionStreamResult.h> #include <aws/nimble/model/GetStudioResult.h> #include <aws/nimble/model/GetStudioComponentResult.h> #include <aws/nimble/model/GetStudioMemberResult.h> #include <aws/nimble/model/ListEulaAcceptancesResult.h> #include <aws/nimble/model/ListEulasResult.h> #include <aws/nimble/model/ListLaunchProfileMembersResult.h> #include <aws/nimble/model/ListLaunchProfilesResult.h> #include <aws/nimble/model/ListStreamingImagesResult.h> #include <aws/nimble/model/ListStreamingSessionsResult.h> #include <aws/nimble/model/ListStudioComponentsResult.h> #include <aws/nimble/model/ListStudioMembersResult.h> #include <aws/nimble/model/ListStudiosResult.h> #include <aws/nimble/model/ListTagsForResourceResult.h> #include <aws/nimble/model/PutLaunchProfileMembersResult.h> #include <aws/nimble/model/PutStudioMembersResult.h> #include <aws/nimble/model/StartStreamingSessionResult.h> #include <aws/nimble/model/StartStudioSSOConfigurationRepairResult.h> #include <aws/nimble/model/StopStreamingSessionResult.h> #include <aws/nimble/model/TagResourceResult.h> #include <aws/nimble/model/UntagResourceResult.h> #include <aws/nimble/model/UpdateLaunchProfileResult.h> #include <aws/nimble/model/UpdateLaunchProfileMemberResult.h> #include <aws/nimble/model/UpdateStreamingImageResult.h> #include <aws/nimble/model/UpdateStudioResult.h> #include <aws/nimble/model/UpdateStudioComponentResult.h> #include <aws/core/client/AsyncCallerContext.h> #include <aws/core/http/HttpTypes.h> #include <future> #include <functional> namespace Aws { namespace Http { class HttpClient; class HttpClientFactory; } // namespace Http namespace Utils { template< typename R, typename E> class Outcome; namespace Threading { class Executor; } // namespace Threading } // namespace Utils namespace Auth { class AWSCredentials; class AWSCredentialsProvider; } // namespace Auth namespace Client { class RetryStrategy; } // namespace Client namespace NimbleStudio { namespace Model { class AcceptEulasRequest; class CreateLaunchProfileRequest; class CreateStreamingImageRequest; class CreateStreamingSessionRequest; class CreateStreamingSessionStreamRequest; class CreateStudioRequest; class CreateStudioComponentRequest; class DeleteLaunchProfileRequest; class DeleteLaunchProfileMemberRequest; class DeleteStreamingImageRequest; class DeleteStreamingSessionRequest; class DeleteStudioRequest; class DeleteStudioComponentRequest; class DeleteStudioMemberRequest; class GetEulaRequest; class GetLaunchProfileRequest; class GetLaunchProfileDetailsRequest; class GetLaunchProfileInitializationRequest; class GetLaunchProfileMemberRequest; class GetStreamingImageRequest; class GetStreamingSessionRequest; class GetStreamingSessionStreamRequest; class GetStudioRequest; class GetStudioComponentRequest; class GetStudioMemberRequest; class ListEulaAcceptancesRequest; class ListEulasRequest; class ListLaunchProfileMembersRequest; class ListLaunchProfilesRequest; class ListStreamingImagesRequest; class ListStreamingSessionsRequest; class ListStudioComponentsRequest; class ListStudioMembersRequest; class ListStudiosRequest; class ListTagsForResourceRequest; class PutLaunchProfileMembersRequest; class PutStudioMembersRequest; class StartStreamingSessionRequest; class StartStudioSSOConfigurationRepairRequest; class StopStreamingSessionRequest; class TagResourceRequest; class UntagResourceRequest; class UpdateLaunchProfileRequest; class UpdateLaunchProfileMemberRequest; class UpdateStreamingImageRequest; class UpdateStudioRequest; class UpdateStudioComponentRequest; typedef Aws::Utils::Outcome<AcceptEulasResult, NimbleStudioError> AcceptEulasOutcome; typedef Aws::Utils::Outcome<CreateLaunchProfileResult, NimbleStudioError> CreateLaunchProfileOutcome; typedef Aws::Utils::Outcome<CreateStreamingImageResult, NimbleStudioError> CreateStreamingImageOutcome; typedef Aws::Utils::Outcome<CreateStreamingSessionResult, NimbleStudioError> CreateStreamingSessionOutcome; typedef Aws::Utils::Outcome<CreateStreamingSessionStreamResult, NimbleStudioError> CreateStreamingSessionStreamOutcome; typedef Aws::Utils::Outcome<CreateStudioResult, NimbleStudioError> CreateStudioOutcome; typedef Aws::Utils::Outcome<CreateStudioComponentResult, NimbleStudioError> CreateStudioComponentOutcome; typedef Aws::Utils::Outcome<DeleteLaunchProfileResult, NimbleStudioError> DeleteLaunchProfileOutcome; typedef Aws::Utils::Outcome<DeleteLaunchProfileMemberResult, NimbleStudioError> DeleteLaunchProfileMemberOutcome; typedef Aws::Utils::Outcome<DeleteStreamingImageResult, NimbleStudioError> DeleteStreamingImageOutcome; typedef Aws::Utils::Outcome<DeleteStreamingSessionResult, NimbleStudioError> DeleteStreamingSessionOutcome; typedef Aws::Utils::Outcome<DeleteStudioResult, NimbleStudioError> DeleteStudioOutcome; typedef Aws::Utils::Outcome<DeleteStudioComponentResult, NimbleStudioError> DeleteStudioComponentOutcome; typedef Aws::Utils::Outcome<DeleteStudioMemberResult, NimbleStudioError> DeleteStudioMemberOutcome; typedef Aws::Utils::Outcome<GetEulaResult, NimbleStudioError> GetEulaOutcome; typedef Aws::Utils::Outcome<GetLaunchProfileResult, NimbleStudioError> GetLaunchProfileOutcome; typedef Aws::Utils::Outcome<GetLaunchProfileDetailsResult, NimbleStudioError> GetLaunchProfileDetailsOutcome; typedef Aws::Utils::Outcome<GetLaunchProfileInitializationResult, NimbleStudioError> GetLaunchProfileInitializationOutcome; typedef Aws::Utils::Outcome<GetLaunchProfileMemberResult, NimbleStudioError> GetLaunchProfileMemberOutcome; typedef Aws::Utils::Outcome<GetStreamingImageResult, NimbleStudioError> GetStreamingImageOutcome; typedef Aws::Utils::Outcome<GetStreamingSessionResult, NimbleStudioError> GetStreamingSessionOutcome; typedef Aws::Utils::Outcome<GetStreamingSessionStreamResult, NimbleStudioError> GetStreamingSessionStreamOutcome; typedef Aws::Utils::Outcome<GetStudioResult, NimbleStudioError> GetStudioOutcome; typedef Aws::Utils::Outcome<GetStudioComponentResult, NimbleStudioError> GetStudioComponentOutcome; typedef Aws::Utils::Outcome<GetStudioMemberResult, NimbleStudioError> GetStudioMemberOutcome; typedef Aws::Utils::Outcome<ListEulaAcceptancesResult, NimbleStudioError> ListEulaAcceptancesOutcome; typedef Aws::Utils::Outcome<ListEulasResult, NimbleStudioError> ListEulasOutcome; typedef Aws::Utils::Outcome<ListLaunchProfileMembersResult, NimbleStudioError> ListLaunchProfileMembersOutcome; typedef Aws::Utils::Outcome<ListLaunchProfilesResult, NimbleStudioError> ListLaunchProfilesOutcome; typedef Aws::Utils::Outcome<ListStreamingImagesResult, NimbleStudioError> ListStreamingImagesOutcome; typedef Aws::Utils::Outcome<ListStreamingSessionsResult, NimbleStudioError> ListStreamingSessionsOutcome; typedef Aws::Utils::Outcome<ListStudioComponentsResult, NimbleStudioError> ListStudioComponentsOutcome; typedef Aws::Utils::Outcome<ListStudioMembersResult, NimbleStudioError> ListStudioMembersOutcome; typedef Aws::Utils::Outcome<ListStudiosResult, NimbleStudioError> ListStudiosOutcome; typedef Aws::Utils::Outcome<ListTagsForResourceResult, NimbleStudioError> ListTagsForResourceOutcome; typedef Aws::Utils::Outcome<PutLaunchProfileMembersResult, NimbleStudioError> PutLaunchProfileMembersOutcome; typedef Aws::Utils::Outcome<PutStudioMembersResult, NimbleStudioError> PutStudioMembersOutcome; typedef Aws::Utils::Outcome<StartStreamingSessionResult, NimbleStudioError> StartStreamingSessionOutcome; typedef Aws::Utils::Outcome<StartStudioSSOConfigurationRepairResult, NimbleStudioError> StartStudioSSOConfigurationRepairOutcome; typedef Aws::Utils::Outcome<StopStreamingSessionResult, NimbleStudioError> StopStreamingSessionOutcome; typedef Aws::Utils::Outcome<TagResourceResult, NimbleStudioError> TagResourceOutcome; typedef Aws::Utils::Outcome<UntagResourceResult, NimbleStudioError> UntagResourceOutcome; typedef Aws::Utils::Outcome<UpdateLaunchProfileResult, NimbleStudioError> UpdateLaunchProfileOutcome; typedef Aws::Utils::Outcome<UpdateLaunchProfileMemberResult, NimbleStudioError> UpdateLaunchProfileMemberOutcome; typedef Aws::Utils::Outcome<UpdateStreamingImageResult, NimbleStudioError> UpdateStreamingImageOutcome; typedef Aws::Utils::Outcome<UpdateStudioResult, NimbleStudioError> UpdateStudioOutcome; typedef Aws::Utils::Outcome<UpdateStudioComponentResult, NimbleStudioError> UpdateStudioComponentOutcome; typedef std::future<AcceptEulasOutcome> AcceptEulasOutcomeCallable; typedef std::future<CreateLaunchProfileOutcome> CreateLaunchProfileOutcomeCallable; typedef std::future<CreateStreamingImageOutcome> CreateStreamingImageOutcomeCallable; typedef std::future<CreateStreamingSessionOutcome> CreateStreamingSessionOutcomeCallable; typedef std::future<CreateStreamingSessionStreamOutcome> CreateStreamingSessionStreamOutcomeCallable; typedef std::future<CreateStudioOutcome> CreateStudioOutcomeCallable; typedef std::future<CreateStudioComponentOutcome> CreateStudioComponentOutcomeCallable; typedef std::future<DeleteLaunchProfileOutcome> DeleteLaunchProfileOutcomeCallable; typedef std::future<DeleteLaunchProfileMemberOutcome> DeleteLaunchProfileMemberOutcomeCallable; typedef std::future<DeleteStreamingImageOutcome> DeleteStreamingImageOutcomeCallable; typedef std::future<DeleteStreamingSessionOutcome> DeleteStreamingSessionOutcomeCallable; typedef std::future<DeleteStudioOutcome> DeleteStudioOutcomeCallable; typedef std::future<DeleteStudioComponentOutcome> DeleteStudioComponentOutcomeCallable; typedef std::future<DeleteStudioMemberOutcome> DeleteStudioMemberOutcomeCallable; typedef std::future<GetEulaOutcome> GetEulaOutcomeCallable; typedef std::future<GetLaunchProfileOutcome> GetLaunchProfileOutcomeCallable; typedef std::future<GetLaunchProfileDetailsOutcome> GetLaunchProfileDetailsOutcomeCallable; typedef std::future<GetLaunchProfileInitializationOutcome> GetLaunchProfileInitializationOutcomeCallable; typedef std::future<GetLaunchProfileMemberOutcome> GetLaunchProfileMemberOutcomeCallable; typedef std::future<GetStreamingImageOutcome> GetStreamingImageOutcomeCallable; typedef std::future<GetStreamingSessionOutcome> GetStreamingSessionOutcomeCallable; typedef std::future<GetStreamingSessionStreamOutcome> GetStreamingSessionStreamOutcomeCallable; typedef std::future<GetStudioOutcome> GetStudioOutcomeCallable; typedef std::future<GetStudioComponentOutcome> GetStudioComponentOutcomeCallable; typedef std::future<GetStudioMemberOutcome> GetStudioMemberOutcomeCallable; typedef std::future<ListEulaAcceptancesOutcome> ListEulaAcceptancesOutcomeCallable; typedef std::future<ListEulasOutcome> ListEulasOutcomeCallable; typedef std::future<ListLaunchProfileMembersOutcome> ListLaunchProfileMembersOutcomeCallable; typedef std::future<ListLaunchProfilesOutcome> ListLaunchProfilesOutcomeCallable; typedef std::future<ListStreamingImagesOutcome> ListStreamingImagesOutcomeCallable; typedef std::future<ListStreamingSessionsOutcome> ListStreamingSessionsOutcomeCallable; typedef std::future<ListStudioComponentsOutcome> ListStudioComponentsOutcomeCallable; typedef std::future<ListStudioMembersOutcome> ListStudioMembersOutcomeCallable; typedef std::future<ListStudiosOutcome> ListStudiosOutcomeCallable; typedef std::future<ListTagsForResourceOutcome> ListTagsForResourceOutcomeCallable; typedef std::future<PutLaunchProfileMembersOutcome> PutLaunchProfileMembersOutcomeCallable; typedef std::future<PutStudioMembersOutcome> PutStudioMembersOutcomeCallable; typedef std::future<StartStreamingSessionOutcome> StartStreamingSessionOutcomeCallable; typedef std::future<StartStudioSSOConfigurationRepairOutcome> StartStudioSSOConfigurationRepairOutcomeCallable; typedef std::future<StopStreamingSessionOutcome> StopStreamingSessionOutcomeCallable; typedef std::future<TagResourceOutcome> TagResourceOutcomeCallable; typedef std::future<UntagResourceOutcome> UntagResourceOutcomeCallable; typedef std::future<UpdateLaunchProfileOutcome> UpdateLaunchProfileOutcomeCallable; typedef std::future<UpdateLaunchProfileMemberOutcome> UpdateLaunchProfileMemberOutcomeCallable; typedef std::future<UpdateStreamingImageOutcome> UpdateStreamingImageOutcomeCallable; typedef std::future<UpdateStudioOutcome> UpdateStudioOutcomeCallable; typedef std::future<UpdateStudioComponentOutcome> UpdateStudioComponentOutcomeCallable; } // namespace Model class NimbleStudioClient; typedef std::function<void(const NimbleStudioClient*, const Model::AcceptEulasRequest&, const Model::AcceptEulasOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > AcceptEulasResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::CreateLaunchProfileRequest&, const Model::CreateLaunchProfileOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateLaunchProfileResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::CreateStreamingImageRequest&, const Model::CreateStreamingImageOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateStreamingImageResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::CreateStreamingSessionRequest&, const Model::CreateStreamingSessionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateStreamingSessionResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::CreateStreamingSessionStreamRequest&, const Model::CreateStreamingSessionStreamOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateStreamingSessionStreamResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::CreateStudioRequest&, const Model::CreateStudioOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateStudioResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::CreateStudioComponentRequest&, const Model::CreateStudioComponentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateStudioComponentResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::DeleteLaunchProfileRequest&, const Model::DeleteLaunchProfileOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteLaunchProfileResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::DeleteLaunchProfileMemberRequest&, const Model::DeleteLaunchProfileMemberOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteLaunchProfileMemberResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::DeleteStreamingImageRequest&, const Model::DeleteStreamingImageOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteStreamingImageResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::DeleteStreamingSessionRequest&, const Model::DeleteStreamingSessionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteStreamingSessionResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::DeleteStudioRequest&, const Model::DeleteStudioOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteStudioResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::DeleteStudioComponentRequest&, const Model::DeleteStudioComponentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteStudioComponentResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::DeleteStudioMemberRequest&, const Model::DeleteStudioMemberOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteStudioMemberResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetEulaRequest&, const Model::GetEulaOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetEulaResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetLaunchProfileRequest&, const Model::GetLaunchProfileOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetLaunchProfileResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetLaunchProfileDetailsRequest&, const Model::GetLaunchProfileDetailsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetLaunchProfileDetailsResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetLaunchProfileInitializationRequest&, const Model::GetLaunchProfileInitializationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetLaunchProfileInitializationResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetLaunchProfileMemberRequest&, const Model::GetLaunchProfileMemberOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetLaunchProfileMemberResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetStreamingImageRequest&, const Model::GetStreamingImageOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetStreamingImageResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetStreamingSessionRequest&, const Model::GetStreamingSessionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetStreamingSessionResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetStreamingSessionStreamRequest&, const Model::GetStreamingSessionStreamOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetStreamingSessionStreamResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetStudioRequest&, const Model::GetStudioOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetStudioResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetStudioComponentRequest&, const Model::GetStudioComponentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetStudioComponentResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::GetStudioMemberRequest&, const Model::GetStudioMemberOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetStudioMemberResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListEulaAcceptancesRequest&, const Model::ListEulaAcceptancesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListEulaAcceptancesResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListEulasRequest&, const Model::ListEulasOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListEulasResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListLaunchProfileMembersRequest&, const Model::ListLaunchProfileMembersOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListLaunchProfileMembersResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListLaunchProfilesRequest&, const Model::ListLaunchProfilesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListLaunchProfilesResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListStreamingImagesRequest&, const Model::ListStreamingImagesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListStreamingImagesResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListStreamingSessionsRequest&, const Model::ListStreamingSessionsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListStreamingSessionsResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListStudioComponentsRequest&, const Model::ListStudioComponentsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListStudioComponentsResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListStudioMembersRequest&, const Model::ListStudioMembersOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListStudioMembersResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListStudiosRequest&, const Model::ListStudiosOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListStudiosResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::ListTagsForResourceRequest&, const Model::ListTagsForResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListTagsForResourceResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::PutLaunchProfileMembersRequest&, const Model::PutLaunchProfileMembersOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutLaunchProfileMembersResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::PutStudioMembersRequest&, const Model::PutStudioMembersOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutStudioMembersResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::StartStreamingSessionRequest&, const Model::StartStreamingSessionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartStreamingSessionResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::StartStudioSSOConfigurationRepairRequest&, const Model::StartStudioSSOConfigurationRepairOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartStudioSSOConfigurationRepairResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::StopStreamingSessionRequest&, const Model::StopStreamingSessionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StopStreamingSessionResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::TagResourceRequest&, const Model::TagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > TagResourceResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::UntagResourceRequest&, const Model::UntagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UntagResourceResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::UpdateLaunchProfileRequest&, const Model::UpdateLaunchProfileOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateLaunchProfileResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::UpdateLaunchProfileMemberRequest&, const Model::UpdateLaunchProfileMemberOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateLaunchProfileMemberResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::UpdateStreamingImageRequest&, const Model::UpdateStreamingImageOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateStreamingImageResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::UpdateStudioRequest&, const Model::UpdateStudioOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateStudioResponseReceivedHandler; typedef std::function<void(const NimbleStudioClient*, const Model::UpdateStudioComponentRequest&, const Model::UpdateStudioComponentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateStudioComponentResponseReceivedHandler; /** * <p>Welcome to the Amazon Nimble Studio API reference. This API reference * provides methods, schema, resources, parameters, and more to help you get the * most out of Nimble Studio.</p> <p>Nimble Studio is a virtual studio that * empowers visual effects, animation, and interactive content teams to create * content securely within a scalable, private cloud service.</p> */ class AWS_NIMBLESTUDIO_API NimbleStudioClient : public Aws::Client::AWSJsonClient { public: typedef Aws::Client::AWSJsonClient BASECLASS; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ NimbleStudioClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ NimbleStudioClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ NimbleStudioClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); virtual ~NimbleStudioClient(); /** * <p>Accept EULAs.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/AcceptEulas">AWS * API Reference</a></p> */ virtual Model::AcceptEulasOutcome AcceptEulas(const Model::AcceptEulasRequest& request) const; /** * <p>Accept EULAs.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/AcceptEulas">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::AcceptEulasOutcomeCallable AcceptEulasCallable(const Model::AcceptEulasRequest& request) const; /** * <p>Accept EULAs.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/AcceptEulas">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void AcceptEulasAsync(const Model::AcceptEulasRequest& request, const AcceptEulasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Create a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateLaunchProfile">AWS * API Reference</a></p> */ virtual Model::CreateLaunchProfileOutcome CreateLaunchProfile(const Model::CreateLaunchProfileRequest& request) const; /** * <p>Create a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateLaunchProfile">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateLaunchProfileOutcomeCallable CreateLaunchProfileCallable(const Model::CreateLaunchProfileRequest& request) const; /** * <p>Create a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateLaunchProfile">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateLaunchProfileAsync(const Model::CreateLaunchProfileRequest& request, const CreateLaunchProfileResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a streaming image resource in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingImage">AWS * API Reference</a></p> */ virtual Model::CreateStreamingImageOutcome CreateStreamingImage(const Model::CreateStreamingImageRequest& request) const; /** * <p>Creates a streaming image resource in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingImage">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateStreamingImageOutcomeCallable CreateStreamingImageCallable(const Model::CreateStreamingImageRequest& request) const; /** * <p>Creates a streaming image resource in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingImage">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateStreamingImageAsync(const Model::CreateStreamingImageRequest& request, const CreateStreamingImageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a streaming session in a studio.</p> <p>After invoking this * operation, you must poll GetStreamingSession until the streaming session is in * state READY.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingSession">AWS * API Reference</a></p> */ virtual Model::CreateStreamingSessionOutcome CreateStreamingSession(const Model::CreateStreamingSessionRequest& request) const; /** * <p>Creates a streaming session in a studio.</p> <p>After invoking this * operation, you must poll GetStreamingSession until the streaming session is in * state READY.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingSession">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateStreamingSessionOutcomeCallable CreateStreamingSessionCallable(const Model::CreateStreamingSessionRequest& request) const; /** * <p>Creates a streaming session in a studio.</p> <p>After invoking this * operation, you must poll GetStreamingSession until the streaming session is in * state READY.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingSession">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateStreamingSessionAsync(const Model::CreateStreamingSessionRequest& request, const CreateStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a streaming session stream for a streaming session.</p> <p>After * invoking this API, invoke GetStreamingSessionStream with the returned streamId * to poll the resource until it is in state READY.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingSessionStream">AWS * API Reference</a></p> */ virtual Model::CreateStreamingSessionStreamOutcome CreateStreamingSessionStream(const Model::CreateStreamingSessionStreamRequest& request) const; /** * <p>Creates a streaming session stream for a streaming session.</p> <p>After * invoking this API, invoke GetStreamingSessionStream with the returned streamId * to poll the resource until it is in state READY.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingSessionStream">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateStreamingSessionStreamOutcomeCallable CreateStreamingSessionStreamCallable(const Model::CreateStreamingSessionStreamRequest& request) const; /** * <p>Creates a streaming session stream for a streaming session.</p> <p>After * invoking this API, invoke GetStreamingSessionStream with the returned streamId * to poll the resource until it is in state READY.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStreamingSessionStream">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateStreamingSessionStreamAsync(const Model::CreateStreamingSessionStreamRequest& request, const CreateStreamingSessionStreamResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Create a new Studio.</p> <p>When creating a Studio, two IAM roles must be * provided: the admin role and the user Role. These roles are assumed by your * users when they log in to the Nimble Studio portal.</p> <p>The user role must * have the AmazonNimbleStudio-StudioUser managed policy attached for the portal to * function properly.</p> <p>The Admin Role must have the * AmazonNimbleStudio-StudioAdmin managed policy attached for the portal to * function properly.</p> <p>You may optionally specify a KMS key in the * StudioEncryptionConfiguration.</p> <p>In Nimble Studio, resource names, * descriptions, initialization scripts, and other data you provide are always * encrypted at rest using an KMS key. By default, this key is owned by Amazon Web * Services and managed on your behalf. You may provide your own KMS key when * calling CreateStudio to encrypt this data using a key you own and manage.</p> * <p>When providing an KMS key during studio creation, Nimble Studio creates KMS * grants in your account to provide your studio user and admin roles access to * these KMS keys.</p> <p>If you delete this grant, the studio will no longer be * accessible to your portal users.</p> <p>If you delete the studio KMS key, your * studio will no longer be accessible.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStudio">AWS * API Reference</a></p> */ virtual Model::CreateStudioOutcome CreateStudio(const Model::CreateStudioRequest& request) const; /** * <p>Create a new Studio.</p> <p>When creating a Studio, two IAM roles must be * provided: the admin role and the user Role. These roles are assumed by your * users when they log in to the Nimble Studio portal.</p> <p>The user role must * have the AmazonNimbleStudio-StudioUser managed policy attached for the portal to * function properly.</p> <p>The Admin Role must have the * AmazonNimbleStudio-StudioAdmin managed policy attached for the portal to * function properly.</p> <p>You may optionally specify a KMS key in the * StudioEncryptionConfiguration.</p> <p>In Nimble Studio, resource names, * descriptions, initialization scripts, and other data you provide are always * encrypted at rest using an KMS key. By default, this key is owned by Amazon Web * Services and managed on your behalf. You may provide your own KMS key when * calling CreateStudio to encrypt this data using a key you own and manage.</p> * <p>When providing an KMS key during studio creation, Nimble Studio creates KMS * grants in your account to provide your studio user and admin roles access to * these KMS keys.</p> <p>If you delete this grant, the studio will no longer be * accessible to your portal users.</p> <p>If you delete the studio KMS key, your * studio will no longer be accessible.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStudio">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateStudioOutcomeCallable CreateStudioCallable(const Model::CreateStudioRequest& request) const; /** * <p>Create a new Studio.</p> <p>When creating a Studio, two IAM roles must be * provided: the admin role and the user Role. These roles are assumed by your * users when they log in to the Nimble Studio portal.</p> <p>The user role must * have the AmazonNimbleStudio-StudioUser managed policy attached for the portal to * function properly.</p> <p>The Admin Role must have the * AmazonNimbleStudio-StudioAdmin managed policy attached for the portal to * function properly.</p> <p>You may optionally specify a KMS key in the * StudioEncryptionConfiguration.</p> <p>In Nimble Studio, resource names, * descriptions, initialization scripts, and other data you provide are always * encrypted at rest using an KMS key. By default, this key is owned by Amazon Web * Services and managed on your behalf. You may provide your own KMS key when * calling CreateStudio to encrypt this data using a key you own and manage.</p> * <p>When providing an KMS key during studio creation, Nimble Studio creates KMS * grants in your account to provide your studio user and admin roles access to * these KMS keys.</p> <p>If you delete this grant, the studio will no longer be * accessible to your portal users.</p> <p>If you delete the studio KMS key, your * studio will no longer be accessible.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStudio">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateStudioAsync(const Model::CreateStudioRequest& request, const CreateStudioResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStudioComponent">AWS * API Reference</a></p> */ virtual Model::CreateStudioComponentOutcome CreateStudioComponent(const Model::CreateStudioComponentRequest& request) const; /** * <p>Creates a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStudioComponent">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateStudioComponentOutcomeCallable CreateStudioComponentCallable(const Model::CreateStudioComponentRequest& request) const; /** * <p>Creates a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/CreateStudioComponent">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateStudioComponentAsync(const Model::CreateStudioComponentRequest& request, const CreateStudioComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Permanently delete a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteLaunchProfile">AWS * API Reference</a></p> */ virtual Model::DeleteLaunchProfileOutcome DeleteLaunchProfile(const Model::DeleteLaunchProfileRequest& request) const; /** * <p>Permanently delete a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteLaunchProfile">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteLaunchProfileOutcomeCallable DeleteLaunchProfileCallable(const Model::DeleteLaunchProfileRequest& request) const; /** * <p>Permanently delete a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteLaunchProfile">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteLaunchProfileAsync(const Model::DeleteLaunchProfileRequest& request, const DeleteLaunchProfileResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Delete a user from launch profile membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteLaunchProfileMember">AWS * API Reference</a></p> */ virtual Model::DeleteLaunchProfileMemberOutcome DeleteLaunchProfileMember(const Model::DeleteLaunchProfileMemberRequest& request) const; /** * <p>Delete a user from launch profile membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteLaunchProfileMember">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteLaunchProfileMemberOutcomeCallable DeleteLaunchProfileMemberCallable(const Model::DeleteLaunchProfileMemberRequest& request) const; /** * <p>Delete a user from launch profile membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteLaunchProfileMember">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteLaunchProfileMemberAsync(const Model::DeleteLaunchProfileMemberRequest& request, const DeleteLaunchProfileMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Delete streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStreamingImage">AWS * API Reference</a></p> */ virtual Model::DeleteStreamingImageOutcome DeleteStreamingImage(const Model::DeleteStreamingImageRequest& request) const; /** * <p>Delete streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStreamingImage">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteStreamingImageOutcomeCallable DeleteStreamingImageCallable(const Model::DeleteStreamingImageRequest& request) const; /** * <p>Delete streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStreamingImage">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteStreamingImageAsync(const Model::DeleteStreamingImageRequest& request, const DeleteStreamingImageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes streaming session resource.</p> <p>After invoking this operation, use * GetStreamingSession to poll the resource until it transitions to a DELETED * state.</p> <p>A streaming session will count against your streaming session * quota until it is marked DELETED.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStreamingSession">AWS * API Reference</a></p> */ virtual Model::DeleteStreamingSessionOutcome DeleteStreamingSession(const Model::DeleteStreamingSessionRequest& request) const; /** * <p>Deletes streaming session resource.</p> <p>After invoking this operation, use * GetStreamingSession to poll the resource until it transitions to a DELETED * state.</p> <p>A streaming session will count against your streaming session * quota until it is marked DELETED.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStreamingSession">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteStreamingSessionOutcomeCallable DeleteStreamingSessionCallable(const Model::DeleteStreamingSessionRequest& request) const; /** * <p>Deletes streaming session resource.</p> <p>After invoking this operation, use * GetStreamingSession to poll the resource until it transitions to a DELETED * state.</p> <p>A streaming session will count against your streaming session * quota until it is marked DELETED.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStreamingSession">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteStreamingSessionAsync(const Model::DeleteStreamingSessionRequest& request, const DeleteStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Delete a studio resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudio">AWS * API Reference</a></p> */ virtual Model::DeleteStudioOutcome DeleteStudio(const Model::DeleteStudioRequest& request) const; /** * <p>Delete a studio resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudio">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteStudioOutcomeCallable DeleteStudioCallable(const Model::DeleteStudioRequest& request) const; /** * <p>Delete a studio resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudio">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteStudioAsync(const Model::DeleteStudioRequest& request, const DeleteStudioResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudioComponent">AWS * API Reference</a></p> */ virtual Model::DeleteStudioComponentOutcome DeleteStudioComponent(const Model::DeleteStudioComponentRequest& request) const; /** * <p>Deletes a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudioComponent">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteStudioComponentOutcomeCallable DeleteStudioComponentCallable(const Model::DeleteStudioComponentRequest& request) const; /** * <p>Deletes a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudioComponent">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteStudioComponentAsync(const Model::DeleteStudioComponentRequest& request, const DeleteStudioComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Delete a user from studio membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudioMember">AWS * API Reference</a></p> */ virtual Model::DeleteStudioMemberOutcome DeleteStudioMember(const Model::DeleteStudioMemberRequest& request) const; /** * <p>Delete a user from studio membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudioMember">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteStudioMemberOutcomeCallable DeleteStudioMemberCallable(const Model::DeleteStudioMemberRequest& request) const; /** * <p>Delete a user from studio membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/DeleteStudioMember">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteStudioMemberAsync(const Model::DeleteStudioMemberRequest& request, const DeleteStudioMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get Eula.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetEula">AWS API * Reference</a></p> */ virtual Model::GetEulaOutcome GetEula(const Model::GetEulaRequest& request) const; /** * <p>Get Eula.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetEula">AWS API * Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetEulaOutcomeCallable GetEulaCallable(const Model::GetEulaRequest& request) const; /** * <p>Get Eula.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetEula">AWS API * Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetEulaAsync(const Model::GetEulaRequest& request, const GetEulaResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfile">AWS * API Reference</a></p> */ virtual Model::GetLaunchProfileOutcome GetLaunchProfile(const Model::GetLaunchProfileRequest& request) const; /** * <p>Get a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfile">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetLaunchProfileOutcomeCallable GetLaunchProfileCallable(const Model::GetLaunchProfileRequest& request) const; /** * <p>Get a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfile">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetLaunchProfileAsync(const Model::GetLaunchProfileRequest& request, const GetLaunchProfileResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Launch profile details include the launch profile resource and summary * information of resources that are used by, or available to, the launch profile. * This includes the name and description of all studio components used by the * launch profiles, and the name and description of streaming images that can be * used with this launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileDetails">AWS * API Reference</a></p> */ virtual Model::GetLaunchProfileDetailsOutcome GetLaunchProfileDetails(const Model::GetLaunchProfileDetailsRequest& request) const; /** * <p>Launch profile details include the launch profile resource and summary * information of resources that are used by, or available to, the launch profile. * This includes the name and description of all studio components used by the * launch profiles, and the name and description of streaming images that can be * used with this launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileDetails">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetLaunchProfileDetailsOutcomeCallable GetLaunchProfileDetailsCallable(const Model::GetLaunchProfileDetailsRequest& request) const; /** * <p>Launch profile details include the launch profile resource and summary * information of resources that are used by, or available to, the launch profile. * This includes the name and description of all studio components used by the * launch profiles, and the name and description of streaming images that can be * used with this launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileDetails">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetLaunchProfileDetailsAsync(const Model::GetLaunchProfileDetailsRequest& request, const GetLaunchProfileDetailsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get a launch profile initialization.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileInitialization">AWS * API Reference</a></p> */ virtual Model::GetLaunchProfileInitializationOutcome GetLaunchProfileInitialization(const Model::GetLaunchProfileInitializationRequest& request) const; /** * <p>Get a launch profile initialization.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileInitialization">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetLaunchProfileInitializationOutcomeCallable GetLaunchProfileInitializationCallable(const Model::GetLaunchProfileInitializationRequest& request) const; /** * <p>Get a launch profile initialization.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileInitialization">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetLaunchProfileInitializationAsync(const Model::GetLaunchProfileInitializationRequest& request, const GetLaunchProfileInitializationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get a user persona in launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileMember">AWS * API Reference</a></p> */ virtual Model::GetLaunchProfileMemberOutcome GetLaunchProfileMember(const Model::GetLaunchProfileMemberRequest& request) const; /** * <p>Get a user persona in launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileMember">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetLaunchProfileMemberOutcomeCallable GetLaunchProfileMemberCallable(const Model::GetLaunchProfileMemberRequest& request) const; /** * <p>Get a user persona in launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetLaunchProfileMember">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetLaunchProfileMemberAsync(const Model::GetLaunchProfileMemberRequest& request, const GetLaunchProfileMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingImage">AWS * API Reference</a></p> */ virtual Model::GetStreamingImageOutcome GetStreamingImage(const Model::GetStreamingImageRequest& request) const; /** * <p>Get streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingImage">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetStreamingImageOutcomeCallable GetStreamingImageCallable(const Model::GetStreamingImageRequest& request) const; /** * <p>Get streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingImage">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetStreamingImageAsync(const Model::GetStreamingImageRequest& request, const GetStreamingImageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets StreamingSession resource.</p> <p>Invoke this operation to poll for a * streaming session state while creating or deleting a session.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingSession">AWS * API Reference</a></p> */ virtual Model::GetStreamingSessionOutcome GetStreamingSession(const Model::GetStreamingSessionRequest& request) const; /** * <p>Gets StreamingSession resource.</p> <p>Invoke this operation to poll for a * streaming session state while creating or deleting a session.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingSession">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetStreamingSessionOutcomeCallable GetStreamingSessionCallable(const Model::GetStreamingSessionRequest& request) const; /** * <p>Gets StreamingSession resource.</p> <p>Invoke this operation to poll for a * streaming session state while creating or deleting a session.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingSession">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetStreamingSessionAsync(const Model::GetStreamingSessionRequest& request, const GetStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets a StreamingSessionStream for a streaming session.</p> <p>Invoke this * operation to poll the resource after invoking CreateStreamingSessionStream.</p> * <p>After the StreamingSessionStream changes to the state READY, the url property * will contain a stream to be used with the DCV streaming client.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingSessionStream">AWS * API Reference</a></p> */ virtual Model::GetStreamingSessionStreamOutcome GetStreamingSessionStream(const Model::GetStreamingSessionStreamRequest& request) const; /** * <p>Gets a StreamingSessionStream for a streaming session.</p> <p>Invoke this * operation to poll the resource after invoking CreateStreamingSessionStream.</p> * <p>After the StreamingSessionStream changes to the state READY, the url property * will contain a stream to be used with the DCV streaming client.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingSessionStream">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetStreamingSessionStreamOutcomeCallable GetStreamingSessionStreamCallable(const Model::GetStreamingSessionStreamRequest& request) const; /** * <p>Gets a StreamingSessionStream for a streaming session.</p> <p>Invoke this * operation to poll the resource after invoking CreateStreamingSessionStream.</p> * <p>After the StreamingSessionStream changes to the state READY, the url property * will contain a stream to be used with the DCV streaming client.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStreamingSessionStream">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetStreamingSessionStreamAsync(const Model::GetStreamingSessionStreamRequest& request, const GetStreamingSessionStreamResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get a Studio resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudio">AWS * API Reference</a></p> */ virtual Model::GetStudioOutcome GetStudio(const Model::GetStudioRequest& request) const; /** * <p>Get a Studio resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudio">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetStudioOutcomeCallable GetStudioCallable(const Model::GetStudioRequest& request) const; /** * <p>Get a Studio resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudio">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetStudioAsync(const Model::GetStudioRequest& request, const GetStudioResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudioComponent">AWS * API Reference</a></p> */ virtual Model::GetStudioComponentOutcome GetStudioComponent(const Model::GetStudioComponentRequest& request) const; /** * <p>Gets a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudioComponent">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetStudioComponentOutcomeCallable GetStudioComponentCallable(const Model::GetStudioComponentRequest& request) const; /** * <p>Gets a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudioComponent">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetStudioComponentAsync(const Model::GetStudioComponentRequest& request, const GetStudioComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get a user's membership in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudioMember">AWS * API Reference</a></p> */ virtual Model::GetStudioMemberOutcome GetStudioMember(const Model::GetStudioMemberRequest& request) const; /** * <p>Get a user's membership in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudioMember">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetStudioMemberOutcomeCallable GetStudioMemberCallable(const Model::GetStudioMemberRequest& request) const; /** * <p>Get a user's membership in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/GetStudioMember">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetStudioMemberAsync(const Model::GetStudioMemberRequest& request, const GetStudioMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>List Eula Acceptances.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListEulaAcceptances">AWS * API Reference</a></p> */ virtual Model::ListEulaAcceptancesOutcome ListEulaAcceptances(const Model::ListEulaAcceptancesRequest& request) const; /** * <p>List Eula Acceptances.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListEulaAcceptances">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListEulaAcceptancesOutcomeCallable ListEulaAcceptancesCallable(const Model::ListEulaAcceptancesRequest& request) const; /** * <p>List Eula Acceptances.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListEulaAcceptances">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListEulaAcceptancesAsync(const Model::ListEulaAcceptancesRequest& request, const ListEulaAcceptancesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>List Eulas.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListEulas">AWS * API Reference</a></p> */ virtual Model::ListEulasOutcome ListEulas(const Model::ListEulasRequest& request) const; /** * <p>List Eulas.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListEulas">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListEulasOutcomeCallable ListEulasCallable(const Model::ListEulasRequest& request) const; /** * <p>List Eulas.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListEulas">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListEulasAsync(const Model::ListEulasRequest& request, const ListEulasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get all users in a given launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListLaunchProfileMembers">AWS * API Reference</a></p> */ virtual Model::ListLaunchProfileMembersOutcome ListLaunchProfileMembers(const Model::ListLaunchProfileMembersRequest& request) const; /** * <p>Get all users in a given launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListLaunchProfileMembers">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListLaunchProfileMembersOutcomeCallable ListLaunchProfileMembersCallable(const Model::ListLaunchProfileMembersRequest& request) const; /** * <p>Get all users in a given launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListLaunchProfileMembers">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListLaunchProfileMembersAsync(const Model::ListLaunchProfileMembersRequest& request, const ListLaunchProfileMembersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>List all the launch profiles a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListLaunchProfiles">AWS * API Reference</a></p> */ virtual Model::ListLaunchProfilesOutcome ListLaunchProfiles(const Model::ListLaunchProfilesRequest& request) const; /** * <p>List all the launch profiles a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListLaunchProfiles">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListLaunchProfilesOutcomeCallable ListLaunchProfilesCallable(const Model::ListLaunchProfilesRequest& request) const; /** * <p>List all the launch profiles a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListLaunchProfiles">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListLaunchProfilesAsync(const Model::ListLaunchProfilesRequest& request, const ListLaunchProfilesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>List the streaming image resources available to this studio.</p> <p>This list * will contain both images provided by Amazon Web Services, as well as streaming * images that you have created in your studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStreamingImages">AWS * API Reference</a></p> */ virtual Model::ListStreamingImagesOutcome ListStreamingImages(const Model::ListStreamingImagesRequest& request) const; /** * <p>List the streaming image resources available to this studio.</p> <p>This list * will contain both images provided by Amazon Web Services, as well as streaming * images that you have created in your studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStreamingImages">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListStreamingImagesOutcomeCallable ListStreamingImagesCallable(const Model::ListStreamingImagesRequest& request) const; /** * <p>List the streaming image resources available to this studio.</p> <p>This list * will contain both images provided by Amazon Web Services, as well as streaming * images that you have created in your studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStreamingImages">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListStreamingImagesAsync(const Model::ListStreamingImagesRequest& request, const ListStreamingImagesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Lists the streaming image resources in a studio.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStreamingSessions">AWS * API Reference</a></p> */ virtual Model::ListStreamingSessionsOutcome ListStreamingSessions(const Model::ListStreamingSessionsRequest& request) const; /** * <p>Lists the streaming image resources in a studio.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStreamingSessions">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListStreamingSessionsOutcomeCallable ListStreamingSessionsCallable(const Model::ListStreamingSessionsRequest& request) const; /** * <p>Lists the streaming image resources in a studio.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStreamingSessions">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListStreamingSessionsAsync(const Model::ListStreamingSessionsRequest& request, const ListStreamingSessionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Lists the StudioComponents in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudioComponents">AWS * API Reference</a></p> */ virtual Model::ListStudioComponentsOutcome ListStudioComponents(const Model::ListStudioComponentsRequest& request) const; /** * <p>Lists the StudioComponents in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudioComponents">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListStudioComponentsOutcomeCallable ListStudioComponentsCallable(const Model::ListStudioComponentsRequest& request) const; /** * <p>Lists the StudioComponents in a studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudioComponents">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListStudioComponentsAsync(const Model::ListStudioComponentsRequest& request, const ListStudioComponentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Get all users in a given studio membership.</p> <p> * <code>ListStudioMembers</code> only returns admin members.</p> <p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudioMembers">AWS * API Reference</a></p> */ virtual Model::ListStudioMembersOutcome ListStudioMembers(const Model::ListStudioMembersRequest& request) const; /** * <p>Get all users in a given studio membership.</p> <p> * <code>ListStudioMembers</code> only returns admin members.</p> <p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudioMembers">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListStudioMembersOutcomeCallable ListStudioMembersCallable(const Model::ListStudioMembersRequest& request) const; /** * <p>Get all users in a given studio membership.</p> <p> * <code>ListStudioMembers</code> only returns admin members.</p> <p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudioMembers">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListStudioMembersAsync(const Model::ListStudioMembersRequest& request, const ListStudioMembersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>List studios in your Amazon Web Services account in the requested Amazon Web * Services Region.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudios">AWS * API Reference</a></p> */ virtual Model::ListStudiosOutcome ListStudios(const Model::ListStudiosRequest& request) const; /** * <p>List studios in your Amazon Web Services account in the requested Amazon Web * Services Region.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudios">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListStudiosOutcomeCallable ListStudiosCallable(const Model::ListStudiosRequest& request) const; /** * <p>List studios in your Amazon Web Services account in the requested Amazon Web * Services Region.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListStudios">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListStudiosAsync(const Model::ListStudiosRequest& request, const ListStudiosResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets the tags for a resource, given its Amazon Resource Names (ARN).</p> * <p>This operation supports ARNs for all resource types in Nimble Studio that * support tags, including studio, studio component, launch profile, streaming * image, and streaming session. All resources that can be tagged will contain an * ARN property, so you do not have to create this ARN yourself.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListTagsForResource">AWS * API Reference</a></p> */ virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const; /** * <p>Gets the tags for a resource, given its Amazon Resource Names (ARN).</p> * <p>This operation supports ARNs for all resource types in Nimble Studio that * support tags, including studio, studio component, launch profile, streaming * image, and streaming session. All resources that can be tagged will contain an * ARN property, so you do not have to create this ARN yourself.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListTagsForResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const Model::ListTagsForResourceRequest& request) const; /** * <p>Gets the tags for a resource, given its Amazon Resource Names (ARN).</p> * <p>This operation supports ARNs for all resource types in Nimble Studio that * support tags, including studio, studio component, launch profile, streaming * image, and streaming session. All resources that can be tagged will contain an * ARN property, so you do not have to create this ARN yourself.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/ListTagsForResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListTagsForResourceAsync(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Add/update users with given persona to launch profile * membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/PutLaunchProfileMembers">AWS * API Reference</a></p> */ virtual Model::PutLaunchProfileMembersOutcome PutLaunchProfileMembers(const Model::PutLaunchProfileMembersRequest& request) const; /** * <p>Add/update users with given persona to launch profile * membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/PutLaunchProfileMembers">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::PutLaunchProfileMembersOutcomeCallable PutLaunchProfileMembersCallable(const Model::PutLaunchProfileMembersRequest& request) const; /** * <p>Add/update users with given persona to launch profile * membership.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/PutLaunchProfileMembers">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void PutLaunchProfileMembersAsync(const Model::PutLaunchProfileMembersRequest& request, const PutLaunchProfileMembersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Add/update users with given persona to studio membership.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/PutStudioMembers">AWS * API Reference</a></p> */ virtual Model::PutStudioMembersOutcome PutStudioMembers(const Model::PutStudioMembersRequest& request) const; /** * <p>Add/update users with given persona to studio membership.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/PutStudioMembers">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::PutStudioMembersOutcomeCallable PutStudioMembersCallable(const Model::PutStudioMembersRequest& request) const; /** * <p>Add/update users with given persona to studio membership.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/PutStudioMembers">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void PutStudioMembersAsync(const Model::PutStudioMembersRequest& request, const PutStudioMembersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p> Transitions sessions from the STOPPED state into the READY state. The * START_IN_PROGRESS state is the intermediate state between the STOPPED and READY * states.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StartStreamingSession">AWS * API Reference</a></p> */ virtual Model::StartStreamingSessionOutcome StartStreamingSession(const Model::StartStreamingSessionRequest& request) const; /** * <p> Transitions sessions from the STOPPED state into the READY state. The * START_IN_PROGRESS state is the intermediate state between the STOPPED and READY * states.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StartStreamingSession">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::StartStreamingSessionOutcomeCallable StartStreamingSessionCallable(const Model::StartStreamingSessionRequest& request) const; /** * <p> Transitions sessions from the STOPPED state into the READY state. The * START_IN_PROGRESS state is the intermediate state between the STOPPED and READY * states.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StartStreamingSession">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void StartStreamingSessionAsync(const Model::StartStreamingSessionRequest& request, const StartStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Repairs the Amazon Web Services SSO configuration for a given studio.</p> * <p>If the studio has a valid Amazon Web Services SSO configuration currently * associated with it, this operation will fail with a validation error.</p> <p>If * the studio does not have a valid Amazon Web Services SSO configuration currently * associated with it, then a new Amazon Web Services SSO application is created * for the studio and the studio is changed to the READY state.</p> <p>After the * Amazon Web Services SSO application is repaired, you must use the Amazon Nimble * Studio console to add administrators and users to your studio.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StartStudioSSOConfigurationRepair">AWS * API Reference</a></p> */ virtual Model::StartStudioSSOConfigurationRepairOutcome StartStudioSSOConfigurationRepair(const Model::StartStudioSSOConfigurationRepairRequest& request) const; /** * <p>Repairs the Amazon Web Services SSO configuration for a given studio.</p> * <p>If the studio has a valid Amazon Web Services SSO configuration currently * associated with it, this operation will fail with a validation error.</p> <p>If * the studio does not have a valid Amazon Web Services SSO configuration currently * associated with it, then a new Amazon Web Services SSO application is created * for the studio and the studio is changed to the READY state.</p> <p>After the * Amazon Web Services SSO application is repaired, you must use the Amazon Nimble * Studio console to add administrators and users to your studio.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StartStudioSSOConfigurationRepair">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::StartStudioSSOConfigurationRepairOutcomeCallable StartStudioSSOConfigurationRepairCallable(const Model::StartStudioSSOConfigurationRepairRequest& request) const; /** * <p>Repairs the Amazon Web Services SSO configuration for a given studio.</p> * <p>If the studio has a valid Amazon Web Services SSO configuration currently * associated with it, this operation will fail with a validation error.</p> <p>If * the studio does not have a valid Amazon Web Services SSO configuration currently * associated with it, then a new Amazon Web Services SSO application is created * for the studio and the studio is changed to the READY state.</p> <p>After the * Amazon Web Services SSO application is repaired, you must use the Amazon Nimble * Studio console to add administrators and users to your studio.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StartStudioSSOConfigurationRepair">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void StartStudioSSOConfigurationRepairAsync(const Model::StartStudioSSOConfigurationRepairRequest& request, const StartStudioSSOConfigurationRepairResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Transitions sessions from the READY state into the STOPPED state. The * STOP_IN_PROGRESS state is the intermediate state between the READY and STOPPED * states.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StopStreamingSession">AWS * API Reference</a></p> */ virtual Model::StopStreamingSessionOutcome StopStreamingSession(const Model::StopStreamingSessionRequest& request) const; /** * <p>Transitions sessions from the READY state into the STOPPED state. The * STOP_IN_PROGRESS state is the intermediate state between the READY and STOPPED * states.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StopStreamingSession">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::StopStreamingSessionOutcomeCallable StopStreamingSessionCallable(const Model::StopStreamingSessionRequest& request) const; /** * <p>Transitions sessions from the READY state into the STOPPED state. The * STOP_IN_PROGRESS state is the intermediate state between the READY and STOPPED * states.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/StopStreamingSession">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void StopStreamingSessionAsync(const Model::StopStreamingSessionRequest& request, const StopStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates tags for a resource, given its ARN.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/TagResource">AWS * API Reference</a></p> */ virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const; /** * <p>Creates tags for a resource, given its ARN.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/TagResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::TagResourceOutcomeCallable TagResourceCallable(const Model::TagResourceRequest& request) const; /** * <p>Creates tags for a resource, given its ARN.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/TagResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void TagResourceAsync(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes the tags for a resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UntagResource">AWS * API Reference</a></p> */ virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const; /** * <p>Deletes the tags for a resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UntagResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UntagResourceOutcomeCallable UntagResourceCallable(const Model::UntagResourceRequest& request) const; /** * <p>Deletes the tags for a resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UntagResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UntagResourceAsync(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Update a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateLaunchProfile">AWS * API Reference</a></p> */ virtual Model::UpdateLaunchProfileOutcome UpdateLaunchProfile(const Model::UpdateLaunchProfileRequest& request) const; /** * <p>Update a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateLaunchProfile">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UpdateLaunchProfileOutcomeCallable UpdateLaunchProfileCallable(const Model::UpdateLaunchProfileRequest& request) const; /** * <p>Update a launch profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateLaunchProfile">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UpdateLaunchProfileAsync(const Model::UpdateLaunchProfileRequest& request, const UpdateLaunchProfileResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Update a user persona in launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateLaunchProfileMember">AWS * API Reference</a></p> */ virtual Model::UpdateLaunchProfileMemberOutcome UpdateLaunchProfileMember(const Model::UpdateLaunchProfileMemberRequest& request) const; /** * <p>Update a user persona in launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateLaunchProfileMember">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UpdateLaunchProfileMemberOutcomeCallable UpdateLaunchProfileMemberCallable(const Model::UpdateLaunchProfileMemberRequest& request) const; /** * <p>Update a user persona in launch profile membership.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateLaunchProfileMember">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UpdateLaunchProfileMemberAsync(const Model::UpdateLaunchProfileMemberRequest& request, const UpdateLaunchProfileMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Update streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStreamingImage">AWS * API Reference</a></p> */ virtual Model::UpdateStreamingImageOutcome UpdateStreamingImage(const Model::UpdateStreamingImageRequest& request) const; /** * <p>Update streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStreamingImage">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UpdateStreamingImageOutcomeCallable UpdateStreamingImageCallable(const Model::UpdateStreamingImageRequest& request) const; /** * <p>Update streaming image.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStreamingImage">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UpdateStreamingImageAsync(const Model::UpdateStreamingImageRequest& request, const UpdateStreamingImageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Update a Studio resource.</p> <p>Currently, this operation only supports * updating the displayName of your studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStudio">AWS * API Reference</a></p> */ virtual Model::UpdateStudioOutcome UpdateStudio(const Model::UpdateStudioRequest& request) const; /** * <p>Update a Studio resource.</p> <p>Currently, this operation only supports * updating the displayName of your studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStudio">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UpdateStudioOutcomeCallable UpdateStudioCallable(const Model::UpdateStudioRequest& request) const; /** * <p>Update a Studio resource.</p> <p>Currently, this operation only supports * updating the displayName of your studio.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStudio">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UpdateStudioAsync(const Model::UpdateStudioRequest& request, const UpdateStudioResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Updates a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStudioComponent">AWS * API Reference</a></p> */ virtual Model::UpdateStudioComponentOutcome UpdateStudioComponent(const Model::UpdateStudioComponentRequest& request) const; /** * <p>Updates a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStudioComponent">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UpdateStudioComponentOutcomeCallable UpdateStudioComponentCallable(const Model::UpdateStudioComponentRequest& request) const; /** * <p>Updates a studio component resource.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/nimble-2020-08-01/UpdateStudioComponent">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UpdateStudioComponentAsync(const Model::UpdateStudioComponentRequest& request, const UpdateStudioComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; void OverrideEndpoint(const Aws::String& endpoint); private: void init(const Aws::Client::ClientConfiguration& clientConfiguration); void AcceptEulasAsyncHelper(const Model::AcceptEulasRequest& request, const AcceptEulasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateLaunchProfileAsyncHelper(const Model::CreateLaunchProfileRequest& request, const CreateLaunchProfileResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateStreamingImageAsyncHelper(const Model::CreateStreamingImageRequest& request, const CreateStreamingImageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateStreamingSessionAsyncHelper(const Model::CreateStreamingSessionRequest& request, const CreateStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateStreamingSessionStreamAsyncHelper(const Model::CreateStreamingSessionStreamRequest& request, const CreateStreamingSessionStreamResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateStudioAsyncHelper(const Model::CreateStudioRequest& request, const CreateStudioResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateStudioComponentAsyncHelper(const Model::CreateStudioComponentRequest& request, const CreateStudioComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteLaunchProfileAsyncHelper(const Model::DeleteLaunchProfileRequest& request, const DeleteLaunchProfileResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteLaunchProfileMemberAsyncHelper(const Model::DeleteLaunchProfileMemberRequest& request, const DeleteLaunchProfileMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteStreamingImageAsyncHelper(const Model::DeleteStreamingImageRequest& request, const DeleteStreamingImageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteStreamingSessionAsyncHelper(const Model::DeleteStreamingSessionRequest& request, const DeleteStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteStudioAsyncHelper(const Model::DeleteStudioRequest& request, const DeleteStudioResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteStudioComponentAsyncHelper(const Model::DeleteStudioComponentRequest& request, const DeleteStudioComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteStudioMemberAsyncHelper(const Model::DeleteStudioMemberRequest& request, const DeleteStudioMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetEulaAsyncHelper(const Model::GetEulaRequest& request, const GetEulaResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetLaunchProfileAsyncHelper(const Model::GetLaunchProfileRequest& request, const GetLaunchProfileResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetLaunchProfileDetailsAsyncHelper(const Model::GetLaunchProfileDetailsRequest& request, const GetLaunchProfileDetailsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetLaunchProfileInitializationAsyncHelper(const Model::GetLaunchProfileInitializationRequest& request, const GetLaunchProfileInitializationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetLaunchProfileMemberAsyncHelper(const Model::GetLaunchProfileMemberRequest& request, const GetLaunchProfileMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetStreamingImageAsyncHelper(const Model::GetStreamingImageRequest& request, const GetStreamingImageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetStreamingSessionAsyncHelper(const Model::GetStreamingSessionRequest& request, const GetStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetStreamingSessionStreamAsyncHelper(const Model::GetStreamingSessionStreamRequest& request, const GetStreamingSessionStreamResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetStudioAsyncHelper(const Model::GetStudioRequest& request, const GetStudioResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetStudioComponentAsyncHelper(const Model::GetStudioComponentRequest& request, const GetStudioComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetStudioMemberAsyncHelper(const Model::GetStudioMemberRequest& request, const GetStudioMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListEulaAcceptancesAsyncHelper(const Model::ListEulaAcceptancesRequest& request, const ListEulaAcceptancesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListEulasAsyncHelper(const Model::ListEulasRequest& request, const ListEulasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListLaunchProfileMembersAsyncHelper(const Model::ListLaunchProfileMembersRequest& request, const ListLaunchProfileMembersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListLaunchProfilesAsyncHelper(const Model::ListLaunchProfilesRequest& request, const ListLaunchProfilesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListStreamingImagesAsyncHelper(const Model::ListStreamingImagesRequest& request, const ListStreamingImagesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListStreamingSessionsAsyncHelper(const Model::ListStreamingSessionsRequest& request, const ListStreamingSessionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListStudioComponentsAsyncHelper(const Model::ListStudioComponentsRequest& request, const ListStudioComponentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListStudioMembersAsyncHelper(const Model::ListStudioMembersRequest& request, const ListStudioMembersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListStudiosAsyncHelper(const Model::ListStudiosRequest& request, const ListStudiosResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListTagsForResourceAsyncHelper(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void PutLaunchProfileMembersAsyncHelper(const Model::PutLaunchProfileMembersRequest& request, const PutLaunchProfileMembersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void PutStudioMembersAsyncHelper(const Model::PutStudioMembersRequest& request, const PutStudioMembersResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void StartStreamingSessionAsyncHelper(const Model::StartStreamingSessionRequest& request, const StartStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void StartStudioSSOConfigurationRepairAsyncHelper(const Model::StartStudioSSOConfigurationRepairRequest& request, const StartStudioSSOConfigurationRepairResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void StopStreamingSessionAsyncHelper(const Model::StopStreamingSessionRequest& request, const StopStreamingSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void TagResourceAsyncHelper(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UntagResourceAsyncHelper(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UpdateLaunchProfileAsyncHelper(const Model::UpdateLaunchProfileRequest& request, const UpdateLaunchProfileResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UpdateLaunchProfileMemberAsyncHelper(const Model::UpdateLaunchProfileMemberRequest& request, const UpdateLaunchProfileMemberResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UpdateStreamingImageAsyncHelper(const Model::UpdateStreamingImageRequest& request, const UpdateStreamingImageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UpdateStudioAsyncHelper(const Model::UpdateStudioRequest& request, const UpdateStudioResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UpdateStudioComponentAsyncHelper(const Model::UpdateStudioComponentRequest& request, const UpdateStudioComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; Aws::String m_uri; Aws::String m_configScheme; std::shared_ptr<Aws::Utils::Threading::Executor> m_executor; }; } // namespace NimbleStudio } // namespace Aws
69.862207
292
0.71657
[ "model" ]
a0b2802480ed51ea6a96a0f63db990fe42f3f192
4,248
h
C
src/core/include/utils/serialize-binary.h
yamanalab/PALISADE
b476d46170da62d7235d55d9a20497778e96a724
[ "BSD-2-Clause" ]
null
null
null
src/core/include/utils/serialize-binary.h
yamanalab/PALISADE
b476d46170da62d7235d55d9a20497778e96a724
[ "BSD-2-Clause" ]
null
null
null
src/core/include/utils/serialize-binary.h
yamanalab/PALISADE
b476d46170da62d7235d55d9a20497778e96a724
[ "BSD-2-Clause" ]
null
null
null
/** * @file serialize-binary.h - include to enable binary serialization * @author TPOC: contact@palisade-crypto.org * * @copyright Copyright (c) 2019, New Jersey Institute of Technology (NJIT) * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. THIS SOFTWARE IS * PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef LBCRYPTO_SERIALIZE_BINARY_H #define LBCRYPTO_SERIALIZE_BINARY_H #include <vector> #include <unordered_map> #include <fstream> #include <sstream> #include <string> #include <iomanip> #include <iostream> #ifndef CEREAL_RAPIDJSON_HAS_STDSTRING #define CEREAL_RAPIDJSON_HAS_STDSTRING 1 #endif #ifndef CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS #define CEREAL_RAPIDJSON_HAS_CXX11_RVALUE_REFS 1 #endif #define CEREAL_RAPIDJSON_HAS_CXX11_NOEXCEPT 0 #ifdef __GNUC__ #if __GNUC__ >= 8 #pragma GCC diagnostic ignored "-Wclass-memaccess" #endif #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-private-field" #endif #include "cereal/cereal.hpp" #include "cereal/archives/portable_binary.hpp" #include "cereal/types/string.hpp" #include "cereal/types/vector.hpp" #include "cereal/types/map.hpp" #include "cereal/types/memory.hpp" #include "cereal/types/polymorphic.hpp" #ifdef __GNUC__ #if __GNUC__ >= 8 #pragma GCC diagnostic pop #endif #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #include "utils/serial.h" namespace lbcrypto { template <typename Element> class CryptoContextImpl; namespace Serial { /** * Serialize an object * @param obj - object to serialize * @param stream - Stream to serialize to * @param sertype - type of serialization; default is BINARY */ template <typename T> inline static void Serialize(const T& obj, std::ostream& stream, const SerType::SERBINARY& st) { cereal::PortableBinaryOutputArchive archive(stream); archive(obj); } /** * Deserialize an object * @param obj - object to deserialize into * @param stream - Stream to deserialize from * @param sertype - type of serialization; default is BINARY */ template <typename T> inline static void Deserialize(T& obj, std::istream& stream, const SerType::SERBINARY& st) { cereal::PortableBinaryInputArchive archive(stream); archive(obj); } template <typename T> inline static bool SerializeToFile(std::string filename, const T& obj, const SerType::SERBINARY& sertype) { std::ofstream file(filename, std::ios::out | std::ios::binary); if (file.is_open()) { Serial::Serialize(obj, file, sertype); file.close(); return true; } return false; } template <typename T> inline static bool DeserializeFromFile(std::string filename, T& obj, const SerType::SERBINARY& sertype) { std::ifstream file(filename, std::ios::in | std::ios::binary); if (file.is_open()) { Serial::Deserialize(obj, file, sertype); file.close(); return true; } return false; } } // namespace Serial } // namespace lbcrypto #endif
30.782609
80
0.73564
[ "object", "vector" ]
a0b323d13c1eef7afce8e7a2c9856a631e1ab4bc
3,787
c
C
d/newbie/rooms/keep/old/keep23.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-07-19T05:24:44.000Z
2021-11-18T04:08:19.000Z
d/newbie/rooms/keep/old/keep23.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
4
2021-03-15T18:56:39.000Z
2021-08-17T17:08:22.000Z
d/newbie/rooms/keep/old/keep23.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-09-12T06:22:38.000Z
2022-01-31T01:15:12.000Z
#include <std.h> #include "keep.h" inherit VAULT; void create() { ::create(); set_terrain(STONE_BUILDING); set_travel(PAVED_ROAD); set_property("indoors",1); set_property("light",1); set_short("The captain's room"); set_long( "You are standing in what was once most likely the guard captain's room. It"+ " is now in rather bad shape. The bookshelf in the corner has been smashed"+ " and overturned, the footboard of the bed has been kicked off, and the"+ " bedding and sheets are very moldy. The desk on the north side of the room"+ " is still mostly intact, but has the remains of a half-eaten (and not very"+ " well cooked) dinner on it that have begun to mold. The floor is littered"+ " with various forms of debris, several of which you notice are %^BOLD%^bones%^RESET%^." ); set_smell("default","There is a disgusting stench that permeats this room."); set_listen("default","The wind whistles faintly outside."); set_items(([ "floor" : "The floor is littered with various forms of debris, the most"+ " striking of which are carefully picked %^BOLD%^bones%^RESET%^.", "ceiling" : "The ceiling is rather unremarkable, except for the %^RED%^blood%^RESET%^ that"+ " has been splattered against it in places.", ({"wall","walls"}) : "The walls seem very sturdy here, although even they"+ " are quite dirty. You can see greasy and muddy hand prints in sections, and"+ " %^RED%^blood%^RESET%^ splattered in other areas, most likely from fights"+ " that have taken places in this room.", "desk" : "The desk is on the north side of the room and is made of sturdy"+ " oak wood. Despite being covered in various forms of filth that you don't"+ " even want to think about, it is in decent shape. There is even a chair on"+ " which to sit next to it.", "chair" : "The chair is very large and appears to be sturdy. Someone has"+ " decorated it in a rather macabre fashion with the skulls of various small"+ " creatures, almost as if it were some sort of throne or something.", "bed" : "The bed is still usable you suppose, although you might actually"+ " prefer the floor. The footboard has been kicked off of it, and the bedding"+ " and sheets are all very moldy, but it would support your weight.", ({"bedding","sheets","pillow","blanket"}) : "The bedding, sheets, pillow, and"+ " blanket that are on the bed are all rather moldy and stink something awful.", "bookshelf" : "The bookshelf on the south side of the room has been smashed"+ " into tiny pieces. There is not much actual wood left, you think parts of it"+ " have perhaps been used to try and repair the door. The books that it once"+ " held are mostly ripped and all of them are completely covered in mildew.", "books" : "Books are scattered about the broken bookshelf. Some have been"+ " ripped and torn, and all are covered in mildew.", "bones" : "%^WHITE%^%^BOLD%^You hope the bones aren't human, but several must have come from"+ " a larger animal. They have all been picked clean, and some have been cracked"+ " open and the marrow cleaned out.%^RESET%^", "debris" : "Debris of various sorts covers the floor, the most horrifying of"+ " which are %^BOLD%^bones%^RESET%^.", "door" : "The door leading back out into the hallway is still in fairly good"+ " shape. From this side you can see that it has obviously been repaired, but"+ " not very well and with wood that is also rather rotted.", ])); set_exits(([ "west" : ROOMS+"keep22", ])); set_door("door",ROOMS+"keep22","west",0); set_string("door","open","The door creaks open rather loudly."); } void reset() { ::reset(); if(!present("half-ogre")) { new(MONS+"halfogre")->move(TO); } }
51.175676
97
0.684447
[ "shape" ]
a0b4c6ef2f8be6f57c590336329af8a8e799fa89
16,550
h
C
oneEngine/oneGame/source/renderer/state/RrRenderer.h
skarik/1Engine
84e846544b4a89af8fd7e9236131363096538ef4
[ "BSD-3-Clause" ]
8
2017-12-08T02:59:31.000Z
2022-02-02T04:30:03.000Z
oneEngine/oneGame/source/renderer/state/RrRenderer.h
skarik/1Engine
84e846544b4a89af8fd7e9236131363096538ef4
[ "BSD-3-Clause" ]
2
2021-04-16T03:44:42.000Z
2021-08-30T06:48:44.000Z
oneEngine/oneGame/source/renderer/state/RrRenderer.h
skarik/1Engine
84e846544b4a89af8fd7e9236131363096538ef4
[ "BSD-3-Clause" ]
1
2021-04-16T02:09:54.000Z
2021-04-16T02:09:54.000Z
#ifndef RENDERER_RENDER_STATE_SYSTEM_H_ #define RENDERER_RENDER_STATE_SYSTEM_H_ #include "core/types/types.h" #include "core/containers/arstring.h" #include "renderer/types/types.h" #include "renderer/types/ObjectSettings.h" #include "renderer/types/RrGpuTexture.h" #include "renderer/types/id.h" #include "renderer/types/viewport.h" #include "renderer/state/InternalSettings.h" #include "renderer/state/pipeline/PipelineModes.h" #include "renderer/types/rrRenderContext.h" #include "renderer/state/RaiiHelpers2.h" //Todo: make following prototypes #include "gpuw/Texture.h" #include "gpuw/RenderTarget.h" #include "gpuw/Device.h" #include "gpuw/GraphicsContext.h" #include "gpuw/Buffers.h" #include "gpuw/Pipeline.h" #include <vector> class RrRenderObject; class RrLogicObject; class RrLight; class RrCamera; class CResourceManager; class RrPass; class RrRenderTexture; class CMRTTexture; struct rrCameraPass; class RrWindow; class RrRenderer; class RrPipelineStateRenderer; class RrPipelineOptions; // class RrWorld : A container of objects that can be rendered. class RrWorld { public: explicit RrWorld ( void ) {} ~RrWorld ( void ) {} friend RrRenderObject; rrId AddObject ( RrRenderObject* renderable ); bool RemoveObject ( RrRenderObject* renderable ); bool RemoveObject ( const rrId& renderable_id ); friend RrLogicObject; rrId AddLogic ( RrLogicObject* logic ); bool RemoveLogic ( RrLogicObject* logic ); bool RemoveLogic ( const rrId& logic_id ); void FrameUpdate ( void ); private: struct rrWorldState { enum WorkStep { kWorkStepSortObjects = 0, kWorkStepSortLogics = 1, kWorkStepCompactObjects = 2, kWorkStepCompactLogics = 3, kWorkStep_MAX, }; WorkStep work_step = kWorkStepSortObjects; }; rrWorldState state; void CompactObjectListing ( void ); void SortObjectListing ( void ); void CompactLogicListing ( void ) {} void SortLogicListing ( void ) {} public: renderer::PipelineMode pipeline_mode = renderer::PipelineMode::kNormal; RrPipelineOptions* pipeline_options = nullptr; uint world_index = UINT32_MAX; std::vector<RrRenderObject*> objects; std::vector<RrLogicObject*> logics; }; struct rrRenderFrameState { gpu::Buffer cbuffer_perFrame; }; // class RrOutputInfo : Defines an output's properties // Does not provide any logic, simply provides information. class RrOutputInfo { public: RrOutputInfo ( RrWorld* world, RrWindow* window ) { this->world = world; output_window = window; type = Type::kWindow; } public: enum class Type { kUinitialized, kWindow, kRenderTarget, }; arstring64 name; bool enabled = true; // Update interval normally used. When -1, updates every frame. When 0, does not update. int update_interval = -1; // Update interval when the view isn't focused. Only valid for Type::kWindow. When -1, updates every frame. When 0, does not update. int update_interval_when_not_focused = -1; // World this output shows RrWorld* world = nullptr; // Camera used for rendering this world RrCamera* camera = nullptr; // Is the viewport scaled up to the output each frame? bool scale_viewport_to_output = true; // If scale_viewport_to_output is false, provides the viewport. rrViewport viewport; // Output type - window or render target Type type = Type::kUinitialized; // Output window if type is Window RrWindow* output_window = nullptr; // Output target if type is RenderTarget RrRenderTexture* output_target = nullptr; public: // GetOutputSize() : Returns the desired output size for the given output RENDER_API Vector2i GetOutputSize ( void ) const; // GetRenderTarget() : Returns the render target for the output RENDER_API gpu::RenderTarget* GetRenderTarget ( void ) const; // GetOutputViewport() : Returns the size of the output viewport. RENDER_API rrViewport GetOutputViewport ( void ) const { if (scale_viewport_to_output) { //return rrViewport{.corner=Vector2i(0, 0), .size=GetOutputSize(), .pixel_density=viewport.pixel_density}; return rrViewport{Vector2i(0, 0), GetOutputSize(), viewport.pixel_density}; } else { return viewport; } } // GetUpdateInterval() : Returns the current update interval for the output. RENDER_API int GetUpdateInterval ( void ) const; }; // class RrOutputState : State for the output views. // Persistent between frames. class RrOutputState { public: explicit RrOutputState ( void ) {} ~RrOutputState ( void ) { FreeContexts(); } // Update() : TODO void Update ( RrOutputInfo* output_info, rrRenderFrameState* frame_state ); // NeedsRender() : TODO bool NeedsRender ( void ) const { return needs_render; } private: void FreeContexts ( void ); private: bool needs_render = false; public: RrOutputInfo* output_info = nullptr; // Counter used for updating the output. int update_interval_counter = 0; Vector2i output_size; bool first_frame_after_creation = false; // Render info and structures for the given frame. rrRenderFrameState* frame_state; public: // Current pipeline mode used for rendering. renderer::PipelineMode pipeline_mode = renderer::PipelineMode::kNormal; // Pipeline state renderer. Used for setting up additional pass information. RrPipelineStateRenderer* pipeline_renderer = nullptr; public: gpu::GraphicsContext* graphics_context = nullptr; }; // struct rrDepthBufferRequest { Vector2i size = Vector2i(0, 0); core::gfx::tex::arColorFormat depth = core::gfx::tex::kDepthFormat32; core::gfx::tex::arColorFormat stencil = core::gfx::tex::KStencilFormatIndex16; int32 mips = 1; // Number of frames this request should persist for int32 persist_for = 2; }; // struct rrRTBufferRequest { Vector2i size = Vector2i(0, 0); core::gfx::tex::arColorFormat format = core::gfx::tex::kColorFormatRGBA16F; int32 mips = 1; // Number of frames this request should persist for int32 persist_for = 2; }; // struct rrMRTBufferRequest { Vector2i size = Vector2i(0, 0); uint8 count; const core::gfx::tex::arColorFormat* formats = nullptr; int32 mips = 1; // Number of frames this request should persist for int32 persist_for = 2; }; // struct rrStoredRenderTexture { Vector2i size; int frame_of_request; int persist_for; core::gfx::tex::arColorFormat format; gpu::Texture texture; }; // struct rrStoredRenderDepthTexture { Vector2i size; int frame_of_request; int persist_for; core::gfx::tex::arColorFormat depth_format; core::gfx::tex::arColorFormat stencil_format; gpu::Texture depth_texture; gpu::WOFrameAttachment stencil_texture; }; // rrRenderRequest : Render request struct rrRenderRequest { RrRenderObject* obj = nullptr; uint8_t pass = UINT8_MAX; }; struct rrRenderRequestSorter { bool operator() ( const rrRenderRequest& i, const rrRenderRequest& j ); }; // Global active instance RENDER_API extern RrRenderer* SceneRenderer; // RrRenderer : main render state & swapchain manager class class RrRenderer { public: // Structure Definitions // ================================ // rrOutputPair : Pair of output info & state struct rrOutputPair { RrOutputInfo info; RrOutputState* state = nullptr; }; public: // Constructor, Destructor, and Initialization // ================================ RENDER_API explicit RrRenderer ( void ); RENDER_API ~RrRenderer ( void ); private: void InitializeResourcesWithDevice ( gpu::Device* device ); void InitializeCommonPipelineResources ( gpu::Device* device ); void FreeCommonPipelineResources ( gpu::Device* device ); public: // Output Management // ================================ // AddOutput(info) : Adds output to be rendered RENDER_API uint AddOutput ( const RrOutputInfo& info ); // GetOutput<Index>() : Gets output with given index. template <int Index> RrOutputInfo& GetOutput ( void ) { ARCORE_ASSERT(Index >= 0 && (size_t)(Index) < render_outputs.size()); return render_outputs[Index].info; } // GetOutput(Index) : Gets output with given index. RrOutputInfo& GetOutput ( const uint Index ) { ARCORE_ASSERT(Index >= 0 && (size_t)(Index) < render_outputs.size()); return render_outputs[Index].info; } // GetOutput<Index>() : Gets output with given index. template <int Index> const RrOutputInfo& GetOutput ( void ) const { ARCORE_ASSERT(Index >= 0 && (size_t)(Index) < render_outputs.size()); return render_outputs[Index].info; } // GetOutput(Index) : Gets output with given index. const RrOutputInfo& GetOutput ( const uint Index ) const { ARCORE_ASSERT(Index >= 0 && (size_t)(Index) < render_outputs.size()); return render_outputs[Index].info; } // FindOutputWithTarget(Window) : Finds output with the given window. Returns its index. RENDER_API uint FindOutputWithTarget ( RrWindow* window ); // FindOutputWithTarget(Window) : Finds output with the given window. Returns its index. RENDER_API uint FindOutputWithTarget ( RrRenderTexture* target ); // RemoveOutput(Index) : Removes the output with the given index. RENDER_API void RemoveOutput ( const uint Index ); // World Management // ================================ // AddWorld(world) : Adds world to the renderer for update. RENDER_API uint AddWorld ( RrWorld* world ); // AddWorldDefault() : Adds a world with default settings to the renderer for update. RENDER_API uint AddWorldDefault ( void ); // GetWorld<Index>() : Gets world with given index. template <int Index> RrWorld* GetWorld ( void ) { ARCORE_ASSERT(Index >= 0 && (size_t)(Index) < worlds.size()); return worlds[Index]; } // GetWorld(Index) : Gets world with given index. RrWorld* GetWorld ( const uint Index ) { ARCORE_ASSERT(Index >= 0 && (size_t)(Index) < worlds.size()); return worlds[Index]; } // RemoveWorld(Index) : Removes world with the given index. RENDER_API void RemoveWorld ( const uint Index ); // RemoveWorld(World) : Removes given world. RENDER_API void RemoveWorld ( RrWorld* world ); // Buffer management // ================================ // Public Render routine // ================================ // Performs internal render loop RENDER_API void Render ( void ); // object state update void StepPreRender ( rrRenderFrameState* frameState ); void StepBufferPush ( gpu::GraphicsContext* gfx, const RrOutputInfo& output, RrOutputState* state, gpu::Texture texture ); void StepPostRender ( void ); // Full Scene Rendering Routines // ================================ gpu::Texture RenderOutput ( gpu::GraphicsContext* gfx, const RrOutputInfo& output, RrOutputState* state, RrWorld* world ); RENDER_API gpu::Texture RenderObjectListWorld ( gpu::GraphicsContext* gfx, rrCameraPass* cameraPass, RrRenderObject** objectsToRender, const uint32_t objectCount, RrOutputState* state ); // Specialized Rendering Routines // ================================ // Rendering configuration // ================================ // Resource creation and management // ================================ // CreatePipeline() : Creates a screen-quad pipeline for the given shader pipeline. RENDER_API void CreatePipeline ( gpu::ShaderPipeline* in_pipeline, gpu::Pipeline& out_pipeline ); private: gpu::Buffer m_vbufDefault; gpu::Pipeline m_pipelineScreenQuadCopy; gpu::Buffer m_vbufScreenQuad; gpu::Buffer m_vbufScreenQuad_ForOutputSurface; // Per-API flips gpu::Buffer m_vbufLightSphere; gpu::Buffer m_vbufLightSphereIndicies; uint32 m_vbufLightSphereLength; gpu::Buffer m_vbufLightCone; gpu::Buffer m_vbufLightConeIndicies; uint32 m_vbufLightConeLength; public: RENDER_API const gpu::Buffer& GetDefaultVertexBuffer ( void ) { return m_vbufDefault; } RENDER_API const gpu::Pipeline& GetScreenQuadCopyPipeline ( void ) { return m_pipelineScreenQuadCopy; } RENDER_API const gpu::Buffer& GetScreenQuadVertexBuffer ( void ) { return m_vbufScreenQuad; } RENDER_API const gpu::Buffer& GetScreenQuadOutputVertexBuffer ( void ) { return m_vbufScreenQuad_ForOutputSurface; } RENDER_API const gpu::Buffer& GetLightSphereVertexBuffer ( void ) { return m_vbufLightSphere; } RENDER_API const gpu::Buffer& GetLightSphereIndexBuffer ( void ) { return m_vbufLightSphereIndicies; } RENDER_API const uint32 GetLightSphereIndexCount ( void ) { return m_vbufLightSphereLength; } RENDER_API const gpu::Buffer& GetLightConeVertexBuffer ( void ) { return m_vbufLightCone; } RENDER_API const gpu::Buffer& GetLightConeIndexBuffer ( void ) { return m_vbufLightConeIndicies; } RENDER_API const uint32 GetLightConeIndexCount ( void ) { return m_vbufLightConeLength; } public: // Public active instance pointer RENDER_API static RrRenderer* Active; public: RENDER_API void CreateRenderTexture ( rrDepthBufferRequest* in_out_request, gpu::Texture* depth, gpu::WOFrameAttachment* stencil ); RENDER_API void CreateRenderTexture ( const rrRTBufferRequest& in_request, gpu::Texture* color ); RENDER_API void CreateRenderTextures ( const rrMRTBufferRequest& in_request, gpu::Texture* colors ); private: void UpdateResourcePools ( void ); private: std::vector<rrStoredRenderTexture> m_renderTexturePool; std::vector<rrStoredRenderDepthTexture> m_renderDepthTexturePool; rrDepthBufferRequest m_currentDepthBufferRequest; private: rrSingleFrameConstantBufferPool m_constantBufferPool; private: gpu::Device* gpu_device; public: gpu::Device* GetGpuDevice ( void ) const { return gpu_device; } private: // Renderable object access and management // ================================ // Objects queued to add to the default world std::vector<RrRenderObject*> objects_to_add; // Logics queued to add to the default world std::vector<RrLogicObject*> logics_to_add; void AddQueuedToWorld ( void ); public: class Listings { private: friend RrRenderObject; friend RrLogicObject; static void AddToUnsorted ( RrRenderObject* object, rrId& out_id ) { SceneRenderer->objects_to_add.push_back(object); out_id = rrId(); out_id.object_index = (uint16)(SceneRenderer->objects_to_add.size() - 1); out_id.world_index = rrId::kWorldInvalid; } static void RemoveFromUnsorted ( RrRenderObject* object, const rrId& id ) { if (SceneRenderer->objects_to_add.back() == object) { ARCORE_ASSERT(id.object_index == (SceneRenderer->objects_to_add.size() - 1)); SceneRenderer->objects_to_add.pop_back(); } else { ARCORE_ASSERT(SceneRenderer->objects_to_add[id.object_index] == object); SceneRenderer->objects_to_add[id.object_index] = nullptr; } } static void AddToUnsorted ( RrLogicObject* object, rrId& out_id ) { SceneRenderer->logics_to_add.push_back(object); out_id = rrId(); out_id.object_index = (uint16)(SceneRenderer->logics_to_add.size() - 1); out_id.world_index = rrId::kWorldInvalid; } static void RemoveFromUnsorted ( RrLogicObject* object, const rrId& id ) { if (SceneRenderer->logics_to_add.back() == object) { ARCORE_ASSERT(id.object_index == (SceneRenderer->logics_to_add.size() - 1)); SceneRenderer->logics_to_add.pop_back(); } else { ARCORE_ASSERT(SceneRenderer->logics_to_add[id.object_index] == object); SceneRenderer->logics_to_add[id.object_index] = nullptr; } } static RrWorld* GetWorld ( const rrId& id ) { if (id.world_index != rrId::kWorldInvalid) { ARCORE_ASSERT(id.world_index < SceneRenderer->worlds.size()); return SceneRenderer->worlds[id.world_index]; } return nullptr; } }; private: // // ================================ // list of outputs std::vector<rrOutputPair> render_outputs; // list of worlds std::vector<RrWorld*> worlds; // Render list // ================================ // Render list sorting // ================================ rrRenderRequestSorter RenderRequestSorter; // Render state // ================================ // Logic list // ================================ // Internal setup state // ================================ uint8 backbuffer_count = 3; int frame_index = 0; // Deferred pass materials // ================================ }; #endif//RENDERER_RENDER_STATE_SYSTEM_H_
26.353503
187
0.694079
[ "render", "object", "vector" ]
a0b4ca759faf0d982fab4735502fa20fe57029d5
15,505
h
C
libkram/kram/KTXImage.h
alecazam/kram
cad0a407ba28329dd38dbdcfd300acd404660556
[ "MIT" ]
53
2020-11-12T03:29:10.000Z
2022-03-13T19:00:52.000Z
libkram/kram/KTXImage.h
alecazam/kram
cad0a407ba28329dd38dbdcfd300acd404660556
[ "MIT" ]
10
2020-11-11T16:45:46.000Z
2022-03-19T18:45:30.000Z
libkram/kram/KTXImage.h
alecazam/kram
cad0a407ba28329dd38dbdcfd300acd404660556
[ "MIT" ]
3
2021-09-29T05:44:18.000Z
2022-02-28T11:26:34.000Z
// kram - Copyright 2020 by Alec Miller. - MIT License // The license and copyright notice shall be included // in all copies or substantial portions of the Software. #pragma once //#include <string> //#include <vector> #include "KramConfig.h" namespace kram { using namespace NAMESPACE_STL; // TODO: abstract MyMTLPixelFormat and move to readable/neutral type enum MyMTLPixelFormat { // Note: bc6/7 aren't supported by squish // ATE in Xcode 12 added bc1/3/4/5/7. MyMTLPixelFormatInvalid = 0, //--------- // bc MyMTLPixelFormatBC1_RGBA = 130, MyMTLPixelFormatBC1_RGBA_sRGB = 131, // MyMTLPixelFormatBC2_RGBA = 132, // MyMTLPixelFormatBC2_RGBA_sRGB = 133, MyMTLPixelFormatBC3_RGBA = 134, MyMTLPixelFormatBC3_RGBA_sRGB = 135, MyMTLPixelFormatBC4_RUnorm = 140, MyMTLPixelFormatBC4_RSnorm = 141, MyMTLPixelFormatBC5_RGUnorm = 142, MyMTLPixelFormatBC5_RGSnorm = 143, MyMTLPixelFormatBC6H_RGBFloat = 150, MyMTLPixelFormatBC6H_RGBUfloat = 151, MyMTLPixelFormatBC7_RGBAUnorm = 152, MyMTLPixelFormatBC7_RGBAUnorm_sRGB = 153, //--------- // astc - 16, 25, 35, 64px blocks MyMTLPixelFormatASTC_4x4_sRGB = 186, MyMTLPixelFormatASTC_4x4_LDR = 204, MyMTLPixelFormatASTC_4x4_HDR = 222, MyMTLPixelFormatASTC_5x5_sRGB = 188, MyMTLPixelFormatASTC_5x5_LDR = 206, MyMTLPixelFormatASTC_5x5_HDR = 224, MyMTLPixelFormatASTC_6x6_sRGB = 190, MyMTLPixelFormatASTC_6x6_LDR = 208, MyMTLPixelFormatASTC_6x6_HDR = 226, MyMTLPixelFormatASTC_8x8_sRGB = 194, MyMTLPixelFormatASTC_8x8_LDR = 212, MyMTLPixelFormatASTC_8x8_HDR = 230, //--------- // etc2 MyMTLPixelFormatEAC_R11Unorm = 170, MyMTLPixelFormatEAC_R11Snorm = 172, MyMTLPixelFormatEAC_RG11Unorm = 174, MyMTLPixelFormatEAC_RG11Snorm = 176, MyMTLPixelFormatETC2_RGB8 = 180, MyMTLPixelFormatETC2_RGB8_sRGB = 181, MyMTLPixelFormatEAC_RGBA8 = 178, MyMTLPixelFormatEAC_RGBA8_sRGB = 179, // not supporting // MyMTLPixelFormatETC2_RGB8A1 = 182, // MyMTLPixelFormatETC2_RGB8A1_sRGB = 183, // ------ // Explicit formats MyMTLPixelFormatR8Unorm = 10, MyMTLPixelFormatRG8Unorm = 30, MyMTLPixelFormatRGBA8Unorm = 70, // TODO: support these // MyMTLPixelFormatR8Unorm_sRGB = 11, // MyMTLPixelFormatRG8Unorm_sRGB= 31, MyMTLPixelFormatRGBA8Unorm_sRGB = 71, // MyMTLPixelFormatR8Snorm = 12, // MyMTLPixelFormatRG8Snorm = 32, // MyMTLPixelFormatRGBA8Snorm = 72, // TODO: also BGRA8Unorm types? MyMTLPixelFormatR16Float = 25, MyMTLPixelFormatRG16Float = 65, MyMTLPixelFormatRGBA16Float = 115, MyMTLPixelFormatR32Float = 55, MyMTLPixelFormatRG32Float = 105, MyMTLPixelFormatRGBA32Float = 125, // TODO: also need rgb9e5 for fallback if ASTC HDR/6H not supported // That is Unity's fallback if alpha not needed, otherwise RGBA16F. #if SUPPORT_RGB // Can import files from KTX/KTX2 with RGB data, but convert right away to RGBA. // These are not export formats. Watch alignment on these too. These // have no MTLPixelFormat. MyMTLPixelFormatRGB8Unorm_internal = 200, MyMTLPixelFormatRGB8Unorm_sRGB_internal = 201, MyMTLPixelFormatRGB16Float_internal = 202, MyMTLPixelFormatRGB32Float_internal = 203, #endif }; enum MyMTLTextureType { // MyMTLTextureType1D = 0, // not twiddled or compressed, more like a buffer but with texture limits MyMTLTextureType1DArray = 1, // not twiddled or compressed, more like a buffer but with texture limits MyMTLTextureType2D = 2, MyMTLTextureType2DArray = 3, // MyMTLTextureType2DMultisample = 4, MyMTLTextureTypeCube = 5, MyMTLTextureTypeCubeArray, MyMTLTextureType3D = 7, // MyMTLTextureType2DMultisampleArray = 8, // MyMTLTextureTypeTextureBuffer = 9 }; struct Int2 { int x, y; }; //--------------------------------------------- constexpr int32_t kKTXIdentifierSize = 12; extern const uint8_t kKTXIdentifier[kKTXIdentifierSize]; extern const uint8_t kKTX2Identifier[kKTXIdentifierSize]; class KTXHeader { public: // Don't add any date to this class. It's typically the top of a file cast to this. // As such, this doesn't have much functionality, other than to hold the header. // 64-byte header uint8_t identifier[kKTXIdentifierSize] = { // same is kKTXIdentifier 0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A //'«', 'K', 'T', 'X', ' ', '1', '1', '»', '\r', '\n', '\x1A', '\n' }; uint32_t endianness = 0x04030201; uint32_t glType = 0; // compressed = 0 uint32_t glTypeSize = 1; // doesn't depend on endianness uint32_t glFormat = 0; uint32_t glInternalFormat = 0; // must be same as glFormat uint32_t glBaseInternalFormat = 0; // GL_RED, RG, RGB, RGBA, SRGB, SRGBA uint32_t pixelWidth = 1; uint32_t pixelHeight = 0; // >0 for 2d uint32_t pixelDepth = 0; // >0 for 3d uint32_t numberOfArrayElements = 0; uint32_t numberOfFaces = 1; uint32_t numberOfMipmapLevels = 1; // 0 means auto mip uint32_t bytesOfKeyValueData = 0; public: // depth * faces * array uint32_t totalChunks() const; // this has gaps in the mapping for ASTC HDR void initFormatGL(MyMTLPixelFormat pixelFormat); MyMTLTextureType metalTextureType() const; // only use this if prop KTXmetalFormat not written out MyMTLPixelFormat metalFormat() const; }; // This is one entire level of mipLevels. // In KTX, the image levels are assumed from format and size since no compression applied. //class KTXImageLevel { //public: // uint64_t offset; // numChunks * length // uint64_t length; // size of a single mip //}; //--------------------------------------------- // Mips are reversed from KTX1 (mips are smallest first for streaming), // and this stores an array of supercompressed levels, and has dfds. class KTX2Header { public: uint8_t identifier[kKTXIdentifierSize] = { // same is kKTX2Identifier 0xAB, 0x4B, 0x54, 0x58, 0x20, 0x32, 0x30, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A // '«', 'K', 'T', 'X', ' ', '2', '0', '»', '\r', '\n', '\x1A', '\n' }; uint32_t vkFormat = 0; // invalid format uint32_t typeSize = 1; uint32_t pixelWidth = 1; uint32_t pixelHeight = 0; uint32_t pixelDepth = 0; uint32_t layerCount = 0; uint32_t faceCount = 1; uint32_t levelCount = 1; uint32_t supercompressionScheme = 0; // Index // dfd block uint32_t dfdByteOffset = 0; uint32_t dfdByteLength = 0; // key-value uint32_t kvdByteOffset = 0; uint32_t kvdByteLength = 0; // supercompress global data uint64_t sgdByteOffset = 0; uint64_t sgdByteLength = 0; // chunks hold levelCount of all mips of the same size // KTXImageLevel* chunks; // [levelCount] }; // Unlike KTX, KTX2 writes an array of level sizes since level compression may be used. // Level compression is an entire compressed array of chunks at a given mip dimension. // So then the entire level must be decompressed before a chunk can be accessed. // This is one entire level of mipLevels. // // Use this for KTX, but there length == lengthCompressed, and the array is just a temporary. // and the offsts include a 4 byte length at the start of each level. class KTXImageLevel { public: uint64_t offset = 0; // differ in ordering - ktx largest first, ktx2 smallest first uint64_t lengthCompressed = 0; // set to 0 if not compresseds uint64_t length = 0; // numChunks * mipSize when written for non cube on KTX1 or all KTX2, internally only stores mipSize }; enum KTX2Supercompression { KTX2SupercompressionNone = 0, KTX2SupercompressionBasisLZ = 1, // can transcode, but can't gen from KTX file using ktxsc, uses sgdByteLength KTX2SupercompressionZstd = 2, // faster deflate, ktxsc support KTX2SupercompressionZlib = 3, // deflate, no ktxsc support (use miniz) // TODO: Need LZFSE? // TODO: need Kraken for PS4 // TODO: need Xbox format }; struct KTX2Compressor { KTX2Supercompression compressorType = KTX2SupercompressionNone; float compressorLevel = 0.0f; // 0.0 is default bool isCompressed() const { return compressorType != KTX2SupercompressionNone; } }; //--------------------------------------------- // Since can't add anything to KTXHeader without throwing off KTXHeader size, // this holds any mutable data for reading/writing KTX images. class KTXImage { public: // this calls init calls bool open(const uint8_t* imageData, size_t imageDataLength, bool isInfoOnly = false); void initProps(const uint8_t* propsData, size_t propDataSize); void initMipLevels(size_t mipOffset); void initMipLevels(bool doMipmaps, int32_t mipMinSize, int32_t mipMaxSize, int32_t mipSkip, uint32_t& numSkippedMips); bool validateMipLevels() const; // props handling void toPropsData(vector<uint8_t>& propsData); string getProp(const char* name) const; void addProp(const char* name, const char* value); void addFormatProps(); void addSwizzleProps(const char* swizzleTextPre, const char* swizzleTexPost); void addSourceHashProps(uint32_t sourceHash); void addChannelProps(const char* channelContent); void addAddressProps(const char* addressContent); void addFilterProps(const char* filterContent); // block data depends on format uint32_t blockSize() const; Int2 blockDims() const; uint32_t blockCount(uint32_t width_, uint32_t height_) const; uint32_t blockCountRows(uint32_t width_) const; // this is where KTXImage holds all mip data internally void reserveImageData(); void reserveImageData(size_t totalSize); vector<uint8_t>& imageData(); // for KTX2 files, the mips can be compressed using various encoders bool isSupercompressed() const { return isKTX2() && mipLevels[0].lengthCompressed != 0; } bool isKTX1() const { return !skipImageLength; } bool isKTX2() const { return skipImageLength; } // determine if image stores rgb * a bool isPremul() const; // can use on ktx1/2 files, does a decompress if needed bool unpackLevel(uint32_t mipNumber, const uint8_t* srcData, uint8_t* dstData) const; // helpers to work with the mipLevels array, mipLength and levelLength are important to get right // mip data depends on format // mip void mipDimensions(uint32_t mipNumber, uint32_t& width_, uint32_t& height_, uint32_t& depth_) const; uint32_t mipLengthCalc(uint32_t width_, uint32_t height_) const; uint32_t mipLengthCalc(uint32_t mipNumber) const; size_t mipLengthLargest() const { return mipLevels[0].length; } size_t mipLength(uint32_t mipNumber) const { return mipLevels[mipNumber].length; } // level size_t levelLength(uint32_t mipNumber) const { return mipLevels[mipNumber].length * totalChunks(); } size_t levelLengthCompressed(uint32_t mipNumber) const { return mipLevels[mipNumber].lengthCompressed; } // chunk uint32_t totalChunks() const; size_t chunkOffset(uint32_t mipNumber, uint32_t chunkNumber) const { return mipLevels[mipNumber].offset + mipLevels[mipNumber].length * chunkNumber; } // trying to bury access to KTX1 header, since this supports KTX2 now uint32_t arrayCount() const { return std::max(1u, header.numberOfArrayElements); } uint32_t mipCount() const { return std::max(1u, header.numberOfMipmapLevels); } uint32_t faceCount() const { return std::max(1u, header.numberOfFaces); } private: bool openKTX2(const uint8_t* imageData, size_t imageDataLength, bool isInfoOnly); // ktx2 mips are uncompressed to convert back to ktx1, but without the image offset vector<uint8_t> _imageData; public: // TODO: bury this MyMTLTextureType textureType = MyMTLTextureType2D; MyMTLPixelFormat pixelFormat = MyMTLPixelFormatInvalid; // copied out of header, but also may be 1 instead of 0 // also these can be modified, and often are non-zero even if header is uint32_t width = 0; uint32_t height = 0; uint32_t depth = 0; // for ktx2 bool skipImageLength = false; KTX2Supercompression supercompressionType = KTX2SupercompressionNone; KTXHeader header; // copy of KTXHeader from KTX1, so can be modified and then written back // write out only string/string props, for easy of viewing vector<pair<string, string> > props; vector<KTXImageLevel> mipLevels; // offsets into fileData // this only holds data for mipLevels size_t fileDataLength = 0; const uint8_t* fileData = nullptr; // mmap data }; // GL/D3D hobbled non-pow2 mips by only supporting round down, not round up // And then Metal followed OpenGL since it's the same hw and drivers. // Round up adds an extra mip level to the chain, but results in much better filtering. // https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_non_power_of_two.txt // http://download.nvidia.com/developer/Papers/2005/NP2_Mipmapping/NP2_Mipmap_Creation.pdf inline void mipDown(int32_t& w, int32_t& h, int32_t& d, uint32_t lod = 1) { // round-down w >>= (int32_t)lod; h >>= (int32_t)lod; d >>= (int32_t)lod; if (w < 1) w = 1; if (h < 1) h = 1; if (d < 1) d = 1; } inline void mipDown(uint32_t& w, uint32_t& h, uint32_t& d, uint32_t lod = 1) { // round-down w >>= lod; h >>= lod; d >>= lod; if (w < 1) w = 1; if (h < 1) h = 1; if (d < 1) d = 1; } inline void KTXImage::mipDimensions(uint32_t mipNumber, uint32_t& width_, uint32_t& height_, uint32_t& depth_) const { assert(mipNumber < mipLevels.size()); width_ = width; height_ = height; depth_ = depth; mipDown(width_, height_, depth_, mipNumber); } const char* supercompressionName(KTX2Supercompression type); // Generic format helpers. All based on the ubiquitous type. bool isFloatFormat(MyMTLPixelFormat format); bool isHalfFormat(MyMTLPixelFormat format); bool isHdrFormat(MyMTLPixelFormat format); bool isSrgbFormat(MyMTLPixelFormat format); bool isColorFormat(MyMTLPixelFormat format); bool isAlphaFormat(MyMTLPixelFormat format); bool isSignedFormat(MyMTLPixelFormat format); bool isBCFormat(MyMTLPixelFormat format); bool isETCFormat(MyMTLPixelFormat format); bool isASTCFormat(MyMTLPixelFormat format); bool isBlockFormat(MyMTLPixelFormat format); bool isExplicitFormat(MyMTLPixelFormat format); Int2 blockDimsOfFormat(MyMTLPixelFormat format); uint32_t blockSizeOfFormat(MyMTLPixelFormat format); uint32_t numChannelsOfFormat(MyMTLPixelFormat format); const char* formatTypeName(MyMTLPixelFormat format); // metal uint32_t metalType(MyMTLPixelFormat format); // really MTLPixelFormat const char* metalTypeName(MyMTLPixelFormat format); // vuklan const char* vulkanTypeName(MyMTLPixelFormat format); uint32_t vulkanType(MyMTLPixelFormat format); // really VKFormat MyMTLPixelFormat vulkanToMetalFormat(uint32_t format); // really VKFormat // gl const char* glTypeName(MyMTLPixelFormat format); uint32_t glType(MyMTLPixelFormat format); MyMTLPixelFormat glToMetalFormat(uint32_t format); const char* textureTypeName(MyMTLTextureType textureType); // find a corresponding srgb/non-srgb format for a given format MyMTLPixelFormat toggleSrgbFormat(MyMTLPixelFormat format); } // namespace kram
34.151982
154
0.708094
[ "vector", "3d" ]
a0b9d09f2493db6e37db50ff511815edff8aa8ea
964
c
C
render/gles2/pixel_format.c
nyorain/wlroots
7d0bf9a1a77420f09389bda1acafcd4bd42e82f1
[ "MIT" ]
1
2021-04-22T15:36:38.000Z
2021-04-22T15:36:38.000Z
render/gles2/pixel_format.c
nyorain/wlroots
7d0bf9a1a77420f09389bda1acafcd4bd42e82f1
[ "MIT" ]
1
2021-06-23T23:47:29.000Z
2021-06-23T23:47:29.000Z
render/gles2/pixel_format.c
nyorain/wlroots
7d0bf9a1a77420f09389bda1acafcd4bd42e82f1
[ "MIT" ]
null
null
null
#include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include "render/gles2.h" // Adapted from weston struct pixel_format formats[] = { { .wl_format = WL_SHM_FORMAT_ARGB8888, .depth = 32, .bpp = 32, .gl_format = GL_BGRA_EXT, .gl_type = GL_UNSIGNED_BYTE, .shader = &shaders.rgba }, { .wl_format = WL_SHM_FORMAT_XRGB8888, .depth = 24, .bpp = 32, .gl_format = GL_BGRA_EXT, .gl_type = GL_UNSIGNED_BYTE, .shader = &shaders.rgbx }, { .wl_format = WL_SHM_FORMAT_XBGR8888, .gl_format = GL_RGBA, .gl_type = GL_UNSIGNED_BYTE, .shader = &shaders.rgbx }, { .wl_format = WL_SHM_FORMAT_ABGR8888, .gl_format = GL_RGBA, .gl_type = GL_UNSIGNED_BYTE, .shader = &shaders.rgba }, }; // TODO: more pixel formats const struct pixel_format *gl_format_for_wl_format(enum wl_shm_format fmt) { for (size_t i = 0; i < sizeof(formats) / sizeof(*formats); ++i) { if (formats[i].wl_format == fmt) { return &formats[i]; } } return NULL; }
20.956522
76
0.671162
[ "render" ]
a0c14707abc28f5c1a5dff5cbf2e33b393e2f6b1
2,054
h
C
SurgSim/Collision/DefaultContactCalculation.h
dbungert/opensurgsim
bd30629f2fd83f823632293959b7654275552fa9
[ "Apache-2.0" ]
24
2015-01-19T16:18:59.000Z
2022-03-13T03:29:11.000Z
SurgSim/Collision/DefaultContactCalculation.h
dbungert/opensurgsim
bd30629f2fd83f823632293959b7654275552fa9
[ "Apache-2.0" ]
3
2018-12-21T14:54:08.000Z
2022-03-14T12:38:07.000Z
SurgSim/Collision/DefaultContactCalculation.h
dbungert/opensurgsim
bd30629f2fd83f823632293959b7654275552fa9
[ "Apache-2.0" ]
8
2015-04-10T19:45:36.000Z
2022-02-02T17:00:59.000Z
// This file is a part of the OpenSurgSim project. // Copyright 2013-2015, SimQuest Solutions Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef SURGSIM_COLLISION_DEFAULTCONTACTCALCULATION_H #define SURGSIM_COLLISION_DEFAULTCONTACTCALCULATION_H #include <memory> #include "SurgSim/Collision/ContactCalculation.h" namespace SurgSim { namespace Collision { class CollisionPair; /// A default calculation, it does nothing and can be used as a placeholder class DefaultContactCalculation : public ContactCalculation { public: /// Constructor /// \param doAssert If set the calculation will throw an exception if it is executed, this /// can be used to detect cases where a contact calculation is being called /// on a pair that should be implemented explicit DefaultContactCalculation(bool doAssert = false); /// Destructor virtual ~DefaultContactCalculation(); std::pair<int, int> getShapeTypes() override; private: bool m_doAssert; void doCalculateContact(std::shared_ptr<CollisionPair> pair) override; std::list<std::shared_ptr<Contact>> doCalculateDcdContact( const Math::PosedShape<std::shared_ptr<Math::Shape>>& posedShape1, const Math::PosedShape<std::shared_ptr<Math::Shape>>& posedShape2) override; std::list<std::shared_ptr<Contact>> doCalculateCcdContact( const Math::PosedShapeMotion<std::shared_ptr<Math::Shape>>& posedShapeMotion1, const Math::PosedShapeMotion<std::shared_ptr<Math::Shape>>& posedShapeMotion2) override; }; }; // namespace Collision }; // namespace SurgSim #endif
32.603175
91
0.768257
[ "shape" ]
a0c533cc0409e84b6857367b0907c69043c3494b
9,913
h
C
clicks/eeprom4/lib/include/eeprom4.h
StrahinjaJacimovic/mikrosdk_click_v2
f8002047c96605f340957a0d3fdbde33706d02ac
[ "MIT" ]
31
2020-10-02T14:15:14.000Z
2022-03-24T08:33:21.000Z
clicks/eeprom4/lib/include/eeprom4.h
greghol/mikrosdk_click_v2
76e5dec265dce5fca72c4b93f77afd668dde5dfa
[ "MIT" ]
4
2020-10-27T14:05:00.000Z
2022-03-10T09:38:57.000Z
clicks/eeprom4/lib/include/eeprom4.h
greghol/mikrosdk_click_v2
76e5dec265dce5fca72c4b93f77afd668dde5dfa
[ "MIT" ]
32
2020-11-28T07:56:42.000Z
2022-03-14T19:42:29.000Z
/* * MikroSDK - MikroE Software Development Kit * Copyright© 2020 MikroElektronika d.o.o. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE * OR OTHER DEALINGS IN THE SOFTWARE. */ /*! * \file * * \brief This file contains API for EEPROM 4 Click driver. * * \addtogroup eeprom4 EEPROM 4 Click Driver * @{ */ // ---------------------------------------------------------------------------- #ifndef EEPROM4_H #define EEPROM4_H #include "drv_digital_out.h" #include "drv_spi_master.h" // -------------------------------------------------------------- PUBLIC MACROS /** * \defgroup macros Macros * \{ */ /** * \defgroup map_mikrobus MikroBUS * \{ */ #define EEPROM4_MAP_MIKROBUS( cfg, mikrobus ) \ cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \ cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \ cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \ cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \ cfg.wp = MIKROBUS( mikrobus, MIKROBUS_RST ); \ cfg.hld = MIKROBUS( mikrobus, MIKROBUS_PWM ) /** \} */ /** * \defgroup error_code Error Code * \{ */ #define EEPROM4_RETVAL uint8_t /** \} */ #define EEPROM4_OK 0x00 #define EEPROM4_INIT_ERROR 0xFF /** \} */ /** * \defgroup value Value * \{ */ #define EEPROM4_LOGIC_HIGH 1 #define EEPROM4_LOGIC_LOW 0 /** \} */ /** * \defgroup bit Bit * \{ */ #define EEPROM4_READY_BIT 0x01 #define EEPROM4_WRITE_ENABLE_LATCH_BIT 0x02 #define EEPROM4_WRITE_PROTECT_ENABLE_BIT 0x80 /** \} */ /** * \defgroup command Command * \{ */ #define EEPROM4_LOW_POWER_WRITE_POLL_COMMAND 0x08 #define EEPROM4_SET_WRITE_ENABLE_LATCH_COMMAND 0x06 #define EEPROM4_RESET_WRITE_ENABLE_LATCH_COMMAND 0x04 /** \} */ /** * \defgroup memory_location Memory location * \{ */ #define EEPROM4_FIRST_MEMORY_LOCATION 0x00000000 #define EEPROM4_ONE_QUARTER_MEMORY_LOCATION 0x0000FFFF #define EEPROM4_HALF_MEMORY_LOCATION 0x0001FFFF #define EEPROM4_TWO_QUARTER_MEMORY_LOCATION 0x0002FFFF #define EEPROM4_LAST_MEMORY_LOCATION 0x0003FFFF /** \} */ /** * \defgroup memory_location Memory location * \{ */ #define EEPROM4_NONE_PROTECTED_MEMORY_LOCATION 0x00 #define EEPROM4_ONE_QUARTER_PROTECTED_MEMORY_LOCATION 0x04 #define EEPROM4_HALF_PROTECTED_MEMORY_LOCATION 0x08 #define EEPROM4_ALL_PROTECTED_MEMORY_LOCATION 0x0C /** \} */ /** \} */ // End group macro // --------------------------------------------------------------- PUBLIC TYPES /** * \defgroup type Types * \{ */ /** * @brief Click ctx object definition. */ typedef struct { // Output pins digital_out_t cs; digital_out_t wp; digital_out_t hld; // Modules spi_master_t spi; pin_name_t chip_select; } eeprom4_t; /** * @brief Click configuration structure definition. */ typedef struct { // Communication gpio pins pin_name_t miso; pin_name_t mosi; pin_name_t sck; pin_name_t cs; // Additional gpio pins pin_name_t wp; pin_name_t hld; // static variable uint32_t spi_speed; spi_master_mode_t spi_mode; spi_master_chip_select_polarity_t cs_polarity; } eeprom4_cfg_t; /** \} */ // End types group // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS /** * \defgroup public_function Public function * \{ */ #ifdef __cplusplus extern "C"{ #endif /** * @brief Config Object Initialization function. * * @param cfg Click configuration structure. * * @description This function initializes click configuration structure to init state. * @note All used pins will be set to unconnected state. */ void eeprom4_cfg_setup ( eeprom4_cfg_t *cfg ); /** * @brief Initialization function. * * @param ctx Click object. * @param cfg Click configuration structure. * * @description This function initializes all necessary pins and peripherals used for this click. */ EEPROM4_RETVAL eeprom4_init ( eeprom4_t *ctx, eeprom4_cfg_t *cfg ); /** * @brief Click Default Configuration function. * * @param ctx Click object. * * @description This function executes default configuration for EEPROM 4 click. */ void eeprom4_default_cfg ( eeprom4_t *ctx ); /** * @brief Generic transfer function. * * @param ctx Click object. * @param wr_buf Write data buffer * @param wr_len Number of byte in write data buffer * @param rd_buf Read data buffer * @param rd_len Number of byte in read data buffer * * @description Generic SPI transfer, for sending and receiving packages */ void eeprom4_generic_transfer ( eeprom4_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len ); /** * @brief Command send function * * @param command_byte Click instruction * * @param ctx Click object. * * @description Function sends command (instruction) to click. In case that command byte is EEPROM4_LOW_POWER_WRITE_POLL_COMMAND (0x08) * function returns 0x00 if part is not in a write cycle and returns 0xFF is part still busy completing the write cycle. * In other case function returns 0. */ uint8_t eeprom4_send_command ( eeprom4_t *ctx, uint8_t command_byte ); /** * @brief Status register write function * * @param data_value Data to be written in status register * * @param ctx Click object. * * @description Function writes data determined in parametar of function to status register. */ void eeprom4_write_status_reg ( eeprom4_t *ctx, uint8_t data_value ); /** * @brief Status register read function * * @param ctx Click object. * * @description Function reads one byte data value from status register. */ uint8_t eeprom4_read_status_reg ( eeprom4_t *ctx ); /** * @brief Memory array write function * * @param ctx Click object. * @param memory_address Address where data be written * @param data_input Pointer to buffer witch from data be written * @param nBytes Number of bytes witch will be written * * @descripption Function writes number of bytes determined by nBytes parametar from buffer determined by data_input pointer * to memory location determined by memory_address parametar. */ void eeprom4_write_memory ( eeprom4_t *ctx, uint32_t memory_address, uint8_t *data_input, uint8_t n_bytes ); /** * @brief Memory array read function * * @param ctx Click object. * @param memory_address Address where from data will be read * @param data_output Pointer to buffer where data be storaged * @param nBytes Number of bytes witch will be read * * @description Function reads number of bytes determined by nBytes parametar from memory location determined by memory_address parametar * and stores bytes to buffer determined by data_output pointer. */ void eeprom4_read_memory ( eeprom4_t *ctx, uint32_t memory_address, uint8_t *data_output, uint8_t n_bytes ); /** * @brief Write Protect enable function * * @param ctx Click object. * @param state Value witch set or reset RST (WP) pin * * @description Function sets RST pin on state value to enable or disable writting to status register and memory array. * WP pin is used in conjuction with the block protection bits of the status register and with WPEN and WEL * bits also. */ void eeprom4_enable_write_protect ( eeprom4_t *ctx, uint8_t state ); /** * @brief Hold operation enable function * * @param ctx Click object. * @param state Value witch set or reset PWM (HLD) pin * * @description Function enables or disables the Hold operation. To pause the serial communication with the master device without * resetting the serial sequence, the HOLD pin must be brought low. To resume serial communication, HOLD pin must be brought high. */ void eeprom4_enable_hold_operation ( eeprom4_t *ctx, uint8_t state ); /** * @brief Status register bits check function * * @param ctx Click object. * @param check_bit Determined witch bit in status register be checked * * @description Function checks value of status register bit determined by check_bit parametar. */ uint8_t eeprom4_check_status_reg ( eeprom4_t *ctx, uint8_t check_bit ); #ifdef __cplusplus } #endif #endif // _EEPROM4_H_ /** \} */ // End public_function group /// \} // End click Driver group /*! @} */ // ------------------------------------------------------------------------- END
30.501538
138
0.65288
[ "object" ]
a0c637a80ceb9088872a264edab1b02b0b7a07d9
2,959
h
C
RenderDrivers/GL/include/GLRenderDriver.h
katoun/kg_engine
fdcc6ec01b191d07cedf7a8d6c274166e25401a8
[ "Unlicense" ]
2
2015-04-21T05:36:12.000Z
2017-04-16T19:31:26.000Z
RenderDrivers/GL/include/GLRenderDriver.h
katoun/kg_engine
fdcc6ec01b191d07cedf7a8d6c274166e25401a8
[ "Unlicense" ]
null
null
null
RenderDrivers/GL/include/GLRenderDriver.h
katoun/kg_engine
fdcc6ec01b191d07cedf7a8d6c274166e25401a8
[ "Unlicense" ]
null
null
null
/* ----------------------------------------------------------------------------- KG game engine (http://katoun.github.com/kg_engine) is made available under the MIT License. Copyright (c) 2006-2013 Catalin Alexandru Nastase Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- */ #ifndef _GL_RENDER_DRIVER_H_ #define _GL_RENDER_DRIVER_H_ #include <GLConfig.h> #include <render/RenderDefines.h> #include <render/RenderDriver.h> #include <core/Singleton.h> namespace resource { class Resource; class Serializer; } namespace render { class VertexBuffer; class IndexBuffer; enum VertexBufferType; enum VertexElementType; enum IndexType; class GLRenderDriver: public RenderDriver, public core::Singleton<GLRenderDriver> { public: GLRenderDriver(); ~GLRenderDriver(); RenderWindow* createRenderWindow(int width, int height, int colorDepth, bool fullScreen, int left = 0, int top = 0, bool depthBuffer = true, void* windowId = nullptr); VertexBuffer* createVertexBuffer(VertexBufferType vertexBufferType, VertexElementType vertexElementType, unsigned int numVertices, resource::BufferUsage usage); void removeVertexBuffer(VertexBuffer* buf); IndexBuffer* createIndexBuffer(IndexType idxType, unsigned int numIndexes, resource::BufferUsage usage); void removeIndexBuffer(IndexBuffer* buf); void beginFrame(Viewport* vp); void render(RenderStateData& renderStateData); void endFrame(); void setViewport(Viewport* viewport); //! Utility function to get the correct GL types. static GLenum getGLUsage(resource::BufferUsage usage); static GLenum getGLType(ShaderType type); static GLenum getGLType(VertexElementType type); static GLenum getGLType(RenderOperationType type); static GLRenderDriver* getInstance(); protected: void initializeImpl(); void uninitializeImpl(); void updateImpl(float elapsedTime); }; } // end namespace render #endif // _GL_RENDER_DRIVER_H_
32.163043
179
0.751943
[ "render" ]
a0c985595a6bfa76f9f2b37508f6f1a3a6d4b155
21,113
c
C
src/map/lapack2flamec/f2c/c/zlaic1.c
haampie/libflame
a6b27af9b7ef91ec2724b52c7c09b681379a3470
[ "BSD-3-Clause" ]
199
2015-02-06T06:05:32.000Z
2022-03-18T05:20:33.000Z
src/map/lapack2flamec/f2c/c/zlaic1.c
haampie/libflame
a6b27af9b7ef91ec2724b52c7c09b681379a3470
[ "BSD-3-Clause" ]
44
2015-05-10T18:14:52.000Z
2022-02-22T08:22:10.000Z
src/map/lapack2flamec/f2c/c/zlaic1.c
haampie/libflame
a6b27af9b7ef91ec2724b52c7c09b681379a3470
[ "BSD-3-Clause" ]
70
2015-02-07T04:53:03.000Z
2022-03-18T05:20:36.000Z
/* ../netlib/zlaic1.f -- translated by f2c (version 20100827). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "FLA_f2c.h" /* Table of constant values */ static integer c__1 = 1; /* > \brief \b ZLAIC1 applies one step of incremental condition estimation. */ /* =========== DOCUMENTATION =========== */ /* Online html documentation available at */ /* http://www.netlib.org/lapack/explore-html/ */ /* > \htmlonly */ /* > Download ZLAIC1 + dependencies */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlaic1. f"> */ /* > [TGZ]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlaic1. f"> */ /* > [ZIP]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlaic1. f"> */ /* > [TXT]</a> */ /* > \endhtmlonly */ /* Definition: */ /* =========== */ /* SUBROUTINE ZLAIC1( JOB, J, X, SEST, W, GAMMA, SESTPR, S, C ) */ /* .. Scalar Arguments .. */ /* INTEGER J, JOB */ /* DOUBLE PRECISION SEST, SESTPR */ /* COMPLEX*16 C, GAMMA, S */ /* .. */ /* .. Array Arguments .. */ /* COMPLEX*16 W( J ), X( J ) */ /* .. */ /* > \par Purpose: */ /* ============= */ /* > */ /* > \verbatim */ /* > */ /* > ZLAIC1 applies one step of incremental condition estimation in */ /* > its simplest version: */ /* > */ /* > Let x, twonorm(x) = 1, be an approximate singular vector of an j-by-j */ /* > lower triangular matrix L, such that */ /* > twonorm(L*x) = sest */ /* > Then ZLAIC1 computes sestpr, s, c such that */ /* > the vector */ /* > [ s*x ] */ /* > xhat = [ c ] */ /* > is an approximate singular vector of */ /* > [ L 0 ] */ /* > Lhat = [ w**H gamma ] */ /* > in the sense that */ /* > twonorm(Lhat*xhat) = sestpr. */ /* > */ /* > Depending on JOB, an estimate for the largest or smallest singular */ /* > value is computed. */ /* > */ /* > Note that [s c]**H and sestpr**2 is an eigenpair of the system */ /* > */ /* > diag(sest*sest, 0) + [alpha gamma] * [ conjg(alpha) ] */ /* > [ conjg(gamma) ] */ /* > */ /* > where alpha = x**H * w. */ /* > \endverbatim */ /* Arguments: */ /* ========== */ /* > \param[in] JOB */ /* > \verbatim */ /* > JOB is INTEGER */ /* > = 1: an estimate for the largest singular value is computed. */ /* > = 2: an estimate for the smallest singular value is computed. */ /* > \endverbatim */ /* > */ /* > \param[in] J */ /* > \verbatim */ /* > J is INTEGER */ /* > Length of X and W */ /* > \endverbatim */ /* > */ /* > \param[in] X */ /* > \verbatim */ /* > X is COMPLEX*16 array, dimension (J) */ /* > The j-vector x. */ /* > \endverbatim */ /* > */ /* > \param[in] SEST */ /* > \verbatim */ /* > SEST is DOUBLE PRECISION */ /* > Estimated singular value of j by j matrix L */ /* > \endverbatim */ /* > */ /* > \param[in] W */ /* > \verbatim */ /* > W is COMPLEX*16 array, dimension (J) */ /* > The j-vector w. */ /* > \endverbatim */ /* > */ /* > \param[in] GAMMA */ /* > \verbatim */ /* > GAMMA is COMPLEX*16 */ /* > The diagonal element gamma. */ /* > \endverbatim */ /* > */ /* > \param[out] SESTPR */ /* > \verbatim */ /* > SESTPR is DOUBLE PRECISION */ /* > Estimated singular value of (j+1) by (j+1) matrix Lhat. */ /* > \endverbatim */ /* > */ /* > \param[out] S */ /* > \verbatim */ /* > S is COMPLEX*16 */ /* > Sine needed in forming xhat. */ /* > \endverbatim */ /* > */ /* > \param[out] C */ /* > \verbatim */ /* > C is COMPLEX*16 */ /* > Cosine needed in forming xhat. */ /* > \endverbatim */ /* Authors: */ /* ======== */ /* > \author Univ. of Tennessee */ /* > \author Univ. of California Berkeley */ /* > \author Univ. of Colorado Denver */ /* > \author NAG Ltd. */ /* > \date September 2012 */ /* > \ingroup complex16OTHERauxiliary */ /* ===================================================================== */ /* Subroutine */ int zlaic1_(integer *job, integer *j, doublecomplex *x, doublereal *sest, doublecomplex *w, doublecomplex *gamma, doublereal * sestpr, doublecomplex *s, doublecomplex *c__) { /* System generated locals */ doublereal d__1, d__2; doublecomplex z__1, z__2, z__3, z__4, z__5, z__6; /* Builtin functions */ double z_abs(doublecomplex *); void d_cnjg(doublecomplex *, doublecomplex *), z_sqrt(doublecomplex *, doublecomplex *); double sqrt(doublereal); void z_div(doublecomplex *, doublecomplex *, doublecomplex *); /* Local variables */ doublereal b, t, s1, s2, scl, eps, tmp; doublecomplex sine; doublereal test, zeta1, zeta2; doublecomplex alpha; doublereal norma; extern /* Double Complex */ VOID zdotc_f2c_(doublecomplex *, integer *, doublecomplex *, integer *, doublecomplex *, integer *); extern doublereal dlamch_(char *); doublereal absgam, absalp; doublecomplex cosine; doublereal absest; /* -- LAPACK auxiliary routine (version 3.4.2) -- */ /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ /* September 2012 */ /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* ===================================================================== */ /* .. Parameters .. */ /* .. */ /* .. Local Scalars .. */ /* .. */ /* .. Intrinsic Functions .. */ /* .. */ /* .. External Functions .. */ /* .. */ /* .. Executable Statements .. */ /* Parameter adjustments */ --w; --x; /* Function Body */ eps = dlamch_("Epsilon"); zdotc_f2c_(&z__1, j, &x[1], &c__1, &w[1], &c__1); alpha.r = z__1.r; alpha.i = z__1.i; // , expr subst absalp = z_abs(&alpha); absgam = z_abs(gamma); absest = f2c_abs(*sest); if (*job == 1) { /* Estimating largest singular value */ /* special cases */ if (*sest == 0.) { s1 = max(absgam,absalp); if (s1 == 0.) { s->r = 0., s->i = 0.; c__->r = 1., c__->i = 0.; *sestpr = 0.; } else { z__1.r = alpha.r / s1; z__1.i = alpha.i / s1; // , expr subst s->r = z__1.r, s->i = z__1.i; z__1.r = gamma->r / s1; z__1.i = gamma->i / s1; // , expr subst c__->r = z__1.r, c__->i = z__1.i; d_cnjg(&z__4, s); z__3.r = s->r * z__4.r - s->i * z__4.i; z__3.i = s->r * z__4.i + s->i * z__4.r; // , expr subst d_cnjg(&z__6, c__); z__5.r = c__->r * z__6.r - c__->i * z__6.i; z__5.i = c__->r * z__6.i + c__->i * z__6.r; // , expr subst z__2.r = z__3.r + z__5.r; z__2.i = z__3.i + z__5.i; // , expr subst z_sqrt(&z__1, &z__2); tmp = z__1.r; z__1.r = s->r / tmp; z__1.i = s->i / tmp; // , expr subst s->r = z__1.r, s->i = z__1.i; z__1.r = c__->r / tmp; z__1.i = c__->i / tmp; // , expr subst c__->r = z__1.r, c__->i = z__1.i; *sestpr = s1 * tmp; } return 0; } else if (absgam <= eps * absest) { s->r = 1., s->i = 0.; c__->r = 0., c__->i = 0.; tmp = max(absest,absalp); s1 = absest / tmp; s2 = absalp / tmp; *sestpr = tmp * sqrt(s1 * s1 + s2 * s2); return 0; } else if (absalp <= eps * absest) { s1 = absgam; s2 = absest; if (s1 <= s2) { s->r = 1., s->i = 0.; c__->r = 0., c__->i = 0.; *sestpr = s2; } else { s->r = 0., s->i = 0.; c__->r = 1., c__->i = 0.; *sestpr = s1; } return 0; } else if (absest <= eps * absalp || absest <= eps * absgam) { s1 = absgam; s2 = absalp; if (s1 <= s2) { tmp = s1 / s2; scl = sqrt(tmp * tmp + 1.); *sestpr = s2 * scl; z__2.r = alpha.r / s2; z__2.i = alpha.i / s2; // , expr subst z__1.r = z__2.r / scl; z__1.i = z__2.i / scl; // , expr subst s->r = z__1.r, s->i = z__1.i; z__2.r = gamma->r / s2; z__2.i = gamma->i / s2; // , expr subst z__1.r = z__2.r / scl; z__1.i = z__2.i / scl; // , expr subst c__->r = z__1.r, c__->i = z__1.i; } else { tmp = s2 / s1; scl = sqrt(tmp * tmp + 1.); *sestpr = s1 * scl; z__2.r = alpha.r / s1; z__2.i = alpha.i / s1; // , expr subst z__1.r = z__2.r / scl; z__1.i = z__2.i / scl; // , expr subst s->r = z__1.r, s->i = z__1.i; z__2.r = gamma->r / s1; z__2.i = gamma->i / s1; // , expr subst z__1.r = z__2.r / scl; z__1.i = z__2.i / scl; // , expr subst c__->r = z__1.r, c__->i = z__1.i; } return 0; } else { /* normal case */ zeta1 = absalp / absest; zeta2 = absgam / absest; b = (1. - zeta1 * zeta1 - zeta2 * zeta2) * .5; d__1 = zeta1 * zeta1; c__->r = d__1, c__->i = 0.; if (b > 0.) { d__1 = b * b; z__4.r = d__1 + c__->r; z__4.i = c__->i; // , expr subst z_sqrt(&z__3, &z__4); z__2.r = b + z__3.r; z__2.i = z__3.i; // , expr subst z_div(&z__1, c__, &z__2); t = z__1.r; } else { d__1 = b * b; z__3.r = d__1 + c__->r; z__3.i = c__->i; // , expr subst z_sqrt(&z__2, &z__3); z__1.r = z__2.r - b; z__1.i = z__2.i; // , expr subst t = z__1.r; } z__3.r = alpha.r / absest; z__3.i = alpha.i / absest; // , expr subst z__2.r = -z__3.r; z__2.i = -z__3.i; // , expr subst z__1.r = z__2.r / t; z__1.i = z__2.i / t; // , expr subst sine.r = z__1.r; sine.i = z__1.i; // , expr subst z__3.r = gamma->r / absest; z__3.i = gamma->i / absest; // , expr subst z__2.r = -z__3.r; z__2.i = -z__3.i; // , expr subst d__1 = t + 1.; z__1.r = z__2.r / d__1; z__1.i = z__2.i / d__1; // , expr subst cosine.r = z__1.r; cosine.i = z__1.i; // , expr subst d_cnjg(&z__4, &sine); z__3.r = sine.r * z__4.r - sine.i * z__4.i; z__3.i = sine.r * z__4.i + sine.i * z__4.r; // , expr subst d_cnjg(&z__6, &cosine); z__5.r = cosine.r * z__6.r - cosine.i * z__6.i; z__5.i = cosine.r * z__6.i + cosine.i * z__6.r; // , expr subst z__2.r = z__3.r + z__5.r; z__2.i = z__3.i + z__5.i; // , expr subst z_sqrt(&z__1, &z__2); tmp = z__1.r; z__1.r = sine.r / tmp; z__1.i = sine.i / tmp; // , expr subst s->r = z__1.r, s->i = z__1.i; z__1.r = cosine.r / tmp; z__1.i = cosine.i / tmp; // , expr subst c__->r = z__1.r, c__->i = z__1.i; *sestpr = sqrt(t + 1.) * absest; return 0; } } else if (*job == 2) { /* Estimating smallest singular value */ /* special cases */ if (*sest == 0.) { *sestpr = 0.; if (max(absgam,absalp) == 0.) { sine.r = 1.; sine.i = 0.; // , expr subst cosine.r = 0.; cosine.i = 0.; // , expr subst } else { d_cnjg(&z__2, gamma); z__1.r = -z__2.r; z__1.i = -z__2.i; // , expr subst sine.r = z__1.r; sine.i = z__1.i; // , expr subst d_cnjg(&z__1, &alpha); cosine.r = z__1.r; cosine.i = z__1.i; // , expr subst } /* Computing MAX */ d__1 = z_abs(&sine); d__2 = z_abs(&cosine); // , expr subst s1 = max(d__1,d__2); z__1.r = sine.r / s1; z__1.i = sine.i / s1; // , expr subst s->r = z__1.r, s->i = z__1.i; z__1.r = cosine.r / s1; z__1.i = cosine.i / s1; // , expr subst c__->r = z__1.r, c__->i = z__1.i; d_cnjg(&z__4, s); z__3.r = s->r * z__4.r - s->i * z__4.i; z__3.i = s->r * z__4.i + s->i * z__4.r; // , expr subst d_cnjg(&z__6, c__); z__5.r = c__->r * z__6.r - c__->i * z__6.i; z__5.i = c__->r * z__6.i + c__->i * z__6.r; // , expr subst z__2.r = z__3.r + z__5.r; z__2.i = z__3.i + z__5.i; // , expr subst z_sqrt(&z__1, &z__2); tmp = z__1.r; z__1.r = s->r / tmp; z__1.i = s->i / tmp; // , expr subst s->r = z__1.r, s->i = z__1.i; z__1.r = c__->r / tmp; z__1.i = c__->i / tmp; // , expr subst c__->r = z__1.r, c__->i = z__1.i; return 0; } else if (absgam <= eps * absest) { s->r = 0., s->i = 0.; c__->r = 1., c__->i = 0.; *sestpr = absgam; return 0; } else if (absalp <= eps * absest) { s1 = absgam; s2 = absest; if (s1 <= s2) { s->r = 0., s->i = 0.; c__->r = 1., c__->i = 0.; *sestpr = s1; } else { s->r = 1., s->i = 0.; c__->r = 0., c__->i = 0.; *sestpr = s2; } return 0; } else if (absest <= eps * absalp || absest <= eps * absgam) { s1 = absgam; s2 = absalp; if (s1 <= s2) { tmp = s1 / s2; scl = sqrt(tmp * tmp + 1.); *sestpr = absest * (tmp / scl); d_cnjg(&z__4, gamma); z__3.r = z__4.r / s2; z__3.i = z__4.i / s2; // , expr subst z__2.r = -z__3.r; z__2.i = -z__3.i; // , expr subst z__1.r = z__2.r / scl; z__1.i = z__2.i / scl; // , expr subst s->r = z__1.r, s->i = z__1.i; d_cnjg(&z__3, &alpha); z__2.r = z__3.r / s2; z__2.i = z__3.i / s2; // , expr subst z__1.r = z__2.r / scl; z__1.i = z__2.i / scl; // , expr subst c__->r = z__1.r, c__->i = z__1.i; } else { tmp = s2 / s1; scl = sqrt(tmp * tmp + 1.); *sestpr = absest / scl; d_cnjg(&z__4, gamma); z__3.r = z__4.r / s1; z__3.i = z__4.i / s1; // , expr subst z__2.r = -z__3.r; z__2.i = -z__3.i; // , expr subst z__1.r = z__2.r / scl; z__1.i = z__2.i / scl; // , expr subst s->r = z__1.r, s->i = z__1.i; d_cnjg(&z__3, &alpha); z__2.r = z__3.r / s1; z__2.i = z__3.i / s1; // , expr subst z__1.r = z__2.r / scl; z__1.i = z__2.i / scl; // , expr subst c__->r = z__1.r, c__->i = z__1.i; } return 0; } else { /* normal case */ zeta1 = absalp / absest; zeta2 = absgam / absest; /* Computing MAX */ d__1 = zeta1 * zeta1 + 1. + zeta1 * zeta2; d__2 = zeta1 * zeta2 + zeta2 * zeta2; // , expr subst norma = max(d__1,d__2); /* See if root is closer to zero or to ONE */ test = (zeta1 - zeta2) * 2. * (zeta1 + zeta2) + 1.; if (test >= 0.) { /* root is close to zero, compute directly */ b = (zeta1 * zeta1 + zeta2 * zeta2 + 1.) * .5; d__1 = zeta2 * zeta2; c__->r = d__1, c__->i = 0.; d__2 = b * b; z__2.r = d__2 - c__->r; z__2.i = -c__->i; // , expr subst d__1 = b + sqrt(z_abs(&z__2)); z__1.r = c__->r / d__1; z__1.i = c__->i / d__1; // , expr subst t = z__1.r; z__2.r = alpha.r / absest; z__2.i = alpha.i / absest; // , expr subst d__1 = 1. - t; z__1.r = z__2.r / d__1; z__1.i = z__2.i / d__1; // , expr subst sine.r = z__1.r; sine.i = z__1.i; // , expr subst z__3.r = gamma->r / absest; z__3.i = gamma->i / absest; // , expr subst z__2.r = -z__3.r; z__2.i = -z__3.i; // , expr subst z__1.r = z__2.r / t; z__1.i = z__2.i / t; // , expr subst cosine.r = z__1.r; cosine.i = z__1.i; // , expr subst *sestpr = sqrt(t + eps * 4. * eps * norma) * absest; } else { /* root is closer to ONE, shift by that amount */ b = (zeta2 * zeta2 + zeta1 * zeta1 - 1.) * .5; d__1 = zeta1 * zeta1; c__->r = d__1, c__->i = 0.; if (b >= 0.) { z__2.r = -c__->r; z__2.i = -c__->i; // , expr subst d__1 = b * b; z__5.r = d__1 + c__->r; z__5.i = c__->i; // , expr subst z_sqrt(&z__4, &z__5); z__3.r = b + z__4.r; z__3.i = z__4.i; // , expr subst z_div(&z__1, &z__2, &z__3); t = z__1.r; } else { d__1 = b * b; z__3.r = d__1 + c__->r; z__3.i = c__->i; // , expr subst z_sqrt(&z__2, &z__3); z__1.r = b - z__2.r; z__1.i = -z__2.i; // , expr subst t = z__1.r; } z__3.r = alpha.r / absest; z__3.i = alpha.i / absest; // , expr subst z__2.r = -z__3.r; z__2.i = -z__3.i; // , expr subst z__1.r = z__2.r / t; z__1.i = z__2.i / t; // , expr subst sine.r = z__1.r; sine.i = z__1.i; // , expr subst z__3.r = gamma->r / absest; z__3.i = gamma->i / absest; // , expr subst z__2.r = -z__3.r; z__2.i = -z__3.i; // , expr subst d__1 = t + 1.; z__1.r = z__2.r / d__1; z__1.i = z__2.i / d__1; // , expr subst cosine.r = z__1.r; cosine.i = z__1.i; // , expr subst *sestpr = sqrt(t + 1. + eps * 4. * eps * norma) * absest; } d_cnjg(&z__4, &sine); z__3.r = sine.r * z__4.r - sine.i * z__4.i; z__3.i = sine.r * z__4.i + sine.i * z__4.r; // , expr subst d_cnjg(&z__6, &cosine); z__5.r = cosine.r * z__6.r - cosine.i * z__6.i; z__5.i = cosine.r * z__6.i + cosine.i * z__6.r; // , expr subst z__2.r = z__3.r + z__5.r; z__2.i = z__3.i + z__5.i; // , expr subst z_sqrt(&z__1, &z__2); tmp = z__1.r; z__1.r = sine.r / tmp; z__1.i = sine.i / tmp; // , expr subst s->r = z__1.r, s->i = z__1.i; z__1.r = cosine.r / tmp; z__1.i = cosine.i / tmp; // , expr subst c__->r = z__1.r, c__->i = z__1.i; return 0; } } return 0; /* End of ZLAIC1 */ } /* zlaic1_ */
36.02901
292
0.408706
[ "object", "vector" ]
a0ce549f690cf3d1fb0ec446e17f2764ae1e7d1f
2,294
h
C
graalvm/transactions/fork/narayana/blacktie/xatmi/src/main/include/AtmiBrokerClient.h
nmcl/wfswarm-example-arjuna-old
c2344f4780cd59caf37dd806e492efe1973ad2ff
[ "Apache-2.0" ]
1
2019-05-23T18:19:26.000Z
2019-05-23T18:19:26.000Z
graalvm/transactions/fork/narayana/blacktie/xatmi/src/main/include/AtmiBrokerClient.h
nmcl/scratch
2a068fa6eb2f14c5338a332d3b624d5c91c42c07
[ "Apache-2.0" ]
65
2016-01-24T19:44:46.000Z
2022-02-09T01:00:07.000Z
graalvm/transactions/fork/narayana/blacktie/xatmi/src/main/include/AtmiBrokerClient.h
nmcl/wfswarm-example-arjuna
c2344f4780cd59caf37dd806e492efe1973ad2ff
[ "Apache-2.0" ]
1
2019-05-02T14:23:43.000Z
2019-05-02T14:23:43.000Z
/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat, Inc., and others contributors as indicated * by the @authors tag. All rights reserved. * See the copyright.txt in the distribution for a * full listing of individual contributors. * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU Lesser General Public License, v. 2.1. * This program is distributed in the hope that it will be useful, but WITHOUT A * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License, * v.2.1 along with this distribution; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef AtmiBroker_CLIENT_H_ #define AtmiBroker_CLIENT_H_ #include "atmiBrokerXatmiMacro.h" #include <vector> #include "Connection.h" #include "Session.h" #include "ConnectionManager.h" #include "SynchronizableObject.h" #include "AtmiBrokerEnv.h" class AtmiBrokerClient { public: AtmiBrokerClient(AtmiBrokerSignalHandler& handler); virtual ~AtmiBrokerClient(); Session* createSession(bool isConv, int& id, char* serviceName); BLACKTIE_XATMI_DLL Session* getQueueSession(); Session* getSession(int id); void closeSession(int id); void disconnectSessions(); protected: Connection* currentConnection; //std::map<std::string, Connection*> clientConnectionMap; ConnectionManager clientConnectionManager; SynchronizableObject* lock; AtmiBrokerSignalHandler& signalHandler; }; // CLIENT extern BLACKTIE_XATMI_DLL AtmiBrokerClient* ptrAtmiBrokerClient; // Required for extensions to handle sending buffers extern BLACKTIE_XATMI_DLL int bufferSize(char* data, int suggestedSize); extern BLACKTIE_XATMI_DLL int send(Session* session, const char* replyTo, char* idata, long ilen, int correlationId, long flags, long rval, MESSAGE& message, long rcode, int priority, long timeToLive, bool queue, char* queueName); extern BLACKTIE_XATMI_DLL int convertMessage(MESSAGE &message, int len, char** odata, long* olen, long flags); #endif
35.292308
97
0.778553
[ "vector" ]
a0d506459a5442a1fff6cdd0fb2dcd8c6b67ae4d
635,558
c
C
package/wav6/iwlwav-dev/drivers/net/wireless/intel/iwlwav/wireless/driver/core.c
opensag/atom-openwrt
ff4f04f2f2c36a507d27406a040105cc763d2f89
[ "Apache-2.0" ]
3
2019-06-04T14:29:04.000Z
2020-05-07T04:47:09.000Z
package/wav6/iwlwav-dev/drivers/net/wireless/intel/iwlwav/wireless/driver/core.c
opensag/atom-openwrt
ff4f04f2f2c36a507d27406a040105cc763d2f89
[ "Apache-2.0" ]
null
null
null
package/wav6/iwlwav-dev/drivers/net/wireless/intel/iwlwav/wireless/driver/core.c
opensag/atom-openwrt
ff4f04f2f2c36a507d27406a040105cc763d2f89
[ "Apache-2.0" ]
2
2019-06-04T11:02:20.000Z
2021-12-07T03:08:02.000Z
/****************************************************************************** Copyright (c) 2012 Lantiq Deutschland GmbH For licensing information, see the file 'LICENSE' in the root folder of this software module. ******************************************************************************/ /* * $Id$ * * * * Core functionality * */ #include "mtlkinc.h" #include "core_priv.h" #include "mtlk_df.h" #include "mtlk_df_user_priv.h" #include "mtlk_df_priv.h" #include "mtlk_coreui.h" #include "core.h" #include "core_config.h" #include "core_stats.h" #include "mtlkhal.h" #include "drvver.h" #include "mhi_mac_event.h" #include "mtlk_packets.h" #include "mtlkparams.h" #include "nlmsgs.h" #include "mtlk_snprintf.h" #include "eeprom.h" #include "bitrate.h" #include "mtlk_fast_mem.h" #include "mtlk_gpl_helper.h" #include "mtlkaux.h" #include "mtlk_param_db.h" #include "mtlkwssa_drvinfo.h" #ifdef MTLK_LEGACY_STATISTICS #include "mtlk_wssd.h" #endif /* MTLK_LEGACY_STATISTICS */ #include "wds.h" #include "ta.h" #include "core_common.h" #include "mtlk_df_nbuf.h" #include "bt_acs.h" #include "mtlk_coc.h" #include "vendor_cmds.h" #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT #include "mtlk_pcoc.h" #endif /*CPTCFG_IWLWAV_PMCU_SUPPORT*/ #include "cfg80211.h" #include "mac80211.h" #include "wave_radio.h" #include "fw_recovery.h" #include "scan_support.h" #include "mhi_umi.h" #include "mcast.h" #include "mtlk_hs20.h" #include "eth_parser.h" #include "core_pdb_def.h" #define DEFAULT_NUM_RX_ANTENNAS (3) #define LOG_LOCAL_GID GID_CORE #define LOG_LOCAL_FID 4 #define SLOG_DFLT_ORIGINATOR 0x11 #define SLOG_DFLT_RECEIVER 0x12 #define RCVRY_DEACTIVATE_VAPS_TIMEOUT 10000 #define RCVRY_PMCU_SYNC_TIMEOUT 3000 #define RCVRY_PMCU_COMPLETE_TIMEOUT 15000 #define RCVRY_PMCU_SYNC_CBK_TIMEOUT 500 #define MTLK_CORE_STA_LIST_HASH_NOF_BUCKETS 16 #define MTLK_CORE_WIDAN_BLACKLIST_HASH_NOF_BUCKETS 16 #define MTLK_CORE_4ADDR_STA_LIST_HASH_NOF_BUCKETS 16 #define MTLK_CORE_WIDAN_UNCONNECTED_STATION_RATE 140 static void __log_set_mib_item(uint32 line, uint32 oid, uint32 mibid, uint32 val) { ILOG2_DDDD("Line %4d: CID-%04x: Read Mib 0x%04x, Val 0x%02x", line, oid, mibid, val); } #define MTLK_CFG_SET_MIB_ITEM_BY_FUNC_VOID(obj,name,func,mibid,retdata,core) \ MTLK_CFG_SET_ITEM_BY_FUNC_VOID(obj, name, func,(mtlk_vap_get_txmm(core->vap_handle), mibid,(retdata))); \ __log_set_mib_item(__LINE__, mtlk_vap_get_oid(core->vap_handle), mibid, *(retdata)) #ifdef MTLK_LEGACY_STATISTICS static int _mtlk_core_on_peer_disconnect(mtlk_core_t *core, sta_entry *sta, uint16 reason); #endif /* MTLK_LEGACY_STATISTICS */ typedef enum __mtlk_core_async_priorities_t { _MTLK_CORE_PRIORITY_MAINTENANCE = 0, _MTLK_CORE_PRIORITY_NETWORK, _MTLK_CORE_PRIORITY_INTERNAL, _MTLK_CORE_PRIORITY_USER, _MTLK_CORE_PRIORITY_EMERGENCY, _MTLK_CORE_NUM_PRIORITIES } _mtlk_core_async_priorities_t; #define SCAN_CACHE_AGEING (3600) /* 1 hour */ static const IEEE_ADDR EMPTY_MAC_ADDR = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; static const IEEE_ADDR EMPTY_MAC_MASK = { {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} }; #define TMP_BCAST_DEST_ADDR 0x3ffa static const uint32 _mtlk_core_wss_id_map[] = { MTLK_WWSS_WLAN_STAT_ID_BYTES_SENT_64, /* MTLK_CORE_CNT_BYTES_SENT_64 */ MTLK_WWSS_WLAN_STAT_ID_BYTES_RECEIVED_64, /* MTLK_CORE_CNT_BYTES_RECEIVED_64 */ MTLK_WWSS_WLAN_STAT_ID_PACKETS_SENT_64, /* MTLK_CORE_CNT_PACKETS_SENT_64 */ MTLK_WWSS_WLAN_STAT_ID_PACKETS_RECEIVED_64, /* MTLK_CORE_CNT_PACKETS_RECEIVED_64 */ MTLK_WWSS_WLAN_STAT_ID_UNICAST_PACKETS_SENT, /* MTLK_CORE_CNT_UNICAST_PACKETS_SENT */ MTLK_WWSS_WLAN_STAT_ID_MULTICAST_PACKETS_SENT, /* MTLK_CORE_CNT_MULTICAST_PACKETS_SENT */ MTLK_WWSS_WLAN_STAT_ID_BROADCAST_PACKETS_SENT, /* MTLK_CORE_CNT_BROADCAST_PACKETS_SENT */ MTLK_WWSS_WLAN_STAT_ID_UNICAST_BYTES_SENT, /* MTLK_CORE_CNT_UNICAST_BYTES_SENT */ MTLK_WWSS_WLAN_STAT_ID_MULTICAST_BYTES_SENT, /* MTLK_CORE_CNT_MULTICAST_BYTES_SENT */ MTLK_WWSS_WLAN_STAT_ID_BROADCAST_BYTES_SENT, /* MTLK_CORE_CNT_BROADCAST_BYTES_SENT */ MTLK_WWSS_WLAN_STAT_ID_UNICAST_PACKETS_RECEIVED, /* MTLK_CORE_CNT_UNICAST_PACKETS_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_MULTICAST_PACKETS_RECEIVED, /* MTLK_CORE_CNT_MULTICAST_PACKETS_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_BROADCAST_PACKETS_RECEIVED, /* MTLK_CORE_CNT_BROADCAST_PACKETS_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_UNICAST_BYTES_RECEIVED, /* MTLK_CORE_CNT_UNICAST_BYTES_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_MULTICAST_BYTES_RECEIVED, /* MTLK_CORE_CNT_MULTICAST_BYTES_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_BROADCAST_BYTES_RECEIVED, /* MTLK_CORE_CNT_BROADCAST_BYTES_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_ERROR_PACKETS_SENT, /* MTLK_CORE_CNT_ERROR_PACKETS_SENT */ MTLK_WWSS_WLAN_STAT_ID_ERROR_PACKETS_RECEIVED, /* MTLK_CORE_CNT_ERROR_PACKETS_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_DISCARD_PACKETS_RECEIVED, /* MTLK_CORE_CNT_DISCARD_PACKETS_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_TX_PROBE_RESP_SENT, /* MTLK_CORE_CNT_TX_PROBE_RESP_SENT */ MTLK_WWSS_WLAN_STAT_ID_TX_PROBE_RESP_DROPPED, /* MTLK_CORE_CNT_TX_PROBE_RESP_DROPPED */ MTLK_WWSS_WLAN_STAT_ID_BSS_MGMT_TX_QUE_FULL, /* MTLK_CORE_CNT_BSS_MGMT_TX_QUE_FULL */ MTLK_WWSS_WLAN_STAT_ID_MAN_FRAMES_RES_QUEUE, /* MTLK_CORE_CNT_MAN_FRAMES_RES_QUEUE */ MTLK_WWSS_WLAN_STAT_ID_MAN_FRAMES_SENT, /* MTLK_CORE_CNT_MAN_FRAMES_SENT */ MTLK_WWSS_WLAN_STAT_ID_MAN_FRAMES_CONFIRMED, /* MTLK_CORE_CNT_MAN_FRAMES_CONFIRMED */ #if MTLK_MTIDL_WLAN_STAT_FULL MTLK_WWSS_WLAN_STAT_ID_RX_PACKETS_DISCARDED_DRV_TOO_OLD, /* MTLK_CORE_CNT_RX_PACKETS_DISCARDED_DRV_TOO_OLD */ MTLK_WWSS_WLAN_STAT_ID_RX_PACKETS_DISCARDED_DRV_DUPLICATE, /* MTLK_CORE_CNT_RX_PACKETS_DISCARDED_DRV_DUPLICATE */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_NO_PEERS, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_NO_PEERS */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_ACM, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_ACM */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_EAPOL_CLONED, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_EAPOL_CLONED */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_UNKNOWN_DESTINATION_DIRECTED, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_UNKNOWN_DESTINATION_DIRECTED */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_UNKNOWN_DESTINATION_MCAST, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_UNKNOWN_DESTINATION_MCAST */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_NO_RESOURCES, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_NO_RESOURCES */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_SQ_OVERFLOW, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_SQ_OVERFLOW */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_EAPOL_FILTER, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_EAPOL_FILTER */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_DROP_ALL_FILTER, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DROP_ALL_FILTER */ MTLK_WWSS_WLAN_STAT_ID_TX_PACKETS_DISCARDED_DRV_TX_QUEUE_OVERFLOW, /* MTLK_CORE_CNT_TX_PACKETS_DISCARDED_TX_QUEUE_OVERFLOW */ MTLK_WWSS_WLAN_STAT_ID_802_1X_PACKETS_RECEIVED, /* MTLK_CORE_CNT_802_1X_PACKETS_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_802_1X_PACKETS_SENT, /* MTLK_CORE_CNT_802_1X_PACKETS_SENT */ MTLK_WWSS_WLAN_STAT_ID_802_1X_PACKETS_DISCARDED, /* MTLK_CORE_CNT_802_1X_PACKETS_DISCARDED */ MTLK_WWSS_WLAN_STAT_ID_PAIRWISE_MIC_FAILURE_PACKETS, /* MTLK_CORE_CNT_PAIRWISE_MIC_FAILURE_PACKETS */ MTLK_WWSS_WLAN_STAT_ID_GROUP_MIC_FAILURE_PACKETS, /* MTLK_CORE_CNT_GROUP_MIC_FAILURE_PACKETS */ MTLK_WWSS_WLAN_STAT_ID_UNICAST_REPLAYED_PACKETS, /* MTLK_CORE_CNT_UNICAST_REPLAYED_PACKETS */ MTLK_WWSS_WLAN_STAT_ID_MULTICAST_REPLAYED_PACKETS, /* MTLK_CORE_CNT_MULTICAST_REPLAYED_PACKETS */ MTLK_WWSS_WLAN_STAT_ID_MANAGEMENT_REPLAYED_PACKETS, /* MTLK_CORE_CNT_MANAGEMENT_REPLAYED_PACKETS */ MTLK_WWSS_WLAN_STAT_ID_FWD_RX_PACKETS, /* MTLK_CORE_CNT_FWD_RX_PACKETS */ MTLK_WWSS_WLAN_STAT_ID_FWD_RX_BYTES, /* MTLK_CORE_CNT_FWD_RX_BYTES */ MTLK_WWSS_WLAN_STAT_ID_DAT_FRAMES_RECEIVED, /* MTLK_CORE_CNT_DAT_FRAMES_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_CTL_FRAMES_RECEIVED, /* MTLK_CORE_CNT_CTL_FRAMES_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_MAN_FRAMES_RECEIVED, /* MTLK_CORE_CNT_MAN_FRAMES_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_RX_MAN_FRAMES_RETRY_DROPPED, /* MTLK_CORE_CNT_RX_MAN_FRAMES_RETRY_DROPPED */ MTLK_WWSS_WLAN_STAT_ID_MAN_FRAMES_CFG80211_FAILED, /* MTLK_CORE_CNT_MAN_FRAMES_CFG80211_FAILED */ MTLK_WWSS_WLAN_STAT_ID_NOF_COEX_EL_RECEIVED, /* MTLK_CORE_CNT_COEX_EL_RECEIVED */ MTLK_WWSS_WLAN_STAT_ID_NOF_COEX_EL_SCAN_EXEMPTION_REQUESTED, /* MTLK_CORE_CNT_COEX_EL_SCAN_EXEMPTION_REQUESTED */ MTLK_WWSS_WLAN_STAT_ID_NOF_COEX_EL_SCAN_EXEMPTION_GRANTED, /* MTLK_CORE_CNT_COEX_EL_SCAN_EXEMPTION_GRANTED */ MTLK_WWSS_WLAN_STAT_ID_NOF_COEX_EL_SCAN_EXEMPTION_GRANT_CANCELLED, /* MTLK_CORE_CNT_COEX_EL_SCAN_EXEMPTION_GRANT_CANCELLED */ MTLK_WWSS_WLAN_STAT_ID_NOF_CHANNEL_SWITCH_20_TO_40, /* MTLK_CORE_CNT_CHANNEL_SWITCH_20_TO_40 */ MTLK_WWSS_WLAN_STAT_ID_NOF_CHANNEL_SWITCH_40_TO_20, /* MTLK_CORE_CNT_CHANNEL_SWITCH_40_TO_20 */ MTLK_WWSS_WLAN_STAT_ID_NOF_CHANNEL_SWITCH_40_TO_40, /* MTLK_CORE_CNT_CHANNEL_SWITCH_40_TO_40 */ MTLK_WWSS_WLAN_STAT_TX_PACKETS_TO_UNICAST_DGAF_DISABLED, /* MTLK_CORE_CNT_TX_PACKETS_TO_UNICAST_DGAF_DISABLED */ MTLK_WWSS_WLAN_STAT_TX_PACKETS_SKIPPED_DGAF_DISABLED, /* MTLK_CORE_CNT_TX_PACKETS_SKIPPED_DGAF_DISABLED */ #endif /* MTLK_MTIDL_WLAN_STAT_FULL */ }; /* API between Core and HW */ static int _mtlk_core_start (mtlk_vap_handle_t vap_handle); static int _mtlk_core_handle_tx_data (mtlk_core_t* nic, mtlk_core_handle_tx_data_t *data, uint32 nbuf_flags) __MTLK_INT_HANDLER_SECTION; static int _mtlk_core_release_tx_data (mtlk_vap_handle_t vap_handle, mtlk_hw_data_req_mirror_t *data_req) __MTLK_INT_HANDLER_SECTION; static int _mtlk_core_handle_rx_data (mtlk_vap_handle_t vap_handle, mtlk_core_handle_rx_data_t *data) __MTLK_INT_HANDLER_SECTION; static int _mtlk_core_handle_rx_bss (mtlk_vap_handle_t vap_handle, mtlk_core_handle_rx_bss_t *data); static void _mtlk_core_handle_rx_ctrl (mtlk_vap_handle_t vap_handle, uint32 id, void *payload, uint32 payload_buffer_size); static int _mtlk_core_get_prop (mtlk_vap_handle_t vap_handle, mtlk_core_prop_e prop_id, void* buffer, uint32 size); static int _mtlk_core_set_prop (mtlk_vap_handle_t vap_handle, mtlk_core_prop_e prop_id, void *buffer, uint32 size); static void _mtlk_core_stop (mtlk_vap_handle_t vap_handle); static void _mtlk_core_prepare_stop (mtlk_vap_handle_t vap_handle); static int _core_sync_done(mtlk_handle_t hcore, const void* data, uint32 data_size); static BOOL _mtlk_core_blacklist_frame_drop (mtlk_core_t *nic, const IEEE_ADDR *addr, unsigned subtype, int8 rx_snr_db, BOOL isbroadcast); static mtlk_core_vft_t const core_vft = { _mtlk_core_start, _mtlk_core_handle_tx_data, _mtlk_core_release_tx_data, _mtlk_core_handle_rx_data, _mtlk_core_handle_rx_bss, _mtlk_core_handle_rx_ctrl, _mtlk_core_get_prop, _mtlk_core_set_prop, _mtlk_core_stop, _mtlk_core_prepare_stop }; typedef struct { uint8 *frame; int size; int freq; int sig_dbm; unsigned subtype; BOOL probe_req_wps_ie; BOOL probe_req_interworking_ie; BOOL probe_req_vsie; BOOL probe_req_he_ie; uint8 pmf_flags; mtlk_phy_info_t phy_info; /* FIXME: could be a pointer to */ } mtlk_mngmnt_frame_t; /* API between Core and DF UI */ static int _mtlk_core_get_hw_limits(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_tx_rate_power(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_ee_caps(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_stadb_sta_list(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_stadb_sta_by_iter_id(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_set_mac_assert(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_mc_igmp_tbl(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_mc_hw_tbl(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_bcl_mac_data_get(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_bcl_mac_data_set(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_range_info_get (mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_connect_sta(mtlk_handle_t hcore, const void* data, uint32 data_size); #ifdef MTLK_LEGACY_STATISTICS static int handleDisconnectMe(mtlk_handle_t core_object, const void *payload, uint32 size); #endif static int _mtlk_core_get_enc_ext_cfg(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_set_enc_ext_cfg(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_set_default_key_cfg(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_status(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_hs20_info(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_set_qamplus_mode(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_qamplus_mode(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_qamplus_mode_req(mtlk_core_t *master_core, const uint32 qamplus_mode); static int _mtlk_core_set_radio_mode(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_radio_mode(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_set_aggr_cfg(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_aggr_cfg(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_set_amsdu_num(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_amsdu_num(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_set_blacklist_entry(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_blacklist_entries(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_get_station_measurements(mtlk_handle_t hcore, const void *data, uint32 data_size); static int _mtlk_core_get_vap_measurements(mtlk_handle_t hcore, const void *data, uint32 data_size); static int _mtlk_core_get_radio_info(mtlk_handle_t hcore, const void *data, uint32 data_size); static int _mtlk_core_get_unconnected_station(mtlk_handle_t hcore, const void* data, uint32 data_size); static int _mtlk_core_check_4addr_mode(mtlk_handle_t hcore, const void *data, uint32 data_size); static int _mtlk_core_set_softblocklist_entry(mtlk_handle_t hcore, const void* data, uint32 data_size); /* Core utilities */ static void mtlk_core_configuration_dump(mtlk_core_t *core); static uint32 mtlk_core_get_available_bitrates (struct nic *nic); int mtlk_core_update_network_mode(mtlk_core_t* nic, uint8 net_mode); static uint8 _mtlk_core_get_spectrum_mode(mtlk_core_t *core); static int _mtlk_core_set_fw_interfdet_req(mtlk_core_t *core, BOOL is_spectrum_40); int mtlk_core_init_defaults (mtlk_core_t *core); static void _mtlk_core_get_traffic_wlan_stats(mtlk_core_t* core, mtlk_wssa_drv_traffic_stats_t* stats); static void _mtlk_core_get_vap_info_stats(mtlk_core_t* core, struct driver_vap_info *vap_info); static void _mtlk_core_get_tr181_hw(mtlk_core_t* core, mtlk_wssa_drv_tr181_hw_t* tr181_hw); #ifdef MTLK_LEGACY_STATISTICS static void _mtlk_core_get_tr181_wlan_stats (mtlk_core_t* core, mtlk_wssa_drv_tr181_wlan_stats_t* stats); static void _mtlk_core_get_wlan_stats (mtlk_core_t* core, mtlk_wssa_drv_wlan_stats_t* stats); #if MTLK_MTIDL_WLAN_STAT_FULL static void _mtlk_core_get_debug_wlan_stats(mtlk_core_t* core, mtlk_wssa_drv_debug_wlan_stats_t* stats); #endif #endif /* MTLK_LEGACY_STATISTICS */ #ifdef CPTCFG_IWLWAV_FILTER_BLACKLISTED_BSS static BOOL _mtlk_core_blacklist_entry_exists (mtlk_core_t *nic, const IEEE_ADDR *addr); #endif int fill_channel_data(mtlk_core_t *core, struct intel_vendor_channel_data *ch_data); /* with checking ALLOWED option */ #define _mtlk_core_get_cnt(core, id) (TRUE == id##_ALLOWED) ? __mtlk_core_get_cnt(core, id) : 0 #define _mtlk_core_reset_cnt(core, id) if (TRUE == id##_ALLOWED) __mtlk_core_reset_cnt(core, id) static __INLINE uint32 __mtlk_core_get_cnt (mtlk_core_t *core, mtlk_core_wss_cnt_id_e cnt_id) { MTLK_ASSERT(cnt_id >= 0 && cnt_id < MTLK_CORE_CNT_LAST); return mtlk_wss_get_stat(core->wss, cnt_id); } static __INLINE void __mtlk_core_reset_cnt (mtlk_core_t *core, mtlk_core_wss_cnt_id_e cnt_id) { MTLK_ASSERT(cnt_id >= 0 && cnt_id < MTLK_CORE_CNT_LAST); mtlk_wss_reset_stat(core->wss, cnt_id); } static __INLINE void _mtlk_core_on_mic_failure (mtlk_core_t *core, mtlk_df_ui_mic_fail_type_t mic_fail_type) { MTLK_ASSERT((MIC_FAIL_PAIRWISE == mic_fail_type) || (MIC_FAIL_GROUP== mic_fail_type)); switch(mic_fail_type) { case MIC_FAIL_PAIRWISE: mtlk_core_inc_cnt(core, MTLK_CORE_CNT_PAIRWISE_MIC_FAILURE_PACKETS); break; case MIC_FAIL_GROUP: mtlk_core_inc_cnt(core, MTLK_CORE_CNT_GROUP_MIC_FAILURE_PACKETS); break; default: WLOG_D("CID-%04x: Wrong type of pairwise packet", mtlk_vap_get_oid(core->vap_handle)); break; } } static __INLINE BOOL _mtlk_core_has_connections(mtlk_core_t *core) { return !mtlk_stadb_is_empty(&core->slow_ctx->stadb); }; BOOL __MTLK_IFUNC mtlk_core_has_connections(mtlk_core_t *core) { return _mtlk_core_has_connections(core); }; static __INLINE unsigned _mtlk_core_get_rrsi_offs (mtlk_core_t *nic) { return mtlk_hw_get_rrsi_offs(mtlk_vap_get_hw(nic->vap_handle)); } /* ======================================================*/ /* Core internal wrapper for asynchronous execution. */ /* Uses serializer, command can't be tracked/canceled, */ /* allocated on heap and deleted by completion callback. */ static void _mtlk_core_async_clb(mtlk_handle_t user_context) { int res = MTLK_ERR_BUSY; _core_async_exec_t *ctx = (_core_async_exec_t *) user_context; if (ctx->cmd.is_cancelled) { mtlk_slid_t slid = ctx->cmd.issuer_slid; MTLK_UNREFERENCED_PARAM(slid); WLOG_DDDD("CID-%04x: Core request was cancelled (GID=%d, FID=%d, LID=%d)", mtlk_vap_get_oid(ctx->vap_handle), mtlk_slid_get_gid(slid), mtlk_slid_get_fid(slid), mtlk_slid_get_lid(slid)); res = MTLK_ERR_CANCELED; } else if (_mtlk_abmgr_is_ability_enabled(mtlk_vap_get_abmgr(ctx->vap_handle), ctx->ability_id)) { res = ctx->func(ctx->receiver, &ctx[1], ctx->data_size); } else { WLOG_DD("CID-%04x: Requested ability 0x%X is disabled or never was registered", mtlk_vap_get_oid(ctx->vap_handle), ctx->ability_id); } if(NULL != ctx->user_req) mtlk_df_ui_req_complete(ctx->user_req, res); } static void _mtlk_core_async_compl_clb(serializer_result_t res, mtlk_command_t* command, mtlk_handle_t completion_ctx) { _core_async_exec_t *ctx = (_core_async_exec_t *) completion_ctx; mtlk_command_cleanup(&ctx->cmd); mtlk_osal_mem_free(ctx); } static int _mtlk_core_execute_async_ex (struct nic *nic, mtlk_ability_id_t ability_id, mtlk_handle_t receiver, mtlk_core_task_func_t func, const void *data, size_t size, _mtlk_core_async_priorities_t priority, mtlk_user_request_t *req, mtlk_slid_t issuer_slid) { int res; _core_async_exec_t *ctx; MTLK_ASSERT(0 == sizeof(_core_async_exec_t) % sizeof(void*)); ctx = mtlk_osal_mem_alloc(sizeof(_core_async_exec_t) + size, MTLK_MEM_TAG_ASYNC_CTX); if(NULL == ctx) { ELOG_D("CID-%04x: Failed to allocate execution context object", mtlk_vap_get_oid(nic->vap_handle)); return MTLK_ERR_NO_MEM; } ctx->receiver = receiver; ctx->data_size = size; ctx->func = func; ctx->user_req = req; ctx->vap_handle = nic->vap_handle; ctx->ability_id = ability_id; wave_memcpy(&ctx[1], size, data, size); res = mtlk_command_init(&ctx->cmd, _mtlk_core_async_clb, HANDLE_T(ctx), issuer_slid); if(MTLK_ERR_OK != res) { mtlk_osal_mem_free(ctx); ELOG_D("CID-%04x: Failed to initialize command object", mtlk_vap_get_oid(nic->vap_handle)); return res; } res = mtlk_serializer_enqueue(&nic->slow_ctx->serializer, priority, &ctx->cmd, _mtlk_core_async_compl_clb, HANDLE_T(ctx)); if(MTLK_ERR_OK != res) { mtlk_osal_mem_free(ctx); ELOG_DD("CID-%04x: Failed to enqueue command object (error: %d)", mtlk_vap_get_oid(nic->vap_handle), res); return res; } return res; } #define _mtlk_core_execute_async(nic, ability_id, receiver, func, data, size, priority, req) \ _mtlk_core_execute_async_ex((nic), (ability_id), (receiver), (func), (data), (size), (priority), (req), MTLK_SLID) int __MTLK_IFUNC mtlk_core_schedule_internal_task_ex (struct nic *nic, mtlk_handle_t object, mtlk_core_task_func_t func, const void *data, size_t size, mtlk_slid_t issuer_slid) { return _mtlk_core_execute_async_ex(nic, MTLK_ABILITY_NONE, object, func, data, size, _MTLK_CORE_PRIORITY_INTERNAL, NULL, issuer_slid); } int __MTLK_IFUNC mtlk_core_schedule_user_task_ex (struct nic *nic, mtlk_handle_t object, mtlk_core_task_func_t func, const void *data, size_t size, mtlk_slid_t issuer_slid) { return _mtlk_core_execute_async_ex(nic, MTLK_ABILITY_NONE, object, func, data, size, _MTLK_CORE_PRIORITY_USER, NULL, issuer_slid); } /*! Function for scheduling out of order (emergency) task. Sends message confirmation for message object specified \param nic Pointer to the core object \param object Handle of receiver object \param func Task callback \param data Pointer to the data buffer provided by caller \param data_size Size of data buffer provided by caller */ int __MTLK_IFUNC mtlk_core_schedule_emergency_task (struct nic *nic, mtlk_handle_t object, mtlk_core_task_func_t func, const void *data, size_t size, mtlk_slid_t issuer_slid) { return _mtlk_core_execute_async_ex(nic, MTLK_ABILITY_NONE, object, func, data, size, _MTLK_CORE_PRIORITY_EMERGENCY, NULL, issuer_slid); } /*! Function for scheduling serialized task on demand of HW module activities Sends message confirmation for message object specified \param nic Pointer to the core object \param object Handle of receiver object \param func Task callback \param data Pointer to the data buffer provided by caller \param data_size Size of data buffer provided by caller */ int __MTLK_IFUNC mtlk_core_schedule_hw_task(struct nic *nic, mtlk_handle_t object, mtlk_core_task_func_t func, const void *data, size_t size, mtlk_slid_t issuer_slid) { return _mtlk_core_execute_async_ex(nic, MTLK_ABILITY_NONE, object, func, data, size, _MTLK_CORE_PRIORITY_NETWORK, NULL, issuer_slid); } /* ======================================================*/ /* ======================================================*/ /* Function for processing HW tasks */ typedef enum __mtlk_hw_task_type_t { SYNCHRONOUS, SERIALIZABLE } _mtlk_core_task_type_t; static void _mtlk_process_hw_task_ex (mtlk_core_t* nic, _mtlk_core_task_type_t task_type, mtlk_core_task_func_t task_func, mtlk_handle_t object, const void* data, uint32 data_size, mtlk_slid_t issuer_slid) { if(SYNCHRONOUS == task_type) { task_func(object, data, data_size); } else { if(MTLK_ERR_OK != mtlk_core_schedule_hw_task(nic, object, task_func, data, data_size, issuer_slid)) { ELOG_DP("CID-%04x: Hardware task schedule for callback 0x%p failed.", mtlk_vap_get_oid(nic->vap_handle), task_func); } } } #define _mtlk_process_hw_task(nic, task_type, task_func, object, data, data_size) \ _mtlk_process_hw_task_ex((nic), (task_type), (task_func), (object), (data), (data_size), MTLK_SLID) static void _mtlk_process_user_task_ex (mtlk_core_t* nic, mtlk_user_request_t *req, _mtlk_core_task_type_t task_type, mtlk_ability_id_t ability_id, mtlk_core_task_func_t task_func, mtlk_handle_t object, mtlk_clpb_t* data, mtlk_slid_t issuer_slid) { if(SYNCHRONOUS == task_type) { int res = MTLK_ERR_BUSY; /* check is ability enabled for execution */ if (_mtlk_abmgr_is_ability_enabled(mtlk_vap_get_abmgr(nic->vap_handle), ability_id)) { res = task_func(object, &data, sizeof(mtlk_clpb_t*)); } else { WLOG_DD("CID-%04x: Requested ability 0x%X is disabled or never was registered", mtlk_vap_get_oid(nic->vap_handle), ability_id); } mtlk_df_ui_req_complete(req, res); } else { int result = _mtlk_core_execute_async_ex(nic, ability_id, object, task_func, &data, sizeof(data), _MTLK_CORE_PRIORITY_USER, req, issuer_slid); if(MTLK_ERR_OK != result) { ELOG_DPD("CID-%04x: User task schedule for callback 0x%p failed (error %d).", mtlk_vap_get_oid(nic->vap_handle), task_func, result); mtlk_df_ui_req_complete(req, result); } } } #define _mtlk_process_user_task(nic, req, task_type, ability_id, task_func, object, data) \ _mtlk_process_user_task_ex((nic), (req), (task_type), (ability_id), (task_func), (object), (data), MTLK_SLID) static void _mtlk_process_emergency_task_ex (mtlk_core_t* nic, mtlk_core_task_func_t task_func, mtlk_handle_t object, const void* data, uint32 data_size, mtlk_slid_t issuer_slid) { if (MTLK_ERR_OK != mtlk_core_schedule_emergency_task(nic, object, task_func, data, data_size, issuer_slid)) { ELOG_DP("CID-%04x: Emergency task schedule for callback 0x%p failed.", mtlk_vap_get_oid(nic->vap_handle), task_func); } } #define _mtlk_process_emergency_task(nic, task_func, object, data, data_size) \ _mtlk_process_emergency_task_ex((nic), (task_func), (object), (data), (data_size), MTLK_SLID) /* ======================================================*/ static void cleanup_on_disconnect(struct nic *nic); mtlk_eeprom_data_t* __MTLK_IFUNC mtlk_core_get_eeprom(mtlk_core_t* core) { mtlk_eeprom_data_t *ee_data = NULL; (void)mtlk_hw_get_prop(mtlk_vap_get_hwapi(core->vap_handle), MTLK_HW_PROP_EEPROM_DATA, &ee_data, sizeof(&ee_data)); return ee_data; } mtlk_scan_support_t* __MTLK_IFUNC mtlk_core_get_scan_support(mtlk_core_t* core) { return wave_radio_scan_support_get(wave_vap_radio_get(core->vap_handle)); } const char *mtlk_net_state_to_string(uint32 state) { switch (state) { case NET_STATE_HALTED: return "NET_STATE_HALTED"; case NET_STATE_IDLE: return "NET_STATE_IDLE"; case NET_STATE_READY: return "NET_STATE_READY"; case NET_STATE_ACTIVATING: return "NET_STATE_ACTIVATING"; case NET_STATE_CONNECTED: return "NET_STATE_CONNECTED"; case NET_STATE_DEACTIVATING: return "NET_STATE_DEACTIVATING"; default: break; } ILOG1_D("Unknown state 0x%04X", state); return "NET_STATE_UNKNOWN"; } static __INLINE mtlk_hw_state_e __mtlk_core_get_hw_state (mtlk_core_t *nic) { mtlk_hw_state_e hw_state = MTLK_HW_STATE_LAST; mtlk_hw_get_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_PROP_STATE, &hw_state, sizeof(hw_state)); return hw_state; } mtlk_hw_state_e __MTLK_IFUNC mtlk_core_get_hw_state (mtlk_core_t *nic) { return __mtlk_core_get_hw_state(nic); } int __MTLK_IFUNC mtlk_set_hw_state (mtlk_core_t *nic, mtlk_hw_state_e st) { #if IWLWAV_RTLOG_MAX_DLEVEL >= 1 mtlk_hw_state_e ost; (void)mtlk_hw_get_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_PROP_STATE, &ost, sizeof(ost)); ILOG1_DD("%i -> %i", ost, st); #endif return mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_PROP_STATE, &st, sizeof(st)); } BOOL mtlk_core_is_hw_halted(mtlk_core_t *nic) { mtlk_hw_state_e hw_state = mtlk_core_get_hw_state(nic); return mtlk_hw_is_halted(hw_state); } static int mtlk_core_set_net_state(mtlk_core_t *core, uint32 new_state) { uint32 allow_mask; mtlk_hw_state_e hw_state; int result = MTLK_ERR_OK; mtlk_osal_lock_acquire(&core->net_state_lock); if (new_state == NET_STATE_HALTED) { ILOG3_SSS("%s: Going from %s to %s", mtlk_df_get_name(mtlk_vap_get_df(core->vap_handle)), mtlk_net_state_to_string(core->net_state), "NET_STATE_HALTED"); core->net_state = NET_STATE_HALTED; goto FINISH; } /* allow transition from NET_STATE_HALTED to NET_STATE_IDLE while in hw state MTLK_HW_STATE_READY */ hw_state = __mtlk_core_get_hw_state(core); if ((hw_state != MTLK_HW_STATE_READY) && (hw_state != MTLK_HW_STATE_UNLOADING) && (new_state != NET_STATE_IDLE)) { ELOG_DD("CID-%04x: Wrong hw_state=%d", mtlk_vap_get_oid(core->vap_handle), hw_state); result = MTLK_ERR_HW; goto FINISH; } allow_mask = 0; switch (new_state) { case NET_STATE_IDLE: allow_mask = NET_STATE_HALTED; /* on core_start */ break; case NET_STATE_READY: allow_mask = NET_STATE_IDLE | NET_STATE_ACTIVATING | NET_STATE_DEACTIVATING; break; case NET_STATE_ACTIVATING: allow_mask = NET_STATE_READY | NET_STATE_DEACTIVATING; /* because activating/disconnecting may morph into one another */ break; case NET_STATE_CONNECTED: allow_mask = NET_STATE_ACTIVATING; break; case NET_STATE_DEACTIVATING: allow_mask = NET_STATE_CONNECTED | NET_STATE_ACTIVATING; /* because activating/disconnecting may morph into one another */ break; default: break; } /* check mask */ if (core->net_state & allow_mask) { ILOG0_SSS("%s: Going from %s to %s", mtlk_df_get_name(mtlk_vap_get_df(core->vap_handle)), mtlk_net_state_to_string(core->net_state), mtlk_net_state_to_string(new_state)); core->net_state = new_state; } else { ILOG0_SSS("%s: Failed to change state from %s to %s", mtlk_df_get_name(mtlk_vap_get_df(core->vap_handle)), mtlk_net_state_to_string(core->net_state), mtlk_net_state_to_string(new_state)); result = MTLK_ERR_WRONG_CONTEXT; } FINISH: mtlk_osal_lock_release(&core->net_state_lock); return result; } int __MTLK_IFUNC mtlk_core_get_net_state (mtlk_core_t *core) { mtlk_hw_state_e hw_state = __mtlk_core_get_hw_state(core); if (hw_state != MTLK_HW_STATE_READY && hw_state != MTLK_HW_STATE_UNLOADING) { return NET_STATE_HALTED; /* FIXME? don't we need to do some cleanup, too to avoid resource leaks? */ } return core->net_state; } static int check_mac_watchdog (mtlk_handle_t core_object, const void *payload, uint32 size) { struct nic *nic = HANDLE_T_PTR(struct nic, core_object); mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_MAC_WATCHDOG *mac_watchdog; int res = MTLK_ERR_OK; wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); MTLK_ASSERT(0 == size); MTLK_UNREFERENCED_PARAM(payload); MTLK_UNREFERENCED_PARAM(size); MTLK_ASSERT(FALSE == mtlk_vap_is_slave_ap(nic->vap_handle)); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txdm(nic->vap_handle), NULL); if (!man_entry) { res = MTLK_ERR_NO_RESOURCES; goto END; } man_entry->id = UM_DBG_MAC_WATCHDOG_REQ; man_entry->payload_size = sizeof(UMI_MAC_WATCHDOG); mac_watchdog = (UMI_MAC_WATCHDOG *)man_entry->payload; mac_watchdog->u16Timeout = HOST_TO_MAC16(WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_TIMEOUT_MS)); res = mtlk_txmm_msg_send_blocked(&man_msg, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_TIMEOUT_MS)); if (res == MTLK_ERR_OK) { switch (mac_watchdog->u8Status) { case UMI_OK: break; case UMI_MC_BUSY: break; case UMI_TIMEOUT: res = MTLK_ERR_UMI; break; default: res = MTLK_ERR_UNKNOWN; break; } } mtlk_txmm_msg_cleanup(&man_msg); END: if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: MAC watchdog error %d", mtlk_vap_get_oid(nic->vap_handle), res); (void)mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_RESET, NULL, 0); } else { if (MTLK_ERR_OK != mtlk_osal_timer_set(&nic->slow_ctx->mac_watchdog_timer, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_PERIOD_MS))) { ELOG_D("CID-%04x: Cannot schedule MAC watchdog timer", mtlk_vap_get_oid(nic->vap_handle)); (void)mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_RESET, NULL, 0); } } return MTLK_ERR_OK; } static uint32 mac_watchdog_timer_handler (mtlk_osal_timer_t *timer, mtlk_handle_t data) { int err; struct nic *nic = (struct nic *)data; err = _mtlk_core_execute_async(nic, MTLK_ABILITY_NONE, HANDLE_T(nic), check_mac_watchdog, NULL, 0, _MTLK_CORE_PRIORITY_MAINTENANCE, NULL); if (err != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't schedule MAC WATCHDOG task (err=%d)", mtlk_vap_get_oid(nic->vap_handle), err); } return 0; } static int __MTLK_IFUNC send_cca_thresholds(mtlk_handle_t core_object, const void *payload, uint32 size) { struct nic *nic = HANDLE_T_PTR(struct nic, core_object); iwpriv_cca_th_t *cca_th_params = (iwpriv_cca_th_t *)payload; int res = MTLK_ERR_OK; MTLK_ASSERT(sizeof(*cca_th_params) == size); MTLK_UNREFERENCED_PARAM(size); MTLK_ASSERT(FALSE == mtlk_vap_is_slave_ap(nic->vap_handle)); res = mtlk_core_cfg_send_cca_threshold_req(nic, cca_th_params); if (res != MTLK_ERR_OK) ELOG_DD("CID-%04x: Can't send CCA thresholds (err=%d)", mtlk_vap_get_oid(nic->vap_handle), res); mtlk_osal_timer_set(&nic->slow_ctx->cca_step_down_timer, nic->slow_ctx->cca_adapt.interval * 1000); return MTLK_ERR_OK; } static BOOL _mtlk_core_cca_is_above_configured (mtlk_core_t *core, iwpriv_cca_th_t *cca_th_params) { int i; for (i = 0; i < MTLK_CCA_TH_PARAMS_LEN; i++) if (core->slow_ctx->cca_adapt.cca_th_params[i] > cca_th_params->values[i]) return TRUE; return FALSE; } static BOOL _mtlk_core_cca_is_below_limit (mtlk_core_t *core, int limit) { int i; for (i = 0; i < MTLK_CCA_TH_PARAMS_LEN; i++) if (core->slow_ctx->cca_adapt.cca_th_params[i] < limit) return TRUE; return FALSE; } static uint32 cca_step_down_timer_clb_func (mtlk_osal_timer_t *timer, mtlk_handle_t data) { struct nic *nic = (struct nic *)data; wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); iwpriv_cca_adapt_t cca_adapt_params; mtlk_pdb_size_t cca_adapt_size = sizeof(cca_adapt_params); iwpriv_cca_th_t cca_th_params; if (MTLK_ERR_OK != WAVE_RADIO_PDB_GET_BINARY(radio, PARAM_DB_RADIO_CCA_ADAPT, &cca_adapt_params, &cca_adapt_size)) { ELOG_V("cannot read CCA_ADAPT data"); return 0; } /* read user config */ if (MTLK_ERR_OK != mtlk_core_cfg_read_cca_threshold(nic, &cca_th_params)) { return MTLK_ERR_UNKNOWN; } ILOG3_V("CCA adaptive: step down timer triggered"); if (_mtlk_core_cca_is_above_configured(nic, &cca_th_params)) { uint32 interval = nic->slow_ctx->cca_adapt.step_down_coef * cca_adapt_params.step_down_interval; int i; ILOG2_D("CCA adaptive: step down, next interval %d", interval); for (i = 0; i < MTLK_CCA_TH_PARAMS_LEN; i++) { nic->slow_ctx->cca_adapt.cca_th_params[i] = MAX(cca_th_params.values[i], nic->slow_ctx->cca_adapt.cca_th_params[i] - cca_adapt_params.step_down); cca_th_params.values[i] = nic->slow_ctx->cca_adapt.cca_th_params[i]; ILOG2_DD("CCA adaptive: step down value %d: %d", i, cca_th_params.values[i]); } nic->slow_ctx->cca_adapt.interval = interval; _mtlk_process_hw_task(nic, SERIALIZABLE, send_cca_thresholds, HANDLE_T(nic), &cca_th_params, sizeof(cca_th_params)); } else nic->slow_ctx->cca_adapt.stepping_down = 0; return 0; } static void __MTLK_IFUNC clean_all_sta_on_disconnect_sta_clb (mtlk_handle_t usr_ctx, sta_entry *sta) { struct nic *nic = HANDLE_T_PTR(struct nic, usr_ctx); const IEEE_ADDR *addr = mtlk_sta_get_addr(sta); ILOG1_Y("Station %Y disconnected", addr->au8Addr); /* Notify Traffic analyzer about STA disconnect */ mtlk_ta_on_disconnect(mtlk_vap_get_ta(nic->vap_handle), sta); if (BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_BRIDGE_MODE) || mtlk_sta_is_4addr(sta)) { /* Don't remove HOST from DB if in WDS mode or 4 address station */ mtlk_hstdb_stop_all_by_sta(&nic->slow_ctx->hstdb, sta); } else { mtlk_hstdb_remove_all_by_sta(&nic->slow_ctx->hstdb, sta); } /* Remove all hosts MAC addr from switch MAC table */ mtlk_hstdb_dcdp_remove_all_by_sta(&nic->slow_ctx->hstdb, sta); /* Remove sta MAC addr from DC DP MAC table */ mtlk_df_user_dcdp_remove_mac_addr(mtlk_vap_get_df(nic->vap_handle), addr->au8Addr); } static void _mtlk_core_clean_vap_tx_on_disconnect(struct nic *nic) { MTLK_UNREFERENCED_PARAM(nic); } static void clean_all_sta_on_disconnect (struct nic *nic) { BOOL wait_all_packets_confirmed; wait_all_packets_confirmed = (mtlk_core_get_net_state(nic) != NET_STATE_HALTED); mtlk_stadb_disconnect_all(&nic->slow_ctx->stadb, clean_all_sta_on_disconnect_sta_clb, HANDLE_T(nic), wait_all_packets_confirmed); _mtlk_core_clean_vap_tx_on_disconnect(nic); } static void cleanup_on_disconnect (struct nic *nic) { if (!mtlk_vap_is_ap(nic->vap_handle)) { /* rollback network mode */ MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_NET_MODE_CUR, core_cfg_get_network_mode_cfg(nic)); } if (!_mtlk_core_has_connections(nic)) { if (mtlk_core_get_net_state(nic) == NET_STATE_DEACTIVATING) { MTLK_CORE_PDB_SET_MAC(nic, PARAM_DB_CORE_BSSID, mtlk_osal_eth_zero_addr); } _mtlk_core_clean_vap_tx_on_disconnect(nic); } #ifdef CPTCFG_IWLWAV_SET_PM_QOS if (mtlk_global_stadb_is_empty()) { mtlk_mmb_update_cpu_dma_latency(mtlk_vap_get_hw(nic->vap_handle), MTLK_HW_PM_QOS_VALUE_NO_CLIENTS); } #endif } #ifdef MTLK_LEGACY_STATISTICS static int _mtlk_core_ap_disconnect_sta_blocked(struct nic *nic, const IEEE_ADDR *addr, uint16 reason) #else static int _mtlk_core_ap_disconnect_sta_blocked(struct nic *nic, const IEEE_ADDR *addr) #endif { int res = MTLK_ERR_OK; int net_state; mtlk_df_t *df; sta_entry *sta = NULL; MTLK_ASSERT(NULL != nic); MTLK_ASSERT(NULL != addr); df = mtlk_vap_get_df(nic->vap_handle); MTLK_ASSERT(NULL != df); /* Check is STA is a peer AP */ if (BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_BRIDGE_MODE)) { wds_peer_disconnect(&nic->slow_ctx->wds_mng, addr); } sta = mtlk_stadb_find_sta(&nic->slow_ctx->stadb, addr->au8Addr); if (sta == NULL) { ILOG1_DY("CID-%04x: Station %Y not found during disconnecting", mtlk_vap_get_oid(nic->vap_handle), addr); res = MTLK_ERR_UNKNOWN; goto finish; } net_state = mtlk_core_get_net_state(nic); if (net_state == NET_STATE_HALTED) { /* Do not send anything to halted MAC or if STA hasn't been connected */ res = MTLK_ERR_UNKNOWN; goto sta_decref; } mtlk_sta_set_packets_filter(sta, MTLK_PCKT_FLTR_DISCARD_ALL); res = core_ap_stop_traffic(nic, &sta->info); /* Send Stop Traffic Request to FW */ if (MTLK_ERR_OK != res) goto sta_decref; res = core_ap_remove_sta(nic, &sta->info); if (MTLK_ERR_OK != res) { res = MTLK_ERR_UNKNOWN; goto sta_decref; } if (BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_BRIDGE_MODE) || mtlk_sta_is_4addr(sta)) { /* Don't remove HOST from DB if in WDS mode or 4 address station */ mtlk_hstdb_stop_all_by_sta(&nic->slow_ctx->hstdb, sta); } else { mtlk_hstdb_remove_all_by_sta(&nic->slow_ctx->hstdb, sta); } mtlk_stadb_remove_sta(&nic->slow_ctx->stadb, sta); /* Remove all hosts MAC addr from switch MAC table */ mtlk_hstdb_dcdp_remove_all_by_sta(&nic->slow_ctx->hstdb, sta); /* Remove sta MAC addr from switch MAC table */ mtlk_df_user_dcdp_remove_mac_addr(df, addr->au8Addr); /* Notify ARP proxy if enabled */ if (MTLK_CORE_PDB_GET_INT(nic, PARAM_DB_CORE_ARP_PROXY)) { mtlk_parp_notify_disconnect((char*) mtlk_df_get_name(df), (char *) addr->au8Addr); } /* Notify Traffic analyzer about STA disconnect */ mtlk_ta_on_disconnect(mtlk_vap_get_ta(nic->vap_handle), sta); #ifdef MTLK_LEGACY_STATISTICS /* Send indication if STA has been disconnected from AP */ _mtlk_core_on_peer_disconnect(nic, sta, reason); #endif /* MTLK_LEGACY_STATISTICS */ cleanup_on_disconnect(nic); /* update disconnections statistics */ nic->pstats.num_disconnects++; sta_decref: mtlk_sta_decref(sta); /* De-reference of find */ finish: return res; } static int reset_security_stuff(struct nic *nic) { int res = MTLK_ERR_OK; memset(&nic->slow_ctx->keys, 0, sizeof(nic->slow_ctx->keys)); memset(&nic->slow_ctx->group_rsc, 0, sizeof(nic->slow_ctx->group_rsc)); nic->slow_ctx->default_key = 0; nic->slow_ctx->default_mgmt_key = 0; nic->slow_ctx->wep_enabled = FALSE; nic->slow_ctx->rsn_enabled = FALSE; nic->slow_ctx->group_cipher = IW_ENCODE_ALG_NONE; /* 802.11W */ memset(&nic->slow_ctx->igtk_key, 0, sizeof(nic->slow_ctx->igtk_key)); nic->slow_ctx->igtk_cipher = IW_ENCODE_ALG_NONE; nic->slow_ctx->igtk_key_len = 0; return res; } BOOL can_disconnect_now(struct nic *nic, BOOL is_scan_fast_rcvry) { return mtlk_vap_is_slave_ap(nic->vap_handle) || !mtlk_core_scan_is_running(nic) || is_scan_fast_rcvry; } /* This interface can be used if we need to disconnect while in * atomic context (for example, when disconnecting from a timer). * Disconnect process requires blocking function calls, so we * have to schedule a work. */ struct mtlk_core_disconnect_sta_data { IEEE_ADDR addr; uint16 reason; uint16 reason_code; int *res; mtlk_osal_event_t *done_evt; }; #ifdef MTLK_LEGACY_STATISTICS /*************************************************************************** * Disconnecting routines for STA ***************************************************************************/ /* This interface can be used if we need to disconnect while in * atomic context (for example, when disconnecting from a timer). * Disconnect process requires blocking function calls, so we * have to schedule a work. */ static void _mtlk_core_schedule_disconnect_me (struct nic *nic, uint16 reason, uint16 reason_code) { int err; struct mtlk_core_disconnect_sta_data data; MTLK_ASSERT(nic != NULL); memset(&data, 0, sizeof(data)); data.reason = reason; data.reason_code = reason_code; err = _mtlk_core_execute_async(nic, MTLK_ABILITY_NONE, HANDLE_T(nic), handleDisconnectMe, &data, sizeof(data), _MTLK_CORE_PRIORITY_NETWORK, NULL); if (err != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't schedule DISCONNECT (err=%d)", mtlk_vap_get_oid(nic->vap_handle), err); } } static int __MTLK_IFUNC _mtlk_core_disconnect_sta(mtlk_core_t *nic, uint16 reason, uint16 reason_code) { uint32 net_state; net_state = mtlk_core_get_net_state(nic); if ((net_state != NET_STATE_CONNECTED) && (net_state != NET_STATE_HALTED)) { /* allow disconnect for clean up */ ILOG0_DS("CID-%04x: disconnect in invalid state %s", mtlk_vap_get_oid(nic->vap_handle), mtlk_net_state_to_string(net_state)); return MTLK_ERR_NOT_READY; } if (!can_disconnect_now(nic, FALSE)) { _mtlk_core_schedule_disconnect_me(nic, reason, reason_code); return MTLK_ERR_OK; } reset_security_stuff(nic); return MTLK_ERR_OK; } static int _mtlk_core_hanle_disconnect_sta_req (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_core_ui_mlme_cfg_t *mlme_cfg; uint32 size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mlme_cfg = mtlk_clpb_enum_get_next(clpb, &size); if ( (NULL == mlme_cfg) || (sizeof(*mlme_cfg) != size) ) { ELOG_D("CID-%04x: Failed to get MLME configuration parameters from CLPB", mtlk_vap_get_oid(nic->vap_handle)); return MTLK_ERR_UNKNOWN; } return _mtlk_core_disconnect_sta(nic, FM_STATUSCODE_USER_REQUEST, mlme_cfg->reason_code); } static int handleDisconnectMe(mtlk_handle_t core_object, const void *payload, uint32 size) { struct nic *nic = HANDLE_T_PTR(struct nic, core_object); struct mtlk_core_disconnect_sta_data *data = (struct mtlk_core_disconnect_sta_data *)payload; MTLK_ASSERT(sizeof(uint16) == size); ILOG2_V("Handling disconnect request"); _mtlk_core_disconnect_sta(nic, data->reason, data->reason_code); return MTLK_ERR_OK; } #endif /* MTLK_LEGACY_STATISTICS */ /* kernel doesn't have structure of the BOOTP/DHCP header * so here it is defined according to rfc2131 */ struct dhcphdr { u8 op; #define BOOTREQUEST 1 #define BOOTREPLY 2 u8 htype; u8 hlen; u8 hops; u32 xid; u16 secs; u16 flags; #define BOOTP_BRD_FLAG 0x8000 u32 ciaddr; u32 yiaddr; u32 siaddr; u32 giaddr; u8 chaddr[16]; u8 sname[64]; u8 file[128]; u32 magic; /* NB: actually magic is a part of options */ u8 options[0]; } __attribute__((aligned(1), packed)); typedef struct _whole_dhcp_packet_t { struct ethhdr eth_hdr; struct iphdr ip_hdr; struct udphdr udp_hdr; struct dhcphdr dhcp_hdr; } __attribute__((aligned(1), packed)) whole_dhcp_packet_t; #define UDP_PORT_DHCP_SERVER (67) #define UDP_PORT_DHCP_CLIENT (68) static BOOL _mtlk_core_convert_dhcp_bcast_to_ucast(mtlk_nbuf_t *nbuf) { BOOL res = FALSE; whole_dhcp_packet_t *wdp = (whole_dhcp_packet_t*) nbuf->data; if (nbuf->len >= sizeof(*wdp) && wdp->eth_hdr.h_proto == __constant_htons(ETH_P_IP) && wdp->ip_hdr.protocol == IPPROTO_UDP && (wdp->udp_hdr.source == __constant_htons(UDP_PORT_DHCP_SERVER) || wdp->udp_hdr.source == __constant_htons(UDP_PORT_DHCP_CLIENT)) && (wdp->udp_hdr.dest == __constant_htons(UDP_PORT_DHCP_SERVER) || wdp->udp_hdr.dest == __constant_htons(UDP_PORT_DHCP_CLIENT))) { mtlk_osal_copy_eth_addresses(wdp->eth_hdr.h_dest, wdp->dhcp_hdr.chaddr); res = TRUE; } return res; } #define IP_ALEN 4 #define ARP_REQ_SEND_RATE_MS 300 /* 1 ARP request per 300ms */ mtlk_nbuf_t* subst_ip_to_arp_probe ( mtlk_nbuf_t **nbuf_in_out, mtlk_osal_timestamp_t *last_arp_req) { struct ethhdr *ether_header_in, *ether_header_arp; struct iphdr *ip_header_in; struct arphdr *arp_hdr; uint8 *arp_data; mtlk_nbuf_t *nbuf_arp, *nbuf_in; uint32 arp_pck_size; mtlk_osal_timestamp_diff_t diff; /* Limit ARP probe sending rate */ diff = mtlk_osal_timestamp_diff(mtlk_osal_timestamp(), *last_arp_req); if (mtlk_osal_timestamp_to_ms(diff) < ARP_REQ_SEND_RATE_MS){ goto subst_ip_to_arp_probe_err; } /* IP packet sanity check */ nbuf_in = *nbuf_in_out; ether_header_in = (struct ethhdr *)nbuf_in->data; if( ntohs(ether_header_in->h_proto) != ETH_P_IP){ goto subst_ip_to_arp_probe_err; } ip_header_in = (struct iphdr *)(nbuf_in->data + sizeof(struct ethhdr)); if (!ip_header_in->saddr || !ip_header_in->daddr){ goto subst_ip_to_arp_probe_err; } /* Allocate and Compose ARP probe packet */ arp_pck_size = sizeof(struct ethhdr) + sizeof(struct arphdr) + (ETH_ALEN + IP_ALEN)*2; nbuf_arp = mtlk_df_nbuf_alloc(arp_pck_size); if (!nbuf_arp){ WLOG_V("Unable to allocate buffer for ARP probe"); goto subst_ip_to_arp_probe_err; } /* Init nbuf fields */ nbuf_arp->dev = nbuf_in->dev; nbuf_arp->len = arp_pck_size; mtlk_df_nbuf_set_priority(nbuf_arp, MTLK_WMM_ACI_DEFAULT_CLASS); /* Fill up ETH header */ ether_header_arp = (struct ethhdr *)nbuf_arp->data; mtlk_osal_copy_eth_addresses(ether_header_arp->h_source, ether_header_in->h_source); memset(ether_header_arp->h_dest, 0xFF, ETH_ALEN); ether_header_arp->h_proto = htons(ETH_P_ARP); /* Fill up ARP header */ arp_hdr = (struct arphdr *)(ether_header_arp + 1); arp_hdr->ar_hrd = htons(ARPHRD_ETHER); arp_hdr->ar_pro = htons(ETH_P_IP); arp_hdr->ar_hln = ETH_ALEN; arp_hdr->ar_pln = IP_ALEN; arp_hdr->ar_op = ARPOP_REQUEST; /* Fill up ARP body */ arp_data = (uint8 *)(arp_hdr + 1); mtlk_osal_copy_eth_addresses(arp_data + 0, ether_header_in->h_source); /* Sender MAC - from IN pck */ mtlk_osal_zero_ip4_address (arp_data + ETH_ALEN ); /* Sender IP - all 0 */ mtlk_osal_copy_eth_addresses(arp_data + ETH_ALEN + IP_ALEN, ether_header_in->h_dest); /* Target MAC - from IN pck */ mtlk_osal_copy_ip4_addresses(arp_data + ETH_ALEN + IP_ALEN + ETH_ALEN, &ip_header_in->daddr); /* Target IP - from IN pck */ /* Release original nbuf */ mtlk_df_nbuf_free(nbuf_in); *nbuf_in_out = nbuf_arp; *last_arp_req = mtlk_osal_timestamp(); ILOG2_Y("Sending ARP probe to %Y", &ether_header_in->h_dest); return nbuf_arp; subst_ip_to_arp_probe_err: return NULL; } /***************************************************************************** ** ** NAME mtlk_core_handle_tx_data ** ** PARAMETERS vap_handle Handle of VAP object ** nbuf Skbuff to transmit ** ** DESCRIPTION Entry point for TX buffers ** ******************************************************************************/ void __MTLK_IFUNC mtlk_core_handle_tx_data (mtlk_vap_handle_t vap_handle, mtlk_nbuf_t *nbuf) { mtlk_core_t *nic = mtlk_vap_get_core(vap_handle); struct ethhdr *ether_header = (struct ethhdr *)nbuf->data; bridge_mode_t bridge_mode; sta_entry *sta = NULL; /* destination STA in AP mode or destination BSS in STA mode */ uint32 nbuf_flags = 0; sta_db *stadb; MTLK_ASSERT(NULL != nic); stadb = &nic->slow_ctx->stadb; CPU_STAT_BEGIN_TRACK(CPU_STAT_ID_TX_OS); /* Transmit only if connected to someone */ if (__UNLIKELY(!_mtlk_core_has_connections(nic))) { mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_NO_PEERS); goto tx_error; } #if defined(CPTCFG_IWLWAV_PER_PACKET_STATS) { /* get private fields */ mtlk_nbuf_priv_t *nbuf_priv = mtlk_nbuf_priv(nbuf); mtlk_nbuf_priv_stats_set(nbuf_priv, MTLK_NBUF_STATS_TS_SQ_IN, mtlk_hw_get_timestamp(vap_handle)); } #endif ILOG4_Y("802.3 tx DA: %Y", ether_header->h_dest); ILOG4_Y("802.3 tx SA: %Y", ether_header->h_source); mtlk_eth_parser(nbuf->data, nbuf->len, mtlk_df_get_name(mtlk_vap_get_df(vap_handle)), "TX"); bridge_mode = MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_BRIDGE_MODE); if (mtlk_vap_is_ap(vap_handle)) { /* AP mode interface */ if (MESH_MODE_BACKHAUL_AP == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_MESH_MODE)) { /* MultiAP: backhaul AP always has ONLY one station and always transmits frames * to the connected STA as is, w/o additional processing. */ nbuf_flags = MTLK_NBUFF_UNICAST; sta = mtlk_stadb_get_first_sta(stadb); if (!sta) { ILOG3_D("CID-%04x: Failed to get destination STA", mtlk_vap_get_oid(vap_handle)); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_UNKNOWN_DESTINATION_DIRECTED); goto tx_error; } goto send_tx_data; } /* check frame destination */ if (mtlk_osal_eth_is_multicast(ether_header->h_dest)) { if (mtlk_osal_eth_is_broadcast(ether_header->h_dest)) { if (nic->dgaf_disabled) { if (_mtlk_core_convert_dhcp_bcast_to_ucast(nbuf)) { ILOG3_V("DGAF disabled: Convert DHCP to Unicast"); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_TO_UNICAST_DGAF_DISABLED); goto unicast; } else { ILOG3_V("DGAF disabled: Skip Broadcast packet"); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_SKIPPED_DGAF_DISABLED); goto tx_error; } } nbuf_flags |= MTLK_NBUFF_BROADCAST; } else nbuf_flags |= MTLK_NBUFF_MULTICAST; goto send_tx_data; } unicast: /* Process unicast packet */ sta = mtlk_stadb_find_sta(stadb, ether_header->h_dest); if (!sta) { /* search even if not WDS - to support STA bridge mode */ sta = mtlk_hstdb_find_sta(&nic->slow_ctx->hstdb, ether_header->h_dest); } if (sta) { nbuf_flags |= MTLK_NBUFF_UNICAST; } else { ILOG3_Y("Unknown destination (%Y)", ether_header->h_dest); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_UNKNOWN_DESTINATION_DIRECTED); if (bridge_mode == BR_MODE_WDS || mtlk_stadb_get_four_addr_sta_cnt(stadb)) { /* In bridge mode or if there are four address stations connected, in case of IP UNICAST packet to unknown destination, substitute original packet with ARP probe */ if (NULL == subst_ip_to_arp_probe(&nbuf, &nic->slow_ctx->last_arp_probe)){ goto tx_error; /* Fail to generate ARP packet */ } nbuf_flags |= MTLK_NBUFF_BROADCAST; } else { goto tx_error; } } } else { /* Station mode interface */ struct ieee80211_vif *vif = net_device_to_ieee80211_vif(nbuf->dev); u8 *bssid = wv_ieee80211_peer_ap_address(vif); if (!bssid) { ELOG_V("wv_ieee80211_peer_ap_address failed"); goto tx_error; } sta = mtlk_stadb_find_sta(stadb, bssid); if (!sta) { ELOG_Y("MAC address %Y not found in sta mode", bssid); goto tx_error; } if (!mtlk_sta_is_4addr(sta) && MTLK_CORE_HOT_PATH_PDB_CMP_MAC(nic, CORE_DB_CORE_MAC_ADDR, ether_header->h_source)) { mtlk_dump(0, nbuf->data, MIN(nbuf->len, 64), "ERROR, not our source MAC address in sta mode"); goto tx_error; } nbuf_flags |= MTLK_NBUFF_UNICAST; } send_tx_data: { mtlk_core_handle_tx_data_t tx_data; /* initialize tx_data */ memset(&tx_data, 0, sizeof(tx_data)); tx_data.nbuf = nbuf; tx_data.dst_sta = sta; mtlk_mc_transmit(nic, &tx_data, nbuf_flags, bridge_mode, NULL); } CPU_STAT_END_TRACK(CPU_STAT_ID_TX_OS); return; tx_error: mtlk_df_nbuf_free(nbuf); if (sta) mtlk_sta_decref(sta); /* De-reference of find or get_ap */ CPU_STAT_END_TRACK(CPU_STAT_ID_TX_OS); } #define SEQUENCE_NUMBER_LIMIT (0x1000) #define SEQ_DISTANCE(seq1, seq2) (((seq2) - (seq1) + SEQUENCE_NUMBER_LIMIT) \ % SEQUENCE_NUMBER_LIMIT) static __INLINE BOOL __mtlk_core_is_looped_packet (mtlk_core_t* nic, mtlk_nbuf_t *nbuf) { struct ethhdr *ether_header = (struct ethhdr *)nbuf->data; return (0 == MTLK_CORE_HOT_PATH_PDB_CMP_MAC(nic, CORE_DB_CORE_MAC_ADDR, ether_header->h_source)); } BOOL __MTLK_IFUNC mtlk_core_is_looped_packet (mtlk_core_t* nic, mtlk_nbuf_t *nbuf) { return __mtlk_core_is_looped_packet(nic, nbuf); } /* Send Packet to the OS's protocol stack or forward */ void __MTLK_IFUNC mtlk_core_analyze_and_send_up (mtlk_core_t* nic, mtlk_core_handle_tx_data_t *tx_data, sta_entry *src_sta) { uint32 nbuf_flags = 0; mtlk_nbuf_t *nbuf = tx_data->nbuf; struct ethhdr *ether_header = (struct ethhdr *)nbuf->data; uint32 nbuf_len = mtlk_df_nbuf_get_data_length(nbuf); if (__UNLIKELY(__mtlk_core_is_looped_packet(nic, nbuf))) { ILOG3_Y("drop rx packet - the source address is the same as own address: %Y", ether_header->h_source); mtlk_df_nbuf_free(nbuf); return; } if (!mtlk_vap_is_ap(nic->vap_handle)) { ILOG3_V("Client mode"); nbuf_flags |= MTLK_NBUFF_UNICAST | MTLK_NBUFF_CONSUME; } else if (MESH_MODE_BACKHAUL_AP == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_MESH_MODE)) { /* MultiAP: backhaul AP always has ONLY one connected station and always forwards frames * from the connected STA to Linux as is, without additional processing. */ ILOG3_V("AP in Backhaul mode - short path"); nbuf_flags |= MTLK_NBUFF_UNICAST | MTLK_NBUFF_CONSUME; } else { /* AP mode */ mtlk_nbuf_t *nbuf_orig = nbuf; sta_entry *dst_sta = NULL; sta_db *stadb = &nic->slow_ctx->stadb; bridge_mode_t bridge_mode = MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_BRIDGE_MODE); if (mtlk_osal_eth_is_broadcast(ether_header->h_dest)) { /* Broadcast packet */ nbuf_flags |= MTLK_NBUFF_BROADCAST | MTLK_NBUFF_CONSUME; if (MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_AP_FORWARDING)) nbuf_flags |= MTLK_NBUFF_FORWARD; } else if (mtlk_osal_eth_is_multicast(ether_header->h_dest)) { /* Multicast packet */ nbuf_flags |= MTLK_NBUFF_MULTICAST | MTLK_NBUFF_CONSUME; if (MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_AP_FORWARDING)) nbuf_flags |= MTLK_NBUFF_FORWARD; } else { /* Unicast packet */ nbuf_flags |= MTLK_NBUFF_UNICAST; if (MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_AP_FORWARDING)) { /* Search of DESTINATION MAC ADDRESS of RECEIVED packet */ dst_sta = mtlk_stadb_find_sta(stadb, ether_header->h_dest); if ((dst_sta == NULL) && ((BR_MODE_WDS == bridge_mode) || mtlk_stadb_get_four_addr_sta_cnt(stadb))) { dst_sta = mtlk_hstdb_find_sta(&nic->slow_ctx->hstdb, ether_header->h_dest); } if (dst_sta != NULL) { if (dst_sta != src_sta) { nbuf_flags |= MTLK_NBUFF_FORWARD; #if MTLK_USE_DIRECTCONNECT_DP_API if (src_sta->vap_handle == dst_sta->vap_handle) { /* Allow Acceleration subsystem to learn about session when driver shortcuts forwarding without going to stack. The flag can be set safely even if acceleration isn't available */ nbuf_flags |= MTLK_NBUFF_SHORTCUT; #if (CPTCFG_IWLWAV_MAX_DLEVEL >= 2) if (mtlk_mmb_fastpath_available(mtlk_vap_get_hw(nic->vap_handle))) { /* Output log message only if acceleratoin is available */ ILOG2_DYDY("Learn shortcut from STA_ID %d (MAC:%Y) to STA_ID %d (MAC %Y)", mtlk_sta_get_sid(src_sta), ether_header->h_source, mtlk_sta_get_sid(dst_sta), ether_header->h_dest); } #endif } #endif } else { ILOG3_V("Loop detected ! Don't forward packet !"); } } else nbuf_flags |= MTLK_NBUFF_CONSUME; /* let the system forward - dst STA not found */ } else nbuf_flags |= MTLK_NBUFF_CONSUME; /* let the system forward - FWD disabled */ } if (nbuf_flags & (MTLK_NBUFF_BROADCAST | MTLK_NBUFF_MULTICAST)) { mtlk_mc_parse(nic, nbuf, src_sta); } switch (nbuf_flags & (MTLK_NBUFF_FORWARD | MTLK_NBUFF_CONSUME)) { case (MTLK_NBUFF_FORWARD | MTLK_NBUFF_CONSUME): nbuf = mtlk_df_nbuf_clone_no_priv(nbuf); break; case 0: mtlk_df_nbuf_free(nbuf); ILOG3_P("nbuf %p dropped - consumption is disabled", nbuf); return; } if (nbuf_flags & MTLK_NBUFF_FORWARD) { CPU_STAT_BEGIN_TRACK(CPU_STAT_ID_TX_FWD); if (__LIKELY(nbuf)) { /* update tx_data before transmitting */ tx_data->nbuf = nbuf; tx_data->dst_sta = dst_sta; mtlk_mc_transmit(nic, tx_data, nbuf_flags, bridge_mode, src_sta); } else { ELOG_D("CID-%04x: Can't clone the packet for forwarding", mtlk_vap_get_oid(nic->vap_handle)); nic->pstats.fwd_cannot_clone++; nic->pstats.fwd_dropped++; } nbuf = nbuf_orig; /* Count rxed data to be forwarded */ mtlk_sta_on_rx_packet_forwarded(src_sta, nbuf); CPU_STAT_END_TRACK(CPU_STAT_ID_TX_FWD); } } /* AP mode */ if (nbuf_flags & MTLK_NBUFF_CONSUME) { int net_state; ether_header = (struct ethhdr *)nbuf->data; #if defined MTLK_DEBUG_IPERF_PAYLOAD_RX //check if it is an iperf's packet we use to debug mtlk_iperf_payload_t *iperf = debug_ooo_is_iperf_pkt((uint8*) ether_header); if (iperf != NULL) { iperf->ts.tag_tx_to_os = htonl(debug_iperf_priv.tag_tx_to_os); debug_iperf_priv.tag_tx_to_os++; } #endif ILOG3_Y("802.3 rx DA: %Y", nbuf->data); ILOG3_Y("802.3 rx SA: %Y", nbuf->data+ETH_ALEN); ILOG3_D("packet protocol %04x", ntohs(ether_header->h_proto)); net_state = mtlk_core_get_net_state(nic); if (net_state != NET_STATE_CONNECTED) { mtlk_df_nbuf_free(nbuf); if (net_state != NET_STATE_DEACTIVATING) { WLOG_DD("CID-%04x: Data rx in not connected state (current state is %d), dropped", mtlk_vap_get_oid(nic->vap_handle), net_state); } return; } if (ntohs(ether_header->h_proto) == ETH_P_IP) { struct iphdr *iph; uint16 ip_len; if (nbuf_len < (sizeof(struct ethhdr) + sizeof(struct iphdr))) { ILOG2_V("malformed IP packet due to uncomplete hdr, dropped\n"); mtlk_df_nbuf_free(nbuf); return; } iph = (struct iphdr *)((mtlk_handle_t)ether_header + sizeof(struct ethhdr)); ip_len = ntohs(iph->tot_len); if((iph->ihl < 5) || (ip_len < (iph->ihl * sizeof(uint32))) || (ip_len > (nbuf_len - sizeof(struct ethhdr)))) { ILOG2_V("malformed IP packet due to payload invalidity, dropped\n"); mtlk_df_nbuf_free(nbuf); return; } } #ifdef MTLK_DEBUG_CHARIOT_OOO /* check out-of-order */ { int diff, seq_prev; seq_prev = nic->seq_prev_sent[nbuf_priv->seq_qos]; diff = SEQ_DISTANCE(seq_prev, nbuf_priv->seq_num); if (diff > SEQUENCE_NUMBER_LIMIT / 2) ILOG2_DDD("ooo: qos %u prev = %u, cur %u\n", nbuf_priv->seq_qos, seq_prev, nbuf_priv->seq_num); nic->seq_prev_sent[nbuf_priv->seq_qos] = nbuf_priv->seq_num; } #endif /* Count only packets sent to OS */ mtlk_sta_on_packet_indicated(src_sta, nbuf, nbuf_flags); CPU_STAT_END_TRACK(CPU_STAT_ID_RX_HW); mtlk_df_ui_indicate_rx_data(mtlk_vap_get_df(nic->vap_handle), nbuf); } } void mtlk_core_record_xmit_err(struct nic *nic, mtlk_nbuf_t *nbuf, uint32 nbuf_flags) { if (nbuf_flags & MTLK_NBUFF_FORWARD) { nic->pstats.fwd_dropped++; } if (++nic->pstats.tx_cons_drop_cnt > nic->pstats.tx_max_cons_drop) nic->pstats.tx_max_cons_drop = nic->pstats.tx_cons_drop_cnt; } /***************************************************************************** * Helper functions for _mtlk_core_handle_tx_data(): ******************************************************************************/ static __INLINE int __mtlk_core_prepare_and_xmit (mtlk_core_t* nic, mtlk_core_handle_tx_data_t *tx_data, BOOL wds, uint16 sta_sid, int mc_index, uint32 nbuf_flags) { int res = MTLK_ERR_PKT_DROPPED; mtlk_nbuf_t *nbuf = tx_data->nbuf; struct ethhdr *ether_header = (struct ethhdr *)nbuf->data; mtlk_hw_api_t *hw_api = mtlk_vap_get_hwapi(nic->vap_handle); uint32 tid = mtlk_df_nbuf_get_priority(nbuf); uint32 ntx_free = 0; mtlk_hw_data_req_mirror_t *msg = NULL; /* Sanity check */ if (__UNLIKELY(tid >= NTS_TIDS_GEN6)) { ELOG_D("Invalid priority: %u", tid); goto tx_skip; } /* prepare hw message */ msg = DATA_REQ_MIRROR_PTR(mtlk_hw_get_msg_to_send(hw_api, nic->vap_handle, &ntx_free)); if (__UNLIKELY(!msg)) { ++nic->pstats.ac_dropped_counter[tid]; nic->pstats.tx_overruns++; nic->pstats.txerr_swpath_overruns++; goto tx_skip; } ++nic->pstats.ac_used_counter[tid]; mtlk_osal_atomic_inc(&nic->unconfirmed_data); ILOG4_P("got from hw_msg %p", msg); /* fill fields */ msg->nbuf = nbuf; msg->size = mtlk_df_nbuf_get_data_length(nbuf); msg->sid = sta_sid; msg->tid = tid; msg->wds = (uint8)wds; msg->mcf = wds ? 0 : nbuf_flags & (MTLK_NBUFF_MULTICAST | MTLK_NBUFF_BROADCAST); msg->frame_type = (ntohs(ether_header->h_proto) >= ETH_P_802_3_MIN) ? FRAME_TYPE_ETHERNET : FRAME_TYPE_IPX_LLC_SNAP; msg->mc_index = mc_index; #ifdef CPTCFG_IWLWAV_PER_PACKET_STATS { mtlk_nbuf_priv_t *nbuf_priv = mtlk_nbuf_priv(nbuf); mtlk_nbuf_priv_stats_set(nbuf_priv, MTLK_NBUF_STATS_DATA_SIZE, msg->size); #if defined(CPTCFG_IWLWAV_TSF_TIMER_ACCESS_ENABLED) mtlk_nbuf_priv_stats_set(nbuf_priv, MTLK_NBUF_STATS_TS_FW_IN, mtlk_hw_get_timestamp(nic->vap_handle)); #endif } #endif /* send hw message */ res = mtlk_hw_send_data(hw_api, nic->vap_handle, msg); if (__LIKELY(res == MTLK_ERR_OK)) return res; ELOG_D("mtlk_hw_send_data ret (%d)", res); nic->pstats.txerr_swpath_hwsend++; tx_skip: /* release hw message and record error's statistic */ if (msg) { mtlk_hw_release_msg_to_send(hw_api, HW_MSG_PTR(msg)); } return res; } #if MTLK_USE_DIRECTCONNECT_DP_API static __INLINE int __mtlk_core_dcdp_prepare_and_xmit (mtlk_core_t *nic, mtlk_core_handle_tx_data_t *tx_data, BOOL wds, uint16 sta_sid, int mc_index, uint32 nbuf_flags) { int res = mtlk_df_ui_dp_prepare_and_xmit(nic->vap_handle, tx_data, wds, sta_sid, mc_index, nbuf_flags); if (__UNLIKELY(MTLK_ERR_OK != res)) { nic->pstats.txerr_dc_xmit++; } return res; } #endif /***************************************************************************** ** ** NAME _mtlk_core_handle_tx_data ** ** PARAMETERS nbuf Skbuff to transmit ** dev Device context ** ** RETURNS Skbuff transmission status ** ** DESCRIPTION This function called to perform packet transmission. ** ******************************************************************************/ static int _mtlk_core_handle_tx_data (mtlk_core_t *nic, mtlk_core_handle_tx_data_t *data, uint32 nbuf_flags) { int res = MTLK_ERR_PKT_DROPPED; uint16 sta_sid = TMP_BCAST_DEST_ADDR; sta_entry *sta = data->dst_sta; struct ethhdr *ether_header = (struct ethhdr *)data->nbuf->data; int mc_index = MCAST_GROUP_BROADCAST; BOOL wds = 0; MTLK_UNUSED_VAR(ether_header); mtlk_dump(5, data->nbuf->data, data->nbuf->len, "nbuf->data received from OS"); if (__LIKELY(sta)) { if (MTLK_PCKT_FLTR_DISCARD_ALL == mtlk_sta_get_packets_filter(sta)) { mtlk_sta_on_packet_dropped(sta, MTLK_TX_DISCARDED_DROP_ALL_FILTER); nic->pstats.txerr_drop_all_filter++; goto tx_skip; } } if (MESH_MODE_BACKHAUL_AP == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_MESH_MODE)) { /* Multi-AP: AP works as backhaul AP. All frames should be sent as-is to the single 4-address STA*/ MTLK_ASSERT(!sta); if (!sta) { /* In fact this code should not be executed, but added there for the safety */ mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_NO_PEERS); goto tx_skip; } sta_sid = mtlk_sta_get_sid(sta); } else { /* Determine multicast group index */ if (nbuf_flags & MTLK_NBUFF_MULTICAST) { mc_index = mtlk_mc_get_grid(nic, data->nbuf); if (MCAST_GROUP_UNDEF == mc_index) { ILOG2_V("Drop due to undefined MC index."); nic->pstats.txerr_undef_mc_index++; goto tx_skip; } } ILOG3_DD("CID-%04x: multicast group: %d", mtlk_vap_get_oid(nic->vap_handle), mc_index); if (sta) { /* Use 4 address for peer APs and 4 address stations */ if (sta->peer_ap || mtlk_sta_is_4addr(sta)) { wds = 1; ILOG4_DYY("WDS/four address STA packet: Peer %d, STA %Y, ETH Dest %Y", sta->peer_ap, mtlk_sta_get_addr(sta), ether_header->h_dest); } sta_sid = mtlk_sta_get_sid(sta); } } ILOG3_D("SID: %d", sta_sid); #if MTLK_USE_DIRECTCONNECT_DP_API if (mtlk_mmb_dcdp_path_available(mtlk_vap_get_hw(nic->vap_handle))) res = __mtlk_core_dcdp_prepare_and_xmit(nic, data, wds, sta_sid, mc_index, nbuf_flags); else #endif res = __mtlk_core_prepare_and_xmit(nic, data, wds, sta_sid, mc_index, nbuf_flags); if (__LIKELY(res == MTLK_ERR_OK)) { mtlk_df_ui_notify_tx_start(mtlk_vap_get_df(nic->vap_handle)); } else { if(sta) { mtlk_sta_on_packet_dropped(sta, MTLK_TX_DISCARDED_TX_QUEUE_OVERFLOW); } else { mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_TX_QUEUE_OVERFLOW); } } tx_skip: return res; } #if MTLK_USE_DIRECTCONNECT_DP_API int __MTLK_IFUNC mtlk_core_get_dev_spec_info (mtlk_nbuf_t *nbuf, mtlk_core_dev_spec_info_t *dev_spec_info) { struct ethhdr *ether_header = (struct ethhdr *)nbuf->data; sta_entry *dst_sta = NULL; mtlk_df_user_t *df_user; mtlk_vap_handle_t vap_handle; mtlk_core_t *core; df_user = mtlk_df_user_from_ndev(nbuf->dev); if (!df_user) { return MTLK_ERR_UNKNOWN; } vap_handle = mtlk_df_get_vap_handle(mtlk_df_user_get_df(df_user)); core = mtlk_vap_get_core(vap_handle); dev_spec_info->vap_id = mtlk_vap_get_id(vap_handle); dev_spec_info->mc_index = MCAST_GROUP_BROADCAST; dev_spec_info->sta_id = TMP_BCAST_DEST_ADDR; dev_spec_info->frame_type = (ntohs(ether_header->h_proto) >= ETH_P_802_3_MIN) ? FRAME_TYPE_ETHERNET : FRAME_TYPE_IPX_LLC_SNAP; if (mtlk_vap_is_ap(vap_handle)) { /* AP mode */ if (mtlk_osal_eth_is_multicast(ether_header->h_dest)) { /* Multicast/broadcast*/ if (!mtlk_osal_eth_is_broadcast(ether_header->h_dest)) { dev_spec_info->mc_index = mtlk_mc_get_grid(core, nbuf); if (dev_spec_info->mc_index == MCAST_GROUP_UNDEF) ILOG1_V("Undefined multicast group index"); } dev_spec_info->mcf = 1; } else { /* Unicast */ dst_sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, ether_header->h_dest); if (!dst_sta) /* search even if not WDS - to support STA bridge mode */ dst_sta = mtlk_hstdb_find_sta(&core->slow_ctx->hstdb, ether_header->h_dest); if (dst_sta) { dev_spec_info->sta_id = mtlk_sta_get_sid(dst_sta); mtlk_sta_decref(dst_sta); } dev_spec_info->mcf = 0; } } else { /* STA mode */ struct ieee80211_vif *vif = net_device_to_ieee80211_vif(nbuf->dev); u8 *bssid = wv_ieee80211_peer_ap_address(vif); if (bssid) { dst_sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, bssid); if (dst_sta) { dev_spec_info->sta_id = mtlk_sta_get_sid(dst_sta); mtlk_sta_decref(dst_sta); } } /* in STA mode we always send unicast packets*/ dev_spec_info->mcf = 0; } return MTLK_ERR_OK; } #endif /* MTLK_USE_DIRECTCONNECT_DP_API */ #ifdef DEBUG_WPS static char test_wps_ie0[] = {0xdd, 7, 0x00, 0x50, 0xf2, 0x04, 1, 2, 3}; static char test_wps_ie1[] = {0xdd, 7, 0x00, 0x50, 0xf2, 0x04, 4, 5, 6}; static char test_wps_ie2[] = {0xdd, 7, 0x00, 0x50, 0xf2, 0x04, 7, 8, 9}; #endif static int bt_acs_send_interf_event(uint8 channel, int8 maximumValue) { int rc; struct bt_acs_interf_event_t *interf_event; rc = MTLK_ERR_OK; /* allocate memory for notification event */ interf_event = mtlk_osal_mem_alloc(sizeof(*interf_event), MTLK_MEM_TAG_CORE); if (!interf_event){ return MTLK_ERR_NO_MEM; } interf_event->event_id = BT_ACS_EVNT_ID_INTERF_DET; interf_event->channel = channel; interf_event->floor_noise = maximumValue; mtlk_nl_bt_acs_send_brd_msg(interf_event, sizeof(*interf_event)); mtlk_osal_mem_free(interf_event); return rc; } /* +----+-------++-----------------++------------------- -----------------------------------------+ | \ || Interf. Dis. || Inerf. Enabled | | \ ||--------+--------||--------+--------+----------+----------+----------+----------| | \ || No Meas| No Meas|| No Meas| No Meas| Measure | Measure | Measure | Measure | | \ || Scan20 | Scan40 || Scan20 | Scan40 | Scan20 | Scan20 | Scan40 | Scan40 | | \ || Regular| Regular|| Regular| Regular| LONG | SHORT | LONG | SHORT | | \ || all all || all | all | unrestr | restr | unrestr | restr | | Spectrum \|| clr $$ | clr $$ || clr $$ | clr $$ | | | | | +------------++--------+--------++--------+--------+----------+----------+----------+----------+ | 20 || 1 | . || . | . | 1 | 2 | . | . | | 40 || 2 | 1 || 1 | . | . | . | 2 | 3 | | 20/40,coex || 2 | 1 || . | 1 | 2 | 3 | . | . | +------------++--------+--------++--------+--------+----------+----------+----------+----------+ 1..3 - scan execution order . - scan skipped */ #define SCAN_TABLE_IDX_20 0 #define SCAN_TABLE_IDX_40 1 #define SCAN_TABLE_IDX_20_40 2 #define SCAN_TABLE_IDX_COEX 3 #define SCAN_TABLE_IDX_LAST 4 #define SCAN_TABLE_NO_MEAS_20_REGULAR_ALL 1 #define SCAN_TABLE_NO_MEAS_40_REGULAR_ALL 2 #define SCAN_TABLE_MEAS_20_LONG_UNRESTR 3 #define SCAN_TABLE_MEAS_20_SHORT_RESTR 4 #define SCAN_TABLE_MEAS_40_LONG_UNRESTR 5 #define SCAN_TABLE_MEAS_40_SHORT_RESTR 6 #define SCAN_TABLE_MEAS_LAST 7 #define SCAN_TABLE_ROW_LAST 4 static const uint8 scan_table_interf_en[SCAN_TABLE_IDX_LAST][SCAN_TABLE_ROW_LAST] = { /* SCAN_TABLE_IDX_20 */ { SCAN_TABLE_MEAS_20_LONG_UNRESTR, SCAN_TABLE_MEAS_20_SHORT_RESTR, 0, 0}, /* SCAN_TABLE_IDX_40 */ { SCAN_TABLE_NO_MEAS_20_REGULAR_ALL, SCAN_TABLE_MEAS_40_LONG_UNRESTR, SCAN_TABLE_MEAS_40_SHORT_RESTR, 0}, /* SCAN_TABLE_IDX_20_40 */ { SCAN_TABLE_NO_MEAS_40_REGULAR_ALL, SCAN_TABLE_MEAS_20_LONG_UNRESTR, SCAN_TABLE_MEAS_20_SHORT_RESTR, 0}, }; static const uint8 scan_table_interf_dis[SCAN_TABLE_IDX_LAST][SCAN_TABLE_ROW_LAST] = { /* SCAN_TABLE_IDX_20 */ { SCAN_TABLE_NO_MEAS_20_REGULAR_ALL, 0, 0, 0}, /* SCAN_TABLE_IDX_40 */ { SCAN_TABLE_NO_MEAS_40_REGULAR_ALL, SCAN_TABLE_NO_MEAS_20_REGULAR_ALL, 0, 0}, /* SCAN_TABLE_IDX_20_40 */ { SCAN_TABLE_NO_MEAS_40_REGULAR_ALL, SCAN_TABLE_NO_MEAS_20_REGULAR_ALL, 0, 0}, }; static int _mtlk_mbss_send_preactivate_req (struct nic *nic) { mtlk_txmm_data_t *man_entry = NULL; mtlk_txmm_msg_t man_msg; int result = MTLK_ERR_OK; UMI_MBSS_PRE_ACTIVATE *pPreActivate; UMI_MBSS_PRE_ACTIVATE_HDR *pPreActivateHeader; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(nic->vap_handle), &result); if (man_entry == NULL) { ELOG_D("CID-%04x: Can't send PRE_ACTIVATE request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); goto FINISH; } man_entry->id = UM_MAN_MBSS_PRE_ACTIVATE_REQ; man_entry->payload_size = mtlk_get_umi_mbss_pre_activate_size(); memset(man_entry->payload, 0, man_entry->payload_size); pPreActivate = (UMI_MBSS_PRE_ACTIVATE *)(man_entry->payload); pPreActivateHeader = &pPreActivate->sHdr; pPreActivateHeader->u16Status = HOST_TO_MAC16(UMI_OK); wave_memcpy(pPreActivate->storedCalibrationChannelBitMap, sizeof(pPreActivate->storedCalibrationChannelBitMap), nic->storedCalibrationChannelBitMap, sizeof(nic->storedCalibrationChannelBitMap)); ILOG1_D("CID-%04x: Sending UMI FW Preactivation", mtlk_vap_get_oid(nic->vap_handle)); mtlk_dump(2, pPreActivate, sizeof(*pPreActivate), "dump of UMI_MBSS_PRE_ACTIVATE:"); result = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (result != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't send PRE_ACTIVATE request to MAC (err=%d)", mtlk_vap_get_oid(nic->vap_handle), result); goto FINISH; } if (MAC_TO_HOST16(pPreActivateHeader->u16Status) != UMI_OK) { ELOG_DD("CID-%04x: Error returned for PRE_ACTIVATE request to MAC (err=%d)", mtlk_vap_get_oid(nic->vap_handle), MAC_TO_HOST16(pPreActivateHeader->u16Status)); result = MTLK_ERR_UMI; goto FINISH; } FINISH: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return result; } static int _core_set_preactivation_mibs (mtlk_core_t *core) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(mtlk_vap_is_master_ap(core->vap_handle)); if (MTLK_ERR_OK != mtlk_mib_set_pre_activate(core)) { return MTLK_ERR_UNKNOWN; } if (MTLK_ERR_OK != mtlk_set_mib_value_uint8(mtlk_vap_get_txmm(core->vap_handle), MIB_SPECTRUM_MODE, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_PROG_MODEL_SPECTRUM_MODE))) { return MTLK_ERR_UNKNOWN; } return MTLK_ERR_OK; } /* FIXME soon to be removed */ static int _mtlk_mbss_preactivate (struct nic *nic, BOOL rescan_exempted) { int result = MTLK_ERR_OK; int channel; uint8 ap_scan_band_cfg; int actual_spectrum_mode; int prog_model_spectrum_mode; wave_radio_t *radio; MTLK_ASSERT(NULL != nic); radio = wave_vap_radio_get(nic->vap_handle); /* select and validate the channel and the spectrum mode*/ channel = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_CHANNEL_CFG); /************************************************************************/ /* Add aocs initialization + loading of programming module */ /************************************************************************/ /* now we have to perform an AP scan and update * the table after we have scan results. Do scan only in one band */ ap_scan_band_cfg = core_cfg_get_freq_band_cfg(nic); ILOG1_DD("CID-%04x: ap_scan_band_cfg = %d", mtlk_vap_get_oid(nic->vap_handle), ap_scan_band_cfg); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_FREQ_BAND_CFG, ((ap_scan_band_cfg == MTLK_HW_BAND_2_4_GHZ) ? MTLK_HW_BAND_2_4_GHZ : MTLK_HW_BAND_5_2_GHZ) ); /* restore all after AP scan */ WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_FREQ_BAND_CFG, ap_scan_band_cfg); /* * at this point spectrum & channel may be changed by AOCS */ channel = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_CHANNEL_CUR); actual_spectrum_mode = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SPECTRUM_MODE); prog_model_spectrum_mode = (actual_spectrum_mode == CW_20) ? CW_20 : CW_40; WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_PROG_MODEL_SPECTRUM_MODE, prog_model_spectrum_mode); /* Progmodel loading was here, moving it out to mtlk_mbss_send_vap_activate() */ /* now check AOCS result - here all state is already restored */ if (result != MTLK_ERR_OK) { ELOG_D("CID-%04x: aocs did not find available channel", mtlk_vap_get_oid(nic->vap_handle)); result = MTLK_ERR_AOCS_FAILED; goto FINISH; } /* * at this point spectrum & channel may be changed by COEX */ /* Send LOG SIGNAL */ SLOG0(SLOG_DFLT_ORIGINATOR, SLOG_DFLT_RECEIVER, mtlk_core_t, nic); _core_set_preactivation_mibs(nic); result = _mtlk_mbss_send_preactivate_req(nic); if (result != MTLK_ERR_OK) { goto FINISH; } FINISH: if (result == MTLK_ERR_OK) { ILOG2_D("CID-%04x: _mtlk_mbss_preactivate returned successfully", mtlk_vap_get_oid(nic->vap_handle)); } else { ELOG_D("CID-%04x: _mtlk_mbss_preactivate returned with error", mtlk_vap_get_oid(nic->vap_handle)); } return result; } int mtlk_mbss_send_vap_db_add(struct nic *nic) { mtlk_txmm_data_t *man_entry = NULL; mtlk_txmm_msg_t man_msg; int result = MTLK_ERR_OK; UMI_VAP_DB_OP *pAddRequest; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(nic->vap_handle), &result); if (man_entry == NULL) { ELOG_D("CID-%04x: Can't send VAP_DB ADD request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); goto FINISH; } man_entry->id = UM_MAN_VAP_DB_REQ; man_entry->payload_size = sizeof (UMI_VAP_DB_OP); pAddRequest = (UMI_VAP_DB_OP *)(man_entry->payload); pAddRequest->u16Status = HOST_TO_MAC16(UMI_OK); pAddRequest->u8OperationCode = VAP_OPERATION_ADD; pAddRequest->u8VAPIdx = mtlk_vap_get_id(nic->vap_handle); result = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (result != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't send VAP_DB ADD request to MAC (err=%d)", mtlk_vap_get_oid(nic->vap_handle), result); goto FINISH; } if (MAC_TO_HOST16(pAddRequest->u16Status) != UMI_OK) { ELOG_DD("CID-%04x: Error returned for VAP_DB ADD request to MAC (err=%d)", mtlk_vap_get_oid(nic->vap_handle), MAC_TO_HOST16(pAddRequest->u16Status)); result = MTLK_ERR_UMI; goto FINISH; } FINISH: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return result; } /* FIXME soon to be removed */ static int _mtlk_mbss_preactivate_if_needed (mtlk_core_t *core, BOOL rescan_exempted) { int result = MTLK_ERR_OK; MTLK_ASSERT(NULL != core); if (0 == mtlk_vap_manager_get_active_vaps_number(mtlk_vap_get_manager(core->vap_handle)) && mtlk_core_get_net_state(core) != NET_STATE_ACTIVATING) { result = _mtlk_mbss_preactivate(mtlk_core_get_master(core), rescan_exempted); } return result; } /* Get/set param DB value of MGMT_FRAMES_RATE */ static uint32 _core_management_frames_rate_get (mtlk_core_t *core) { return (uint32)MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_MGMT_FRAMES_RATE); } void __MTLK_IFUNC wave_core_management_frames_rate_set (mtlk_core_t *core, uint32 value) { MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_MGMT_FRAMES_RATE, value); } /* We can't to use the real configured value because we don't send 11g rates to FW in 11b mode */ static uint32 _core_management_frames_rate_select (mtlk_core_t *core) { mtlk_core_t *mcore = mtlk_core_get_master(core); if ((!mcore) || ((UMI_PHY_TYPE_BAND_2_4_GHZ == __wave_core_chandef_get(mcore)->chan.band) && (MTLK_NETWORK_11B_ONLY == core_cfg_get_network_mode_cur(core)))) { WLOG_DD("CID-%04x: Set MCS VAP Management to default (%02x) value in FW due to 11B HW mode", mtlk_vap_get_oid(core->vap_handle), FIXED_MCS_VAP_MANAGEMENT_IS_NOT_VALID); return FIXED_MCS_VAP_MANAGEMENT_IS_NOT_VALID; } return _core_management_frames_rate_get(core); } #define WAVE_HW_11B_RATES_NUM 4 #define WAVE_HW_11G_RATES_NUM 8 #define WAVE_HW_11A_RATES_NUM 8 static uint32 _core_basic_rates_11g_set (mtlk_core_t *core, mtlk_hw_band_e band, uint8 *rates_buf, uint32 rates_buf_len, uint32 rates_fill_len) { uint32 rates_len = rates_fill_len; uint8 rates[] = { (1 * MBIT_RATE_ENCODING_MUL), /* rates 11b */ (2 * MBIT_RATE_ENCODING_MUL), (55 / HUNDRED_KBIT_RATE_ENCODING_DIV), (11 * MBIT_RATE_ENCODING_MUL), (6 * MBIT_RATE_ENCODING_MUL), /* rates 11g or 11a */ (9 * MBIT_RATE_ENCODING_MUL), (12 * MBIT_RATE_ENCODING_MUL), (18 * MBIT_RATE_ENCODING_MUL), (24 * MBIT_RATE_ENCODING_MUL), (36 * MBIT_RATE_ENCODING_MUL), (48 * MBIT_RATE_ENCODING_MUL), (54 * MBIT_RATE_ENCODING_MUL) }; if (UMI_PHY_TYPE_BAND_2_4_GHZ == band) { uint32 mode = core_cfg_get_network_mode_cur(core); if ((MTLK_NETWORK_11BG_MIXED == mode) || (MTLK_NETWORK_11BGN_MIXED == mode) || (MTLK_NETWORK_11BGNAX_MIXED == mode)) { if (rates_buf_len >= sizeof(rates)) { wave_memcpy(rates_buf, rates_buf_len, rates, sizeof(rates)); rates_len = sizeof(rates); } } else if (MTLK_NETWORK_11B_ONLY == mode) { if (rates_buf_len >= WAVE_HW_11B_RATES_NUM) { wave_memcpy(rates_buf, rates_buf_len, rates, WAVE_HW_11B_RATES_NUM); rates_len = WAVE_HW_11B_RATES_NUM; } } } else /* if (UMI_PHY_TYPE_BAND_5_2_GHZ == band) */ { if (rates_buf_len >= WAVE_HW_11A_RATES_NUM) { wave_memcpy(rates_buf, rates_buf_len, &rates[WAVE_HW_11B_RATES_NUM], WAVE_HW_11A_RATES_NUM); rates_len = WAVE_HW_11A_RATES_NUM; } } return rates_len; } uint32 __MTLK_IFUNC wave_core_param_db_basic_rates_get (mtlk_core_t *core, mtlk_hw_band_e band, uint8 *rates_buf, uint32 rates_buf_len) { mtlk_pdb_size_t rates_len = rates_buf_len; mtlk_pdb_t *param_db_core = mtlk_vap_get_param_db(core->vap_handle); mtlk_pdb_id_t param_id = (band == UMI_PHY_TYPE_BAND_2_4_GHZ ? PARAM_DB_CORE_BASIC_RATES_2 : PARAM_DB_CORE_BASIC_RATES_5); if (MTLK_ERR_OK == wave_pdb_get_binary(param_db_core, param_id, rates_buf, &rates_len)) rates_len = _core_basic_rates_11g_set(core, band, rates_buf, rates_buf_len, rates_len); else rates_len = 0; return rates_len; } /* band needed to load the right progmodels and for initial basic rate choosing */ int mtlk_mbss_send_vap_activate(struct nic *nic, mtlk_hw_band_e band) { mtlk_txmm_data_t* man_entry=NULL; mtlk_txmm_msg_t activate_msg; UMI_ADD_VAP *req; int result = MTLK_ERR_OK; uint8 vap_id = mtlk_vap_get_id(nic->vap_handle); mtlk_pdb_t *param_db_core = mtlk_vap_get_param_db(nic->vap_handle); int net_state = mtlk_core_get_net_state(nic); mtlk_txmm_t *txmm = mtlk_vap_get_txmm(nic->vap_handle); u8 mbssid_vap_mode = wave_pdb_get_int(param_db_core, PARAM_DB_CORE_MBSSID_VAP); /* If the VAP has already been added, skip all the work */ if (net_state & (NET_STATE_ACTIVATING | NET_STATE_DEACTIVATING | NET_STATE_CONNECTED)) goto end; /* FIXME this thing is supposed to get removed soon */ if (MTLK_ERR_OK != (result = _mtlk_mbss_preactivate_if_needed(nic, FALSE))) { ELOG_D("CID-%04x: _mtlk_mbss_preactivate_if_needed returned with error", mtlk_vap_get_oid(nic->vap_handle)); goto end; } /* we switch beforehand because the state switch does some checks; we'll correct the state if we fail */ if (mtlk_core_set_net_state(nic, NET_STATE_ACTIVATING) != MTLK_ERR_OK) { ELOG_D("CID-%04x: Failed to switch core to state ACTIVATING", mtlk_vap_get_oid(nic->vap_handle)); result = MTLK_ERR_NOT_READY; goto end; } ILOG1_D("CID-%04x: Start activation", mtlk_vap_get_oid(nic->vap_handle)); mtlk_vap_set_ready(nic->vap_handle); man_entry = mtlk_txmm_msg_init_with_empty_data(&activate_msg, txmm, &result); if (man_entry == NULL) { ELOG_D("CID-%04x: Can't send ACTIVATE request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); goto FINISH; } man_entry->id = UM_MAN_ADD_VAP_REQ; man_entry->payload_size = sizeof(*req); req = (UMI_ADD_VAP *) man_entry->payload; memset(req, 0, sizeof(*req)); wave_pdb_get_mac(param_db_core, PARAM_DB_CORE_MAC_ADDR, &req->sBSSID); ILOG2_DY("Mac addr for VapID %u from param DB is %Y", vap_id, &req->sBSSID.au8Addr); req->vapId = vap_id; if (mtlk_vap_is_ap(nic->vap_handle)) { if(WAVE_RADIO_OPERATION_MODE_MBSSID_TRANSMIT_VAP == mbssid_vap_mode) { req->operationMode = OPERATION_MODE_MBSSID_TRANSMIT_VAP; } else if(WAVE_RADIO_OPERATION_MODE_MBSSID_NON_TRANSMIT_VAP == mbssid_vap_mode) { req->operationMode = OPERATION_MODE_MBSSID_NON_TRANSMIT_VAP; } else { req->operationMode = OPERATION_MODE_NORMAL; } } else { req->operationMode = OPERATION_MODE_VSTA; } ILOG2_D("mbssid_vap_mode: %d", mbssid_vap_mode); ILOG2_D("UMI_ADD_VAP->operationMode: %d", req->operationMode); req->u8Rates_Length = (uint8)wave_core_param_db_basic_rates_get(nic, band, req->u8Rates, sizeof(req->u8Rates)); memset(&req->u8TX_MCS_Bitmask, 0, sizeof(req->u8TX_MCS_Bitmask)); /* Each MCS Map subfield of u8VHT_Mcs_Nss/u8HE_Mcs_Nss is two bits wide, * 3 indicates that n spatial streams is not supported for HE PPDUs. * Filling it with 0xff - meaning all subfields are equal to 3 by default */ memset(&req->u8VHT_Mcs_Nss, 0xff, sizeof(req->u8VHT_Mcs_Nss)); memset(&req->u8HE_Mcs_Nss, 0xff, sizeof(req->u8HE_Mcs_Nss)); nic->activation_status = FALSE; mtlk_osal_event_reset(&nic->slow_ctx->connect_event); mtlk_dump(2, req, sizeof(*req), "dump of UMI_ADD_VAP:"); ILOG0_DY("CID-%04x: UMI_ADD_VAP, BSSID %Y", mtlk_vap_get_oid(nic->vap_handle), &req->sBSSID); result = mtlk_txmm_msg_send_blocked(&activate_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (result != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Cannot send ADD_VAP request due to TXMM err#%d", mtlk_vap_get_oid(nic->vap_handle), result); goto FINISH; } nic->activation_status = TRUE; nic->is_stopped = FALSE; mtlk_vap_manager_notify_vap_activated(mtlk_vap_get_manager(nic->vap_handle)); result = MTLK_ERR_OK; ILOG1_SDDDS("%s: Activated: is_stopped=%u, is_stopping=%u, is_iface_stopping=%u, net_state=%s", mtlk_df_get_name(mtlk_vap_get_df(nic->vap_handle)), nic->is_stopped, nic->is_stopping, nic->is_iface_stopping, mtlk_net_state_to_string(mtlk_core_get_net_state(nic))); FINISH: if (result != MTLK_ERR_OK && mtlk_core_get_net_state(nic) != NET_STATE_READY) mtlk_core_set_net_state(nic, NET_STATE_READY); if (man_entry) mtlk_txmm_msg_cleanup(&activate_msg); end: return result; } /* =============================================================================== * This function fills UMI_SET_BSS request with values from parameters db, * combined with bss_parameters. * =============================================================================== */ static void _mtlk_core_fill_set_bss_request(mtlk_core_t *core, UMI_SET_BSS *req, struct mtlk_bss_parameters *params) { mtlk_pdb_t *param_db_core = mtlk_vap_get_param_db(core->vap_handle); struct nic *master_core = mtlk_vap_manager_get_master_core(mtlk_vap_get_manager(core->vap_handle)); struct mtlk_chan_def *current_chandef = __wave_core_chandef_get(master_core); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); uint16 dtim_int, beacon_int; MTLK_ASSERT(req); MTLK_ASSERT(params); memset(req, 0, sizeof(*req)); /* Dealing w/ cts protection */ if (params->use_cts_prot == -1) params->use_cts_prot = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_HT_PROTECTION); req->protectionMode = params->use_cts_prot; /* Dealing w/ short slot time */ if (params->use_short_slot_time == -1) params->use_short_slot_time = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SHORT_SLOT); req->slotTime = params->use_short_slot_time; /* Dealing w/ short preamble */ if (params->use_short_preamble == -1) params->use_short_preamble = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SHORT_PREAMBLE); req->useShortPreamble = params->use_short_preamble; /* FIXME figure out how preamble affects the rates */ /* DTIM and Beacon interval are set in start_ap and stored in param_db */ beacon_int = (uint16) WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_BEACON_PERIOD); dtim_int = (uint16) MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_DTIM_PERIOD); req->beaconInterval = HOST_TO_MAC16(beacon_int); req->dtimInterval = HOST_TO_MAC16(dtim_int); ILOG1_DD("dtim_int: %d beacon_int: %d", dtim_int, beacon_int); /* Dealing w/ basic rates */ if (!params->basic_rates_len) { /* copy existing parameters from params db */ req->u8Rates_Length = (uint8)wave_core_param_db_basic_rates_get(core, current_chandef->chan.band, req->u8Rates, sizeof(req->u8Rates)); } else { /* copy from input structure */ wave_memcpy(req->u8Rates, sizeof(req->u8Rates), params->basic_rates, params->basic_rates_len); req->u8Rates_Length = (uint8)_core_basic_rates_11g_set(core, current_chandef->chan.band, req->u8Rates, sizeof(req->u8Rates), params->basic_rates_len); } /* Dealing w/ HT/VHT MCS-s and flags */ { mtlk_pdb_size_t mcs_len; mcs_len = sizeof(req->u8TX_MCS_Bitmask); wave_pdb_get_binary(param_db_core, PARAM_DB_CORE_RX_MCS_BITMASK, &req->u8TX_MCS_Bitmask, &mcs_len); mcs_len = sizeof(req->u8VHT_Mcs_Nss); wave_pdb_get_binary(param_db_core, PARAM_DB_CORE_VHT_MCS_NSS, &req->u8VHT_Mcs_Nss, &mcs_len); req->flags = wave_pdb_get_int(param_db_core, PARAM_DB_CORE_SET_BSS_FLAGS); if (wave_pdb_get_int(param_db_core, PARAM_DB_CORE_RELIABLE_MCAST)) { req->flags |= MTLK_BFIELD_VALUE(VAP_ADD_FLAGS_RELIABLE_MCAST, 1, uint8); } if (mtlk_df_user_get_hs20_status(mtlk_vap_get_df(core->vap_handle))) { req->flags |= MTLK_BFIELD_VALUE(VAP_ADD_FLAGS_HS20_ENABLE, 1, uint8); } } /* MultiBSS related */ req->mbssIdNumOfVapsInGroup = (uint8)wave_pdb_get_int(param_db_core, PARAM_DB_CORE_MBSSID_NUM_VAPS_IN_GROUP); ILOG2_D("UMI_SET_BSS->mbssIdNumOfVapsInGroup:%d", req->mbssIdNumOfVapsInGroup); /* 802.11AX HE support */ { mtlk_pdb_size_t mcs_len; mcs_len = sizeof(req->u8HE_Mcs_Nss); /* Each MCS Map subfield of u8VHT_Mcs_Nss/u8HE_Mcs_Nss is two bits wide, * 3 indicates that n spatial streams is not supported for HE PPDUs. * Filling it with 0xff - meaning all subfields are equal to 3 by default */ memset(req->u8HE_Mcs_Nss, 0xff, sizeof(req->u8HE_Mcs_Nss)); wave_pdb_get_binary(param_db_core, PARAM_DB_CORE_HE_MCS_NSS, &req->u8HE_Mcs_Nss, &mcs_len); mtlk_dump(1, &req->u8HE_Mcs_Nss, mcs_len, "dump of u8HE_Mcs_Nss:"); } } /* =============================================================================== * This function updates values in parameters db using data in already filled * UMI_SET_BSS request, according to values in bss_parameters as update indicators * =============================================================================== */ static void _mtlk_core_update_bss_params(mtlk_core_t *core, UMI_SET_BSS *req, struct mtlk_bss_parameters *params) { mtlk_pdb_t *param_db_core = mtlk_vap_get_param_db(core->vap_handle); struct nic *master_core = mtlk_vap_manager_get_master_core(mtlk_vap_get_manager(core->vap_handle)); struct mtlk_chan_def *current_chandef = __wave_core_chandef_get(master_core); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); /* Dealing w/ cts protection */ if (params->use_cts_prot != -1) MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_HT_PROTECTION, req->protectionMode); /* Dealing w/ short slot time */ if (params->use_short_slot_time != -1) WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_SHORT_SLOT, req->slotTime); /* Dealing w/ short preamble */ if (params->use_short_preamble != -1) WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_SHORT_PREAMBLE, req->useShortPreamble); /* FIXME figure out how preamble affects the rates */ /* Dealing w/ basic rates */ if (params->basic_rates_len) { wave_pdb_set_binary(param_db_core, (current_chandef->chan.band == UMI_PHY_TYPE_BAND_2_4_GHZ ? PARAM_DB_CORE_BASIC_RATES_2 : PARAM_DB_CORE_BASIC_RATES_5), req->u8Rates, params->basic_rates_len); } } /* =============================================================================== * This function processes UM_BSS_SET_BSS_REQ FW request * =============================================================================== * If we are in master serializer context we need to prevent set chan for the master core * (otherwize there will be a dead-lock) but still the actual FW SET_BSS message should be * sent for the relevant core. */ int __MTLK_IFUNC mtlk_core_set_bss(mtlk_core_t *core, mtlk_core_t *context_core, UMI_SET_BSS *fw_params) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_SET_BSS *req; int res = MTLK_ERR_OK; uint8 vap_id = mtlk_vap_get_id(core->vap_handle); mtlk_pdb_t *param_db_core = mtlk_vap_get_param_db(core->vap_handle); int twt_operation_mode = wave_pdb_get_int(param_db_core, PARAM_DB_CORE_TWT_OPERATION_MODE); uint8 mbssIdNumOfVapsInGroup = wave_pdb_get_int(param_db_core, PARAM_DB_CORE_MBSSID_NUM_VAPS_IN_GROUP); MTLK_ASSERT(fw_params); MTLK_ASSERT(TRUE >= twt_operation_mode); /* prepare msg for the FW */ if (!(man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), &res))) { ELOG_DD("CID-%04x: UM_BSS_SET_BSS_REQ init failed, err=%i", mtlk_vap_get_oid(core->vap_handle), res); res = MTLK_ERR_NO_RESOURCES; goto end; } man_entry->id = UM_BSS_SET_BSS_REQ; man_entry->payload_size = sizeof(*req); req = (UMI_SET_BSS *) man_entry->payload; /* copy input structure and setup vapId */ *req = *fw_params; req->vapId = vap_id; req->twtOpreationMode = twt_operation_mode; req->mbssIdNumOfVapsInGroup = mbssIdNumOfVapsInGroup; req->fixedMcsVapManagement = (uint8)_core_management_frames_rate_select(core); /* temporary hardcode bss color always to 4 */ { req->u8HE_Bss_Color = 4u; ILOG0_D("UMI_SET_BSS->u8HE_Bss_Color:%d", req->u8HE_Bss_Color); } ILOG2_D("UMI_SET_BSS->mbssIdNumOfVapsInGroup:%d", req->mbssIdNumOfVapsInGroup); finish_and_prevent_fw_set_chan(context_core, TRUE); /* set_bss is a "process", so need this; core is the core on which we're running */ mtlk_dump(2, req, sizeof(*req), "dump of UMI_SET_BSS:"); /* send message to FW */ res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); /* process result */ if (res != MTLK_ERR_OK) ELOG_DD("CID-%04x: UM_BSS_SET_BSS_REQ send failed, err=%i", mtlk_vap_get_oid(core->vap_handle), res); else if (mtlk_core_get_net_state(core) != NET_STATE_CONNECTED && MTLK_ERR_OK != (res = mtlk_core_set_net_state(core, NET_STATE_CONNECTED))) { ELOG_D("CID-%04x: Failed to switch core to state CONNECTED", mtlk_vap_get_oid(core->vap_handle)); } if (NULL != man_entry) mtlk_txmm_msg_cleanup(&man_msg); end: finish_and_prevent_fw_set_chan(context_core, FALSE); return res; } /* This function should be called from master serializer context */ static int _core_change_bss_by_params(mtlk_core_t *master_core, struct mtlk_bss_parameters *params) { mtlk_core_t *core = NULL; UMI_SET_BSS fw_request; int res = MTLK_ERR_OK; mtlk_pdb_t *param_db_core = NULL; mtlk_vap_handle_t vap_handle; wave_radio_t *radio; MTLK_ASSERT(master_core == mtlk_core_get_master(master_core)); /* Prevent set bss while in block_tx */ if (mtlk_core_is_block_tx_mode(master_core)) { res = MTLK_ERR_NOT_READY; goto end; } /* Prevent set bss while in scan */ if (mtlk_core_is_in_scan_mode(master_core)) { res = MTLK_ERR_RETRY; goto end; } if (MTLK_ERR_OK != mtlk_vap_manager_get_vap_handle(mtlk_vap_get_manager(master_core->vap_handle), params->vap_id, &vap_handle)) { res = MTLK_ERR_VALUE; goto end; } core = mtlk_vap_get_core (vap_handle); param_db_core = mtlk_vap_get_param_db(core->vap_handle); radio = wave_vap_radio_get(core->vap_handle); if (core->net_state != NET_STATE_ACTIVATING && core->net_state != NET_STATE_CONNECTED) goto end; if (mtlk_vap_is_ap(core->vap_handle)) { if (!wave_core_sync_hostapd_done_get(core)) { ILOG1_D("CID-%04x: HOSTAPD STA database is not synced", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto end; } /* Update ap_isolate parameter */ wave_pdb_set_int(param_db_core, PARAM_DB_CORE_AP_FORWARDING, !params->ap_isolate); /* Update ht_protection value if it was changed earlier by iwpriv */ if (MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_IWPRIV_FORCED) & PARAM_DB_CORE_IWPRIV_FORCED_HT_PROTECTION_FLAG) { params->use_cts_prot = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_HT_PROTECTION); } } else { wave_pdb_set_int(param_db_core, PARAM_DB_CORE_AP_FORWARDING, FALSE); } /* Fill UMI_SET_BSS FW request */ _mtlk_core_fill_set_bss_request(core, &fw_request, params); /* Process UM_BSS_SET_BSS_REQ */ res = mtlk_core_set_bss(core, master_core, &fw_request); /* Update params db */ if (MTLK_ERR_OK == res) _mtlk_core_update_bss_params(core, &fw_request, params); end: return res; } /* This function should be called from master serializer context */ static int _core_change_bss (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *master_core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; struct mtlk_bss_parameters *params; unsigned params_size; int res = MTLK_ERR_OK; MTLK_ASSERT(sizeof(mtlk_clpb_t *) == data_size); params = mtlk_clpb_enum_get_next(clpb, &params_size); MTLK_CLPB_TRY(params, params_size) res = _core_change_bss_by_params(master_core, params); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_send_stop_vap_traffic(struct nic *nic) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_STOP_VAP_TRAFFIC *req; int net_state = mtlk_core_get_net_state(nic); unsigned vap_id = mtlk_vap_get_id(nic->vap_handle); int result = MTLK_ERR_OK; ILOG0_DD("STOP_VAP_TRAFFIC VapID=%u, net_state=%i", vap_id, net_state); if (net_state == NET_STATE_HALTED) { /* Do not send anything to halted MAC or if STA hasn't been connected */ clean_all_sta_on_disconnect(nic); return MTLK_ERR_OK; } /* we switch the states beforehand because this does some checks; we'll fix the state if we fail */ if ((result = mtlk_core_set_net_state(nic, NET_STATE_DEACTIVATING)) != MTLK_ERR_OK) { goto FINISH; } man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(nic->vap_handle), &result); if (man_entry == NULL) { ELOG_D("CID-%04x: Can't init STOP_VAP_TRAFFIC request due to the lack of MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); goto FINISH; } core_ap_disconnect_all(nic); man_entry->id = UM_MAN_STOP_VAP_TRAFFIC_REQ; man_entry->payload_size = sizeof(*req); req = (UMI_STOP_VAP_TRAFFIC *) man_entry->payload; req->u16Status = HOST_TO_MAC16(UMI_OK); req->vapId = vap_id; mtlk_dump(2, req, sizeof(*req), "dump of UMI_STOP_VAP_TRAFFIC:"); result = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (result != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't send STOP_VAP_TRAFFIC request to VAP (err=%d)", mtlk_vap_get_oid(nic->vap_handle), result); mtlk_core_set_net_state(nic, net_state); /* restore previous net_state if we can */ goto FINISH; } if (MAC_TO_HOST16(req->u16Status) != UMI_OK) { WLOG_DD("CID-%04x: STOP_VAP_TRAFFIC failed in FW (status=%u)", mtlk_vap_get_oid(nic->vap_handle), MAC_TO_HOST16(req->u16Status)); result = MTLK_ERR_MAC; mtlk_core_set_net_state(nic, net_state); /* restore previous net_state if we can */ goto FINISH; } FINISH: if (man_entry) mtlk_txmm_msg_cleanup(&man_msg); return result; } static int _mtlk_core_send_vap_remove(struct nic *nic) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_REMOVE_VAP *req; int net_state = mtlk_core_get_net_state(nic); int result = MTLK_ERR_OK; uint8 vap_id = mtlk_vap_get_id(nic->vap_handle); if (net_state == NET_STATE_HALTED) { /* Do not send anything to halted MAC or if STA hasn't been connected */ clean_all_sta_on_disconnect(nic); return MTLK_ERR_OK; } man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(nic->vap_handle), &result); if (man_entry == NULL) { ELOG_D("CID-%04x: Can't send REMOVE_VAP request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); goto FINISH; } /* we switch the states beforehand because this does some checks; we'll fix the state if we fail */ if ((result = mtlk_core_set_net_state(nic, NET_STATE_READY)) != MTLK_ERR_OK) { goto FINISH; } man_entry->id = UM_MAN_REMOVE_VAP_REQ; /* the structs are identical so we could have not bothered with this... */ man_entry->payload_size = sizeof(*req); req = (UMI_REMOVE_VAP *) man_entry->payload; req->u16Status = HOST_TO_MAC16(UMI_OK); req->vapId = vap_id; mtlk_dump(2, req, sizeof(*req), "dump of UMI_REMOVE_VAP:"); result = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (result != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't send REMOVE_VAP request to VAP (err=%d)", mtlk_vap_get_oid(nic->vap_handle), result); mtlk_core_set_net_state(nic, net_state); /* restore previous net_state if we can */ goto FINISH; } if (MAC_TO_HOST16(req->u16Status) != UMI_OK) { WLOG_DD("CID-%04x: REMOVE_VAP failed in FW (status=%u)", mtlk_vap_get_oid(nic->vap_handle), MAC_TO_HOST16(req->u16Status)); result = MTLK_ERR_MAC; mtlk_core_set_net_state(nic, net_state); /* restore previous net_state if we can */ goto FINISH; } /* update disconnections statistics */ nic->pstats.num_disconnects++; #if IWLWAV_RTLOG_MAX_DLEVEL >= 1 { IEEE_ADDR mac_addr; MTLK_CORE_PDB_GET_MAC(nic, PARAM_DB_CORE_MAC_ADDR, &mac_addr); ILOG1_DDYD("CID-%04x: VapID %u at %Y disconnected (status %u)", mtlk_vap_get_oid(nic->vap_handle), vap_id, mac_addr.au8Addr, MAC_TO_HOST16(req->u16Status)); } #endif FINISH: if (man_entry) mtlk_txmm_msg_cleanup(&man_msg); return result; } static void _mtlk_core_flush_bcast_probe_resp_list (mtlk_core_t *nic); static void _mtlk_core_flush_ucast_probe_resp_list (mtlk_core_t *nic); static int _mtlk_core_add_ucast_probe_resp_entry (mtlk_core_t* nic, const IEEE_ADDR *addr); static int _mtlk_core_del_bcast_probe_resp_entry (mtlk_core_t *nic, const IEEE_ADDR *addr); static int _mtlk_core_del_ucast_probe_resp_entry (mtlk_core_t *nic, const IEEE_ADDR *addr); static BOOL _mtlk_core_ucast_probe_resp_entry_exists (mtlk_core_t *nic, const IEEE_ADDR *addr); void __MTLK_IFUNC mtlk_core_on_bss_tx (mtlk_core_t *nic, uint32 subtype) { MTLK_ASSERT(nic); MTLK_UNREFERENCED_PARAM(subtype); /* can be used in the future */ ILOG3_DD("CID-%04x: mgmt subtype %d", mtlk_vap_get_oid(nic->vap_handle), subtype); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_SENT); } void __MTLK_IFUNC mtlk_core_on_bss_cfm (mtlk_core_t *nic, IEEE_ADDR *peer, uint32 extra_processing, uint32 subtype, BOOL is_broadcast) { MTLK_ASSERT(nic); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_CONFIRMED); ILOG3_DDDYD("CID-%04x: type %d, subtype %d, peer %Y, is_broadcast %d", mtlk_vap_get_oid(nic->vap_handle), extra_processing, subtype, peer->au8Addr, (int)is_broadcast); if (extra_processing == PROCESS_NULL_DATA_PACKET && nic->waiting_for_ndp_ack) mtlk_osal_event_set(&nic->ndp_acked); if (subtype == MAN_TYPE_PROBE_RES) { if (is_broadcast) { _mtlk_core_del_bcast_probe_resp_entry(nic, peer); } else { _mtlk_core_del_ucast_probe_resp_entry(nic, peer); } } } /* Update counters for BSS reserved queue */ void __MTLK_IFUNC mtlk_core_on_bss_res_queued(mtlk_core_t *nic) { MTLK_ASSERT(nic); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_RES_QUEUE); } void __MTLK_IFUNC mtlk_core_on_bss_res_freed(mtlk_core_t *nic) { MTLK_ASSERT(nic); mtlk_core_dec_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_RES_QUEUE); } int __MTLK_IFUNC mtlk_wait_all_packets_confirmed(mtlk_core_t *nic) { #define SQ_WAIT_ALL_PACKETS_CFM_TIMEOUT_TOTAL (2 * MSEC_PER_SEC) #define SQ_WAIT_ALL_PACKETS_CFM_TIMEOUT_ONCE 10 int wait_cnt = (SQ_WAIT_ALL_PACKETS_CFM_TIMEOUT_TOTAL / SQ_WAIT_ALL_PACKETS_CFM_TIMEOUT_ONCE); int res = MTLK_ERR_OK; uint32 dat_uncfm, bss_sent, bss_cfm, bss_uncfm, bss_res_queue; for (;;) { dat_uncfm = mtlk_osal_atomic_get(&nic->unconfirmed_data); bss_sent = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_SENT); /* main ring */ bss_cfm = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_CONFIRMED); bss_uncfm = bss_sent - bss_cfm; bss_res_queue = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_RES_QUEUE); /* reserved queue */ ILOG4_DDDDDDD("CID-%04x: wait_cnt %3d, data:%d, bss:%d (sent:%d, confirmed:%d), bss_res_queue:%d", mtlk_vap_get_oid(nic->vap_handle), wait_cnt, dat_uncfm, bss_uncfm, bss_sent, bss_cfm, bss_res_queue); if (!(dat_uncfm | bss_uncfm | bss_res_queue)) break; /* all confirmed */ if (wait_cnt == 0) { mtlk_hw_t *hw = mtlk_vap_get_hw(nic->vap_handle); ELOG_DDDDDD("CID-%04x: Unconfirmed data:%d, bss:%d (sent:%d, confirmed:%d), bss_res_queue:%d", mtlk_vap_get_oid(nic->vap_handle), dat_uncfm, bss_uncfm, bss_sent, bss_cfm, bss_res_queue); if (dat_uncfm) mtlk_mmb_print_tx_dat_ring_info(hw); if (bss_uncfm) mtlk_mmb_print_tx_bss_ring_info(hw); if (bss_res_queue) mtlk_mmb_print_tx_bss_res_queue(hw); res = MTLK_ERR_CANCELED; break; } mtlk_osal_msleep(SQ_WAIT_ALL_PACKETS_CFM_TIMEOUT_ONCE); wait_cnt--; } return res; } static int _mtlk_mbss_deactivate_vap(mtlk_core_t *running_core, mtlk_core_t *nic) { int net_state = mtlk_core_get_net_state(nic); int res; ILOG2_DS("CID-%04x: net_state=%s", mtlk_vap_get_oid(nic->vap_handle), mtlk_net_state_to_string(nic->net_state)); finish_and_prevent_fw_set_chan(running_core, TRUE); /* remove_vap is a "process", so need this. Not sure about stop_vap_traffic */ if (net_state == NET_STATE_HALTED) { goto CORE_HALTED; } if (net_state == NET_STATE_CONNECTED) { if (nic->vap_in_fw_is_active) { res = _mtlk_core_send_stop_vap_traffic(nic); if (res != MTLK_ERR_OK) { goto FINISH; } } else { ILOG0_V("skip UM_MAN_STOP_VAP_TRAFFIC_REQ due vap is not active in fw"); if ((res = mtlk_core_set_net_state(nic, NET_STATE_DEACTIVATING)) != MTLK_ERR_OK) { goto FINISH; } } } if (mtlk_wait_all_packets_confirmed(nic)) { WLOG_D("CID-%04x: wait time for all MSDUs confirmation expired", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_FW; mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_RESET, NULL, 0); goto FINISH; } CORE_HALTED: cleanup_on_disconnect(nic); /* Don't wait with this for complete removal */ res = _mtlk_core_send_vap_remove(nic); mtlk_vap_set_stopped(nic->vap_handle); FINISH: finish_and_prevent_fw_set_chan(running_core, FALSE); if (1 >= mtlk_vap_manager_get_active_vaps_number(mtlk_vap_get_manager(nic->vap_handle))) { struct mtlk_chan_def *current_chandef = __wave_core_chandef_get(nic); if (!mtlk_core_rcvry_is_running(nic)) wv_cfg80211_on_core_down(mtlk_core_get_master(nic)); current_chandef->center_freq1 = 0; } if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Error during VAP deactivation", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_FW; /* FIXME Are we really supposed to halt the FW or just pretend we did? mtlk_core_set_net_state(nic, NET_STATE_HALTED); */ } nic->vap_in_fw_is_active = FALSE; return res; } int mtlk_mbss_send_vap_db_del(struct nic *nic) { mtlk_txmm_data_t *man_entry = NULL; mtlk_txmm_msg_t man_msg; int result = MTLK_ERR_OK; UMI_VAP_DB_OP *pRemoveRequest; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(nic->vap_handle), &result); if (man_entry == NULL) { ELOG_D("CID-%04x: Can't send VAP_DB DEL request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); goto FINISH; } man_entry->id = UM_MAN_VAP_DB_REQ; man_entry->payload_size = sizeof (UMI_VAP_DB_OP); pRemoveRequest = (UMI_VAP_DB_OP *)(man_entry->payload); pRemoveRequest->u16Status = MTLK_ERR_OK; pRemoveRequest->u8OperationCode = VAP_OPERATION_DEL; pRemoveRequest->u8VAPIdx = mtlk_vap_get_id(nic->vap_handle); result = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (result != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't send VAP_DB DEL request to MAC (err=%d)", mtlk_vap_get_oid(nic->vap_handle), result); goto FINISH; } if (pRemoveRequest->u16Status != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Error returned for VAP DB DEL request to MAC (err=%d)", mtlk_vap_get_oid(nic->vap_handle), pRemoveRequest->u16Status); result = MTLK_ERR_UMI; goto FINISH; } FINISH: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return result; } /* FIXME this is a station only thing and has to be reworked with ADD_VAP, etc. */ static int mtlk_send_activate (struct nic *nic) { mtlk_txmm_data_t* man_entry = NULL; mtlk_txmm_msg_t activate_msg; int channel, bss_type; mtlk_pdb_size_t essid_len; UMI_ACTIVATE_HDR *areq; int result = MTLK_ERR_OK; wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); MTLK_ASSERT(!mtlk_vap_is_ap(nic->vap_handle)); if (!mtlk_vap_is_ap(nic->vap_handle)) { bss_type = CFG_INFRA_STATION; } else { bss_type = CFG_ACCESS_POINT; } /* Start activation request */ ILOG2_D("CID-%04x: Start activation", mtlk_vap_get_oid(nic->vap_handle)); man_entry = mtlk_txmm_msg_init_with_empty_data(&activate_msg, mtlk_vap_get_txmm(nic->vap_handle), &result); if (man_entry == NULL) { ELOG_D("CID-%04x: Can't send ACTIVATE request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); return result; } man_entry->id = UM_MAN_ACTIVATE_REQ; man_entry->payload_size = mtlk_get_umi_activate_size(); areq = mtlk_get_umi_activate_hdr(man_entry->payload); memset(areq, 0, sizeof(UMI_ACTIVATE_HDR)); channel = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_CHANNEL_CUR); /* for AP channel 0 means "use AOCS", but for STA channel must be set implicitly - we cannot send 0 to MAC in activation request */ if ((channel == 0) && !mtlk_vap_is_master_ap(nic->vap_handle)) { ELOG_D("CID-%04x: Channel must be specified for station or Virtual AP", mtlk_vap_get_oid(nic->vap_handle)); result = MTLK_ERR_NOT_READY; goto FINISH; } essid_len = sizeof(areq->sSSID.acESSID); result = MTLK_CORE_PDB_GET_BINARY(nic, PARAM_DB_CORE_ESSID, areq->sSSID.acESSID, &essid_len); if (MTLK_ERR_OK != result) { ELOG_D("CID-%04x: ESSID parameter has wrong length", mtlk_vap_get_oid(nic->vap_handle)); goto FINISH; } if (0 == essid_len) { ELOG_D("CID-%04x: ESSID is not set", mtlk_vap_get_oid(nic->vap_handle)); result = MTLK_ERR_NOT_READY; goto FINISH; } /* Do not allow to activate if BSSID isn't set for the STA. Probably it * is worth to not allow this on AP as well? */ if (!mtlk_vap_is_ap(nic->vap_handle) && (0 == MTLK_CORE_HOT_PATH_PDB_CMP_MAC(nic, PARAM_DB_CORE_BSSID, mtlk_osal_eth_zero_addr))) { ELOG_D("CID-%04x: BSSID is not set", mtlk_vap_get_oid(nic->vap_handle)); result = MTLK_ERR_NOT_READY; goto FINISH; } if (!mtlk_vap_is_ap(nic->vap_handle)) { core_cfg_sta_country_code_set_default_on_activate(nic); } wave_pdb_get_mac(mtlk_vap_get_param_db(nic->vap_handle), PARAM_DB_CORE_BSSID, areq->sBSSID.au8Addr); areq->sSSID.u8Length = essid_len; areq->u16RestrictedChannel = HOST_TO_MAC16(channel); areq->u16BSStype = HOST_TO_MAC16(bss_type); areq->isHiddenBssID = nic->slow_ctx->cfg.is_hidden_ssid; ILOG0_D("CID-%04x: Activation started with parameters:", mtlk_vap_get_oid(nic->vap_handle)); mtlk_core_configuration_dump(nic); /* get data from Regulatory table: Availability Check Time, Scan Type */ ILOG2_DD("CurrentSpectrumMode = %d\n" "RFSpectrumMode = %d", WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SPECTRUM_MODE), WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_PROG_MODEL_SPECTRUM_MODE)); /* TODO- add SmRequired to 11d table !! */ /* ILOG1_SSDY("activating (mode:%s, essid:\"%s\", chan:%d, bssid %Y)...", bss_type_str, nic->slow_ctx->essid, channel, nic->slow_ctx->bssid); */ /*********************** END NEW **********************************/ if (mtlk_core_set_net_state(nic, NET_STATE_ACTIVATING) != MTLK_ERR_OK) { ELOG_D("CID-%04x: Failed to switch core to state ACTIVATING", mtlk_vap_get_oid(nic->vap_handle)); result = MTLK_ERR_NOT_READY; goto FINISH; } nic->activation_status = FALSE; mtlk_osal_event_reset(&nic->slow_ctx->connect_event); mtlk_dump(3, areq, sizeof(UMI_ACTIVATE_HDR), "dump of UMI_ACTIVATE_HDR:"); result = mtlk_txmm_msg_send_blocked(&activate_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (result != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Cannot send activate request due to TXMM err#%d", mtlk_vap_get_oid(nic->vap_handle), result); goto FINISH; } if (areq->u16Status != UMI_OK && areq->u16Status != UMI_ALREADY_ENABLED) { WLOG_DD("CID-%04x: Activate VAP request failed with code %d", mtlk_vap_get_oid(nic->vap_handle), areq->u16Status); result = MTLK_ERR_UNKNOWN; goto FINISH; } /* now wait and handle connection event if any */ ILOG4_V("Timestamp before network status wait..."); result = mtlk_osal_event_wait(&nic->slow_ctx->connect_event, CONNECT_TIMEOUT); if (result == MTLK_ERR_TIMEOUT) { /* MAC is dead? Either fix MAC or increase timeout */ ELOG_DS("CID-%04x: Timeout reached while waiting for %s event", mtlk_vap_get_oid(nic->vap_handle), mtlk_vap_is_ap(nic->vap_handle) ? "BSS creation" : "connection"); (void)mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_RESET, NULL, 0); goto CLEANUP; } else if (nic->activation_status) { mtlk_core_set_net_state(nic, NET_STATE_CONNECTED); mtlk_vap_manager_notify_vap_activated(mtlk_vap_get_manager(nic->vap_handle)); nic->is_stopped = FALSE; ILOG1_SDDDS("%s: Activated2: is_stopped=%u, is_stopping=%u, is_iface_stopping=%u, net_state=%s", mtlk_df_get_name(mtlk_vap_get_df(nic->vap_handle)), nic->is_stopped, nic->is_stopping, nic->is_iface_stopping, mtlk_net_state_to_string(mtlk_core_get_net_state(nic))); } else { ELOG_D("CID-%04x: Activate failed. Switch to NET_STATE_READY", mtlk_vap_get_oid(nic->vap_handle)); mtlk_core_set_net_state(nic, NET_STATE_READY); goto CLEANUP; } FINISH: if (result != MTLK_ERR_OK && mtlk_core_get_net_state(nic) != NET_STATE_READY) mtlk_core_set_net_state(nic, NET_STATE_READY); CLEANUP: mtlk_txmm_msg_cleanup(&activate_msg); return result; } /* FIXME this also seems to be a station only thing and has to be reworked */ static int _mtlk_core_connect_sta (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; int res = MTLK_ERR_OK; bss_data_t bss_found; int freq; IEEE_ADDR *addr; uint32 addr_size; uint32 new_spectrum_mode; wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); addr = mtlk_clpb_enum_get_next(clpb, &addr_size); MTLK_ASSERT(NULL != addr); MTLK_ASSERT(sizeof(*addr) == addr_size); if (!mtlk_clpb_check_data(addr, addr_size, sizeof(*addr), __FUNCTION__, __LINE__)) return MTLK_ERR_UNKNOWN; if (mtlk_vap_is_ap(nic->vap_handle)) { res = MTLK_ERR_NOT_SUPPORTED; goto end_activation; } if ( (mtlk_core_get_net_state(nic) != NET_STATE_READY) || mtlk_core_scan_is_running(nic) || mtlk_core_is_stopping(nic)) { ILOG1_V("Can't connect to AP - unappropriated state"); res = MTLK_ERR_NOT_READY; /* We shouldn't update current network mode in these cases */ goto end; } if (mtlk_cache_find_bss_by_bssid(&nic->slow_ctx->cache, addr, &bss_found, NULL) == 0) { ILOG1_V("Can't connect to AP - unknown BSS"); res = MTLK_ERR_PARAMS; goto end_activation; } /* store actual BSS data */ nic->slow_ctx->bss_data = bss_found; /* update regulation limits for the BSS */ if (core_cfg_get_dot11d(nic)) { core_cfg_sta_country_code_update_on_connect(nic, &bss_found.country_code); } WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_CHANNEL_CUR, bss_found.channel); /* save ESSID */ res = MTLK_CORE_PDB_SET_BINARY(nic, PARAM_DB_CORE_ESSID, bss_found.essid, strlen(bss_found.essid)); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Can't store ESSID (err=%d)", mtlk_vap_get_oid(nic->vap_handle), res); goto end_activation; } /* save BSSID so we can use it on activation */ wave_pdb_set_mac(mtlk_vap_get_param_db(nic->vap_handle), PARAM_DB_CORE_BSSID, addr); /* set bonding according to the AP */ WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_BONDING_MODE, bss_found.upper_lower); /* set current frequency band */ freq = channel_to_band(bss_found.channel); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_FREQ_BAND_CUR, freq); /* set current HT capabilities */ if (BSS_IS_WEP_ENABLED(&bss_found) && nic->slow_ctx->wep_enabled) { /* no HT is allowed for WEP connections */ MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_IS_HT_CUR, FALSE); } else { MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_IS_HT_CUR, (core_cfg_get_is_ht_cfg(nic) && bss_found.is_ht)); } /* for STA spectrum mode should be set according to our own HT capabilities */ if (core_cfg_get_is_ht_cur(nic) == 0) { /* e.g. if we connect to A/N AP, but STA is A then we should select 20MHz */ new_spectrum_mode = CW_20; } else { new_spectrum_mode = bss_found.spectrum; if (CW_40 == bss_found.spectrum) { uint32 sta_force_spectrum_mode = MTLK_CORE_PDB_GET_INT(nic, PARAM_DB_CORE_STA_FORCE_SPECTRUM_MODE); /* force set spectrum mode */ if (CW_20 == sta_force_spectrum_mode) { new_spectrum_mode = CW_20; } } } WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_SPECTRUM_MODE, new_spectrum_mode); ILOG1_DS("CID-%04x: Set SpectrumMode: %s MHz", mtlk_vap_get_oid(nic->vap_handle), mtlkcw2str(new_spectrum_mode)); /* previously set network mode shouldn't be overridden, * but in case it "MTLK_HW_BAND_BOTH" it need to be recalculated, this value is not * acceptable for MAC! */ if(MTLK_HW_BAND_BOTH == net_mode_to_band(core_cfg_get_network_mode_cur(nic))) { MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_NET_MODE_CUR, get_net_mode(freq, core_cfg_get_is_ht_cur(nic))); } if (mtlk_send_activate(nic) != MTLK_ERR_OK) { res = MTLK_ERR_NOT_READY; } end_activation: if (MTLK_ERR_OK != res) { /* rollback network mode */ MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_NET_MODE_CUR, core_cfg_get_network_mode_cfg(nic)); } end: return res; } static int _mtlk_sta_status_query(mtlk_handle_t hcore, const void* payload, uint32 size) { int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); uint8 *mac_addr = (uint8 *) payload; sta_entry *sta = NULL; int status; MTLK_ASSERT(ETH_ALEN == size); if (NET_STATE_HALTED == mtlk_core_get_net_state(core)) { /* Do nothing if halted */ return MTLK_ERR_OK; } sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, mac_addr); if (NULL == sta) { ILOG1_Y("STA not found during status query: %Y", mac_addr); return MTLK_ERR_NO_ENTRY; } res = poll_client_req(core->vap_handle, sta, &status); mtlk_sta_decref(sta); /* De-reference by STA DB hash */ if (MTLK_ERR_OK != res) { ELOG_Y("Failed to poll STA %Y ", mac_addr); } return res; } static void __MTLK_IFUNC _mtlk_core_on_sta_keepalive (mtlk_handle_t usr_data, sta_entry *sta) { struct nic *nic = HANDLE_T_PTR(struct nic, usr_data); /* Skip scheduling because serializer is blocked during Recovery */ if (!wave_rcvry_mac_fatal_pending_get((mtlk_vap_get_hw(nic->vap_handle))) && !mtlk_core_rcvry_is_running(nic)) { _mtlk_process_hw_task(nic, SERIALIZABLE, _mtlk_sta_status_query, HANDLE_T(nic), &mtlk_sta_get_addr(sta)->au8Addr, ETH_ALEN); } } static int _mtlk_core_get_ap_capabilities (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_card_capabilities_t card_capabilities; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; wave_radio_t *radio; MTLK_ASSERT(mtlk_vap_is_master_ap(nic->vap_handle)); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); radio = wave_vap_radio_get(nic->vap_handle); MTLK_CFG_SET_ITEM(&card_capabilities, max_stas_supported, wave_radio_max_stas_get(radio)); MTLK_CFG_SET_ITEM(&card_capabilities, max_vaps_supported, wave_radio_max_vaps_get(radio)); return mtlk_clpb_push(clpb, &card_capabilities, sizeof(card_capabilities)); } static int _mtlk_core_cfg_init_mr_coex (mtlk_core_t *core) { int res; uint8 enabled, mode; if (MTLK_ERR_OK != mtlk_core_is_band_supported(core, UMI_PHY_TYPE_BAND_2_4_GHZ)) return MTLK_ERR_OK; res = mtlk_core_receive_coex_config(core, &enabled, &mode); if (MTLK_ERR_OK == res) { WAVE_RADIO_PDB_SET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_COEX_ENABLED, 0); WAVE_RADIO_PDB_SET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_COEX_MODE, 0); } return res; } static int _mtlk_core_receive_tx_power_limit_offset (mtlk_core_t *core, uint8 *power_limit_offset) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_TX_POWER_LIMIT *mac_msg; int res; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_SET_POWER_LIMIT_REQ; man_entry->payload_size = sizeof(UMI_TX_POWER_LIMIT); mac_msg = (UMI_TX_POWER_LIMIT *)man_entry->payload; mac_msg->getSetOperation = API_GET_OPERATION; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK == res) { *power_limit_offset = mac_msg->powerLimitOffset; } else{ ELOG_D("CID-%04x: Receive UM_MAN_SET_POWER_LIMIT_REQ failed", mtlk_vap_get_oid(core->vap_handle)); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_cfg_init_pw_lim_offset (mtlk_core_t *core) { int res; uint8 power_limit_offset; res = _mtlk_core_receive_tx_power_limit_offset(core, &power_limit_offset); if (MTLK_ERR_OK == res) WAVE_RADIO_PDB_SET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_TX_POWER_LIMIT_OFFSET, DBM_TO_POWER(power_limit_offset)); return res; } static int _mtlk_core_cfg_init_mcast (mtlk_core_t *core) { int res; uint8 mcast_flag; res = mtlk_core_receive_reliable_multicast(core, &mcast_flag); if (MTLK_ERR_OK == res) MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_RELIABLE_MCAST, mcast_flag); return res; } int mtlk_core_init_defaults (mtlk_core_t *core) { int res; _mtlk_core_cfg_init_mcast(core); if (mtlk_vap_is_master(core->vap_handle)) { mtlk_core_cfg_init_cca_adapt(core); mtlk_core_cfg_init_ire_ctrl(core); _mtlk_core_cfg_init_mr_coex(core); _mtlk_core_cfg_init_pw_lim_offset(core); } res = mtlk_core_send_iwpriv_config_to_fw(core); return res; } static void _mtlk_core_reset_pstat_traffic_cntrs(mtlk_core_t *core) { core->pstats.tx_bytes = 0; core->pstats.rx_bytes = 0; core->pstats.tx_packets = 0; core->pstats.rx_packets = 0; core->pstats.rx_multicast_packets = 0; } static void _mtlk_core_poll_stat_stop(mtlk_core_t *core) { mtlk_wss_poll_stat_stop(&core->poll_stat); } static void _mtlk_core_poll_stat_init(mtlk_core_t *core) { memset(&core->poll_stat_last, 0, sizeof(core->poll_stat_last)); mtlk_wss_poll_stat_init(&core->poll_stat, MTLK_CORE_CNT_POLL_STAT_NUM, &core->wss_hcntrs[MTLK_CORE_CNT_POLL_STAT_FIRST], &core->poll_stat_last[0]); } static void _mtlk_core_poll_stat_start(mtlk_core_t *core) { _mtlk_core_reset_pstat_traffic_cntrs(core); mtlk_wss_poll_stat_start(&core->poll_stat); } static BOOL _mtlk_core_poll_stat_is_started(mtlk_core_t *core) { return mtlk_wss_poll_stat_is_started(&core->poll_stat); } static void _mtlk_core_poll_stat_update (mtlk_core_t *core, uint32 *values, uint32 values_num) { mtlk_poll_stat_update_cntrs(&core->poll_stat, values, values_num); } static int _mtlk_core_activate (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_core_t *mcore = mtlk_vap_manager_get_master_core(mtlk_vap_get_manager(nic->vap_handle)); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_pdb_t *param_db_core = mtlk_vap_get_param_db(nic->vap_handle); wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); struct mtlk_ap_settings *aps; unsigned aps_size; int res; sta_db_cfg_t sta_db_cfg; MTLK_ASSERT(sizeof(mtlk_clpb_t *) == data_size); aps = mtlk_clpb_enum_get_next(clpb, &aps_size); MTLK_CLPB_TRY(aps, aps_size) { if (mtlk_vap_is_ap(nic->vap_handle)) { /* save these away for later restores, etc. */ MTLK_CORE_PDB_SET_BINARY(nic, PARAM_DB_CORE_ESSID, aps->essid, aps->essid_len); wave_pdb_set_int(param_db_core, PARAM_DB_CORE_HIDDEN_SSID, aps->hidden_ssid); MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_DTIM_PERIOD, aps->dtim_period); /* This is "per-interface", not per-VAP in hostapd, but we stick it into this VAP's DB anyway for simplicity */ WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_BEACON_PERIOD, aps->beacon_interval); } /* We used to check that the VAP is not up here but now it might be due to scan or * initial channels switch. Yet it may not have the BSS, so we need to keep working on it */ ILOG0_D("CID-%04x: open interface", mtlk_vap_get_oid(nic->vap_handle)); if (MTLK_ERR_OK != mtlk_eeprom_is_valid(mtlk_core_get_eeprom(nic))) { WLOG_D("CID-%04x: Interface cannot UP after EEPROM failure", mtlk_vap_get_oid(nic->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NOT_READY); } if (mtlk_vap_is_dut(nic->vap_handle)) { WLOG_D("CID-%04x: Interface cannot UP in DUT mode", mtlk_vap_get_oid(nic->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NOT_SUPPORTED); } if (!(mtlk_core_get_net_state(nic) & (NET_STATE_READY | NET_STATE_ACTIVATING)) || mtlk_core_scan_is_running(nic) || mtlk_core_is_stopping(nic)) { ELOG_D("CID-%04x: Failed to open - inappropriate state", mtlk_vap_get_oid(nic->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NOT_READY); } _mtlk_core_poll_stat_start(nic); res = mtlk_mbss_send_vap_activate(nic, __wave_core_chandef_get(mcore)->chan.band); if (mtlk_vap_is_ap(nic->vap_handle)) { if (BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_BRIDGE_MODE)){ wds_on_if_up(&nic->slow_ctx->wds_mng); } } if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Failed to activate the core", mtlk_vap_get_oid(nic->vap_handle)); MTLK_CLPB_EXIT(res); } /* CoC configuration */ if (1 >= mtlk_vap_manager_get_active_vaps_number(mtlk_vap_get_manager(nic->vap_handle))) { mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(nic); mtlk_coc_reset_antenna_params(coc_mgmt); (void)mtlk_coc_set_power_mode(coc_mgmt, mtlk_coc_get_auto_mode_cfg(coc_mgmt)); } /* interface is up - start timers */ sta_db_cfg.api.usr_data = HANDLE_T(nic); sta_db_cfg.api.on_sta_keepalive = _mtlk_core_on_sta_keepalive; sta_db_cfg.max_nof_stas = wave_radio_max_stas_get(radio); sta_db_cfg.parent_wss = nic->wss; mtlk_stadb_configure(&nic->slow_ctx->stadb, &sta_db_cfg); mtlk_stadb_start(&nic->slow_ctx->stadb); } MTLK_CLPB_FINALLY(res) { return mtlk_clpb_push_res(clpb, res); } MTLK_CLPB_END; } static int __mtlk_core_deactivate(mtlk_core_t *running_core, mtlk_core_t *nic) { mtlk_hw_t *hw; BOOL is_scan_rcvry; wave_rcvry_type_e rcvry_type; mtlk_scan_support_t *ss; int net_state = mtlk_core_get_net_state(nic); mtlk_vap_manager_t *vap_manager = mtlk_vap_get_manager(nic->vap_handle); int res = MTLK_ERR_OK; int deactivate_res = MTLK_ERR_OK; ILOG1_SDDDS("%s: Deactivating: is_stopped=%u, is_iface_stopping=%u, is_slave_ap=%u, net_state=%s", mtlk_df_get_name(mtlk_vap_get_df(nic->vap_handle)), nic->is_stopped, nic->is_iface_stopping, mtlk_vap_is_slave_ap(nic->vap_handle), mtlk_net_state_to_string(net_state)); if (nic->is_stopped) { /* Interface has already been stopped */ res = MTLK_ERR_OK; goto FINISH; } MTLK_ASSERT(0 != mtlk_vap_manager_get_active_vaps_number(mtlk_vap_get_manager(nic->vap_handle))); nic->chan_state = ST_LAST; hw = mtlk_vap_get_hw(nic->vap_handle); rcvry_type = wave_rcvry_type_current_get(hw); is_scan_rcvry = (RCVRY_NO_SCAN != wave_rcvry_scan_type_current_get(hw, vap_manager)); mtlk_osal_lock_acquire(&nic->net_state_lock); nic->is_iface_stopping = TRUE; mtlk_osal_lock_release(&nic->net_state_lock); _mtlk_core_poll_stat_stop(nic); ss = __wave_core_scan_support_get(running_core); if (mtlk_vap_is_master(nic->vap_handle)) { mtlk_df_t *df = mtlk_vap_get_df(nic->vap_handle); mtlk_df_user_t *df_user = mtlk_df_get_user(df); struct mtlk_chan_def *ccd = __wave_core_chandef_get(nic); ccd->sb_dfs.sb_dfs_bw = MTLK_SB_DFS_BW_NORMAL; mtlk_core_cfg_set_block_tx(nic, 0); if (!mtlk_osal_timer_is_stopped(&nic->slow_ctx->cac_timer)) { mtlk_osal_timer_cancel_sync(&nic->slow_ctx->cac_timer); if ((RCVRY_TYPE_FAST == rcvry_type) || (RCVRY_TYPE_FULL == rcvry_type)) { ILOG1_D("CID-%04x: Cancel CAC-timer due to Recovery w/o Kernel and hostapd notification", mtlk_vap_get_oid(nic->vap_handle)); wave_rcvry_restart_cac_set(hw, vap_manager, TRUE); } else { struct net_device *ndev = mtlk_df_user_get_ndev(df_user); ILOG1_D("CID-%04x: Aborting the CAC", mtlk_vap_get_oid(nic->vap_handle)); wv_cfg80211_cac_event(ndev, ccd, 0); /* 0 means it didn't finish, i.e., was aborted */ } } if (ss->dfs_debug_params.debug_chan) ss->dfs_debug_params.switch_in_progress = FALSE; if (is_scan_rcvry) { pause_or_prevent_scan(nic); if (ss->set_chan_man_msg.data) { mtlk_txmm_msg_cleanup(&ss->set_chan_man_msg); ss->set_chan_man_msg.data = NULL; } } } if (!is_scan_rcvry) { mtlk_df_user_t *df_user = mtlk_df_get_user(mtlk_vap_get_df(running_core->vap_handle)); if(ss->req.saved_request != NULL && ((struct cfg80211_scan_request *)ss->req.saved_request)->wdev == mtlk_df_user_get_wdev(df_user)) abort_scan_sync(mtlk_core_get_master(running_core)); /* this can be done many times, so no other checks */ } /* Force disconnect of all WDS peers */ if (mtlk_vap_is_ap(nic->vap_handle) && BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_BRIDGE_MODE)){ wds_on_if_down(&nic->slow_ctx->wds_mng); } if (!can_disconnect_now(nic, is_scan_rcvry)) { res = MTLK_ERR_RETRY; goto FINISH; } /* for all of these states we can at least remove the VAP. For connected will also do stop_vap_traffic before that */ if ((net_state & (NET_STATE_CONNECTED | NET_STATE_ACTIVATING | NET_STATE_DEACTIVATING)) || (net_state == NET_STATE_HALTED)) /* for cleanup after exception */ { deactivate_res = _mtlk_mbss_deactivate_vap(running_core, nic); /* this will set the net_state */ /* For Fast and Full Recovery we will need to restore WEP or GTK keys. For Complete Recovery - hostapd will restore all keys */ if ((RCVRY_TYPE_FAST != rcvry_type) && (RCVRY_TYPE_FULL != rcvry_type)) { ILOG1_D("CID-%04x: Reset security", mtlk_vap_get_oid(nic->vap_handle)); reset_security_stuff(nic); } else { ILOG1_D("CID-%04x: Skip reset security", mtlk_vap_get_oid(nic->vap_handle)); } } MTLK_ASSERT(0 == mtlk_stadb_get_four_addr_sta_cnt(&nic->slow_ctx->stadb)); mtlk_stadb_stop(&nic->slow_ctx->stadb); /* Clearing cache */ mtlk_cache_clear(&nic->slow_ctx->cache); mtlk_qos_dscp_table_init(nic->dscp_table); net_state = mtlk_core_get_net_state(nic); /* see what the new net_state is */ mtlk_osal_lock_acquire(&nic->net_state_lock); nic->is_iface_stopping = FALSE; /* FIXME is_stopped should always be deduced from the net_state flags, a separate field is a nuisance */ nic->is_stopped = !(net_state & (NET_STATE_CONNECTED | NET_STATE_ACTIVATING | NET_STATE_DEACTIVATING)); mtlk_osal_lock_release(&nic->net_state_lock); if (nic->is_stopped) { mtlk_vap_manager_notify_vap_deactivated(vap_manager); ILOG1_D("CID-%04x: interface is stopped", mtlk_vap_get_oid(nic->vap_handle)); } ILOG1_SDDDS("%s: Deactivated: is_stopped=%u, is_stopping=%u, is_iface_stopping=%u, net_state=%s", mtlk_df_get_name(mtlk_vap_get_df(nic->vap_handle)), nic->is_stopped, nic->is_stopping, nic->is_iface_stopping, mtlk_net_state_to_string(mtlk_core_get_net_state(nic))); if ((0 == mtlk_vap_manager_get_active_vaps_number(vap_manager))) { mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(nic); mtlk_coc_auto_mode_disable(coc_mgmt); } if (mtlk_vap_is_master (nic->vap_handle)) { // re-enable in case we disabled during channel switch wave_radio_abilities_enable_vap_ops(nic->vap_handle); } if (0 == mtlk_vap_manager_get_active_vaps_number(vap_manager)) { __wave_core_chan_switch_type_set(nic, ST_NONE); } FINISH: /* If deactivate_res indicates an error - we must make sure that the close function will not reiterate. Therefore, we return specific error code in this case. */ if (MTLK_ERR_OK != deactivate_res) res = deactivate_res; return res; } int core_recovery_deactivate(mtlk_core_t *master_core, mtlk_core_t *nic) { return __mtlk_core_deactivate(master_core, nic); } static int _mtlk_core_deactivate (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); res = __mtlk_core_deactivate(core, core); return mtlk_clpb_push(clpb, &res, sizeof(res)); } /* Set peer AP beacon interval (relevant only for station role interface) * Should be called before UMI ADD STA for the peer AP */ static int _mtlk_beacon_man_set_beacon_interval_by_params(mtlk_core_t *core, mtlk_beacon_interval_t *mtlk_beacon_interval) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_BEACON_INTERVAL_t *pBeaconInterval = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; int res; MTLK_ASSERT(vap_handle); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_SET_BEACON_INTERVAL_REQ; man_entry->payload_size = sizeof(UMI_BEACON_INTERVAL_t); pBeaconInterval = (UMI_BEACON_INTERVAL_t *)(man_entry->payload); pBeaconInterval->beaconInterval = HOST_TO_MAC32(mtlk_beacon_interval->beacon_interval); pBeaconInterval->vapID = HOST_TO_MAC32(mtlk_beacon_interval->vap_id); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: beacon interval set failure (%i)", mtlk_vap_get_oid(vap_handle), res); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_beacon_man_set_beacon_interval (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_beacon_interval_t *mtlk_beacon_interval; uint32 res = MTLK_ERR_UNKNOWN; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mtlk_beacon_interval = mtlk_clpb_enum_get_next(clpb, NULL); MTLK_ASSERT(NULL != mtlk_beacon_interval); if (mtlk_beacon_interval) { res = _mtlk_beacon_man_set_beacon_interval_by_params(core, mtlk_beacon_interval); } return mtlk_clpb_push_res(clpb, res); } static int _mtlk_core_mgmt_tx (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; struct mgmt_tx_params *mtp; uint32 mtp_size; sta_entry *sta = NULL; const unsigned char *dst_addr; unsigned frame_ctrl, subtype; size_t frame_min_len = sizeof(frame_head_t); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mtp = mtlk_clpb_enum_get_next(clpb, &mtp_size); MTLK_CLPB_TRY(mtp, mtp_size) { if (PROCESS_EAPOL == mtp->extra_processing) frame_min_len = sizeof(struct ethhdr); if (mtp->len < frame_min_len) { ELOG_DDD("CID-%04x: Management Frame length %u is less than min %u", mtlk_vap_get_oid(core->vap_handle), mtp->len, frame_min_len); MTLK_CLPB_EXIT(MTLK_ERR_NOT_IN_USE); } dst_addr = WLAN_GET_ADDR1(mtp->buf); frame_ctrl = mtlk_wlan_pkt_get_frame_ctl((uint8 *)mtp->buf); subtype = (frame_ctrl & FRAME_SUBTYPE_MASK) >> FRAME_SUBTYPE_SHIFT; if (PROCESS_EAPOL == mtp->extra_processing) { struct ethhdr *ether_header = (struct ethhdr *) mtp->buf; sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, ether_header->h_dest); if (!sta) { MTLK_CLPB_EXIT(MTLK_ERR_NOT_HANDLED); } if (MTLK_PCKT_FLTR_DISCARD_ALL == mtlk_sta_get_packets_filter(sta)) { mtlk_sta_on_packet_dropped(sta, MTLK_TX_DISCARDED_DROP_ALL_FILTER); MTLK_CLPB_EXIT(MTLK_ERR_NOT_HANDLED); } } else if (PROCESS_NULL_DATA_PACKET == mtp->extra_processing) { uint16 sid = mtlk_core_get_sid_by_addr(core, (char *)dst_addr); if (DB_UNKNOWN_SID == sid) { ELOG_Y("Unknown SID when sending null data packet, STA address %Y", dst_addr); MTLK_CLPB_EXIT(MTLK_ERR_NOT_HANDLED); } } else if (PROCESS_MANAGEMENT == mtp->extra_processing) { ILOG2_DDY("CID-%04x: mgmt subtype %d, peer %Y", mtlk_vap_get_oid(core->vap_handle), subtype, dst_addr); if (MAN_TYPE_PROBE_RES == subtype) { /* Filtering the Probe Responses */ if (_mtlk_core_ucast_probe_resp_entry_exists(core, (IEEE_ADDR *)dst_addr)) { ILOG2_DY("CID-%04x: Don't send Probe Response to %Y", mtlk_vap_get_oid(core->vap_handle), dst_addr); MTLK_CLPB_EXIT(MTLK_ERR_OK); } else { /* * We are in serializer context. It is important to add entry to the list * prior to frame transmission is executed, as CFM may come nearly immediately * after HD is copied to the ring. The entry is removed from list in the * tasklet context, that might create a racing on entry removal. */ _mtlk_core_add_ucast_probe_resp_entry(core, (IEEE_ADDR *)dst_addr); } } } res = mtlk_mmb_bss_mgmt_tx(core->vap_handle, mtp->buf, mtp->len, mtp->channum, mtp->no_cck, mtp->dont_wait_for_ack, FALSE, /* unicast */ mtp->cookie, mtp->extra_processing, mtp->skb, FALSE, NTS_TID_USE_DEFAULT); if (res != MTLK_ERR_OK) { /* delete entry if TX failed */ if ((PROCESS_MANAGEMENT == mtp->extra_processing) && (MAN_TYPE_PROBE_RES == subtype)) { _mtlk_core_del_ucast_probe_resp_entry(core, (IEEE_ADDR *)dst_addr); } ILOG1_DSDDS("CID-%04x: Send %s frame error: type=%d, res=%d (%s)", mtlk_vap_get_oid(core->vap_handle), (mtp->extra_processing == PROCESS_MANAGEMENT) ? "management" : (mtp->extra_processing == PROCESS_EAPOL) ? "EAPOL" : (mtp->extra_processing == PROCESS_NULL_DATA_PACKET) ? "null data" : "unknown", mtp->extra_processing, res, mtlk_get_error_text(res)); if (sta) if (PROCESS_EAPOL == mtp->extra_processing) mtlk_sta_on_tx_packet_discarded_802_1x(sta); /* Count 802_1x discarded TX packets */ } else { if (sta) if (PROCESS_EAPOL == mtp->extra_processing) mtlk_sta_on_tx_packet_802_1x(sta); /* Count 802_1x TX packets */ } } MTLK_CLPB_FINALLY(res) { if (sta) mtlk_sta_decref(sta); /* De-reference of find */ return mtlk_clpb_push_res(clpb, res); } MTLK_CLPB_END; } static int _mtlk_core_mgmt_rx (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_core_handle_rx_bss_t *rx_bss; uint32 rx_bss_size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); rx_bss = mtlk_clpb_enum_get_next(clpb, &rx_bss_size); MTLK_CLPB_TRY(rx_bss, rx_bss_size) res = _mtlk_core_handle_rx_bss(core->vap_handle, rx_bss); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } int mtlk_handle_eapol(mtlk_vap_handle_t vap_handle, void *data, int data_len) { mtlk_df_t *df = mtlk_vap_get_df(vap_handle); mtlk_df_user_t *df_user = mtlk_df_get_user(df); struct wireless_dev *wdev; struct ethhdr *ether_header = (struct ethhdr *)data; mtlk_core_t *nic = mtlk_vap_get_core(vap_handle); sta_entry *sta = mtlk_stadb_find_sta(&nic->slow_ctx->stadb, ether_header->h_source); mtlk_nbuf_t *evt_nbuf; uint8 *cp; if (mtlk_vap_is_ap(vap_handle)) wdev = mtlk_df_user_get_wdev(df_user); else wdev = (struct wireless_dev *)mtlk_df_user_get_ndev(df_user)->ieee80211_ptr; MTLK_ASSERT(NULL != wdev); CAPWAP1(mtlk_hw_mmb_get_card_idx(mtlk_vap_get_hw(vap_handle)), data, data_len, 0, 0); if (sta) { /* If WDS WPS station sent EAPOL not to us, discard. */ if (MTLK_BFIELD_GET(sta->info.flags, STA_FLAGS_WDS_WPA)) { if (MTLK_CORE_HOT_PATH_PDB_CMP_MAC(nic, CORE_DB_CORE_MAC_ADDR, ether_header->h_dest)) { mtlk_sta_decref(sta); /* De-reference of find */ return MTLK_ERR_OK; } } mtlk_sta_on_rx_packet_802_1x(sta); /* Count 802_1x RX packets */ mtlk_sta_decref(sta); /* De-reference of find */ } evt_nbuf = wv_cfg80211_vendor_event_alloc(wdev, data_len, LTQ_NL80211_VENDOR_EVENT_RX_EAPOL); if (!evt_nbuf) { return MTLK_ERR_NO_MEM; } cp = mtlk_df_nbuf_put(evt_nbuf, data_len); wave_memcpy(cp, data_len, data, data_len); ILOG3_D("CID-%04x: EAPOL RX", mtlk_vap_get_oid(vap_handle)); mtlk_dump(3, evt_nbuf->data, evt_nbuf->len, "EAPOL RX vendor frame"); wv_cfg80211_vendor_event(evt_nbuf); return MTLK_ERR_OK; } static int _mtlk_core_set_mac_addr_wrapper (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; const char* mac_addr; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mac_addr = mtlk_clpb_enum_get_next(clpb, NULL); MTLK_ASSERT(NULL != mac_addr); if (!mac_addr) return MTLK_ERR_UNKNOWN; return core_cfg_set_mac_addr(nic, mac_addr); } static int _mtlk_core_get_mac_addr (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; IEEE_ADDR mac_addr; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_CORE_PDB_GET_MAC(core, PARAM_DB_CORE_MAC_ADDR, &mac_addr); return mtlk_clpb_push(clpb, &mac_addr, sizeof(mac_addr)); } static void _mtlk_core_reset_stats_internal (mtlk_core_t *core) { if (mtlk_vap_is_ap(core->vap_handle)) { mtlk_stadb_reset_cnts(&core->slow_ctx->stadb); } memset(&core->pstats, 0, sizeof(core->pstats)); } static int _mtlk_core_reset_stats (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; unsigned uint32_size; uint32 *reset_radar_cnt; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); reset_radar_cnt = mtlk_clpb_enum_get_next(clpb, &uint32_size); MTLK_CLPB_TRY(reset_radar_cnt, uint32_size) { if (*reset_radar_cnt) { mtlk_hw_reset_radar_cntr(mtlk_vap_get_hw(nic->vap_handle)); MTLK_CLPB_EXIT(res); } if (mtlk_core_get_net_state(nic) != NET_STATE_HALTED) { ELOG_D("CID-%04x: Can not reset stats when core is active", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_NOT_READY; } else { _mtlk_core_reset_stats_internal(nic); } } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_get_aocs_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; ILOG3_V("Faking"); return res; } static int _mtlk_core_set_aocs_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); ILOG3_V("Faking"); return mtlk_clpb_push(clpb, &res, sizeof(res)); } int mtlk_get_dbg_channel_availability_check_time(mtlk_scan_support_t* obj) { MTLK_ASSERT(NULL != obj); return obj->dfs_debug_params.cac_time; } int mtlk_get_dbg_channel_switch_count(mtlk_scan_support_t* obj) { MTLK_ASSERT(NULL != obj); return obj->dfs_debug_params.beacon_count; } int mtlk_get_dbg_nop(mtlk_scan_support_t* obj) { MTLK_ASSERT(NULL != obj); return obj->dfs_debug_params.nop; } static int _mtlk_core_get_dot11h_ap_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_11h_ap_cfg_t dot11h_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(!mtlk_vap_is_slave_ap(core->vap_handle)); memset(&dot11h_cfg, 0, sizeof(dot11h_cfg)); MTLK_CFG_SET_ITEM(&dot11h_cfg, debugChannelSwitchCount, mtlk_get_dbg_channel_switch_count(mtlk_core_get_scan_support(core))); MTLK_CFG_SET_ITEM(&dot11h_cfg, debugChannelAvailabilityCheckTime, mtlk_get_dbg_channel_availability_check_time(mtlk_core_get_scan_support(core))); MTLK_CFG_SET_ITEM(&dot11h_cfg, debugNOP, mtlk_get_dbg_nop(mtlk_core_get_scan_support(core))); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &dot11h_cfg, sizeof(dot11h_cfg)); } return res; } void mtlk_set_dbg_channel_availability_check_time(mtlk_scan_support_t* obj, int channel_availability_check_time) { /* wait for Radar Detection end */ wave_radio_radar_detect_end_wait(wave_vap_radio_get(obj->master_core->vap_handle)); obj->dfs_debug_params.cac_time = channel_availability_check_time; } void mtlk_set_dbg_channel_switch_count(mtlk_scan_support_t *obj, int channel_switch_count) { obj->dfs_debug_params.beacon_count = channel_switch_count; } void mtlk_set_dbg_nop(mtlk_scan_support_t *obj, uint32 nop) { obj->dfs_debug_params.nop = nop; } static int _mtlk_core_set_dot11h_ap_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_11h_ap_cfg_t *dot11h_cfg = NULL; uint32 dot11h_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(!mtlk_vap_is_slave_ap(core->vap_handle)); dot11h_cfg = mtlk_clpb_enum_get_next(clpb, &dot11h_cfg_size); MTLK_CLPB_TRY(dot11h_cfg, dot11h_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(dot11h_cfg, debugChannelSwitchCount, mtlk_set_dbg_channel_switch_count, (mtlk_core_get_scan_support(core), dot11h_cfg->debugChannelSwitchCount)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(dot11h_cfg, debugChannelAvailabilityCheckTime, mtlk_set_dbg_channel_availability_check_time, (mtlk_core_get_scan_support(core), dot11h_cfg->debugChannelAvailabilityCheckTime)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(dot11h_cfg, debugNOP, mtlk_set_dbg_nop, (mtlk_core_get_scan_support(core), dot11h_cfg->debugNOP)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_get_mibs_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_mibs_cfg_t mibs_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&mibs_cfg, 0, sizeof(mibs_cfg)); MTLK_CFG_SET_ITEM(&mibs_cfg, short_cyclic_prefix, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SHORT_CYCLIC_PREFIX)); if (mtlk_core_scan_is_running(core)) { ILOG1_D("%CID-%04x: Request eliminated due to running scan", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto err_get; } else { MTLK_CFG_SET_MIB_ITEM_BY_FUNC_VOID(&mibs_cfg, long_retry_limit, mtlk_get_mib_value_uint16, MIB_LONG_RETRY_LIMIT, &mibs_cfg.long_retry_limit, core); } err_get: res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &mibs_cfg, sizeof(mibs_cfg)); } return res; } static int _wave_core_get_phy_inband_power (mtlk_handle_t hcore, const void *data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_phy_inband_power_cfg_t power_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; wave_radio_t *radio; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); radio = wave_vap_radio_get(core->vap_handle); memset(&power_cfg, 0, sizeof(power_cfg)); MTLK_CFG_SET_ITEM_BY_FUNC(&power_cfg, power_data, mtlk_ccr_read_phy_inband_power, (mtlk_hw_mmb_get_ccr(mtlk_vap_get_hw(core->vap_handle)), wave_radio_id_get(radio), wave_radio_current_antenna_mask_get(radio), power_cfg.power_data.noise_estim, power_cfg.power_data.system_gain), res); return mtlk_clpb_push_res_data(clpb, res, &power_cfg, sizeof(power_cfg)); } static int _mtlk_core_get_country_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_country_cfg_t country_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&country_cfg, 0, sizeof(country_cfg)); /* TODO: This check must be dropped in favor of abilities */ if (mtlk_core_scan_is_running(core)) { ILOG1_D("%CID-%04x: Request eliminated due to running scan", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto err_get; } MTLK_CFG_SET_ITEM_BY_FUNC_VOID(&country_cfg, country_code, core_cfg_country_code_get, (core, &country_cfg.country_code)); err_get: res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &country_cfg, sizeof(country_cfg)); } return res; } static int _mtlk_core_set_bss_base_rate(mtlk_core_t *core, uint32 val) { MTLK_ASSERT(mtlk_vap_is_ap(core->vap_handle)); if (mtlk_core_get_net_state(core) != NET_STATE_READY) { return MTLK_ERR_NOT_READY; } if ((val != CFG_BASIC_RATE_SET_DEFAULT) && (val != CFG_BASIC_RATE_SET_EXTRA) && (val != CFG_BASIC_RATE_SET_LEGACY)) { return MTLK_ERR_PARAMS; } if ((val == CFG_BASIC_RATE_SET_LEGACY) && (MTLK_HW_BAND_2_4_GHZ != core_cfg_get_freq_band_cfg(core))) { return MTLK_ERR_PARAMS; } MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_BASIC_RATE_SET, val); return MTLK_ERR_OK; } static int _mtlk_core_set_mibs_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_txmm_t *txmm = mtlk_vap_get_txmm(core->vap_handle); mtlk_mibs_cfg_t *mibs_cfg = NULL; uint32 mibs_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mibs_cfg = mtlk_clpb_enum_get_next(clpb, &mibs_cfg_size); MTLK_CLPB_TRY(mibs_cfg, mibs_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(mibs_cfg, short_cyclic_prefix, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_SHORT_CYCLIC_PREFIX, mibs_cfg->short_cyclic_prefix)); if (mtlk_core_scan_is_running(core)) { ILOG1_D("CID-%04x: Request eliminated due to running scan", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NOT_READY); } else { MTLK_CFG_CHECK_ITEM_AND_CALL(mibs_cfg, long_retry_limit, mtlk_set_mib_value_uint16, (txmm, MIB_LONG_RETRY_LIMIT, mibs_cfg->long_retry_limit), res); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(mibs_cfg, long_retry_limit, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_LONG_RETRY_LIMIT, mibs_cfg->long_retry_limit)); } MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_set_country_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_country_cfg_t *country_cfg = NULL; uint32 country_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); country_cfg = mtlk_clpb_enum_get_next(clpb, &country_cfg_size); MTLK_CLPB_TRY(country_cfg, country_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() if (mtlk_core_scan_is_running(core)) { ILOG1_D("CID-%04x: Request eliminated due to running scan", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; break; } MTLK_CFG_CHECK_ITEM_AND_CALL(country_cfg, country_code, core_cfg_set_country_from_ui, (core, &country_cfg->country_code), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_set_wds_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_wds_cfg_t *wds_cfg; uint32 wds_cfg_size; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); wds_cfg = mtlk_clpb_enum_get_next(clpb, &wds_cfg_size); MTLK_CLPB_TRY(wds_cfg, wds_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(wds_cfg, peer_ap_addr_add, wds_usr_add_peer_ap, (&core->slow_ctx->wds_mng, &wds_cfg->peer_ap_addr_add), res); MTLK_CFG_CHECK_ITEM_AND_CALL(wds_cfg, peer_ap_addr_del, wds_usr_del_peer_ap, (&core->slow_ctx->wds_mng, &wds_cfg->peer_ap_addr_del), res); MTLK_CFG_GET_ITEM(wds_cfg, peer_ap_key_idx, core->slow_ctx->peerAPs_key_idx); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_get_wds_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_wds_cfg_t wds_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&wds_cfg, 0, sizeof(wds_cfg)); MTLK_CFG_SET_ITEM(&wds_cfg, peer_ap_key_idx, core->slow_ctx->peerAPs_key_idx); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &wds_cfg, sizeof(wds_cfg)); } return res; } static int _mtlk_core_get_wds_peer_ap (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_wds_cfg_t wds_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&wds_cfg, 0, sizeof(wds_cfg)); MTLK_CFG_SET_ITEM_BY_FUNC(&wds_cfg, peer_ap_vect, mtlk_wds_get_peer_vect, (&core->slow_ctx->wds_mng, &wds_cfg.peer_ap_vect), res); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &wds_cfg, sizeof(wds_cfg)); } return res; } static int _core_cfg_get_dot11d_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_dot11d_cfg_t dot11d_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&dot11d_cfg, 0, sizeof(dot11d_cfg)); MTLK_CFG_SET_ITEM(&dot11d_cfg, is_dot11d, core_cfg_get_dot11d(core)); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &dot11d_cfg, sizeof(dot11d_cfg)); } return res; } static int _mtlk_core_set_dot11d_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_dot11d_cfg_t *dot11d_cfg = NULL; uint32 dot11d_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); dot11d_cfg = mtlk_clpb_enum_get_next(clpb, &dot11d_cfg_size); MTLK_CLPB_TRY(dot11d_cfg, dot11d_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(dot11d_cfg, is_dot11d, core_cfg_set_is_dot11d, (core, dot11d_cfg->is_dot11d), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_get_mac_wdog_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_mac_wdog_cfg_t mac_wdog_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&mac_wdog_cfg, 0, sizeof(mac_wdog_cfg)); MTLK_CFG_SET_ITEM(&mac_wdog_cfg, mac_watchdog_timeout_ms, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_TIMEOUT_MS)); MTLK_CFG_SET_ITEM(&mac_wdog_cfg, mac_watchdog_period_ms, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_PERIOD_MS)); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &mac_wdog_cfg, sizeof(mac_wdog_cfg)); } return res; } static int _mtlk_core_set_mac_wdog_timeout(mtlk_core_t *core, uint16 value) { if (value < 1000) { return MTLK_ERR_PARAMS; } WAVE_RADIO_PDB_SET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_TIMEOUT_MS, value); return MTLK_ERR_OK; } static int _mtlk_core_set_mac_wdog_period(mtlk_core_t *core, uint32 value) { if (0 == value) { return MTLK_ERR_PARAMS; } WAVE_RADIO_PDB_SET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_PERIOD_MS, value); return MTLK_ERR_OK; } static int _mtlk_core_set_mac_wdog_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_mac_wdog_cfg_t *mac_wdog_cfg = NULL; uint32 mac_wdog_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mac_wdog_cfg = mtlk_clpb_enum_get_next(clpb, &mac_wdog_cfg_size); MTLK_CLPB_TRY(mac_wdog_cfg, mac_wdog_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(mac_wdog_cfg, mac_watchdog_timeout_ms, _mtlk_core_set_mac_wdog_timeout, (core, mac_wdog_cfg->mac_watchdog_timeout_ms), res); MTLK_CFG_CHECK_ITEM_AND_CALL(mac_wdog_cfg, mac_watchdog_period_ms, _mtlk_core_set_mac_wdog_period, (core, mac_wdog_cfg->mac_watchdog_period_ms), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_get_stadb_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_stadb_cfg_t stadb_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&stadb_cfg, 0, sizeof(stadb_cfg)); MTLK_CFG_SET_ITEM(&stadb_cfg, keepalive_interval, core->slow_ctx->stadb.keepalive_interval); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &stadb_cfg, sizeof(stadb_cfg)); } return res; } static int _mtlk_core_set_stadb_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_stadb_cfg_t *stadb_cfg = NULL; uint32 stadb_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); stadb_cfg = mtlk_clpb_enum_get_next(clpb, &stadb_cfg_size); MTLK_CLPB_TRY(stadb_cfg, stadb_cfg_size) { if (stadb_cfg->keepalive_interval == 0) { stadb_cfg->keepalive_interval = DEFAULT_KEEPALIVE_TIMEOUT; } MTLK_CFG_GET_ITEM(stadb_cfg, keepalive_interval, core->slow_ctx->stadb.keepalive_interval); } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static uint8 _mtlk_core_get_spectrum_mode(mtlk_core_t *core) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); if (mtlk_vap_is_ap(core->vap_handle)) { return WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SPECTRUM_MODE); } return MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_STA_FORCE_SPECTRUM_MODE); } static int _mtlk_core_get_channel (mtlk_core_t *core) { wave_radio_t *radio; MTLK_ASSERT(NULL != core); radio = wave_vap_radio_get(core->vap_handle); /* Retrieve PARAM_DB_RADIO_CHANNEL_CUR channel in case if there are active VAPs * Master VAP can be in NET_STATE_READY, but Slave VAP can be in NET_STATE_CONNECTED, * therefore PARAM_DB_RADIO_CHANNEL_CUR channel, belonged to Master VAP has correct value */ if ((NET_STATE_CONNECTED == mtlk_core_get_net_state(core)) || (0 != mtlk_vap_manager_get_active_vaps_number(mtlk_vap_get_manager(core->vap_handle)))) return WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_CHANNEL_CUR); else return WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_CHANNEL_CFG); } int __MTLK_IFUNC mtlk_core_get_channel (mtlk_core_t *core) { return _mtlk_core_get_channel(core); } static int _mtlk_core_set_up_rescan_exemption_time_sec (mtlk_core_t *core, uint32 value) { if (value == MAX_UINT32) { ; } else if (value < MAX_UINT32/ MSEC_PER_SEC) { value *= MSEC_PER_SEC; } else { /* In this case, the TS (which is measured in ms) can wrap around. */ return MTLK_ERR_PARAMS; } MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_UP_RESCAN_EXEMPTION_TIME, value); return MTLK_ERR_OK; } static uint32 _mtlk_core_get_up_rescan_exemption_time_sec (mtlk_core_t *core) { uint32 res = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_UP_RESCAN_EXEMPTION_TIME); if (res != MAX_UINT32) { res /= MSEC_PER_SEC; } return res; } static void _mtlk_core_fill_channel_params (mtlk_core_t *core, mtlk_core_channel_def_t *ch_def) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); ch_def->channel = _mtlk_core_get_channel(core); ch_def->spectrum_mode = _mtlk_core_get_spectrum_mode(core); ch_def->bonding = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_BONDING_MODE); } static void _mtlk_master_core_get_core_cfg (mtlk_core_t *core, mtlk_gen_core_cfg_t* pCore_Cfg) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); MTLK_CFG_CHECK_AND_SET_ITEM(pCore_Cfg, dbg_sw_wd_enable, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MAC_SOFT_RESET_ENABLE)); MTLK_CFG_CHECK_AND_SET_ITEM(pCore_Cfg, up_rescan_exemption_time, _mtlk_core_get_up_rescan_exemption_time_sec(core)); MTLK_CFG_CHECK_AND_SET_ITEM(pCore_Cfg, frequency_band_cur, core_cfg_get_freq_band_cur(core)); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC_VOID(pCore_Cfg, channel_def, _mtlk_core_fill_channel_params, (core, &pCore_Cfg->channel_def)); } static void _mtlk_slave_core_get_core_cfg (mtlk_core_t *core, mtlk_gen_core_cfg_t* pCore_Cfg) { _mtlk_master_core_get_core_cfg(mtlk_core_get_master(core), pCore_Cfg); } static uint32 __MTLK_IFUNC _core_get_network_mode_current(mtlk_core_t *core) { return core_cfg_get_network_mode_cur(core); } static int _mtlk_core_get_temperature_req(mtlk_core_t *core, uint32 *temperature, uint32 calibrate_mask) { int res = MTLK_ERR_OK; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_HDK_USER_DEMAND *pTemperature = NULL; int i; mtlk_df_t *df = mtlk_vap_get_df(core->vap_handle); mtlk_df_user_t *df_user = mtlk_df_get_user(df); struct wireless_dev *wdev = mtlk_df_user_get_wdev(df_user); BOOL cac_started = wdev->cac_started; mtlk_card_type_info_t card_type_info; mtlk_hw_get_prop(mtlk_vap_get_hwapi(core->vap_handle), MTLK_HW_PROP_CARD_TYPE_INFO, &card_type_info, sizeof(&card_type_info)); if (!_mtlk_card_is_asic(card_type_info)) { /* non ASIC, i.e. FPGA/Emul */ return MTLK_ERR_NOT_SUPPORTED; } if (!is_channel_certain(__wave_core_chandef_get(core))) { return MTLK_ERR_NOT_READY; } if (cac_started || core->chan_state != ST_NORMAL) { return MTLK_ERR_NOT_READY; } man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto FINISH; } res = mtlk_core_radio_enable_if_needed(core); if (MTLK_ERR_OK != res) goto FINISH; man_entry->id = UM_MAN_HDK_USER_DEMAND_REQ; man_entry->payload_size = sizeof(UMI_HDK_USER_DEMAND); pTemperature = (UMI_HDK_USER_DEMAND *)(man_entry->payload); memset(pTemperature, 0, sizeof(*pTemperature)); pTemperature->calibrateMask = HOST_TO_MAC32(calibrate_mask); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Get temperature failed (%i)", mtlk_vap_get_oid(core->vap_handle), res); goto FINISH; } for (i=0; i<NUM_OF_ANTS_FOR_TEMPERATURE; i++) { temperature[i] = MAC_TO_HOST32(pTemperature->temperature[i]); } res = mtlk_core_radio_disable_if_needed(core); FINISH: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static int _mtlk_core_set_calibrate_on_demand (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_temperature_sensor_t *temperature_cfg = NULL; uint32 temperature_cfg_size; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); temperature_cfg = mtlk_clpb_enum_get_next(clpb, &temperature_cfg_size); MTLK_CLPB_TRY(temperature_cfg, temperature_cfg_size) MTLK_CFG_SET_ITEM_BY_FUNC(temperature_cfg, temperature, _mtlk_core_get_temperature_req, (core, temperature_cfg->temperature, temperature_cfg->calibrate_mask), res); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_get_temperature (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_temperature_sensor_t temperature_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_CFG_SET_ITEM_BY_FUNC(&temperature_cfg, temperature, _mtlk_core_get_temperature_req, (core, temperature_cfg.temperature, 0), res); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &temperature_cfg, sizeof(temperature_cfg)); } return res; } static int _mtlk_core_get_essid (mtlk_core_t *core, mtlk_gen_core_cfg_t* pcore_cfg) { int res = MTLK_ERR_OK; mtlk_pdb_size_t str_size = sizeof(pcore_cfg->essid); /* Don't report ESSID to iw/iwconfig if we are not beaconing */ if (core_cfg_is_connected(core)) { res = MTLK_CORE_PDB_GET_BINARY(core, PARAM_DB_CORE_ESSID, pcore_cfg->essid, &str_size); } else { pcore_cfg->essid[0] = '\0'; } return res; } static int _mtlk_core_get_core_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_gen_core_cfg_t* pcore_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 str_size, core_cfg_size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); pcore_cfg = mtlk_clpb_enum_get_next(clpb, &core_cfg_size); MTLK_CLPB_TRY(pcore_cfg, core_cfg_size) MTLK_CFG_CHECK_AND_SET_ITEM(pcore_cfg, bridge_mode, MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_BRIDGE_MODE)); MTLK_CFG_CHECK_AND_SET_ITEM(pcore_cfg, ap_forwarding, MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_AP_FORWARDING)); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(pcore_cfg, reliable_multicast, mtlk_core_receive_reliable_multicast, (core, &pcore_cfg->reliable_multicast), res); if (NET_STATE_CONNECTED == mtlk_core_get_net_state(core)) { MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC_VOID(pcore_cfg, bssid, MTLK_CORE_PDB_GET_MAC, (core, PARAM_DB_CORE_BSSID, &pcore_cfg->bssid)); } else { MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC_VOID(pcore_cfg, bssid, ieee_addr_zero, (&pcore_cfg->bssid)); } MTLK_CFG_CHECK_AND_SET_ITEM(pcore_cfg, net_mode, _core_get_network_mode_current(core)); MTLK_CFG_CHECK_AND_SET_ITEM(pcore_cfg, bss_rate, MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_BASIC_RATE_SET)); str_size = sizeof(pcore_cfg->nickname); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(pcore_cfg, nickname, wave_pdb_get_string, (mtlk_vap_get_param_db(core->vap_handle), PARAM_DB_CORE_NICK_NAME, pcore_cfg->nickname, &str_size), res); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(pcore_cfg, essid, _mtlk_core_get_essid, (core, pcore_cfg), res); MTLK_CFG_CHECK_AND_SET_ITEM(pcore_cfg, is_hidden_ssid, core->slow_ctx->cfg.is_hidden_ssid); MTLK_CFG_CHECK_AND_SET_ITEM(pcore_cfg, is_bss_load_enable, MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_IS_BSS_LOAD_ENABLE)); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(pcore_cfg, admission_capacity, mtlk_core_receive_admission_capacity, (core, &pcore_cfg->admission_capacity), res); if (mtlk_vap_is_slave_ap(core->vap_handle)) { _mtlk_slave_core_get_core_cfg(core, pcore_cfg); } else { _mtlk_master_core_get_core_cfg(core, pcore_cfg); } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res_data(clpb, res, pcore_cfg, sizeof(*pcore_cfg)); MTLK_CLPB_END } static int _wave_core_network_mode_get (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; wave_core_network_mode_cfg_t network_mode_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* read config from internal db */ memset(&network_mode_cfg, 0, sizeof(network_mode_cfg)); MTLK_CFG_SET_ITEM(&network_mode_cfg, net_mode, (uint8)_core_get_network_mode_current(core)); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) res = mtlk_clpb_push(clpb, &network_mode_cfg, sizeof(network_mode_cfg)); return res; } BOOL __MTLK_IFUNC wave_hw_radio_band_cfg_is_single (mtlk_hw_t *hw); static int _wave_core_cdb_cfg_get (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; wave_core_cdb_cfg_t cdb; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* read config from internal db */ memset(&cdb, 0, sizeof(cdb)); MTLK_CFG_SET_ITEM(&cdb, cdb_cfg, (uint8)!wave_hw_radio_band_cfg_is_single(mtlk_vap_get_hw(core->vap_handle))); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) res = mtlk_clpb_push(clpb, &cdb, sizeof(cdb)); return res; } static int _mtlk_core_receive_dynamic_mc_rate (mtlk_core_t *core, uint32 *dynamic_mc_rate) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UmiDmrConfig_t *dmr_cfg = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; int res; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_DMR_CONFIG_REQ; man_entry->payload_size = sizeof(UmiDmrConfig_t); dmr_cfg = (UmiDmrConfig_t *)(man_entry->payload); dmr_cfg->getSetOperation = API_GET_OPERATION; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK == res) { *dynamic_mc_rate = MAC_TO_HOST32(dmr_cfg->dmrMode); } else { ELOG_DD("CID-%04x: Receiving UM_MAN_DMR_CONFIG_REQ failed, res %d", mtlk_vap_get_oid(vap_handle), res); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_get_master_specific_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_master_core_cfg_t *master_cfg = NULL; uint32 master_cfg_size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); master_cfg = mtlk_clpb_enum_get_next(clpb, &master_cfg_size); MTLK_CLPB_TRY(master_cfg, master_cfg_size) MTLK_CFG_CHECK_AND_SET_ITEM(master_cfg, acs_update_timeout, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_ACS_UPDATE_TO)); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(master_cfg, slow_probing_mask, mtlk_core_receive_slow_probing_mask, (core, &master_cfg->slow_probing_mask), res); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(master_cfg, mu_operation, mtlk_core_receive_mu_operation, (core, &master_cfg->mu_operation), res); MTLK_CFG_CHECK_AND_SET_ITEM(master_cfg, he_mu_operation, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_HE_MU_OPERATION)); MTLK_CFG_CHECK_AND_SET_ITEM(master_cfg, rts_mode_params.dynamic_bw, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_RTS_DYNAMIC_BW)); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(master_cfg, rts_mode_params, mtlk_core_receive_rts_mode, (core, &master_cfg->rts_mode_params), res); MTLK_CFG_CHECK_AND_SET_ITEM(master_cfg, bf_mode, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_BF_MODE)); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(master_cfg, txop_mode_params, mtlk_core_receive_txop_mode, (core, &master_cfg->txop_mode_params), res); MTLK_CFG_CHECK_AND_SET_ITEM(master_cfg, txop_mode_params.sid, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TXOP_SID)); MTLK_CFG_CHECK_AND_SET_ITEM(master_cfg, active_ant_mask, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_ACTIVE_ANT_MASK)); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC_VOID(master_cfg, fixed_pwr_params, wave_radio_fixed_pwr_params_get, (radio, &master_cfg->fixed_pwr_params)); MTLK_CFG_CHECK_AND_SET_ITEM(master_cfg, unconnected_sta_scan_time, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_UNCONNECTED_STA_SCAN_TIME)); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(master_cfg, fast_drop, mtlk_core_receive_fast_drop, (core, &master_cfg->fast_drop), res); MTLK_CFG_CHECK_AND_SET_ITEM_BY_FUNC(master_cfg, dynamic_mc_rate, _mtlk_core_receive_dynamic_mc_rate, (core, &master_cfg->dynamic_mc_rate), res); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res_data(clpb, res, master_cfg, sizeof(*master_cfg)); MTLK_CLPB_END } static int _mtlk_core_set_bridge_mode(mtlk_core_t *core, uint8 mode) { uint8 mode_old; mtlk_vap_manager_t* vap_manager = mtlk_vap_get_manager(core->vap_handle); /* check for only allowed values */ if (mode >= BR_MODE_LAST) { ELOG_DD("CID-%04x: Unsupported bridge mode value: %d.", mtlk_vap_get_oid(core->vap_handle), mode); return MTLK_ERR_PARAMS; } /* on AP only NONE and WDS allowed */ if (mtlk_vap_is_ap(core->vap_handle) && mode != BR_MODE_NONE && mode != BR_MODE_WDS) { ELOG_DD("CID-%04x: Unsupported (on AP) bridge mode value: %d.", mtlk_vap_get_oid(core->vap_handle), mode); return MTLK_ERR_PARAMS; } mode_old = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_BRIDGE_MODE); /* Nothing's changed */ if (mode_old == mode) return MTLK_ERR_OK; MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_BRIDGE_MODE, mode); ILOG1_DD("CID-%04x: bridge_mode set to %u", mtlk_vap_get_oid(core->vap_handle), mode); if (mtlk_vap_is_ap(core->vap_handle)){ if (mode == BR_MODE_WDS){ /* Enable WDS abilities */ wds_enable_abilities(&core->slow_ctx->wds_mng); mtlk_vap_manager_inc_wds_bridgemode(vap_manager); }else{ /* Disable WDS abilities */ wds_disable_abilities(&core->slow_ctx->wds_mng); } if ((mode != BR_MODE_WDS) && (mode_old == BR_MODE_WDS)) { wds_switch_off(&core->slow_ctx->wds_mng); mtlk_vap_manager_dec_wds_bridgemode(vap_manager); } } return MTLK_ERR_OK; } static int _mtlk_core_set_bss_load_enable(mtlk_core_t *core, uint32 value) { int res = MTLK_ERR_OK; mtlk_core_t *master_core; MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_IS_BSS_LOAD_ENABLE, value); master_core = mtlk_vap_manager_get_master_core(mtlk_vap_get_manager(core->vap_handle)); MTLK_ASSERT(NULL != master_core); /* update BSS load on/off for the current VAP through the master VAP serializer */ _mtlk_process_hw_task(master_core, SERIALIZABLE, wave_beacon_man_beacon_update, HANDLE_T(core), &value, 0); /* no need for parameters */ return res; } static int _mtlk_core_recovery_reliable_multicast (mtlk_core_t *core) { uint8 flag = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_RELIABLE_MCAST); if (MTLK_PARAM_DB_VALUE_IS_INVALID(flag)) return MTLK_ERR_OK; return mtlk_core_set_reliable_multicast(core, flag); } static int _mtlk_core_update_network_mode(mtlk_core_t *core, uint8 mode) { if(mtlk_core_scan_is_running(core)) { ELOG_D("CID-%04x: Cannot set network mode while scan is running", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_BUSY; } return mtlk_core_update_network_mode(core, mode); } static __INLINE int _mtlk_core_set_nickname_by_cfg(mtlk_core_t *core, mtlk_gen_core_cfg_t *core_cfg) { int res = wave_pdb_set_string(mtlk_vap_get_param_db(core->vap_handle), PARAM_DB_CORE_NICK_NAME, core_cfg->nickname); if (MTLK_ERR_OK == res) { ILOG2_DS("CID-%04x: Set NICKNAME to \"%s\"", mtlk_vap_get_oid(core->vap_handle), core_cfg->nickname); } return res; } int mtlk_core_set_essid_by_cfg(mtlk_core_t *core, mtlk_gen_core_cfg_t *core_cfg) { int res = MTLK_CORE_PDB_SET_BINARY(core, PARAM_DB_CORE_ESSID, core_cfg->essid, strlen(core_cfg->essid)); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Can't store ESSID (err=%d)", mtlk_vap_get_oid(core->vap_handle), res); } else { ILOG2_DS("CID-%04x: Set ESSID to \"%s\"", mtlk_vap_get_oid(core->vap_handle), core_cfg->essid); } return res; } static int _mtlk_core_set_radio_mode_req (mtlk_core_t *core, uint32 enable_radio) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_ENABLE_RADIO *pEnableRadio = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; wave_radio_t *radio = wave_vap_radio_get(vap_handle); int res; MTLK_ASSERT(vap_handle); ILOG0_DD("CID-%04x:EnableRadio FW request: Set %d mode", mtlk_vap_get_oid(vap_handle), enable_radio); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_ENABLE_RADIO_REQ; man_entry->payload_size = sizeof(UMI_ENABLE_RADIO); pEnableRadio = (UMI_ENABLE_RADIO *)(man_entry->payload); pEnableRadio->u32RadioOn = HOST_TO_MAC32(enable_radio); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Set Radio Enable failure (%i)", mtlk_vap_get_oid(vap_handle), res); } else { WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_MODE_CURRENT, enable_radio); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_check_and_set_radio_mode (mtlk_core_t *core, uint32 radio_mode) { int net_state; struct mtlk_chan_def *cd = __wave_core_chandef_get(core); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); if (mtlk_core_is_block_tx_mode(core)) { ILOG1_V("waiting for beacons"); return MTLK_ERR_OK; } if (mtlk_core_scan_is_running(core) || mtlk_core_is_in_scan_mode(core)) { ILOG1_V("scan is running"); return MTLK_ERR_OK; } if (ST_RSSI == __wave_core_chan_switch_type_get(core)) { ILOG1_V("Is in ST_RSSI channel switch mode"); return MTLK_ERR_OK; } net_state = mtlk_core_get_net_state(core); if (NET_STATE_ACTIVATING > net_state) { ILOG1_D("net state: %d", net_state); return MTLK_ERR_OK; } if (!is_channel_certain(cd)) { ILOG1_V("channel is not certain"); return MTLK_ERR_OK; } if (radio_mode == WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MODE_CURRENT)) { ILOG1_S("Radio already %s", radio_mode ? "ON" : "OFF"); return MTLK_ERR_OK; } return _mtlk_core_set_radio_mode_req(core, radio_mode); } static int _mtlk_core_set_core_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_gen_core_cfg_t *core_cfg = NULL; uint32 core_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); core_cfg = mtlk_clpb_enum_get_next(clpb, &core_cfg_size); MTLK_CLPB_TRY(core_cfg, core_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(core_cfg, bridge_mode, _mtlk_core_set_bridge_mode, (core, core_cfg->bridge_mode), res); MTLK_CFG_CHECK_ITEM_AND_CALL(core_cfg, reliable_multicast, mtlk_core_set_reliable_multicast, (core, !!core_cfg->reliable_multicast), res); MTLK_CFG_CHECK_ITEM_AND_CALL(core_cfg, up_rescan_exemption_time, _mtlk_core_set_up_rescan_exemption_time_sec, (core, core_cfg->up_rescan_exemption_time), res); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(core_cfg, ap_forwarding, wave_pdb_set_int, (mtlk_vap_get_param_db(core->vap_handle), PARAM_DB_CORE_AP_FORWARDING, !!core_cfg->ap_forwarding)); MTLK_CFG_CHECK_ITEM_AND_CALL(core_cfg, net_mode, _mtlk_core_update_network_mode, (core, core_cfg->net_mode), res); MTLK_CFG_CHECK_ITEM_AND_CALL(core_cfg, bss_rate, _mtlk_core_set_bss_base_rate, (core, core_cfg->bss_rate), res); MTLK_CFG_CHECK_ITEM_AND_CALL(core_cfg, nickname, _mtlk_core_set_nickname_by_cfg, (core, core_cfg), res); MTLK_CFG_GET_ITEM_BY_FUNC_VOID(core_cfg, essid, mtlk_core_set_essid_by_cfg, (core, core_cfg)); MTLK_CFG_GET_ITEM(core_cfg, is_hidden_ssid, core->slow_ctx->cfg.is_hidden_ssid); MTLK_CFG_CHECK_ITEM_AND_CALL(core_cfg, is_bss_load_enable, _mtlk_core_set_bss_load_enable, (core, core_cfg->is_bss_load_enable), res); MTLK_CFG_CHECK_ITEM_AND_CALL(core_cfg, admission_capacity, mtlk_core_set_admission_capacity, (core, core_cfg->admission_capacity), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int __MTLK_IFUNC _mtlk_core_set_he_mu_operation(mtlk_core_t *core, BOOL he_mu_operation) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_HE_MU_OPERATION_CONFIG *mu_operation_config = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; wave_radio_t *radio = wave_vap_radio_get(vap_handle); int res; ILOG2_V("Sending UMI_HE_MU_OPERATION_CONFIG"); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_HE_MU_OPERATION_CONFIG_REQ; man_entry->payload_size = sizeof(UMI_HE_MU_OPERATION_CONFIG); mu_operation_config = (UMI_HE_MU_OPERATION_CONFIG *)(man_entry->payload); mu_operation_config->enableHeMuOperation = he_mu_operation; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Set UMI_HE_MU_OPERATION_CONFIG failed (res = %d)", mtlk_vap_get_oid(vap_handle), res); } else { WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_HE_MU_OPERATION, he_mu_operation); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int __MTLK_IFUNC _mtlk_core_send_bf_mode (mtlk_core_t *core, BeamformingMode_e bf_mode) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_BF_MODE_CONFIG *bf_mode_config = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; wave_radio_t *radio = wave_vap_radio_get(vap_handle); int res; if ((BF_NUMBER_OF_MODES <= bf_mode) && (BF_STATE_AUTO_MODE != bf_mode)) { ELOG_DDDD("Wrong Beamforming mode: %u, must be from %u to %u or %u", bf_mode, BF_FIRST_STATE, BF_LAST_STATE, BF_STATE_AUTO_MODE); return MTLK_ERR_PARAMS; } ILOG2_V("Sending UM_MAN_BF_MODE_CONFIG_REQ"); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_BF_MODE_CONFIG_REQ; man_entry->payload_size = sizeof(UMI_BF_MODE_CONFIG); bf_mode_config = (UMI_BF_MODE_CONFIG *)(man_entry->payload); bf_mode_config->bfMode = bf_mode; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Sending UM_MAN_BF_MODE_CONFIG_REQ failed (res = %d)", mtlk_vap_get_oid(vap_handle), res); } else { WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_BF_MODE, bf_mode); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_send_fixed_pwr_cfg (mtlk_core_t *core, FixedPower_t *fixed_pwr_params) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; FixedPower_t *fixed_pwr_cfg = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; int res; ILOG2_V("Sending UM_MAN_FIXED_POWER_REQ"); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_FIXED_POWER_REQ; man_entry->payload_size = sizeof(FixedPower_t); fixed_pwr_cfg = (FixedPower_t *)(man_entry->payload); *fixed_pwr_cfg = *fixed_pwr_params; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Sending UM_MAN_FIXED_POWER_REQ failed (res = %d)", mtlk_vap_get_oid(vap_handle), res); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_store_and_send_fixed_pwr_cfg (mtlk_core_t *core, FixedPower_t *fixed_pwr_params) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(NULL != radio); if (MTLK_ERR_OK != WAVE_RADIO_PDB_SET_BINARY(radio, PARAM_DB_RADIO_FIXED_PWR, fixed_pwr_params, sizeof(*fixed_pwr_params))) ELOG_V("Failed to store Fixed TX management power parameters"); return _mtlk_core_send_fixed_pwr_cfg(core, fixed_pwr_params); } static int _mtlk_core_send_dynamic_mc_rate (mtlk_core_t *core, uint32 dynamic_mc_rate) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UmiDmrConfig_t *dmr_cfg = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; int res; ILOG2_V("Sending UM_MAN_DMR_CONFIG_REQ"); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_DMR_CONFIG_REQ; man_entry->payload_size = sizeof(UmiDmrConfig_t); dmr_cfg = (UmiDmrConfig_t *)(man_entry->payload); dmr_cfg->dmrMode = HOST_TO_MAC32(dynamic_mc_rate); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Sending UM_MAN_DMR_CONFIG_REQ failed (res = %d)", mtlk_vap_get_oid(vap_handle), res); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_store_and_send_dynamic_mc_rate (mtlk_core_t *core, uint32 dynamic_mc_rate) { int res = MTLK_ERR_PARAMS; MTLK_ASSERT(core); if ((UMI_DMR_DISABLED != dynamic_mc_rate) && (UMI_DMR_SUPPORTED_RATES != dynamic_mc_rate)) { ELOG_DDDD("CID-%04x: Wrong Dynamic multicast range value given (%d), must be %d or %d", mtlk_vap_get_oid(core->vap_handle), dynamic_mc_rate, UMI_DMR_DISABLED, UMI_DMR_SUPPORTED_RATES); return res; } WAVE_RADIO_PDB_SET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_DYNAMIC_MC_RATE, dynamic_mc_rate); return _mtlk_core_send_dynamic_mc_rate(core, dynamic_mc_rate); } static int _mtlk_core_set_master_specific_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_master_core_cfg_t *master_cfg = NULL; uint32 master_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); master_cfg = mtlk_clpb_enum_get_next(clpb, &master_cfg_size); MTLK_CLPB_TRY(master_cfg, master_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(master_cfg, acs_update_timeout, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_ACS_UPDATE_TO, master_cfg->acs_update_timeout)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(master_cfg, txop_mode_params, mtlk_core_send_txop_mode, (core, master_cfg->txop_mode_params.sid, master_cfg->txop_mode_params.mode)); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, mu_operation, mtlk_core_set_mu_operation, (core, !!master_cfg->mu_operation), res); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, he_mu_operation, _mtlk_core_set_he_mu_operation, (core, !!master_cfg->he_mu_operation), res); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, rts_mode_params, mtlk_core_set_rts_mode, (core, !!master_cfg->rts_mode_params.dynamic_bw, !!master_cfg->rts_mode_params.static_bw), res); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, bf_mode, _mtlk_core_send_bf_mode, (core, master_cfg->bf_mode), res); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, active_ant_mask, mtlk_core_cfg_send_active_ant_mask, (core, master_cfg->active_ant_mask), res); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, slow_probing_mask, mtlk_core_cfg_send_slow_probing_mask, (core, master_cfg->slow_probing_mask), res); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, fixed_pwr_params, _mtlk_core_store_and_send_fixed_pwr_cfg, (core, &master_cfg->fixed_pwr_params), res); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(master_cfg, unconnected_sta_scan_time, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_UNCONNECTED_STA_SCAN_TIME, master_cfg->unconnected_sta_scan_time)); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, fast_drop, mtlk_core_cfg_set_fast_drop, (core, master_cfg->fast_drop), res); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, erp_cfg, mtlk_core_send_erp_cfg, (core, &master_cfg->erp_cfg), res); MTLK_CFG_CHECK_ITEM_AND_CALL(master_cfg, dynamic_mc_rate, _mtlk_core_store_and_send_dynamic_mc_rate, (core, master_cfg->dynamic_mc_rate), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } #ifdef MTLK_LEGACY_STATISTICS /* MHI_STATISTICS */ static int _mtlk_core_get_mhi_stats (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_mhi_stats_t *mhi_stats; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_hw_t *hw; uint32 size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mhi_stats = mtlk_clpb_enum_get_next(clpb, &size); if ((NULL == mhi_stats) || (sizeof(*mhi_stats) != size)) { ELOG_D("CID-%04x: Failed to get parameters from CLPB", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_UNKNOWN; } hw = mtlk_vap_get_hw(core->vap_handle); MTLK_ASSERT(hw); return mtlk_hw_mhi_copy_stats(hw, mhi_stats->mhi_stats_data, &mhi_stats->mhi_stats_size); } #endif /* MTLK_LEGACY_STATISTICS */ /*------ PHY_RX_STATUS -------*/ static int _mtlk_core_get_phy_rx_status (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; wave_bin_data_t *phy_rx_status; uint32 size; int res; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); phy_rx_status = mtlk_clpb_enum_get_next(clpb, &size); MTLK_CLPB_TRY(phy_rx_status, size) res = mtlk_hw_copy_phy_rx_status(mtlk_vap_get_hw(core->vap_handle), phy_rx_status->buff, &phy_rx_status->size); MTLK_CLPB_FINALLY(res) return res; MTLK_CLPB_END; } static int _mtlk_core_get_eeprom_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_eeprom_cfg_t* eeprom_cfg = mtlk_osal_mem_alloc(sizeof(mtlk_eeprom_cfg_t), MTLK_MEM_TAG_EEPROM); mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); if(NULL == eeprom_cfg) { return MTLK_ERR_NO_MEM; } memset(eeprom_cfg, 0, sizeof(mtlk_eeprom_cfg_t)); MTLK_CFG_SET_ITEM_BY_FUNC_VOID(eeprom_cfg, eeprom_data, mtlk_eeprom_get_cfg, (mtlk_core_get_eeprom(core), &eeprom_cfg->eeprom_data)); MTLK_CFG_SET_ITEM_BY_FUNC_VOID(eeprom_cfg, eeprom_raw_data, mtlk_eeprom_get_raw_data, (mtlk_vap_get_hwapi(core->vap_handle), eeprom_cfg)); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, eeprom_cfg, sizeof(mtlk_eeprom_cfg_t)); } mtlk_osal_mem_free(eeprom_cfg); return res; } static int _mtlk_core_get_hstdb_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_hstdb_cfg_t hstdb_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&hstdb_cfg, 0, sizeof(hstdb_cfg)); MTLK_CFG_SET_ITEM(&hstdb_cfg, wds_host_timeout, core->slow_ctx->hstdb.wds_host_timeout); MTLK_CFG_SET_ITEM_BY_FUNC_VOID(&hstdb_cfg, address, mtlk_hstdb_get_local_mac, (&core->slow_ctx->hstdb, hstdb_cfg.address.au8Addr)); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &hstdb_cfg, sizeof(hstdb_cfg)); } return res; } static int _mtlk_core_set_hstdb_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_hstdb_cfg_t *hstdb_cfg = NULL; uint32 hstdb_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); hstdb_cfg = mtlk_clpb_enum_get_next(clpb, &hstdb_cfg_size); MTLK_CLPB_TRY(hstdb_cfg, hstdb_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_GET_ITEM(hstdb_cfg, wds_host_timeout, core->slow_ctx->hstdb.wds_host_timeout); MTLK_CFG_CHECK_ITEM_AND_CALL(hstdb_cfg, address, mtlk_hstdb_set_local_mac, (&core->slow_ctx->hstdb, hstdb_cfg->address.au8Addr), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_simple_cli (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t* man_entry = NULL; UmiDbgCliReq_t *mac_msg; mtlk_dbg_cli_cfg_t *UmiDbgCliReq; int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 clpb_data_size; mtlk_dbg_cli_cfg_t* clpb_data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); clpb_data = mtlk_clpb_enum_get_next(clpb, &clpb_data_size); MTLK_CLPB_TRY(clpb_data, clpb_data_size) UmiDbgCliReq = clpb_data; ILOG2_DDDDD("Simple CLI: Action %d, data1 %d, data2 %d, data3 %d, numOfArgs %d", UmiDbgCliReq->DbgCliReq.action, UmiDbgCliReq->DbgCliReq.data1, UmiDbgCliReq->DbgCliReq.data2, UmiDbgCliReq->DbgCliReq.data3, UmiDbgCliReq->DbgCliReq.numOfArgumets); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txdm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NO_RESOURCES); } man_entry->id = UM_DBG_CLI_REQ; man_entry->payload_size = sizeof(UmiDbgCliReq_t); mac_msg = (UmiDbgCliReq_t *)man_entry->payload; mac_msg->action = HOST_TO_MAC32(UmiDbgCliReq->DbgCliReq.action); mac_msg->numOfArgumets = HOST_TO_MAC32(UmiDbgCliReq->DbgCliReq.numOfArgumets); mac_msg->data1 = HOST_TO_MAC32(UmiDbgCliReq->DbgCliReq.data1); mac_msg->data2 = HOST_TO_MAC32(UmiDbgCliReq->DbgCliReq.data2); mac_msg->data3 = HOST_TO_MAC32(UmiDbgCliReq->DbgCliReq.data3); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); mtlk_txmm_msg_cleanup(&man_msg); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: DBG_CLI failed (res=%d)", mtlk_vap_get_oid(core->vap_handle), res); } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } int __MTLK_IFUNC _mtlk_core_fw_assert (mtlk_core_t *core, UMI_FW_DBG_REQ *req_msg) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t* man_entry = NULL; UMI_FW_DBG_REQ *mac_msg; int res = MTLK_ERR_OK; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txdm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_DBG_FW_DBG_REQ; man_entry->payload_size = sizeof(UMI_FW_DBG_REQ); mac_msg = (UMI_FW_DBG_REQ *)man_entry->payload; MTLK_STATIC_ASSERT(sizeof(mac_msg->debugType) == sizeof(uint8)); mac_msg->debugType = req_msg->debugType; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); mtlk_txmm_msg_cleanup(&man_msg); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: FW Debug message failed (res=%d)", mtlk_vap_get_oid(core->vap_handle), res); } return res; } BOOL __MTLK_IFUNC mtlk_core_rcvry_is_running (mtlk_core_t *core) { return (RCVRY_TYPE_UNDEF != wave_rcvry_type_current_get(mtlk_vap_get_hw(core->vap_handle))); } static int _mtlk_core_fw_debug (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_fw_debug_cfg_t *UmiFWDebugReq; int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 clpb_data_size; mtlk_fw_debug_cfg_t* clpb_data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); clpb_data = mtlk_clpb_enum_get_next(clpb, &clpb_data_size); MTLK_CLPB_TRY(clpb_data, clpb_data_size) { UmiFWDebugReq = (mtlk_fw_debug_cfg_t*)clpb_data; ILOG2_DD("CID-%04x: FW debug type: %d", mtlk_vap_get_oid(core->vap_handle), UmiFWDebugReq->FWDebugReq.debugType); wave_rcvry_set_to_dbg_mode(core->vap_handle); res = _mtlk_core_fw_assert(core, &UmiFWDebugReq->FWDebugReq); } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static __INLINE int _mtlk_core_set_radar_detect (mtlk_core_t *core, uint32 radar_detect) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_ENABLE_RADAR_INDICATION *radar_ind_cfg = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; int res; wave_radio_t *radio; MTLK_ASSERT(vap_handle); ILOG1_V("Sending UMI_ENABLE_RADAR_INDICATION"); radio = wave_vap_radio_get(vap_handle); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_ENABLE_RADAR_INDICATION_REQ; man_entry->payload_size = sizeof(UMI_ENABLE_RADAR_INDICATION); radar_ind_cfg = (UMI_ENABLE_RADAR_INDICATION *)(man_entry->payload); radar_ind_cfg->enableIndication = radar_detect; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Set UMI_ENABLE_RADAR_INDICATION failed (res = %i)", mtlk_vap_get_oid(vap_handle), res); } else { WAVE_RADIO_PDB_SET_INT(wave_vap_radio_get(vap_handle), PARAM_DB_RADIO_DFS_RADAR_DETECTION, radar_detect); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_emulate_radar_event (mtlk_handle_t hcore, uint8 rbm) { int res; mtlk_core_radar_emu_t radar_emu; mtlk_core_t *core = (mtlk_core_t*)hcore; struct mtlk_chan_def *ccd = __wave_core_chandef_get(core); int cur_channel = ieee80211_frequency_to_channel(ccd->chan.center_freq); if (!is_channel_certain(ccd)) { ELOG_V("Can not emulate radar, channel is not certain"); return MTLK_ERR_UNKNOWN; } if (!cur_channel) { ELOG_D("Could not find channel for frequency %d", ccd->chan.center_freq); return MTLK_ERR_UNKNOWN; } memset(&radar_emu, 0, sizeof(radar_emu)); radar_emu.radar_det.channel = cur_channel; radar_emu.radar_det.subBandBitmap = rbm; res = _handle_radar_event(hcore, &radar_emu, sizeof(radar_emu)); return res; } static int _mtlk_core_set_scan_and_calib_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_scan_and_calib_cfg_t *scan_and_calib_cfg; uint32 clpb_data_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); scan_and_calib_cfg = mtlk_clpb_enum_get_next(clpb, &clpb_data_size); MTLK_CLPB_TRY(scan_and_calib_cfg, clpb_data_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(scan_and_calib_cfg, scan_modifs, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_SCAN_MODIFS, scan_and_calib_cfg->scan_modifs)); MTLK_CFG_CHECK_ITEM_AND_CALL(scan_and_calib_cfg, scan_params, WAVE_RADIO_PDB_SET_BINARY, (radio, PARAM_DB_RADIO_SCAN_PARAMS, &scan_and_calib_cfg->scan_params, sizeof(iwpriv_scan_params_t)), res); MTLK_CFG_CHECK_ITEM_AND_CALL(scan_and_calib_cfg, scan_params_bg, WAVE_RADIO_PDB_SET_BINARY, (radio, PARAM_DB_RADIO_SCAN_PARAMS_BG, &scan_and_calib_cfg->scan_params_bg, sizeof(iwpriv_scan_params_bg_t)), res); MTLK_CFG_CHECK_ITEM_AND_CALL(scan_and_calib_cfg, calib_cw_masks, WAVE_RADIO_PDB_SET_BINARY, (radio, PARAM_DB_RADIO_CALIB_CW_MASKS, &scan_and_calib_cfg->calib_cw_masks, sizeof(uint32) * NUM_IWPRIV_CALIB_CW_MASKS), res); MTLK_CFG_CHECK_ITEM_AND_CALL(scan_and_calib_cfg, rbm, _mtlk_core_emulate_radar_event, (hcore, scan_and_calib_cfg->rbm), res); MTLK_CFG_CHECK_ITEM_AND_CALL(scan_and_calib_cfg, radar_detect, _mtlk_core_set_radar_detect, (core, !!scan_and_calib_cfg->radar_detect), res); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(scan_and_calib_cfg, scan_expire_time, wv_cfg80211_set_scan_expire_time, (mtlk_df_user_get_wdev(mtlk_df_get_user(mtlk_vap_get_df(core->vap_handle))), scan_and_calib_cfg->scan_expire_time)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_scan_and_calib_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_pdb_size_t scan_params_size = sizeof(iwpriv_scan_params_t); mtlk_pdb_size_t scan_params_bg_size = sizeof(iwpriv_scan_params_bg_t); mtlk_pdb_size_t calib_cw_masks_size = sizeof(uint32) * NUM_IWPRIV_CALIB_CW_MASKS; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_scan_and_calib_cfg_t scan_and_calib_cfg; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&scan_and_calib_cfg, 0, sizeof(scan_and_calib_cfg)); MTLK_CFG_SET_ITEM(&scan_and_calib_cfg, scan_modifs, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SCAN_MODIFS)); MTLK_CFG_SET_ITEM_BY_FUNC(&scan_and_calib_cfg, scan_params, WAVE_RADIO_PDB_GET_BINARY, (radio, PARAM_DB_RADIO_SCAN_PARAMS, &scan_and_calib_cfg.scan_params, &scan_params_size), res); MTLK_CFG_SET_ITEM_BY_FUNC(&scan_and_calib_cfg, scan_params_bg, WAVE_RADIO_PDB_GET_BINARY, (radio, PARAM_DB_RADIO_SCAN_PARAMS_BG, &scan_and_calib_cfg.scan_params_bg, &scan_params_bg_size), res); MTLK_CFG_SET_ITEM_BY_FUNC(&scan_and_calib_cfg, calib_cw_masks, WAVE_RADIO_PDB_GET_BINARY, (radio, PARAM_DB_RADIO_CALIB_CW_MASKS, scan_and_calib_cfg.calib_cw_masks, &calib_cw_masks_size), res); MTLK_CFG_SET_ITEM(&scan_and_calib_cfg, radar_detect, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_DFS_RADAR_DETECTION)); if (mtlk_vap_is_ap(core->vap_handle)){ MTLK_CFG_SET_ITEM(&scan_and_calib_cfg, scan_expire_time, wv_cfg80211_get_scan_expire_time(mtlk_df_user_get_wdev(mtlk_df_get_user(mtlk_vap_get_df(core->vap_handle))))); } /* TODO MAC80211: handle set/get bss scan expire time for sta mode interface - is this required? */ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) res = mtlk_clpb_push(clpb, &scan_and_calib_cfg, sizeof(scan_and_calib_cfg)); return res; } static int _mtlk_core_get_coc_antenna_params (mtlk_core_t *core, mtlk_coc_antenna_cfg_t *antenna_params) { mtlk_coc_antenna_cfg_t *current_params; mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); MTLK_ASSERT(core != NULL); MTLK_ASSERT(antenna_params != NULL); current_params = mtlk_coc_get_current_params(coc_mgmt); *antenna_params = *current_params; return MTLK_ERR_OK; } static unsigned _mtlk_core_get_current_tx_antennas (mtlk_core_t *core) { mtlk_coc_antenna_cfg_t *current_params; mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); MTLK_ASSERT(core != NULL); current_params = mtlk_coc_get_current_params(coc_mgmt); return current_params->num_tx_antennas; } static int _mtlk_core_get_coc_auto_params (mtlk_core_t *core, mtlk_coc_auto_cfg_t *auto_params) { mtlk_coc_auto_cfg_t *configured_params; mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); MTLK_ASSERT(core != NULL); MTLK_ASSERT(auto_params != NULL); configured_params = mtlk_coc_get_auto_params(coc_mgmt); *auto_params = *configured_params; return MTLK_ERR_OK; } static int _mtlk_core_get_coc_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_coc_mode_cfg_t coc_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(!mtlk_vap_is_slave_ap(core->vap_handle)); radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(radio); memset(&coc_cfg, 0, sizeof(coc_cfg)); MTLK_CFG_SET_ITEM(&coc_cfg, is_auto_mode, mtlk_coc_is_auto_mode(coc_mgmt)); MTLK_CFG_SET_ITEM_BY_FUNC(&coc_cfg, antenna_params, _mtlk_core_get_coc_antenna_params, (core, &coc_cfg.antenna_params), res); MTLK_CFG_SET_ITEM_BY_FUNC(&coc_cfg, auto_params, _mtlk_core_get_coc_auto_params, (core, &coc_cfg.auto_params), res); MTLK_CFG_SET_ITEM(&coc_cfg, cur_ant_mask, wave_radio_current_antenna_mask_get(radio)); MTLK_CFG_SET_ITEM(&coc_cfg, hw_ant_mask, wave_radio_rx_antenna_mask_get(radio)); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &coc_cfg, sizeof(coc_cfg)); } return res; } static int _mtlk_core_set_coc_power_mode (mtlk_core_t *core, BOOL is_auto_mode) { int res = MTLK_ERR_OK; mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); res = mtlk_coc_set_power_mode(coc_mgmt, is_auto_mode); return res; } int __MTLK_IFUNC mtlk_core_set_coc_actual_power_mode(mtlk_core_t *core) { mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); return mtlk_coc_set_actual_power_mode(coc_mgmt); } static int _mtlk_core_set_antenna_params (mtlk_core_t *core, mtlk_coc_antenna_cfg_t *antenna_params) { int res = MTLK_ERR_OK; mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); res = mtlk_coc_set_antenna_params(coc_mgmt, antenna_params); return res; } static int _mtlk_core_set_auto_params (mtlk_core_t *core, mtlk_coc_auto_cfg_t *auto_params) { int res = MTLK_ERR_OK; mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); res = mtlk_coc_set_auto_params(coc_mgmt, auto_params); return res; } static int _mtlk_core_set_coc_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_coc_mode_cfg_t *coc_cfg = NULL; uint32 coc_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); coc_cfg = mtlk_clpb_enum_get_next(clpb, &coc_cfg_size); MTLK_CLPB_TRY(coc_cfg, coc_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(coc_cfg, auto_params, _mtlk_core_set_auto_params, (core, &coc_cfg->auto_params), res); MTLK_CFG_CHECK_ITEM_AND_CALL(coc_cfg, antenna_params, _mtlk_core_set_antenna_params, (core, &coc_cfg->antenna_params), res); MTLK_CFG_CHECK_ITEM_AND_CALL(coc_cfg, is_auto_mode, _mtlk_core_set_coc_power_mode, (core, coc_cfg->is_auto_mode), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_tasklet_limits (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *core = (mtlk_core_t *) hcore; mtlk_hw_api_t *hw_api = mtlk_vap_get_hwapi(core->vap_handle); mtlk_tasklet_limits_cfg_t tl_cfg; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 res = MTLK_ERR_OK; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(!mtlk_vap_is_slave_ap(core->vap_handle)); memset(&tl_cfg, 0, sizeof(tl_cfg)); res |= mtlk_hw_get_prop(hw_api, MTLK_HW_DATA_TXOUT_LIM, &tl_cfg.tl.data_txout_lim, sizeof(tl_cfg.tl.data_txout_lim)); res |= mtlk_hw_get_prop(hw_api, MTLK_HW_DATA_RX_LIM, &tl_cfg.tl.data_rx_lim, sizeof(tl_cfg.tl.data_rx_lim)); res |= mtlk_hw_get_prop(hw_api, MTLK_HW_BSS_RX_LIM, &tl_cfg.tl.bss_rx_lim, sizeof(tl_cfg.tl.bss_rx_lim)); res |= mtlk_hw_get_prop(hw_api, MTLK_HW_BSS_CFM_LIM, &tl_cfg.tl.bss_cfm_lim, sizeof(tl_cfg.tl.bss_cfm_lim)); res |= mtlk_hw_get_prop(hw_api, MTLK_HW_LEGACY_LIM, &tl_cfg.tl.legacy_lim, sizeof(tl_cfg.tl.legacy_lim)); if (MTLK_ERR_OK != res) ELOG_D("CID-%04x: Can't get tasklet_limits", mtlk_vap_get_oid(core->vap_handle)); else tl_cfg.tl_filled = 1; res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) res = mtlk_clpb_push(clpb, &tl_cfg, sizeof(tl_cfg)); return res; } static int _mtlk_core_set_tasklet_limits (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t *) hcore; mtlk_hw_api_t *hw_api = mtlk_vap_get_hwapi(core->vap_handle); mtlk_tasklet_limits_cfg_t *tl_cfg = NULL; uint32 tl_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); tl_cfg = mtlk_clpb_enum_get_next(clpb, &tl_cfg_size); MTLK_CLPB_TRY(tl_cfg, tl_cfg_size) if (!tl_cfg->tl_filled) MTLK_CLPB_EXIT(MTLK_ERR_UNKNOWN); res |= mtlk_hw_set_prop(hw_api, MTLK_HW_DATA_TXOUT_LIM, &tl_cfg->tl.data_txout_lim, sizeof(tl_cfg->tl.data_txout_lim)); res |= mtlk_hw_set_prop(hw_api, MTLK_HW_DATA_RX_LIM, &tl_cfg->tl.data_rx_lim, sizeof(tl_cfg->tl.data_rx_lim)); res |= mtlk_hw_set_prop(hw_api, MTLK_HW_BSS_RX_LIM, &tl_cfg->tl.bss_rx_lim, sizeof(tl_cfg->tl.bss_rx_lim)); res |= mtlk_hw_set_prop(hw_api, MTLK_HW_BSS_CFM_LIM, &tl_cfg->tl.bss_cfm_lim, sizeof(tl_cfg->tl.bss_cfm_lim)); res |= mtlk_hw_set_prop(hw_api, MTLK_HW_LEGACY_LIM, &tl_cfg->tl.legacy_lim, sizeof(tl_cfg->tl.legacy_lim)); if (MTLK_ERR_OK != res) ELOG_D("CID-%04x: Can't set tasklet_limits", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } /************* AGG rate limit *******************/ static int _mtlk_core_receive_agg_rate_limit (mtlk_core_t *core, mtlk_agg_rate_limit_req_cfg_t *arl_cfg) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_AGG_RATE_LIMIT *mac_msg; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_SET_AGG_RATE_LIMIT_REQ; man_entry->payload_size = sizeof(UMI_AGG_RATE_LIMIT); mac_msg = (UMI_AGG_RATE_LIMIT *)man_entry->payload; mac_msg->getSetOperation = API_GET_OPERATION; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK == res) { arl_cfg->mode = mac_msg->mode; arl_cfg->maxRate = MAC_TO_HOST16(mac_msg->maxRate); } else { ELOG_D("CID-%04x: Failed to receive UM_MAN_SET_AGG_RATE_LIMIT_REQ", mtlk_vap_get_oid(core->vap_handle)); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static void _mtlk_core_read_agg_rate_limit (mtlk_core_t *core, mtlk_agg_rate_limit_cfg_t *agg_rate_cfg) { wave_radio_t *radio; MTLK_ASSERT(core != NULL); MTLK_ASSERT(agg_rate_cfg != NULL); radio = wave_vap_radio_get(core->vap_handle); agg_rate_cfg->agg_rate_limit.mode = (uint8) WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_AGG_RATE_LIMIT_MODE); agg_rate_cfg->agg_rate_limit.maxRate = (uint16) WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_AGG_RATE_LIMIT_MAXRATE); } static void _mtlk_core_store_agg_rate_limit (mtlk_core_t *core, const mtlk_agg_rate_limit_cfg_t *agg_rate_cfg) { wave_radio_t *radio; MTLK_ASSERT(core != NULL); MTLK_ASSERT(agg_rate_cfg != NULL); radio = wave_vap_radio_get(core->vap_handle); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_AGG_RATE_LIMIT_MODE, agg_rate_cfg->agg_rate_limit.mode); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_AGG_RATE_LIMIT_MAXRATE, agg_rate_cfg->agg_rate_limit.maxRate); } int __MTLK_IFUNC mtlk_core_set_agg_rate_limit (mtlk_core_t *core, mtlk_agg_rate_limit_cfg_t *agg_rate_cfg) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_AGG_RATE_LIMIT *mac_msg; int res; MTLK_ASSERT((0==agg_rate_cfg->agg_rate_limit.mode) || (1==agg_rate_cfg->agg_rate_limit.mode)); ILOG2_DDD("CID-%04x: Set aggregation-rate limit. Mode: %u, maxRate: %u", mtlk_vap_get_oid(core->vap_handle), agg_rate_cfg->agg_rate_limit.mode, agg_rate_cfg->agg_rate_limit.maxRate); /* allocate a new message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_NO_RESOURCES; } /* fill the message data */ man_entry->id = UM_MAN_SET_AGG_RATE_LIMIT_REQ; man_entry->payload_size = sizeof(UMI_AGG_RATE_LIMIT); mac_msg = (UMI_AGG_RATE_LIMIT *)man_entry->payload; mac_msg->mode = agg_rate_cfg->agg_rate_limit.mode; mac_msg->maxRate = HOST_TO_MAC16(agg_rate_cfg->agg_rate_limit.maxRate); /* send the message to FW */ res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); /* cleanup the message */ mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_set_agg_rate_limit (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t *) hcore; mtlk_agg_rate_limit_cfg_t *agg_cfg = NULL; uint32 agg_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ agg_cfg = mtlk_clpb_enum_get_next(clpb, &agg_cfg_size); MTLK_CLPB_TRY(agg_cfg, agg_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* send new config to FW */ MTLK_CFG_CHECK_ITEM_AND_CALL(agg_cfg, agg_rate_limit, mtlk_core_set_agg_rate_limit, (core, agg_cfg), res); /* store new config in internal db*/ MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(agg_cfg, agg_rate_limit, _mtlk_core_store_agg_rate_limit, (core, agg_cfg)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_agg_rate_limit (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_agg_rate_limit_cfg_t agg_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* read config from internal db */ memset(&agg_cfg, 0, sizeof(agg_cfg)); MTLK_CFG_SET_ITEM_BY_FUNC(&agg_cfg, agg_rate_limit, _mtlk_core_receive_agg_rate_limit, (core, &agg_cfg.agg_rate_limit), res) /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &agg_cfg, sizeof(agg_cfg)); } return res; } /************* TX Power Limit configuration ******************/ static int _mtlk_core_send_tx_power_limit_offset (mtlk_core_t *core, const uint32 power_limit) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_TX_POWER_LIMIT *mac_msg; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); int res; MTLK_ASSERT(((power_limit == 0) || (power_limit == 3) || (power_limit == 6) || (power_limit == 9))); /* Power settings are determined by peer AP configuration. Therefore TX power cannot be set * in case there are station mode interfaces unless FW recovery is in progress */ if (wave_radio_get_sta_vifs_exist(radio) && !mtlk_core_rcvry_is_running(core)) { WLOG_V("Setting TX power limit is disabled while sta vifs exists"); return MTLK_ERR_NOT_SUPPORTED; } if (mtlk_vap_is_ap(core->vap_handle) && ((wave_radio_sta_cnt_get(radio) > 0) && !mtlk_core_rcvry_is_running(core))) { WLOG_V("Setting TX power limit is disabled while connected STA or peer AP exists"); return MTLK_ERR_NOT_SUPPORTED; } ILOG2_DD("CID-%04x: Set TX Power Limit. powerLimitOffset: %u", mtlk_vap_get_oid(core->vap_handle), power_limit); /* allocate a new message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_NO_RESOURCES; } /* fill the message data */ man_entry->id = UM_MAN_SET_POWER_LIMIT_REQ; man_entry->payload_size = sizeof(UMI_TX_POWER_LIMIT); mac_msg = (UMI_TX_POWER_LIMIT *)man_entry->payload; memset(mac_msg, 0, sizeof(*mac_msg)); mac_msg->powerLimitOffset = (uint8)power_limit; /* send the message to FW */ res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); /* New structure does not contain field status */ /* cleanup the message */ mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_set_tx_power_limit_offset (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t *) hcore; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_tx_power_lim_cfg_t *tx_power_lim_cfg = NULL; uint32 tx_power_lim_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ tx_power_lim_cfg = mtlk_clpb_enum_get_next(clpb, &tx_power_lim_cfg_size); MTLK_CLPB_TRY(tx_power_lim_cfg, tx_power_lim_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* send new config to FW */ MTLK_CFG_CHECK_ITEM_AND_CALL(tx_power_lim_cfg, powerLimitOffset, _mtlk_core_send_tx_power_limit_offset, (core, tx_power_lim_cfg->powerLimitOffset), res); /* store new config in internal db*/ MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(tx_power_lim_cfg, powerLimitOffset, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_TX_POWER_LIMIT_OFFSET, tx_power_lim_cfg->powerLimitOffset)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_tx_power_limit_offset (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_tx_power_lim_cfg_t tx_power_lim_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_CFG_SET_ITEM_BY_FUNC(&tx_power_lim_cfg, powerLimitOffset, _mtlk_core_receive_tx_power_limit_offset, (core, &tx_power_lim_cfg.powerLimitOffset), res); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &tx_power_lim_cfg, sizeof(tx_power_lim_cfg)); } return res; } /* Fixed Rate configuration */ struct mtlk_param_limits { uint32 min_limit; uint32 max_limit; }; static BOOL _mtlk_core_params_limits_valid (mtlk_core_t *core, const uint32 *params, struct mtlk_param_limits *limits, int size) { uint32 value, v_min, v_max; int i; for (i = 0; i < size; i++) { value = params[i]; v_min = limits[i].min_limit; v_max = limits[i].max_limit; if (!((v_min <= value) && (value <= v_max))) { ELOG_DDDD("params[%d] = %u is not fit to range [%u ... %u]", i, value, v_min, v_max); return FALSE; } } return TRUE; } static int _mtlk_core_check_fixed_rate (mtlk_core_t *core, const mtlk_fixed_rate_cfg_t *fixed_rate_cfg) { struct mtlk_param_limits limits[MTLK_FIXED_RATE_CFG_SIZE] = { [MTLK_FIXED_RATE_CFG_SID] = { 0, ALL_SID_MAX }, /* stationIndex */ [MTLK_FIXED_RATE_CFG_AUTO] = { 0, 1 }, /* isAutoRate */ [MTLK_FIXED_RATE_CFG_BW] = { CW_20, CW_160 }, /* bw */ [MTLK_FIXED_RATE_CFG_PHYM] = { PHY_MODE_MIN, PHY_MODE_MAX }, /* phyMode */ [MTLK_FIXED_RATE_CFG_NSS] = { 0, 4 }, /* nss */ [MTLK_FIXED_RATE_CFG_MCS] = { 0, 32 }, /* mcs */ [MTLK_FIXED_RATE_CFG_SCP] = { 0, 5 }, /* scp/cpMode */ [MTLK_FIXED_RATE_CFG_DCM] = { 0, 1 }, /* dcm */ [MTLK_FIXED_RATE_CFG_HE_EXTPARTIALBWDATA] = { 0, 1 }, /* heExtPartialBwData */ [MTLK_FIXED_RATE_CFG_HE_EXTPARTIALBWMNG] = { 0, 1 }, /* heExtPartialBwMng */ [MTLK_FIXED_RATE_CFG_CHANGETYPE] = { 1, 3 }, /* changeType */ }; if (/* All params are within limits */ _mtlk_core_params_limits_valid(core, &fixed_rate_cfg->params[0], &limits[0], MTLK_FIXED_RATE_CFG_SIZE) && /* StationID: valid OR for all */ mtlk_hw_is_sid_valid_or_all_sta_sid(mtlk_vap_get_hw(core->vap_handle), fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_SID]) && /* AutoRate OR correct bitrate params */ ((0 != fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_AUTO]) || mtlk_bitrate_params_supported( fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_PHYM], fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_BW], fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_SCP], fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_MCS], fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_NSS])) ) { return MTLK_ERR_OK; } return MTLK_ERR_PARAMS; } static int _mtlk_core_send_fixed_rate (mtlk_core_t *core, const mtlk_fixed_rate_cfg_t *fixed_rate_cfg) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_FIXED_RATE_CONFIG *mac_msg; int res; unsigned oid; MTLK_ASSERT(core != NULL); oid = mtlk_vap_get_oid(core->vap_handle); ILOG2_D("CID-%04x: Set FIXED RATE", oid); /* allocate a new message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", oid); return MTLK_ERR_NO_RESOURCES; } /* fill the message data */ man_entry->id = UM_MAN_FIXED_RATE_CONFIG_REQ; man_entry->payload_size = sizeof(UMI_FIXED_RATE_CONFIG); mac_msg = (UMI_FIXED_RATE_CONFIG *)man_entry->payload; memset(mac_msg, 0, sizeof(*mac_msg)); MTLK_STATIC_ASSERT(sizeof(mac_msg->stationIndex) == sizeof(uint16)); mac_msg->stationIndex = HOST_TO_MAC16(fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_SID]); mac_msg->isAutoRate = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_AUTO]; mac_msg->bw = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_BW]; mac_msg->phyMode = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_PHYM]; mac_msg->nss = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_NSS]; mac_msg->mcs = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_MCS]; mac_msg->cpMode = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_SCP]; mac_msg->dcm = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_DCM]; mac_msg->heExtPartialBwData = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_HE_EXTPARTIALBWDATA]; mac_msg->heExtPartialBwMng = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_HE_EXTPARTIALBWMNG]; mac_msg->changeType = fixed_rate_cfg->params[MTLK_FIXED_RATE_CFG_CHANGETYPE]; /* send the message to FW */ res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); /* cleanup the message */ mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_check_and_send_fixed_rate (mtlk_core_t *core, const mtlk_fixed_rate_cfg_t *fixed_rate_cfg) { int res = _mtlk_core_check_fixed_rate(core, fixed_rate_cfg); if (MTLK_ERR_OK == res) { res = _mtlk_core_send_fixed_rate(core, fixed_rate_cfg); } return res; } static int _mtlk_core_set_fixed_rate (mtlk_handle_t hcore, const void *data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t *) hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_fixed_rate_cfg_t *fixed_rate_cfg = NULL; uint32 cfg_size; MTLK_ASSERT(core != NULL); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ fixed_rate_cfg = mtlk_clpb_enum_get_next(clpb, &cfg_size); MTLK_CLPB_TRY(fixed_rate_cfg, cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* send configuration to FW */ MTLK_CFG_CHECK_ITEM_AND_CALL(fixed_rate_cfg, params, _mtlk_core_check_and_send_fixed_rate, (core, fixed_rate_cfg), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } /************* Change HT protection method ******************/ static int _mtlk_core_set_bss_internal(mtlk_core_t *core, struct mtlk_bss_parameters *params) { UMI_SET_BSS fw_request; int res = MTLK_ERR_OK; ILOG2_DD("CID-%04x: vap_in_fw_is_active=%u", mtlk_vap_get_oid(core->vap_handle), core->vap_in_fw_is_active); /* FIXME: be sure that this flag as correct */ if (!core->vap_in_fw_is_active) { /* Workaround: UM_BSS_SET_BSS_REQ still cannot be sent, but it is not a fatal error. Updated parameterts has to written to pdb; they will be set during a new call of UM_BSS_SET_BSS_REQ. */ ILOG2_D("CID-%04x: UM_BSS_SET_BSS_REQ rejected, but settings will be updated in pdb", mtlk_vap_get_oid(core->vap_handle)); goto end; } /* Fill UMI_SET_BSS FW request */ _mtlk_core_fill_set_bss_request(core, &fw_request, params); /* Process UM_BSS_SET_BSS_REQ */ res = mtlk_core_set_bss(core, core, &fw_request); end: return res; } static void _mtlk_core_reset_bss_params_internal(struct mtlk_bss_parameters *bss_parameters) { memset(bss_parameters, 0, sizeof(*bss_parameters)); bss_parameters->use_cts_prot = -1; bss_parameters->use_short_preamble = -1; bss_parameters->use_short_slot_time = -1; bss_parameters->ht_opmode = -1; bss_parameters->p2p_ctwindow = -1; bss_parameters->p2p_opp_ps = -1; } static int mtlk_core_set_ht_protection (mtlk_core_t *core, uint32 protection_mode) { struct mtlk_bss_parameters bss_parameters; /* reset structure and set protection mode */ _mtlk_core_reset_bss_params_internal(&bss_parameters); bss_parameters.use_cts_prot = protection_mode; /* set bss */ return _mtlk_core_set_bss_internal(core, &bss_parameters); } static void _mtlk_core_store_ht_protection (mtlk_core_t *core, const uint32 protection_mode) { int flags; MTLK_ASSERT(core != NULL); /* store value */ MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_HT_PROTECTION, protection_mode); /* update priority flag */ flags = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_IWPRIV_FORCED); MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_IWPRIV_FORCED, flags | PARAM_DB_CORE_IWPRIV_FORCED_HT_PROTECTION_FLAG); } static int _mtlk_core_set_ht_protection (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t *) hcore; mtlk_ht_protection_cfg_t *protection_cfg = NULL; uint32 protection_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ protection_cfg = mtlk_clpb_enum_get_next(clpb, &protection_cfg_size); MTLK_CLPB_TRY(protection_cfg, protection_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* send new config to FW */ MTLK_CFG_CHECK_ITEM_AND_CALL(protection_cfg, use_cts_prot, mtlk_core_set_ht_protection, (core, protection_cfg->use_cts_prot), res); /* store new config in internal db*/ MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(protection_cfg, use_cts_prot, _mtlk_core_store_ht_protection, (core, protection_cfg->use_cts_prot)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_ht_protection (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_ht_protection_cfg_t protection_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* read config from internal db */ MTLK_CFG_SET_ITEM(&protection_cfg, use_cts_prot, MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_HT_PROTECTION)); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &protection_cfg, sizeof(protection_cfg)); } return res; } /********************************/ static int _mtlk_core_get_bf_explicit_cap (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_bf_explicit_cap_cfg_t bf_explicit_cap_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* read capability */ MTLK_CFG_SET_ITEM(&bf_explicit_cap_cfg, bf_explicit_cap, core_get_psdb_bf_explicit_cap(core)); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &bf_explicit_cap_cfg, sizeof(bf_explicit_cap_cfg)); } return res; } /********************************/ static int _mtlk_core_get_tx_power (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_tx_power_cfg_t tx_power_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* read tx power and convert it from power units to dBm */ MTLK_CFG_SET_ITEM(&tx_power_cfg, tx_power, POWER_TO_DBM(WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TX_POWER_CFG) - WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TX_POWER_LIMIT_OFFSET))); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &tx_power_cfg, sizeof(tx_power_cfg)); } return res; } /********************************/ #define DSCP_LOWEST_PRIORITY 0 #define DSCP_UNUSED_RANGE 255 static int _save_qos_map (mtlk_core_t *core, struct cfg80211_qos_map *qos_map) { int res = MTLK_ERR_PARAMS; uint32 up_idx, dscp_idx, dscp_low, dscp_high; uint8 dscp_table[DSCP_NUM]; /* Erase table. All frames with unknown DSCP must be transmitted with UP=0 (DSCP_LOWEST_PRIORITY) */ memset(dscp_table, DSCP_LOWEST_PRIORITY, sizeof(dscp_table)); /* Process common DSCP values */ { for (up_idx = 0; up_idx < NTS_TIDS; up_idx++) { dscp_low = qos_map->up[up_idx].low; dscp_high = qos_map->up[up_idx].high; if ((dscp_low < DSCP_NUM) && (dscp_high < DSCP_NUM) && (dscp_low <= dscp_high)) { for (dscp_idx = dscp_low; dscp_idx <= dscp_high; dscp_idx++) { dscp_table[dscp_idx] = up_idx; } } else if ((dscp_low == DSCP_UNUSED_RANGE) && (dscp_high == DSCP_UNUSED_RANGE)){ ILOG0_D("Skip pair for up_idx %d", up_idx); } else { ELOG_DDD("Incorrect value(s) for up_idx: %d (dscp_low: %d, dscp_high %d)", up_idx, dscp_low, dscp_high); goto end; } } } /* Process DSCP exceptions */ { int num_des = qos_map->num_des; int i; if (num_des > IEEE80211_QOS_MAP_MAX_EX) { ELOG_DD("Too many DSCP exceptions: %d, maximum allowed: %d", num_des, IEEE80211_QOS_MAP_MAX_EX); goto end; } for (i = 0; i < num_des; i++) { dscp_idx = qos_map->dscp_exception[i].dscp; up_idx = qos_map->dscp_exception[i].up; if ((dscp_idx < DSCP_NUM) && (up_idx < NTS_TIDS)) { dscp_table[dscp_idx] = up_idx; } else { ELOG_DDD("Incorrect value(s) for exception %d (dscp_idx: %d, up_idx: %d)", i, dscp_idx, up_idx); goto end; } } } mtlk_dump(2, dscp_table, sizeof(dscp_table), "dump of QoS map"); wave_memcpy(core->dscp_table, sizeof(core->dscp_table), dscp_table, sizeof(dscp_table)); res = MTLK_ERR_OK; #if MTLK_USE_DIRECTCONNECT_DP_API /* Update QoS for DirectConnect DP Driver */ { mtlk_df_user_t *df_user = mtlk_df_get_user(mtlk_vap_get_df(core->vap_handle)); if (MTLK_ERR_OK != mtlk_df_user_set_priority_to_qos(df_user, core->dscp_table)) { WLOG_S("%s: Unable set priority to WMM", mtlk_df_user_get_name(df_user)); } } #endif end: return res; } static int _mtlk_core_set_qos_map (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_NOT_SUPPORTED; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 qos_map_size; struct cfg80211_qos_map *qos_map = NULL; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); qos_map = mtlk_clpb_enum_get_next(clpb, &qos_map_size); MTLK_CLPB_TRY(qos_map, qos_map_size) res = _save_qos_map(core, qos_map); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT static int _mtlk_core_get_pcoc_params (mtlk_core_t *core, mtlk_pcoc_params_t *params) { mtlk_pcoc_params_t *configured_params; MTLK_ASSERT(core != NULL); MTLK_ASSERT(params != NULL); configured_params = wv_PMCU_Get_Params(); *params = *configured_params; return MTLK_ERR_OK; } static int _mtlk_core_get_pcoc_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_pcoc_mode_cfg_t pcoc_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(!mtlk_vap_is_slave_ap(core->vap_handle)); memset(&pcoc_cfg, 0, sizeof(pcoc_cfg)); MTLK_CFG_SET_ITEM(&pcoc_cfg, is_enabled, wv_PMCU_is_enabled_adm()); MTLK_CFG_SET_ITEM(&pcoc_cfg, is_active, wv_PMCU_is_active()); MTLK_CFG_SET_ITEM(&pcoc_cfg, traffic_state, wv_PMCU_get_traffic_state()); MTLK_CFG_SET_ITEM_BY_FUNC(&pcoc_cfg, params, _mtlk_core_get_pcoc_params, (core, &pcoc_cfg.params), res); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &pcoc_cfg, sizeof(pcoc_cfg)); } return res; } static int _mtlk_core_set_pcoc_enabled (mtlk_core_t *core, BOOL is_enabled) { int res = MTLK_ERR_OK; res = wv_PMCU_set_enabled_adm(is_enabled); return res; } static int _mtlk_core_set_pcoc_pmcu_debug (mtlk_core_t *core, uint32 pmcu_debug) { int res = MTLK_ERR_OK; return res; } static int _mtlk_core_set_pcoc_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_pcoc_mode_cfg_t *pcoc_cfg = NULL; uint32 pcoc_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); pcoc_cfg = mtlk_clpb_enum_get_next(clpb, &pcoc_cfg_size); MTLK_CLPB_TRY(pcoc_cfg, pcoc_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(pcoc_cfg, params, wv_PMCU_Set_Params, (&pcoc_cfg->params), res); MTLK_CFG_CHECK_ITEM_AND_CALL(pcoc_cfg, is_enabled, _mtlk_core_set_pcoc_enabled, (core, pcoc_cfg->is_enabled), res); MTLK_CFG_CHECK_ITEM_AND_CALL(pcoc_cfg, pmcu_debug, _mtlk_core_set_pcoc_pmcu_debug, (core, pcoc_cfg->pmcu_debug), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } #endif /*CPTCFG_IWLWAV_PMCU_SUPPORT*/ #ifdef CPTCFG_IWLWAV_SET_PM_QOS static int _mtlk_core_set_cpu_dma_latency (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t *) hcore; mtlk_pm_qos_cfg_t *pm_qos_cfg = NULL; uint32 pm_qos_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ pm_qos_cfg = mtlk_clpb_enum_get_next(clpb, &pm_qos_cfg_size); MTLK_CLPB_TRY(pm_qos_cfg, pm_qos_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* change config */ MTLK_CFG_CHECK_ITEM_AND_CALL(pm_qos_cfg, cpu_dma_latency, mtlk_mmb_update_cpu_dma_latency, (mtlk_vap_get_hw(core->vap_handle), pm_qos_cfg->cpu_dma_latency), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_get_cpu_dma_latency (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_pm_qos_cfg_t pm_qos_cfg; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_UNREFERENCED_PARAM(hcore); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_CFG_SET_ITEM(&pm_qos_cfg, cpu_dma_latency, cpu_dma_latency); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &pm_qos_cfg, sizeof(pm_qos_cfg)); } return res; } #endif static int _mtlk_core_mbss_add_vap_idx (mtlk_handle_t hcore, uint32 vap_index, mtlk_work_role_e role, BOOL is_master) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; char ndev_name_pattern[IFNAMSIZ]; int nchars; ILOG2_D("CID-%04x: Got PRM_ID_VAP_ADD", mtlk_vap_get_oid(core->vap_handle)); nchars = snprintf(ndev_name_pattern, sizeof(ndev_name_pattern), "%s.%d", MTLK_NDEV_NAME, (vap_index - 1)); if (nchars >= sizeof(ndev_name_pattern)) { return MTLK_ERR_BUF_TOO_SMALL; } if ((res = mtlk_vap_manager_create_vap(mtlk_vap_get_manager(core->vap_handle), vap_index, NULL, ndev_name_pattern, role, is_master, NULL)) != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't add VapID %u", mtlk_vap_get_oid(core->vap_handle), vap_index); } else { ILOG0_DD("CID-%04x: VapID %u added", mtlk_vap_get_oid(core->vap_handle), vap_index); } return res; } static int _mtlk_core_mbss_del_vap_idx (mtlk_handle_t hcore, uint32 vap_index) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_vap_handle_t vap_handle; int target_core_state; uint32 max_vaps_count; max_vaps_count = mtlk_vap_manager_get_max_vaps_count(mtlk_vap_get_manager(core->vap_handle)); if (vap_index >= max_vaps_count) { ELOG_DD("CID-%04x: VapID %u invalid", mtlk_vap_get_oid(core->vap_handle), vap_index); res = MTLK_ERR_PARAMS; goto func_ret; } res = mtlk_vap_manager_get_vap_handle(mtlk_vap_get_manager(core->vap_handle), vap_index, &vap_handle); if (MTLK_ERR_OK != res ) { ELOG_DD("CID-%04x: VapID %u doesn't exist", mtlk_vap_get_oid(core->vap_handle), vap_index); res = MTLK_ERR_PARAMS; goto func_ret; } if (mtlk_vap_is_master(vap_handle)) { ELOG_D("CID-%04x: Can't remove Master VAP", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_PARAMS; goto func_ret; } target_core_state = mtlk_core_get_net_state(mtlk_vap_get_core(vap_handle)); if ( 0 == ((NET_STATE_READY|NET_STATE_IDLE|NET_STATE_HALTED) & target_core_state) ) { ILOG1_D("CID-%04x:: Invalid card state - request rejected", mtlk_vap_get_oid(vap_handle)); res = MTLK_ERR_NOT_READY; goto func_ret; } ILOG0_DD("CID-%04x: Deleting VapID %u", mtlk_vap_get_oid(core->vap_handle), vap_index); mtlk_vap_stop(vap_handle); mtlk_vap_delete(vap_handle); res = MTLK_ERR_OK; func_ret: return res; } static int _mtlk_core_add_vap_name (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_NO_RESOURCES; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_mbss_cfg_t *mbss_cfg; uint32 mbss_cfg_size = sizeof(mtlk_mbss_cfg_t); uint32 _vap_index; mtlk_vap_handle_t _vap_handle; void *ctx; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mbss_cfg = mtlk_clpb_enum_get_next(clpb, &mbss_cfg_size); MTLK_CLPB_TRY(mbss_cfg, mbss_cfg_size) { if (mtlk_core_is_block_tx_mode(nic)) { ELOG_V("Cannot add vap, waiting for beacons"); MTLK_CLPB_EXIT(MTLK_ERR_RETRY); } if (mtlk_core_is_in_scan_mode(nic)) { ELOG_V("Cannot add vap, scan is running"); MTLK_CLPB_EXIT(MTLK_ERR_RETRY); } res = mtlk_vap_manager_get_free_vap_index(mtlk_vap_get_manager(nic->vap_handle), &_vap_index); if (MTLK_ERR_OK != res) { ELOG_V("No free slot for new VAP"); MTLK_CLPB_EXIT(res); } res = mtlk_vap_manager_create_vap(mtlk_vap_get_manager(nic->vap_handle), _vap_index, mbss_cfg->wiphy, mbss_cfg->added_vap_name, mbss_cfg->role, mbss_cfg->is_master, mbss_cfg->ndev); if (MTLK_ERR_OK != res) { ELOG_V("Can't add VAP"); MTLK_CLPB_EXIT(res); } res = mtlk_vap_manager_get_vap_handle(mtlk_vap_get_manager(nic->vap_handle), _vap_index, &_vap_handle); if (MTLK_ERR_OK != res) { ELOG_D("VapID %u doesn't exist", _vap_index); MTLK_CLPB_EXIT(res); } if (mbss_cfg->role == MTLK_ROLE_AP){ ctx = mtlk_df_user_get_wdev(mtlk_df_get_user(mtlk_vap_get_df(_vap_handle))); res = mtlk_clpb_push(clpb, &ctx, sizeof(ctx)); if (MTLK_ERR_OK != res) { mtlk_clpb_purge(clpb); } } else { /* Station mode interface */ ctx = mtlk_df_get_user(mtlk_vap_get_df(_vap_handle)); res = mtlk_clpb_push(clpb, &ctx, sizeof(ctx)); if (MTLK_ERR_OK != res) { mtlk_clpb_purge(clpb); } } } MTLK_CLPB_FINALLY(res) return res; MTLK_CLPB_END; } static int _mtlk_core_add_vap_idx (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_mbss_cfg_t *mbss_cfg; uint32 mbss_cfg_size = sizeof(mtlk_mbss_cfg_t); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mbss_cfg = mtlk_clpb_enum_get_next(clpb, &mbss_cfg_size); MTLK_CLPB_TRY(mbss_cfg, mbss_cfg_size) { MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(mbss_cfg, added_vap_index, _mtlk_core_mbss_add_vap_idx, (hcore, mbss_cfg->added_vap_index, mbss_cfg->role, mbss_cfg->is_master), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_del_vap_name (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; int target_core_state; mtlk_mbss_cfg_t *mbss_cfg; uint32 mbss_cfg_size = sizeof(mtlk_mbss_cfg_t); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mbss_cfg = mtlk_clpb_enum_get_next(clpb, &mbss_cfg_size); MTLK_CLPB_TRY(mbss_cfg, mbss_cfg_size) if (mtlk_vap_is_master(mbss_cfg->vap_handle)) { ELOG_D("CID-%04x: Can't remove Master VAP", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_PARAMS); } if (!mtlk_vap_get_core(mbss_cfg->vap_handle)->is_stopped) { res = __mtlk_core_deactivate(core, mtlk_vap_get_core(mbss_cfg->vap_handle)); if ((MTLK_ERR_OK != res) && (MTLK_ERR_RETRY != res)) { ELOG_DD("CID-%04x: Core deactivation is failed err:%d", mtlk_vap_get_oid(mbss_cfg->vap_handle), res); MTLK_CLPB_EXIT(MTLK_ERR_PARAMS); } else if (MTLK_ERR_RETRY == res) { ILOG2_D("CID-%04x: Core deactivation is postponded", mtlk_vap_get_oid(mbss_cfg->vap_handle)); MTLK_CLPB_EXIT(res); } } target_core_state = mtlk_core_get_net_state(mtlk_vap_get_core(mbss_cfg->vap_handle)); if (0 == ((NET_STATE_READY|NET_STATE_IDLE|NET_STATE_HALTED) & target_core_state)) { WLOG_D("CID-%04x: Invalid card state - request rejected", mtlk_vap_get_oid(mbss_cfg->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NOT_READY); } if (mtlk_core_is_block_tx_mode(core)) { ELOG_V("Cannot remove vap, waiting for beacons"); MTLK_CLPB_EXIT(MTLK_ERR_RETRY); } if (mtlk_core_is_in_scan_mode(core)) { ELOG_V("Cannot remove vap, scan is running"); MTLK_CLPB_EXIT(MTLK_ERR_RETRY); } mtlk_vap_stop(mbss_cfg->vap_handle); mtlk_vap_delete(mbss_cfg->vap_handle); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int _mtlk_core_del_vap_idx (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_mbss_cfg_t *mbss_cfg; uint32 mbss_cfg_size = sizeof(mtlk_mbss_cfg_t); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); mbss_cfg = mtlk_clpb_enum_get_next(clpb, &mbss_cfg_size); MTLK_CLPB_TRY(mbss_cfg, mbss_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(mbss_cfg, deleted_vap_index, _mtlk_core_mbss_del_vap_idx, (hcore, mbss_cfg->deleted_vap_index), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } typedef struct { int res; mtlk_clpb_t *clpb; } mtlk_core_get_serializer_info_enum_ctx_t; static BOOL __mtlk_core_get_serializer_info_enum_clb (mtlk_serializer_t *szr, const mtlk_command_t *command, BOOL is_current, mtlk_handle_t enum_ctx) { mtlk_core_get_serializer_info_enum_ctx_t *ctx = HANDLE_T_PTR(mtlk_core_get_serializer_info_enum_ctx_t, enum_ctx); mtlk_serializer_command_info_t cmd_info; MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_SET_ITEM(&cmd_info, is_current, is_current); MTLK_CFG_SET_ITEM(&cmd_info, priority, mtlk_command_get_priority(command)); MTLK_CFG_SET_ITEM(&cmd_info, issuer_slid, mtlk_command_get_issuer_slid(command)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() ctx->res = mtlk_clpb_push(ctx->clpb, &cmd_info, sizeof(cmd_info)); return (ctx->res == MTLK_ERR_OK)?TRUE:FALSE; } static int _mtlk_core_get_serializer_info (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_core_get_serializer_info_enum_ctx_t ctx; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); ctx.clpb = *(mtlk_clpb_t **) data; ctx.res = MTLK_ERR_OK; mtlk_serializer_enum_commands(&nic->slow_ctx->serializer, __mtlk_core_get_serializer_info_enum_clb, HANDLE_T(&ctx)); return ctx.res; } static int _mtlk_core_set_interfdet_do_params (mtlk_core_t *core, wave_radio_t *radio) { BOOL interf_det_enabled, is_spectrum_40; MTLK_ASSERT(core != NULL); MTLK_ASSERT(mtlk_vap_is_master_ap(core->vap_handle)); interf_det_enabled = FALSE; interf_det_enabled |= (0 != WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_20MHZ_DETECTION_THRESHOLD)); interf_det_enabled |= (0 != WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_20MHZ_NOTIFICATION_THRESHOLD)); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_INTERFDET_MODE, interf_det_enabled); if (!core->is_stopped) { is_spectrum_40 = (CW_40 == _mtlk_core_get_spectrum_mode(core)); if (MTLK_ERR_OK == _mtlk_core_set_fw_interfdet_req(core, is_spectrum_40)) { ILOG0_DS("CID-%04x: Interference detection is %s", mtlk_vap_get_oid(core->vap_handle), (interf_det_enabled ? "activated" : "deactivated")); wave_radio_interfdet_set(radio, interf_det_enabled); } else { ELOG_DS("CID-%04x: Interference detection cannot be %s", mtlk_vap_get_oid(core->vap_handle), (interf_det_enabled ? "activated" : "deactivated")); wave_radio_interfdet_set(radio, FALSE); } } return MTLK_ERR_OK; } static int _mtlk_core_set_interfdet_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_interfdet_cfg_t *interfdet_cfg; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); uint32 interfdet_cfg_size = sizeof(mtlk_interfdet_cfg_t); mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); interfdet_cfg = mtlk_clpb_enum_get_next(clpb, &interfdet_cfg_size); MTLK_CLPB_TRY(interfdet_cfg, interfdet_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_timeouts, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_ACTIVE_POLLING_TIMEOUT, interfdet_cfg->req_timeouts.active_polling_timeout)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_timeouts, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_SHORT_SCAN_POLLING_TIMEOUT, interfdet_cfg->req_timeouts.short_scan_polling_timeout)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_timeouts, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_LONG_SCAN_POLLING_TIMEOUT, interfdet_cfg->req_timeouts.long_scan_polling_timeout)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_timeouts, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_ACTIVE_NOTIFICATION_TIMEOUT, interfdet_cfg->req_timeouts.active_notification_timeout)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_timeouts, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_SHORT_SCAN_NOTIFICATION_TIMEOUT, interfdet_cfg->req_timeouts.short_scan_notification_timeout)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_timeouts, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_LONG_SCAN_NOTIFICATION_TIMEOUT, interfdet_cfg->req_timeouts.long_scan_notification_timeout)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_thresh, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_20MHZ_DETECTION_THRESHOLD, interfdet_cfg->req_thresh.detection_threshold_20mhz)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_thresh, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_20MHZ_NOTIFICATION_THRESHOLD, interfdet_cfg->req_thresh.notification_threshold_20mhz)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_thresh, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_40MHZ_DETECTION_THRESHOLD, interfdet_cfg->req_thresh.detection_threshold_40mhz)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_thresh, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_40MHZ_NOTIFICATION_THRESHOLD, interfdet_cfg->req_thresh.notification_threshold_40mhz)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_thresh, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_SCAN_NOISE_THRESHOLD, interfdet_cfg->req_thresh.scan_noise_threshold)); MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(interfdet_cfg, req_thresh, WAVE_RADIO_PDB_SET_INT, (radio, PARAM_DB_RADIO_INTERFDET_SCAN_MINIMUM_NOISE, interfdet_cfg->req_thresh.scan_minimum_noise)); _mtlk_core_set_interfdet_do_params(core, radio); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_interfdet_mode_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_interfdet_mode_cfg_t interfdet_mode_cfg; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(mtlk_vap_is_master_ap(core->vap_handle)); memset(&interfdet_mode_cfg, 0, sizeof(interfdet_mode_cfg)); MTLK_CFG_SET_ITEM(&interfdet_mode_cfg, interfdet_mode, wave_radio_interfdet_get(radio)); return mtlk_clpb_push(clpb, &interfdet_mode_cfg, sizeof(interfdet_mode_cfg)); } static int _mtlk_core_set_fw_interfdet_req (mtlk_core_t *core, BOOL is_spectrum_40) { int res = MTLK_ERR_UNKNOWN; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_INTERFERER_DETECTION_PARAMS *umi_interfdet = NULL; wave_radio_t *radio; MTLK_ASSERT(core != NULL); MTLK_ASSERT(mtlk_vap_is_master_ap(core->vap_handle)); radio = wave_vap_radio_get(core->vap_handle); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { res = MTLK_ERR_NO_RESOURCES; goto END; } man_entry->id = UM_MAN_SET_INTERFERER_DETECTION_PARAMS_REQ; man_entry->payload_size = sizeof(*umi_interfdet); umi_interfdet = (UMI_INTERFERER_DETECTION_PARAMS *)man_entry->payload; if (is_spectrum_40){ umi_interfdet->threshold = (int8)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_40MHZ_NOTIFICATION_THRESHOLD); } else { umi_interfdet->threshold = (int8)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_20MHZ_NOTIFICATION_THRESHOLD); } res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Cannot send UM_MAN_SET_INTERFERER_DETECTION_PARAMS_REQ to the FW (err=%d)", mtlk_vap_get_oid(core->vap_handle), res); goto END; } ILOG1_DSD("CID-%04x: UMI_INTERFERER_DETECTION_PARAMS(%s): Threshold: %d", mtlk_vap_get_oid(core->vap_handle), is_spectrum_40 ? "40MHz":"20MHz", umi_interfdet->threshold); END: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static int _mtlk_core_set_fw_log_severity (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_UNKNOWN; mtlk_fw_log_severity_t *fw_log_severity; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 clpb_data_size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); fw_log_severity = mtlk_clpb_enum_get_next(clpb, &clpb_data_size); MTLK_CLPB_TRY(fw_log_severity, clpb_data_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* need to check two parameters */ /* 1st: check only */ MTLK_CFG_CHECK_ITEM_VOID(fw_log_severity, newLevel); /* 2nd: check and call */ MTLK_CFG_CHECK_ITEM_AND_CALL(fw_log_severity, targetCPU, _mtlk_mmb_send_fw_log_severity, (mtlk_vap_get_hw(core->vap_handle), fw_log_severity->newLevel, fw_log_severity->targetCPU), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_send_11b_antsel (mtlk_core_t *core, const mtlk_11b_antsel_t *antsel) { #define _11B_ANTSEL_ROUNDROBIN 4 /* TODO: move this define to the mac shared files */ int res = MTLK_ERR_UNKNOWN; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_ANT_SELECTION_11B *umi_11b_antsel = NULL; BOOL valid_roundrobin; BOOL valid_ant_sel; uint32 tx_hw_supported_antenna_mask; uint32 rx_hw_supported_antenna_mask; mtlk_hw_t *hw; MTLK_ASSERT(core != NULL); MTLK_ASSERT(antsel != NULL); MTLK_STATIC_ASSERT(MAX_NUM_TX_ANTENNAS <= _11B_ANTSEL_ROUNDROBIN); MTLK_STATIC_ASSERT(MAX_NUM_RX_ANTENNAS <= _11B_ANTSEL_ROUNDROBIN); hw = mtlk_vap_get_hw(core->vap_handle); tx_hw_supported_antenna_mask = hw_get_tx_antenna_mask(hw); rx_hw_supported_antenna_mask = hw_get_rx_antenna_mask(hw); /* rate field is set only when txAnt and rxAnt set to Round Robin mode, otherwise the rate value should be 0 */ valid_roundrobin = (antsel->txAnt == _11B_ANTSEL_ROUNDROBIN) && (antsel->rxAnt == _11B_ANTSEL_ROUNDROBIN) && (antsel->rate != 0); valid_ant_sel = (antsel->rate == 0) && (antsel->txAnt < MAX_NUM_TX_ANTENNAS) && (antsel->rxAnt < MAX_NUM_RX_ANTENNAS); if (!valid_roundrobin && !valid_ant_sel) { ELOG_DDDD("CID-%04x: Incorrect configuration: txAnt=%d, rxAnt=%d, rate=%d", mtlk_vap_get_oid(core->vap_handle), antsel->txAnt, antsel->rxAnt, antsel->rate); res = MTLK_ERR_PARAMS; goto END; } if (valid_ant_sel && !((tx_hw_supported_antenna_mask & (1 << antsel->txAnt)) && (rx_hw_supported_antenna_mask & (1 << antsel->rxAnt)))) { ELOG_DDDDD("CID-%04x: Antenna selection is not supported by HW: txAnt=%d, rxAnt=%d, TX/RX mask: 0x%x/0x%x", mtlk_vap_get_oid(core->vap_handle), antsel->txAnt, antsel->rxAnt, tx_hw_supported_antenna_mask, rx_hw_supported_antenna_mask); res = MTLK_ERR_PARAMS; goto END; } man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { res = MTLK_ERR_NO_RESOURCES; goto END; } man_entry->id = UM_MAN_SEND_11B_SET_ANT_REQ; man_entry->payload_size = sizeof(*umi_11b_antsel); umi_11b_antsel = (UMI_ANT_SELECTION_11B *)man_entry->payload; umi_11b_antsel->txAnt = antsel->txAnt; umi_11b_antsel->rxAnt = antsel->rxAnt; umi_11b_antsel->rate = antsel->rate; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Cannot send UM_MAN_SEND_11B_SET_ANT_REQ to the FW (err=%d)", mtlk_vap_get_oid(core->vap_handle), res); goto END; } END: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static int _mtlk_core_set_11b_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; wave_radio_t *radio; mtlk_11b_cfg_t *_11b_cfg = NULL; uint32 _11b_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(core != NULL); radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(radio != NULL); _11b_cfg = mtlk_clpb_enum_get_next(clpb, &_11b_cfg_size); MTLK_CLPB_TRY(_11b_cfg, _11b_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(_11b_cfg, antsel, _mtlk_core_send_11b_antsel, (core, &_11b_cfg->antsel), res); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_11B_ANTSEL_TXANT, _11b_cfg->antsel.txAnt); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_11B_ANTSEL_RXANT, _11b_cfg->antsel.rxAnt); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_11B_ANTSEL_RATE, _11b_cfg->antsel.rate); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_receive_11b_antsel (mtlk_core_t *core, mtlk_11b_antsel_t *antsel) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_ANT_SELECTION_11B *umi_11b_antsel = NULL; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) return MTLK_ERR_NO_RESOURCES; man_entry->id = UM_MAN_SEND_11B_SET_ANT_REQ; man_entry->payload_size = sizeof(*umi_11b_antsel); umi_11b_antsel = (UMI_ANT_SELECTION_11B *)man_entry->payload; umi_11b_antsel->getSetOperation = API_GET_OPERATION; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK == res) { antsel->txAnt = umi_11b_antsel->txAnt; antsel->rxAnt = umi_11b_antsel->rxAnt; antsel->rate = umi_11b_antsel->rate; } else { ELOG_D("CID-%04x: Failed to receive UM_MAN_SEND_11B_SET_ANT_REQ", mtlk_vap_get_oid(core->vap_handle)); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_get_11b_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_11b_cfg_t _11b_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&_11b_cfg, 0, sizeof(_11b_cfg)); MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_SET_ITEM_BY_FUNC(&_11b_cfg, antsel, _mtlk_core_receive_11b_antsel, (core, &_11b_cfg.antsel), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &_11b_cfg, sizeof(_11b_cfg)); } return res; } static int _mtlk_core_set_recovery_cfg (mtlk_handle_t hcore, const void *data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_rcvry_cfg_t *_rcvry_cfg = NULL; uint32 _rcvry_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); _rcvry_cfg = mtlk_clpb_enum_get_next(clpb, &_rcvry_cfg_size); MTLK_CLPB_TRY(_rcvry_cfg, _rcvry_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(_rcvry_cfg, recovery_cfg, wave_rcvry_cfg_set, (mtlk_vap_get_hw(core->vap_handle), &_rcvry_cfg->recovery_cfg), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_recovery_cfg (mtlk_handle_t hcore, const void *data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_rcvry_cfg_t _rcvry_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&_rcvry_cfg, 0, sizeof(_rcvry_cfg)); MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_SET_ITEM_BY_FUNC(&_rcvry_cfg, recovery_cfg, wave_rcvry_cfg_get, (mtlk_vap_get_hw(core->vap_handle), &_rcvry_cfg.recovery_cfg), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &_rcvry_cfg, sizeof(_rcvry_cfg)); } return res; } static int _mtlk_core_get_recovery_stats (mtlk_handle_t hcore, const void *data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_rcvry_stats_t _rcvry_stats; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); memset(&_rcvry_stats, 0, sizeof(_rcvry_stats)); MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_SET_ITEM_BY_FUNC_VOID(&_rcvry_stats, recovery_stats, wave_hw_get_recovery_stats, (mtlk_vap_get_hw(core->vap_handle), &_rcvry_stats.recovery_stats)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() return mtlk_clpb_push_res_data(clpb, res, &_rcvry_stats, sizeof(_rcvry_stats)); } static int _mtlk_core_stop_lm(mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), &res); if (!man_entry) { ELOG_D("CID-%04x: Can't stop lower MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NO_MEM; goto end; } man_entry->id = UM_LM_STOP_REQ; man_entry->payload_size = 0; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Can't stop lower MAC, timed-out", mtlk_vap_get_oid(core->vap_handle)); } mtlk_txmm_msg_cleanup(&man_msg); end: return res; } static int _mtlk_core_get_iw_generic (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; UMI_GENERIC_MAC_REQUEST *req_df_cfg = NULL; UMI_GENERIC_MAC_REQUEST *pdata = NULL; uint32 req_df_cfg_size; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); req_df_cfg = mtlk_clpb_enum_get_next(clpb, &req_df_cfg_size); MTLK_CLPB_TRY(req_df_cfg, req_df_cfg_size) man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), &res); if (!man_entry) { ELOG_D("CID-%04x: Can't send request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NO_MEM); } pdata = (UMI_GENERIC_MAC_REQUEST*)man_entry->payload; man_entry->id = UM_MAN_GENERIC_MAC_REQ; man_entry->payload_size = sizeof(*pdata); pdata->opcode= cpu_to_le32(req_df_cfg->opcode); pdata->size= cpu_to_le32(req_df_cfg->size); pdata->action= cpu_to_le32(req_df_cfg->action); pdata->res0= cpu_to_le32(req_df_cfg->res0); pdata->res1= cpu_to_le32(req_df_cfg->res1); pdata->res2= cpu_to_le32(req_df_cfg->res2); pdata->retStatus= cpu_to_le32(req_df_cfg->retStatus); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Can't send generic request to MAC, timed-out", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_EXIT(res); } /* Send response to DF user */ pdata->opcode= cpu_to_le32(pdata->opcode); pdata->size= cpu_to_le32(pdata->size); pdata->action= cpu_to_le32(pdata->action); pdata->res0= cpu_to_le32(pdata->res0); pdata->res1= cpu_to_le32(pdata->res1); pdata->res2= cpu_to_le32(pdata->res2); pdata->retStatus= cpu_to_le32(pdata->retStatus); res = mtlk_clpb_push(clpb, pdata, sizeof(*pdata)); MTLK_CLPB_FINALLY(res) if (man_entry) mtlk_txmm_msg_cleanup(&man_msg); /* Don't need to push result to clipboard */ return res; MTLK_CLPB_END } static int _mtlk_core_gen_dataex_get_connection_stats (mtlk_core_t *core, WE_GEN_DATAEX_REQUEST *preq, mtlk_clpb_t *clpb) { int res = MTLK_ERR_OK; WE_GEN_DATAEX_CONNECTION_STATUS dataex_conn_status; WE_GEN_DATAEX_RESPONSE resp; int nof_connected; const sta_entry *sta = NULL; mtlk_stadb_iterator_t iter; memset(&resp, 0, sizeof(resp)); memset(&dataex_conn_status, 0, sizeof(dataex_conn_status)); resp.ver = WE_GEN_DATAEX_PROTO_VER; resp.status = WE_GEN_DATAEX_SUCCESS; resp.datalen = sizeof(WE_GEN_DATAEX_CONNECTION_STATUS); if (preq->datalen < resp.datalen) { return MTLK_ERR_NO_MEM; } memset(&dataex_conn_status, 0, sizeof(WE_GEN_DATAEX_CONNECTION_STATUS)); nof_connected = 0; sta = mtlk_stadb_iterate_first(&core->slow_ctx->stadb, &iter); if (sta) { do { WE_GEN_DATAEX_DEVICE_STATUS dataex_dev_status; dataex_dev_status.u32RxCount = mtlk_sta_get_stat_cntr_rx_frames(sta); dataex_dev_status.u32TxCount = mtlk_sta_get_stat_cntr_tx_frames(sta); resp.datalen += sizeof(WE_GEN_DATAEX_DEVICE_STATUS); if (preq->datalen < resp.datalen) { res = MTLK_ERR_NO_MEM; break; } res = mtlk_clpb_push(clpb, &dataex_dev_status, sizeof(WE_GEN_DATAEX_DEVICE_STATUS)); if (MTLK_ERR_OK != res) { break; } nof_connected++; sta = mtlk_stadb_iterate_next(&iter); } while (sta); mtlk_stadb_iterate_done(&iter); } if (MTLK_ERR_OK == res) { dataex_conn_status.u32NumOfConnections = nof_connected; res = mtlk_clpb_push(clpb, &dataex_conn_status, sizeof(WE_GEN_DATAEX_CONNECTION_STATUS)); } if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &resp, sizeof(resp)); } return res; } static int _mtlk_core_gen_dataex_get_status (mtlk_core_t *core, WE_GEN_DATAEX_REQUEST *preq, mtlk_clpb_t *clpb) { int res = MTLK_ERR_OK; const sta_entry *sta; WE_GEN_DATAEX_RESPONSE resp; WE_GEN_DATAEX_STATUS status; mtlk_stadb_iterator_t iter; memset(&resp, 0, sizeof(resp)); memset(&status, 0, sizeof(status)); if (preq->datalen < sizeof(status)) { resp.status = WE_GEN_DATAEX_DATABUF_TOO_SMALL; resp.datalen = sizeof(status); goto end; } resp.ver = WE_GEN_DATAEX_PROTO_VER; resp.status = WE_GEN_DATAEX_SUCCESS; resp.datalen = sizeof(status); memset(&status, 0, sizeof(status)); status.security_on = 0; status.wep_enabled = 0; sta = mtlk_stadb_iterate_first(&core->slow_ctx->stadb, &iter); if (sta) { do { /* Check global WEP enabled flag only if some STA connected */ if ((mtlk_sta_get_cipher(sta) != IW_ENCODE_ALG_NONE) || core->slow_ctx->wep_enabled) { status.security_on = 1; if (core->slow_ctx->wep_enabled) { status.wep_enabled = 1; } break; } sta = mtlk_stadb_iterate_next(&iter); } while (sta); mtlk_stadb_iterate_done(&iter); } status.scan_started = mtlk_core_scan_is_running(core); if (!mtlk_vap_is_slave_ap(core->vap_handle)) { status.frequency_band = core_cfg_get_freq_band_cur(core); } else { status.frequency_band = MTLK_HW_BAND_NONE; } status.link_up = (mtlk_core_get_net_state(core) == NET_STATE_CONNECTED) ? 1 : 0; res = mtlk_clpb_push(clpb, &status, sizeof(status)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &resp, sizeof(resp)); } end: return res; } static int _mtlk_core_gen_data_exchange (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_ui_gen_data_t *req = NULL; uint32 req_size; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); req = mtlk_clpb_enum_get_next(clpb, &req_size); MTLK_CLPB_TRY(req, req_size) switch (req->request.cmd_id) { case WE_GEN_DATAEX_CMD_CONNECTION_STATS: res = _mtlk_core_gen_dataex_get_connection_stats(core, &req->request, clpb); break; case WE_GEN_DATAEX_CMD_STATUS: res = _mtlk_core_gen_dataex_get_status(core, &req->request, clpb); break; default: MTLK_ASSERT(0); } MTLK_CLPB_FINALLY(res) return res; MTLK_CLPB_END } uint32 mtlk_core_get_available_bitrates (struct nic *nic) { uint8 net_mode; uint32 mask = 0; /* Get all needed MIBs */ net_mode = core_cfg_get_network_mode(nic); mask = get_operate_rate_set(net_mode); ILOG3_D("Configuration mask: 0x%08x", mask); return mask; } int mtlk_core_is_chandef_identical(struct mtlk_chan_def *chan1, struct mtlk_chan_def *chan2) { return (chan1->width == chan2->width && chan1->center_freq1 == chan2->center_freq1 && chan1->center_freq2 == chan2->center_freq2 && chan1->chan.center_freq == chan2->chan.center_freq); } int mtlk_core_is_band_supported(mtlk_core_t *nic, mtlk_hw_band_e band) { mtlk_hw_t *hw = mtlk_vap_get_hw(nic->vap_handle); wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); unsigned radio_id = wave_radio_id_get(radio); int res = MTLK_ERR_NOT_SUPPORTED; if ((band != MTLK_HW_BAND_BOTH) && /* VAP (station or AP role) can't be dual-band */ (mtlk_is_band_supported(HANDLE_T(hw), radio_id, band))) { res = MTLK_ERR_OK; } return res; } int __MTLK_IFUNC hw_mmb_set_rtlog_cfg(mtlk_hw_t *hw, void *buff, uint32 size); static int _mtlk_core_set_rtlog_cfg (mtlk_handle_t hcore, const void* data, uint32 size) { mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 cfg_size; void *cfg_data; /* FIXME */ MTLK_ASSERT(sizeof(mtlk_clpb_t*) == size); cfg_data = mtlk_clpb_enum_get_next(clpb, &cfg_size); MTLK_ASSERT(NULL != cfg_data); if (NULL == cfg_data) { ELOG_SD("%s(%d): failed to get data from clipboard", __FUNCTION__, __LINE__); return MTLK_ERR_UNKNOWN; } mtlk_dump(2, cfg_data, MIN(64, cfg_size), "cfg_data"); /* Don't need to push result to clipboard */ return hw_mmb_set_rtlog_cfg(mtlk_vap_get_hw(core->vap_handle), cfg_data, cfg_size); } static int _mtlk_core_mcast_group_id_action (mtlk_handle_t core_object, const void *payload, uint32 size) { struct nic *nic = HANDLE_T_PTR(struct nic, core_object); mtlk_core_ui_mc_action_t *req = (mtlk_core_ui_mc_action_t *)payload; sta_entry *sta = NULL; MTLK_ASSERT(size == sizeof(mtlk_core_ui_mc_action_t)); ILOG1_DDSDY("CID-%04x: action=%d (%s), group=%d, sta addr=%Y", mtlk_vap_get_oid(nic->vap_handle), req->action, ((req->action == MTLK_MC_STA_JOIN_GROUP) ? "join group" : ((req->action == MTLK_MC_STA_LEAVE_GROUP) ? "leave group" : "unknown")), req->grp_id, &req->sta_mac_addr); if (MTLK_IPv4 == req->mc_addr.type) ILOG1_D("dst IPv4:%B", htonl(req->mc_addr.grp_ip.ip4_addr.s_addr)); else ILOG1_K("dst IPv6:%K", req->mc_addr.grp_ip.ip6_addr.s6_addr); sta = mtlk_stadb_find_sta(&nic->slow_ctx->stadb, req->sta_mac_addr.au8Addr); if (NULL == sta) { sta = mtlk_hstdb_find_sta(&nic->slow_ctx->hstdb, req->sta_mac_addr.au8Addr); if (NULL == sta) { ILOG1_DY("CID-%04x: can't find sta:%Y", mtlk_vap_get_oid(nic->vap_handle), req->sta_mac_addr.au8Addr); return MTLK_ERR_OK; } } mtlk_mc_update_group_id_sta(nic, req->grp_id, req->action, &req->mc_addr, sta); mtlk_sta_decref(sta); return MTLK_ERR_OK; } int _mtlk_core_mcast_helper_group_id_action (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_core_ui_mc_update_sta_db_t *req; unsigned r_size; int res = MTLK_ERR_OK; ILOG1_V("mcast_helper group action invoked"); MTLK_ASSERT(sizeof(mtlk_clpb_t *) == data_size); req = mtlk_clpb_enum_get_next(clpb, &r_size); MTLK_CLPB_TRY(req, r_size) mtlk_mc_update_stadb(core, req); mtlk_osal_mem_free(req->macs_list); MTLK_CLPB_FINALLY(res) return res; MTLK_CLPB_END } int mtlk_core_update_network_mode(mtlk_core_t* nic, uint8 net_mode) { mtlk_core_t *core = nic; uint8 band_new = net_mode_to_band(net_mode); wave_radio_t *radio; MTLK_ASSERT(NULL != nic); radio = wave_vap_radio_get(nic->vap_handle); if (mtlk_core_is_band_supported(core, band_new) != MTLK_ERR_OK) { if (band_new == MTLK_HW_BAND_BOTH) { /* * Just in case of single-band hardware * continue to use `default' frequency band, * which is de facto correct. */ ELOG_D("CID-%04x: dualband isn't supported", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_OK; } else { ELOG_DSD("CID-%04x: %s band isn't supported (%d)", mtlk_vap_get_oid(core->vap_handle), mtlk_eeprom_band_to_string(net_mode_to_band(net_mode)), net_mode); return MTLK_ERR_NOT_SUPPORTED; } } ILOG1_S("Set Network Mode to %s", net_mode_to_string(net_mode)); MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_NET_MODE_CUR, net_mode); MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_NET_MODE_CFG, net_mode); MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_IS_HT_CUR, is_ht_net_mode(net_mode)); MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_IS_HT_CFG, is_ht_net_mode(net_mode)); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_FREQ_BAND_CFG, band_new); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_FREQ_BAND_CUR, band_new); /* The set of supported bands may be changed by this request. */ /* Scan cache to be cleared to throw out BSS from unsupported now bands */ mtlk_cache_clear(&core->slow_ctx->cache); return MTLK_ERR_OK; } static int _mtlk_core_get_ta_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_ta_cfg_t *ta_cfg; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); ta_cfg = mtlk_osal_mem_alloc(sizeof(*ta_cfg), MTLK_MEM_TAG_CLPB); if(ta_cfg == NULL) { ELOG_D("CID-%04x: Can't allocate clipboard data", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_NO_MEM; } memset(ta_cfg, 0, sizeof(*ta_cfg)); MTLK_CFG_SET_ITEM(ta_cfg, timer_resolution, mtlk_ta_get_timer_resolution_ticks(mtlk_vap_get_ta(core->vap_handle))); MTLK_CFG_SET_ITEM_BY_FUNC_VOID(ta_cfg, debug_info, mtlk_ta_get_debug_info, (mtlk_vap_get_ta(core->vap_handle), &ta_cfg->debug_info)); res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push_nocopy(clpb, ta_cfg, sizeof(*ta_cfg)); if(MTLK_ERR_OK != res) { mtlk_osal_mem_free(ta_cfg); } } return res; } static int _mtlk_core_set_ta_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_ta_cfg_t *ta_cfg; uint32 ta_cfg_size; mtlk_core_t *core = (mtlk_core_t*)hcore; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); ta_cfg = mtlk_clpb_enum_get_next(clpb, &ta_cfg_size); MTLK_CLPB_TRY(ta_cfg, ta_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_CHECK_ITEM_AND_CALL(ta_cfg, timer_resolution, mtlk_ta_set_timer_resolution_ticks, (mtlk_vap_get_ta(core->vap_handle), ta_cfg->timer_resolution), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } /* * Definitions and macros below are used only for the packet's header transformation * For more information, please see following documents: * - IEEE 802.1H standard * - IETF RFC 1042 * - IEEE 802.11n standard draft 5 Annex M * */ #define _8021H_LLC_HI4BYTES 0xAAAA0300 #define _8021H_LLC_LO2BYTES_CONVERT 0x0000 #define RFC1042_LLC_LO2BYTES_TUNNEL 0x00F8 /* Default ISO/IEC conversion * we need to keep full LLC header and store packet length in the T/L subfield */ #define _8021H_CONVERT(ether_header, nbuf, data_offset) \ data_offset -= sizeof(struct ethhdr); \ ether_header = (struct ethhdr *)(nbuf->data + data_offset); \ ether_header->h_proto = htons(nbuf->len - data_offset - sizeof(struct ethhdr)) /* 802.1H encapsulation * we need to remove LLC header except the 'type' field */ #define _8021H_DECAPSULATE(ether_header, nbuf, data_offset) \ data_offset -= sizeof(struct ethhdr) - (sizeof(mtlk_snap_hdr_t) + sizeof(mtlk_llc_hdr_t)); \ ether_header = (struct ethhdr *)(nbuf->data + data_offset) static int _handle_rx_ind (mtlk_core_t *nic, mtlk_nbuf_t *nbuf, mtlk_core_handle_rx_data_t *data) { int res = MTLK_ERR_OK; /* Do not free nbuf */ uint32 qos = 0; sta_entry *src_sta = NULL; struct ethhdr *ether_header = (struct ethhdr *)nbuf->data; ILOG4_V("Rx indication"); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_DAT_FRAMES_RECEIVED); mtlk_eth_parser(nbuf->data, nbuf->len, mtlk_df_get_name(mtlk_vap_get_df(nic->vap_handle)), "RX"); mtlk_dump(3, nbuf->data, MIN(64, nbuf->len), "dump of recvd 802.3 packet"); /* Try to find source MAC of transmitter */ src_sta = mtlk_stadb_find_sid(&nic->slow_ctx->stadb, data->sid); if (src_sta == NULL) { ILOG2_V("SOURCE of RX packet not found!"); res = MTLK_ERR_NOT_IN_USE; /* Free nbuf */ goto end; } ILOG5_YD("STA %Y found by SID %d", src_sta->info.addr.au8Addr, data->sid); qos = data->priority; #ifdef MTLK_DEBUG_CHARIOT_OOO { /* Get pointer to private area */ mtlk_nbuf_priv_t *nbuf_priv = mtlk_nbuf_priv(nbuf); nbuf_priv->seq_qos = qos; } #endif if (__LIKELY(qos < NTS_TIDS_GEN6)) nic->pstats.ac_rx_counter[qos]++; else ELOG_D("Invalid priority: %u", qos); nic->pstats.sta_session_rx_packets++; /* In Backhaul AP mode only one STA can be connected (IRE), so we do not need to update hostdb */ if (MESH_MODE_BACKHAUL_AP != MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_MESH_MODE)) { /* Check if packet received from WDS HOST or 4 address station */ if (src_sta->peer_ap || mtlk_sta_is_4addr(src_sta)) { /* On AP we need to update HOST's entry in database of registered * HOSTs behind connected STAs */ mtlk_hstdb_update_host(&nic->slow_ctx->hstdb, ether_header->h_source, src_sta); } } { mtlk_core_handle_tx_data_t tx_data; memset(&tx_data, 0, sizeof(tx_data)); tx_data.nbuf = nbuf; mtlk_core_analyze_and_send_up(nic, &tx_data, src_sta); } end: if (src_sta) mtlk_sta_decref(src_sta); /* De-reference of find */ return res; } /* Funstions for STA DB hash */ __INLINE void _mtlk_core_flush_ieee_addr_list (mtlk_core_t *nic, ieee_addr_list_t *list, char *name) { mtlk_hash_enum_t e; MTLK_HASH_ENTRY_T(ieee_addr) *h; ieee_addr_entry_t *ieee_addr_entry; MTLK_UNREFERENCED_PARAM(name); ILOG2_DS("CID-%04x: %s list flush", mtlk_vap_get_oid(nic->vap_handle), name); mtlk_osal_lock_acquire(&list->ieee_addr_lock); h = mtlk_hash_enum_first_ieee_addr(&list->hash, &e); while (h) { ILOG2_Y("\t remove %Y", h->key.au8Addr); ieee_addr_entry = MTLK_CONTAINER_OF(h, ieee_addr_entry_t, hentry); mtlk_hash_remove_ieee_addr(&list->hash, &ieee_addr_entry->hentry); mtlk_osal_mem_free(ieee_addr_entry); h = mtlk_hash_enum_next_ieee_addr(&list->hash, &e); } mtlk_osal_lock_release(&list->ieee_addr_lock); } __INLINE BOOL _mtlk_core_ieee_addr_entry_exists (mtlk_core_t *nic, const IEEE_ADDR *addr, ieee_addr_list_t *list, char *name) { MTLK_HASH_ENTRY_T(ieee_addr) *h; MTLK_UNREFERENCED_PARAM(name); ILOG3_DSY("CID-%04x: looking for %s list entry %Y", mtlk_vap_get_oid(nic->vap_handle), name, addr->au8Addr); mtlk_osal_lock_acquire(&list->ieee_addr_lock); h = mtlk_hash_find_ieee_addr(&list->hash, addr); mtlk_osal_lock_release(&list->ieee_addr_lock); if (!h) { ILOG3_DSY("CID-%04x: %s list entry NOT found %Y", mtlk_vap_get_oid(nic->vap_handle), name, addr->au8Addr); } return (h != NULL); } __INLINE void* __mtlk_core_add_ieee_addr_entry_internal (mtlk_core_t *nic, const IEEE_ADDR *addr, ieee_addr_list_t *list, char *name, size_t extra_size) { ieee_addr_entry_t *ieee_addr_entry = NULL; MTLK_HASH_ENTRY_T(ieee_addr) *h; size_t alloc_size = sizeof(*ieee_addr_entry) + extra_size; ieee_addr_entry = mtlk_osal_mem_alloc(alloc_size, MTLK_MEM_TAG_IEEE_ADDR_LIST); if (!ieee_addr_entry) { WLOG_V("Can't alloc list entry"); return NULL; } memset(ieee_addr_entry, 0, alloc_size); mtlk_osal_lock_acquire(&list->ieee_addr_lock); h = mtlk_hash_insert_ieee_addr(&list->hash, addr, &ieee_addr_entry->hentry); mtlk_osal_lock_release(&list->ieee_addr_lock); if (h) { mtlk_osal_mem_free(ieee_addr_entry); ieee_addr_entry = MTLK_CONTAINER_OF(h, ieee_addr_entry_t, hentry); WLOG_DYS("CID-%04x: %Y already in %s list", mtlk_vap_get_oid(nic->vap_handle), addr->au8Addr, name); } else { ILOG3_DSY("CID-%04x: %s list entry add %Y", mtlk_vap_get_oid(nic->vap_handle), name, addr->au8Addr); } return ieee_addr_entry; } __INLINE int _mtlk_core_add_ieee_addr_entry (mtlk_core_t *nic, const IEEE_ADDR *addr, ieee_addr_list_t *list, char *name) { return ((__mtlk_core_add_ieee_addr_entry_internal (nic, addr, list, name, 0) == NULL) ? MTLK_ERR_NO_MEM : MTLK_ERR_OK); } __INLINE int _mtlk_core_del_ieee_addr_entry (mtlk_core_t* nic, const IEEE_ADDR *addr, ieee_addr_list_t *list, char *name, BOOL entry_expected) { MTLK_HASH_ENTRY_T(ieee_addr) *h; ILOG3_DSY("CID-%04x: %s list entry del %Y", mtlk_vap_get_oid(nic->vap_handle), name, addr->au8Addr); mtlk_osal_lock_acquire(&list->ieee_addr_lock); h = mtlk_hash_find_ieee_addr(&list->hash, addr); /* find address list entry in address list */ if (h) { ieee_addr_entry_t *ieee_addr_entry = MTLK_CONTAINER_OF(h, ieee_addr_entry_t, hentry); mtlk_hash_remove_ieee_addr(&list->hash, &ieee_addr_entry->hentry); mtlk_osal_mem_free(ieee_addr_entry); mtlk_osal_lock_release(&list->ieee_addr_lock); } else { mtlk_osal_lock_release(&list->ieee_addr_lock); if (entry_expected) { ILOG0_DSY("CID-%04x: %s list entry %Y doesn't exist", mtlk_vap_get_oid(nic->vap_handle), name, addr->au8Addr); } else { ILOG2_DSY("CID-%04x: %s list entry %Y doesn't exist", mtlk_vap_get_oid(nic->vap_handle), name, addr->au8Addr); } } return MTLK_ERR_OK; } __INLINE int _mtlk_core_dump_ieee_addr_list (mtlk_core_t *nic, ieee_addr_list_t *list, char *name, const void* data, uint32 data_size) { mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_hash_enum_t e; MTLK_HASH_ENTRY_T(ieee_addr) *h; int res = MTLK_ERR_UNKNOWN; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(nic); MTLK_ASSERT(clpb); MTLK_UNREFERENCED_PARAM(name); ILOG2_DS("CID-%04x: %s list dump", mtlk_vap_get_oid(nic->vap_handle), name); mtlk_osal_lock_acquire(&list->ieee_addr_lock); h = mtlk_hash_enum_first_ieee_addr(&list->hash, &e); while (h) { ILOG2_Y("\t dump %Y", h->key.au8Addr); if (MTLK_ERR_OK != (res = mtlk_clpb_push(clpb, h, sizeof(*h)))) { mtlk_osal_lock_release(&list->ieee_addr_lock); goto err_push; } h = mtlk_hash_enum_next_ieee_addr(&list->hash, &e); } mtlk_osal_lock_release(&list->ieee_addr_lock); return MTLK_ERR_OK; err_push: mtlk_clpb_purge(clpb); return res; } __INLINE int __mtlk_core_add_blacklist_addr_entry (mtlk_core_t *nic, struct intel_vendor_blacklist_cfg *blacklist_cfg, ieee_addr_list_t *list, char *name) { ieee_addr_entry_t *ieee_addr_entry = NULL; ieee_addr_entry = __mtlk_core_add_ieee_addr_entry_internal(nic, &blacklist_cfg->addr, list, name, sizeof(blacklist_snr_info_t)); if (ieee_addr_entry) { /* STA in blacklist.Update the params if any */ ieee_addr_entry->data[0] = blacklist_cfg->snrProbeHWM; ieee_addr_entry->data[1] = blacklist_cfg->snrProbeLWM; return MTLK_ERR_OK; } else { return MTLK_ERR_NO_MEM; } } /* STA DB hash for filtering the Probe Responses 1) on broadcast Probe Request (offline) 2) on unicast Probe Request */ static void _mtlk_core_flush_bcast_probe_resp_list (mtlk_core_t *nic) { _mtlk_core_flush_ieee_addr_list(nic, &nic->broadcast_probe_resp_sta_list, "broadcast"); } static BOOL _mtlk_core_bcast_probe_resp_entry_exists (mtlk_core_t *nic, const IEEE_ADDR *addr) { return _mtlk_core_ieee_addr_entry_exists(nic, addr, &nic->broadcast_probe_resp_sta_list, "broadcast"); } static int _mtlk_core_add_bcast_probe_resp_entry (mtlk_core_t* nic, const IEEE_ADDR *addr) { return _mtlk_core_add_ieee_addr_entry(nic, addr, &nic->broadcast_probe_resp_sta_list, "broadcast"); } static int _mtlk_core_del_bcast_probe_resp_entry (mtlk_core_t* nic, const IEEE_ADDR *addr) { return _mtlk_core_del_ieee_addr_entry(nic, addr, &nic->broadcast_probe_resp_sta_list, "broadcast", TRUE); } static void _mtlk_core_flush_ucast_probe_resp_list (mtlk_core_t *nic) { _mtlk_core_flush_ieee_addr_list(nic, &nic->unicast_probe_resp_sta_list, "unicast"); } static BOOL _mtlk_core_ucast_probe_resp_entry_exists (mtlk_core_t *nic, const IEEE_ADDR *addr) { return _mtlk_core_ieee_addr_entry_exists(nic, addr, &nic->unicast_probe_resp_sta_list, "unicast"); } static int _mtlk_core_add_ucast_probe_resp_entry (mtlk_core_t* nic, const IEEE_ADDR *addr) { return _mtlk_core_add_ieee_addr_entry(nic, addr, &nic->unicast_probe_resp_sta_list, "unicast"); } static int _mtlk_core_del_ucast_probe_resp_entry (mtlk_core_t* nic, const IEEE_ADDR *addr) { return _mtlk_core_del_ieee_addr_entry(nic, addr, &nic->unicast_probe_resp_sta_list, "unicast", TRUE); } /* This function must be called from Master VAP serializer context */ static __INLINE void mtlk_core_finalize_and_send_probe_resp(mtlk_core_t *core, mtlk_mngmnt_frame_t *frame) { uint64 cookie; frame_head_t *head_req, *head_resp; unsigned len; u8 *buf; head_req = (frame_head_t *) frame->frame; /* Need to remove HE IEs from probe response for clients that do not support HE */ if (!frame->probe_req_he_ie) { buf = core->slow_ctx->probe_resp_templ_non_he; len = core->slow_ctx->probe_resp_templ_non_he_len; } else { buf = core->slow_ctx->probe_resp_templ; len = core->slow_ctx->probe_resp_templ_len; } head_resp = (frame_head_t *) buf; /* we mess up the dst_addr in the template, but it's OK, we're under a lock and it will get copied into one of the queues in mgmt_tx */ head_resp->dst_addr = head_req->src_addr; ILOG3_DY("CID-%04x: Probe Response to %Y", mtlk_vap_get_oid(core->vap_handle), head_resp->dst_addr.au8Addr); /* check if have enough room in tx queue. Do not send probe response if not */ if (mtlk_mmb_bss_mgmt_tx_check(core->vap_handle)) { /* Search STA in list. Don't send if found */ if (_mtlk_core_bcast_probe_resp_entry_exists(core, &head_resp->dst_addr)) { ILOG2_DY("CID-%04x: Don't send Probe Response to %Y", mtlk_vap_get_oid(core->vap_handle), head_resp->dst_addr.au8Addr); mtlk_core_inc_cnt(core, MTLK_CORE_CNT_TX_PROBE_RESP_DROPPED); return; } /* * We are in serializer context. It is important to add entry to the list * prior to frame transmission is executed, as CFM may come nearly immediately * after HD is copied to the ring. The entry is removed from list in the * tasklet context, that might create a racing on entry removal. */ _mtlk_core_add_bcast_probe_resp_entry(core, &head_resp->dst_addr); if (MTLK_ERR_OK == mtlk_mmb_bss_mgmt_tx(core->vap_handle, buf, len, freq2lowchannum(frame->freq, CW_20), FALSE, TRUE, TRUE /* broadcast */, &cookie, PROCESS_MANAGEMENT, NULL, FALSE, NTS_TID_USE_DEFAULT)) { mtlk_core_inc_cnt(core, MTLK_CORE_CNT_TX_PROBE_RESP_SENT); } else { /* delete entry if TX failed */ _mtlk_core_del_bcast_probe_resp_entry(core, &head_resp->dst_addr); mtlk_core_inc_cnt(core, MTLK_CORE_CNT_TX_PROBE_RESP_DROPPED); } } else { /* no room in tx queue, frame is dropped */ mtlk_core_inc_cnt(core, MTLK_CORE_CNT_TX_PROBE_RESP_DROPPED); } } int __MTLK_IFUNC mtlk_send_softblock_msg_drop (mtlk_vap_handle_t vap_handle, void *data, int data_len) { mtlk_df_t *df = mtlk_vap_get_df(vap_handle); mtlk_df_user_t *df_user = mtlk_df_get_user(df); struct wireless_dev *wdev = mtlk_df_user_get_wdev(df_user); mtlk_nbuf_t *evt_nbuf; uint8* cp; MTLK_ASSERT(NULL != wdev); evt_nbuf = wv_cfg80211_vendor_event_alloc(wdev, data_len, LTQ_NL80211_VENDOR_EVENT_SOFTBLOCK_DROP); if (!evt_nbuf) { ELOG_D("Malloc event fail. data_len = %d", data_len); return MTLK_ERR_NO_MEM; } cp = mtlk_df_nbuf_put(evt_nbuf, data_len); wave_memcpy(cp, data_len, data, data_len); wv_cfg80211_vendor_event(evt_nbuf); return MTLK_ERR_OK; } enum { DRV_SOFTBLOCK_ACCEPT = 0, DRV_SOFTBLOCK_DROP = 1, DRV_SOFTBLOCK_ALLOW = 2, DRV_MULTI_AP_BLACKLIST_FOUND = 3 }; static int _mtlk_core_mngmnt_softblock_notify (mtlk_core_t *nic, const IEEE_ADDR *addr, ieee_addr_list_t *list, char *name, int8 rx_snr_db, BOOL isbroadcast, struct intel_vendor_event_msg_drop *prb_req_drop) { MTLK_HASH_ENTRY_T(ieee_addr) *h; ieee_addr_entry_t *entry; int ret = DRV_SOFTBLOCK_ACCEPT; blacklist_snr_info_t *blacklist_snr_info = NULL; if (MTLK_CORE_PDB_GET_INT(nic, PARAM_DB_CORE_SOFTBLOCK_DISABLE)) return ret; MTLK_UNREFERENCED_PARAM(name); ILOG3_DSY("CID-%04x: looking for %s SoftBlock entry %Y", mtlk_vap_get_oid(nic->vap_handle), name, addr->au8Addr); mtlk_osal_lock_acquire(&list->ieee_addr_lock); h = mtlk_hash_find_ieee_addr(&list->hash, addr); /* finding the mac addr only from the list in address list */ mtlk_osal_lock_release(&list->ieee_addr_lock); if (h) { entry = MTLK_CONTAINER_OF(h, ieee_addr_entry_t, hentry); ret = DRV_MULTI_AP_BLACKLIST_FOUND; blacklist_snr_info = (blacklist_snr_info_t *)&entry->data[0]; if ((blacklist_snr_info->snrProbeHWM != 0) && (blacklist_snr_info->snrProbeLWM != 0)) { /* The case when the notification to be sent to hostap since its configured */ prb_req_drop->rx_snr = rx_snr_db; prb_req_drop->broadcast = isbroadcast; prb_req_drop->msgtype = MAN_TYPE_PROBE_REQ; prb_req_drop->reason = 0; prb_req_drop->rejected = 0; prb_req_drop->addr = *addr; prb_req_drop->vap_id = mtlk_vap_get_id(nic->vap_handle); if ((blacklist_snr_info->snrProbeHWM < rx_snr_db) || (blacklist_snr_info->snrProbeLWM > rx_snr_db)) { /* Silently Ignore the message */ ILOG1_DD("CID-%04x: mgmt::Probe Req Softblock dropped SNR: %d", mtlk_vap_get_oid(nic->vap_handle), rx_snr_db); /* Notify hostap its dropped */ ret = DRV_SOFTBLOCK_DROP; prb_req_drop->blocked = TRUE; /* Trigger notification */ mtlk_send_softblock_msg_drop(nic->vap_handle, prb_req_drop, sizeof(*prb_req_drop)); } else { ILOG1_DD("CID-%04x: mgmt::Probe Req Softblock allowed SNR: %d", mtlk_vap_get_oid(nic->vap_handle), rx_snr_db); /* Notify hostap its allowed */ prb_req_drop->blocked = FALSE; ret = DRV_SOFTBLOCK_ALLOW; /* Notification will be done when its sent after further checks */ } } else { return ret; } } return ret; } static __INLINE void __mtlk_core_mngmnt_frame_notify (mtlk_core_t *nic, const u8 *data, int size, int freq, unsigned subtype, mtlk_phy_info_t *phy_info, uint8 pmf_flags) { BOOL is_broadcast = FALSE; if (mtlk_vap_is_ap(nic->vap_handle)) { mtlk_df_t *df = mtlk_vap_get_df(nic->vap_handle); /* this checks vap_handle and df, cannot return NULL */ mtlk_df_user_t *df_user = mtlk_df_get_user(df); struct wireless_dev *wdev = mtlk_df_user_get_wdev(df_user); /* this checks df_user */ if (is_multicast_ether_addr((const u8 *)&(((frame_head_t*)data)->dst_addr))) { is_broadcast = TRUE; } /* don't notify about client that is in the blacklist */ if (_mtlk_core_blacklist_frame_drop(nic, (IEEE_ADDR *)& (((frame_head_t*)data)->src_addr), subtype, phy_info->snr_db, is_broadcast)) return; if (!wv_cfg80211_mngmn_frame(wdev, data, size, freq, phy_info->sig_dbm, phy_info->snr_db, subtype)) { ILOG3_D("CID-%04x: CFG80211 can't pass the RX mgmt frame to the kernel", mtlk_vap_get_oid(nic->vap_handle)); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_CFG80211_FAILED); mtlk_dump(3, data, MIN(size, 32), "RX BSS IND data (first 32 bytes):"); } } else { #if 1 /* FIXME: will be available in phy_info */ phy_info->rate_idx = mtlk_bitrate_info_to_rate_idx(phy_info->bitrate_info); #endif wv_ieee80211_mngmn_frame_rx(nic, data, size, freq, phy_info->sig_dbm, subtype, phy_info->rate_idx, phy_info->phy_mode, pmf_flags); } } static __INLINE ie_t *mtlk_core_find_essid(u8 *buf, unsigned len) { u8 *end = buf + len; ie_t *essid = NULL; while (!essid && buf < end) { ie_t *ie = (ie_t *) buf; if (ie->id == IE_SSID) essid = ie; buf += sizeof(ie_t) + ie->length; } if (buf > end) /* the SSID element was incomplete */ essid = NULL; return essid; } void copy_mtlk_chandef(struct mtlk_chan_def *mcd, struct mtlk_chan_def *mcs) { struct mtlk_channel *mc_dest = &mcd->chan; struct mtlk_channel *mc_src = &mcs->chan; mcd->center_freq1 = mcs->center_freq1; mcd->center_freq2 = mcs->center_freq2; mcd->width = mcs->width; mcd->is_noht = mcs->is_noht; mc_dest->dfs_state_entered = mc_src->dfs_state_entered; mc_dest->dfs_state = mc_src->dfs_state; mc_dest->band = mc_src->band; mc_dest->center_freq = mc_src->center_freq; mc_dest->flags = mc_src->flags; mc_dest->orig_flags = mc_src->orig_flags; mc_dest->max_antenna_gain = mc_src->max_antenna_gain; mc_dest->max_power = mc_src->max_power; mc_dest->max_reg_power = mc_src->max_reg_power; mc_dest->dfs_cac_ms = mc_src->dfs_cac_ms; } int __MTLK_IFUNC _mtlk_core_switch_channel_normal(mtlk_core_t *master_core, struct mtlk_chan_def *chandef) { mtlk_df_t *master_df = mtlk_vap_manager_get_master_df(mtlk_vap_get_manager(master_core->vap_handle)); mtlk_vap_handle_t master_vap_handle = mtlk_df_get_vap_handle(master_df); struct set_chan_param_data cpd; ILOG0_V("Seen a beacon changing channel to type normal"); memset(&cpd, 0, sizeof(cpd)); cpd.vap_id = mtlk_vap_get_id(master_vap_handle); cpd.ndev = mtlk_df_user_get_ndev(mtlk_df_get_user(master_df)); copy_mtlk_chandef(&cpd.chandef, chandef); cpd.switch_type = ST_NORMAL; cpd.block_tx_pre = FALSE; cpd.block_tx_post = FALSE; /* TRUE means waiting for radars */ cpd.radar_required = FALSE; /* we have a station up so we don't need radar checks */ _mtlk_df_user_invoke_core_async(master_df, WAVE_RADIO_REQ_SET_CHAN, &cpd, sizeof(cpd), NULL, 0); return MTLK_ERR_OK; } bool _mtlk_core_is_radar_chan(struct mtlk_channel *channel) { return (channel->flags & MTLK_CHAN_RADAR); } static int _mtlk_core_broadcast_mngmnt_frame_notify (mtlk_handle_t object, const void *data, uint32 data_size) { mtlk_mngmnt_frame_t *frame = (mtlk_mngmnt_frame_t *)data; struct nic *nic = HANDLE_T_PTR(struct nic, object); mtlk_core_t *cur_core; mtlk_vap_manager_t *vap_mng; mtlk_vap_handle_t vap_handle; uint8 *buf = frame->frame; int size = frame->size; int freq = frame->freq; unsigned subtype = frame->subtype; unsigned i, max_vaps; sta_entry *sta; IEEE_ADDR *src_addr; int disable_master_vap; int softblockcheck; struct intel_vendor_event_msg_drop prb_req_drop; MTLK_ASSERT (data_size == sizeof(mtlk_mngmnt_frame_t)); vap_mng = mtlk_vap_get_manager(nic->vap_handle); max_vaps = wave_radio_max_vaps_get(wave_vap_radio_get(nic->vap_handle)); src_addr = &((frame_head_t*)buf)->src_addr; for (i = 0; i < max_vaps; i++) { if (MTLK_ERR_OK != mtlk_vap_manager_get_vap_handle(vap_mng, i, &vap_handle)) { continue; /* VAP does not exist */ } cur_core = mtlk_vap_get_core(vap_handle); if (NET_STATE_CONNECTED != mtlk_core_get_net_state(cur_core)) { /* Core is not ready */ continue; } disable_master_vap = WAVE_VAP_RADIO_PDB_GET_INT(vap_handle, PARAM_DB_RADIO_DISABLE_MASTER_VAP); if (disable_master_vap && mtlk_vap_is_master(vap_handle)){ /* Dummy master VAP (in order to support reconf for all VAPs) */ continue; } sta = mtlk_stadb_find_sta(&cur_core->slow_ctx->stadb, src_addr->au8Addr); /* don't notify about unassociated client that is in the blacklist */ if ((sta == NULL) && _mtlk_core_blacklist_frame_drop(cur_core, src_addr, subtype, frame->phy_info.snr_db, TRUE)) continue; if (sta) mtlk_sta_decref(sta); if (subtype == MAN_TYPE_PROBE_REQ) { if (mtlk_vap_is_ap(vap_handle)) { ie_t *essid = NULL; mtlk_pdb_t *param_db_core = mtlk_vap_get_param_db(vap_handle); int hidden = wave_pdb_get_int(param_db_core, PARAM_DB_CORE_HIDDEN_SSID); u8 our_ssid[MIB_ESSID_LENGTH]; mtlk_pdb_size_t our_ssid_len = sizeof(our_ssid); if (size > sizeof(frame_head_t)) essid = mtlk_core_find_essid(buf + sizeof(frame_head_t), size - sizeof(frame_head_t)); if (MTLK_CORE_PDB_GET_BINARY(cur_core, PARAM_DB_CORE_ESSID, our_ssid, &our_ssid_len) != MTLK_ERR_OK) { ELOG_D("CID-%04x: Can't get the ESSID", mtlk_vap_get_oid(nic->vap_handle)); continue; } /* if ESSID given and matches ours */ if ((essid && essid->length == our_ssid_len && !memcmp((char *) essid + sizeof(ie_t), our_ssid, our_ssid_len)) || ((!essid || essid->length == 0) && !hidden)) /* or no ESSID or broadcast ESSID but we're not hidden */ { if (frame->probe_req_wps_ie) { ILOG3_V("Probe request with WPS IE received, notify hostapd"); __mtlk_core_mngmnt_frame_notify(cur_core, buf, size, freq, subtype, &frame->phy_info, frame->pmf_flags); /* hostapd will generate and send probe response */ continue; } if (frame->probe_req_interworking_ie) { ILOG3_V("Probe request with INTERWORKING IE received, notify hostapd"); __mtlk_core_mngmnt_frame_notify(cur_core, buf, size, freq, subtype, &frame->phy_info, frame->pmf_flags); /* hostapd will generate and send probe response */ continue; } if (frame->probe_req_vsie) { ILOG3_V("Probe request with VSIE received, notify hostapd"); __mtlk_core_mngmnt_frame_notify(cur_core, buf, size, freq, subtype, &frame->phy_info, frame->pmf_flags); /* hostapd will generate and send probe response */ continue; } /* case when wps, interworking, vs ies are not present */ if (cur_core->slow_ctx->probe_resp_templ) { softblockcheck = _mtlk_core_mngmnt_softblock_notify(cur_core, src_addr, &cur_core->multi_ap_blacklist, "multi-AP black", frame->phy_info.snr_db, TRUE, &prb_req_drop); if ((softblockcheck == DRV_SOFTBLOCK_ACCEPT) || (softblockcheck == DRV_SOFTBLOCK_ALLOW)) { /* All probe responses should be sent from master VAP in case of MBSSID */ if(MTLK_CORE_PDB_GET_INT(cur_core, PARAM_DB_CORE_MBSSID_VAP) > WAVE_RADIO_OPERATION_MODE_MBSSID_TRANSMIT_VAP) mtlk_core_finalize_and_send_probe_resp(mtlk_core_get_master(cur_core), frame); else mtlk_core_finalize_and_send_probe_resp(cur_core, frame); /* Notify hostap */ if (softblockcheck == DRV_SOFTBLOCK_ALLOW) { /* Trigger notification */ mtlk_send_softblock_msg_drop(cur_core->vap_handle, &prb_req_drop, sizeof(prb_req_drop)); } } } } } } else if (subtype == MAN_TYPE_BEACON) { if (!mtlk_vap_is_ap(vap_handle)) __mtlk_core_mngmnt_frame_notify(cur_core, buf, size, freq, subtype, &frame->phy_info, frame->pmf_flags); } else { __mtlk_core_mngmnt_frame_notify(cur_core, buf, size, freq, subtype, &frame->phy_info, frame->pmf_flags); } } /* for (i = 0; i < max_vaps; i++) */ mtlk_osal_mem_free(frame->frame); return MTLK_ERR_OK; } static BOOL _wave_core_cac_in_progress(mtlk_core_t *master_core) { MTLK_ASSERT(NULL != master_core); return !mtlk_osal_timer_is_stopped(&master_core->slow_ctx->cac_timer); } static int handle_rx_bss_ind(mtlk_core_t *nic, mtlk_core_handle_rx_bss_t *data) { int res = MTLK_ERR_OK; int disable_master_vap; uint16 frame_ctl; unsigned frame_type; mtlk_dump(4, data->buf, MIN(data->size, 32), "RX BSS IND data (first 32 bytes):"); if (data->size < sizeof(frame_head_t)) { ILOG1_D("CID-%04x: Management Frame length is wrong", mtlk_vap_get_oid(nic->vap_handle)); return MTLK_ERR_NOT_IN_USE; } frame_ctl = mtlk_wlan_pkt_get_frame_ctl(data->buf); frame_type = WLAN_FC_GET_TYPE(frame_ctl); /* 802.11n data frame from AP: |----------------------------------------------------------------| Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 6? | 2? | 0..2312 | 4 | |------|-------|-----|-----|-----|-----|-----|-----|---------|---| Descr. | Ctl |Dur/ID |Addr1|Addr2|Addr3| Seq |Addr4| QoS | Frame |fcs| | | | | | | Ctl | | Ctl | data | | |----------------------------------------------------------------| Total: 28-2346 bytes Existance of Addr4 in frame is optional and depends on To_DS From_DS flags. Existance of QoS_Ctl is also optional and depends on Ctl flags. (802.11n-D1.0 describes also HT Control (0 or 4 bytes) field after QoS_Ctl but we don't support this for now.) Interpretation of Addr1/2/3/4 depends on To_DS From_DS flags: To DS From DS Addr1 Addr2 Addr3 Addr4 --------------------------------------------- 0 0 DA SA BSSID N/A 0 1 DA BSSID SA N/A 1 0 BSSID SA DA N/A 1 1 RA TA DA SA frame data begins with 8 bytes of LLC/SNAP: |-----------------------------------| Bytes | 1 | 1 | 1 | 3 | 2 | |-----------------------------------| Descr. | LLC | SNAP | |-----------------------------------+ | DSAP | SSAP | Ctrl | OUI | T | |-----------------------------------| | AA | AA | 03 | 000000 | | |-----------------------------------| From 802.11 data frame that we receive from MAC we are making Ethernet DIX (II) frame. Ethernet DIX (II) frame format: |------------------------------------------------------| Bytes | 6 | 6 | 2 | 46 - 1500 | 4 | |------------------------------------------------------| Descr. | DA | SA | T | Data | FCS| |------------------------------------------------------| So we overwrite 6 bytes of LLC/SNAP with SA. Excerpts from "IEEE P802.11e/D13.0, January 2005" p.p. 22-23 Type Subtype Description ------------------------------------------------------------- 00 Management 0000 Association request 00 Management 0001 Association response 00 Management 0010 Reassociation request 00 Management 0011 Reassociation response 00 Management 0100 Probe request 00 Management 0101 Probe response 00 Management 0110-0111 Reserved 00 Management 1000 Beacon 00 Management 1001 Announcement traffic indication message (ATIM) 00 Management 1010 Disassociation 00 Management 1011 Authentication 00 Management 1100 Deauthentication 00 Management 1101 Action 00 Management 1101-1111 Reserved 01 Control 0000-0111 Reserved 01 Control 1000 Block Acknowledgement Request (BlockAckReq) 01 Control 1001 Block Acknowledgement (BlockAck) 01 Control 1010 Power Save Poll (PS-Poll) 01 Control 1011 Request To Send (RTS) 01 Control 1100 Clear To Send (CTS) 01 Control 1101 Acknowledgement (ACK) 01 Control 1110 Contention-Free (CF)-End 01 Control 1111 CF-End + CF-Ack 10 Data 0000 Data 10 Data 0001 Data + CF-Ack 10 Data 0010 Data + CF-Poll 10 Data 0011 Data + CF-Ack + CF-Poll 10 Data 0100 Null function (no data) 10 Data 0101 CF-Ack (no data) 10 Data 0110 CF-Poll (no data) 10 Data 0111 CF-Ack + CF-Poll (no data) 10 Data 1000 QoS Data 10 Data 1001 QoS Data + CF-Ack 10 Data 1010 QoS Data + CF-Poll 10 Data 1011 QoS Data + CF-Ack + CF-Poll 10 Data 1100 QoS Null (no data) 10 Data 1101 Reserved 10 Data 1110 QoS CF-Poll (no data) 10 Data 1111 QoS CF-Ack + CF-Poll (no data) 11 Reserved 0000-1111 Reserved */ /* If we are AP: - in CAC time filter out all management/control/action frames. Print AUTH_REQ for debug a specific case. - if NET_STATE != CONNECTED: pass only beacons and probe responces. */ if (mtlk_vap_is_ap(nic->vap_handle)) { mtlk_core_t *master_core = mtlk_vap_manager_get_master_core(mtlk_vap_get_manager(nic->vap_handle)); int frame_subtype = 0, net_state; /* are we in DFS CAC? */ if (_wave_core_cac_in_progress(master_core)) { if (frame_type == IEEE80211_FTYPE_MGMT) { frame_subtype = (frame_ctl & FRAME_SUBTYPE_MASK) >> FRAME_SUBTYPE_SHIFT; if (frame_subtype == MAN_TYPE_AUTH) { ILOG0_Y("AUTH frame from %Y dropped during CAC", WLAN_GET_ADDR2(data->buf)); } } return res; } /* are we in NET_STATE_CONNECTED ? */ net_state = mtlk_core_get_net_state(master_core); if (NET_STATE_CONNECTED != net_state) { if (frame_type == IEEE80211_FTYPE_MGMT) { frame_subtype = (frame_ctl & FRAME_SUBTYPE_MASK) >> FRAME_SUBTYPE_SHIFT; if ((frame_subtype != MAN_TYPE_PROBE_RES) && (frame_subtype != MAN_TYPE_BEACON)) { ILOG2_DYD("Frame subtype %d from %Y dropped due to wrong NET_STATE %d", frame_subtype, WLAN_GET_ADDR2(data->buf), net_state); return res; } } else { /* not a management frame */ ILOG2_DYD("Frame type %d from %Y dropped due to wrong NET_STATE %d", frame_type, WLAN_GET_ADDR2(data->buf), net_state); return res; } } } switch (frame_type) { case IEEE80211_FTYPE_MGMT: { mtlk_phy_info_t *phy_info = &data->phy_info; uint8 *src_addr = WLAN_GET_ADDR2(data->buf); sta_entry *sta = mtlk_stadb_find_sta(&(nic->slow_ctx->stadb), src_addr); mtlk_mgmt_frame_data_t fd; mtlk_df_t *df = mtlk_vap_get_df(nic->vap_handle); /* this checks vap_handle and df, cannot return NULL */ mtlk_df_user_t *df_user = mtlk_df_get_user(df); struct wireless_dev *wdev = mtlk_df_user_get_wdev(df_user); /* this checks df_user */ unsigned subtype = (frame_ctl & FRAME_SUBTYPE_MASK) >> FRAME_SUBTYPE_SHIFT; uint8 *orig_buf = data->buf; uint32 orig_size = data->size; MTLK_ASSERT(NULL != wdev); memset(&fd, 0, sizeof(fd)); fd.phy_info = phy_info; fd.chan = NULL; res = mtlk_process_man_frame(HANDLE_T(nic), sta, data->buf, &data->size, &fd); /* if (subtype != MAN_TYPE_BEACON) ILOG2_DDDD("Res=%i, notify_hostapd=%i, report_bss=%i, obss_beacon_report=%i", res, notify_hostapd, report_bss, obss_beacon_report); */ if (res == MTLK_ERR_OK) { BOOL reported = FALSE; if (fd.notify_hapd_supplicant) { BOOL is_broadcast = FALSE; reported = TRUE; if (mgmt_frame_filter_allows(nic, &nic->slow_ctx->mgmt_frame_filter, data->buf, data->size, &is_broadcast)) { if (is_broadcast) { /* Broad cast frames will be send throught serialzer - we need copy them for all vaps */ mtlk_mngmnt_frame_t frame; frame.size = data->size; frame.freq = fd.chan->center_freq; frame.subtype = subtype; frame.phy_info = *fd.phy_info; /* including max_rssi */ frame.probe_req_wps_ie = fd.probe_req_wps_ie; frame.probe_req_interworking_ie = fd.probe_req_interworking_ie; frame.probe_req_vsie = fd.probe_req_vsie; frame.probe_req_he_ie = fd.probe_req_he_ie; frame.pmf_flags = fd.pmf_flags; frame.frame = mtlk_osal_mem_alloc(data->size, MTLK_MEM_TAG_CFG80211); if (frame.frame == NULL) { ELOG_D("CID-%04x: Can't allocate memory for mngmnt frame", mtlk_vap_get_oid(nic->vap_handle)); } else { wave_memcpy(frame.frame, data->size, data->buf, data->size); _mtlk_process_hw_task(mtlk_core_get_master(nic), SERIALIZABLE, _mtlk_core_broadcast_mngmnt_frame_notify, HANDLE_T(nic), &frame, sizeof(mtlk_mngmnt_frame_t)); } } else { /* Sanity: drop unicast frames sent to a disabled mater VAP */ disable_master_vap = WAVE_VAP_RADIO_PDB_GET_INT(nic->vap_handle, PARAM_DB_RADIO_DISABLE_MASTER_VAP); if (disable_master_vap && mtlk_vap_is_master(nic->vap_handle)){ ILOG2_DY("Frame type %d from %Y dropped since master VAP is disabled", frame_type, WLAN_GET_ADDR2(data->buf)); return MTLK_ERR_OK; } /* unicast frames can be send directly */ __mtlk_core_mngmnt_frame_notify(nic, data->buf, data->size, fd.chan->center_freq, subtype, fd.phy_info, fd.pmf_flags); } } } if (fd.report_bss) { reported = TRUE; #ifdef CPTCFG_IWLWAV_FILTER_BLACKLISTED_BSS if (!_mtlk_core_blacklist_entry_exists(nic, (IEEE_ADDR*)src_addr)) #endif if (mtlk_vap_is_ap(nic->vap_handle)) wv_cfg80211_inform_bss_frame(wdev, fd.chan, orig_buf, orig_size, phy_info->max_rssi); } if (fd.obss_beacon_report) { reported = TRUE; #ifdef CPTCFG_IWLWAV_FILTER_BLACKLISTED_BSS if (!_mtlk_core_blacklist_entry_exists(nic, (IEEE_ADDR*)src_addr)) #endif if (mtlk_vap_is_ap(nic->vap_handle)) wv_cfg80211_obss_beacon_report(wdev, data->buf, data->size, WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(nic->vap_handle), PARAM_DB_RADIO_CHANNEL_CUR), phy_info->max_rssi); /* mtlk_dump(2, data->buf, MIN(data->size, 16), "RX BSS frame obss-beacon-reported (first 16 bytes):"); */ } if (!reported && subtype != MAN_TYPE_BEACON && (subtype != MAN_TYPE_PROBE_RES || !wave_radio_scan_is_ignorant(wave_vap_radio_get(nic->vap_handle)))) mtlk_dump(2, data->buf, MIN(data->size, 32), "RX mgmt frame not reported in any way (first 32 bytes):"); } mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_RECEIVED); if (sta) { ILOG3_YDDDDDD("STA %Y frame_ctrl 0x%04X, rssi (%d, %d, %d, %d), max_rssi %d", mtlk_sta_get_addr(sta), frame_ctl, phy_info->rssi[0], phy_info->rssi[1], phy_info->rssi[2], phy_info->rssi[3], phy_info->max_rssi); mtlk_sta_update_rx_rate_rssi_on_man_frame(sta, phy_info); mtlk_sta_decref(sta); /* De-reference of find */ } } break; case IEEE80211_FTYPE_CTL: CPU_STAT_SPECIFY_TRACK(CPU_STAT_ID_RX_CTL); res = mtlk_process_ctl_frame(HANDLE_T(nic), data->buf, data->size); mtlk_core_inc_cnt(nic, MTLK_CORE_CNT_CTL_FRAMES_RECEIVED); break; default: mtlk_df_inc_corrupted_packets(mtlk_vap_get_df(nic->vap_handle)); WLOG_DD("CID-%04x: Not Management or Control packet in BSS RX path, frame_ctl %04x", mtlk_vap_get_oid(nic->vap_handle), frame_ctl); mtlk_dump(0, data->buf, MIN(data->size, 128), "RX BSS IND data (first 128 bytes):"); data->make_assert = TRUE; res = MTLK_ERR_CORRUPTED; } return res; } int _handle_radar_event(mtlk_handle_t core_object, const void *payload, uint32 size) { BOOL emulating; uint8 rbm; /* Radar Bit Map */ struct mtlk_chan_def ccd; UMI_RADAR_DETECTION *radar_det; mtlk_scan_support_t *ss; mtlk_df_t *df; mtlk_df_user_t *df_user; struct wireless_dev *wdev; struct net_device *ndev; int cur_channel; uint32 cac_started; BOOL radar_det_enabled; struct nic *nic = HANDLE_T_PTR(struct nic, core_object); wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); wv_cfg80211_t *cfg80211 = wave_radio_cfg80211_get(radio); struct wiphy *wiphy = wv_cfg80211_wiphy_get(cfg80211); MTLK_ASSERT(nic == mtlk_core_get_master(nic)); /* wait for Radar Detection end */ wave_radio_radar_detect_end_wait(radio); if (mtlk_vap_manager_vap_is_not_ready(mtlk_vap_get_manager(nic->vap_handle), mtlk_vap_get_id(nic->vap_handle))) { ELOG_V("Radar detection: interface already deactivated"); return MTLK_ERR_UNKNOWN; } ss = mtlk_core_get_scan_support(nic); df = mtlk_vap_get_df(nic->vap_handle); df_user = mtlk_df_get_user(df); wdev = mtlk_df_user_get_wdev(df_user); ndev = mtlk_df_user_get_ndev(df_user); radar_det_enabled = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_DFS_RADAR_DETECTION); ccd = *__wave_core_chandef_get(nic); cur_channel = ieee80211_frequency_to_channel(ccd.chan.center_freq); /* Primary channel */ if (sizeof(UMI_RADAR_DETECTION) == size) { radar_det = (UMI_RADAR_DETECTION *)payload; emulating = FALSE; /* On gen6 Sub Band DFS PHY layer development has not started yet. rbm contains dummy data and should be ignored. */ rbm = mtlk_hw_type_is_gen6(mtlk_vap_get_hw(nic->vap_handle)) ? 0 : MAC_TO_HOST16(radar_det->subBandBitmap); } else if (sizeof(mtlk_core_radar_emu_t) == size) { /* Emulating */ mtlk_core_radar_emu_t *radar_emu = (mtlk_core_radar_emu_t *)payload; radar_det = &radar_emu->radar_det; rbm = radar_det->subBandBitmap; emulating = TRUE; } else { ELOG_D("Wrong radar event data size %d", size); return MTLK_ERR_UNKNOWN; } ILOG0_DDDD("RADAR detected on channel: %u, radar_type: %u, radar bit map 0x%02x, emulated %d", radar_det->channel, radar_det->radarType, rbm, emulating); cac_started = !mtlk_osal_timer_is_stopped(&nic->slow_ctx->cac_timer); mtlk_hw_inc_radar_cntr(mtlk_vap_get_hw(nic->vap_handle)); if (!radar_det_enabled) { if (!emulating) { ELOG_V("Radar detected while radar detection is disabled"); return MTLK_ERR_OK; /* Ignore message */ } else { ILOG0_V("Allowing radar emulation even radar detection is disabled"); } } if (WAVE_RADIO_OFF == WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MODE_CURRENT)) { ILOG1_V("Radar detected while RF is off, ignoring"); return MTLK_ERR_OK; /* Ignore message */ } if (cur_channel != radar_det->channel) { ILOG0_DD("Radar detected on different channel (%u) than current channel (%d)", radar_det->channel, cur_channel); return MTLK_ERR_OK; /* Ignore message */ } if (!wv_cfg80211_get_chans_dfs_required(wiphy, ccd.center_freq1, mtlkcw2cw(ccd.width)) || (rbm && !wv_cfg80211_get_chans_dfs_bitmap_valid(wiphy, ccd.center_freq1, mtlkcw2cw(ccd.width), rbm))) { ILOG0_D("Radar detected on non-DFS channel (%u), ignoring", cur_channel); return MTLK_ERR_OK; /* Ignore message */ } /* Radar simulation debug switch may take some time, * so ignore new event if previous not completed yet */ if (ss->dfs_debug_params.debug_chan) { if (ss->dfs_debug_params.switch_in_progress) return MTLK_ERR_OK; /* Ignore message */ else ss->dfs_debug_params.switch_in_progress = TRUE; } MTLK_ASSERT(wdev); mtlk_osal_timer_cancel_sync(&nic->slow_ctx->cac_timer); mtlk_core_cfg_set_block_tx(nic, 0); if (wave_radio_get_sta_vifs_exist(radio)) { return wv_cfg80211_radar_event_if_sta_exist(wdev, &ccd); } if (cac_started) wv_cfg80211_cac_event(ndev, &ccd, 0); /* 0 means it didn't finish, i.e., was aborted */ if (__mtlk_is_sb_dfs_switch(ccd.sb_dfs.sb_dfs_bw)) { ccd.center_freq1 = ccd.sb_dfs.center_freq; ccd.width = ccd.sb_dfs.width; } mtlk_df_user_handle_radar_event(df_user, wdev, &ccd, cac_started, rbm); return MTLK_ERR_OK; } static int _mtlk_core_set_wep_key_blocked (struct nic *nic, sta_entry *sta, uint16 key_idx) { int res = MTLK_ERR_UNKNOWN; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_SET_KEY *umi_key; UMI_DEFAULT_KEY_INDEX *umi_default_key; uint16 key_len = 0; int i; uint16 sid; uint16 key_type; if(key_idx >= CORE_NUM_WEP_KEYS) { ELOG_DD("CID-%04x: Wrong default key index %d", mtlk_vap_get_oid(nic->vap_handle), key_idx); goto FINISH; } if(0 == nic->slow_ctx->wds_keys[key_idx].key_len) { ELOG_DD("CID-%04x: There is no key with default index %d", mtlk_vap_get_oid(nic->vap_handle), key_idx); goto FINISH; } man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(nic->vap_handle), &res); if (!man_entry) { ELOG_DD("CID-%04x: No man entry available (res = %d)", mtlk_vap_get_oid(nic->vap_handle), res); goto FINISH; } if (sta) { key_type = HOST_TO_MAC16(UMI_RSN_PAIRWISE_KEY); sid = HOST_TO_MAC16(mtlk_sta_get_sid(sta)); } else { key_type = HOST_TO_MAC16(UMI_RSN_GROUP_KEY); sid = HOST_TO_MAC16(TMP_BCAST_DEST_ADDR); } umi_key = (UMI_SET_KEY*)man_entry->payload; memset(umi_key, 0, sizeof(*umi_key)); man_entry->id = UM_MAN_SET_KEY_REQ; man_entry->payload_size = sizeof(*umi_key); for (i = 0; i < CORE_NUM_WEP_KEYS; i++) { key_len = nic->slow_ctx->wds_keys[i].key_len; if(0 == key_len) { /* key is not set */ break; } if ((nic->slow_ctx->wds_keys[i].cipher != UMI_RSN_CIPHER_SUITE_WEP40) && (nic->slow_ctx->wds_keys[i].cipher != UMI_RSN_CIPHER_SUITE_WEP104)) { ELOG_DD("CID-%04x: CipherSuite is not WEP %d", mtlk_vap_get_oid(nic->vap_handle), nic->slow_ctx->wds_keys[i].cipher); goto FINISH; } /* Prepeare the key */ memset(umi_key, 0, sizeof(*umi_key)); umi_key->u16Sid = sid; umi_key->u16KeyType = key_type; umi_key->u16KeyIndex = HOST_TO_MAC16(i); umi_key->u16CipherSuite = HOST_TO_MAC16(nic->slow_ctx->wds_keys[i].cipher); wave_memcpy(umi_key->au8Tk, sizeof(umi_key->au8Tk), nic->slow_ctx->wds_keys[i].key, key_len); ILOG1_D("UMI_SET_KEY SID:0x%x", MAC_TO_HOST16(umi_key->u16Sid)); ILOG1_D("UMI_SET_KEY KeyType:0x%x", MAC_TO_HOST16(umi_key->u16KeyType)); ILOG1_D("UMI_SET_KEY u16CipherSuite:0x%x", MAC_TO_HOST16(umi_key->u16CipherSuite)); ILOG1_D("UMI_SET_KEY KeyIndex:%d", MAC_TO_HOST16(umi_key->u16KeyIndex)); mtlk_dump(1, umi_key->au8RxSeqNum, sizeof(umi_key->au8RxSeqNum), "RxSeqNum"); mtlk_dump(1, umi_key->au8TxSeqNum, sizeof(umi_key->au8TxSeqNum), "TxSeqNum"); mtlk_dump(1, umi_key->au8Tk, key_len, "KEY:"); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: mtlk_mm_send failed: %d", mtlk_vap_get_oid(nic->vap_handle), res); goto FINISH; } umi_key->u16Status = MAC_TO_HOST16(umi_key->u16Status); if (umi_key->u16Status != UMI_OK) { ELOG_DYD("CID-%04x: %Y: status is %d", mtlk_vap_get_oid(nic->vap_handle), mtlk_sta_get_addr(sta)->au8Addr, umi_key->u16Status); res = MTLK_ERR_MAC; goto FINISH; } } /* Send default key index */ man_entry->id = UM_MAN_SET_DEFAULT_KEY_INDEX_REQ; man_entry->payload_size = sizeof(*umi_key); umi_default_key = (UMI_DEFAULT_KEY_INDEX *)man_entry->payload; memset(umi_default_key, 0, sizeof(*umi_default_key)); umi_default_key->u16SID = sid; umi_default_key->u16KeyType = key_type; umi_default_key->u16KeyIndex = MAC_TO_HOST16(key_idx); ILOG1_D("UMI_SET_DEFAULT_KEY SID:0x%x", MAC_TO_HOST16(umi_default_key->u16SID)); ILOG1_D("UMI_SET_DEFAULT_KEY KeyType:0x%x", MAC_TO_HOST16(umi_default_key->u16KeyType)); ILOG1_D("UMI_SET_DEFAULT_KEY KeyIndex:%d", MAC_TO_HOST16(umi_default_key->u16KeyIndex)); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: failed to send default key: %d", mtlk_vap_get_oid(nic->vap_handle), res); goto FINISH; } FINISH: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static int _mtlk_core_ap_add_sta_req (struct nic *nic, sta_info *info) { int res = MTLK_ERR_OK; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_STA_ADD *psUmiStaAdd; uint8 u8Flags; uint8 u8FlagsExt; unsigned rssi_offs; int rssi; MTLK_ASSERT(NULL != nic); MTLK_ASSERT(NULL != info); if (info->supported_rates_len > MAX_NUM_SUPPORTED_RATES) { ELOG_DD("Rates length (%d) is longer than rates array size (%d).", info->supported_rates_len, MAX_NUM_SUPPORTED_RATES); res = MTLK_ERR_PARAMS; goto FINISH; } man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(nic->vap_handle), &res); if (!man_entry) { ELOG_D("CID-%04x: Can't send STA_ADD request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto FINISH; } man_entry->id = UM_MAN_STA_ADD_REQ; man_entry->payload_size = sizeof(UMI_STA_ADD); memset(man_entry->payload, 0, man_entry->payload_size); psUmiStaAdd = (UMI_STA_ADD *)man_entry->payload; rssi_offs = _mtlk_core_get_rrsi_offs(nic); rssi = info->rssi_dbm + rssi_offs; ILOG2_DDD("rssi_dbm %d, offs %d, rssi %d", info->rssi_dbm, rssi_offs, rssi); MTLK_ASSERT((MIN_RSSI <= rssi) && (rssi <= (int8)MAX_INT8)); psUmiStaAdd->u8Status = UMI_OK; psUmiStaAdd->u16SID = HOST_TO_MAC16(info->sid); psUmiStaAdd->u8VapIndex = mtlk_vap_get_id(nic->vap_handle); psUmiStaAdd->u8BSS_Coex_20_40 = info->bss_coex_20_40; psUmiStaAdd->u8UAPSD_Queues = info->uapsd_queues; psUmiStaAdd->u8Max_SP = info->max_sp; psUmiStaAdd->u16AID = HOST_TO_MAC16(info->aid); psUmiStaAdd->u16HT_Cap_Info = info->ht_cap_info; /* Do not convert to MAC format */ psUmiStaAdd->u8AMPDU_Param = info->ampdu_param; psUmiStaAdd->sAddr = info->addr; psUmiStaAdd->u8Rates_Length = info->supported_rates_len; psUmiStaAdd->u8ListenInterval = info->listen_interval; psUmiStaAdd->u32VHT_Cap_Info = info->vht_cap_info; /* element ID is the first byte */ psUmiStaAdd->u8HE_Mac_Phy_Cap_Info[0] = WLAN_EID_EXT_HE_CAPABILITY; wave_memcpy(psUmiStaAdd->u8HE_Mac_Phy_Cap_Info + 1, sizeof(psUmiStaAdd->u8HE_Mac_Phy_Cap_Info) - 1, &info->he_cap.he_cap_elem, sizeof(info->he_cap.he_cap_elem)); psUmiStaAdd->rssi = (uint8)rssi; psUmiStaAdd->transmitBfCapabilities = info->tx_bf_cap_info; /* Do not convert to MAC format */ psUmiStaAdd->u8VHT_OperatingModeNotification = info->opmode_notif; psUmiStaAdd->u8WDS_client_type = info->WDS_client_type; u8Flags = 0; MTLK_BFIELD_SET(u8Flags, STA_ADD_FLAGS_WDS, MTLK_BFIELD_GET(info->flags, STA_FLAGS_WDS) || mtlk_sta_info_is_4addr(info)); MTLK_BFIELD_SET(u8Flags, STA_ADD_FLAGS_IS_8021X_FILTER_OPEN, MTLK_BFIELD_GET(info->flags, STA_FLAGS_IS_8021X_FILTER_OPEN)); MTLK_BFIELD_SET(u8Flags, STA_ADD_FLAGS_MFP, MTLK_BFIELD_GET(info->flags, STA_FLAGS_MFP)); MTLK_BFIELD_SET(u8Flags, STA_ADD_FLAGS_IS_HT, MTLK_BFIELD_GET(info->flags, STA_FLAGS_11n)); MTLK_BFIELD_SET(u8Flags, STA_ADD_FLAGS_IS_VHT, MTLK_BFIELD_GET(info->flags, STA_FLAGS_11ac)); MTLK_BFIELD_SET(u8Flags, STA_ADD_FLAGS_OMN, MTLK_BFIELD_GET(info->flags, STA_FLAGS_OMN_SUPPORTED)); MTLK_BFIELD_SET(u8Flags, STA_ADD_FLAGS_OPER_MODE_NOTIF_VALID, MTLK_BFIELD_GET(info->flags, STA_FLAGS_OPMODE_NOTIF)); MTLK_BFIELD_SET(u8Flags, STA_ADD_FLAGS_WME, MTLK_BFIELD_GET(info->flags, STA_FLAGS_WMM) || MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_IS_HT) || MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_IS_VHT)); psUmiStaAdd->u8Flags = u8Flags; u8FlagsExt = 0; MTLK_BFIELD_SET(u8FlagsExt, STA_ADD_FLAGS_EXT_IS_HE, MTLK_BFIELD_GET(info->flags, STA_FLAGS_11ax)); MTLK_BFIELD_SET(u8FlagsExt, STA_ADD_FLAGS_EXT_PBAC, MTLK_BFIELD_GET(info->flags, STA_FLAGS_PBAC)); psUmiStaAdd->u8FlagsExt = u8FlagsExt; wave_memcpy(psUmiStaAdd->u8Rates, sizeof(psUmiStaAdd->u8Rates), info->rates, psUmiStaAdd->u8Rates_Length); wave_memcpy(psUmiStaAdd->u8RX_MCS_Bitmask, sizeof(psUmiStaAdd->u8RX_MCS_Bitmask), info->rx_mcs_bitmask, sizeof(info->rx_mcs_bitmask)); wave_memcpy(psUmiStaAdd->u8VHT_Mcs_Nss, sizeof(psUmiStaAdd->u8VHT_Mcs_Nss), &info->vht_mcs_info, sizeof(info->vht_mcs_info)); wave_memcpy(psUmiStaAdd->u8HE_Mcs_Nss, sizeof(psUmiStaAdd->u8HE_Mcs_Nss), &info->he_cap.he_mcs_nss_supp, MIN(sizeof(psUmiStaAdd->u8HE_Mcs_Nss), sizeof(info->he_cap.he_mcs_nss_supp))); /* 80P80 not supported by FW */ wave_memcpy(psUmiStaAdd->u8HE_Ppe_Th, sizeof(psUmiStaAdd->u8HE_Ppe_Th), &info->he_cap.ppe_thres, MIN(sizeof(psUmiStaAdd->u8HE_Ppe_Th), sizeof(info->he_cap.ppe_thres))); /* 8 NSS not supported by FW */ ILOG1_D("CID-%04x: UMI_STA_ADD", mtlk_vap_get_oid(nic->vap_handle)); mtlk_dump(1, psUmiStaAdd, sizeof(UMI_STA_ADD), "dump of UMI_STA_ADD:"); ILOG1_D("UMI_STA_ADD->u16SID: %u", MAC_TO_HOST16(psUmiStaAdd->u16SID)); ILOG1_D("UMI_STA_ADD->u8VapIndex: %u", psUmiStaAdd->u8VapIndex); ILOG1_D("UMI_STA_ADD->u8Status: %u", psUmiStaAdd->u8Status); ILOG1_D("UMI_STA_ADD->u8ListenInterval: %u", psUmiStaAdd->u8ListenInterval); ILOG1_D("UMI_STA_ADD->u8BSS_Coex_20_40: %u", psUmiStaAdd->u8BSS_Coex_20_40); ILOG1_D("UMI_STA_ADD->u8UAPSD_Queues: %u", psUmiStaAdd->u8UAPSD_Queues); ILOG1_D("UMI_STA_ADD->u8Max_SP: %u", psUmiStaAdd->u8Max_SP); ILOG1_D("UMI_STA_ADD->u16AID: %u", MAC_TO_HOST16(psUmiStaAdd->u16AID)); ILOG1_Y("UMI_STA_ADD->sAddr: %Y", &psUmiStaAdd->sAddr); mtlk_dump(1, psUmiStaAdd->u8Rates, sizeof(psUmiStaAdd->u8Rates), "dump of UMI_STA_ADD->u8Rates:"); ILOG1_D("UMI_STA_ADD->u16HT_Cap_Info: %04X", MAC_TO_HOST16(psUmiStaAdd->u16HT_Cap_Info)); ILOG1_D("UMI_STA_ADD->u8AMPDU_Param: %u", psUmiStaAdd->u8AMPDU_Param); mtlk_dump(1, psUmiStaAdd->u8RX_MCS_Bitmask, sizeof(psUmiStaAdd->u8RX_MCS_Bitmask), "dump of UMI_STA_ADD->u8RX_MCS_Bitmask:"); ILOG1_D("UMI_STA_ADD->u8Rates_Length: %u", psUmiStaAdd->u8Rates_Length); ILOG1_DD("UMI_STA_ADD->rssi: %02X(%d)", psUmiStaAdd->rssi, (int8)psUmiStaAdd->rssi); ILOG1_D("UMI_STA_ADD->u8Flags: %02X", psUmiStaAdd->u8Flags); ILOG1_D("UMI_STA_ADD->u8FlagsExt: %02X", psUmiStaAdd->u8FlagsExt); ILOG1_D("UMI_STA_ADD->u32VHT_Cap_Info: %08X", MAC_TO_HOST32(psUmiStaAdd->u32VHT_Cap_Info)); ILOG1_D("UMI_STA_ADD->transmitBfCapabilities:%08X", MAC_TO_HOST32(psUmiStaAdd->transmitBfCapabilities)); ILOG1_D("UMI_STA_ADD->u8VHT_OperatingModeNotification:%02X", psUmiStaAdd->u8VHT_OperatingModeNotification); ILOG1_D("UMI_STA_ADD->u8HE_OperatingModeNotification:%02X", psUmiStaAdd->u8HE_OperatingModeNotification); ILOG1_D("UMI_STA_ADD->u8WDS_client_type: %u", psUmiStaAdd->u8WDS_client_type); mtlk_dump(1, psUmiStaAdd->u8VHT_Mcs_Nss, sizeof(psUmiStaAdd->u8VHT_Mcs_Nss), "dump of UMI_STA_ADD->u8VHT_Mcs_Nss:"); ILOG1_D("UMI_STA_ADD->b8WDS: %u", MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_WDS)); ILOG1_D("UMI_STA_ADD->b8WME: %u", MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_WME)); ILOG1_D("UMI_STA_ADD->b8Authorized: %u", MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_IS_8021X_FILTER_OPEN)); ILOG1_D("UMI_STA_ADD->b8MFP: %u", MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_MFP)); ILOG1_D("UMI_STA_ADD->b8HT: %u", MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_IS_HT)); ILOG1_D("UMI_STA_ADD->b8VHT: %u", MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_IS_VHT)); ILOG1_D("UMI_STA_ADD->b8OMN_supported: %u", MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_OMN)); ILOG1_D("UMI_STA_ADD->b8OPER_MODE_NOTIF: %u", MTLK_BFIELD_GET(u8Flags, STA_ADD_FLAGS_OPER_MODE_NOTIF_VALID)); ILOG1_D("UMI_STA_ADD->b8PBAC: %u", MTLK_BFIELD_GET(u8FlagsExt, STA_ADD_FLAGS_EXT_PBAC)); ILOG1_D("UMI_STA_ADD->b8HE: %u", MTLK_BFIELD_GET(u8FlagsExt, STA_ADD_FLAGS_EXT_IS_HE)); ILOG1_D("UMI_STA_ADD->heExtSingleUserDisable: %u", psUmiStaAdd->heExtSingleUserDisable); mtlk_dump(1, psUmiStaAdd->u8HE_Mac_Phy_Cap_Info, sizeof(psUmiStaAdd->u8HE_Mac_Phy_Cap_Info), "dump of UMI_STA_ADD->u8HE_Mac_Phy_Cap_Info:"); mtlk_dump(1, psUmiStaAdd->u8HE_Mcs_Nss, sizeof(psUmiStaAdd->u8HE_Mcs_Nss), "dump of UMI_STA_ADD->u8HE_Mcs_Nss:"); mtlk_dump(1, psUmiStaAdd->u8HE_Ppe_Th, sizeof(psUmiStaAdd->u8HE_Ppe_Th), "dump of UMI_STA_ADD->u8HE_Ppe_Th:"); mtlk_dump(1, &info->he_operation_parameters, sizeof(info->he_operation_parameters), "dump of info->he_operation_parameters:"); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't send UM_MAN_STA_ADD_REQ request to MAC (err=%d)", mtlk_vap_get_oid(nic->vap_handle), res); goto FINISH; } if (psUmiStaAdd->u8Status != UMI_OK) { WLOG_DYD("CID-%04x: Station %Y add failed in FW (status=%u)", mtlk_vap_get_oid(nic->vap_handle), &info->addr, psUmiStaAdd->u8Status); res = MTLK_ERR_MAC; goto FINISH; } info->sid = MAC_TO_HOST16(psUmiStaAdd->u16SID); ILOG1_DYD("CID-%04x: Station %Y connected (SID = %u)", mtlk_vap_get_oid(nic->vap_handle), &info->addr, info->sid); FINISH: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } int _mtlk_send_filter_req(mtlk_core_t *core, sta_entry *sta, BOOL authorizing); static sta_entry * _mtlk_core_add_sta (mtlk_core_t *core, const IEEE_ADDR *mac, sta_info *info_cfg) { #ifdef CPTCFG_IWLWAV_SET_PM_QOS BOOL is_empty = mtlk_global_stadb_is_empty(); #endif sta_entry *sta = mtlk_stadb_add_sta(&core->slow_ctx->stadb, mac->au8Addr, info_cfg); #ifdef CPTCFG_IWLWAV_SET_PM_QOS if (sta && is_empty) { /* change PM QOS latency, if added very first STA */ mtlk_mmb_update_cpu_dma_latency(mtlk_vap_get_hw(core->vap_handle), MTLK_HW_PM_QOS_VALUE_ANY_CLIENT); } #endif return sta; } static enum mtlk_sta_4addr_mode_e _mtlk_core_check_static_4addr_mode (mtlk_core_t *core, const IEEE_ADDR *addr) { /* For WDS WPA 4-way Handshake must be in 4-addr mode, otherwise in 3-addr mode: * FOUR_ADRESSES_STATION - EAPOL 4-way handshake will be in 3-addr mode * WPA_WDS - EAPOL 4-way handshake will be in 4-addr mode * For both cases data afterwards will be sent in 4-addr mode */ int four_addr_mode = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_4ADDR_MODE); if (MTLK_CORE_4ADDR_DYNAMIC == four_addr_mode) return STA_4ADDR_MODE_DYNAMIC; if ((MTLK_CORE_4ADDR_STATIC == four_addr_mode) || (MTLK_CORE_4ADDR_LIST == four_addr_mode && core_cfg_four_addr_entry_exists(core, addr))) return STA_4ADDR_MODE_ON; if (mtlk_core_cfg_wds_wpa_entry_exists(core, addr)) return STA_4ADDR_MODE_ON; return STA_4ADDR_MODE_OFF; } static int _mtlk_core_ap_connect_sta_by_info (mtlk_core_t *core, sta_info *info) { uint32 res = MTLK_ERR_PARAMS; const IEEE_ADDR *addr = &info->addr; sta_entry *sta = NULL; BOOL is_ht_capable; uint32 four_addr_mode = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_4ADDR_MODE); /* set WDS flag for peer AP */ if (mtlk_vap_is_ap(core->vap_handle) && BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(core, CORE_DB_CORE_BRIDGE_MODE)){ MTLK_BFIELD_SET(info->flags, STA_FLAGS_WDS, wds_sta_is_peer_ap(&core->slow_ctx->wds_mng, addr) ? 1 : 0); } MTLK_BFIELD_SET(info->flags, STA_FLAGS_WDS_WPA, mtlk_core_cfg_wds_wpa_entry_exists(core, addr)); /* For WDS WPA 4-way Handshake must be in 4-addr mode, otherwise in 3-addr mode: * FOUR_ADDRESSES_STATION - EAPOL 4-way handshake will be in 3-addr mode * WPA_WDS - EAPOL 4-way handshake will be in 4-addr mode * For both cases data afterwards will be sent in 4-addr mode */ if ((MTLK_CORE_4ADDR_STATIC == four_addr_mode) || (MTLK_CORE_4ADDR_LIST == four_addr_mode && core_cfg_four_addr_entry_exists(core, addr))) info->WDS_client_type = FOUR_ADDRESSES_STATION; else if (MTLK_BFIELD_GET(info->flags, STA_FLAGS_WDS_WPA)) info->WDS_client_type = WPA_WDS; /* Reset of authorized flag for secure connection. This flag is set later on in _change_sta() */ if (MTLK_BFIELD_GET(info->flags, STA_FLAGS_WDS)) { if (core->slow_ctx->peerAPs_key_idx) { /* WDS with WEP - clear filter after setting key below */ MTLK_BFIELD_SET(info->flags, STA_FLAGS_IS_8021X_FILTER_OPEN, 0); } } else { if ((core->slow_ctx->group_cipher == IW_ENCODE_ALG_TKIP) || (core->slow_ctx->group_cipher == IW_ENCODE_ALG_CCMP) || (core->slow_ctx->group_cipher == IW_ENCODE_ALG_AES_CMAC)) { if (0 != MTLK_BFIELD_GET(info->flags, STA_FLAGS_IS_8021X_FILTER_OPEN)) { ELOG_DY("CID-%04x: STA:%Y flag STA_FLAGS_IS_8021X_FILTER_OPEN must be 0", mtlk_vap_get_oid(core->vap_handle), info->addr.au8Addr); MTLK_BFIELD_SET(info->flags, STA_FLAGS_IS_8021X_FILTER_OPEN, 0); } } } sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, info->addr.au8Addr); if (sta != NULL) { ELOG_DY("CID-%04x: ERROR:Try to add sta which already exist:%Y", mtlk_vap_get_oid(core->vap_handle), info->addr.au8Addr); mtlk_sta_decref(sta); MTLK_ASSERT(FALSE); } res = _mtlk_core_ap_add_sta_req(core, info); if (MTLK_ERR_OK != res) { goto FINISH; } /* Remove sta MAC addr from DC DP MAC table */ mtlk_df_user_dcdp_remove_mac_addr(mtlk_vap_get_df(core->vap_handle), addr->au8Addr); is_ht_capable = MTLK_BFIELD_GET(info->flags, STA_FLAGS_11n); sta = _mtlk_core_add_sta(core, addr, info); if (sta == NULL) { core_ap_remove_sta(core, info); res = MTLK_ERR_UNKNOWN; goto FINISH; } if (MTLK_BFIELD_GET(sta->info.flags, STA_FLAGS_WDS)) { /* WDS peer */ if (core->slow_ctx->peerAPs_key_idx) { if (MTLK_ERR_OK != _mtlk_core_set_wep_key_blocked(core, sta, core->slow_ctx->peerAPs_key_idx - 1)) { wds_peer_disconnect (&core->slow_ctx->wds_mng, addr); core_ap_stop_traffic(core, &sta->info); /* Send Stop Traffic Request to FW */ core_ap_remove_sta(core, info); mtlk_stadb_remove_sta(&core->slow_ctx->stadb, sta); res = MTLK_ERR_UNKNOWN; goto FINISH; } mtlk_sta_set_cipher(sta, IW_ENCODE_ALG_WEP); res = _mtlk_send_filter_req(core, sta, TRUE); /* open filter */ } } else { if (core->slow_ctx->wep_enabled) { mtlk_sta_set_cipher(sta, IW_ENCODE_ALG_WEP); } } if (!MTLK_BFIELD_GET(info->flags, STA_FLAGS_IS_8021X_FILTER_OPEN) && !MTLK_BFIELD_GET(sta->info.flags, STA_FLAGS_WDS)) { /* In WPA/WPA security start ADDBA after key is set */ mtlk_sta_set_packets_filter(sta, MTLK_PCKT_FLTR_ALLOW_802_1X); ILOG1_Y("%Y: turn on 802.1x filtering due to RSN", mtlk_sta_get_addr(sta)); } else { mtlk_sta_set_packets_filter(sta, MTLK_PCKT_FLTR_ALLOW_ALL); mtlk_stadb_set_sta_auth_flag_in_irbd(sta); mtlk_df_mcast_notify_sta_connected(mtlk_vap_get_df(core->vap_handle)); } if (BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(core, CORE_DB_CORE_BRIDGE_MODE) || mtlk_sta_is_4addr(sta)) { mtlk_hstdb_start_all_by_sta(&core->slow_ctx->hstdb, sta); } mtlk_hstdb_remove_host_by_addr(&core->slow_ctx->hstdb, addr); if (BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(core, CORE_DB_CORE_BRIDGE_MODE)){ wds_peer_connect(&core->slow_ctx->wds_mng, sta, addr, MTLK_BFIELD_GET(info->flags, STA_FLAGS_11n), MTLK_BFIELD_GET(info->flags, STA_FLAGS_11ac), MTLK_BFIELD_GET(info->flags, STA_FLAGS_11ax)); } /* notify Traffic Analyzer about new STA */ mtlk_ta_on_connect(mtlk_vap_get_ta(core->vap_handle), sta); if (mtlk_vap_is_ap(core->vap_handle) && core->dgaf_disabled) { mtlk_mc_add_sta(core, sta); } if (!mtlk_vap_is_ap(core->vap_handle)) { bss_data_t bss_found; if (mtlk_cache_find_bss_by_bssid(&core->slow_ctx->cache, addr, &bss_found, NULL) == 0) { ILOG2_V("unknown BSS"); goto FINISH; } /* store actual BSS data */ core->slow_ctx->bss_data = bss_found; MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_IS_HT_CUR, (core_cfg_get_is_ht_cfg(core) && bss_found.is_ht)); } FINISH: if (sta) { mtlk_sta_decref(sta); /* De-reference by creator */ } return res; } #ifdef MTLK_LEGACY_STATISTICS static int _mtlk_core_on_peer_connect(mtlk_core_t *core, sta_info *info, uint16 status) { mtlk_connection_event_t connect_event; MTLK_ASSERT(core != NULL); MTLK_ASSERT(info != NULL); MTLK_STATIC_ASSERT(sizeof(connect_event.mac_addr) >= sizeof(IEEE_ADDR)); memset(&connect_event, 0, sizeof(connect_event)); *((IEEE_ADDR *)&connect_event.mac_addr) = info->addr; connect_event.status = status; if (MTLK_BFIELD_GET(info->flags, STA_FLAGS_IS_8021X_FILTER_OPEN)) connect_event.auth_type = UMI_BSS_AUTH_OPEN; else connect_event.auth_type = UMI_BSS_AUTH_SHARED_KEY; return mtlk_wssd_send_event(mtlk_vap_get_irbd(core->vap_handle), MTLK_WSSA_DRV_EVENT_CONNECTION, &connect_event, sizeof(connect_event)); } #endif /* MTLK_LEGACY_STATISTICS */ static int _mtlk_core_ap_connect_sta (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; sta_info *info = NULL; uint32 info_size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); info = mtlk_clpb_enum_get_next(clpb, &info_size); MTLK_CLPB_TRY(info, info_size) if (mtlk_vap_is_ap(core->vap_handle) && !wave_core_sync_hostapd_done_get(core)) { ILOG1_D("CID-%04x: HOSTAPD STA database is not synced", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; } else { res = _mtlk_core_ap_connect_sta_by_info(core, info); } #ifdef MTLK_LEGACY_STATISTICS _mtlk_core_on_peer_connect(core, info, res ? FM_STATUSCODE_FAILURE : FM_STATUSCODE_SUCCESSFUL); #endif MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } int _mtlk_send_filter_req(mtlk_core_t *core, sta_entry *sta, BOOL authorizing) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; mtlk_txmm_t *txmm = mtlk_vap_get_txmm(core->vap_handle); UMI_802_1X_FILTER *umi_filter; uint32 res = MTLK_ERR_PARAMS; /* Prepare UMI message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, txmm, NULL); if (!man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_SET_802_1X_FILTER_REQ; man_entry->payload_size = sizeof(UMI_802_1X_FILTER); umi_filter = (UMI_802_1X_FILTER *)man_entry->payload; memset(umi_filter, 0, sizeof(*umi_filter)); umi_filter->u16SID = HOST_TO_MAC16(mtlk_sta_get_sid(sta)); umi_filter->u8IsFilterOpen = authorizing; ILOG1_DD("CID-%04x: UM_MAN_SET_802_1X_FILTER_REQ SID:0x%x", mtlk_vap_get_oid(core->vap_handle), MAC_TO_HOST16(umi_filter->u16SID)); ILOG1_DD("CID-%04x: UM_MAN_SET_802_1X_FILTER_REQ u8IsFilterOpen:%d", mtlk_vap_get_oid(core->vap_handle), umi_filter->u8IsFilterOpen); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: mtlk_mm_send_blocked failed: %i", mtlk_vap_get_oid(core->vap_handle), res); } if (NULL != man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static int _mtlk_core_ap_authorizing_sta (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_PARAMS; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_core_ui_authorizing_cfg_t *t_authorizing; uint32 size; IEEE_ADDR sStationID; BOOL authorizing = FALSE; sta_entry *sta = NULL; mtlk_pckt_filter_e sta_filter_stored; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); if (mtlk_vap_is_ap(core->vap_handle) && !wave_core_sync_hostapd_done_get(core)) { ILOG1_D("CID-%04x: HOSTAPD STA database is not synced", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } if ((mtlk_core_get_net_state(core) & (NET_STATE_READY | NET_STATE_CONNECTED)) == 0) { ILOG1_D("CID-%04x: Invalid card state - request rejected", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } if (mtlk_core_is_stopping(core)) { ILOG1_D("CID-%04x: Can't set authorizing configuration - core is stopping", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } t_authorizing = mtlk_clpb_enum_get_next(clpb, &size); if ( (NULL == t_authorizing) || (sizeof(*t_authorizing) != size) ) { ELOG_D("CID-%04x: Failed to set authorizing configuration parameters from CLPB", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_UNKNOWN; goto FINISH; } MTLK_CFG_START_CHEK_ITEM_AND_CALL() MTLK_CFG_GET_ITEM(t_authorizing, sta_addr, sStationID); MTLK_CFG_GET_ITEM(t_authorizing, authorizing, authorizing); MTLK_CFG_END_CHEK_ITEM_AND_CALL() sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, sStationID.au8Addr); if (sta == NULL) { ILOG1_DY("CID-%04x: Station %Y not found during authorizing", mtlk_vap_get_oid(core->vap_handle), sStationID.au8Addr); res = MTLK_ERR_OK; goto FINISH; } /*check if we already have the same filter set */ sta_filter_stored = mtlk_sta_get_packets_filter(sta); if ((MTLK_PCKT_FLTR_ALLOW_ALL == sta_filter_stored) && (authorizing)) { ILOG2_DY("CID-%04x: Station %Y has already filter set", mtlk_vap_get_oid(core->vap_handle), sStationID.au8Addr); res = MTLK_ERR_OK; goto FINISH; } else if ((MTLK_PCKT_FLTR_ALLOW_802_1X == sta_filter_stored) && (!authorizing)) { ILOG2_DY("CID-%04x: Station %Y has already filter set", mtlk_vap_get_oid(core->vap_handle), sStationID.au8Addr); res = MTLK_ERR_OK; goto FINISH; } res = _mtlk_send_filter_req(core, sta, authorizing); if(authorizing){ mtlk_sta_set_packets_filter(sta, MTLK_PCKT_FLTR_ALLOW_ALL); mtlk_stadb_set_sta_auth_flag_in_irbd(sta); mtlk_df_mcast_notify_sta_connected(mtlk_vap_get_df(core->vap_handle)); } else{ mtlk_sta_set_packets_filter(sta, MTLK_PCKT_FLTR_ALLOW_802_1X); } FINISH: if (NULL != sta) { mtlk_sta_decref(sta); /* De-reference of find */ } return res; } static int _mtlk_core_ap_disconnect_sta (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_PARAMS; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; IEEE_ADDR *addr; uint32 size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); addr = mtlk_clpb_enum_get_next(clpb, &size); MTLK_CLPB_TRY(addr, size) #ifdef MTLK_LEGACY_STATISTICS res = _mtlk_core_ap_disconnect_sta_blocked(core, addr, FM_STATUSCODE_USER_REQUEST); #else res = _mtlk_core_ap_disconnect_sta_blocked(core, addr); #endif if (MTLK_ERR_OK != res) { ILOG1_DYD("CID-%04x: Station %Y disconnection failed (%d)", mtlk_vap_get_oid(core->vap_handle), addr, res); } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } int __MTLK_IFUNC core_ap_disconnect_all (mtlk_core_t *core) { uint32 res = MTLK_ERR_OK; const sta_entry *sta = NULL; /* int net_state = mtlk_core_get_net_state(nic); */ mtlk_stadb_iterator_t iter; /* FIXCFG80211: Check if this should be removed or leave as is. Note: NET_STATE_CONNECTED is only after core activation, this function can be called before start_ap by hostapd. */ /* if (mtlk_core_get_net_state(nic) != NET_STATE_CONNECTED) { WLOG_V("AP is down - request rejected"); res = MTLK_ERR_NOT_READY; goto FINISH; } */ sta = mtlk_stadb_iterate_first(&core->slow_ctx->stadb, &iter); if (sta) { do { /*uint16 sid = mtlk_sta_get_sid(sta);*/ #ifdef MTLK_LEGACY_STATISTICS res = _mtlk_core_ap_disconnect_sta_blocked(core, mtlk_sta_get_addr(sta), FM_STATUSCODE_USER_REQUEST); #else res = _mtlk_core_ap_disconnect_sta_blocked(core, mtlk_sta_get_addr(sta)); #endif if (res != MTLK_ERR_OK) { ELOG_DYD("CID-%04x: Station %Y disconnection failed (%d)", mtlk_vap_get_oid(core->vap_handle), mtlk_sta_get_addr(sta), res); break; } /* all SIDs will be removed by commands from hostapd */ /*core_remove_sid(core, sid);*/ sta = mtlk_stadb_iterate_next(&iter); } while (sta); mtlk_stadb_iterate_done(&iter); } return res; } #ifdef MTLK_LEGACY_STATISTICS static int _mtlk_core_on_peer_disconnect(mtlk_core_t *core, sta_entry *sta, uint16 reason) { mtlk_disconnection_event_t disconnect_event; MTLK_ASSERT(core != NULL); MTLK_ASSERT(sta != NULL); MTLK_STATIC_ASSERT(sizeof(disconnect_event.mac_addr) >= sizeof(IEEE_ADDR)); memset(&disconnect_event, 0, sizeof(disconnect_event)); *((IEEE_ADDR *)&disconnect_event.mac_addr) = *mtlk_sta_get_addr(sta); disconnect_event.reason = reason; if((FM_STATUSCODE_AGED_OUT == reason) || (FM_STATUSCODE_INACTIVITY == reason) || (FM_STATUSCODE_USER_REQUEST == reason) || (FM_STATUSCODE_PEER_PARAMS_CHANGED == reason)) { disconnect_event.initiator = MTLK_DI_THIS_SIDE; } else disconnect_event.initiator = MTLK_DI_OTHER_SIDE; mtlk_sta_get_peer_stats(sta, &disconnect_event.peer_stats); mtlk_sta_get_peer_capabilities(sta, &disconnect_event.peer_capabilities); return mtlk_wssd_send_event(mtlk_vap_get_irbd(core->vap_handle), MTLK_WSSA_DRV_EVENT_DISCONNECTION, &disconnect_event, sizeof(disconnect_event)); } #endif /* MTLK_LEGACY_STATISTICS */ static int _handle_security_alert_ind(mtlk_handle_t object, const void *data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, object); UMI_TKIP_MIC_FAILURE *usa = (UMI_TKIP_MIC_FAILURE *)data; mtlk_df_ui_mic_fail_type_t mic_fail_type; sta_entry *sta = NULL; mtlk_core_t *cur_core; mtlk_vap_manager_t *vap_mng; mtlk_vap_handle_t vap_handle; unsigned i, j, max_vaps; uint16_t stationId; MTLK_ASSERT(sizeof(UMI_TKIP_MIC_FAILURE) == data_size); if (MAX_NUMBER_TKIP_MIC_FAILURE_ENTRIES_IN_MESSAGE < usa->u8numOfValidEntries) { ELOG_D("Number of valid entries too big: %d", usa->u8numOfValidEntries); mtlk_dump(0, usa, sizeof(*usa), "Dump of UMI_TKIP_MIC_FAILURE"); return MTLK_ERR_OK; } vap_mng = mtlk_vap_get_manager(core->vap_handle); max_vaps = mtlk_vap_manager_get_max_vaps_count(vap_mng); for (i = 0; i < usa->u8numOfValidEntries; i++) { stationId = MAC_TO_HOST16(usa->micFailureEntry[i].stationId); for (j = 0; j < max_vaps; j++) { if (MTLK_ERR_OK != mtlk_vap_manager_get_vap_handle(vap_mng, j, &vap_handle)) { continue; /* VAP does not exist */ } cur_core = mtlk_vap_get_core(vap_handle); if (NET_STATE_CONNECTED != mtlk_core_get_net_state(cur_core)) { /* Core is not ready */ continue; } sta = mtlk_stadb_find_sid(&cur_core->slow_ctx->stadb, stationId); if (sta) { mic_fail_type = usa->micFailureEntry[i].isGroupKey ? MIC_FAIL_GROUP : MIC_FAIL_PAIRWISE; /* todo: temporarily disabled till fixed in FW */ #if 0 ELOG_DDYS("CID-%04x: MIC failure STA_ID:%d STA:%Y type:%s", mtlk_vap_get_oid(vap_handle), stationId, mtlk_sta_get_addr(sta)->au8Addr, (mic_fail_type == MIC_FAIL_GROUP) ? "GROUP" : "PAIRWISE"); #endif mtlk_df_ui_notify_mic_failure(mtlk_vap_get_df(vap_handle), mtlk_sta_get_addr(sta)->au8Addr, mic_fail_type); _mtlk_core_on_mic_failure(cur_core, mic_fail_type); mtlk_sta_decref(sta); /* De-reference of find */ break; } } /* todo: temporarily disabled till fixed in FW */ #if 0 if (!sta) { ELOG_DD("CID-%04x: MIC failure for unknown STA_ID:%d", mtlk_vap_get_oid(core->vap_handle), stationId); } #endif } return MTLK_ERR_OK; } uint32 hw_get_max_tx_antennas (mtlk_hw_t *hw); uint32 hw_get_max_rx_antennas (mtlk_hw_t *hw); uint32 mtlk_core_get_max_tx_antennas (struct nic* nic) { return wave_radio_max_tx_antennas_get(wave_vap_radio_get(nic->vap_handle)); } uint32 mtlk_core_get_max_rx_antennas (struct nic* nic) { return wave_radio_max_rx_antennas_get(wave_vap_radio_get(nic->vap_handle)); } /* To keep this valid forever Master VAP slow ctx should only get deleted on card/driver removal */ int current_chandef_init(mtlk_core_t *core, struct mtlk_chan_def *ccd) { UMI_HDK_CONFIG *chc = __wave_core_hdkconfig_get(core); uint32 dma_addr; mtlk_eeprom_data_t *eeprom = mtlk_core_get_eeprom(core); if (MTLK_ERR_OK != mtlk_eeprom_is_valid(eeprom)) { ELOG_D("CID-%04x: EEPROM/calibration file info is invalid", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_UNKNOWN; } memset(ccd, 0, sizeof(*ccd)); /* mtlk_osal_lock_init(&ccd->chan_lock); */ __wave_core_chan_switch_type_set(core, ST_NONE); memset(chc, 0, sizeof(*chc)); mtlk_hw_get_prop(mtlk_vap_get_hwapi(core->vap_handle), MTLK_HW_CALIB_BUF_DMA_ADDR, &dma_addr, sizeof(dma_addr)); chc->calibrationBufferBaseAddress = HOST_TO_MAC32(dma_addr); chc->hdkConf.numTxAnts = mtlk_core_get_max_tx_antennas(core); chc->hdkConf.numRxAnts = mtlk_core_get_max_rx_antennas(core); chc->hdkConf.eepromInfo.u16EEPROMVersion = HOST_TO_MAC16(mtlk_eeprom_get_version(eeprom)); #if 1 /* FIXME: to be removed because is not used by FW, i.e. zero values can be used */ /* TODO: remove also the functions mtlk_eeprom_get_numpointsXX and all related data */ chc->hdkConf.eepromInfo.u8NumberOfPoints5GHz = mtlk_eeprom_get_numpoints52(eeprom); chc->hdkConf.eepromInfo.u8NumberOfPoints2GHz = mtlk_eeprom_get_numpoints24(eeprom); #endif return MTLK_ERR_OK; } /* steps for init and cleanup */ MTLK_INIT_STEPS_LIST_BEGIN(core_slow_ctx) #ifdef EEPROM_DATA_ACCESS MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, EEPROM) #endif /* EEPROM_DATA_ACCESS */ MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, SERIALIZER) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, SET_NIC_CFG) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, WATCHDOG_TIMER_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, CONNECT_EVENT_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, STADB_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, HSTDB_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, BEACON_DATA) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, MGMT_FRAME_FILTER) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, SCHED_SCAN_TIMER_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, CAC_TIMER_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, CCA_TIMER_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, SCHED_SCAN_REQ_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core_slow_ctx, PROBE_RESP_TEMPL) MTLK_INIT_INNER_STEPS_BEGIN(core_slow_ctx) MTLK_INIT_STEPS_LIST_END(core_slow_ctx); static __INLINE void mem_free_nullsafe(void **ptrptr) { if (*ptrptr) { mtlk_osal_mem_free(*ptrptr); *ptrptr = NULL; } } static __INLINE void __probe_resp_templ_mem_free (struct nic_slow_ctx *slow_ctx) { if (slow_ctx->probe_resp_templ) mtlk_osal_mem_free(slow_ctx->probe_resp_templ); if (slow_ctx->probe_resp_templ_non_he && (slow_ctx->probe_resp_templ_non_he != slow_ctx->probe_resp_templ)) mtlk_osal_mem_free(slow_ctx->probe_resp_templ_non_he); slow_ctx->probe_resp_templ = NULL; slow_ctx->probe_resp_templ_non_he = NULL; } static void __MTLK_IFUNC _mtlk_slow_ctx_cleanup(struct nic_slow_ctx *slow_ctx, struct nic* nic) { MTLK_ASSERT(NULL != slow_ctx); MTLK_ASSERT(NULL != nic); MTLK_CLEANUP_BEGIN(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx)) MTLK_CLEANUP_STEP(core_slow_ctx, PROBE_RESP_TEMPL, MTLK_OBJ_PTR(slow_ctx), __probe_resp_templ_mem_free, (slow_ctx)); MTLK_CLEANUP_STEP(core_slow_ctx, SCHED_SCAN_REQ_INIT, MTLK_OBJ_PTR(slow_ctx), mem_free_nullsafe, ((void **) &slow_ctx->sched_scan_req)); MTLK_CLEANUP_STEP(core_slow_ctx, CCA_TIMER_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_cleanup, (&slow_ctx->cca_step_down_timer)); MTLK_CLEANUP_STEP(core_slow_ctx, CAC_TIMER_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_cleanup, (&slow_ctx->cac_timer)); MTLK_CLEANUP_STEP(core_slow_ctx, SCHED_SCAN_TIMER_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_cleanup, (&slow_ctx->sched_scan_timer)); MTLK_CLEANUP_STEP(core_slow_ctx, MGMT_FRAME_FILTER, MTLK_OBJ_PTR(slow_ctx), mgmt_frame_filter_cleanup, (&slow_ctx->mgmt_frame_filter)); MTLK_CLEANUP_STEP(core_slow_ctx, BEACON_DATA, MTLK_OBJ_PTR(slow_ctx), wave_beacon_man_cleanup, (&slow_ctx->beacon_man_data, nic->vap_handle)); MTLK_CLEANUP_STEP(core_slow_ctx, HSTDB_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_hstdb_cleanup, (&slow_ctx->hstdb)); MTLK_CLEANUP_STEP(core_slow_ctx, STADB_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_stadb_cleanup, (&slow_ctx->stadb)); MTLK_CLEANUP_STEP(core_slow_ctx, CONNECT_EVENT_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_event_cleanup, (&slow_ctx->connect_event)); MTLK_CLEANUP_STEP(core_slow_ctx, WATCHDOG_TIMER_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_cleanup, (&slow_ctx->mac_watchdog_timer)); MTLK_CLEANUP_STEP(core_slow_ctx, SET_NIC_CFG, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()); MTLK_CLEANUP_STEP(core_slow_ctx, SERIALIZER, MTLK_OBJ_PTR(slow_ctx), mtlk_serializer_cleanup, (&slow_ctx->serializer)); #ifdef EEPROM_DATA_ACCESS MTLK_CLEANUP_STEP(core_slow_ctx, EEPROM, MTLK_OBJ_PTR(slow_ctx), mtlk_eeprom_access_cleanup, (nic->vap_handle)); #endif /* EEPROM_DATA_ACCESS */ MTLK_CLEANUP_END(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx)); } static int __MTLK_IFUNC _mtlk_slow_ctx_init(struct nic_slow_ctx *slow_ctx, struct nic* nic) { char ser_name[sizeof(slow_ctx->serializer.name)]; MTLK_ASSERT(NULL != slow_ctx); MTLK_ASSERT(NULL != nic); memset(slow_ctx, 0, sizeof(struct nic_slow_ctx)); slow_ctx->nic = nic; snprintf(ser_name, sizeof(ser_name), "mtlk_%s", mtlk_df_get_name(mtlk_vap_get_df(nic->vap_handle))); MTLK_INIT_TRY(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx)) #ifdef EEPROM_DATA_ACCESS MTLK_INIT_STEP_IF(!mtlk_vap_is_slave_ap(nic->vap_handle), core_slow_ctx, EEPROM, MTLK_OBJ_PTR(slow_ctx), mtlk_eeprom_access_init, (nic->vap_handle)); #endif /* EEPROM_DATA_ACCESS */ MTLK_INIT_STEP(core_slow_ctx, SERIALIZER, MTLK_OBJ_PTR(slow_ctx), mtlk_serializer_init, (&slow_ctx->serializer, ser_name, _MTLK_CORE_NUM_PRIORITIES)); MTLK_INIT_STEP_VOID(core_slow_ctx, SET_NIC_CFG, MTLK_OBJ_PTR(slow_ctx), mtlk_mib_set_nic_cfg, (nic)); MTLK_INIT_STEP_IF(!mtlk_vap_is_slave_ap(nic->vap_handle), core_slow_ctx, WATCHDOG_TIMER_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_init, (&slow_ctx->mac_watchdog_timer, mac_watchdog_timer_handler, HANDLE_T(nic))); MTLK_INIT_STEP(core_slow_ctx, CONNECT_EVENT_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_event_init, (&slow_ctx->connect_event)); /* TODO MAC80211: is this required for station mode interfaces? */ MTLK_INIT_STEP(core_slow_ctx, STADB_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_stadb_init, (&slow_ctx->stadb, nic->vap_handle)); MTLK_INIT_STEP(core_slow_ctx, HSTDB_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_hstdb_init, (&slow_ctx->hstdb, nic->vap_handle)); /* TODO MAC80211: is this required for station mode interfaces? */ MTLK_INIT_STEP(core_slow_ctx, BEACON_DATA, MTLK_OBJ_PTR(slow_ctx), wave_beacon_man_init, (&slow_ctx->beacon_man_data, nic->vap_handle)); MTLK_INIT_STEP(core_slow_ctx, MGMT_FRAME_FILTER, MTLK_OBJ_PTR(slow_ctx), mgmt_frame_filter_init, (&slow_ctx->mgmt_frame_filter)); MTLK_INIT_STEP(core_slow_ctx, SCHED_SCAN_TIMER_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_init, (&slow_ctx->sched_scan_timer, sched_scan_timer_clb_func, HANDLE_T(nic))); MTLK_INIT_STEP(core_slow_ctx, CAC_TIMER_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_init, (&slow_ctx->cac_timer, cac_timer_clb_func, HANDLE_T(nic))); MTLK_INIT_STEP(core_slow_ctx, CCA_TIMER_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_init, (&slow_ctx->cca_step_down_timer, cca_step_down_timer_clb_func, HANDLE_T(nic))); /* everything in slow_ctx was memset to 0, so we don't need to set sched_scan_req to NULL explicitly */ MTLK_INIT_STEP_VOID(core_slow_ctx, SCHED_SCAN_REQ_INIT, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()); /* everything in slow_ctx was memset to 0, so we don't need to set probe_resp_templ to NULL explicitly */ /* MAC80211 TODO: no need to do that for sta */ MTLK_INIT_STEP_VOID(core_slow_ctx, PROBE_RESP_TEMPL, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()); nic->slow_ctx->tx_limits.num_tx_antennas = mtlk_core_get_max_tx_antennas(nic); nic->slow_ctx->tx_limits.num_rx_antennas = mtlk_core_get_max_rx_antennas(nic); MTLK_INIT_FINALLY(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx)) MTLK_INIT_RETURN(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx), _mtlk_slow_ctx_cleanup, (nic->slow_ctx, nic)) } static int mtlk_core_crypto_cleanup (mtlk_core_t *core) { struct nic_slow_ctx *slow_ctx = core->slow_ctx; if(slow_ctx->wep_rx){ crypto_free_cipher(slow_ctx->wep_rx); } if(slow_ctx->wep_tx){ crypto_free_cipher(slow_ctx->wep_tx); } return MTLK_ERR_OK; } static int mtlk_core_crypto_init (mtlk_core_t *core) { struct nic_slow_ctx *slow_ctx = core->slow_ctx; /* start WEP IV from a random value */ get_random_bytes(&slow_ctx->wep_iv, IEEE80211_WEP_IV_LEN); slow_ctx->wep_rx = crypto_alloc_cipher("arc4", 0, CRYPTO_ALG_ASYNC); if(!slow_ctx->wep_rx){ ELOG_D("CID-%04x: Can't allocate wep cipher RX", mtlk_vap_get_oid(core->vap_handle)); return MTLK_ERR_UNKNOWN; } slow_ctx->wep_tx = crypto_alloc_cipher("arc4", 0, CRYPTO_ALG_ASYNC); if(!slow_ctx->wep_tx){ ELOG_D("CID-%04x: Can't allocate wep cipher TX", mtlk_vap_get_oid(core->vap_handle)); crypto_free_cipher(slow_ctx->wep_rx); return MTLK_ERR_UNKNOWN; } return MTLK_ERR_OK; } BOOL __MTLK_IFUNC mtlk_core_crypto_decrypt(mtlk_core_t *core, uint32 key_idx, uint8 *fbuf, uint8 *data, int32 data_len) { struct nic_slow_ctx *slow_ctx = core->slow_ctx; uint8 rc4key[3 + MIB_WEP_KEY_WEP2_LENGTH]; uint32 key_len; uint32 crc; int i; /* check the cipher */ if ((slow_ctx->keys[key_idx].key_len == 0) || ((slow_ctx->keys[key_idx].cipher != UMI_RSN_CIPHER_SUITE_WEP104) && (slow_ctx->keys[key_idx].cipher != UMI_RSN_CIPHER_SUITE_WEP40))) { ILOG1_DDDD("CID-%04x: KEY:%d is not set or cipher is wrong key_len:%d cipher:%d", mtlk_vap_get_oid(core->vap_handle), key_idx, slow_ctx->keys[key_idx].key_len, slow_ctx->keys[key_idx].cipher); return FALSE; } key_len = IEEE80211_WEP_IV_WO_IDX_LEN + slow_ctx->keys[key_idx].key_len; /* Prepend 24-bit IV to RC4 key */ wave_memcpy(rc4key, sizeof(rc4key), fbuf, IEEE80211_WEP_IV_WO_IDX_LEN); /* Copy rest of the WEP key (the secret part) */ wave_memcpy(rc4key + IEEE80211_WEP_IV_WO_IDX_LEN, sizeof(rc4key) - IEEE80211_WEP_IV_WO_IDX_LEN, slow_ctx->keys[key_idx].key, slow_ctx->keys[key_idx].key_len); crypto_cipher_setkey(slow_ctx->wep_rx, rc4key, key_len); for (i = 0; i < data_len + IEEE80211_WEP_ICV_LEN; i++) { crypto_cipher_decrypt_one(slow_ctx->wep_rx, data + i, data + i); } crc = cpu_to_le32(~crc32_le(~0, data, data_len)); if (memcmp(&crc, data + data_len, IEEE80211_WEP_ICV_LEN) != 0) { /* ICV mismatch */ ILOG1_D("CID-%04x: ICV mismatch", mtlk_vap_get_oid(core->vap_handle)); return FALSE; } return TRUE; } /* steps for init and cleanup */ MTLK_INIT_STEPS_LIST_BEGIN(core) MTLK_INIT_STEPS_LIST_ENTRY(core, CORE_PDB_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, SLOW_CTX_ALLOC) MTLK_INIT_STEPS_LIST_ENTRY(core, SLOW_CTX_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, WSS_CREATE) MTLK_INIT_STEPS_LIST_ENTRY(core, WSS_HCTNRs) MTLK_INIT_STEPS_LIST_ENTRY(core, NET_STATE_LOCK_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, TXMM_EEPROM_ASYNC_MSGS_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, CRYPTO_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, BLACKLIST_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, BLACKLIST_LOCK_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, MULTI_AP_BLACKLIST_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, MULTI_AP_BLACKLIST_LOCK_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, 4ADDR_STA_LIST_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, 4ADDR_STA_LIST_LOCK_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, BC_PROBE_REQ_STA_LIST_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, BC_PROBE_REQ_STA_LIST_LOCK_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, UC_PROBE_REQ_STA_LIST_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, UC_PROBE_REQ_STA_LIST_LOCK_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, NDP_WDS_WPA_STA_LIST_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, NDP_WDS_WPA_STA_LIST_LOCK_INIT) MTLK_INIT_STEPS_LIST_ENTRY(core, NDP_ACKED) MTLK_INIT_INNER_STEPS_BEGIN(core) MTLK_INIT_STEPS_LIST_END(core); static void __MTLK_IFUNC _mtlk_core_cleanup(struct nic* nic) { int i; MTLK_ASSERT(NULL != nic); /* delete all four address list entries */ core_cfg_flush_four_addr_list(nic); /* delete all blacklist entries */ _mtlk_core_flush_ieee_addr_list(nic, &nic->widan_blacklist, "widan black"); _mtlk_core_flush_ieee_addr_list(nic, &nic->multi_ap_blacklist, "multi-AP black"); _mtlk_core_flush_bcast_probe_resp_list(nic); _mtlk_core_flush_ucast_probe_resp_list(nic); mtlk_core_cfg_flush_wds_wpa_list(nic); mtlk_osal_event_terminate(&nic->ndp_acked); if (BR_MODE_WDS == MTLK_CORE_PDB_GET_INT(nic, PARAM_DB_CORE_BRIDGE_MODE)) { mtlk_vap_manager_dec_wds_bridgemode(mtlk_vap_get_manager(nic->vap_handle)); } MTLK_CLEANUP_BEGIN(core, MTLK_OBJ_PTR(nic)) MTLK_CLEANUP_STEP(core, NDP_ACKED, MTLK_OBJ_PTR(nic), mtlk_osal_event_cleanup, (&nic->ndp_acked)); MTLK_CLEANUP_STEP(core, NDP_WDS_WPA_STA_LIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_cleanup, (&nic->wds_wpa_sta_list.ieee_addr_lock)); MTLK_CLEANUP_STEP(core, NDP_WDS_WPA_STA_LIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_cleanup_ieee_addr, (&nic->wds_wpa_sta_list.hash)); MTLK_CLEANUP_STEP(core, UC_PROBE_REQ_STA_LIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_cleanup, (&nic->unicast_probe_resp_sta_list.ieee_addr_lock)); MTLK_CLEANUP_STEP(core, UC_PROBE_REQ_STA_LIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_cleanup_ieee_addr, (&nic->unicast_probe_resp_sta_list.hash)); MTLK_CLEANUP_STEP(core, BC_PROBE_REQ_STA_LIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_cleanup, (&nic->broadcast_probe_resp_sta_list.ieee_addr_lock)); MTLK_CLEANUP_STEP(core, BC_PROBE_REQ_STA_LIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_cleanup_ieee_addr, (&nic->broadcast_probe_resp_sta_list.hash)); MTLK_CLEANUP_STEP(core, 4ADDR_STA_LIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_cleanup, (&nic->four_addr_sta_list.ieee_addr_lock)); MTLK_CLEANUP_STEP(core, 4ADDR_STA_LIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_cleanup_ieee_addr, (&nic->four_addr_sta_list.hash)); MTLK_CLEANUP_STEP(core, MULTI_AP_BLACKLIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_cleanup, (&nic->multi_ap_blacklist.ieee_addr_lock)); MTLK_CLEANUP_STEP(core, MULTI_AP_BLACKLIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_cleanup_ieee_addr, (&nic->multi_ap_blacklist.hash)); MTLK_CLEANUP_STEP(core, BLACKLIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_cleanup, (&nic->widan_blacklist.ieee_addr_lock)); MTLK_CLEANUP_STEP(core, BLACKLIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_cleanup_ieee_addr, (&nic->widan_blacklist.hash)); MTLK_CLEANUP_STEP(core, CRYPTO_INIT, MTLK_OBJ_PTR(nic), mtlk_core_crypto_cleanup, (nic)); for (i = 0; i < ARRAY_SIZE(nic->txmm_async_eeprom_msgs); i++) { MTLK_CLEANUP_STEP_LOOP(core, TXMM_EEPROM_ASYNC_MSGS_INIT, MTLK_OBJ_PTR(nic), mtlk_txmm_msg_cleanup, (&nic->txmm_async_eeprom_msgs[i])); } MTLK_CLEANUP_STEP(core, NET_STATE_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_cleanup, (&nic->net_state_lock)); MTLK_CLEANUP_STEP(core, WSS_HCTNRs, MTLK_OBJ_PTR(nic), mtlk_wss_cntrs_close, (nic->wss, nic->wss_hcntrs, ARRAY_SIZE(nic->wss_hcntrs))) MTLK_CLEANUP_STEP(core, WSS_CREATE, MTLK_OBJ_PTR(nic), mtlk_wss_delete, (nic->wss)); MTLK_CLEANUP_STEP(core, SLOW_CTX_INIT, MTLK_OBJ_PTR(nic), _mtlk_slow_ctx_cleanup, (nic->slow_ctx, nic)); MTLK_CLEANUP_STEP(core, SLOW_CTX_ALLOC, MTLK_OBJ_PTR(nic), kfree_tag, (nic->slow_ctx)); MTLK_CLEANUP_STEP(core, CORE_PDB_INIT, MTLK_OBJ_PTR(nic), mtlk_core_pdb_fast_handles_close, (nic->pdb_hot_path_handles)); MTLK_CLEANUP_END(core, MTLK_OBJ_PTR(nic)); } static int __MTLK_IFUNC _mtlk_core_init(struct nic* nic, mtlk_vap_handle_t vap_handle, mtlk_df_t* df) { int txem_cnt = 0; MTLK_ASSERT(NULL != nic); MTLK_STATIC_ASSERT(MTLK_CORE_CNT_LAST == ARRAY_SIZE(nic->wss_hcntrs)); MTLK_STATIC_ASSERT(MTLK_CORE_CNT_LAST == ARRAY_SIZE(_mtlk_core_wss_id_map)); MTLK_INIT_TRY(core, MTLK_OBJ_PTR(nic)) /* set initial net state */ nic->net_state = NET_STATE_HALTED; nic->vap_handle = vap_handle; nic->chan_state = ST_LAST; nic->radio_wss = wave_radio_wss_get(wave_vap_radio_get(nic->vap_handle)); /* Get parent WSS from Radio */ MTLK_ASSERT(NULL != nic->radio_wss); MTLK_INIT_STEP(core, CORE_PDB_INIT, MTLK_OBJ_PTR(nic), mtlk_core_pdb_fast_handles_open, (mtlk_vap_get_param_db(nic->vap_handle), nic->pdb_hot_path_handles)); MTLK_INIT_STEP_EX(core, SLOW_CTX_ALLOC, MTLK_OBJ_PTR(nic), kmalloc_tag, (sizeof(struct nic_slow_ctx), GFP_KERNEL, MTLK_MEM_TAG_CORE), nic->slow_ctx, NULL != nic->slow_ctx, MTLK_ERR_NO_MEM); MTLK_INIT_STEP(core, SLOW_CTX_INIT, MTLK_OBJ_PTR(nic), _mtlk_slow_ctx_init, (nic->slow_ctx, nic)); MTLK_INIT_STEP_EX(core, WSS_CREATE, MTLK_OBJ_PTR(nic), mtlk_wss_create, (nic->radio_wss, _mtlk_core_wss_id_map, ARRAY_SIZE(_mtlk_core_wss_id_map)), nic->wss, nic->wss != NULL, MTLK_ERR_NO_MEM); MTLK_INIT_STEP(core, WSS_HCTNRs, MTLK_OBJ_PTR(nic), mtlk_wss_cntrs_open, (nic->wss, _mtlk_core_wss_id_map, nic->wss_hcntrs, MTLK_CORE_CNT_LAST)); MTLK_INIT_STEP(core, NET_STATE_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_init, (&nic->net_state_lock)); for (txem_cnt = 0; txem_cnt < ARRAY_SIZE(nic->txmm_async_eeprom_msgs); txem_cnt++) { MTLK_INIT_STEP_LOOP(core, TXMM_EEPROM_ASYNC_MSGS_INIT, MTLK_OBJ_PTR(nic), mtlk_txmm_msg_init, (&nic->txmm_async_eeprom_msgs[txem_cnt])); } MTLK_INIT_STEP(core, CRYPTO_INIT, MTLK_OBJ_PTR(nic), mtlk_core_crypto_init, (nic)); MTLK_INIT_STEP_VOID(core, BLACKLIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_init_ieee_addr, (&nic->widan_blacklist.hash, MTLK_CORE_WIDAN_BLACKLIST_HASH_NOF_BUCKETS)); MTLK_INIT_STEP(core, BLACKLIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_init, (&nic->widan_blacklist.ieee_addr_lock)); MTLK_INIT_STEP_VOID(core, MULTI_AP_BLACKLIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_init_ieee_addr, (&nic->multi_ap_blacklist.hash, MTLK_CORE_STA_LIST_HASH_NOF_BUCKETS)); MTLK_INIT_STEP(core, MULTI_AP_BLACKLIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_init, (&nic->multi_ap_blacklist.ieee_addr_lock)); MTLK_INIT_STEP_VOID(core, 4ADDR_STA_LIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_init_ieee_addr, (&nic->four_addr_sta_list.hash, MTLK_CORE_4ADDR_STA_LIST_HASH_NOF_BUCKETS)); MTLK_INIT_STEP(core, 4ADDR_STA_LIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_init, (&nic->four_addr_sta_list.ieee_addr_lock)); MTLK_INIT_STEP_VOID(core, BC_PROBE_REQ_STA_LIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_init_ieee_addr, (&nic->broadcast_probe_resp_sta_list.hash, MTLK_CORE_STA_LIST_HASH_NOF_BUCKETS)); MTLK_INIT_STEP(core, BC_PROBE_REQ_STA_LIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_init, (&nic->broadcast_probe_resp_sta_list.ieee_addr_lock)); MTLK_INIT_STEP_VOID(core, UC_PROBE_REQ_STA_LIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_init_ieee_addr, (&nic->unicast_probe_resp_sta_list.hash, MTLK_CORE_STA_LIST_HASH_NOF_BUCKETS)); MTLK_INIT_STEP(core, UC_PROBE_REQ_STA_LIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_init, (&nic->unicast_probe_resp_sta_list.ieee_addr_lock)); MTLK_INIT_STEP_VOID(core, NDP_WDS_WPA_STA_LIST_INIT, MTLK_OBJ_PTR(nic), mtlk_hash_init_ieee_addr, (&nic->wds_wpa_sta_list.hash, MTLK_CORE_4ADDR_STA_LIST_HASH_NOF_BUCKETS)); MTLK_INIT_STEP(core, NDP_WDS_WPA_STA_LIST_LOCK_INIT, MTLK_OBJ_PTR(nic), mtlk_osal_lock_init, (&nic->wds_wpa_sta_list.ieee_addr_lock)); MTLK_INIT_STEP(core, NDP_ACKED, MTLK_OBJ_PTR(nic), mtlk_osal_event_init, (&nic->ndp_acked)); nic->is_stopped = TRUE; ILOG1_SDDDS("%s: Inited: is_stopped=%u, is_stopping=%u, is_iface_stopping=%u, net_state=%s", mtlk_df_get_name(mtlk_vap_get_df(nic->vap_handle)), nic->is_stopped, nic->is_stopping, nic->is_iface_stopping, mtlk_net_state_to_string(mtlk_core_get_net_state(nic))); MTLK_INIT_FINALLY(core, MTLK_OBJ_PTR(nic)) MTLK_INIT_RETURN(core, MTLK_OBJ_PTR(nic), _mtlk_core_cleanup, (nic)) } int __MTLK_IFUNC mtlk_core_api_init (mtlk_vap_handle_t vap_handle, mtlk_core_api_t *core_api, mtlk_df_t* df) { int res; mtlk_core_t *core; MTLK_ASSERT(NULL != core_api); /* initialize function table */ core_api->vft = &core_vft; core = mtlk_fast_mem_alloc(MTLK_FM_USER_CORE, sizeof(mtlk_core_t)); if(NULL == core) { return MTLK_ERR_NO_MEM; } memset(core, 0, sizeof(mtlk_core_t)); res = _mtlk_core_init(core, vap_handle, df); if (MTLK_ERR_OK != res) { mtlk_fast_mem_free(core); return res; } core_api->core_handle = HANDLE_T(core); return MTLK_ERR_OK; } static int mtlk_core_master_set_default_band(struct nic *nic) { uint8 freq_band_cfg = MTLK_HW_BAND_NONE; wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); MTLK_ASSERT(!mtlk_vap_is_slave_ap(nic->vap_handle)); if (mtlk_core_is_band_supported(nic, MTLK_HW_BAND_BOTH) == MTLK_ERR_OK) { freq_band_cfg = MTLK_HW_BAND_BOTH; } else if (mtlk_core_is_band_supported(nic, MTLK_HW_BAND_5_2_GHZ) == MTLK_ERR_OK) { freq_band_cfg = MTLK_HW_BAND_5_2_GHZ; } else if (mtlk_core_is_band_supported(nic, MTLK_HW_BAND_2_4_GHZ) == MTLK_ERR_OK) { freq_band_cfg = MTLK_HW_BAND_2_4_GHZ; } else { ELOG_D("CID-%04x: None of the bands is supported", mtlk_vap_get_oid(nic->vap_handle)); return MTLK_ERR_UNKNOWN; } WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_FREQ_BAND_CFG, freq_band_cfg); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_FREQ_BAND_CUR, freq_band_cfg); return MTLK_ERR_OK; } static int mtlk_core_set_default_net_mode(struct nic *nic) { uint8 freq_band_cfg = MTLK_HW_BAND_NONE; uint8 net_mode = MTLK_NETWORK_NONE; mtlk_core_t *core_master = NULL; uint32 bss_rate = CFG_BASIC_RATE_SET_DEFAULT; MTLK_ASSERT(nic != NULL); if(mtlk_vap_is_master(nic->vap_handle)) { /* Set default mode based on band * for Master AP or STA */ freq_band_cfg = core_cfg_get_freq_band_cfg(nic); net_mode = get_net_mode(freq_band_cfg, TRUE); } else { /* Copy default mode from Master VAP. * This is important while scripts * are not ready for network mode per VAP. */ core_master = mtlk_core_get_master(nic); MTLK_ASSERT(core_master != NULL); net_mode = core_cfg_get_network_mode_cfg(core_master); /* Copy basic rate set too */ bss_rate = MTLK_CORE_PDB_GET_INT(core_master, PARAM_DB_CORE_BASIC_RATE_SET); MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_BASIC_RATE_SET, bss_rate); } MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_NET_MODE_CUR, net_mode); MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_NET_MODE_CFG, net_mode); MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_IS_HT_CUR, is_ht_net_mode(net_mode)); MTLK_CORE_PDB_SET_INT(nic, PARAM_DB_CORE_IS_HT_CFG, is_ht_net_mode(net_mode)); return MTLK_ERR_OK; } MTLK_START_STEPS_LIST_BEGIN(core_slow_ctx) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, SERIALIZER_START) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, SET_MAC_MAC_ADDR) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, PARSE_EE_DATA) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, CACHE_INIT) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, PROCESS_ANTENNA_CFG) #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, PROCESS_PCOC) #endif /*CPTCFG_IWLWAV_PMCU_SUPPORT*/ MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, WDS_INIT) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, SET_DEFAULT_BAND) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, SET_DEFAULT_NET_MODE) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, WATCHDOG_TIMER_START) MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, SERIALIZER_ACTIVATE) #ifdef MTLK_LEGACY_STATISTICS MTLK_START_STEPS_LIST_ENTRY(core_slow_ctx, CORE_STAT_REQ_HANDLER) #endif MTLK_START_INNER_STEPS_BEGIN(core_slow_ctx) MTLK_START_STEPS_LIST_END(core_slow_ctx); #ifdef MTLK_LEGACY_STATISTICS static void __MTLK_IFUNC _mtlk_core_stat_handle_request(mtlk_irbd_t *irbd, mtlk_handle_t context, const mtlk_guid_t *evt, void *buffer, uint32 *size) { struct nic_slow_ctx *slow_ctx = HANDLE_T_PTR(struct nic_slow_ctx, context); mtlk_wssa_info_hdr_t *hdr = (mtlk_wssa_info_hdr_t *) buffer; MTLK_UNREFERENCED_PARAM(evt); if(sizeof(mtlk_wssa_info_hdr_t) > *size) return; if(MTIDL_SRC_DRV == hdr->info_source) { switch(hdr->info_id) { case MTLK_WSSA_DRV_TR181_WLAN: { if(sizeof(mtlk_wssa_drv_tr181_wlan_stats_t) + sizeof(mtlk_wssa_info_hdr_t) > *size) { hdr->processing_result = MTLK_ERR_BUF_TOO_SMALL; } else { _mtlk_core_get_tr181_wlan_stats(slow_ctx->nic, (mtlk_wssa_drv_tr181_wlan_stats_t*) &hdr[1]); hdr->processing_result = MTLK_ERR_OK; *size = sizeof(mtlk_wssa_drv_tr181_wlan_stats_t) + sizeof(mtlk_wssa_info_hdr_t); } } break; case MTLK_WSSA_DRV_STATUS_WLAN: { if(sizeof(mtlk_wssa_drv_wlan_stats_t) + sizeof(mtlk_wssa_info_hdr_t) > *size) { hdr->processing_result = MTLK_ERR_BUF_TOO_SMALL; } else { _mtlk_core_get_wlan_stats(slow_ctx->nic, (mtlk_wssa_drv_wlan_stats_t*) &hdr[1]); hdr->processing_result = MTLK_ERR_OK; *size = sizeof(mtlk_wssa_drv_wlan_stats_t) + sizeof(mtlk_wssa_info_hdr_t); } } break; case MTLK_WSSA_DRV_TR181_HW: { if(sizeof(mtlk_wssa_drv_tr181_hw_t) + sizeof(mtlk_wssa_info_hdr_t) > *size) { hdr->processing_result = MTLK_ERR_BUF_TOO_SMALL; } else { _mtlk_core_get_tr181_hw(slow_ctx->nic, (mtlk_wssa_drv_tr181_hw_t*) &hdr[1]); hdr->processing_result = MTLK_ERR_OK; *size = sizeof(mtlk_wssa_drv_tr181_hw_t) + sizeof(mtlk_wssa_info_hdr_t); } } break; #if MTLK_MTIDL_WLAN_STAT_FULL case MTLK_WSSA_DRV_DEBUG_STATUS_WLAN: { if(sizeof(mtlk_wssa_drv_debug_wlan_stats_t) + sizeof(mtlk_wssa_info_hdr_t) > *size) { hdr->processing_result = MTLK_ERR_BUF_TOO_SMALL; } else { _mtlk_core_get_debug_wlan_stats(slow_ctx->nic, (mtlk_wssa_drv_debug_wlan_stats_t*) &hdr[1]); hdr->processing_result = MTLK_ERR_OK; *size = sizeof(mtlk_wssa_drv_debug_wlan_stats_t) + sizeof(mtlk_wssa_info_hdr_t); } } break; #endif /* MTLK_MTIDL_WLAN_STAT_FULL */ default: { /* Try to handle HW/Radio request */ wave_radio_t *radio = wave_vap_radio_get(slow_ctx->nic->vap_handle); return wave_radio_stat_handle_request(irbd, HANDLE_T(radio), evt, buffer, size); } } } else { hdr->processing_result = MTLK_ERR_NO_ENTRY; *size = sizeof(mtlk_wssa_info_hdr_t); } } #endif /* MTLK_LEGACY_STATISTICS */ #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT static const mtlk_ability_id_t _core_pmcu_abilities[] = { WAVE_RADIO_REQ_GET_PCOC_CFG, WAVE_RADIO_REQ_SET_PCOC_CFG }; void __MTLK_IFUNC mtlk_core_pmcu_register_vap(mtlk_vap_handle_t vap_handle) { mtlk_abmgr_register_ability_set(mtlk_vap_get_abmgr(vap_handle), _core_pmcu_abilities, ARRAY_SIZE(_core_pmcu_abilities)); mtlk_abmgr_enable_ability_set(mtlk_vap_get_abmgr(vap_handle), _core_pmcu_abilities, ARRAY_SIZE(_core_pmcu_abilities)); } void __MTLK_IFUNC mtlk_core_pmcu_unregister_vap(mtlk_vap_handle_t vap_handle) { mtlk_abmgr_disable_ability_set(mtlk_vap_get_abmgr(vap_handle), _core_pmcu_abilities, ARRAY_SIZE(_core_pmcu_abilities)); mtlk_abmgr_unregister_ability_set(mtlk_vap_get_abmgr(vap_handle), _core_pmcu_abilities, ARRAY_SIZE(_core_pmcu_abilities)); } #endif /*CPTCFG_IWLWAV_PMCU_SUPPORT*/ static void __MTLK_IFUNC _mtlk_slow_ctx_stop(struct nic_slow_ctx *slow_ctx, struct nic* nic) { MTLK_ASSERT(NULL != slow_ctx); MTLK_ASSERT(NULL != nic); MTLK_STOP_BEGIN(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx)) #ifdef MTLK_LEGACY_STATISTICS MTLK_STOP_STEP(core_slow_ctx, CORE_STAT_REQ_HANDLER, MTLK_OBJ_PTR(slow_ctx), mtlk_wssd_unregister_request_handler, (mtlk_vap_get_irbd(nic->vap_handle), slow_ctx->stat_irb_handle)); #endif MTLK_STOP_STEP(core_slow_ctx, SERIALIZER_ACTIVATE, MTLK_OBJ_PTR(slow_ctx), mtlk_serializer_stop, (&slow_ctx->serializer)) MTLK_STOP_STEP(core_slow_ctx, WATCHDOG_TIMER_START, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_cancel_sync, (&slow_ctx->mac_watchdog_timer)) MTLK_STOP_STEP(core_slow_ctx, SET_DEFAULT_NET_MODE, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()) MTLK_STOP_STEP(core_slow_ctx, SET_DEFAULT_BAND, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()) MTLK_STOP_STEP(core_slow_ctx, WDS_INIT, MTLK_OBJ_PTR(slow_ctx), wds_cleanup, (&slow_ctx->wds_mng)) #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT MTLK_STOP_STEP(core_slow_ctx, PROCESS_PCOC, MTLK_OBJ_PTR(slow_ctx), mtlk_core_pmcu_unregister_vap, (nic->vap_handle)) #endif /*CPTCFG_IWLWAV_PMCU_SUPPORT*/ MTLK_STOP_STEP(core_slow_ctx, PROCESS_ANTENNA_CFG, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()) MTLK_STOP_STEP(core_slow_ctx, CACHE_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_cache_cleanup, (&slow_ctx->cache)) MTLK_STOP_STEP(core_slow_ctx, PARSE_EE_DATA, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()) MTLK_STOP_STEP(core_slow_ctx, SET_MAC_MAC_ADDR, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()) MTLK_STOP_STEP(core_slow_ctx, SERIALIZER_START, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()) MTLK_STOP_END(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx)) } static int __MTLK_IFUNC _mtlk_slow_ctx_start(struct nic_slow_ctx *slow_ctx, struct nic* nic) { int cache_param; struct mtlk_scan_config scan_cfg; mtlk_eeprom_data_t *eeprom_data; mtlk_txmm_t *txmm; BOOL is_dut; BOOL is_master; int res = MTLK_ERR_OK; MTLK_ASSERT(NULL != slow_ctx); MTLK_ASSERT(NULL != nic); MTLK_UNREFERENCED_PARAM(res); txmm = mtlk_vap_get_txmm(nic->vap_handle); is_dut = mtlk_vap_is_dut(nic->vap_handle); is_master = mtlk_vap_is_master (nic->vap_handle); MTLK_START_TRY(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx)) MTLK_START_STEP(core_slow_ctx, SERIALIZER_START, MTLK_OBJ_PTR(slow_ctx), mtlk_serializer_start, (&slow_ctx->serializer)) eeprom_data = mtlk_core_get_eeprom(nic); MTLK_START_STEP_IF(!is_dut && is_master, core_slow_ctx, SET_MAC_MAC_ADDR, MTLK_OBJ_PTR(slow_ctx), core_cfg_set_mac_addr, (nic, (char *)mtlk_eeprom_get_nic_mac_addr(eeprom_data))) MTLK_START_STEP_IF(!is_dut && is_master, core_slow_ctx, PARSE_EE_DATA, MTLK_OBJ_PTR(slow_ctx), mtlk_eeprom_check_ee_data, (eeprom_data, txmm, mtlk_vap_is_ap(nic->vap_handle))) core_cfg_country_code_set_default(nic); if (mtlk_vap_is_ap(nic->vap_handle)) { cache_param = 0; } else { cache_param = SCAN_CACHE_AGEING; } MTLK_START_STEP(core_slow_ctx, CACHE_INIT, MTLK_OBJ_PTR(slow_ctx), mtlk_cache_init, (&slow_ctx->cache, cache_param)) MTLK_START_STEP_VOID(core_slow_ctx, PROCESS_ANTENNA_CFG, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()) SLOG0(SLOG_DFLT_ORIGINATOR, SLOG_DFLT_RECEIVER, tx_limit_t, &nic->slow_ctx->tx_limits); #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT MTLK_START_STEP_VOID_IF((is_master), core_slow_ctx, PROCESS_PCOC, MTLK_OBJ_PTR(slow_ctx), mtlk_core_pmcu_register_vap, (nic->vap_handle)); #endif /*CPTCFG_IWLWAV_PMCU_SUPPORT*/ scan_cfg.txmm = txmm; scan_cfg.bss_cache = &slow_ctx->cache; scan_cfg.bss_data = &slow_ctx->bss_data; MTLK_START_STEP_IF(mtlk_vap_is_ap(nic->vap_handle), core_slow_ctx, WDS_INIT, MTLK_OBJ_PTR(slow_ctx), wds_init, (&slow_ctx->wds_mng, nic->vap_handle)) MTLK_START_STEP_IF(!is_dut && is_master, core_slow_ctx, SET_DEFAULT_BAND, MTLK_OBJ_PTR(slow_ctx), mtlk_core_master_set_default_band, (nic)) MTLK_START_STEP(core_slow_ctx, SET_DEFAULT_NET_MODE, MTLK_OBJ_PTR(slow_ctx), mtlk_core_set_default_net_mode, (nic)) MTLK_START_STEP_IF(is_master, core_slow_ctx, WATCHDOG_TIMER_START, MTLK_OBJ_PTR(slow_ctx), mtlk_osal_timer_set, (&slow_ctx->mac_watchdog_timer, WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(nic->vap_handle), PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_PERIOD_MS))) MTLK_START_STEP_VOID(core_slow_ctx, SERIALIZER_ACTIVATE, MTLK_OBJ_PTR(slow_ctx), MTLK_NOACTION, ()) #ifdef MTLK_LEGACY_STATISTICS MTLK_START_STEP_EX(core_slow_ctx, CORE_STAT_REQ_HANDLER, MTLK_OBJ_PTR(slow_ctx), mtlk_wssd_register_request_handler, (mtlk_vap_get_irbd(nic->vap_handle), _mtlk_core_stat_handle_request, HANDLE_T(slow_ctx)), slow_ctx->stat_irb_handle, slow_ctx->stat_irb_handle != NULL, MTLK_ERR_UNKNOWN); #endif MTLK_START_FINALLY(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx)) MTLK_START_RETURN(core_slow_ctx, MTLK_OBJ_PTR(slow_ctx), _mtlk_slow_ctx_stop, (slow_ctx, nic)) } MTLK_START_STEPS_LIST_BEGIN(core) MTLK_START_STEPS_LIST_ENTRY(core, SET_NET_STATE_IDLE) MTLK_START_STEPS_LIST_ENTRY(core, SLOW_CTX_START) MTLK_START_STEPS_LIST_ENTRY(core, DF_USER_SET_MAC_ADDR) MTLK_START_STEPS_LIST_ENTRY(core, RESET_STATS) MTLK_START_STEPS_LIST_ENTRY(core, MC_INIT) MTLK_START_STEPS_LIST_ENTRY(core, DUT_REGISTER) MTLK_START_STEPS_LIST_ENTRY(core, VAP_DB) MTLK_START_STEPS_LIST_ENTRY(core, CORE_ABILITIES_INIT) MTLK_START_STEPS_LIST_ENTRY(core, RADIO_ABILITIES_INIT) MTLK_START_STEPS_LIST_ENTRY(core, SET_NET_STATE_READY) MTLK_START_STEPS_LIST_ENTRY(core, INIT_DEFAULTS) MTLK_START_STEPS_LIST_ENTRY(core, SET_VAP_MIBS) MTLK_START_INNER_STEPS_BEGIN(core) MTLK_START_STEPS_LIST_END(core); static void _mtlk_core_stop (mtlk_vap_handle_t vap_handle) { mtlk_core_t *nic = mtlk_vap_get_core (vap_handle); int i; ILOG0_D("CID-%04x: stop", mtlk_vap_get_oid(vap_handle)); /*send RMMOD event to application*/ if (!mtlk_core_is_hw_halted(nic) && mtlk_vap_is_ap(vap_handle)) { ILOG4_V("RMMOD send event"); mtlk_df_ui_notify_notify_rmmod(mtlk_df_get_name(mtlk_vap_get_df(vap_handle))); } MTLK_STOP_BEGIN(core, MTLK_OBJ_PTR(nic)) MTLK_STOP_STEP(core, SET_VAP_MIBS, MTLK_OBJ_PTR(nic), MTLK_NOACTION, ()) MTLK_STOP_STEP(core, INIT_DEFAULTS, MTLK_OBJ_PTR(nic), MTLK_NOACTION, ()) MTLK_STOP_STEP(core, SET_NET_STATE_READY, MTLK_OBJ_PTR(nic), MTLK_NOACTION, ()) MTLK_STOP_STEP(core, RADIO_ABILITIES_INIT, MTLK_OBJ_PTR(nic), wave_radio_abilities_unregister, (nic)) MTLK_STOP_STEP(core, CORE_ABILITIES_INIT, MTLK_OBJ_PTR(nic), wave_core_abilities_unregister, (nic)) MTLK_STOP_STEP(core, VAP_DB, MTLK_OBJ_PTR(nic), mtlk_mbss_send_vap_db_del, (nic)) MTLK_STOP_STEP(core, DUT_REGISTER, MTLK_OBJ_PTR(nic), mtlk_dut_core_unregister, (nic)); MTLK_STOP_STEP(core, MC_INIT, MTLK_OBJ_PTR(nic), mtlk_mc_uninit, (nic)) MTLK_STOP_STEP(core, RESET_STATS, MTLK_OBJ_PTR(nic), MTLK_NOACTION, ()) MTLK_STOP_STEP(core, DF_USER_SET_MAC_ADDR, MTLK_OBJ_PTR(nic), MTLK_NOACTION, ()) MTLK_STOP_STEP(core, SLOW_CTX_START, MTLK_OBJ_PTR(nic), _mtlk_slow_ctx_stop, (nic->slow_ctx, nic)) MTLK_STOP_STEP(core, SET_NET_STATE_IDLE, MTLK_OBJ_PTR(nic), MTLK_NOACTION, ()) MTLK_STOP_END(core, MTLK_OBJ_PTR(nic)) for (i = 0; i < ARRAY_SIZE(nic->txmm_async_eeprom_msgs); i++) { mtlk_txmm_msg_cancel(&nic->txmm_async_eeprom_msgs[i]); } ILOG1_SDDDS("%s: Stopped: is_stopped=%u, is_stopping=%u, is_iface_stopping=%u, net_state=%s", mtlk_df_get_name(mtlk_vap_get_df(nic->vap_handle)), nic->is_stopped, nic->is_stopping, nic->is_iface_stopping, mtlk_net_state_to_string(mtlk_core_get_net_state(nic))); } static int _mtlk_core_start (mtlk_vap_handle_t vap_handle) { mtlk_core_t *nic = mtlk_vap_get_core (vap_handle); uint8 mac_addr[ETH_ALEN]; MTLK_START_TRY(core, MTLK_OBJ_PTR(nic)) MTLK_START_STEP(core, SET_NET_STATE_IDLE, MTLK_OBJ_PTR(nic), mtlk_core_set_net_state, (nic, NET_STATE_IDLE)) _mtlk_core_poll_stat_init(nic); MTLK_START_STEP(core, SLOW_CTX_START, MTLK_OBJ_PTR(nic), _mtlk_slow_ctx_start, (nic->slow_ctx, nic)) wave_pdb_get_mac( mtlk_vap_get_param_db(vap_handle), PARAM_DB_CORE_MAC_ADDR, &mac_addr); /* Setting mac address in net_device is done by mac80211 framework for station role interfaces */ MTLK_START_STEP_VOID_IF((mtlk_vap_is_ap(vap_handle)), core, DF_USER_SET_MAC_ADDR, MTLK_OBJ_PTR(nic), mtlk_df_ui_set_mac_addr, (mtlk_vap_get_df(vap_handle), mac_addr)) MTLK_START_STEP_VOID(core, RESET_STATS, MTLK_OBJ_PTR(nic), _mtlk_core_reset_stats_internal, (nic)) MTLK_START_STEP_IF((mtlk_vap_is_ap(vap_handle)), core, MC_INIT, MTLK_OBJ_PTR(nic), mtlk_mc_init, (nic)) MTLK_START_STEP(core, DUT_REGISTER, MTLK_OBJ_PTR(nic), mtlk_dut_core_register, (nic)); MTLK_START_STEP_IF(mtlk_vap_is_ap(vap_handle), core, VAP_DB, MTLK_OBJ_PTR(nic), mtlk_mbss_send_vap_db_add, (nic)) MTLK_START_STEP(core, CORE_ABILITIES_INIT, MTLK_OBJ_PTR(nic), wave_core_abilities_register, (nic)) MTLK_START_STEP_IF(mtlk_vap_is_master_ap(vap_handle), core, RADIO_ABILITIES_INIT, MTLK_OBJ_PTR(nic), wave_radio_abilities_register, (nic)) MTLK_START_STEP(core, SET_NET_STATE_READY, MTLK_OBJ_PTR(nic), mtlk_core_set_net_state, (nic, NET_STATE_READY)) MTLK_START_STEP(core, INIT_DEFAULTS, MTLK_OBJ_PTR(nic), mtlk_core_init_defaults, (nic)) mtlk_qos_dscp_table_init(nic->dscp_table); if (mtlk_vap_is_ap(vap_handle)) nic->dgaf_disabled = FALSE; else nic->dgaf_disabled = TRUE; nic->osen_enabled = FALSE; MTLK_START_STEP_IF(mtlk_vap_is_ap(vap_handle), core, SET_VAP_MIBS, MTLK_OBJ_PTR(nic), mtlk_set_vap_mibs, (nic)) MTLK_START_FINALLY(core, MTLK_OBJ_PTR(nic)) MTLK_START_RETURN(core, MTLK_OBJ_PTR(nic), _mtlk_core_stop, (vap_handle)) } static int _mtlk_core_release_tx_data (mtlk_vap_handle_t vap_handle, mtlk_hw_data_req_mirror_t *data_req) { int res = MTLK_ERR_UNKNOWN; mtlk_core_t *nic = mtlk_vap_get_core (vap_handle); mtlk_nbuf_t *nbuf = data_req->nbuf; unsigned short qos = 0; #if defined(CPTCFG_IWLWAV_PER_PACKET_STATS) mtlk_nbuf_priv_t *nbuf_priv = mtlk_nbuf_priv(nbuf); #endif #if defined(CPTCFG_IWLWAV_PER_PACKET_STATS) mtlk_nbuf_priv_stats_set(nbuf_priv, MTLK_NBUF_STATS_TS_FW_OUT, mtlk_hw_get_timestamp(vap_handle)); #endif // check if NULL packet confirmed if (data_req->size == 0) { ILOG9_V("Confirmation for NULL nbuf"); goto FINISH; } qos = data_req->tid; if (nic->pstats.ac_used_counter[qos] > 0) --nic->pstats.ac_used_counter[qos]; mtlk_osal_atomic_dec(&nic->unconfirmed_data); res = MTLK_ERR_OK; FINISH: #if defined(CPTCFG_IWLWAV_PRINT_PER_PACKET_STATS) mtlk_nbuf_priv_stats_dump(nbuf_priv); #endif /* Release net buffer * WARNING: we can't do it before since we use STA referenced by this packet on FINISH. */ mtlk_df_nbuf_free(nbuf); return res; } static int _mtlk_core_handle_rx_data (mtlk_vap_handle_t vap_handle, mtlk_core_handle_rx_data_t *data) { mtlk_nbuf_t *nbuf = data->nbuf; MTLK_ASSERT(nbuf != NULL); return _handle_rx_ind(mtlk_vap_get_core(vap_handle), nbuf, data); } static int _mtlk_core_handle_rx_bss (mtlk_vap_handle_t vap_handle, mtlk_core_handle_rx_bss_t *data) { MTLK_ASSERT(data != NULL); return handle_rx_bss_ind(mtlk_vap_get_core(vap_handle), data); } static int __MTLK_IFUNC _handle_fw_debug_trace_event(mtlk_handle_t object, const void *data, uint32 data_size) { UmiDbgTraceInd_t *UmiDbgTraceInd = (UmiDbgTraceInd_t *) data; MTLK_UNREFERENCED_PARAM(object); MTLK_ASSERT(sizeof(UmiDbgTraceInd_t) >= data_size); MTLK_ASSERT(MAX_DBG_TRACE_DATA >= MAC_TO_HOST32(UmiDbgTraceInd->length)); UmiDbgTraceInd->au8Data[MAX_DBG_TRACE_DATA - 1] = 0; // make sure it is NULL-terminated (although it should be without this) ILOG0_SDDD("DBG TRACE: %s, val1:0x%08X val2:0x%08X val3:0x%08X", UmiDbgTraceInd->au8Data, MAC_TO_HOST32(UmiDbgTraceInd->val1), MAC_TO_HOST32(UmiDbgTraceInd->val2), MAC_TO_HOST32(UmiDbgTraceInd->val3)); return MTLK_ERR_OK; } static int _wave_core_rcvry_reset (mtlk_handle_t hcore, const void* data, uint32 data_size){ mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; wave_rcvry_task_ctx_t ** rcvry_handle = NULL; int res = MTLK_ERR_OK; uint32 size = sizeof(wave_rcvry_task_ctx_t *); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); ILOG1_V("resetting recovery config"); rcvry_handle = mtlk_clpb_enum_get_next(clpb, &size); MTLK_CLPB_TRY(rcvry_handle, size) wave_rcvry_reset(rcvry_handle); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END; } static int __MTLK_IFUNC wave_dbg_static_plan_mu_group_stats_ind_handle(mtlk_handle_t object, const void *data, uint32 data_size) { int i; int group_id; mtlk_core_t *master_core; wave_radio_t *radio; UMI_DBG_HE_MU_GROUP_STATS *UmiDbgMuGroup = (UMI_DBG_HE_MU_GROUP_STATS *) data; UMI_DBG_HE_MU_GROUP_STATS HeMuGroups[HE_MU_MAX_NUM_OF_GROUPS]; mtlk_pdb_size_t UmiDbgMuGroupStatsSize = sizeof(HeMuGroups); MTLK_UNREFERENCED_PARAM(object); MTLK_ASSERT(sizeof(*UmiDbgMuGroup) == data_size); group_id = UmiDbgMuGroup->groupId; if(group_id >= HE_MU_MAX_NUM_OF_GROUPS) { ELOG_D("Wrong HE MU Group ID (%d) !", group_id); return MTLK_ERR_PARAMS; } master_core = HANDLE_T_PTR(mtlk_core_t, object); radio = wave_vap_radio_get(master_core->vap_handle); mtlk_dump(1, UmiDbgMuGroup, sizeof(*UmiDbgMuGroup), "dump of the UMI_MAN_HE_MU_DBG_IND"); /* Read current MU group stats */ if (MTLK_ERR_OK != WAVE_RADIO_PDB_GET_BINARY(radio, PARAM_DB_RADIO_PLAN_MU_GROUP_STATS, &HeMuGroups[0], &UmiDbgMuGroupStatsSize)) { ELOG_D("CID-%04x: Can't read PLAN_MU_GROUP_STATS from PDB", mtlk_vap_get_oid(master_core->vap_handle)); return MTLK_ERR_PARAMS; } /* Update the stats for particular group */ HeMuGroups[group_id].groupId = group_id; HeMuGroups[group_id].planType = UmiDbgMuGroup->planType; HeMuGroups[group_id].setReset = UmiDbgMuGroup->setReset; for(i = 0; i < HE_MU_MAX_NUM_OF_USERS_PER_GROUP; i++) { HeMuGroups[group_id].stationId[i] = MAC_TO_HOST16(UmiDbgMuGroup->stationId[i]); } if (MTLK_ERR_OK != WAVE_RADIO_PDB_SET_BINARY(radio, PARAM_DB_RADIO_PLAN_MU_GROUP_STATS, &HeMuGroups[0], UmiDbgMuGroupStatsSize)) { ELOG_D("CID-%04x: Can't set PLAN_MU_GROUP_STATS to PDB", mtlk_vap_get_oid(master_core->vap_handle)); return MTLK_ERR_PARAMS; } return MTLK_ERR_OK; } static int __MTLK_IFUNC _handle_core_class3_error(mtlk_handle_t core_object, const void *data, uint32 data_size) { mtlk_core_t *master_core = HANDLE_T_PTR(mtlk_core_t, core_object); mtlk_core_t *core; UMI_FRAME_CLASS_ERROR *frame_error = (UMI_FRAME_CLASS_ERROR *)data; UMI_FRAME_CLASS_ERROR_ENTRY *class3_error = NULL; mtlk_vap_manager_t *vap_mng; mtlk_vap_handle_t vap_handle; uint32 i; MTLK_ASSERT(sizeof(UMI_FRAME_CLASS_ERROR) == data_size); MTLK_ASSERT(frame_error->u8numOfValidEntries <= MAX_NUMBER_FRAME_CLASS_ERROR_ENTRIES_IN_MESSAGE); MTLK_ASSERT(master_core != NULL); vap_mng = mtlk_vap_get_manager(master_core->vap_handle); for(i = 0; i < frame_error->u8numOfValidEntries; i++) { class3_error = &frame_error->frameClassErrorEntries[i]; MTLK_ASSERT(class3_error != NULL); if (MTLK_ERR_OK != mtlk_vap_manager_get_vap_handle(vap_mng, class3_error->u8vapIndex, &vap_handle)){ ILOG2_D("VapID %u doesn't exist. Ignore class3 error", class3_error->u8vapIndex); continue; /* VAP not exist */ } core = mtlk_vap_get_core(vap_handle); MTLK_ASSERT(core != NULL); if (mtlk_core_get_net_state(core) != NET_STATE_CONNECTED){ ILOG2_D("VapID %u not active. Ignore class3 error", class3_error->u8vapIndex); continue; } /* if WDS is ON, find peer AP in DB and filter out Class 3 errors */ if (mtlk_vap_is_ap(vap_handle) && (BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(core, CORE_DB_CORE_BRIDGE_MODE)) && (core_wds_frame_drop(core, &class3_error->sAddr))) { ILOG2_Y("Ignore class3 error for WDS peers:%Y", class3_error->sAddr.au8Addr); continue; } ILOG2_DDY("CID-%04x: Class3 Error VapID:%u MAC:%Y", mtlk_vap_get_oid(core->vap_handle), class3_error->u8vapIndex, class3_error->sAddr.au8Addr); if (mtlk_vap_is_ap(vap_handle)) wv_cfg80211_class3_error_notify(mtlk_df_user_get_wdev(mtlk_df_get_user(mtlk_vap_get_df(core->vap_handle))), class3_error->sAddr.au8Addr); } return MTLK_ERR_OK; } static int __MTLK_IFUNC _handle_class3_error_ind_handle (mtlk_handle_t core_object, const void *data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, core_object); ILOG5_V("Handling class 3 error"); _mtlk_process_hw_task(core, SERIALIZABLE, _handle_core_class3_error, HANDLE_T(core), data, sizeof(UMI_FRAME_CLASS_ERROR)); return MTLK_ERR_OK; } static int __MTLK_IFUNC _handle_fw_interference_ind (mtlk_handle_t core_object, const void *data, uint32 data_size) { int8 det_threshold; mtlk_core_t* core = HANDLE_T_PTR(mtlk_core_t, core_object); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); const UMI_CONTINUOUS_INTERFERER *interferer_ind = (const UMI_CONTINUOUS_INTERFERER *)data; MTLK_ASSERT(sizeof(UMI_CONTINUOUS_INTERFERER) == data_size); ILOG3_DD("UMI_CONTINUOUS_INTERFERER event: Channel: %u, maximumValue: %d", interferer_ind->channel, interferer_ind->maximumValue); if (mtlk_vap_is_master_ap(core->vap_handle)) { if (core->is_stopped) { ILOG2_V("UMI_CONTINUOUS_INTERFERER event while core is down"); return MTLK_ERR_OK; /* do not process */ } if (!wave_radio_interfdet_get(radio)) { ILOG3_V("UMI_CONTINUOUS_INTERFERER event while interference detection is deactivated"); return MTLK_ERR_OK; /* do not process */ } if (mtlk_core_scan_is_running(core)) { ILOG2_V("UMI_CONTINUOUS_INTERFERER event while scan is running"); return MTLK_ERR_OK; /* do not process */ } if (WAVE_RADIO_OFF == WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MODE_CURRENT)) { ILOG2_V("UMI_CONTINUOUS_INTERFERER event while RF is off"); return MTLK_ERR_OK; /* do not process */ } if (CW_40 == _mtlk_core_get_spectrum_mode(core)) { /* Use 40MHz thresold if user choose 40MHz explicitly */ det_threshold = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_40MHZ_DETECTION_THRESHOLD); } else { /* Use 20MHZ threshold for 20MHz and 20/40 Auto and coexistance */ det_threshold = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_20MHZ_DETECTION_THRESHOLD); } if (interferer_ind->maximumValue > det_threshold) { struct intel_vendor_channel_data ch_data; int res; iwpriv_cca_adapt_t cca_adapt_params; iwpriv_cca_th_t cca_th_params; mtlk_pdb_size_t cca_adapt_size = sizeof(cca_adapt_params); if (MTLK_ERR_OK == WAVE_RADIO_PDB_GET_BINARY(radio, PARAM_DB_RADIO_CCA_ADAPT, &cca_adapt_params, &cca_adapt_size)) { if (cca_adapt_params.initial) { mtlk_osal_timer_cancel_sync(&core->slow_ctx->cca_step_down_timer); core->slow_ctx->cca_adapt.cwi_poll = TRUE; core->slow_ctx->cca_adapt.cwi_drop_detected = FALSE; core->slow_ctx->cca_adapt.stepping_down = FALSE; core->slow_ctx->cca_adapt.stepping_up = FALSE; core->slow_ctx->cca_adapt.step_down_coef = 1; /* read user config */ if (MTLK_ERR_OK != mtlk_core_cfg_read_cca_threshold(core, &cca_th_params)) { return MTLK_ERR_UNKNOWN; } ILOG3_V("CCA adaptive: stop adaptation"); if (_mtlk_core_cca_is_above_configured(core, &cca_th_params)) { int i; ILOG2_V("CCA adaptive: restore original values"); for (i = 0; i < MTLK_CCA_TH_PARAMS_LEN; i++) { core->slow_ctx->cca_adapt.cca_th_params[i] = cca_th_params.values[i]; } res = mtlk_core_cfg_send_cca_threshold_req(core, &cca_th_params); if (res != MTLK_ERR_OK) ELOG_DD("CID-%04x: Can't send CCA thresholds (err=%d)", mtlk_vap_get_oid(core->vap_handle), res); } } } if (is_interf_det_switch_needed(interferer_ind->channel)) { ILOG0_DDD("CID-%04x: Interference is detected on channel %d with Metric %d", mtlk_vap_get_oid(core->vap_handle), interferer_ind->channel, interferer_ind->maximumValue); bt_acs_send_interf_event(interferer_ind->channel, interferer_ind->maximumValue); res = fill_channel_data(core, &ch_data); if (res == MTLK_ERR_OK) mtlk_send_chan_data(core->vap_handle, &ch_data, sizeof(ch_data)); } } } return MTLK_ERR_OK; } void mtlk_cca_step_up_if_allowed (mtlk_core_t* core, int cwi_noise, int limit, int step_up) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); int det_threshold; int i; if (CW_40 == _mtlk_core_get_spectrum_mode(core)) { /* Use 40MHz thresold if user choose 40MHz explicitly */ det_threshold = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_40MHZ_DETECTION_THRESHOLD); } else { /* Use 20MHZ threshold for 20MHz and 20/40 Auto and coexistance */ det_threshold = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_20MHZ_DETECTION_THRESHOLD); } ILOG1_DDD("noise = %d, det_thresh = %d, limit = %d", cwi_noise, det_threshold, limit); ILOG1_DDDDD("current adaptive CCA thresholds: %d %d %d %d %d", core->slow_ctx->cca_adapt.cca_th_params[0], core->slow_ctx->cca_adapt.cca_th_params[1], core->slow_ctx->cca_adapt.cca_th_params[2], core->slow_ctx->cca_adapt.cca_th_params[3], core->slow_ctx->cca_adapt.cca_th_params[4]); if (cwi_noise < det_threshold) { if (core->slow_ctx->cca_adapt.cwi_poll) { if (core->slow_ctx->cca_adapt.cwi_drop_detected) { core->slow_ctx->cca_adapt.cwi_poll = FALSE; core->slow_ctx->cca_adapt.cwi_drop_detected = FALSE; } else { core->slow_ctx->cca_adapt.cwi_drop_detected = TRUE; return; /* act next time */ } } if (_mtlk_core_cca_is_below_limit(core, limit)) { /* increase threshold, send */ iwpriv_cca_th_t cca_th_params; for (i = 0; i < MTLK_CCA_TH_PARAMS_LEN; i++) { core->slow_ctx->cca_adapt.cca_th_params[i] = MIN(limit, core->slow_ctx->cca_adapt.cca_th_params[i] + step_up); cca_th_params.values[i] = core->slow_ctx->cca_adapt.cca_th_params[i]; ILOG1_DD("CCA adaptive: step up value %d: %d", i, cca_th_params.values[i]); } core->slow_ctx->cca_adapt.stepping_up = TRUE; mtlk_core_cfg_send_cca_threshold_req(core, &cca_th_params); } } else { core->slow_ctx->cca_adapt.cwi_poll = TRUE; } } static int __MTLK_IFUNC _handle_beacon_blocked_ind(mtlk_handle_t core_object, const void *data, uint32 data_size) { iwpriv_cca_adapt_t cca_adapt_params; mtlk_pdb_size_t cca_adapt_size = sizeof(cca_adapt_params); mtlk_core_t* core = HANDLE_T_PTR(mtlk_core_t, core_object); const UMI_Beacon_Block_t *beacon_block_ind = (const UMI_Beacon_Block_t *)data; mtlk_osal_msec_t cur_time = mtlk_osal_timestamp_to_ms(mtlk_osal_timestamp()); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); iwpriv_cca_th_t cca_th_params; MTLK_ASSERT(sizeof(UMI_Beacon_Block_t) == data_size); ILOG1_D("BEACON_BLOCKED event: blocked: %d", beacon_block_ind->beaconBlock); if (mtlk_vap_is_master_ap(core->vap_handle)) { if (core->is_stopped) { ILOG1_V("BEACON_BLOCKED event while core is down"); return MTLK_ERR_OK; /* do not process */ } if (!wave_radio_interfdet_get(radio)) { ILOG1_V("BEACON_BLOCKED event while interference detection is deactivated"); return MTLK_ERR_OK; /* do not process */ } if (MTLK_ERR_OK == WAVE_RADIO_PDB_GET_BINARY(radio, PARAM_DB_RADIO_CCA_ADAPT, &cca_adapt_params, &cca_adapt_size)) { if (!cca_adapt_params.initial) { ILOG1_V("BEACON_BLOCKED event while CCA adaptation is deactivated"); return MTLK_ERR_OK; /* do not process */ } } /* read default user config */ if (MTLK_ERR_OK != mtlk_core_cfg_read_cca_threshold(core, &cca_th_params)) { return MTLK_ERR_UNKNOWN; } if (beacon_block_ind->beaconBlock) { /* blocked */ struct intel_vendor_channel_data ch_data; int res; if (core->slow_ctx->cca_adapt.stepping_down) { /* cancel step_down_timer */ mtlk_osal_timer_cancel_sync(&core->slow_ctx->cca_step_down_timer); core->slow_ctx->cca_adapt.stepping_down = FALSE; if ((cur_time - core->slow_ctx->cca_adapt.last_unblocked_time) < (cca_adapt_params.min_unblocked_time * 1000)) { core->slow_ctx->cca_adapt.step_down_coef <<= 1; } } else { if (!core->slow_ctx->cca_adapt.stepping_up) { core->slow_ctx->cca_adapt.step_down_coef = 1; /* reset if adaptation is (re)started */ } } memset(&ch_data, 0, sizeof(ch_data)); res = scan_get_aocs_info(core, &ch_data, NULL); if (MTLK_ERR_OK == res) mtlk_cca_step_up_if_allowed(core, ch_data.cwi_noise, cca_adapt_params.limit, cca_adapt_params.step_up); } else { /* unblocked */ core->slow_ctx->cca_adapt.stepping_up = FALSE; core->slow_ctx->cca_adapt.cwi_poll = FALSE; if (!core->slow_ctx->cca_adapt.stepping_down) { core->slow_ctx->cca_adapt.last_unblocked_time = cur_time; ILOG2_D("CCA adaptive: set last unblocked %d", core->slow_ctx->cca_adapt.last_unblocked_time); if (_mtlk_core_cca_is_above_configured(core, &cca_th_params)) { ILOG1_D("CCA adaptive: Schedule step down timer, interval %d", core->slow_ctx->cca_adapt.step_down_coef * cca_adapt_params.step_down_interval); ILOG1_DDDDD("user config th: %d %d %d %d %d", cca_th_params.values[0], cca_th_params.values[1], cca_th_params.values[2], cca_th_params.values[3], cca_th_params.values[4]); ILOG1_DDDDD("current core th: %d %d %d %d %d", core->slow_ctx->cca_adapt.cca_th_params[0], core->slow_ctx->cca_adapt.cca_th_params[1], core->slow_ctx->cca_adapt.cca_th_params[2], core->slow_ctx->cca_adapt.cca_th_params[3], core->slow_ctx->cca_adapt.cca_th_params[4]); core->slow_ctx->cca_adapt.stepping_down = TRUE; mtlk_osal_timer_set(&core->slow_ctx->cca_step_down_timer, core->slow_ctx->cca_adapt.step_down_coef * cca_adapt_params.step_down_interval * 1000); } } } } return MTLK_ERR_OK; } static int _mtlk_core_sta_req_bss_change (mtlk_core_t *master_core, struct mtlk_sta_bss_change_parameters *bss_change_params) { struct cfg80211_chan_def *chandef = &bss_change_params->info->chandef; struct ieee80211_channel *channel = chandef->chan; struct mtlk_bss_parameters bp; unsigned long basic_rates = bss_change_params->info->basic_rates; int i, res; memset(&bp, 0, sizeof(bp)); bp.vap_id = bss_change_params->vap_index; bp.use_cts_prot = bss_change_params->info->use_cts_prot; bp.use_short_preamble = bss_change_params->info->use_short_preamble; bp.use_short_slot_time = bss_change_params->info->use_short_slot; bp.ap_isolate = 0; bp.ht_opmode = bss_change_params->info->ht_operation_mode; bp.p2p_ctwindow = bss_change_params->info->p2p_noa_attr.oppps_ctwindow; bp.p2p_opp_ps = 0; for_each_set_bit(i, &basic_rates, BITS_PER_LONG) { bp.basic_rates[bp.basic_rates_len++] = bss_change_params->bands[channel->band]->bitrates[i].bitrate / 5; } res = _core_change_bss_by_params(master_core, &bp); return res; } /* This function should be called from master serializer context */ static int _mtlk_core_sta_change_bss (mtlk_handle_t hcore, const void* data, uint32 data_size) { uint32 res = MTLK_ERR_OK; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; struct mtlk_sta_bss_change_parameters *bss_change_params = NULL; uint32 params_size; mtlk_core_t *master_core = HANDLE_T_PTR(mtlk_core_t, hcore); wave_radio_t *radio = wave_vap_radio_get(master_core->vap_handle); wv_mac80211_t *mac80211 = wave_radio_mac80211_get(radio); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(master_core == mtlk_core_get_master(master_core)); bss_change_params = mtlk_clpb_enum_get_next(clpb, &params_size); MTLK_CLPB_TRY(bss_change_params, params_size) /* Prevent setting WMM while in scan */ if (mtlk_core_is_in_scan_mode(master_core)) { MTLK_CLPB_EXIT(MTLK_ERR_RETRY); } if ((bss_change_params->changed & BSS_CHANGED_BASIC_RATES) || (bss_change_params->changed & BSS_CHANGED_ERP_PREAMBLE) || (bss_change_params->changed & BSS_CHANGED_ERP_SLOT) || (bss_change_params->changed & BSS_CHANGED_ERP_CTS_PROT)) { res = _mtlk_core_sta_req_bss_change(master_core, bss_change_params); if (res) { ELOG_V("_mtlk_core_sta_change_bss failed"); MTLK_CLPB_EXIT(res); } wv_mac80211_iface_set_initialized(mac80211, bss_change_params->vap_index); } if (!wv_mac80211_iface_get_is_initialized(mac80211, bss_change_params->vap_index)) { res = _mtlk_core_sta_req_bss_change(master_core, bss_change_params); if (res) { ELOG_V("_mtlk_core_sta_change_bss failed"); MTLK_CLPB_EXIT(res); } wv_mac80211_iface_set_initialized(mac80211, bss_change_params->vap_index); } if (bss_change_params->changed & BSS_CHANGED_BEACON_INT) { mtlk_beacon_interval_t mtlk_beacon_interval; /* * FW should be notified about peer AP beacon interval so that FW ages out packets correctly. * Ager timeout for STA is set according to VAP beacon interval * STA listen interval. * If we only have one VSTA VAP FW may drop packets unnecessarily as ageing period will be minimum * Note: even though we do not enter PS we still need to do some periodic ageing on STA queues * in case we have low rate, many retries, lack of PDs, etc... */ ILOG1_DD("Peer AP Beacon interval (Sta idx %d) has updated to: %d", bss_change_params->vap_index, bss_change_params->info->beacon_int); /* store interval to be used when we get CSA from peer AP*/ wv_mac80211_iface_set_beacon_interval(mac80211, bss_change_params->vap_index, bss_change_params->info->beacon_int); mtlk_beacon_interval.beacon_interval = bss_change_params->info->beacon_int; mtlk_beacon_interval.vap_id = bss_change_params->vap_index; res = _mtlk_beacon_man_set_beacon_interval_by_params(bss_change_params->core, &mtlk_beacon_interval); if (res != MTLK_ERR_OK) ELOG_DD("Error setting peer AP beacon interval %u for VapID %u ", bss_change_params->info->beacon_int, bss_change_params->vap_index); } /* this flag indicates that txq params for all ac's was set by wv_ieee80211_conf_tx*/ if (bss_change_params->changed & BSS_CHANGED_QOS) { struct mtlk_wmm_settings wmm_settings; wmm_settings.vap_id = bss_change_params->vap_index; /* For Sta mode txq params values were already set in param_db by wv_ieee80211_conf_tx, * so these are just dummy values */ wmm_settings.txq_params.ac = 0; wmm_settings.txq_params.aifs = 0; wmm_settings.txq_params.cwmax = 0; wmm_settings.txq_params.cwmin = 0; wmm_settings.txq_params.txop = 0; wmm_settings.txq_params.acm_flag = 0; res = core_cfg_wmm_param_set_by_params(master_core, &wmm_settings); if (res != MTLK_ERR_OK) ELOG_V("WAVE_CORE_REQ_SET_WMM_PARAM failed"); } if (bss_change_params->changed & BSS_CHANGED_TXPOWER) { ILOG0_SD("%s: TODO: tx power changed tx_power=%d", bss_change_params->vif_name, bss_change_params->info->txpower); } MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int __MTLK_IFUNC _mtlk_handle_eeprom_failure_sync(mtlk_handle_t object, const void *data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, object); MTLK_ASSERT(sizeof(EEPROM_FAILURE_EVENT) == data_size); mtlk_cc_handle_eeprom_failure(nic->vap_handle, (const EEPROM_FAILURE_EVENT*) data); return MTLK_ERR_OK; } static int __MTLK_IFUNC _mtlk_handle_generic_event(mtlk_handle_t object, const void *data, uint32 data_size) { MTLK_ASSERT(sizeof(GENERIC_EVENT) == data_size); mtlk_cc_handle_generic_event(HANDLE_T_PTR(mtlk_core_t, object)->vap_handle, (GENERIC_EVENT*) data); return MTLK_ERR_OK; } static int __MTLK_IFUNC _mtlk_handle_algo_failure(mtlk_handle_t object, const void *data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, object); MTLK_ASSERT(sizeof(CALIBR_ALGO_EVENT) == data_size); mtlk_cc_handle_algo_calibration_failure(nic->vap_handle, (const CALIBR_ALGO_EVENT*)data); return MTLK_ERR_OK; } static int __MTLK_IFUNC _mtlk_handle_dummy_event(mtlk_handle_t object, const void *data, uint32 data_size) { MTLK_ASSERT(sizeof(DUMMY_EVENT) == data_size); mtlk_cc_handle_dummy_event(HANDLE_T_PTR(mtlk_core_t, object)->vap_handle, (const DUMMY_EVENT*) data); return MTLK_ERR_OK; } static int __MTLK_IFUNC _mtlk_handle_unknown_event(mtlk_handle_t object, const void *data, uint32 data_size) { MTLK_ASSERT(sizeof(uint32) == data_size); mtlk_cc_handle_unknown_event(HANDLE_T_PTR(mtlk_core_t, object)->vap_handle, *(uint32*)data); return MTLK_ERR_OK; } static void __MTLK_IFUNC _mtlk_handle_mac_event(mtlk_core_t *nic, MAC_EVENT *event) { uint32 event_id = MAC_TO_HOST32(event->u32EventID) & 0xff; switch(event_id) { case EVENT_EEPROM_FAILURE: _mtlk_process_hw_task(nic, SYNCHRONOUS, _mtlk_handle_eeprom_failure_sync, HANDLE_T(nic), &event->u.sEepromEvent, sizeof(EEPROM_FAILURE_EVENT)); break; case EVENT_GENERIC_EVENT: _mtlk_process_hw_task(nic, SERIALIZABLE, _mtlk_handle_generic_event, HANDLE_T(nic), &event->u.sGenericData, sizeof(GENERIC_EVENT)); break; case EVENT_CALIBR_ALGO_FAILURE: _mtlk_process_hw_task(nic, SERIALIZABLE, _mtlk_handle_algo_failure, HANDLE_T(nic), &event->u.sCalibrationEvent, sizeof(CALIBR_ALGO_EVENT)); break; case EVENT_DUMMY: _mtlk_process_hw_task(nic, SERIALIZABLE, _mtlk_handle_dummy_event, HANDLE_T(nic), &event->u.sDummyEvent, sizeof(DUMMY_EVENT)); break; default: _mtlk_process_hw_task(nic, SERIALIZABLE, _mtlk_handle_unknown_event, HANDLE_T(nic), &event_id, sizeof(uint32)); break; } } static int __MTLK_IFUNC _mtlk_handle_unknown_ind_type(mtlk_handle_t object, const void *data, uint32 data_size) { MTLK_ASSERT(sizeof(uint32) == data_size); ILOG0_DD("CID-%04x: Unknown MAC indication type %u", mtlk_vap_get_oid(HANDLE_T_PTR(mtlk_core_t, object)->vap_handle), *(uint32*)data); return MTLK_ERR_OK; } static void _mtlk_core_handle_rx_ctrl (mtlk_vap_handle_t vap_handle, uint32 id, void *payload, uint32 payload_buffer_size) { mtlk_core_t *nic = mtlk_vap_get_core (vap_handle); mtlk_core_t *master_nic = NULL; MTLK_ASSERT(NULL != nic); master_nic = mtlk_vap_manager_get_master_core(mtlk_vap_get_manager(nic->vap_handle)); MTLK_ASSERT(NULL != master_nic); switch(id) { case MC_MAN_MAC_EVENT_IND: _mtlk_handle_mac_event(nic, (MAC_EVENT*)payload); break; case MC_MAN_TKIP_MIC_FAILURE_IND: _mtlk_process_hw_task(master_nic, SERIALIZABLE, _handle_security_alert_ind, HANDLE_T(nic), payload, sizeof(UMI_TKIP_MIC_FAILURE)); break; case MC_MAN_TRACE_IND: _mtlk_process_hw_task(nic, SERIALIZABLE, _handle_fw_debug_trace_event, HANDLE_T(nic), payload, sizeof(UmiDbgTraceInd_t)); break; case MC_MAN_CONTINUOUS_INTERFERER_IND: _mtlk_process_hw_task(nic, SERIALIZABLE, _handle_fw_interference_ind, HANDLE_T(nic), payload, sizeof(UMI_CONTINUOUS_INTERFERER)); break; case MC_MAN_BEACON_BLOCKED_IND: _mtlk_process_hw_task(nic, SERIALIZABLE, _handle_beacon_blocked_ind, HANDLE_T(nic), payload, sizeof(UMI_Beacon_Block_t)); break; case MC_MAN_RADAR_IND: _mtlk_process_hw_task(master_nic, SERIALIZABLE, _handle_radar_event, HANDLE_T(master_nic), payload, sizeof(UMI_RADAR_DETECTION)); break; case MC_MAN_BEACON_TEMPLATE_WAS_SET_IND: /* This has to be run in master VAP context */ if (RCVRY_TYPE_UNDEF != wave_rcvry_type_current_get(mtlk_vap_get_hw(nic->vap_handle))) { /* recovery case */ wave_beacon_man_rcvry_template_ind_handle(master_nic); } else { /* operational case */ _mtlk_process_hw_task(master_nic, SERIALIZABLE, wave_beacon_man_template_ind_handle, HANDLE_T(master_nic), payload, sizeof(UMI_BEACON_SET)); } break; case MC_MAN_CLASS3_ERROR_IND: _mtlk_process_hw_task(nic, SYNCHRONOUS, _handle_class3_error_ind_handle, HANDLE_T(nic), payload, sizeof(UMI_FRAME_CLASS_ERROR_ENTRY)); break; case MC_MAN_HE_MU_DBG_IND: { _mtlk_process_hw_task(nic, SERIALIZABLE, wave_dbg_static_plan_mu_group_stats_ind_handle, HANDLE_T(nic), payload, sizeof(UMI_DBG_HE_MU_GROUP_STATS)); break; } default: _mtlk_process_hw_task(nic, SERIALIZABLE, _mtlk_handle_unknown_ind_type, HANDLE_T(nic), &id, sizeof(uint32)); break; } } static BOOL mtlk_core_ready_to_process_task (mtlk_core_t *nic, uint32 req_id) { wave_rcvry_type_e rcvry_type; mtlk_hw_t *hw = mtlk_vap_get_hw(nic->vap_handle); /* if error is occurred in _pci_probe then serializer is absent */ if (wave_rcvry_pci_probe_error_get(wave_hw_mmb_get_mmb_base(hw))) return FALSE; /* if NONE Recovery was executed then handle BCL commands only */ rcvry_type = wave_rcvry_type_current_get(hw); if (((RCVRY_TYPE_DUT == rcvry_type) || (RCVRY_TYPE_IGNORE == rcvry_type)) && /* just in case, if user executes 2nd NONE Recovery */ (WAVE_CORE_REQ_GET_NETWORK_MODE != req_id) && /* required for BclSockServer */ (WAVE_RADIO_REQ_GET_BCL_MAC_DATA != req_id) && (WAVE_RADIO_REQ_SET_BCL_MAC_DATA != req_id)) { return FALSE; } if ((mtlk_core_rcvry_is_running(nic) || mtlk_core_is_hw_halted(nic) || wave_rcvry_mac_fatal_pending_get(hw)) && (WAVE_CORE_REQ_SET_BEACON == req_id || WAVE_CORE_REQ_ACTIVATE_OPEN == req_id || WAVE_CORE_REQ_GET_STATION == req_id || WAVE_CORE_REQ_CHANGE_BSS == req_id || WAVE_CORE_REQ_SET_WMM_PARAM == req_id || WAVE_RADIO_REQ_SET_CHAN == req_id || WAVE_RADIO_REQ_DO_SCAN == req_id || WAVE_RADIO_REQ_SCAN_TIMEOUT == req_id)) { return FALSE; } return TRUE; } void __MTLK_IFUNC mtlk_core_handle_tx_ctrl (mtlk_vap_handle_t vap_handle, mtlk_user_request_t *req, uint32 id, mtlk_clpb_t *data) { #define _WAVE_CORE_REQ_MAP_START(req_id) \ switch (req_id) { #define _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(req_id, func) \ case (req_id): \ _mtlk_process_user_task(nic, req, SERIALIZABLE, req_id, func, HANDLE_T(nic), data); \ break; #define _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS(req_id, func) \ case (req_id): \ _mtlk_process_user_task(nic, req, SYNCHRONOUS, req_id, func, HANDLE_T(nic), data); \ break; #define _MTLK_CORE_HANDLE_REQ_DUMPABLE(req_id, func) \ case (req_id): \ if (wave_rcvry_fw_dump_in_progress_get(mtlk_vap_get_hw(nic->vap_handle))) { \ _mtlk_process_user_task(nic, req, SYNCHRONOUS, req_id, func, HANDLE_T(nic), data); \ } \ else { \ _mtlk_process_user_task(nic, req, SERIALIZABLE, req_id, func, HANDLE_T(nic), data); \ } \ break; #define _WAVE_CORE_REQ_MAP_END(_id_) \ default: \ ELOG_D("Request 0x%08x not mapped by core", _id_); \ MTLK_ASSERT(FALSE); \ } mtlk_core_t *nic = mtlk_vap_get_core(vap_handle); MTLK_ASSERT(NULL != nic); MTLK_ASSERT(NULL != req); MTLK_ASSERT(NULL != data); if (!mtlk_core_ready_to_process_task (nic, id)) { mtlk_df_ui_req_complete(req, MTLK_ERR_NOT_READY); return; } _WAVE_CORE_REQ_MAP_START(id) /* Radio requests */ _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_ACTIVATE_OPEN, _mtlk_core_activate); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_BEACON, wave_beacon_man_beacon_set); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_BEACON_INTERVAL, _mtlk_beacon_man_set_beacon_interval); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_REQUEST_SID, core_cfg_request_sid); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_REMOVE_SID, core_cfg_remove_sid); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SYNC_DONE, _core_sync_done) _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_CHANGE_BSS, _core_change_bss) _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_STATION, core_cfg_get_station); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_WMM_PARAM, core_cfg_wmm_param_set); _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS(WAVE_CORE_REQ_MGMT_TX, _mtlk_core_mgmt_tx); _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS(WAVE_CORE_REQ_MGMT_RX, _mtlk_core_mgmt_rx); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_CONNECT_STA, _mtlk_core_connect_sta); #ifdef MTLK_LEGACY_STATISTICS _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_DISCONNECT_STA, _mtlk_core_hanle_disconnect_sta_req); #endif _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_AP_CONNECT_STA, _mtlk_core_ap_connect_sta); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_AP_DISCONNECT_STA, _mtlk_core_ap_disconnect_sta); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_AP_DISCONNECT_ALL, core_cfg_ap_disconnect_all); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_AUTHORIZING_STA, _mtlk_core_ap_authorizing_sta); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_DEACTIVATE, _mtlk_core_deactivate); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_MAC_ADDR, _mtlk_core_set_mac_addr_wrapper); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_MAC_ADDR, _mtlk_core_get_mac_addr); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_STATUS, _mtlk_core_get_status); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_RESET_STATS, _mtlk_core_reset_stats); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_WDS_CFG, _mtlk_core_set_wds_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_WDS_CFG, _mtlk_core_get_wds_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_WDS_PEERAP, _mtlk_core_get_wds_peer_ap); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_STADB_CFG, _mtlk_core_get_stadb_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_STADB_CFG, _mtlk_core_set_stadb_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_CORE_CFG, _mtlk_core_get_core_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_CORE_CFG, _mtlk_core_set_core_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_HSTDB_CFG, _mtlk_core_get_hstdb_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_HSTDB_CFG, _mtlk_core_set_hstdb_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GEN_DATA_EXCHANGE, _mtlk_core_gen_data_exchange); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_EE_CAPS, _mtlk_core_get_ee_caps); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_MC_IGMP_TBL, _mtlk_core_get_mc_igmp_tbl); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_MC_HW_TBL, _mtlk_core_get_mc_hw_tbl); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_RANGE_INFO, _mtlk_core_range_info_get); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_STADB_STATUS, _mtlk_core_get_stadb_sta_list); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_STADB_STA_BY_ITER_ID, _mtlk_core_get_stadb_sta_by_iter_id); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_HS20_INFO, _mtlk_core_get_hs20_info); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_WDS_WEP_ENC_CFG, mtlk_core_cfg_set_wds_wep_enc_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_WDS_WEP_ENC_CFG, mtlk_core_cfg_get_wds_wep_enc_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_AUTH_CFG, mtlk_core_cfg_set_auth_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_AUTH_CFG, mtlk_core_cfg_get_auth_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_ENCEXT_CFG, _mtlk_core_get_enc_ext_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_ENCEXT_CFG, _mtlk_core_set_enc_ext_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_DEFAULT_KEY_CFG, _mtlk_core_set_default_key_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_IW_GENERIC, _mtlk_core_get_iw_generic); _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS(WAVE_CORE_REQ_GET_SERIALIZER_INFO, _mtlk_core_get_serializer_info); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_RTLOG_CFG, _mtlk_core_set_rtlog_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(MTLK_CORE_REQ_MCAST_HELPER_GROUP_ID_ACTION, _mtlk_core_mcast_helper_group_id_action); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_RX_TH, mtlk_core_cfg_get_rx_threshold); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_RX_TH, mtlk_core_cfg_set_rx_threshold); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_QOS_MAP, _mtlk_core_set_qos_map); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_AGGR_CONFIG, _mtlk_core_set_aggr_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_AGGR_CONFIG, _mtlk_core_get_aggr_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_SOFTBLOCKLIST_ENTRY, _mtlk_core_set_softblocklist_entry); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_BLACKLIST_ENTRY, _mtlk_core_set_blacklist_entry); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_BLACKLIST_ENTRIES, _mtlk_core_get_blacklist_entries); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_MULTI_AP_BL_ENTRIES, mtlk_core_cfg_get_multi_ap_blacklist_entries); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_ASSOCIATED_DEV_RATE_INFO_RX_STATS, mtlk_core_get_associated_dev_rate_info_rx_stats); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_ASSOCIATED_DEV_RATE_INFO_TX_STATS, mtlk_core_get_associated_dev_rate_info_tx_stats); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_STATION_MEASUREMENTS, _mtlk_core_get_station_measurements); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_VAP_MEASUREMENTS, _mtlk_core_get_vap_measurements); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_UNCONNECTED_STATION, _mtlk_core_get_unconnected_station); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_FOUR_ADDR_CFG, core_cfg_set_four_addr_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_FOUR_ADDR_CFG, core_cfg_get_four_addr_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_FOUR_ADDR_STA_LIST, core_cfg_get_four_addr_sta_list); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_ATF_QUOTAS, mtlk_core_cfg_set_atf_quotas); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_MCAST_RANGE, mtlk_core_cfg_set_mcast_range); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_MCAST_RANGE_IPV4, mtlk_core_cfg_get_mcast_range_list_ipv4); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_MCAST_RANGE_IPV6, mtlk_core_cfg_get_mcast_range_list_ipv6); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_OPERATING_MODE, mtlk_core_cfg_set_operating_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_WDS_WPA_LIST_ENTRY, mtlk_core_cfg_set_wds_wpa_entry); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_WDS_WPA_LIST_ENTRIES, mtlk_core_cfg_get_wds_wpa_entry); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_DGAF_DISABLED, mtlk_core_cfg_set_dgaf_disabled); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_TX_POWER, _mtlk_core_get_tx_power); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_CHECK_4ADDR_MODE, _mtlk_core_check_4addr_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_RADIO_INFO, _mtlk_core_get_radio_info); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_CHAN, core_cfg_set_chan_clpb); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_DO_SCAN, scan_do_scan); _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS(WAVE_RADIO_REQ_START_SCHED_SCAN, scan_start_sched_scan); _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS(WAVE_RADIO_REQ_STOP_SCHED_SCAN, scan_stop_sched_scan); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SCAN_TIMEOUT, scan_timeout_async_func); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_ALTER_SCAN, mtlk_alter_scan) _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS(WAVE_RADIO_REQ_DUMP_SURVEY, scan_dump_survey); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_FIN_PREV_FW_SC, finish_and_prevent_fw_set_chan_clpb); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_AOCS_CFG, _mtlk_core_get_aocs_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_AOCS_CFG, _mtlk_core_set_aocs_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_DOT11H_AP_CFG, _mtlk_core_get_dot11h_ap_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_DOT11H_AP_CFG, _mtlk_core_set_dot11h_ap_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_MIBS_CFG, _mtlk_core_get_mibs_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_MIBS_CFG, _mtlk_core_set_mibs_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_COUNTRY_CFG, _mtlk_core_get_country_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_COUNTRY_CFG, _mtlk_core_set_country_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_DOT11D_CFG, _core_cfg_get_dot11d_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_DOT11D_CFG, _mtlk_core_set_dot11d_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_MAC_WATCHDOG_CFG, _mtlk_core_get_mac_wdog_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_MAC_WATCHDOG_CFG, _mtlk_core_set_mac_wdog_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_MASTER_CFG, _mtlk_core_get_master_specific_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_MASTER_CFG, _mtlk_core_set_master_specific_cfg); #ifdef MTLK_LEGACY_STATISTICS _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_MHI_STATS, _mtlk_core_get_mhi_stats); #endif _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_PHY_RX_STATUS, _mtlk_core_get_phy_rx_status); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_HW_LIMITS, _mtlk_core_get_hw_limits); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_TX_RATE_POWER, _mtlk_core_get_tx_rate_power); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_TPC_CFG, mtlk_core_get_tpc_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_TPC_CFG, mtlk_core_set_tpc_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_COC_CFG, _mtlk_core_get_coc_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_COC_CFG, _mtlk_core_set_coc_cfg); #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_PCOC_CFG, _mtlk_core_get_pcoc_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_PCOC_CFG, _mtlk_core_set_pcoc_cfg); #endif /*CPTCFG_IWLWAV_PMCU_SUPPORT*/ _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_STOP_LM, _mtlk_core_stop_lm); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_MAC_ASSERT, _mtlk_core_set_mac_assert); _MTLK_CORE_HANDLE_REQ_DUMPABLE(WAVE_RADIO_REQ_GET_BCL_MAC_DATA, _mtlk_core_bcl_mac_data_get); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_BCL_MAC_DATA, _mtlk_core_bcl_mac_data_set); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_MBSS_ADD_VAP_IDX, _mtlk_core_add_vap_idx); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_MBSS_ADD_VAP_NAME, _mtlk_core_add_vap_name); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_MBSS_DEL_VAP_IDX, _mtlk_core_del_vap_idx); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_MBSS_DEL_VAP_NAME, _mtlk_core_del_vap_name); /* Interference Detection */ _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_INTERFDET_PARAMS_CFG, _mtlk_core_set_interfdet_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_INTERFDET_MODE_CFG, _mtlk_core_get_interfdet_mode_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_DBG_CLI, _mtlk_core_simple_cli); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_FW_DEBUG, _mtlk_core_fw_debug); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_FW_LOG_SEVERITY, _mtlk_core_set_fw_log_severity); /* Traffic Analyzer */ _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_TA_CFG, _mtlk_core_set_ta_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_TA_CFG, _mtlk_core_get_ta_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_11B_CFG, _mtlk_core_set_11b_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_11B_CFG, _mtlk_core_get_11b_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_RECOVERY_CFG, _mtlk_core_set_recovery_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_RECOVERY_CFG, _mtlk_core_get_recovery_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_RECOVERY_STATS, _mtlk_core_get_recovery_stats); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_SCAN_AND_CALIB_CFG, _mtlk_core_set_scan_and_calib_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_SCAN_AND_CALIB_CFG, _mtlk_core_get_scan_and_calib_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_AGG_RATE_LIMIT, _mtlk_core_get_agg_rate_limit); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_AGG_RATE_LIMIT, _mtlk_core_set_agg_rate_limit); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_RX_DUTY_CYCLE, mtlk_core_cfg_get_rx_duty_cycle); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_RX_DUTY_CYCLE, mtlk_core_cfg_set_rx_duty_cycle); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_TX_POWER_LIMIT_OFFSET, _mtlk_core_get_tx_power_limit_offset); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_TX_POWER_LIMIT_OFFSET, _mtlk_core_set_tx_power_limit_offset); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_HT_PROTECTION, _mtlk_core_get_ht_protection) _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_HT_PROTECTION, _mtlk_core_set_ht_protection) _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_QAMPLUS_MODE, _mtlk_core_set_qamplus_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_QAMPLUS_MODE, _mtlk_core_get_qamplus_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_RADIO_MODE, _mtlk_core_set_radio_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_RADIO_MODE, _mtlk_core_get_radio_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_AMSDU_NUM, _mtlk_core_set_amsdu_num); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_AMSDU_NUM, _mtlk_core_get_amsdu_num); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_CCA_THRESHOLD, mtlk_core_cfg_set_cca_threshold); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_CCA_THRESHOLD, mtlk_core_cfg_get_cca_threshold); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_CCA_ADAPTIVE, mtlk_core_cfg_set_cca_intervals); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_CCA_ADAPTIVE, mtlk_core_cfg_get_cca_intervals); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_RADAR_RSSI_TH, mtlk_core_cfg_set_radar_rssi_threshold); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_RADAR_RSSI_TH, mtlk_core_cfg_get_radar_rssi_threshold); #ifdef CPTCFG_IWLWAV_SET_PM_QOS _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS (WAVE_RADIO_REQ_GET_CPU_DMA_LATENCY, _mtlk_core_get_cpu_dma_latency); _MTLK_CORE_HANDLE_REQ_SYNCHRONOUS (WAVE_RADIO_REQ_SET_CPU_DMA_LATENCY, _mtlk_core_set_cpu_dma_latency); #endif _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_MAX_MPDU_LENGTH, mtlk_core_cfg_set_max_mpdu_length); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_MAX_MPDU_LENGTH, mtlk_core_cfg_get_max_mpdu_length); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_IRE_CTRL_B, mtlk_core_cfg_set_ire_ctrl_b); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_IRE_CTRL_B, mtlk_core_cfg_get_ire_ctrl_b); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_FIXED_RATE, _mtlk_core_set_fixed_rate); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_SET_STATIC_PLAN, mtlk_core_cfg_set_static_plan); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_SSB_MODE, mtlk_core_set_ssb_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_SSB_MODE, mtlk_core_get_ssb_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_COEX_CFG, mtlk_core_set_coex_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_COEX_CFG, mtlk_core_get_coex_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_FREQ_JUMP_MODE, mtlk_core_cfg_set_freq_jump_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_RESTRICTED_AC_MODE, mtlk_core_cfg_set_restricted_ac_mode_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_RESTRICTED_AC_MODE, mtlk_core_cfg_get_restricted_ac_mode_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_STA_CHANGE_BSS, _mtlk_core_sta_change_bss); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_FIXED_LTF_AND_GI, mtlk_core_set_fixed_ltf_and_gi); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_FIXED_LTF_AND_GI, mtlk_core_get_fixed_ltf_and_gi); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_CAC_TIMEOUT, cac_timer_serialized_func); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_CALIBRATION_MASK, core_cfg_set_calibration_mask); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_CALIBRATION_MASK, core_cfg_get_calibration_mask); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_NFRP_CFG, wave_core_set_nfrp_cfg); /* HW requests */ #ifdef EEPROM_DATA_ACCESS _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_GET_EEPROM_CFG, _mtlk_core_get_eeprom_cfg); #endif /* EEPROM_DATA_ACCESS */ _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_GET_AP_CAPABILITIES, _mtlk_core_get_ap_capabilities) _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_GET_BF_EXPLICIT_CAP, _mtlk_core_get_bf_explicit_cap); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_SET_TEMPERATURE_SENSOR, _mtlk_core_set_calibrate_on_demand); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_GET_TEMPERATURE_SENSOR, _mtlk_core_get_temperature); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_GET_TASKLET_LIMITS, _mtlk_core_get_tasklet_limits); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_SET_TASKLET_LIMITS, _mtlk_core_set_tasklet_limits); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(MTLK_HW_REQ_GET_COUNTERS_SRC, mtlk_core_cfg_get_counters_src); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(MTLK_HW_REQ_SET_COUNTERS_SRC, mtlk_core_cfg_set_counters_src); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_GET_PVT_SENSOR, wave_core_get_pvt_sensor); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_SET_TEST_BUS, wave_core_set_test_bus_mode); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RCVRY_RESET, _wave_core_rcvry_reset); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_RCVRY_MSG_TX, wave_core_cfg_send_rcvry_msg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_NETWORK_MODE, _wave_core_network_mode_get); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_RTS_RATE, wave_core_cfg_get_rts_rate); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_CDB_CFG, _wave_core_cdb_cfg_get); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_SET_RTS_RATE, wave_core_cfg_set_rts_rate); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_RADIO_REQ_GET_PHY_INBAND_POWER, _wave_core_get_phy_inband_power); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_ASSOCIATED_DEV_STATS, mtlk_core_get_associated_dev_stats); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_CHANNEL_STATS, mtlk_core_get_channel_stats); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_ASSOCIATED_DEV_TID_STATS, mtlk_core_get_associated_dev_tid_stats); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_STATS_POLL_PERIOD, mtlk_core_stats_poll_period_get); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_SET_STATS_POLL_PERIOD, mtlk_core_stats_poll_period_set); #ifndef MTLK_LEGACY_STATISTICS _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_PEER_LIST, mtlk_core_get_peer_list); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_PEER_FLOW_STATUS, mtlk_core_get_peer_flow_status); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_PEER_CAPABILITIES, mtlk_core_get_peer_capabilities); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_PEER_RATE_INFO, mtlk_core_get_peer_rate_info); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_RECOVERY_STATS, mtlk_core_get_recovery_stats); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_HW_FLOW_STATUS, mtlk_core_get_hw_flow_status); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_TR181_WLAN_STATS, mtlk_core_get_tr181_wlan_statistics); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_TR181_HW_STATS, mtlk_core_get_tr181_hw_statistics); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_CORE_REQ_GET_TR181_PEER_STATS, mtlk_core_get_tr181_peer_statistics); #endif _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_SET_DYNAMIC_MU_CFG, wave_core_cfg_set_dynamic_mu_cfg); _MTLK_CORE_HANDLE_REQ_SERIALIZABLE(WAVE_HW_REQ_GET_DYNAMIC_MU_CFG, wave_core_cfg_get_dynamic_mu_cfg); _WAVE_CORE_REQ_MAP_END(id) #undef _WAVE_CORE_REQ_MAP_START #undef _MTLK_CORE_HANDLE_REQ_SERIALIZABLE #undef _WAVE_CORE_REQ_MAP_END } static int _mtlk_core_get_prop (mtlk_vap_handle_t vap_handle, mtlk_core_prop_e prop_id, void* buffer, uint32 size) { int res = MTLK_ERR_NOT_SUPPORTED; switch (prop_id) { case MTLK_CORE_PROP_MAC_SW_RESET_ENABLED: if (buffer && size == sizeof(uint32)) { uint32 *mac_sw_reset_enabled = (uint32 *)buffer; *mac_sw_reset_enabled = WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(vap_handle), PARAM_DB_RADIO_MAC_SOFT_RESET_ENABLE); res = MTLK_ERR_OK; } break; case MTLK_CORE_PROP_IS_DUT: if (buffer && size == sizeof(BOOL)) { BOOL *val = (BOOL *)buffer; *val = mtlk_is_dut_core_active(mtlk_vap_get_core(vap_handle)); res = MTLK_ERR_OK; } break; case MTLK_CORE_PROP_IS_MAC_FATAL_PENDING: if (buffer && size == sizeof(BOOL)) { BOOL *val = (BOOL *)buffer; mtlk_hw_t *hw = mtlk_vap_get_hw(vap_handle); *val = (wave_rcvry_mac_fatal_pending_get(hw) | wave_rcvry_fw_dump_in_progress_get(hw)); res = MTLK_ERR_OK; } break; default: break; } return res; } static int _mtlk_core_set_prop (mtlk_vap_handle_t vap_handle, mtlk_core_prop_e prop_id, void *buffer, uint32 size) { int res = MTLK_ERR_NOT_SUPPORTED; mtlk_core_t *nic = mtlk_vap_get_core (vap_handle); switch (prop_id) { case MTLK_CORE_PROP_MAC_STUCK_DETECTED: if (buffer && size == sizeof(uint32)) { uint32 *cpu_no = (uint32 *)buffer; nic->slow_ctx->mac_stuck_detected_by_sw = 1; mtlk_set_hw_state(nic, MTLK_HW_STATE_APPFATAL); (void)mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_RESET, NULL, 0); mtlk_df_ui_notify_notify_fw_hang(mtlk_vap_get_df(nic->vap_handle), *cpu_no, MTLK_HW_STATE_APPFATAL); } break; default: break; } return res; } void __MTLK_IFUNC mtlk_core_api_cleanup (mtlk_core_api_t *core_api) { mtlk_core_t* core = HANDLE_T_PTR(mtlk_core_t, core_api->core_handle); _mtlk_core_cleanup(core); mtlk_fast_mem_free(core); } static int _mtlk_core_get_hw_limits (mtlk_handle_t hcore, const void *data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); return mtlk_psdb_get_hw_limits_list(nic, clpb); } void __MTLK_IFUNC mtlk_core_get_tx_power_data (mtlk_core_t *core, mtlk_tx_power_data_t *tx_power_data) { wave_radio_t *radio; int i; uint16 tx_power_offs; /* user set tx power offset in to reduce total tx power */ mtlk_pdb_size_t pw_limits_size = sizeof(psdb_pw_limits_t); unsigned radio_idx; MTLK_ASSERT(core); MTLK_ASSERT(tx_power_data); radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(NULL != radio); radio_idx = wave_radio_id_get(radio); tx_power_offs = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TX_POWER_LIMIT_OFFSET); mtlk_hw_mhi_get_tx_power(mtlk_vap_get_hw(core->vap_handle), &tx_power_data->power_hw, radio_idx); /* All TX power values are in power units */ tx_power_data->power_usr_offs = tx_power_offs; tx_power_data->power_reg = (uint16)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TX_POWER_REG_LIM); /* power units */ tx_power_data->power_psd = (uint16)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TX_POWER_PSD); /* power units */ tx_power_data->power_cfg = (uint16)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TX_POWER_CFG) - tx_power_offs; /* power units */ pw_limits_size = sizeof(psdb_pw_limits_t); if (MTLK_ERR_OK != WAVE_RADIO_PDB_GET_BINARY(radio, PARAM_DB_RADIO_TPC_PW_LIMITS_PSD, &(tx_power_data->power_tpc_psd), &pw_limits_size)) { ELOG_V("Failed to get TPC Power limits PSD array"); } pw_limits_size = sizeof(psdb_pw_limits_t); if (MTLK_ERR_OK != WAVE_RADIO_PDB_GET_BINARY(radio, PARAM_DB_RADIO_TPC_PW_LIMITS_CFG, &(tx_power_data->power_tpc_cfg), &pw_limits_size)) { ELOG_V("Failed to get TPC Power limits Configured array"); } for (i = PSDB_PHY_CW_11B; i <= PSDB_PHY_CW_OFDM_160; i++) { tx_power_data->power_tpc_cfg.pw_limits[i] -= tx_power_offs; /* substruct power backoffs for 11b till bw160 */ } tx_power_data->open_loop = (TPC_OPEN_LOOP == WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TPC_LOOP_TYPE)); core_cfg_country_code_get(core, &tx_power_data->cur_country_code); tx_power_data->cur_band = core_cfg_get_freq_band_cfg(core); tx_power_data->cur_chan = _mtlk_core_get_channel(core); tx_power_data->cur_cbw = _mtlk_core_get_spectrum_mode(core); tx_power_data->max_cbw = (MTLK_HW_BAND_2_4_GHZ == tx_power_data->cur_band) ? CW_MAX_2G : mtlk_hw_type_is_gen5(mtlk_vap_get_hw(core->vap_handle)) ? CW_MAX_5G_GEN5 : CW_MAX_5G_GEN6; tx_power_data->max_antennas = core->slow_ctx->tx_limits.num_tx_antennas; tx_power_data->cur_antennas = _mtlk_core_get_current_tx_antennas(core); tx_power_data->max_ant_gain = mtlk_antennas_factor(tx_power_data->max_antennas); tx_power_data->cur_ant_gain = mtlk_antennas_factor(tx_power_data->cur_antennas); for (i = 0; i < tx_power_data->power_hw.pw_size; i++) { tx_power_data->pw_min_brd[i] = tx_power_data->cur_ant_gain + tx_power_data->power_hw.pw_min_ant[i]; tx_power_data->pw_max_brd[i] = tx_power_data->cur_ant_gain + tx_power_data->power_hw.pw_max_ant[i]; tx_power_data->pw_targets[i] = hw_mmb_get_tx_power_target(tx_power_data->power_cfg, (uint16)(tx_power_data->cur_ant_gain + tx_power_data->power_hw.pw_max_ant[i])); ILOG3_DD("pw_min_ant[%d]=%d", i, tx_power_data->power_hw.pw_min_ant[i]); ILOG3_DD("pw_max_ant[%d]=%d", i, tx_power_data->power_hw.pw_max_ant[i]); } } static int _mtlk_core_get_tx_rate_power (mtlk_handle_t hcore, const void *data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_tx_power_data_t tx_power_data; int res; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* 1. Tx power */ mtlk_core_get_tx_power_data(core, &tx_power_data); if (MTLK_ERR_OK != (res = mtlk_clpb_push(clpb, &tx_power_data, sizeof(tx_power_data)))) { goto err_push; } /* 2. PSDB rate power list */ return mtlk_psdb_get_rate_power_list(core, clpb); err_push: mtlk_clpb_purge(clpb); return res; } static int _mtlk_core_set_mac_assert (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_NOT_SUPPORTED; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 clpb_data_size; uint32* clpb_data; uint32 assert_type; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); clpb_data = mtlk_clpb_enum_get_next(clpb, &clpb_data_size); MTLK_CLPB_TRY(clpb_data, clpb_data_size) assert_type = *clpb_data; WLOG_DD("CID-%04x: Rise MAC assert (assert type=%d)", mtlk_vap_get_oid(nic->vap_handle), assert_type); switch (assert_type) { case MTLK_CORE_UI_ASSERT_TYPE_ALL_MACS: wave_rcvry_type_forced_set(mtlk_vap_get_hw(nic->vap_handle), MTLK_CORE_UI_RCVRY_TYPE_NONE); (void)mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_DBG_ASSERT_ALL_MACS, NULL, 0); res = MTLK_ERR_OK; break; case MTLK_CORE_UI_ASSERT_TYPE_FW_LMIPS0: case MTLK_CORE_UI_ASSERT_TYPE_FW_LMIPS1: case MTLK_CORE_UI_ASSERT_TYPE_FW_UMIPS: { int mips_no; mips_no = hw_assert_type_to_core_nr(mtlk_vap_get_hw(nic->vap_handle), assert_type); if (mips_no == -1) { ELOG_DD("CID-%04x: Invalid assert type %d", mtlk_vap_get_oid(nic->vap_handle), assert_type); return res; } wave_rcvry_type_forced_set(mtlk_vap_get_hw(nic->vap_handle), MTLK_CORE_UI_RCVRY_TYPE_NONE); res = mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_DBG_ASSERT_FW, &mips_no, sizeof(mips_no)); if (res != MTLK_ERR_OK) { ELOG_DDD("CID-%04x: Can't assert FW MIPS#%d (res=%d)", mtlk_vap_get_oid(nic->vap_handle), mips_no, res); } } break; case MTLK_CORE_UI_ASSERT_TYPE_DRV_DIV0: { #ifdef __KLOCWORK__ abort(1); /* Special case for correct analysis by Klocwork */ #else volatile int do_bug = 0; do_bug = 1/do_bug; ILOG0_D("do_bug = %d", do_bug); /* To avoid compilation optimization */ #endif res = MTLK_ERR_OK; } break; case MTLK_CORE_UI_ASSERT_TYPE_DRV_BLOOP: #ifdef __KLOCWORK__ abort(1); /* Special case for correct analysis by Klocwork */ #else while (1) {;} #endif break; case MTLK_CORE_UI_ASSERT_TYPE_NONE: case MTLK_CORE_UI_ASSERT_TYPE_LAST: default: WLOG_DD("CID-%04x: Unsupported assert type: %d", mtlk_vap_get_oid(nic->vap_handle), assert_type); res = MTLK_ERR_NOT_SUPPORTED; break; } MTLK_CLPB_FINALLY(res) return res; MTLK_CLPB_END } static int _mtlk_core_get_mc_igmp_tbl(mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_NOT_SUPPORTED; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); res = mtlk_mc_dump_groups(nic, clpb); return res; } static int _mtlk_core_get_mc_hw_tbl (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_NOT_SUPPORTED; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_core_ui_mc_grid_action_t req; int i; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); for (i = MC_MIN_GROUP; i < MC_GROUPS; i++) { req.grp_id = i; mtlk_hw_get_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_MC_GROUP_ID, &req, sizeof(req)); res = mtlk_clpb_push(clpb, &req, sizeof(req)); if (MTLK_ERR_OK != res) { goto err_push; } } goto finish; err_push: mtlk_clpb_purge(clpb); finish: return res; } static int _mtlk_core_get_stadb_sta_by_iter_id (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; st_info_by_idx_data_t *p_info_data; uint32 size; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); p_info_data = mtlk_clpb_enum_get_next(clpb, &size); MTLK_CLPB_TRY(p_info_data, size) if (!wave_core_sync_hostapd_done_get(nic)) { ILOG1_D("CID-%04x: HOSTAPD STA database is not synced", mtlk_vap_get_oid(nic->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NOT_READY); } /* No need to check res, MAC address will be set to 0 if entry not found */ mtlk_stadb_get_sta_by_iter_id(&nic->slow_ctx->stadb, p_info_data->idx, p_info_data->mac, p_info_data->stinfo); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_stadb_sta_list (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_core_ui_get_stadb_status_req_t *get_stadb_status_req; uint32 size; hst_db *hstdb = NULL; uint8 group_cipher = FALSE; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); if ( 0 == (mtlk_core_get_net_state(nic) & (NET_STATE_HALTED | NET_STATE_CONNECTED)) ) { mtlk_clpb_purge(clpb); return MTLK_ERR_OK; } get_stadb_status_req = mtlk_clpb_enum_get_next(clpb, &size); if ( (NULL == get_stadb_status_req) || (sizeof(*get_stadb_status_req) != size) ) { ELOG_SD("Failed to get data from clipboard in function %s, line %d", __FUNCTION__, __LINE__); return MTLK_ERR_UNKNOWN; } if (get_stadb_status_req->get_hostdb) { hstdb = &nic->slow_ctx->hstdb; } if (get_stadb_status_req->use_cipher) { group_cipher = nic->slow_ctx->group_cipher; } mtlk_clpb_purge(clpb); return mtlk_stadb_get_stat(&nic->slow_ctx->stadb, hstdb, clpb, group_cipher); } static int _mtlk_core_get_ee_caps(mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); res = mtlk_eeprom_get_caps(mtlk_core_get_eeprom(nic), clpb); return res; } mtlk_core_t * __MTLK_IFUNC mtlk_core_get_master (mtlk_core_t *core) { MTLK_ASSERT(core != NULL); return mtlk_vap_manager_get_master_core(mtlk_vap_get_manager(core->vap_handle)); } uint8 __MTLK_IFUNC mtlk_core_is_device_busy(mtlk_handle_t context) { return FALSE; } tx_limit_t* __MTLK_IFUNC mtlk_core_get_tx_limits(mtlk_core_t *core) { return &core->slow_ctx->tx_limits; } void mtlk_core_configuration_dump(mtlk_core_t *core) { mtlk_country_code_t country_code; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); MTLK_UNREFERENCED_PARAM(radio); core_cfg_country_code_get(core, &country_code); ILOG0_DS("CID-%04x: Country : %s", mtlk_vap_get_oid(core->vap_handle), country_code.country); ILOG0_DD("CID-%04x: Domain : %u", mtlk_vap_get_oid(core->vap_handle), mtlk_psdb_country_to_regd_code(country_code.country)); ILOG0_DS("CID-%04x: Network mode : %s", mtlk_vap_get_oid(core->vap_handle), net_mode_to_string(core_cfg_get_network_mode_cfg(core))); ILOG0_DS("CID-%04x: Band : %s", mtlk_vap_get_oid(core->vap_handle), mtlk_eeprom_band_to_string(net_mode_to_band(core_cfg_get_network_mode_cfg(core)))); ILOG0_DS("CID-%04x: Prog Model Spectrum : %s MHz", mtlk_vap_get_oid(core->vap_handle), mtlkcw2str(WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_PROG_MODEL_SPECTRUM_MODE))); ILOG0_DS("CID-%04x: Spectrum : %s MHz", mtlk_vap_get_oid(core->vap_handle), mtlkcw2str(WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SPECTRUM_MODE))); ILOG0_DS("CID-%04x: Bonding : %s", mtlk_vap_get_oid(core->vap_handle), WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_BONDING_MODE) == ALTERNATE_UPPER ? "upper" : (WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_BONDING_MODE) == ALTERNATE_LOWER ? "lower" : "none")); ILOG0_DS("CID-%04x: HT mode : %s", mtlk_vap_get_oid(core->vap_handle), core_cfg_get_is_ht_cur(core) ? "enabled" : "disabled"); ILOG0_DS("CID-%04x: SM enabled : %s", mtlk_vap_get_oid(core->vap_handle), mtlk_eeprom_get_disable_sm_channels(mtlk_core_get_eeprom(core)) ? "disabled" : "enabled"); } static void _mtlk_core_prepare_stop(mtlk_vap_handle_t vap_handle) { mtlk_core_t *nic = mtlk_vap_get_core (vap_handle); if (!nic->is_stopped) { if (MTLK_ERR_OK != __mtlk_core_deactivate(nic, nic)) { ELOG_D("CID-%04x: Core deactivation is failed", mtlk_vap_get_oid(vap_handle)); } } ILOG1_V("Core prepare stopping...."); mtlk_osal_lock_acquire(&nic->net_state_lock); nic->is_stopping = TRUE; mtlk_osal_lock_release(&nic->net_state_lock); if (mtlk_vap_is_slave_ap(vap_handle)) { return; } } BOOL __MTLK_IFUNC mtlk_core_is_stopping(mtlk_core_t *core) { return (core->is_stopping || core->is_iface_stopping); } void mtlk_core_bswap_bcl_request (UMI_BCL_REQUEST *req, BOOL hdr_only) { int i; req->Size = cpu_to_le32(req->Size); req->Address = cpu_to_le32(req->Address); req->Unit = cpu_to_le32(req->Unit); if (!hdr_only) { for (i = 0; i < ARRAY_SIZE(req->Data); i++) { req->Data[i] = cpu_to_le32(req->Data[i]); } } } static int _mtlk_core_bcl_mac_data_get (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t* man_entry = NULL; int exception; UMI_BCL_REQUEST* preq; BOOL f_bswap_data = TRUE; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* Get BCL request from CLPB */ preq = mtlk_clpb_enum_get_next(clpb, NULL); if (NULL == preq) { ELOG_SD("Failed to get data from clipboard in function %s, line %d", __FUNCTION__, __LINE__); return MTLK_ERR_UNKNOWN; } /* Check MAC state */ exception = (mtlk_core_is_hw_halted(core) && !core->slow_ctx->mac_stuck_detected_by_sw); /* if Core got here preq->Unit field wiath value greater or equal to BCL_UNIT_MAX - * the Core should not convert result data words in host format. */ if (preq->Unit >= BCL_UNIT_MAX) { preq->Unit -= BCL_UNIT_MAX; /*Restore original field value*/ f_bswap_data = FALSE; } ILOG4_SDDDD("Getting BCL over %s unit(%d) address(0x%x) size(%u) (%x)", exception ? "io" : "txmm", (int)preq->Unit, (unsigned int)preq->Address, (unsigned int)preq->Size, (unsigned int)preq->Data[0]); if (exception) { /* MAC is halted - send BCL request through IO */ mtlk_core_bswap_bcl_request(preq, TRUE); res = mtlk_hw_get_prop(mtlk_vap_get_hwapi(core->vap_handle), MTLK_HW_BCL_ON_EXCEPTION, preq, sizeof(*preq)); if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Can't get BCL", mtlk_vap_get_oid(core->vap_handle)); goto err_push; } } else { /* MAC is in normal state - send BCL request through TXMM */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can't send Get BCL request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto err_push; } mtlk_core_bswap_bcl_request(preq, TRUE); *((UMI_BCL_REQUEST*)man_entry->payload) = *preq; man_entry->id = UM_MAN_QUERY_BCL_VALUE; man_entry->payload_size = sizeof(*preq); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Can't send Get BCL request to MAC, timed-out", mtlk_vap_get_oid(core->vap_handle)); mtlk_txmm_msg_cleanup(&man_msg); goto err_push; } /* Copy back results */ *preq = *((UMI_BCL_REQUEST*)man_entry->payload); mtlk_txmm_msg_cleanup(&man_msg); } /* Send back results */ mtlk_core_bswap_bcl_request(preq, !f_bswap_data); mtlk_dump(3, preq, sizeof(*preq), "dump of the UM_MAN_QUERY_BCL_VALUE"); res = mtlk_clpb_push(clpb, preq, sizeof(*preq)); if (MTLK_ERR_OK == res) { return res; } err_push: mtlk_clpb_purge(clpb); return res; } static int _mtlk_core_bcl_mac_data_set (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t* man_entry = NULL; int exception; uint32 req_size; UMI_BCL_REQUEST* preq = NULL; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* Read Set BCL request from CLPB */ preq = mtlk_clpb_enum_get_next(clpb, &req_size); MTLK_CLPB_TRY(preq, req_size) /* Check MAC state */ exception = (mtlk_core_is_hw_halted(core) && !core->slow_ctx->mac_stuck_detected_by_sw); ILOG2_SDDDD("Setting BCL over %s unit(%d) address(0x%x) size(%u) (%x)", exception ? "io" : "txmm", (int)preq->Unit, (unsigned int)preq->Address, (unsigned int)preq->Size, (unsigned int)preq->Data[0]); mtlk_dump(3, preq, sizeof(*preq), "dump of the UM_MAN_SET_BCL_VALUE"); if (exception) { /* MAC is halted - send BCL request through IO */ mtlk_core_bswap_bcl_request(preq, FALSE); res = mtlk_hw_set_prop(mtlk_vap_get_hwapi(core->vap_handle), MTLK_HW_BCL_ON_EXCEPTION, preq, sizeof(*preq)); if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Can't set BCL", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_EXIT(res); } } else { /* MAC is in normal state - send BCL request through TXMM */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can't send Set BCL request to MAC due to the lack of MAN_MSG", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NO_RESOURCES); } mtlk_core_bswap_bcl_request(preq, FALSE); *((UMI_BCL_REQUEST*)man_entry->payload) = *preq; man_entry->id = UM_MAN_SET_BCL_VALUE; man_entry->payload_size = sizeof(*preq); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Can't send Set BCL request to MAC, timed-out", mtlk_vap_get_oid(core->vap_handle)); } mtlk_txmm_msg_cleanup(&man_msg); } MTLK_CLPB_FINALLY(res) return res; MTLK_CLPB_END } static int _mtlk_general_core_range_info_get (mtlk_core_t* nic, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_ui_range_info_t range_info; mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_ASSERT(!mtlk_vap_is_slave_ap(nic->vap_handle)); /* Get supported bitrates */ { int avail = mtlk_core_get_available_bitrates(nic); int32 short_cyclic_prefix = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SHORT_CYCLIC_PREFIX); int num_bitrates; /* Index in table returned to userspace */ int value; /* Bitrate's value */ int i; /* Bitrate index */ int k, l; /* Counters, used for sorting */ int sm = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SPECTRUM_MODE); /* Array of bitrates is sorted and consist of only unique elements */ num_bitrates = 0; for (i = BITRATE_FIRST; i <= BITRATE_LAST; i++) { if ((1 << i) & avail) { value = mtlk_bitrate_get_value(i, sm, short_cyclic_prefix); if (MTLK_BITRATE_INVALID == value) { ILOG1_DDD("Rate is not supported: index %d, spectrum mode %d, scp %d", i, sm, short_cyclic_prefix); continue; /* is not supported (e.g in AC mode) */ } range_info.bitrates[num_bitrates] = value; k = num_bitrates; while (k && (range_info.bitrates[k-1] >= value)) k--; /* Position found */ if ((k == num_bitrates) || (range_info.bitrates[k] != value)) { for (l = num_bitrates; l > k; l--) range_info.bitrates[l] = range_info.bitrates[l-1]; range_info.bitrates[k] = value; num_bitrates++; } } } range_info.num_bitrates = num_bitrates; } res = mtlk_clpb_push(clpb, &range_info, sizeof(range_info)); if (MTLK_ERR_OK != res) { mtlk_clpb_purge(clpb); } return res; } static int _mtlk_slave_core_range_info_get (mtlk_core_t* nic, const void* data, uint32 data_size) { return (_mtlk_general_core_range_info_get (mtlk_core_get_master (nic), data, data_size)); } static int _mtlk_core_range_info_get (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); if (!mtlk_vap_is_slave_ap (core->vap_handle)) { return _mtlk_general_core_range_info_get (core, data, data_size); } else return _mtlk_slave_core_range_info_get (core, data, data_size); } static int _mtlk_core_get_enc_ext_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 size; mtlk_txmm_t *txmm = mtlk_vap_get_txmm(nic->vap_handle); mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; mtlk_core_ui_group_pn_t rsc_result; mtlk_core_ui_group_pn_t *prsc_requset; UMI_GROUP_PN *umi_gpn; uint32 key_index; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); if (!wave_core_sync_hostapd_done_get(nic)) { ILOG1_D("CID-%04x: HOSTAPD STA database is not synced", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } if (0 != (mtlk_core_get_net_state(nic) & (NET_STATE_HALTED | NET_STATE_IDLE))) { ILOG1_D("CID-%04x: Invalid card state - request rejected", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } if (mtlk_core_scan_is_running(nic)) { ILOG1_D("CID-%04x: Can't get WEP configuration - scan in progress", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, txmm, NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto FINISH; } prsc_requset = mtlk_clpb_enum_get_next(clpb, &size); if ( (NULL == prsc_requset) || (sizeof(mtlk_core_ui_group_pn_t) != size) ) { ELOG_D("CID-%04x: Failed to set authorizing configuration parameters from CLPB", mtlk_vap_get_oid(nic->vap_handle)); res = MTLK_ERR_UNKNOWN; goto FINISH; } umi_gpn = (UMI_GROUP_PN*)man_entry->payload; memset(umi_gpn, 0, sizeof(UMI_GROUP_PN)); man_entry->id = UM_MAN_GET_GROUP_PN_REQ; man_entry->payload_size = sizeof(UMI_GROUP_PN); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_D("CID-%04x: Timeout expired while waiting for CFM from MAC", mtlk_vap_get_oid(nic->vap_handle)); goto FINISH; } umi_gpn->u16Status = le16_to_cpu(umi_gpn->u16Status); if (UMI_OK != umi_gpn->u16Status) { ELOG_DD("CID-%04x: GET_GROUP_PN_REQ failed: %u", mtlk_vap_get_oid(nic->vap_handle), umi_gpn->u16Status); res = MTLK_ERR_NOT_READY; goto FINISH; } mtlk_dump(3, umi_gpn->au8TxSeqNum, UMI_RSN_SEQ_NUM_LEN, "GROUP RSC"); memset(&rsc_result, 0, sizeof(mtlk_core_ui_group_pn_t)); wave_memcpy(rsc_result.seq, sizeof(rsc_result.seq), umi_gpn->au8TxSeqNum, UMI_RSN_SEQ_NUM_LEN); rsc_result.seq_len = CORE_KEY_SEQ_LEN; key_index = prsc_requset->key_idx; wave_memcpy(rsc_result.key, sizeof(rsc_result.key), nic->slow_ctx->keys[key_index].key, nic->slow_ctx->keys[key_index].key_len); rsc_result.key_len = nic->slow_ctx->keys[key_index].key_len ; res = mtlk_clpb_push(clpb, &rsc_result, sizeof(rsc_result)); if (MTLK_ERR_OK != res) { mtlk_clpb_purge(clpb); } FINISH: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static void _mtlk_core_set_rx_seq(struct nic *nic, uint16 idx, uint8* rx_seq) { nic->slow_ctx->group_rsc[idx][0] = rx_seq[5]; nic->slow_ctx->group_rsc[idx][1] = rx_seq[4]; nic->slow_ctx->group_rsc[idx][2] = rx_seq[3]; nic->slow_ctx->group_rsc[idx][3] = rx_seq[2]; nic->slow_ctx->group_rsc[idx][4] = rx_seq[1]; nic->slow_ctx->group_rsc[idx][5] = rx_seq[0]; } static int _mtlk_core_set_enc_ext_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_ui_encext_cfg_t *encext_cfg; uint16 key_indx; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 size; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; mtlk_txmm_t *txmm = mtlk_vap_get_txmm(core->vap_handle); UMI_SET_KEY *umi_key; uint16 alg_type = IW_ENCODE_ALG_NONE; uint16 key_len = 0; sta_entry *sta = NULL; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); if ((mtlk_core_get_net_state(core) & (NET_STATE_READY | NET_STATE_ACTIVATING | NET_STATE_CONNECTED)) == 0) { ILOG1_D("CID-%04x: Invalid card state - request rejected", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } if (mtlk_core_is_stopping(core)) { ILOG1_D("CID-%04x: Can't set ENC_EXT configuration - core is stopping", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } encext_cfg = mtlk_clpb_enum_get_next(clpb, &size); if ( (NULL == encext_cfg) || (sizeof(*encext_cfg) != size) ) { ELOG_D("CID-%04x: Failed to get ENC_EXT configuration parameters from CLPB", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_UNKNOWN; goto FINISH; } /* Prepare UMI message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, txmm, NULL); if (!man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto FINISH; } umi_key = (UMI_SET_KEY*)man_entry->payload; memset(umi_key, 0, sizeof(*umi_key)); man_entry->id = UM_MAN_SET_KEY_REQ; man_entry->payload_size = sizeof(*umi_key); key_len = encext_cfg->key_len; if(0 == key_len) { ELOG_D("CID-%04x: No key is set", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_PARAMS; goto FINISH; } key_indx = encext_cfg->key_idx; /* Set Ciper Suite */ alg_type = encext_cfg->alg_type; switch (alg_type) { case IW_ENCODE_ALG_WEP: if(MIB_WEP_KEY_WEP2_LENGTH == key_len) { /* 104 bit */ umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_WEP104); } else if (MIB_WEP_KEY_WEP1_LENGTH == key_len) { /* 40 bit */ umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_WEP40); } else { ELOG_DD("CID-%04x: Wrong WEP key lenght %d", mtlk_vap_get_oid(core->vap_handle), key_len); res = MTLK_ERR_PARAMS; goto FINISH; } break; case IW_ENCODE_ALG_TKIP: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_TKIP); break; case IW_ENCODE_ALG_CCMP: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_CCMP); break; case IW_ENCODE_ALG_AES_CMAC: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_BIP); break; case IW_ENCODE_ALG_GCMP: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_GCMP128); break; case IW_ENCODE_ALG_GCMP_256: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_GCMP256); break; default: ELOG_D("CID-%04x: Unknown CiperSuite", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_PARAMS; goto FINISH; } /* Set key type */ if (mtlk_osal_eth_is_broadcast(encext_cfg->sta_addr.au8Addr)) { umi_key->u16KeyType = HOST_TO_MAC16(UMI_RSN_GROUP_KEY); core->slow_ctx->group_cipher = alg_type; /* update group replay counter */ _mtlk_core_set_rx_seq(core, key_indx, encext_cfg->rx_seq); umi_key->u16Sid = HOST_TO_MAC16(TMP_BCAST_DEST_ADDR); } else { /* Check STA availability */ sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, encext_cfg->sta_addr.au8Addr); if (NULL == sta) { ILOG1_Y("There is no connection with %Y", encext_cfg->sta_addr.au8Addr); res = MTLK_ERR_PARAMS; goto FINISH; } umi_key->u16Sid = HOST_TO_MAC16(mtlk_sta_get_sid(sta)); umi_key->u16KeyType = HOST_TO_MAC16(UMI_RSN_PAIRWISE_KEY); } /* The key has been copied into au8Tk1 array with UMI_RSN_TK1_LEN size. * But key can have UMI_RSN_TK1_LEN+UMI_RSN_TK2_LEN size - so * actually second part of key is copied into au8Tk2 array */ wave_memcpy(umi_key->au8Tk, sizeof(umi_key->au8Tk), encext_cfg->key, key_len); if(sta){ mtlk_sta_set_cipher(sta, alg_type); } /* set TX sequence number */ umi_key->au8TxSeqNum[0] = 1; umi_key->u16KeyIndex = HOST_TO_MAC16(key_indx); wave_memcpy(umi_key->au8RxSeqNum, sizeof(umi_key->au8RxSeqNum), encext_cfg->rx_seq, sizeof(encext_cfg->rx_seq)); ILOG1_D("UMI_SET_KEY SID:0x%x", MAC_TO_HOST16(umi_key->u16Sid)); ILOG1_D("UMI_SET_KEY KeyType:0x%x", MAC_TO_HOST16(umi_key->u16KeyType)); ILOG1_D("UMI_SET_KEY u16CipherSuite:0x%x", MAC_TO_HOST16(umi_key->u16CipherSuite)); ILOG1_D("UMI_SET_KEY KeyIndex:%d", MAC_TO_HOST16(umi_key->u16KeyIndex)); mtlk_dump(1, umi_key->au8RxSeqNum, sizeof(umi_key->au8RxSeqNum), "RxSeqNum"); mtlk_dump(1, umi_key->au8TxSeqNum, sizeof(umi_key->au8TxSeqNum), "TxSeqNum"); mtlk_dump(1, umi_key->au8Tk, key_len, "KEY:"); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: mtlk_mm_send_blocked failed: %i", mtlk_vap_get_oid(core->vap_handle), res); goto FINISH; } /* Store the key */ wave_memcpy(core->slow_ctx->keys[key_indx].key, sizeof(core->slow_ctx->keys[key_indx].key), encext_cfg->key, key_len); core->slow_ctx->keys[key_indx].key_len = key_len; memset(core->slow_ctx->keys[key_indx].seq, 0, CORE_KEY_SEQ_LEN); wave_memcpy(core->slow_ctx->keys[key_indx].seq, sizeof(core->slow_ctx->keys[key_indx].seq), encext_cfg->rx_seq, sizeof(encext_cfg->rx_seq)); core->slow_ctx->keys[key_indx].seq_len = CORE_KEY_SEQ_LEN; core->slow_ctx->keys[key_indx].cipher = MAC_TO_HOST16(umi_key->u16CipherSuite); FINISH: if (NULL != sta) { mtlk_sta_decref(sta); /* De-reference of find */ } if (NULL != man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static int _mtlk_core_set_default_key_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_ui_default_key_cfg_t *default_key_cfg; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; uint32 size; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; mtlk_txmm_t *txmm = mtlk_vap_get_txmm(core->vap_handle); UMI_DEFAULT_KEY_INDEX *umi_default_key; sta_entry *sta = NULL; uint16 key_indx; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); if (!wave_core_sync_hostapd_done_get(core)) { ILOG1_D("CID-%04x: HOSTAPD STA database is not synced", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } default_key_cfg = mtlk_clpb_enum_get_next(clpb, &size); if ( (NULL == default_key_cfg) || (sizeof(*default_key_cfg) != size) ) { ELOG_D("CID-%04x: Failed to get ENC_EXT configuration parameters from CLPB", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_UNKNOWN; goto FINISH; } /* Prepare UMI message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, txmm, NULL); if (!man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto FINISH; } man_entry->id = UM_MAN_SET_DEFAULT_KEY_INDEX_REQ; man_entry->payload_size = sizeof(UMI_DEFAULT_KEY_INDEX); umi_default_key = (UMI_DEFAULT_KEY_INDEX *)man_entry->payload; memset(umi_default_key, 0, sizeof(*umi_default_key)); if (mtlk_osal_eth_is_broadcast(default_key_cfg->sta_addr.au8Addr)) { umi_default_key->u16SID = HOST_TO_MAC16(TMP_BCAST_DEST_ADDR); if (default_key_cfg->is_mgmt_key) umi_default_key->u16KeyType = HOST_TO_MAC16(UMI_RSN_MGMT_GROUP_KEY); else umi_default_key->u16KeyType = HOST_TO_MAC16(UMI_RSN_GROUP_KEY); } else { /* Check STA availability */ sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, default_key_cfg->sta_addr.au8Addr); if (NULL == sta) { ILOG1_Y("There is no connection with %Y", default_key_cfg->sta_addr.au8Addr); res = MTLK_ERR_PARAMS; goto FINISH; } umi_default_key->u16SID = HOST_TO_MAC16(mtlk_sta_get_sid(sta)); umi_default_key->u16KeyType = HOST_TO_MAC16(UMI_RSN_PAIRWISE_KEY); } key_indx = default_key_cfg->key_idx; umi_default_key->u16KeyIndex = HOST_TO_MAC16(key_indx); ILOG2_D("UMI_SET_DEFAULT_KEY SID:0x%x", MAC_TO_HOST16(umi_default_key->u16SID)); ILOG2_D("UMI_SET_DEFAULT_KEY KeyType:0x%x", MAC_TO_HOST16(umi_default_key->u16KeyType)); ILOG2_D("UMI_SET_DEFAULT_KEY KeyIndex:%d", MAC_TO_HOST16(umi_default_key->u16KeyIndex)); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: mtlk_mm_send_blocked failed: %i", mtlk_vap_get_oid(core->vap_handle), res); goto FINISH; } /* Store default key */ if (default_key_cfg->is_mgmt_key) { core->slow_ctx->default_mgmt_key = key_indx; } else { core->slow_ctx->default_key = key_indx; } FINISH: if (NULL != sta) { mtlk_sta_decref(sta); /* De-reference of find */ } if (NULL != man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static int core_recovery_default_key(mtlk_core_t *core, BOOL is_mgmt_key) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; mtlk_txmm_t *txmm = mtlk_vap_get_txmm(core->vap_handle); UMI_DEFAULT_KEY_INDEX *umi_default_key; uint16 alg_type; alg_type = core->slow_ctx->group_cipher; if (alg_type == IW_ENCODE_ALG_NONE) { ILOG2_D("CID-%04x: ENCODE ALG is NONE, ignore set default key index.", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_OK; goto FINISH; } /* Prepare UMI message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, txmm, NULL); if (!man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto FINISH; } man_entry->id = UM_MAN_SET_DEFAULT_KEY_INDEX_REQ; man_entry->payload_size = sizeof(UMI_DEFAULT_KEY_INDEX); umi_default_key = (UMI_DEFAULT_KEY_INDEX *)man_entry->payload; memset(umi_default_key, 0, sizeof(*umi_default_key)); umi_default_key->u16SID = HOST_TO_MAC16(TMP_BCAST_DEST_ADDR); if (is_mgmt_key) { umi_default_key->u16KeyType = HOST_TO_MAC16(UMI_RSN_MGMT_GROUP_KEY); umi_default_key->u16KeyIndex = HOST_TO_MAC16(core->slow_ctx->default_mgmt_key); } else { umi_default_key->u16KeyType = HOST_TO_MAC16(UMI_RSN_GROUP_KEY); umi_default_key->u16KeyIndex = HOST_TO_MAC16(core->slow_ctx->default_key); } ILOG2_D("UMI_SET_DEFAULT_KEY SID:0x%x", MAC_TO_HOST16(umi_default_key->u16SID)); ILOG2_D("UMI_SET_DEFAULT_KEY KeyType:0x%x", MAC_TO_HOST16(umi_default_key->u16KeyType)); ILOG2_D("UMI_SET_DEFAULT_KEY KeyIndex:%d", MAC_TO_HOST16(umi_default_key->u16KeyIndex)); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: mtlk_mm_send_blocked failed: %i", mtlk_vap_get_oid(core->vap_handle), res); goto FINISH; } FINISH: if (NULL != man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } /* Aggregation configuration */ static int _mtlk_core_receive_agg_rate_cfg (mtlk_core_t *core, mtlk_core_aggr_cfg_t *aggr_cfg) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_TS_VAP_CONFIGURE *pAggrConfig = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_TS_VAP_CONFIGURE_REQ; man_entry->payload_size = sizeof(UMI_TS_VAP_CONFIGURE); pAggrConfig = (UMI_TS_VAP_CONFIGURE *)(man_entry->payload); pAggrConfig->vapId = (uint8)mtlk_vap_get_id(vap_handle); pAggrConfig->getSetOperation = API_GET_OPERATION; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK == res) { aggr_cfg->ba_mode = pAggrConfig->enableBa; aggr_cfg->amsdu_mode = pAggrConfig->amsduSupport; aggr_cfg->windowSize = MAC_TO_HOST32(pAggrConfig->windowSize); } else { ELOG_D("CID-%04x: Failed to receive UM_MAN_TS_VAP_CONFIGURE_REQ", mtlk_vap_get_oid(vap_handle)); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_get_aggr_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_aggr_cfg_t aggr_cfg; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* read config from internal db */ memset(&aggr_cfg, 0, sizeof(aggr_cfg)); MTLK_CFG_SET_ITEM_BY_FUNC(&aggr_cfg, cfg, _mtlk_core_receive_agg_rate_cfg, (core, &aggr_cfg.cfg), res) /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &aggr_cfg, sizeof(aggr_cfg)); } return res; } static int _mtlk_core_set_aggr_cfg_req (mtlk_core_t *core, uint8 enable_amsdu, uint8 enable_ba, uint32 windowSize) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_TS_VAP_CONFIGURE *pAggrConfig = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; MTLK_ASSERT(vap_handle); if ((enable_amsdu != 0 && enable_amsdu != 1) || (enable_ba != 0 && enable_ba != 1)) { ELOG_V("Wrong parameter value given, must be 0 or 1"); return MTLK_ERR_PARAMS; } ILOG1_DDDD("CID-%04x: Send Aggregation config to FW: enable AMSDU %u, enable BA %u, Window size %u", mtlk_vap_get_oid(vap_handle), enable_amsdu, enable_ba, windowSize); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_TS_VAP_CONFIGURE_REQ; man_entry->payload_size = sizeof(UMI_TS_VAP_CONFIGURE); pAggrConfig = (UMI_TS_VAP_CONFIGURE *)(man_entry->payload); pAggrConfig->vapId = (uint8) mtlk_vap_get_id(vap_handle); pAggrConfig->enableBa = (uint8)enable_ba; pAggrConfig->amsduSupport = (uint8)enable_amsdu; pAggrConfig->windowSize = HOST_TO_MAC32(windowSize); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Set Aggregation config failure (%i)", mtlk_vap_get_oid(vap_handle), res); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static void _mtlk_core_store_aggr_config (mtlk_core_t *core, uint32 amsdu_mode, uint32 ba_mode, uint32 windowSize) { MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_AMSDU_MODE, amsdu_mode); MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_BA_MODE, ba_mode); MTLK_CORE_PDB_SET_INT(core, PARAM_DB_CORE_WINDOW_SIZE, windowSize); } static int _mtlk_core_set_aggr_cfg (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_aggr_cfg_t *aggr_cfg = NULL; uint32 aggr_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ aggr_cfg = mtlk_clpb_enum_get_next(clpb, &aggr_cfg_size); MTLK_CLPB_TRY(aggr_cfg, aggr_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* send new config to FW */ MTLK_CFG_CHECK_ITEM_AND_CALL(aggr_cfg, cfg, _mtlk_core_set_aggr_cfg_req, (core, aggr_cfg->cfg.amsdu_mode, aggr_cfg->cfg.ba_mode, aggr_cfg->cfg.windowSize), res); /* store new config in internal db*/ MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(aggr_cfg, cfg, _mtlk_core_store_aggr_config, (core, aggr_cfg->cfg.amsdu_mode, aggr_cfg->cfg.ba_mode, aggr_cfg->cfg.windowSize)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } #ifdef MTLK_LEGACY_STATISTICS /* MHI_STATISTICS */ static __INLINE uint32 _mtlk_core_get_vap_stat(mtlk_core_t *nic, mtlk_mhi_stat_vap_e id) { return nic->mhi_vap_stat.stat[id]; } uint32 __MTLK_IFUNC mtlk_core_get_vap_stat(mtlk_core_t *nic, mtlk_mhi_stat_vap_e id) { return _mtlk_core_get_vap_stat(nic, id); } static __INLINE uint64 _mtlk_core_get_vap_stat64(mtlk_core_t *nic, mtlk_mhi_stat64_vap_e id) { return nic->mhi_vap_stat.stat64[id]; } uint64 __MTLK_IFUNC mtlk_core_get_vap_stat64(mtlk_core_t *nic, mtlk_mhi_stat64_vap_e id) { return _mtlk_core_get_vap_stat64(nic, id); } #endif /* MTLK_LEGACY_STATISTICS */ /* Calculate summ of 3 counters, update summ of them, return delta. */ static __INLINE uint32 _update_summ_of_3_cntrs(uint64 *summ, uint32 cntr1, uint32 cntr2, uint32 cntr3) { uint32 sum123, value; sum123 = cntr1 + cntr2 + cntr3; /* new */ value = (uint32)*summ; /* prev */ value = sum123 - value; /* delta = new - prev */ *summ += (uint64)value; /* update with delta */ return value; } #ifdef MTLK_LEGACY_STATISTICS static int _mtlk_core_mac_get_mhi_stats (mtlk_core_t *nic, mtlk_hw_t *hw) { if (NET_STATE_HALTED == mtlk_core_get_net_state(nic)) { /* Do nothing if halted */ return MTLK_ERR_OK; } return mtlk_hw_mhi_get_stats(hw); } #else static int _mtlk_core_get_statistics (mtlk_core_t *nic, mtlk_hw_t *hw) { if (NET_STATE_CONNECTED == mtlk_core_get_net_state(nic)) { mtlk_hw_set_stats_available(hw, TRUE); return _mtlk_hw_get_statistics(hw); } return MTLK_ERR_OK; } #endif #ifdef MTLK_LEGACY_STATISTICS static int _mtlk_core_update_vaps_mhi_stats (mtlk_core_t *nic, wave_radio_t *radio, mtlk_hw_t *hw) { mtlk_vap_manager_t *vap_mgr; mtlk_core_t *cur_nic; mtlk_mhi_stats_vap_t *mhi_vap_stat; mtlk_vap_handle_t vap_handle; int vaps_count, vap_index; uint64 total_traffic = 0; uint32 delta, total_traffic_delta = 0; int res = MTLK_ERR_OK; /* Update statistics for all VAPs and calculate total_traffic */ vap_mgr = mtlk_vap_get_manager(nic->vap_handle); vaps_count = mtlk_vap_manager_get_max_vaps_count(vap_mgr); for (vap_index = vaps_count - 1; vap_index >= 0; vap_index--) { res = mtlk_vap_manager_get_vap_handle(vap_mgr, vap_index, &vap_handle); if (MTLK_ERR_OK == res) { cur_nic = mtlk_vap_get_core(vap_handle); mhi_vap_stat = &cur_nic->mhi_vap_stat; mtlk_hw_mhi_get_vap_stats(hw, mhi_vap_stat, mtlk_vap_get_id_fw(cur_nic->vap_handle)); /* Vap ID in FW */ if (_mtlk_core_poll_stat_is_started(cur_nic)) { /* - Update all 32-bit statistics from FW; - 64-bit statistics is updated manually */ MTLK_STATIC_ASSERT(4 == STAT64_VAP_TOTAL); _mtlk_core_poll_stat_update(cur_nic, mhi_vap_stat->stat, ARRAY_SIZE(mhi_vap_stat->stat)); /* Take into account the traffic since last update */ delta = _update_summ_of_3_cntrs(&cur_nic->pstats.tx_packets, mhi_vap_stat->stat[STAT_VAP_TX_UNICAST_FRAMES], mhi_vap_stat->stat[STAT_VAP_TX_BROADCAST_FRAMES], mhi_vap_stat->stat[STAT_VAP_TX_MULTICAST_FRAMES]); mhi_vap_stat->stat64[STAT64_VAP_TX_FRAMES] = cur_nic->pstats.tx_packets; mtlk_core_add64_cnt(cur_nic, MTLK_CORE_CNT_PACKETS_SENT_64, delta); delta = _update_summ_of_3_cntrs(&cur_nic->pstats.rx_packets, mhi_vap_stat->stat[STAT_VAP_RX_UNICAST_FRAMES], mhi_vap_stat->stat[STAT_VAP_RX_BROADCAST_FRAMES], mhi_vap_stat->stat[STAT_VAP_RX_MULTICAST_FRAMES]); mhi_vap_stat->stat64[STAT64_VAP_RX_FRAMES] = cur_nic->pstats.rx_packets; mtlk_core_add64_cnt(cur_nic, MTLK_CORE_CNT_PACKETS_RECEIVED_64, delta); delta = _update_summ_of_3_cntrs(&cur_nic->pstats.tx_bytes, mhi_vap_stat->stat[STAT_VAP_TX_UNICAST_BYTES], mhi_vap_stat->stat[STAT_VAP_TX_BROADCAST_BYTES], mhi_vap_stat->stat[STAT_VAP_TX_MULTICAST_BYTES]); mhi_vap_stat->stat64[STAT64_VAP_TX_BYTES] = cur_nic->pstats.tx_bytes; mtlk_core_add64_cnt(cur_nic, MTLK_CORE_CNT_BYTES_SENT_64, delta); total_traffic_delta += delta; delta = _update_summ_of_3_cntrs(&cur_nic->pstats.rx_bytes, mhi_vap_stat->stat[STAT_VAP_RX_UNICAST_BYTES], mhi_vap_stat->stat[STAT_VAP_RX_BROADCAST_BYTES], mhi_vap_stat->stat[STAT_VAP_RX_MULTICAST_BYTES]); mhi_vap_stat->stat64[STAT64_VAP_RX_BYTES] = cur_nic->pstats.rx_bytes; mtlk_core_add64_cnt(cur_nic, MTLK_CORE_CNT_BYTES_RECEIVED_64, delta); total_traffic_delta += delta; /* Received multicast packets */ _update_summ_of_3_cntrs(&cur_nic->pstats.rx_multicast_packets, 0, 0, mhi_vap_stat->stat[STAT_VAP_RX_MULTICAST_FRAMES]); } total_traffic += cur_nic->pstats.tx_bytes; total_traffic += cur_nic->pstats.rx_bytes; } } #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT wv_PMCU_Traffic_Report(hw, total_traffic); #endif wave_radio_total_traffic_delta_set(radio, total_traffic_delta); return res; } #else /* MTLK_LEGACY_STATISTICS */ static int _mtlk_core_update_vaps_mhi_stats (mtlk_core_t *nic, wave_radio_t *radio, mtlk_hw_t *hw) { mtlk_vap_manager_t *vap_mgr; mtlk_core_t *cur_nic; mtlk_mhi_stats_vap_t *mhi_vap_stat; mtlk_vap_handle_t vap_handle; int vaps_count, vap_index; uint64 total_traffic = 0; uint32 delta, total_traffic_delta = 0; int res = MTLK_ERR_OK; uint32 *stats; stats = mtlk_osal_mem_alloc(sizeof(mhi_vap_stat->stats), MTLK_MEM_TAG_EXTENSION); if(NULL == stats) { ELOG_D("CID-%04x: Failed to allocate stats", mtlk_vap_get_oid(nic->vap_handle)); return MTLK_ERR_NO_MEM; } /* Update statistics for all VAPs and calculate total_traffic */ vap_mgr = mtlk_vap_get_manager(nic->vap_handle); vaps_count = mtlk_vap_manager_get_max_vaps_count(vap_mgr); for (vap_index = vaps_count - 1; vap_index >= 0; vap_index--) { res = mtlk_vap_manager_get_vap_handle(vap_mgr, vap_index, &vap_handle); if (MTLK_ERR_OK == res) { cur_nic = mtlk_vap_get_core(vap_handle); mhi_vap_stat = &cur_nic->mhi_vap_stat; mtlk_hw_mhi_get_vap_stats(hw, mhi_vap_stat, mtlk_vap_get_id_fw(cur_nic->vap_handle)); /* Vap ID in FW */ if (_mtlk_core_poll_stat_is_started(cur_nic)) { /* - Update all 32-bit statistics from FW; - 64-bit statistics is updated manually */ wave_memcpy(stats, sizeof(mhi_vap_stat->stats), &mhi_vap_stat->stats, sizeof(mhi_vap_stat->stats)); _mtlk_core_poll_stat_update(cur_nic, (uint32 *)stats, sizeof(mhi_vap_stat->stats)); /* Take into account the traffic since last update */ delta = _update_summ_of_3_cntrs(&cur_nic->pstats.tx_packets, mhi_vap_stat->stats.txInUnicastHd, mhi_vap_stat->stats.txInBroadcastHd, mhi_vap_stat->stats.txInMulticastHd); mhi_vap_stat->stats64.txFrames = cur_nic->pstats.tx_packets; mtlk_core_add64_cnt(cur_nic, MTLK_CORE_CNT_PACKETS_SENT_64, delta); delta = _update_summ_of_3_cntrs(&cur_nic->pstats.rx_packets, mhi_vap_stat->stats.rxOutUnicastHd, mhi_vap_stat->stats.rxOutBroadcastHd, mhi_vap_stat->stats.rxOutMulticastHd); mhi_vap_stat->stats64.rxFrames = cur_nic->pstats.rx_packets; mtlk_core_add64_cnt(cur_nic, MTLK_CORE_CNT_PACKETS_RECEIVED_64, delta); delta = _update_summ_of_3_cntrs(&cur_nic->pstats.tx_bytes, mhi_vap_stat->stats.txInUnicastNumOfBytes, mhi_vap_stat->stats.txInBroadcastNumOfBytes, mhi_vap_stat->stats.txInMulticastNumOfBytes); mhi_vap_stat->stats64.txBytes = cur_nic->pstats.tx_bytes; mtlk_core_add64_cnt(cur_nic, MTLK_CORE_CNT_BYTES_SENT_64, delta); total_traffic_delta += delta; delta = _update_summ_of_3_cntrs(&cur_nic->pstats.rx_bytes, mhi_vap_stat->stats.rxOutUnicastNumOfBytes, mhi_vap_stat->stats.rxOutBroadcastNumOfBytes, mhi_vap_stat->stats.rxOutMulticastNumOfBytes); mhi_vap_stat->stats64.rxBytes = cur_nic->pstats.rx_bytes; mtlk_core_add64_cnt(cur_nic, MTLK_CORE_CNT_BYTES_RECEIVED_64, delta); total_traffic_delta += delta; /* Received multicast packets */ _update_summ_of_3_cntrs(&cur_nic->pstats.rx_multicast_packets, 0, 0, mhi_vap_stat->stats.rxOutMulticastHd); } total_traffic += cur_nic->pstats.tx_bytes; total_traffic += cur_nic->pstats.rx_bytes; } } if( NULL != stats){ mtlk_osal_mem_free(stats); } #ifdef CPTCFG_IWLWAV_PMCU_SUPPORT wv_PMCU_Traffic_Report(hw, total_traffic); #endif wave_radio_total_traffic_delta_set(radio, total_traffic_delta); return res; } #endif /* MTLK_LEGACY_STATISTICS */ /* PHY_RX_STATUS */ void hw_mac_update_peers_stats (mtlk_hw_t *hw, mtlk_core_t *core); static int _mtlk_core_mac_get_phy_status(mtlk_core_t *nic, mtlk_hw_t *hw, mtlk_core_general_stats_t *general_stats) { MTLK_ASSERT(nic != NULL); MTLK_ASSERT(general_stats != NULL); if (NET_STATE_HALTED == mtlk_core_get_net_state(nic)) { /* Do nothing if halted */ return MTLK_ERR_OK; } return hw_phy_rx_status_get(hw, nic); } static void _mtlk_core_mac_update_peers_stats (mtlk_core_t *nic) { hw_mac_update_peers_stats(mtlk_vap_get_hw(nic->vap_handle), nic); } extern void __MTLK_IFUNC mtlk_log_tsf_sync_msg(int hw_idx, uint32 drv_ts, int32 fw_offset); extern void __MTLK_IFUNC mtlk_log_tsf_sync_msg(int hw_idx, uint32 drv_ts, int32 fw_offset); /* Sync Log Timestamp with FW TSF */ static void _mtlk_core_sync_log_timestamp (mtlk_vap_handle_t vap_handle) { #ifdef CPTCFG_IWLWAV_TSF_TIMER_ACCESS_ENABLED uint32 t_log, t_tsf; int32 t_ofs; mtlk_hw_get_log_fw_timestamps(vap_handle, &t_log, &t_tsf); t_ofs = t_tsf - t_log; /* signed time shift */ #if 0 if (-1 > t_ofs || t_ofs > 1) /* +/- 1 usec is allowed for jitter */ { mtlk_log_timestamp_offset += t_ofs; /* additional shift */ ILOG4_DDD("LogTimestamp shift: TSF %010u, t_log %010u, shift %+d", t_tsf, t_log, t_ofs); } #endif mtlk_log_tsf_sync_msg(mtlk_vap_get_hw_idx(vap_handle), t_log, t_ofs); #endif /* CPTCFG_IWLWAV_TSF_TIMER_ACCESS_ENABLED */ } static int _mtlk_core_get_status (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); wave_radio_t *radio = wave_vap_radio_get(nic->vap_handle); mtlk_hw_api_t *hw_api = mtlk_vap_get_hwapi(nic->vap_handle); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_core_general_stats_t *general_stats; mtlk_txmm_stats_t txm_stats; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); general_stats = mtlk_osal_mem_alloc(sizeof(*general_stats), MTLK_MEM_TAG_CLPB); if(general_stats == NULL) { ELOG_D("CID-%04x: Can't allocate clipboard data", mtlk_vap_get_oid(nic->vap_handle)); return MTLK_ERR_NO_MEM; } memset(general_stats, 0, sizeof(*general_stats)); /* Fill Core private statistic fields*/ general_stats->core_priv_stats = nic->pstats; /* struct copy */ general_stats->tx_packets = nic->pstats.tx_packets; general_stats->tx_bytes = nic->pstats.tx_bytes; general_stats->rx_packets = nic->pstats.rx_packets; general_stats->rx_bytes = nic->pstats.rx_bytes; general_stats->rx_multicast_packets = nic->pstats.rx_multicast_packets; general_stats->unicast_replayed_packets = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_UNICAST_REPLAYED_PACKETS); general_stats->multicast_replayed_packets = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MULTICAST_REPLAYED_PACKETS); general_stats->management_replayed_packets = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MANAGEMENT_REPLAYED_PACKETS); general_stats->fwd_rx_packets = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_FWD_RX_PACKETS); general_stats->fwd_rx_bytes = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_FWD_RX_BYTES); general_stats->rx_dat_frames = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_DAT_FRAMES_RECEIVED); general_stats->rx_ctl_frames = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_CTL_FRAMES_RECEIVED); general_stats->tx_man_frames_res_queue = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_RES_QUEUE); general_stats->tx_man_frames_sent = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_SENT); general_stats->tx_man_frames_confirmed = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_CONFIRMED); general_stats->rx_man_frames = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_RECEIVED); general_stats->rx_man_frames_retry_dropped = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_RX_MAN_FRAMES_RETRY_DROPPED); general_stats->rx_man_frames_cfg80211_fail = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_MAN_FRAMES_CFG80211_FAILED); general_stats->dgaf_disabled_tx_pck_dropped = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_TO_UNICAST_DGAF_DISABLED); general_stats->dgaf_disabled_tx_pck_converted = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_TX_PACKETS_SKIPPED_DGAF_DISABLED); /* bss mgmt statistics */ general_stats->tx_probe_resp_sent_cnt = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_TX_PROBE_RESP_SENT); general_stats->tx_probe_resp_dropped_cnt = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_TX_PROBE_RESP_DROPPED); general_stats->bss_mgmt_tx_que_full_cnt = _mtlk_core_get_cnt(nic, MTLK_CORE_CNT_BSS_MGMT_TX_QUE_FULL); /* Radio status */ general_stats->tx_probe_resp_sent_cnt_per_radio = mtlk_wss_get_stat(nic->radio_wss, WAVE_RADIO_CNT_TX_PROBE_RESP_SENT); general_stats->tx_probe_resp_dropped_cnt_per_radio = mtlk_wss_get_stat(nic->radio_wss, WAVE_RADIO_CNT_TX_PROBE_RESP_DROPPED); general_stats->bss_mgmt_tx_que_full_cnt_per_radio = mtlk_wss_get_stat(nic->radio_wss, WAVE_RADIO_CNT_BSS_MGMT_TX_QUE_FULL); /* HW status */ (void)mtlk_hw_get_prop(hw_api, MTLK_HW_BSS_MGMT_MAX_MSGS, &general_stats->bss_mgmt_bds_max_num, sizeof(general_stats->bss_mgmt_bds_max_num)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_BSS_MGMT_FREE_MSGS, &general_stats->bss_mgmt_bds_free_num, sizeof(general_stats->bss_mgmt_bds_free_num)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_BSS_MGMT_MSGS_USED_PEAK, &general_stats->bss_mgmt_bds_usage_peak, sizeof(general_stats->bss_mgmt_bds_usage_peak)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_BSS_MGMT_MAX_RES_MSGS, &general_stats->bss_mgmt_bds_max_num_res, sizeof(general_stats->bss_mgmt_bds_max_num_res)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_BSS_MGMT_FREE_RES_MSGS, &general_stats->bss_mgmt_bds_free_num_res, sizeof(general_stats->bss_mgmt_bds_free_num_res)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_BSS_MGMT_MSGS_RES_USED_PEAK, &general_stats->bss_mgmt_bds_usage_peak_res, sizeof(general_stats->bss_mgmt_bds_usage_peak_res)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FREE_TX_MSGS, &general_stats->tx_msdus_free, sizeof(general_stats->tx_msdus_free)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_TX_MSGS_USED_PEAK, &general_stats->tx_msdus_usage_peak, sizeof(general_stats->tx_msdus_usage_peak)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_BIST, &general_stats->bist_check_passed, sizeof(general_stats->bist_check_passed)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FW_BUFFERS_PROCESSED, &general_stats->fw_logger_packets_processed, sizeof(general_stats->fw_logger_packets_processed)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FW_BUFFERS_DROPPED, &general_stats->fw_logger_packets_dropped, sizeof(general_stats->fw_logger_packets_dropped)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_RADARS_DETECTED, &general_stats->radars_detected, sizeof(general_stats->radars_detected)); #ifdef CPTCFG_IWLWAV_LEGACY_INT_RECOVERY_MON (void)mtlk_hw_get_prop(hw_api, MTLK_HW_ISR_LOST_SUSPECT, &general_stats->isr_lost_suspect, sizeof(general_stats->isr_lost_suspect)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_ISR_LOST_RECOVERED, &general_stats->isr_recovered, sizeof(general_stats->isr_recovered)); #endif #ifdef MTLK_DEBUG (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FW_CFM_IN_TASKLET, &general_stats->tx_max_cfm_in_tasklet, sizeof(general_stats->tx_max_cfm_in_tasklet)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FW_TX_TIME_INT_TO_TASKLET, &general_stats->tx_max_time_int_to_tasklet, sizeof(general_stats->tx_max_time_int_to_tasklet)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FW_TX_TIME_INT_TO_CFM, &general_stats->tx_max_time_int_to_pck, sizeof(general_stats->tx_max_time_int_to_pck)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FW_DATA_IN_TASKLET, &general_stats->rx_max_pck_in_tasklet, sizeof(general_stats->rx_max_pck_in_tasklet)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FW_RX_TIME_INT_TO_TASKLET, &general_stats->rx_max_time_int_to_tasklet, sizeof(general_stats->rx_max_time_int_to_tasklet)); (void)mtlk_hw_get_prop(hw_api, MTLK_HW_FW_RX_TIME_INT_TO_PCK, &general_stats->rx_max_time_int_to_pck, sizeof(general_stats->rx_max_time_int_to_pck)); #endif mtlk_txmm_get_stats(mtlk_vap_get_txmm(nic->vap_handle), &txm_stats); general_stats->txmm_sent = txm_stats.nof_sent; general_stats->txmm_cfmd = txm_stats.nof_cfmed; general_stats->txmm_peak = txm_stats.used_peak; mtlk_txmm_get_stats(mtlk_vap_get_txdm(nic->vap_handle), &txm_stats); general_stats->txdm_sent = txm_stats.nof_sent; general_stats->txdm_cfmd = txm_stats.nof_cfmed; general_stats->txdm_peak = txm_stats.used_peak; /* For master VAP only */ if(mtlk_vap_is_master(nic->vap_handle)) { mtlk_vap_handle_t vap_handle = nic->vap_handle; mtlk_hw_t *hw = mtlk_vap_get_hw(vap_handle); wave_radio_t *radio = wave_vap_radio_get(vap_handle); /* Sync Log Timestamp with FW TSF */ _mtlk_core_sync_log_timestamp(vap_handle); /* Check HW ring queues */ if (wave_hw_mmb_all_rings_queue_check(hw)) { ELOG_V("Ring failure -> Reset FW"); (void)mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_RESET, NULL, 0); res = MTLK_ERR_UNKNOWN; goto FINISH; } #ifdef MTLK_LEGACY_STATISTICS /* Get MHI Statistics which is per HW card */ if (wave_radio_is_first(radio)) _mtlk_core_mac_get_mhi_stats(nic, hw); #else /* if any core on this card is scanning then _mtlk_core_get_statistics is * invoked from scan context and not from stats context, this * prevents both scan and stats context accessing the common stats buffer */ if (wave_radio_is_first(radio) && (!mtlk_hw_scan_is_running(hw))) _mtlk_core_get_statistics(nic, hw); if ( TRUE == mtlk_hw_get_stats_available(hw)){ #endif /* Update all VAPs Statistics */ if (MTLK_ERR_OK == res) { _mtlk_core_update_vaps_mhi_stats(nic, radio, hw); } #ifdef MTLK_LEGACY_STATISTICS /* Get PHY Status */ if (!mtlk_core_scan_is_running(nic)) { #endif { struct intel_vendor_channel_data ch_data; mtlk_osal_msec_t cur_time = mtlk_osal_timestamp_to_ms(mtlk_osal_timestamp()); iwpriv_cca_adapt_t cca_adapt_params; mtlk_pdb_size_t cca_adapt_size = sizeof(cca_adapt_params); _mtlk_core_mac_get_phy_status(nic, hw, general_stats); /* if beacons were blocked due to CCA, need to poll CWI */ if (nic->slow_ctx->cca_adapt.cwi_poll) { if (MTLK_ERR_OK != WAVE_RADIO_PDB_GET_BINARY(radio, PARAM_DB_RADIO_CCA_ADAPT, &cca_adapt_params, &cca_adapt_size)) goto FINISH; if ((cur_time - nic->slow_ctx->cca_adapt.cwi_poll_ts) > (cca_adapt_params.iterative * DEFAULT_BEACON_INTERVAL)) { res = scan_get_aocs_info(nic, &ch_data, NULL); if (MTLK_ERR_OK == res) { mtlk_cca_step_up_if_allowed(nic, ch_data.cwi_noise, cca_adapt_params.limit, cca_adapt_params.step_up); } nic->slow_ctx->cca_adapt.cwi_poll_ts = cur_time; } } /* for AP channel 0 means "use AOCS" */ if (!WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_CHANNEL_CFG) && WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_ACS_UPDATE_TO) && (cur_time - nic->acs_updated_ts) > WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_ACS_UPDATE_TO)) { res = fill_channel_data(nic, &ch_data); if (MTLK_ERR_OK == res) res = mtlk_send_chan_data(nic->vap_handle, &ch_data, sizeof(ch_data)); nic->acs_updated_ts = cur_time; } } } if (MTLK_ERR_OK != res) { goto FINISH; } /* Fill core status fields */ general_stats->net_state = mtlk_core_get_net_state(nic); MTLK_CORE_PDB_GET_MAC(nic, PARAM_DB_CORE_BSSID, &general_stats->bssid); if (!mtlk_vap_is_ap(nic->vap_handle) && (mtlk_core_get_net_state(nic) == NET_STATE_CONNECTED)) { sta_entry *sta = mtlk_stadb_get_ap(&nic->slow_ctx->stadb); if (NULL != sta) { general_stats->max_rssi = mtlk_sta_get_max_rssi(sta); mtlk_sta_decref(sta); /* De-reference of get_ap */ } } } /* Radio Phy Status */ { wave_radio_phy_stat_t phy_stat; wave_radio_phy_status_get(radio, &phy_stat); general_stats->noise = phy_stat.noise; general_stats->channel_util = phy_stat.ch_util; general_stats->airtime = phy_stat.airtime; general_stats->airtime_efficiency = phy_stat.airtime_efficiency;; } /* Get PHY Status */ _mtlk_core_mac_update_peers_stats(nic); /* Return Core status & statistic data */ res = mtlk_clpb_push_nocopy(clpb, general_stats, sizeof(*general_stats)); if (MTLK_ERR_OK != res) { mtlk_clpb_purge(clpb); goto FINISH; } return MTLK_ERR_OK; FINISH: mtlk_osal_mem_free(general_stats); return res; } int _mtlk_core_get_hs20_info(mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; mtlk_core_hs20_info_t *hs20_info; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); hs20_info = mtlk_osal_mem_alloc(sizeof(*hs20_info), MTLK_MEM_TAG_CLPB); if(hs20_info == NULL) { ELOG_V("Can't allocate clipboard data"); res = MTLK_ERR_NO_MEM; goto err_finish; } memset(hs20_info, 0, sizeof(*hs20_info)); hs20_info->hs20_enabled = mtlk_df_user_get_hs20_status(mtlk_vap_get_df(nic->vap_handle)); hs20_info->arp_proxy = MTLK_CORE_PDB_GET_INT(nic, PARAM_DB_CORE_ARP_PROXY); hs20_info->dgaf_disabled = nic->dgaf_disabled; hs20_info->osen_enabled = nic->osen_enabled; wave_memcpy(hs20_info->dscp_table, sizeof(hs20_info->dscp_table), nic->dscp_table, sizeof(nic->dscp_table)); res = mtlk_clpb_push_nocopy(clpb, hs20_info, sizeof(*hs20_info)); if (MTLK_ERR_OK != res) { mtlk_clpb_purge(clpb); goto err_finish; } return MTLK_ERR_OK; err_finish: if (hs20_info) { mtlk_osal_mem_free(hs20_info); } return res; } void __MTLK_IFUNC core_wds_beacon_process(mtlk_core_t *master_core, wds_beacon_data_t *beacon_data) { wds_t *master_wds = &master_core->slow_ctx->wds_mng; wds_on_beacon_t *on_beacon; ILOG5_V("Processing a WDS beacon"); on_beacon = wds_on_beacon_find_remove(master_wds, &beacon_data->addr, FALSE); if (on_beacon) { beacon_data->vap_idx = on_beacon->vap_id; if (NULL == on_beacon->ie_data) { on_beacon->ie_data = mtlk_osal_mem_alloc(beacon_data->ie_data_len, LQLA_MEM_TAG_WDS); if (on_beacon->ie_data) { wave_memcpy(on_beacon->ie_data, beacon_data->ie_data_len, beacon_data->ie_data, beacon_data->ie_data_len); on_beacon->ie_data_len = beacon_data->ie_data_len; _mtlk_process_hw_task(master_core, SERIALIZABLE, wds_beacon_process, HANDLE_T(master_wds), beacon_data, sizeof(wds_beacon_data_t)); } } } } BOOL __MTLK_IFUNC core_wds_frame_drop(mtlk_core_t *core, IEEE_ADDR *addr) { wds_t *wds_ctx = &core->slow_ctx->wds_mng; return wds_sta_is_peer_ap(wds_ctx, addr); } uint32 __MTLK_IFUNC mtlk_core_ta_on_timer (mtlk_osal_timer_t *timer, mtlk_handle_t ta_handle) { /* Note: This function is called from timer context Do not modify TA structure from here */ mtlk_core_t *core; mtlk_vap_handle_t vap_handle = mtlk_ta_get_vap_handle(ta_handle); if (vap_handle) { core = mtlk_vap_get_core(vap_handle); mtlk_core_schedule_internal_task(core, ta_handle, ta_timer, NULL, 0); return mtlk_ta_get_timer_resolution_ms(ta_handle); } else { ELOG_V("Can't to schedule TA task: VAP-handler not found"); return 0; } } int __MTLK_IFUNC mtlk_core_stop_lm (struct nic *core) { return (_mtlk_core_stop_lm(HANDLE_T(core), NULL, 0)); } int __MTLK_IFUNC core_on_rcvry_isol (mtlk_core_t *core, uint32 rcvry_type) { int res; #ifdef MTLK_LEGACY_STATISTICS mtlk_wssd_unregister_request_handler(mtlk_vap_get_irbd(core->vap_handle), core->slow_ctx->stat_irb_handle); core->slow_ctx->stat_irb_handle = NULL; #endif if (mtlk_vap_is_master_ap(core->vap_handle)) { mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); mtlk_ta_on_rcvry_isol(mtlk_vap_get_ta(core->vap_handle)); /* Disable MAC WatchDog */ mtlk_osal_timer_cancel_sync(&core->slow_ctx->mac_watchdog_timer); /* CoC isolation */ mtlk_coc_on_rcvry_isol(coc_mgmt); if (mtlk_core_scan_is_running(core)) { res = pause_or_prevent_scan(core); if (MTLK_ERR_OK != res) { return res; } } } clean_all_sta_on_disconnect(core); if (mtlk_vap_is_ap(core->vap_handle)) { wds_on_if_down(&core->slow_ctx->wds_mng); } mtlk_stadb_stop(&core->slow_ctx->stadb); res = wave_beacon_man_rcvry_reset(core); if (MTLK_ERR_OK != res) { return res; } res = mtlk_core_set_net_state(core, NET_STATE_HALTED); if (res != MTLK_ERR_OK) { return res; } return MTLK_ERR_OK; } int __MTLK_IFUNC _core_set_umi_key(mtlk_core_t *core, int key_index) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; mtlk_txmm_t *txmm = mtlk_vap_get_txmm(core->vap_handle); UMI_SET_KEY *umi_key; uint16 alg_type; uint16 key_len; if ((mtlk_core_get_net_state(core) & (NET_STATE_READY | NET_STATE_ACTIVATING | NET_STATE_CONNECTED)) == 0) { ILOG1_D("CID-%04x: Invalid card state - request rejected", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } if (mtlk_core_is_stopping(core)) { ILOG1_D("CID-%04x: Can't set ENC_EXT configuration - core is stopping", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NOT_READY; goto FINISH; } alg_type = core->slow_ctx->group_cipher; if ((key_index == 0) && (alg_type != IW_ENCODE_ALG_WEP)) { ILOG2_DDD("CID-%04x: Ignore Key %d, if alg_type=%d is not WEP", mtlk_vap_get_oid(core->vap_handle), key_index, alg_type); res = MTLK_ERR_OK; goto FINISH; } /* Prepare UMI message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, txmm, NULL); if (!man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto FINISH; } umi_key = (UMI_SET_KEY*)man_entry->payload; memset(umi_key, 0, sizeof(*umi_key)); man_entry->id = UM_MAN_SET_KEY_REQ; man_entry->payload_size = sizeof(*umi_key); key_len = core->slow_ctx->keys[key_index].key_len; if( 0 == key_len) { ILOG2_DD("CID-%04x: Key %d is not set", mtlk_vap_get_oid(core->vap_handle), key_index); res = MTLK_ERR_OK; goto FINISH; } /* Set Ciper Suite */ switch (alg_type) { case IW_ENCODE_ALG_WEP: if(MIB_WEP_KEY_WEP2_LENGTH == key_len) { /* 104 bit */ umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_WEP104); } else if (MIB_WEP_KEY_WEP1_LENGTH == key_len) { /* 40 bit */ umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_WEP40); } else { ELOG_DD("CID-%04x: Wrong WEP key length %d", mtlk_vap_get_oid(core->vap_handle), key_len); res = MTLK_ERR_PARAMS; goto FINISH; } break; case IW_ENCODE_ALG_TKIP: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_TKIP); break; case IW_ENCODE_ALG_CCMP: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_CCMP); break; case IW_ENCODE_ALG_AES_CMAC: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_BIP); break; case IW_ENCODE_ALG_GCMP: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_GCMP128); break; case IW_ENCODE_ALG_GCMP_256: umi_key->u16CipherSuite = HOST_TO_MAC16(UMI_RSN_CIPHER_SUITE_GCMP256); break; default: ELOG_D("CID-%04x: Unknown CiperSuite", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_PARAMS; goto FINISH; } /* Recovery only group key */ umi_key->u16KeyType = HOST_TO_MAC16(UMI_RSN_GROUP_KEY); /* update group replay counter */ _mtlk_core_set_rx_seq(core, key_index, core->slow_ctx->keys[key_index].seq); umi_key->u16Sid = HOST_TO_MAC16(TMP_BCAST_DEST_ADDR); /* The key has been copied into au8Tk1 array with UMI_RSN_TK1_LEN size. * But key can have UMI_RSN_TK1_LEN+UMI_RSN_TK2_LEN size - so * actually second part of key is copied into au8Tk2 array */ wave_memcpy(umi_key->au8Tk, sizeof(umi_key->au8Tk), core->slow_ctx->keys[key_index].key, core->slow_ctx->keys[key_index].key_len); /* set TX sequence number */ umi_key->au8TxSeqNum[0] = 1; umi_key->u16KeyIndex = HOST_TO_MAC16(key_index); ILOG1_D("UMI_SET_KEY SID:0x%x", MAC_TO_HOST16(umi_key->u16Sid)); ILOG1_D("UMI_SET_KEY KeyType:0x%x", MAC_TO_HOST16(umi_key->u16KeyType)); ILOG1_D("UMI_SET_KEY u16CipherSuite:0x%x", MAC_TO_HOST16(umi_key->u16CipherSuite)); ILOG1_D("UMI_SET_KEY KeyIndex:%d", MAC_TO_HOST16(umi_key->u16KeyIndex)); mtlk_dump(1, umi_key->au8RxSeqNum, sizeof(umi_key->au8RxSeqNum), "RxSeqNum"); mtlk_dump(1, umi_key->au8TxSeqNum, sizeof(umi_key->au8TxSeqNum), "TxSeqNum"); mtlk_dump(1, umi_key->au8Tk, key_len, "KEY:"); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: mtlk_mm_send_blocked failed: %i", mtlk_vap_get_oid(core->vap_handle), res); goto FINISH; } FINISH: if (NULL != man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } static int _mtlk_core_set_amsdu_num_req (mtlk_core_t *core, uint32 htMsduInAmsdu, uint32 vhtMsduInAmsdu, uint32 heMsduInAmsdu) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_MSDU_IN_AMSDU_CONFIG *pAMSDUNum = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; MTLK_ASSERT(vap_handle); ILOG1_DDD("CID-%04x:AMSDUNum FW request: Set %d %d", mtlk_vap_get_oid(vap_handle), htMsduInAmsdu, vhtMsduInAmsdu); man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_MSDU_IN_AMSDU_CONFIG_REQ; man_entry->payload_size = sizeof(UMI_MSDU_IN_AMSDU_CONFIG); pAMSDUNum = (UMI_MSDU_IN_AMSDU_CONFIG *)(man_entry->payload); pAMSDUNum->htMsduInAmsdu = (uint8)htMsduInAmsdu; pAMSDUNum->vhtMsduInAmsdu = (uint8)vhtMsduInAmsdu; pAMSDUNum->heMsduInAmsdu = (uint8)heMsduInAmsdu; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Set AMSDU Enable failure (%i)", mtlk_vap_get_oid(vap_handle), res); } mtlk_txmm_msg_cleanup(&man_msg); return res; } void __MTLK_IFUNC core_on_rcvry_error (mtlk_core_t *core) { if (mtlk_vap_is_master(core->vap_handle)) { wave_core_sync_hostapd_done_set(core, TRUE); ILOG1_D("CID-%04x: Recovery: Set HOSTAPD STA database synced to TRUE", mtlk_vap_get_oid(core->vap_handle)); } } static void mtlk_core_on_rcvry_reset_counters(mtlk_core_t *core) { /* Reset data packet confirmation counter */ mtlk_osal_atomic_set(&core->unconfirmed_data, 0); /* Reset management packet sent/confirmed counters */ _mtlk_core_reset_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_SENT); _mtlk_core_reset_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_CONFIRMED); /* Reserved queue is cleaned up in mtlk_hw_mmb_restore, so just reset counter */ _mtlk_core_reset_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_RES_QUEUE); } int __MTLK_IFUNC core_on_rcvry_restore (mtlk_core_t *core, uint32 rcvry_type) { /* Restore CORE's data & variables not related with current configuration */ int res = MTLK_ERR_OK; res = mtlk_core_set_net_state(core, NET_STATE_IDLE); if (res != MTLK_ERR_OK) { return res; } if (mtlk_vap_is_master(core->vap_handle)) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); /* Restore WATCHDOG timer */ mtlk_osal_timer_set(&core->slow_ctx->mac_watchdog_timer, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MAC_WATCHDOG_TIMER_PERIOD_MS)); wave_radio_progmodel_loaded_set(radio, FALSE); wave_radio_last_pm_freq_set(radio, MTLK_HW_BAND_NONE); /* Reset Radio Calibration context */ if (RCVRY_TYPE_FULL == rcvry_type) { struct mtlk_chan_def *ccd = wave_radio_chandef_get(radio); struct scan_support *ss = wave_radio_scan_support_get(radio); /* Make channel uncertain */ ccd->center_freq1 = 0; /* Reset previously calibrated channels list */ memset(ss->css, 0, sizeof(ss->css)); } } /* Reset required counters */ mtlk_core_on_rcvry_reset_counters (core); #ifdef MTLK_LEGACY_STATISTICS /* register back irb handler */ core->slow_ctx->stat_irb_handle = mtlk_wssd_register_request_handler(mtlk_vap_get_irbd(core->vap_handle), _mtlk_core_stat_handle_request, HANDLE_T(core->slow_ctx)); if (core->slow_ctx->stat_irb_handle == NULL) { return res; } #endif res = mtlk_core_set_net_state(core, NET_STATE_READY); if (res != MTLK_ERR_OK) { ELOG_D("Set net state failed. res=%d", res); return res; } return MTLK_ERR_OK; } static int core_on_rcvry_security(mtlk_core_t *core) { int res; int i; for (i = 0; i < MIB_WEP_N_DEFAULT_KEYS; i++) { res = _core_set_umi_key(core, i); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Recovery failed. res=%d", mtlk_vap_get_oid(core->vap_handle), res); return res; } } res = core_recovery_default_key(core, FALSE); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Recovery failed. res=%d", mtlk_vap_get_oid(core->vap_handle), res); return res; } return res; } static int core_recovery_cfg_change_bss(mtlk_core_t *core) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_SET_BSS *req; uint16 beacon_int, dtim_int; uint8 vap_id = mtlk_vap_get_id(core->vap_handle); mtlk_pdb_t *param_db_core = mtlk_vap_get_param_db(core->vap_handle); struct nic *master_core = mtlk_vap_manager_get_master_core(mtlk_vap_get_manager(core->vap_handle)); struct mtlk_chan_def *current_chandef = __wave_core_chandef_get(master_core); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); /* prepare msg for the FW */ if (!(man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(core->vap_handle), &res))) { ELOG_DD("CID-%04x: UM_BSS_SET_BSS_REQ init failed, err=%i", mtlk_vap_get_oid(core->vap_handle), res); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_BSS_SET_BSS_REQ; man_entry->payload_size = sizeof(*req); req = (UMI_SET_BSS *) man_entry->payload; memset(req, 0, sizeof(*req)); req->vapId = vap_id; ILOG4_V("Dealing w/ protection"); req->protectionMode = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_HT_PROTECTION); ILOG4_V("Dealing w/ short slot"); req->slotTime = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SHORT_SLOT); req->useShortPreamble = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SHORT_PREAMBLE); /* DTIM and Beacon interval are set in start_ap and stored in param_db */ ILOG4_V("Dealing with DTIM and Beacon intervals"); beacon_int = (uint16) WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_BEACON_PERIOD); dtim_int = (uint16) MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_DTIM_PERIOD); req->beaconInterval = HOST_TO_MAC16(beacon_int); req->dtimInterval = HOST_TO_MAC16(dtim_int); ILOG4_V("Dealing w/ basic rates"); req->u8Rates_Length = (uint8)wave_core_param_db_basic_rates_get(core, current_chandef->chan.band, req->u8Rates, sizeof(req->u8Rates)); ILOG4_V("Dealing w/ Fixed MCS VAP management"); req->fixedMcsVapManagement = (uint8)_core_management_frames_rate_select(core); ILOG4_V("Dealing w/ HT/VHT MCS-s and flags"); { mtlk_pdb_size_t mcs_len = sizeof(req->u8TX_MCS_Bitmask); wave_pdb_get_binary(param_db_core, PARAM_DB_CORE_RX_MCS_BITMASK, &req->u8TX_MCS_Bitmask, &mcs_len); mcs_len = sizeof(req->u8VHT_Mcs_Nss); wave_pdb_get_binary(param_db_core, PARAM_DB_CORE_VHT_MCS_NSS, &req->u8VHT_Mcs_Nss, &mcs_len); req->flags = wave_pdb_get_int(param_db_core, PARAM_DB_CORE_SET_BSS_FLAGS); if (wave_pdb_get_int(param_db_core, PARAM_DB_CORE_RELIABLE_MCAST)) { req->flags |= MTLK_BFIELD_VALUE(VAP_ADD_FLAGS_RELIABLE_MCAST, 1, uint8); } if (mtlk_df_user_get_hs20_status(mtlk_vap_get_df(core->vap_handle))) { req->flags |= MTLK_BFIELD_VALUE(VAP_ADD_FLAGS_HS20_ENABLE, 1, uint8); } } mtlk_dump(2, req, sizeof(*req), "dump of UMI_SET_BSS:"); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: UM_BSS_SET_BSS_REQ send failed, err=%i", mtlk_vap_get_oid(core->vap_handle), res); } else { if (mtlk_core_get_net_state(core) != NET_STATE_CONNECTED) { res = mtlk_core_set_net_state(core, NET_STATE_CONNECTED); } } mtlk_txmm_msg_cleanup(&man_msg); return res; } static __INLINE BOOL __mtlk_core_11b_antsel_configured (mtlk_11b_antsel_t *antsel) { MTLK_ASSERT(antsel != NULL); return antsel->txAnt != MTLK_PARAM_DB_INVALID_UINT8 && antsel->rxAnt != MTLK_PARAM_DB_INVALID_UINT8 && antsel->rate != MTLK_PARAM_DB_INVALID_UINT8; } static int _mtlk_core_set_11b_antsel (mtlk_core_t *core) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_11b_antsel_t antsel; memset(&antsel, 0, sizeof(antsel)); antsel.txAnt = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_11B_ANTSEL_TXANT); antsel.rxAnt = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_11B_ANTSEL_RXANT); antsel.rate = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_11B_ANTSEL_RATE); if (!__mtlk_core_11b_antsel_configured(&antsel)) return MTLK_ERR_OK; return _mtlk_core_send_11b_antsel(core, &antsel); } static int mtlk_core_rcvry_set_channel (mtlk_core_t *core) { mtlk_handle_t ccd_handle; struct mtlk_chan_def *ccd; wave_rcvry_chandef_current_get(mtlk_vap_get_hw(core->vap_handle), mtlk_vap_get_manager(core->vap_handle), &ccd_handle); ccd = (struct mtlk_chan_def *)ccd_handle; if (NULL == ccd) return MTLK_ERR_NOT_SUPPORTED; /* In case FW crashed for example during SET_CHAN_REQ */ if (!is_channel_certain(ccd)) { ccd = __wave_core_chandef_get(core); } return core_cfg_set_chan(core, ccd, NULL); } static int mtlk_core_cfg_recovery_set_coex (mtlk_core_t *core) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); uint8 coex_enabled = (uint8)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_COEX_ENABLED); uint8 coex_mode = (uint8)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_COEX_MODE); if (MTLK_ERR_OK != mtlk_core_is_band_supported(core, UMI_PHY_TYPE_BAND_2_4_GHZ)) return MTLK_ERR_OK; return mtlk_core_send_coex_config_req(core, coex_mode, coex_enabled); } static int _mtlk_core_rcvry_set_freq_jump_mode (mtlk_core_t *core) { int res = MTLK_ERR_OK; uint32 freq_jump_mode = WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_FREQ_JUMP_MODE); /* First message to FW must not contain default value */ if (MTLK_FREQ_JUMP_MODE_DEFAULT != freq_jump_mode) { res = mtlk_core_cfg_send_freq_jump_mode(core, freq_jump_mode); } return res; } static int _mtlk_core_rcvry_set_pd_threshold (mtlk_core_t *core) { UMI_SET_PD_THRESH pd_thresh; mtlk_core_cfg_get_pd_threshold(core, &pd_thresh); if (QOS_PD_THRESHOLD_NUM_MODES == pd_thresh.mode) return MTLK_ERR_OK; return mtlk_core_cfg_send_pd_threshold(core, &pd_thresh); } static int _mtlk_core_rcvry_set_resticted_ac_mode (mtlk_core_t *core) { UMI_SET_RESTRICTED_AC restricted_ac_mode; mtlk_core_cfg_get_restricted_ac_mode(core, &restricted_ac_mode); if (MTLK_PARAM_DB_VALUE_IS_INVALID(restricted_ac_mode.restrictedAcModeEnable)) return MTLK_ERR_OK; return mtlk_core_cfg_send_restricted_ac_mode(core, &restricted_ac_mode); } static int _mtlk_core_recover_aggr_cfg (mtlk_core_t *core) { uint8 amsdu_mode = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_AMSDU_MODE); uint8 ba_mode = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_BA_MODE); uint32 window_size = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_WINDOW_SIZE); if (MTLK_PARAM_DB_VALUE_IS_INVALID(amsdu_mode) || MTLK_PARAM_DB_VALUE_IS_INVALID(ba_mode) || MTLK_PARAM_DB_VALUE_IS_INVALID(window_size)) return MTLK_ERR_OK; return _mtlk_core_set_aggr_cfg_req(core, amsdu_mode, ba_mode, window_size); } static int _mtlk_core_recover_agg_rate_limit (mtlk_core_t *core) { mtlk_agg_rate_limit_cfg_t agg_rate_cfg; _mtlk_core_read_agg_rate_limit(core, &agg_rate_cfg); if (MTLK_PARAM_DB_VALUE_IS_INVALID(agg_rate_cfg.agg_rate_limit.mode)) return MTLK_ERR_OK; return mtlk_core_set_agg_rate_limit(core, &agg_rate_cfg); } static int _mtlk_core_recover_max_mpdu_length (mtlk_core_t *core) { uint32 length = mtlk_core_cfg_read_max_mpdu_length(core); if (MTLK_PARAM_DB_VALUE_IS_INVALID(length)) return MTLK_ERR_OK; return mtlk_core_cfg_send_max_mpdu_length(core, length); } static int _mtlk_core_recover_mu_operation (mtlk_core_t *core) { uint8 mu_operation = WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_MU_OPERATION); if (MTLK_PARAM_DB_VALUE_IS_INVALID(mu_operation)) return MTLK_ERR_OK; return mtlk_core_set_mu_operation(core, mu_operation); } static int _core_recover_he_mu_operation (mtlk_core_t *core) { int res = MTLK_ERR_OK; if (!mtlk_hw_type_is_gen5(mtlk_vap_get_hw(core->vap_handle))) { res = _mtlk_core_set_he_mu_operation(core, WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_HE_MU_OPERATION)); } return res; } static int _mtlk_core_recover_amsdu_cfg (mtlk_core_t *core) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); uint32 amsdu_num = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_AMSDU_NUM); uint32 amsdu_vnum = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_AMSDU_VNUM); uint32 amsdu_henum = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_AMSDU_HENUM); if (MTLK_PARAM_DB_VALUE_IS_INVALID(amsdu_num) || MTLK_PARAM_DB_VALUE_IS_INVALID(amsdu_vnum) || MTLK_PARAM_DB_VALUE_IS_INVALID(amsdu_henum)) return MTLK_ERR_OK; return _mtlk_core_set_amsdu_num_req(core, amsdu_num, amsdu_vnum, amsdu_henum); } static int _mtlk_core_recover_qamplus_mode (mtlk_core_t *core) { uint8 qam_plus_mode = WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_QAMPLUS_MODE); if (MTLK_PARAM_DB_VALUE_IS_INVALID(qam_plus_mode)) return MTLK_ERR_OK; return _mtlk_core_qamplus_mode_req(core, qam_plus_mode); } static int _mtlk_recover_rts_mode (mtlk_core_t *core) { uint8 dynamic_bw, static_bw; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); dynamic_bw = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_RTS_DYNAMIC_BW); static_bw = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_RTS_STATIC_BW); if (MTLK_PARAM_DB_VALUE_IS_INVALID(dynamic_bw) || MTLK_PARAM_DB_VALUE_IS_INVALID(static_bw)) return MTLK_ERR_OK; return mtlk_core_set_rts_mode(core, dynamic_bw, static_bw); } static int _mtlk_core_recover_rx_duty_cycle (mtlk_core_t *core) { uint32 on_time, off_time; mtlk_rx_duty_cycle_cfg_t duty_cycle_cfg; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); memset(&duty_cycle_cfg, 0, sizeof(duty_cycle_cfg)); on_time = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_RX_DUTY_CYCLE_ON_TIME); off_time = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_RX_DUTY_CYCLE_OFF_TIME); if (MTLK_PARAM_DB_VALUE_IS_INVALID(on_time) || MTLK_PARAM_DB_VALUE_IS_INVALID(off_time)) return MTLK_ERR_OK; duty_cycle_cfg.duty_cycle.onTime = on_time; duty_cycle_cfg.duty_cycle.offTime = off_time; return mtlk_core_set_rx_duty_cycle(core, &duty_cycle_cfg); } static int _mtlk_core_recover_rx_threshold (mtlk_core_t *core) { uint32 rx_thr = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_RX_THRESHOLD); mtlk_rx_th_cfg_t rx_th_cfg; if (MTLK_PARAM_DB_VALUE_IS_INVALID(rx_thr)) return MTLK_ERR_OK; /* Validated on iwpriv setter */ rx_th_cfg.rx_threshold = (int8)rx_thr; return mtlk_core_set_rx_threshold(core, &rx_th_cfg); } static int _mtlk_core_recover_slow_probing_mask (mtlk_core_t *core) { uint32 mask = WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_SLOW_PROBING_MASK); if (MTLK_PARAM_DB_VALUE_IS_INVALID(mask)) return MTLK_ERR_OK; return mtlk_core_cfg_send_slow_probing_mask(core, mask); } static int _mtlk_core_recover_ssb_mode (mtlk_core_t *core) { mtlk_ssb_mode_cfg_t ssb_mode_cfg; uint32 ssb_mode_cfg_data_size = MTLK_SSB_MODE_CFG_SIZE; mtlk_core_read_ssb_mode(core, &ssb_mode_cfg, &ssb_mode_cfg_data_size); if (MTLK_PARAM_DB_VALUE_IS_INVALID(ssb_mode_cfg.params[MTLK_SSB_MODE_CFG_EN]) || MTLK_PARAM_DB_VALUE_IS_INVALID(ssb_mode_cfg.params[MTLK_SSB_MODE_CFG_20MODE])) return MTLK_ERR_OK; return mtlk_core_send_ssb_mode(core, &ssb_mode_cfg); } static int _mtlk_core_recover_txop_mode (mtlk_core_t *core) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); uint8 mode = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TXOP_MODE); uint32 sid = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TXOP_SID); if (MTLK_PARAM_DB_VALUE_IS_INVALID(mode)) return MTLK_ERR_OK; return mtlk_core_send_txop_mode(core, sid, mode); } static int _mtlk_core_recover_admission_capacity (mtlk_core_t *core) { uint32 admission_capacity = MTLK_CORE_PDB_GET_INT(core, PARAM_DB_CORE_ADMISSION_CAPACITY); if (MTLK_PARAM_DB_VALUE_IS_INVALID(admission_capacity)) return MTLK_ERR_OK; return mtlk_core_set_admission_capacity(core, admission_capacity); } static int _mtlk_core_recover_fast_drop (mtlk_core_t *core) { uint8 fast_drop = WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_FAST_DROP); if (MTLK_PARAM_DB_VALUE_IS_INVALID(fast_drop)) return MTLK_ERR_OK; return mtlk_core_cfg_send_fast_drop(core, fast_drop); } static int _mtlk_recover_bf_mode (mtlk_core_t *core) { uint8 bf_mode = WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_BF_MODE); return _mtlk_core_send_bf_mode(core, bf_mode); } static int _mtlk_core_recover_interfdet_threshold (mtlk_core_t *core) { BOOL is_spectrum_40 = (CW_40 == _mtlk_core_get_spectrum_mode(core)); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); int8 thr; if (is_spectrum_40) thr = (int8)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_40MHZ_NOTIFICATION_THRESHOLD); else thr = (int8)WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_INTERFDET_20MHZ_NOTIFICATION_THRESHOLD); if (MTLK_INTERFDET_THRESHOLD_INVALID == thr) return MTLK_ERR_OK; return _mtlk_core_set_fw_interfdet_req(core, is_spectrum_40); } static int _mtlk_core_recover_dynamic_mc_rate (mtlk_core_t *core) { uint32 dynamic_mc_rate = WAVE_RADIO_PDB_GET_INT(wave_vap_radio_get(core->vap_handle), PARAM_DB_RADIO_DYNAMIC_MC_RATE); if (MTLK_PARAM_DB_VALUE_IS_INVALID(dynamic_mc_rate)) return MTLK_ERR_OK; return _mtlk_core_send_dynamic_mc_rate(core, dynamic_mc_rate); } static void _mtlk_core_rcvry_chan_switch_notify (mtlk_core_t *core) { mtlk_df_t *df = mtlk_vap_get_df(core->vap_handle); mtlk_df_user_t *df_user = mtlk_df_get_user(df); struct net_device *ndev = mtlk_df_user_get_ndev(df_user); wv_cfg80211_ch_switch_notify(ndev, __wave_core_chandef_get(core), FALSE); } #define RECOVERY_INFO(text, oid) do { ILOG1_DS("CID-%04x: Recovery %s", oid, text); } while(0) #define RECOVERY_WARN(text, oid) do { WLOG_DS("CID-%04x: Recovery %s", oid, text); } while(0) static int _core_on_rcvry_configure (mtlk_core_t *core, uint32 target_net_state) { int res = MTLK_ERR_OK; uint32 db_value; uint32 active_ant_mask; mtlk_hw_band_e band; uint16 core_oid = mtlk_vap_get_oid(core->vap_handle); mtlk_core_t *master_core = mtlk_core_get_master(core); struct mtlk_chan_def *current_chandef = __wave_core_chandef_get(master_core); mtlk_scan_support_t *ss = mtlk_core_get_scan_support(core); mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_hw_t *hw = mtlk_vap_get_hw(core->vap_handle); mtlk_vap_manager_t *vap_manager = mtlk_vap_get_manager(core->vap_handle); MTLK_ASSERT(master_core != NULL); MTLK_ASSERT(current_chandef != NULL); MTLK_UNUSED_VAR(core_oid); ILOG1_DS("CID-%04x: Recovery: target_net_state: %s", core_oid, mtlk_net_state_to_string(target_net_state)); /* Set all MIBs, beside of security & preactivation MIBs * all these MIBS are sent on core creation*/ RECOVERY_INFO("set vap mibs", core_oid); res = mtlk_set_vap_mibs(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* Set before Activating VAP */ RECOVERY_INFO("Aggregation config", core_oid); res = _mtlk_core_recover_aggr_cfg(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("Admission Capacity", core_oid); res = _mtlk_core_recover_admission_capacity(core); if (res != MTLK_ERR_OK) {goto ERR_END;} if (mtlk_vap_is_master(core->vap_handle)) { /* Gen6 specific */ if (wave_radio_is_gen6(radio)) { /* HW card abilities are for the first radio */ if (wave_radio_is_first(radio)) { /* Test Bus */ db_value = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TEST_BUS_MODE); if (!MTLK_PARAM_DB_VALUE_IS_INVALID(db_value)) { RECOVERY_INFO("Enable Test Bus", core_oid); res = wave_core_send_test_bus_mode(core, db_value); if (res != MTLK_ERR_OK) {goto ERR_END;} } } } RECOVERY_INFO("Enable radar detection", core_oid); res = _mtlk_core_set_radar_detect(core, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_DFS_RADAR_DETECTION)); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("Set aggr limits", core_oid); res = _mtlk_core_recover_agg_rate_limit(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("MAX MPDU length", core_oid); res = _mtlk_core_recover_max_mpdu_length(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("AMSDU config", core_oid); res = _mtlk_core_recover_amsdu_cfg(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("MU operation", core_oid); res = _mtlk_core_recover_mu_operation(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("HE MU operation", core_oid); res = _core_recover_he_mu_operation(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("RTS mode", core_oid); res = _mtlk_recover_rts_mode(core); if (res != MTLK_ERR_OK) { goto ERR_END; } RECOVERY_INFO("11b antsel", core_oid); res = _mtlk_core_set_11b_antsel(core); if (res != MTLK_ERR_OK) { goto ERR_END; } RECOVERY_INFO("BF Mode", core_oid); res = _mtlk_recover_bf_mode(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("SSB Mode", core_oid); res = _mtlk_core_recover_ssb_mode(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("Frequency Jump Mode", core_oid); res = _mtlk_core_rcvry_set_freq_jump_mode(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("QOS PD Threshold", core_oid); res = _mtlk_core_rcvry_set_pd_threshold(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("Restricted AC Mode", core_oid); res = _mtlk_core_rcvry_set_resticted_ac_mode(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("Fast Drop", core_oid); res = _mtlk_core_recover_fast_drop(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* CCA Threshold */ RECOVERY_INFO("set CCA Threshold", core_oid); res = mtlk_core_cfg_recovery_cca_threshold(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* adaptive CCA Threshold */ RECOVERY_INFO("set CCA Adaptive Intervals", core_oid); res = mtlk_core_cfg_recovery_cca_adapt(core); if (res != MTLK_ERR_OK) { goto ERR_END; } /* 2.4 GHz Coexistance */ RECOVERY_INFO("Set Coexistance configuration", core_oid); res = mtlk_core_cfg_recovery_set_coex(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* TX Power limit configuration */ RECOVERY_INFO("set power limits", core_oid); res = _mtlk_core_send_tx_power_limit_offset(core, POWER_TO_DBM(WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_TX_POWER_LIMIT_OFFSET))); if (res != MTLK_ERR_OK) {goto ERR_END;} /* QAMplus mode configuration */ RECOVERY_INFO("QAMplus mode", core_oid); res = _mtlk_core_recover_qamplus_mode(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* Reception Duty Cycle configuration */ RECOVERY_INFO("set duty cycle", core_oid); res = _mtlk_core_recover_rx_duty_cycle(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* High Reception Threshold configuration */ RECOVERY_INFO("set rx_thresold", core_oid); res = _mtlk_core_recover_rx_threshold(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* Slow Probing Mask */ RECOVERY_INFO("Slow Probing Mask", core_oid); res = _mtlk_core_recover_slow_probing_mask(core); if (res != MTLK_ERR_OK) { goto ERR_END; } /* TXOP mode */ RECOVERY_INFO("set TXOP mode", core_oid); res = _mtlk_core_recover_txop_mode(core); if (res != MTLK_ERR_OK) { goto ERR_END; } RECOVERY_INFO("Multicast", core_oid); res = _mtlk_core_recovery_reliable_multicast(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* Radar Detection Threshold */ RECOVERY_INFO("set Radar Detection Threshold", core_oid); res = mtlk_core_cfg_recovery_radar_rssi_threshold(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* Dynamic Multicast Rate */ RECOVERY_INFO("set Dynamic Multicast Rate", core_oid); res = _mtlk_core_recover_dynamic_mc_rate(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* MAC Fatal occurred during scan, but before VAP was activated (NET_STATE_READY) */ if (RCVRY_FG_SCAN == wave_rcvry_scan_type_current_get(hw, vap_manager) && (target_net_state & NET_STATE_READY)) { RECOVERY_INFO("Resuming foreground scan", core_oid); res = mtlk_scan_recovery_continue_scan(core, MTLK_SCAN_SUPPORT_NO_BG_SCAN); if (res != MTLK_ERR_OK) {goto ERR_END;} } RECOVERY_INFO("RTS protection cutoff point", core_oid); res = wave_core_cfg_recover_cutoff_point(core); if (res != MTLK_ERR_OK) {goto ERR_END;} } /* VAP was not previously activated, nothing to configure */ if (!(target_net_state & (NET_STATE_ACTIVATING | NET_STATE_CONNECTED))) { goto ERR_OK; } RECOVERY_INFO("vap activate", core_oid); band = wave_radio_band_get(radio); if (!is_channel_certain(current_chandef) && RCVRY_FG_SCAN == wave_rcvry_scan_type_current_get(hw, vap_manager)) { band = ss->req.channels[0].band; /* Band wasn't set yet, so get from original scan request */ } res = mtlk_mbss_send_vap_activate(core, band); if (res != MTLK_ERR_OK) {goto ERR_END;} /* net state is ACTIVATING */ RECOVERY_INFO("stadb start", core_oid); mtlk_stadb_start(&core->slow_ctx->stadb); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("restore security", core_oid); res = core_on_rcvry_security(core); if (res != MTLK_ERR_OK) {goto ERR_END;} if (mtlk_vap_is_master(core->vap_handle)) { /* WDS */ if (BR_MODE_WDS == MTLK_CORE_HOT_PATH_PDB_GET_INT(core, CORE_DB_CORE_BRIDGE_MODE)) { RECOVERY_INFO("restore WDS", core_oid); wds_on_if_up(&core->slow_ctx->wds_mng); } /* IRE Control */ RECOVERY_INFO("set IRE Control", core_oid); res = mtlk_core_cfg_recovery_ire_ctrl(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* Continue foreground scan */ if (RCVRY_FG_SCAN == wave_rcvry_scan_type_current_get(hw, vap_manager)) { RECOVERY_INFO("Resuming foreground scan", core_oid); res = mtlk_scan_recovery_continue_scan(core, MTLK_SCAN_SUPPORT_NO_BG_SCAN); if (res != MTLK_ERR_OK) { goto ERR_END; } } /* Restart CAC-procedure */ if (wave_rcvry_restart_cac_get(hw, vap_manager)) { struct set_chan_param_data *pcpd = (struct set_chan_param_data *)wave_rcvry_chanparam_get(hw, vap_manager); wave_rcvry_restart_cac_set(hw, vap_manager, FALSE); if (NULL != pcpd) { RECOVERY_INFO("restart CAC-procedure", core_oid); /* CAC-timer will be restarted by this function */ res = core_cfg_set_chan(core, &pcpd->chandef, pcpd); if (res != MTLK_ERR_OK) {goto ERR_END;} } } } /* Continue only if NET_STATE_CONNECTED */ if (!(target_net_state & NET_STATE_CONNECTED)) { goto ERR_OK; } if (mtlk_vap_is_master(core->vap_handle)) { RECOVERY_INFO("set channel", core_oid); res = mtlk_core_rcvry_set_channel(core); if (res != MTLK_ERR_OK) {goto ERR_END;} } if (mtlk_vap_is_ap(core->vap_handle)) { /* When master VAP is used as a dummy VAP (in order to support reconf * of all VAPs without having to restart hostapd) we avoid setting beacon * so that the dummy VAPs will not send beacons */ if (WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_DISABLE_MASTER_VAP) && mtlk_vap_is_master(core->vap_handle)){ RECOVERY_INFO("Dummy (disabled) Master VAP, not setting beacon template in FW", core_oid); } else { RECOVERY_INFO("set beacon template", core_oid); res = wave_beacon_man_rcvry_beacon_set(core); if (res != MTLK_ERR_OK) {goto ERR_END;} } } RECOVERY_INFO("set bss", core_oid); res = core_recovery_cfg_change_bss(core); if (res != MTLK_ERR_OK) {goto ERR_END;} /* net state is CONNECTED */ RECOVERY_INFO("set wmm", core_oid); /*Set after state CONNECTED */ res = core_recovery_cfg_wmm_param_set(core); if (res != MTLK_ERR_OK) {goto ERR_END;} if (mtlk_vap_is_master(core->vap_handle)) { RECOVERY_INFO("Enable radio", core_oid); res = _mtlk_core_set_radio_mode_req(core, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MODE_REQUESTED)); if (res != MTLK_ERR_OK) {goto ERR_END;} /* CoC configuration */ RECOVERY_INFO("COC start", core_oid); res = mtlk_coc_on_rcvry_configure(coc_mgmt); if (res != MTLK_ERR_OK) {goto ERR_END;} active_ant_mask = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_ACTIVE_ANT_MASK); if (active_ant_mask) { RECOVERY_INFO("Active ant mask", core_oid); res = mtlk_core_cfg_send_active_ant_mask(core, active_ant_mask); if (res != MTLK_ERR_OK) {goto ERR_END;} } RECOVERY_INFO("Interference detection", core_oid); res = _mtlk_core_recover_interfdet_threshold(core); if (res != MTLK_ERR_OK) {goto ERR_END;} RECOVERY_INFO("Sync HOSTAPD STA database", core_oid); wave_core_sync_hostapd_done_set(core, FALSE); res = wv_cfg80211_handle_flush_stations(core->vap_handle, NULL, 0); if (res != MTLK_ERR_OK) {goto ERR_END;} } /* If FW crashed e.g. during SET_CHAN procedure, recovery could end up * with misaligned channel, beacons, etc. Notify hostapd to make sure * we have aligned beacons to the recovered channel */ if (is_channel_certain(current_chandef)) { _mtlk_core_rcvry_chan_switch_notify(core); } else { RECOVERY_WARN("Channel switch notification not sent because channel is uncertain", core_oid); } ERR_OK: return res; ERR_END: ELOG_DD("CID-%04x: Recovery configuration fail. res=%d", core_oid, res); return res; } /* Restore CORE's and its sub modules configuration. * This function is intended for recovery configurable * parameters only. Non configurable parameters and * variables must be set in RESTORE function. */ int __MTLK_IFUNC core_on_rcvry_configure (mtlk_core_t *core, uint32 was_connected) { int res; uint16 oid = mtlk_vap_get_oid(core->vap_handle); MTLK_UNREFERENCED_PARAM(oid); ILOG1_DDS("CID-%04x: Net State before Recovery = %d (%s)", oid, was_connected, mtlk_net_state_to_string(was_connected)); res = mtlk_mbss_send_vap_db_add(core); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Recovery VAP_DB ADD failed. res=%d", oid, res); return res; } res = _core_on_rcvry_configure(core, was_connected); if (res != MTLK_ERR_OK) { ELOG_D("CID-%04x: Recovery configuration failed", oid); } return res; } void __MTLK_IFUNC core_schedule_recovery_task (mtlk_vap_handle_t vap_handle, mtlk_core_task_func_t task, mtlk_handle_t rcvry_handle, const void* data, uint32 data_size) { /* Just wrapper to put recovery task to the serializer */ mtlk_core_t *core = mtlk_vap_get_core(vap_handle); _mtlk_process_emergency_task(core, task, rcvry_handle, data, data_size); return; } void __MTLK_IFUNC mtlk_core_store_calibration_channel_bit_map (mtlk_core_t *core, uint32 *storedCalibrationChannelBitMap) { wave_memcpy(core->storedCalibrationChannelBitMap, sizeof(core->storedCalibrationChannelBitMap), storedCalibrationChannelBitMap, sizeof(core->storedCalibrationChannelBitMap)); } static int _core_sync_done (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res; mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); if (!mtlk_vap_is_master_ap(core->vap_handle)) { ELOG_S("%s: vap not master ap", __FUNCTION__); res = MTLK_ERR_NOT_SUPPORTED; goto Exit; } wave_core_sync_hostapd_done_set(core, TRUE); ILOG1_D("CID-%04x: Recovery: Set HOSTAPD STA database synced to TRUE", mtlk_vap_get_oid(core->vap_handle)); res = MTLK_ERR_OK; Exit: return mtlk_clpb_push_res(clpb, res); } int __MTLK_IFUNC core_remove_sid(mtlk_core_t *core, uint16 sid) { int res = MTLK_ERR_OK; mtlk_vap_handle_t vap_handle = core->vap_handle; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_REMOVE_SID *umi_rem_sid; /* prepare the msg to the FW */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), &res); if (!man_entry) { ELOG_DD("CID-%04x: UM_MAN_REMOVE_SID_REQ init failed, err=%i", mtlk_vap_get_oid(vap_handle), res); return MTLK_ERR_NO_MEM; } man_entry->id = UM_MAN_REMOVE_SID_REQ; man_entry->payload_size = sizeof(UMI_REMOVE_SID); umi_rem_sid = (UMI_REMOVE_SID *) man_entry->payload; memset(umi_rem_sid, 0, sizeof(UMI_REMOVE_SID)); umi_rem_sid->u16SID = HOST_TO_MAC16(sid); mtlk_dump(2, umi_rem_sid, sizeof(UMI_REMOVE_SID), "dump of UMI_REMOVE_SID before submitting to FW:"); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); mtlk_dump(2, umi_rem_sid, sizeof(UMI_REMOVE_SID), "dump of UMI_REMOVE_SID after submitting to FW:"); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: UM_MAN_REMOVE_SID_REQ send failed, err=%i", mtlk_vap_get_oid(vap_handle), res); } else if (umi_rem_sid->u8Status) { ELOG_DD("CID-%04x: UM_MAN_REMOVE_SID_REQ execution failed, status=%hhu", mtlk_vap_get_oid(vap_handle), umi_rem_sid->u8Status); res = MTLK_ERR_MAC; } mtlk_txmm_msg_cleanup(&man_msg); return res; } uint32 __MTLK_IFUNC mtlk_core_get_sid_by_addr(mtlk_core_t *nic, uint8 *addr) { uint32 sid = DB_UNKNOWN_SID; sta_entry *sta = NULL; if (mtlk_osal_eth_is_multicast(addr)) /* Broadcast is a kind of multicast too */ { sid = TMP_BCAST_DEST_ADDR; } else { sta = mtlk_stadb_find_sta(&nic->slow_ctx->stadb, addr); if (sta) { sid = mtlk_sta_get_sid(sta); mtlk_sta_decref(sta); } } ILOG3_DY("SID is=:%d STA:%Y", sid, addr); return sid; } int core_ap_stop_traffic(struct nic *nic, sta_info *info) { int res = MTLK_ERR_OK; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_STOP_TRAFFIC *psUmiStopTraffic; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(nic->vap_handle), &res); if (!man_entry) { ELOG_D("CID-%04x: Can't send STOP_TRAFFIC request to MAC: no MAN_MSG", mtlk_vap_get_oid(nic->vap_handle)); return MTLK_ERR_NO_MEM; } man_entry->id = UM_MAN_STOP_TRAFFIC_REQ; man_entry->payload_size = sizeof(UMI_STOP_TRAFFIC); memset(man_entry->payload, 0, man_entry->payload_size); psUmiStopTraffic = (UMI_STOP_TRAFFIC *) man_entry->payload; psUmiStopTraffic->u8Status = UMI_OK; psUmiStopTraffic->u16SID = HOST_TO_MAC16(info->sid); mtlk_dump(2, psUmiStopTraffic, sizeof(UMI_STA_REMOVE), "dump of UMI_STOP_TRAFFIC:"); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't send UM_MAN_STOP_TRAFFIC_REQ request to MAC (err=%d)", mtlk_vap_get_oid(nic->vap_handle), res); goto finish; } if (psUmiStopTraffic->u8Status != UMI_OK) { WLOG_DYD("CID-%04x: Station %Y remove failed in FW (status=%u)", mtlk_vap_get_oid(nic->vap_handle), &info->addr, psUmiStopTraffic->u8Status); res = MTLK_ERR_MAC; goto finish; } ILOG1_DYD("CID-%04x: Station %Y traffic stopped (SID = %u)", mtlk_vap_get_oid(nic->vap_handle), &info->addr, info->sid); finish: mtlk_txmm_msg_cleanup(&man_msg); return res; } int core_ap_remove_sta(struct nic *nic, sta_info *info) { int res = MTLK_ERR_OK; mtlk_vap_handle_t vap_handle = nic->vap_handle; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_STA_REMOVE *psUmiStaRemove; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), &res); if (man_entry == NULL) { ELOG_D("CID-%04x: Can't send STA_REMOVE request to MAC: no MAN_MSG", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_MEM; } man_entry->id = UM_MAN_STA_REMOVE_REQ; man_entry->payload_size = sizeof(UMI_STA_REMOVE); memset(man_entry->payload, 0, man_entry->payload_size); psUmiStaRemove = (UMI_STA_REMOVE *)man_entry->payload; psUmiStaRemove->u8Status = UMI_OK; psUmiStaRemove->u16SID = HOST_TO_MAC16(info->sid); mtlk_dump(2, psUmiStaRemove, sizeof(UMI_STA_REMOVE), "dump of UMI_STA_REMOVE:"); ILOG1_DY("UMI_STA_REMOVE->u16SID: %u, %Y", MAC_TO_HOST16(psUmiStaRemove->u16SID), &info->addr); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (res != MTLK_ERR_OK) { ELOG_DD("CID-%04x: Can't send UM_MAN_STA_REMOVE_REQ request to MAC (err=%d)", mtlk_vap_get_oid(vap_handle), res); goto finish; } if (psUmiStaRemove->u8Status != UMI_OK) { WLOG_DYD("CID-%04x: Station %Y remove failed in FW (status=%u)", mtlk_vap_get_oid(vap_handle), &info->addr, psUmiStaRemove->u8Status); res = MTLK_ERR_MAC; goto finish; } ILOG1_DYD("CID-%04x: Station %Y disconnected (SID = %u)", mtlk_vap_get_oid(vap_handle), &info->addr, info->sid); finish: mtlk_txmm_msg_cleanup(&man_msg); return res; } #if MTLK_USE_DIRECTCONNECT_DP_API /* Get station ID callback */ int mtlk_core_dp_get_subif_cb (mtlk_vap_handle_t vap_handle, char *mac_addr, uint32_t *subif) { uint16 sta_id = 0; sta_entry *sta = NULL; mtlk_core_t *nic = mtlk_vap_get_core(vap_handle); uint8 vap_id = mtlk_vap_get_id(vap_handle); MTLK_ASSERT(NULL != nic); MTLK_ASSERT(NULL != nic->slow_ctx); *subif = 0; MTLK_BFIELD_SET(*subif, TX_DATA_INFO_VAPID, vap_id); if (mac_addr) { if (MESH_MODE_BACKHAUL_AP == MTLK_CORE_HOT_PATH_PDB_GET_INT(nic, CORE_DB_CORE_MESH_MODE)) { /* MultiAP: backhaul AP. * Need to return a first station from the STA_DB regardless from the MAC */ sta = mtlk_stadb_get_first_sta(&nic->slow_ctx->stadb); if (sta) { sta_id = mtlk_sta_get_sid(sta); } else { ILOG2_D("CID-%04x: backhaul AP, cannot return STA_ID", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_UNKNOWN; } ILOG2_DD("CID-%04x: backhaul AP, returned IRE STA_ID = %d", mtlk_vap_get_oid(vap_handle), sta_id); } else { /* Normal processing */ sta = mtlk_stadb_find_sta(&nic->slow_ctx->stadb, mac_addr); if (sta) { sta_id = mtlk_sta_get_sid(sta); } else { /* try searching in hostdb */ sta = mtlk_hstdb_find_sta(&nic->slow_ctx->hstdb, mac_addr); if (sta) sta_id = mtlk_sta_get_sid(sta); else { ILOG2_DY("CID-%04x: Cannot find STA_ID for MAC %Y", mtlk_vap_get_oid(vap_handle), mac_addr); return MTLK_ERR_UNKNOWN; } } ILOG2_DYD("CID-%04x: Requested MAC = %Y, returned STA_ID = %d", mtlk_vap_get_oid(vap_handle), mac_addr, sta_id); } MTLK_BFIELD_SET(*subif, TX_DATA_INFO_STAID, sta_id); mtlk_sta_decref(sta); /* De-reference of find or get_ap */ } return MTLK_ERR_OK; } #endif BOOL __MTLK_IFUNC mtlk_core_mcast_module_is_available (mtlk_core_t* nic) { return mtlk_df_ui_mcast_is_registered(mtlk_vap_get_df(nic->vap_handle)); } uint32 __MTLK_IFUNC mtlk_core_mcast_handle_grid (mtlk_core_t* nic, mtlk_mc_addr_t *mc_addr, mc_grid_action_t action, int grp_id) { mtlk_core_ui_mc_grid_action_t req; req.mc_addr = *mc_addr; req.action = action; req.grp_id = grp_id; if (MTLK_ERR_OK == mtlk_hw_set_prop(mtlk_vap_get_hwapi(nic->vap_handle), MTLK_HW_MC_GROUP_ID, &req, sizeof(req))) { if ((MCAST_GROUP_UNDEF == req.grp_id) && (MTLK_GRID_ADD == action)) { ELOG_D("CID-%04x: No free group ID", mtlk_vap_get_oid(nic->vap_handle)); } } return req.grp_id; } void __MTLK_IFUNC mtlk_core_mcast_group_id_action_serialized (mtlk_core_t* nic, mc_action_t action, int grp_id, uint8 *mac_addr, mtlk_mc_addr_t *mc_addr) { mtlk_core_ui_mc_action_t req; if (MCAST_GROUP_UNDEF == grp_id) { ILOG1_V("Group ID is not defined yet"); return; } req.action = action; req.grp_id = grp_id; ieee_addr_set(&req.sta_mac_addr, mac_addr); req.mc_addr = *mc_addr; _mtlk_process_hw_task(nic, SERIALIZABLE, _mtlk_core_mcast_group_id_action, HANDLE_T(nic), &req, sizeof(mtlk_core_ui_mc_action_t)); } int __MTLK_IFUNC mtlk_core_mcast_notify_fw (mtlk_vap_handle_t vap_handle, int action, int sta_id, int grp_id) { int res = MTLK_ERR_OK; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_MULTICAST_ACTION *pMulticastAction = NULL; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), &res); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); res = MTLK_ERR_NO_RESOURCES; goto FINISH; } man_entry->id = UM_MAN_MULTICAST_ACTION_REQ; man_entry->payload_size = sizeof(UMI_MULTICAST_ACTION); pMulticastAction = (UMI_MULTICAST_ACTION *) man_entry->payload; pMulticastAction->u8Action = (action == MTLK_MC_STA_JOIN_GROUP) ? ADD_STA_TO_MULTICAST_GROUP : REMOVE_STA_FROM_MULTICAST_GROUP; pMulticastAction->u16StaID = HOST_TO_MAC16((uint16)sta_id); pMulticastAction->u8GroupID = grp_id; ILOG1_DSD("Multicast FW action request: STA (SID=%d) %s group %d", sta_id, (action == MTLK_MC_STA_JOIN_GROUP) ? "joined" : "leaving", grp_id); mtlk_dump(1, pMulticastAction, sizeof(UMI_MULTICAST_ACTION), "dump of UMI_MULTICAST_ACTION:"); res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK != res) { ELOG_DD("CID-%04x: Multicast Action sending failure (%i)", mtlk_vap_get_oid(vap_handle), res); goto FINISH; } FINISH: if (man_entry) { mtlk_txmm_msg_cleanup(&man_msg); } return res; } void mtlk_core_on_bss_drop_tx_que_full(mtlk_core_t *core) { MTLK_ASSERT(core); mtlk_core_inc_cnt(core, MTLK_CORE_CNT_BSS_MGMT_TX_QUE_FULL); } /* QAMplus configuration */ static void _core_store_qamplus_mode (wave_radio_t *radio, const uint32 qamplus_mode) { MTLK_ASSERT(radio != NULL); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_QAMPLUS_MODE, qamplus_mode); } static int _mtlk_core_receive_qamplus_mode (mtlk_core_t *master_core, uint8 *qamplus_mode) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_QAMPLUS_ACTIVATE *mac_msg; int res = MTLK_ERR_OK; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(master_core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", mtlk_vap_get_oid(master_core->vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_QAMPLUS_ACTIVATE_REQ; man_entry->payload_size = sizeof(UMI_QAMPLUS_ACTIVATE); mac_msg = (UMI_QAMPLUS_ACTIVATE *)man_entry->payload; memset(mac_msg, 0, sizeof(*mac_msg)); mac_msg->getSetOperation = API_GET_OPERATION; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK == res) { *qamplus_mode = mac_msg->enableQAMplus; } else { ELOG_D("CID-%04x: Receive UM_MAN_QAMPLUS_ACTIVATE_REQ failed", mtlk_vap_get_oid(master_core->vap_handle)); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_qamplus_mode_req (mtlk_core_t *master_core, const uint32 qamplus_mode) { mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry; UMI_QAMPLUS_ACTIVATE *mac_msg; int res = MTLK_ERR_OK; ILOG2_DD("CID-%04x: QAMplus mode: %u", mtlk_vap_get_oid(master_core->vap_handle), qamplus_mode); /* allocate a new message */ man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(master_core->vap_handle), NULL); if (!man_entry) { ELOG_D("CID-%04x: Can not get TXMM slot", mtlk_vap_get_oid(master_core->vap_handle)); return MTLK_ERR_NO_RESOURCES; } /* fill the message data */ man_entry->id = UM_MAN_QAMPLUS_ACTIVATE_REQ; man_entry->payload_size = sizeof(UMI_QAMPLUS_ACTIVATE); mac_msg = (UMI_QAMPLUS_ACTIVATE *)man_entry->payload; memset(mac_msg, 0, sizeof(*mac_msg)); mac_msg->enableQAMplus = (uint8)qamplus_mode; /* send the message to FW */ res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); /* New structure does not contain field status */ /* cleanup the message */ mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_set_qamplus_mode (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = mtlk_core_get_master((mtlk_core_t*)hcore); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_qamplus_mode_cfg_t *qamplus_mode_cfg = NULL; uint32 qamplus_mode_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ qamplus_mode_cfg = mtlk_clpb_enum_get_next(clpb, &qamplus_mode_cfg_size); MTLK_CLPB_TRY(qamplus_mode_cfg, qamplus_mode_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* send new config to FW */ MTLK_CFG_CHECK_ITEM_AND_CALL(qamplus_mode_cfg, qamplus_mode, _mtlk_core_qamplus_mode_req, (core, qamplus_mode_cfg->qamplus_mode), res); /* store new config in internal db*/ MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(qamplus_mode_cfg, qamplus_mode, _core_store_qamplus_mode, (radio, qamplus_mode_cfg->qamplus_mode)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_qamplus_mode (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_qamplus_mode_cfg_t qamplus_mode_cfg; mtlk_core_t *master_core = mtlk_core_get_master((mtlk_core_t*)hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); MTLK_CFG_SET_ITEM_BY_FUNC(&qamplus_mode_cfg, qamplus_mode, _mtlk_core_receive_qamplus_mode, (master_core, &qamplus_mode_cfg.qamplus_mode), res); /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &qamplus_mode_cfg, sizeof(qamplus_mode_cfg)); } return res; } /* Radio configuration */ static int _mtlk_core_get_radio_mode(mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_radio_mode_cfg_t radio_mode_cfg; mtlk_core_t *master_core = mtlk_core_get_master((mtlk_core_t*)hcore); wave_radio_t *radio = wave_vap_radio_get(master_core->vap_handle); mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* read config from internal db */ MTLK_CFG_SET_ITEM(&radio_mode_cfg, radio_mode, wave_radio_mode_get(radio)) /* push result and config to clipboard*/ res = mtlk_clpb_push(clpb, &res, sizeof(res)); if (MTLK_ERR_OK == res) { res = mtlk_clpb_push(clpb, &radio_mode_cfg, sizeof(radio_mode_cfg)); } return res; } static int _mtlk_core_set_radio_mode (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = mtlk_core_get_master((mtlk_core_t*)hcore); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_radio_mode_cfg_t *radio_mode_cfg = NULL; uint32 radio_mode_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ radio_mode_cfg = mtlk_clpb_enum_get_next(clpb, &radio_mode_cfg_size); MTLK_CLPB_TRY(radio_mode_cfg, radio_mode_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* store new config in internal db*/ MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(radio_mode_cfg, radio_mode, wave_radio_mode_set, (radio, radio_mode_cfg->radio_mode)); /* send new config to FW if it is ready, if not, send it later after set bss */ MTLK_CFG_CHECK_ITEM_AND_CALL(radio_mode_cfg, radio_mode, _mtlk_core_check_and_set_radio_mode, (core, radio_mode_cfg->radio_mode), res); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } /* AMSDU NUM configuration */ inline static void __core_store_amsdu_num (mtlk_core_t *core, const uint32 htMsduInAmsdu, const uint32 vhtMsduInAmsdu, const uint32 heMsduInAmsdu) { wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); MTLK_ASSERT(radio != NULL); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_AMSDU_NUM, htMsduInAmsdu); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_AMSDU_VNUM, vhtMsduInAmsdu); WAVE_RADIO_PDB_SET_INT(radio, PARAM_DB_RADIO_AMSDU_HENUM, heMsduInAmsdu); } static int _mtlk_core_receive_amsdu_num (mtlk_core_t *core, uint32 *htMsduInAmsdu, uint32 *vhtMsduInAmsdu, uint32 *heMsduInAmsdu) { int res; mtlk_txmm_msg_t man_msg; mtlk_txmm_data_t *man_entry = NULL; UMI_MSDU_IN_AMSDU_CONFIG *pAMSDUNum = NULL; mtlk_vap_handle_t vap_handle = core->vap_handle; man_entry = mtlk_txmm_msg_init_with_empty_data(&man_msg, mtlk_vap_get_txmm(vap_handle), NULL); if (NULL == man_entry) { ELOG_D("CID-%04x: No man entry available", mtlk_vap_get_oid(vap_handle)); return MTLK_ERR_NO_RESOURCES; } man_entry->id = UM_MAN_MSDU_IN_AMSDU_CONFIG_REQ; man_entry->payload_size = sizeof(UMI_MSDU_IN_AMSDU_CONFIG); pAMSDUNum = (UMI_MSDU_IN_AMSDU_CONFIG *)(man_entry->payload); pAMSDUNum->getSetOperation = API_GET_OPERATION; res = mtlk_txmm_msg_send_blocked(&man_msg, MTLK_MM_BLOCKED_SEND_TIMEOUT); if (MTLK_ERR_OK == res) { *htMsduInAmsdu = pAMSDUNum->htMsduInAmsdu; *vhtMsduInAmsdu = pAMSDUNum->vhtMsduInAmsdu; *heMsduInAmsdu = pAMSDUNum->heMsduInAmsdu; } else { ELOG_D("CID-%04x: Receive UM_MAN_MSDU_IN_AMSDU_CONFIG_REQ failed", mtlk_vap_get_oid(vap_handle)); } mtlk_txmm_msg_cleanup(&man_msg); return res; } static int _mtlk_core_get_amsdu_num (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_amsdu_num_cfg_t amsdu_num_cfg; uint32 amsdu_num, amsdu_vnum, amsdu_henum; mtlk_core_t *core = mtlk_core_get_master((mtlk_core_t*)hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); res = _mtlk_core_receive_amsdu_num(core, &amsdu_num, &amsdu_vnum, &amsdu_henum); if (MTLK_ERR_OK == res) { MTLK_CFG_SET_ITEM(&amsdu_num_cfg, amsdu_num, amsdu_num); MTLK_CFG_SET_ITEM(&amsdu_num_cfg, amsdu_vnum, amsdu_vnum); MTLK_CFG_SET_ITEM(&amsdu_num_cfg, amsdu_henum, amsdu_henum); } /* push result and config to clipboard*/ return mtlk_clpb_push_res_data(clpb, res, &amsdu_num_cfg, sizeof(amsdu_num_cfg)); } static int _mtlk_core_check_and_set_amsdu_num (mtlk_core_t *core, uint32 htMsduInAmsdu, uint32 vhtMsduInAmsdu, uint32 heMsduInAmsdu) { if (htMsduInAmsdu > MAX_AMSDU_NUM || htMsduInAmsdu < MIN_AMSDU_NUM) { ELOG_D("Invalid htMsduInAmsdu: %d", htMsduInAmsdu); return MTLK_ERR_PARAMS; } if (vhtMsduInAmsdu > MAX_AMSDU_NUM || vhtMsduInAmsdu < MIN_AMSDU_NUM) { ELOG_D("Invalid vhtMsduInAmsdu: %d", vhtMsduInAmsdu); return MTLK_ERR_PARAMS; } if (heMsduInAmsdu > MAX_AMSDU_NUM || heMsduInAmsdu < MIN_AMSDU_NUM) { ELOG_D("Invalid heMsduInAmsdu: %d", heMsduInAmsdu); return MTLK_ERR_PARAMS; } return _mtlk_core_set_amsdu_num_req(core, htMsduInAmsdu, vhtMsduInAmsdu, heMsduInAmsdu); } static int _mtlk_core_set_amsdu_num (mtlk_handle_t hcore, const void* data, uint32 data_size) { int res = MTLK_ERR_OK; mtlk_core_t *core = mtlk_core_get_master((mtlk_core_t*)hcore); mtlk_amsdu_num_cfg_t *amsdu_num_cfg = NULL; uint32 amsdu_num_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ amsdu_num_cfg = mtlk_clpb_enum_get_next(clpb, &amsdu_num_cfg_size); MTLK_CLPB_TRY(amsdu_num_cfg, amsdu_num_cfg_size) MTLK_CFG_START_CHEK_ITEM_AND_CALL() /* send new config to FW */ MTLK_CFG_CHECK_ITEM_AND_CALL(amsdu_num_cfg, amsdu_num, _mtlk_core_check_and_set_amsdu_num, (core, amsdu_num_cfg->amsdu_num, amsdu_num_cfg->amsdu_vnum, amsdu_num_cfg->amsdu_henum), res); /* store new config in internal db*/ MTLK_CFG_CHECK_ITEM_AND_CALL_VOID(amsdu_num_cfg, amsdu_num, __core_store_amsdu_num, (core, amsdu_num_cfg->amsdu_num, amsdu_num_cfg->amsdu_vnum, amsdu_num_cfg->amsdu_henum)); MTLK_CFG_END_CHEK_ITEM_AND_CALL() MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } #ifdef CPTCFG_IWLWAV_FILTER_BLACKLISTED_BSS static BOOL _mtlk_core_blacklist_entry_exists (mtlk_core_t *nic, const IEEE_ADDR *addr) { return _mtlk_core_ieee_addr_entry_exists(nic, addr, &nic->widan_blacklist, "widan black") || _mtlk_core_ieee_addr_entry_exists(nic, addr, &nic->multi_ap_blacklist, "multi-AP black"); } #endif static BOOL _mtlk_core_blacklist_frame_drop (mtlk_core_t *nic, const IEEE_ADDR *addr, unsigned subtype, int8 rx_snr_db, BOOL isbroadcast) { struct intel_vendor_event_msg_drop prb_req_drop; ieee_addr_entry_t *entry; MTLK_HASH_ENTRY_T(ieee_addr) *h; blacklist_snr_info_t *blacklist_snr_info = NULL; /* drop all frames to STA in list without reject code */ if (_mtlk_core_ieee_addr_entry_exists(nic, addr, &nic->widan_blacklist, "widan black")) /* Widanblacklist=1, MultiAP blacklist=0 */ return TRUE; /* Check if STA is in multi AP blacklist */ mtlk_osal_lock_acquire(&nic->multi_ap_blacklist.ieee_addr_lock); h = mtlk_hash_find_ieee_addr(&nic->multi_ap_blacklist.hash, addr); mtlk_osal_lock_release(&nic->multi_ap_blacklist.ieee_addr_lock); if (h) { entry = MTLK_CONTAINER_OF(h, ieee_addr_entry_t, hentry); blacklist_snr_info = (blacklist_snr_info_t *)&entry->data[0]; if ((blacklist_snr_info->snrProbeHWM == 0) && (blacklist_snr_info->snrProbeLWM == 0)) { /* case when the client is not added by softblock */ if (subtype == MAN_TYPE_PROBE_REQ) return TRUE; return FALSE; /* report all auth, assoc requests and other */ } } else { return FALSE; } /* W=0, A=1, Prb req */ if (subtype == MAN_TYPE_PROBE_REQ) { /* In the path of unicast/bcast probe req. Check for softblock */ if ((_mtlk_core_mngmnt_softblock_notify(nic, addr, &nic->multi_ap_blacklist, "multi-AP black", rx_snr_db, isbroadcast, &prb_req_drop)) == DRV_SOFTBLOCK_ALLOW) { /* This is the case when the STA is in multi ap blacklist due to SoftBlock and thresholds allow to be processed */ return FALSE; } else { return TRUE; } } /* report all auth, assoc requests and other */ /* A=1, other msgs */ return FALSE; } static int _mtlk_core_set_softblocklist_entry (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); int res = MTLK_ERR_OK; struct intel_vendor_blacklist_cfg *softblocklist_cfg = NULL; uint32 softblocklist_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ softblocklist_cfg = mtlk_clpb_enum_get_next(clpb, &softblocklist_cfg_size); MTLK_CLPB_TRY(softblocklist_cfg, softblocklist_cfg_size) if (softblocklist_cfg->remove) { _mtlk_core_del_ieee_addr_entry(nic, &softblocklist_cfg->addr, &nic->multi_ap_blacklist, "multi-AP black", FALSE); } else { res = __mtlk_core_add_blacklist_addr_entry(nic, softblocklist_cfg, &nic->multi_ap_blacklist, "multi-AP black"); } MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_set_blacklist_entry (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *nic = HANDLE_T_PTR(mtlk_core_t, hcore); int res = MTLK_ERR_OK; struct intel_vendor_blacklist_cfg *blacklist_cfg = NULL; uint32 blacklist_cfg_size; mtlk_clpb_t *clpb = *(mtlk_clpb_t **)data; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); /* get configuration */ blacklist_cfg = mtlk_clpb_enum_get_next(clpb, &blacklist_cfg_size); MTLK_CLPB_TRY(blacklist_cfg, blacklist_cfg_size) if (blacklist_cfg->remove) { if (!is_zero_ether_addr(blacklist_cfg->addr.au8Addr)) { _mtlk_core_del_ieee_addr_entry(nic, &blacklist_cfg->addr, &nic->widan_blacklist, "widan black", FALSE); _mtlk_core_del_ieee_addr_entry(nic, &blacklist_cfg->addr, &nic->multi_ap_blacklist, "multi-AP black", FALSE); } else { _mtlk_core_flush_ieee_addr_list(nic, &nic->widan_blacklist, "widan black"); _mtlk_core_flush_ieee_addr_list(nic, &nic->multi_ap_blacklist, "multi-AP black"); } } else { if (blacklist_cfg->status == 0) { _mtlk_core_del_ieee_addr_entry(nic, &blacklist_cfg->addr, &nic->multi_ap_blacklist, "multi-AP black", FALSE); res = _mtlk_core_add_ieee_addr_entry(nic, &blacklist_cfg->addr, &nic->widan_blacklist, "widan black"); } else { _mtlk_core_del_ieee_addr_entry(nic, &blacklist_cfg->addr, &nic->widan_blacklist, "widan black", FALSE); res = __mtlk_core_add_blacklist_addr_entry(nic, blacklist_cfg, &nic->multi_ap_blacklist, "multi-AP black"); } } MTLK_CLPB_FINALLY(res) /* push result into clipboard */ return mtlk_clpb_push_res(clpb, res); MTLK_CLPB_END } static int _mtlk_core_get_blacklist_entries (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); return _mtlk_core_dump_ieee_addr_list (core, &core->widan_blacklist, "widan black", data, data_size); } static int _mtlk_core_get_station_measurements (mtlk_handle_t hcore, const void *data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; int res = MTLK_ERR_OK; IEEE_ADDR *addr; uint32 addr_size; sta_entry *sta = NULL; struct driver_sta_info sta_info; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); addr = mtlk_clpb_enum_get_next(clpb, &addr_size); MTLK_CLPB_TRY(addr, addr_size) if (!wave_core_sync_hostapd_done_get(core)) { ILOG1_D("CID-%04x: HOSTAPD STA database is not synced", mtlk_vap_get_oid(core->vap_handle)); MTLK_CLPB_EXIT(MTLK_ERR_NOT_READY); } /* find station in stadb */ sta = mtlk_stadb_find_sta(&core->slow_ctx->stadb, addr->au8Addr); if (NULL == sta) { WLOG_DY("CID-%04x: station %Y not found", mtlk_vap_get_oid(core->vap_handle), addr); MTLK_CLPB_EXIT(MTLK_ERR_UNKNOWN); } mtlk_core_get_driver_sta_info(sta, &sta_info); MTLK_CLPB_FINALLY(res) if (sta) mtlk_sta_decref(sta); return mtlk_clpb_push_res_data(clpb, res, &sta_info, sizeof(sta_info)); MTLK_CLPB_END; } static int _mtlk_core_get_vap_measurements (mtlk_handle_t hcore, const void *data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; struct driver_vap_info vap_info; _mtlk_core_get_vap_info_stats(core, &vap_info); return mtlk_clpb_push_res_data(clpb, MTLK_ERR_OK, &vap_info, sizeof(vap_info)); } static int _mtlk_core_check_4addr_mode (mtlk_handle_t hcore, const void *data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; struct vendor_check_4addr_mode check_4addr_mode; IEEE_ADDR *addr; uint32 addr_size; int res = MTLK_ERR_OK; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); addr = mtlk_clpb_enum_get_next(clpb, &addr_size); MTLK_CLPB_TRY(addr, addr_size) check_4addr_mode.sta_4addr_mode = _mtlk_core_check_static_4addr_mode(core, addr); ILOG2_DD("CID-%04x: sta_4addr_mode=%d", mtlk_vap_get_oid(core->vap_handle), check_4addr_mode.sta_4addr_mode); MTLK_CLPB_FINALLY(res) return mtlk_clpb_push_res_data(clpb, MTLK_ERR_OK, &check_4addr_mode, sizeof(check_4addr_mode)); MTLK_CLPB_END; } static int _mtlk_core_get_unconnected_station (mtlk_handle_t hcore, const void* data, uint32 data_size) { mtlk_core_t *core = HANDLE_T_PTR(mtlk_core_t, hcore); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; IEEE_ADDR *addr; sta_entry *sta = NULL; struct vendor_unconnected_sta_req_data_internal *sta_req_data; struct intel_vendor_unconnected_sta sta_res_data; unsigned sta_req_data_size; int res = MTLK_ERR_OK, res2, i; uint16 sid; sta_info info; struct mtlk_chan_def origianl_ccd; struct mtlk_chan_def cd; struct set_chan_param_data cpd; struct ieee80211_channel *c; BOOL paused_scan = FALSE; mtlk_vap_manager_t *vap_mgr = mtlk_vap_get_manager(core->vap_handle); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); wv_mac80211_t *mac80211 = wave_radio_mac80211_get(radio); mtlk_nbuf_t *nbuf_ndp = NULL; frame_head_t *wifi_header; mtlk_df_user_t *df_user; mtlk_vap_handle_t vap_handle; mtlk_core_t *caller_core, *sta_core; uint32 scan_flags; MTLK_ASSERT(sizeof(mtlk_clpb_t*) == data_size); sta_req_data = mtlk_clpb_enum_get_next(clpb, &sta_req_data_size); MTLK_CLPB_TRY(sta_req_data, sta_req_data_size) df_user = mtlk_df_user_from_wdev(sta_req_data->wdev); if (NULL == df_user) { res = MTLK_ERR_UNKNOWN; goto end; } vap_handle = mtlk_df_get_vap_handle(mtlk_df_user_get_df(df_user)); caller_core = mtlk_vap_get_core(vap_handle); memset(&cd, 0, sizeof(cd)); memset(&sta_res_data, 0, sizeof(sta_res_data)); sta_res_data.addr = sta_req_data->addr; for (i = 0; i < ARRAY_SIZE(sta_res_data.rssi); i++) sta_res_data.rssi[i] = MIN_RSSI; c = ieee80211_get_channel(sta_req_data->wdev->wiphy, sta_req_data->center_freq); if (!c) { ELOG_DD("CID-%04x: Getting channel structure for frequency %d MHz failed", mtlk_vap_get_oid(core->vap_handle), sta_req_data->center_freq); res = MTLK_ERR_PARAMS; goto end; } cd.chan.band = nlband2mtlkband(c->band); if (mtlk_core_is_band_supported(core, cd.chan.band) != MTLK_ERR_OK) { ELOG_DD("CID-%04x: HW does not support band %i", mtlk_vap_get_oid(core->vap_handle), cd.chan.band); res = MTLK_ERR_NOT_SUPPORTED; goto end; } scan_flags = wave_radio_scan_flags_get(radio); if (wave_radio_scan_is_running(radio)) { if (!(scan_flags & SDF_BACKGROUND)) { ELOG_V("Cannot change channels in the middle of a non-BG scan"); res = MTLK_ERR_BUSY; goto end; } else if (!(scan_flags & SDF_BG_BREAK)) /* background scan and not on a break at the moment */ { ILOG0_V("Background scan encountered, so pausing it first"); if ((res = pause_or_prevent_scan(core)) != MTLK_ERR_OK) { ELOG_V("Scan is already paused/prevented, canceling the channel switch"); goto end; } paused_scan = TRUE; } else ILOG0_V("Background scan during its break encountered, so changing the channel"); } /* find station in stadb of any VAP */ addr = &sta_req_data->addr; sta = mtlk_vap_manager_find_sta(core, &sta_core, addr); if (NULL != sta) { WLOG_DYD("CID-%04x: station %Y already connected to CID-%04x", mtlk_vap_get_oid(caller_core->vap_handle), addr->au8Addr, mtlk_vap_get_oid(sta_core->vap_handle)); res = MTLK_ERR_ALREADY_EXISTS; goto end; } if (wv_mac80211_has_sta_connections(mac80211)) { nbuf_ndp = mtlk_df_nbuf_alloc(sizeof(frame_head_t)); if (!nbuf_ndp) { ELOG_D("CID-%04x: Unable to allocate buffer for Null Data Packet", mtlk_vap_get_oid(caller_core->vap_handle)); res = MTLK_ERR_UNKNOWN; goto end; } wifi_header = (frame_head_t *) nbuf_ndp->data; memset(wifi_header, 0, sizeof(*wifi_header)); wifi_header->frame_control = HOST_TO_WLAN16(IEEE80211_STYPE_NULLFUNC | IEEE80211_FTYPE_DATA); res = wv_mac80211_NDP_send_to_all_APs(mac80211, nbuf_ndp, TRUE, TRUE); if (res != MTLK_ERR_OK) { ELOG_DDS("CID-%04x: sending NDP failed with error %d (%s)", mtlk_vap_get_oid(caller_core->vap_handle), res, mtlk_get_error_text(res)); if (res == MTLK_ERR_TIMEOUT) wv_mac80211_NDP_send_to_all_APs(mac80211, nbuf_ndp, FALSE, FALSE); goto end; } } /* get SID */ res = core_cfg_internal_request_sid(caller_core, addr, &sid); if (res != MTLK_ERR_OK) goto end; /* add station */ memset(&info, 0, sizeof(info)); info.sid = sid; info.aid = sid + 1; info.addr = *addr; info.rates[0] = MTLK_CORE_WIDAN_UNCONNECTED_STATION_RATE; info.supported_rates_len = sizeof(info.rates[0]); MTLK_BFIELD_SET(info.flags, STA_FLAGS_WMM, 1); MTLK_BFIELD_SET(info.flags, STA_FLAGS_IS_8021X_FILTER_OPEN, 1); /* RSSI in ADD STA should be set to MIN value */ info.rssi_dbm = MIN_RSSI - _mtlk_core_get_rrsi_offs(caller_core); res = _mtlk_core_ap_add_sta_req(caller_core, &info); if (res != MTLK_ERR_OK) goto remove_sid; /* add station to stadb */ sta = _mtlk_core_add_sta(caller_core, addr, &info); if (sta == NULL) { res = MTLK_ERR_UNKNOWN; goto remove_sta; } /* may not do set_chan unless there has been a VAP activated */ if (0 == mtlk_vap_manager_get_active_vaps_number(vap_mgr) && ((res = mtlk_mbss_send_vap_activate(core, cd.chan.band)) != MTLK_ERR_OK)) { ELOG_D("Could not activate the master VAP, err=%i", res); goto remove_sta; } /* save original channel definition for restoring it afterwards */ origianl_ccd = *__wave_core_chandef_get(core); cd.center_freq1 = sta_req_data->cf1; cd.center_freq2 = sta_req_data->cf2; cd.width = nlcw2mtlkcw(sta_req_data->chan_width); cd.chan.center_freq = sta_req_data->center_freq; memset(&cpd, 0, sizeof(cpd)); cpd.switch_type = ST_RSSI; cpd.bg_scan = core_cfg_channels_overlap(&origianl_ccd, &cd) ? 0 : SDF_RUNNING; cpd.sid = sid; res = core_cfg_send_set_chan(core, &cd, &cpd); if (res != MTLK_ERR_OK) goto remove_sta; mtlk_osal_msleep(WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_UNCONNECTED_STA_SCAN_TIME)); memset(&cpd, 0, sizeof(cpd)); cpd.switch_type = ST_NORMAL_AFTER_RSSI; cpd.sid = sid; res = core_cfg_send_set_chan(core, &origianl_ccd, &cpd); if (res != MTLK_ERR_OK) goto remove_sta; if (nbuf_ndp) wv_mac80211_NDP_send_to_all_APs(mac80211, nbuf_ndp, FALSE, FALSE); for(i = 0; i < ARRAY_SIZE(cpd.rssi); i++) { cpd.rssi[i] = mtlk_stadb_apply_rssi_offset(cpd.rssi[i], _mtlk_core_get_rrsi_offs(core)); } /* Get MHI Statistics */ #ifdef MTLK_LEGACY_STATISTICS _mtlk_core_mac_get_mhi_stats(caller_core, mtlk_vap_get_hw(caller_core->vap_handle)); #else _mtlk_core_get_statistics(caller_core, mtlk_vap_get_hw(caller_core->vap_handle)); #endif _mtlk_core_mac_update_peers_stats(caller_core); sta_res_data.rx_bytes = mtlk_sta_get_stat_cntr_rx_bytes(sta); sta_res_data.rx_packets = mtlk_sta_get_stat_cntr_rx_frames(sta); wave_memcpy(sta_res_data.rssi, sizeof(sta_res_data.rssi), cpd.rssi, sizeof(cpd.rssi)); sta_res_data.rate = MTLK_BITRATE_TO_MBPS(cpd.rate); MTLK_STATIC_ASSERT(ARRAY_SIZE(cpd.noise) == ARRAY_SIZE(cpd.rf_gain)); MTLK_STATIC_ASSERT(ARRAY_SIZE(cpd.rf_gain) == ARRAY_SIZE(sta_res_data.noise)); if ((ARRAY_SIZE(cpd.noise) != ARRAY_SIZE(cpd.rf_gain)) || (ARRAY_SIZE(cpd.rf_gain) != ARRAY_SIZE(sta_res_data.noise))) { ELOG_V("Noise and RF Gain arrays not equal size"); goto remove_sta; } for (i = 0; i < ARRAY_SIZE(cpd.noise); i++) { sta_res_data.noise[i] = mtlk_hw_noise_phy_to_noise_dbm(mtlk_vap_get_hw(core->vap_handle), cpd.noise[i], cpd.rf_gain[i]); } remove_sta: /* Send Stop Traffic Request to FW */ if (sta) core_ap_stop_traffic(caller_core, &sta->info); core_ap_remove_sta(caller_core, &info); if (sta) mtlk_stadb_remove_sta(&caller_core->slow_ctx->stadb, sta); remove_sid: core_remove_sid(caller_core, sid); end: if (paused_scan) { ILOG0_V("Resuming the paused scan"); resume_or_allow_scan(core); } if (nbuf_ndp) mtlk_df_nbuf_free(nbuf_ndp); if (sta) mtlk_sta_decref(sta); /* De-reference by creator */ res2 = wv_cfg80211_handle_get_unconnected_sta(sta_req_data->wdev, &sta_res_data, sizeof(sta_res_data)); MTLK_CLPB_FINALLY(res) return res != MTLK_ERR_OK ? res : res2; MTLK_CLPB_END } /* Radio has to be ON for set channel, calibrate request, CoC and temperature */ int __MTLK_IFUNC mtlk_core_radio_enable_if_needed(mtlk_core_t *core) { int res = MTLK_ERR_OK; mtlk_core_t* master_core = mtlk_core_get_master(core); wave_radio_t *radio = wave_vap_radio_get(master_core->vap_handle); if (WAVE_RADIO_OFF == WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MODE_CURRENT)) { res = _mtlk_core_set_radio_mode_req(master_core, WAVE_RADIO_ON); if (MTLK_ERR_OK != res) { ELOG_V("Failed to enable radio"); } } return res; } int __MTLK_IFUNC mtlk_core_radio_disable_if_needed(mtlk_core_t *core) { int res = MTLK_ERR_OK; mtlk_core_t* master_core = mtlk_core_get_master(core); wave_radio_t *radio = wave_vap_radio_get(master_core->vap_handle); if (mtlk_core_is_block_tx_mode(master_core)) { ILOG2_V("Waiting for beacons"); return MTLK_ERR_OK; } /* will be disabled after scan */ if (mtlk_core_scan_is_running(master_core) || mtlk_core_is_in_scan_mode(master_core)) { ILOG2_V("Is in scan mode"); return MTLK_ERR_OK; } if (ST_RSSI == __wave_core_chan_switch_type_get(core)) { ILOG2_V("Is in ST_RSSI channel switch mode"); return MTLK_ERR_OK; } if ((WAVE_RADIO_ON == WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MODE_CURRENT)) && (WAVE_RADIO_OFF == WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_MODE_REQUESTED))) { res = _mtlk_core_set_radio_mode_req(master_core, WAVE_RADIO_OFF); if (MTLK_ERR_OK != res) { ELOG_V("Failed to disable radio"); } } return res; } static int _mtlk_core_get_radio_info (mtlk_handle_t hcore, const void *data, uint32 data_size) { mtlk_core_t *core = mtlk_core_get_master((mtlk_core_t*)hcore); wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); mtlk_clpb_t *clpb = *(mtlk_clpb_t **) data; int res = MTLK_ERR_OK; struct driver_radio_info radio_info; mtlk_tx_power_data_t tx_pw_data; mtlk_coc_antenna_cfg_t *current_params; mtlk_coc_t *coc_mgmt = __wave_core_coc_mgmt_get(core); struct mtlk_chan_def cd; memset(&radio_info, 0, sizeof(radio_info)); #if defined(CPTCFG_IWLWAV_TSF_TIMER_ACCESS_ENABLED) radio_info.tsf_start_time = mtlk_hw_get_timestamp(core->vap_handle); #endif _mtlk_core_get_tr181_hw(core, &radio_info.tr181_hw); wave_radio_get_tr181_hw_stats(radio, &radio_info.tr181_hw_stats); radio_info.load = wave_radio_channel_load_get(radio); mtlk_core_get_tx_power_data(core, &tx_pw_data); radio_info.tx_pwr_cfg = POWER_TO_MBM(tx_pw_data.pw_targets[tx_pw_data.cur_cbw]); current_params = mtlk_coc_get_current_params(coc_mgmt); radio_info.num_tx_antennas = current_params->num_tx_antennas; radio_info.num_rx_antennas = current_params->num_rx_antennas; /* Note: this info could have been changing while we copied it and * we won't necessarily catch it with the is_channel_certain() trick. */ cd = *__wave_core_chandef_get(core); if (is_channel_certain(&cd)) { radio_info.primary_center_freq = cd.chan.center_freq; radio_info.center_freq1 = cd.center_freq1; radio_info.center_freq2 = cd.center_freq2; radio_info.width = MHZS_PER_20MHZ << cd.width; } return mtlk_clpb_push_res_data(clpb, res, &radio_info, sizeof(radio_info)); } int fill_channel_data (mtlk_core_t *core, struct intel_vendor_channel_data *ch_data) { mtlk_core_t* master_core = mtlk_core_get_master(core); const struct mtlk_chan_def *cd = __wave_core_chandef_get(master_core); uint8 sec_offset; int res; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); memset(ch_data, 0, sizeof(*ch_data)); ch_data->channel = WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_CHANNEL_CUR); switch (WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_SPECTRUM_MODE)) { case CW_20: ch_data->BW = 20; break; case CW_40: ch_data->BW = 40; break; case CW_80: ch_data->BW = 80; break; case CW_160:ch_data->BW = 160; break; case CW_80_80: ch_data->BW = -160; break; default: MTLK_ASSERT(0); } ch_data->primary = ch_data->channel; switch (WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_BONDING_MODE)) { case ALTERNATE_UPPER: sec_offset = UMI_CHANNEL_SW_MODE_SCA; break; case ALTERNATE_LOWER: sec_offset = UMI_CHANNEL_SW_MODE_SCB; break; case ALTERNATE_NONE: sec_offset = UMI_CHANNEL_SW_MODE_SCN; break; default: sec_offset = UMI_CHANNEL_SW_MODE_SCN; break; } ch_data->secondary = mtlk_channels_get_secondary_channel_no_by_offset(ch_data->primary, sec_offset); ch_data->freq = channel_to_frequency(freq2lowchannum(cd->center_freq1, cd->width)); res = scan_get_aocs_info(core, ch_data, NULL); ch_data->total_time = 255; ch_data->filled_mask |= CHDATA_TOTAL_TIME; return res; } #ifdef MTLK_LEGACY_STATISTICS static void _mtlk_core_get_traffic_wlan_stats(mtlk_core_t* core, mtlk_wssa_drv_traffic_stats_t* stats) { stats->UnicastPacketsSent = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_UNICAST_FRAMES); stats->UnicastPacketsReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_UNICAST_FRAMES); stats->MulticastPacketsSent = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_MULTICAST_FRAMES); stats->MulticastPacketsReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_MULTICAST_FRAMES); stats->BroadcastPacketsSent = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_BROADCAST_FRAMES); stats->BroadcastPacketsReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_BROADCAST_FRAMES); #if 1 /* 64-bit accumulated values */ stats->PacketsSent = _mtlk_core_get_vap_stat64(core, STAT64_VAP_TX_FRAMES); stats->PacketsReceived = _mtlk_core_get_vap_stat64(core, STAT64_VAP_RX_FRAMES); stats->BytesSent = _mtlk_core_get_vap_stat64(core, STAT64_VAP_TX_BYTES); stats->BytesReceived = _mtlk_core_get_vap_stat64(core, STAT64_VAP_RX_BYTES); #else /* 32-bit values*/ stats->PacketsSent = stats->UnicastPacketsSent + stats->MulticastPacketsSent + stats->BroadcastPacketsSent; stats->PacketsReceived = stats->UnicastPacketsReceived + stats->MulticastPacketsReceived + stats->BroadcastPacketsReceived; stats->BytesSent = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_UNICAST_BYTES) + _mtlk_core_get_vap_stat(core, STAT_VAP_TX_MULTICAST_BYTES) + _mtlk_core_get_vap_stat(core, STAT_VAP_TX_BROADCAST_BYTES); stats->BytesReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_UNICAST_BYTES) + _mtlk_core_get_vap_stat(core, STAT_VAP_RX_MULTICAST_BYTES) + _mtlk_core_get_vap_stat(core, STAT_VAP_RX_BROADCAST_BYTES); #endif } static void _mtlk_core_get_mgmt_wlan_stats(mtlk_core_t *core, mtlk_wssa_drv_mgmt_stats_t *stats) { stats->MANFramesResQueue = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_RES_QUEUE); stats->MANFramesSent = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_SENT); stats->MANFramesConfirmed = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_CONFIRMED); stats->MANFramesReceived = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_RECEIVED); stats->MANFramesRetryDropped = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_RX_MAN_FRAMES_RETRY_DROPPED); stats->ProbeRespSent = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PROBE_RESP_SENT); stats->ProbeRespDropped = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PROBE_RESP_DROPPED); stats->BssMgmtTxQueFull = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_BSS_MGMT_TX_QUE_FULL); } static void _mtlk_core_get_wlan_stats(mtlk_core_t* core, mtlk_wssa_drv_wlan_stats_t* stats) { /* minimal statistic */ _mtlk_core_get_tr181_wlan_stats(core, &stats->tr181_stats); _mtlk_core_get_mgmt_wlan_stats(core, &stats->mgmt_stats); } #if MTLK_MTIDL_WLAN_STAT_FULL static void _mtlk_core_get_debug_wlan_stats(mtlk_core_t* core, mtlk_wssa_drv_debug_wlan_stats_t* stats) { /* minimal statistic */ stats->UnicastPacketsSent = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_UNICAST_FRAMES); stats->UnicastPacketsReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_UNICAST_FRAMES); stats->MulticastPacketsSent = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_MULTICAST_FRAMES); stats->MulticastPacketsReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_MULTICAST_FRAMES); stats->BroadcastPacketsSent = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_BROADCAST_FRAMES); stats->BroadcastPacketsReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_BROADCAST_FRAMES); #if 1 /* 64-bit accumulated values */ stats->TxPacketsSucceeded = _mtlk_core_get_vap_stat64(core, STAT64_VAP_TX_FRAMES); stats->RxPacketsSucceeded = _mtlk_core_get_vap_stat64(core, STAT64_VAP_RX_FRAMES); stats->TxBytesSucceeded = _mtlk_core_get_vap_stat64(core, STAT64_VAP_TX_BYTES); stats->RxBytesSucceeded = _mtlk_core_get_vap_stat64(core, STAT64_VAP_RX_BYTES); #else /* 32-bit values */ stats->TxPacketsSucceeded = stats->UnicastPacketsSent + stats->MulticastPacketsSent + stats->BroadcastPacketsSent; stats->RxPacketsSucceeded = stats->UnicastPacketsReceived + stats->MulticastPacketsReceived + stats->BroadcastPacketsReceived; stats->TxBytesSucceeded = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_UNICAST_BYTES) + _mtlk_core_get_vap_stat(core, STAT_VAP_TX_MULTICAST_BYTES) + _mtlk_core_get_vap_stat(core, STAT_VAP_TX_BROADCAST_BYTES); stats->RxBytesSucceeded = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_UNICAST_BYTES) + _mtlk_core_get_vap_stat(core, STAT_VAP_RX_MULTICAST_BYTES) + _mtlk_core_get_vap_stat(core, STAT_VAP_RX_BROADCAST_BYTES); #endif /* full statistic */ stats->MulticastBytesSent = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MULTICAST_BYTES_SENT); stats->MulticastBytesReceived = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MULTICAST_BYTES_RECEIVED); stats->BroadcastBytesSent = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_BROADCAST_BYTES_SENT); stats->BroadcastBytesReceived = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_BROADCAST_BYTES_RECEIVED); stats->RxPacketsDiscardedDrvTooOld = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_RX_PACKETS_DISCARDED_DRV_TOO_OLD); stats->RxPacketsDiscardedDrvDuplicate = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_RX_PACKETS_DISCARDED_DRV_DUPLICATE); stats->TxPacketsDiscardedDrvNoPeers = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_NO_PEERS); stats->TxPacketsDiscardedDrvACM = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_ACM); stats->TxPacketsDiscardedEapolCloned = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_EAPOL_CLONED); stats->TxPacketsDiscardedDrvUnknownDestinationDirected = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_UNKNOWN_DESTINATION_DIRECTED); stats->TxPacketsDiscardedDrvUnknownDestinationMcast = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_UNKNOWN_DESTINATION_MCAST); stats->TxPacketsDiscardedDrvNoResources = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DRV_NO_RESOURCES); stats->TxPacketsDiscardedDrvSQOverflow = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_SQ_OVERFLOW); stats->TxPacketsDiscardedDrvEAPOLFilter = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_EAPOL_FILTER); stats->TxPacketsDiscardedDrvDropAllFilter = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_DROP_ALL_FILTER); stats->TxPacketsDiscardedDrvTXQueueOverflow = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PACKETS_DISCARDED_TX_QUEUE_OVERFLOW); stats->RxPackets802_1x = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_802_1X_PACKETS_RECEIVED); stats->TxPackets802_1x = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_802_1X_PACKETS_SENT); stats->TxDiscardedPackets802_1x = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_802_1X_PACKETS_DISCARDED); stats->PairwiseMICFailurePackets = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_PAIRWISE_MIC_FAILURE_PACKETS); stats->GroupMICFailurePackets = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_GROUP_MIC_FAILURE_PACKETS); stats->UnicastReplayedPackets = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_UNICAST_REPLAYED_PACKETS); stats->MulticastReplayedPackets = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MULTICAST_REPLAYED_PACKETS); stats->ManagementReplayedPackets = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MANAGEMENT_REPLAYED_PACKETS); stats->FwdRxPackets = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_FWD_RX_PACKETS); stats->FwdRxBytes = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_FWD_RX_BYTES); stats->DATFramesReceived = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_DAT_FRAMES_RECEIVED); stats->CTLFramesReceived = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_CTL_FRAMES_RECEIVED); stats->MANFramesResQueue = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_RES_QUEUE); stats->MANFramesSent = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_SENT); stats->MANFramesConfirmed = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_CONFIRMED); stats->MANFramesReceived = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_RECEIVED); stats->MANFramesRetryDropped = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_RX_MAN_FRAMES_RETRY_DROPPED); stats->MANFramesRejectedCfg80211 = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_MAN_FRAMES_CFG80211_FAILED); stats->ProbeRespSent = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PROBE_RESP_SENT); stats->ProbeRespDropped = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_TX_PROBE_RESP_DROPPED); stats->BssMgmtTxQueFull = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_BSS_MGMT_TX_QUE_FULL); stats->CoexElReceived = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_COEX_EL_RECEIVED); stats->ScanExRequested = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_COEX_EL_SCAN_EXEMPTION_REQUESTED); stats->ScanExGranted = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_COEX_EL_SCAN_EXEMPTION_GRANTED); stats->ScanExGrantCancelled = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_COEX_EL_SCAN_EXEMPTION_GRANT_CANCELLED); stats->SwitchChannel20To40 = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_CHANNEL_SWITCH_20_TO_40); stats->SwitchChannel40To20 = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_CHANNEL_SWITCH_40_TO_20); stats->SwitchChannel40To40 = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_CHANNEL_SWITCH_40_TO_40); stats->TxPacketsToUnicastNoDGAF = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_TX_PACKETS_TO_UNICAST_DGAF_DISABLED); stats->TxPacketsSkippedNoDGAF = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_TX_PACKETS_SKIPPED_DGAF_DISABLED); } #endif /* MTLK_MTIDL_WLAN_STAT_FULL */ static void _mtlk_core_get_tr181_error_stats (mtlk_core_t* core, mtlk_wssa_drv_tr181_error_stats_t* errors) { errors->ErrorsSent = _mtlk_core_get_vap_stat(core, STAT_VAP_TX_AGER_COUNT); errors->ErrorsReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_DROP_MPDU); errors->DiscardPacketsReceived = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_DISCARD_PACKETS_RECEIVED); errors->DiscardPacketsSent = errors->ErrorsSent; } static void _mtlk_core_get_tr181_retrans_stats (mtlk_core_t* core, mtlk_wssa_retrans_stats_t* retrans) { retrans->Retransmissions = 0; /* Not available in FW so far */ retrans->FailedRetransCount = 0; /* Never drop packets due to retry limit */ retrans->RetransCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMIT_STREAM_RPRT_MULTIPLE_RETRY_COUNT); retrans->RetryCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_RETRY_AMSDU); retrans->MultipleRetryCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_MULTIPLE_RETRY_AMSDU); } static void _mtlk_core_get_tr181_wlan_stats (mtlk_core_t* core, mtlk_wssa_drv_tr181_wlan_stats_t* stats) { _mtlk_core_get_traffic_wlan_stats(core, &stats->traffic_stats); _mtlk_core_get_tr181_error_stats(core, &stats->error_stats); _mtlk_core_get_tr181_retrans_stats(core, &stats->retrans_stats); stats->UnknownProtoPacketsReceived = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_MPDU_TYPE_NOTSUPPORTED); stats->ACKFailureCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_ACK_FAILURE); stats->AggregatedPacketCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMITTED_AMSDU); } static void _mtlk_core_get_vap_info_stats(mtlk_core_t* core, struct driver_vap_info *vap_info) { _mtlk_core_get_tr181_wlan_stats(core, &vap_info->vap_stats); /* todo: These 4 counters are 64-bit, but actual values are 32-bit. Check * if 64 bit values are needed and implement. */ vap_info->TransmittedOctetsInAMSDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMITTED_OCTETS_IN_AMSDU); vap_info->ReceivedOctetsInAMSDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_AMSDU_BYTES); vap_info->TransmittedOctetsInAMPDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMITTED_OCTETS_IN_AMPDU); vap_info->ReceivedOctetsInAMPDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_OCTETS_IN_AMPDU); vap_info->RTSSuccessCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_RTS_SUCCESS_COUNT); vap_info->RTSFailureCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_RTS_FAILURE); vap_info->TransmittedAMSDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMITTED_AMSDU); vap_info->FailedAMSDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_FAILED_AMSDU); vap_info->AMSDUAckFailureCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_AMSDU_ACK_FAILURE); vap_info->ReceivedAMSDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_AMSDU); vap_info->TransmittedAMPDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMITTED_AMPDU); vap_info->TransmittedMPDUsInAMPDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMITTED_MPDU_IN_AMPDU); vap_info->AMPDUReceivedCount = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_AMPDU); vap_info->MPDUInReceivedAMPDUCount = _mtlk_core_get_vap_stat(core, STAT_VAP_RX_MPDUIN_AMPDU); vap_info->ImplicitBARFailureCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_IMPLICIT_BAR_FAILURE); vap_info->ExplicitBARFailureCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_EXPLICIT_BAR_FAILURE); vap_info->TwentyMHzFrameTransmittedCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMIT_BW20); vap_info->FortyMHzFrameTransmittedCount = _mtlk_core_get_vap_stat(core, STAT_VAP_BAA_TRANSMIT_BW40); vap_info->SwitchChannel20To40 = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_CHANNEL_SWITCH_20_TO_40); vap_info->SwitchChannel40To20 = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_CHANNEL_SWITCH_40_TO_20); vap_info->FrameDuplicateCount = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_RX_PACKETS_DISCARDED_DRV_DUPLICATE); } #else /* MTLK_LEGACY_STATISTICS */ static void _mtlk_core_get_traffic_wlan_stats (mtlk_core_t* core, mtlk_wssa_drv_traffic_stats_t* stats) { mtlk_mhi_stats_vap_t *mhi_vap_stats; MTLK_ASSERT((core) || (stats)); mhi_vap_stats = &core->mhi_vap_stat; /* 64-bit accumulated values */ stats->PacketsSent = mhi_vap_stats->stats64.txFrames; stats->PacketsReceived = mhi_vap_stats->stats64.rxFrames; stats->BytesSent = mhi_vap_stats->stats64.txBytes; stats->BytesReceived = mhi_vap_stats->stats64.rxBytes; stats->UnicastPacketsSent = mhi_vap_stats->stats.txInUnicastHd; stats->UnicastPacketsReceived = mhi_vap_stats->stats.rxOutUnicastHd; stats->MulticastPacketsSent = mhi_vap_stats->stats.txInMulticastHd; stats->MulticastPacketsReceived = mhi_vap_stats->stats.rxOutMulticastHd; stats->BroadcastPacketsSent = mhi_vap_stats->stats.txInBroadcastHd; stats->BroadcastPacketsReceived = mhi_vap_stats->stats.rxOutBroadcastHd; } static void _mtlk_core_get_tr181_hw (mtlk_core_t* core, mtlk_wssa_drv_tr181_hw_t* tr181_hw) { wave_radio_t *radio; MTLK_ASSERT((core) || (tr181_hw)); radio = wave_vap_radio_get(core->vap_handle); tr181_hw->Enable = wave_radio_mode_get(radio); tr181_hw->Channel = _mtlk_core_get_channel(core); } static void _mtlk_core_get_tr181_error_stats (mtlk_core_t* core, mtlk_wssa_drv_tr181_error_stats_t* errors) { mtlk_mhi_stats_vap_t *mhi_vap_stats; MTLK_ASSERT((core) || (errors)); mhi_vap_stats = &core->mhi_vap_stat; errors->ErrorsSent = mhi_vap_stats->stats.agerCount; errors->ErrorsReceived = mhi_vap_stats->stats.dropMpdu; errors->DiscardPacketsReceived = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_DISCARD_PACKETS_RECEIVED); errors->DiscardPacketsSent = errors->ErrorsSent; } static void _mtlk_core_get_tr181_retrans_stats (mtlk_core_t* core, mtlk_wssa_retrans_stats_t* retrans) { mtlk_mhi_stats_vap_t *mhi_vap_stats; MTLK_ASSERT((core) || (retrans)); mhi_vap_stats = &core->mhi_vap_stat; retrans->Retransmissions = 0; /* Not available in FW so far */ retrans->FailedRetransCount = 0; /* Never drop packets due to retry limit */ retrans->RetransCount = mhi_vap_stats->stats.transmitStreamRprtMultipleRetryCount; retrans->RetryCount = mhi_vap_stats->stats.retryAmsdu; retrans->MultipleRetryCount = mhi_vap_stats->stats.multipleRetryAmsdu; } void __MTLK_IFUNC mtlk_core_get_tr181_wlan_stats (mtlk_core_t* core, mtlk_wssa_drv_tr181_wlan_stats_t* stats) { mtlk_mhi_stats_vap_t *mhi_vap_stats; MTLK_ASSERT((core) || (stats)); mhi_vap_stats = &core->mhi_vap_stat; _mtlk_core_get_traffic_wlan_stats(core, &stats->traffic_stats); _mtlk_core_get_tr181_error_stats(core, &stats->error_stats); _mtlk_core_get_tr181_retrans_stats(core, &stats->retrans_stats); stats->UnknownProtoPacketsReceived = mhi_vap_stats->stats.mpduTypeNotSupported; stats->ACKFailureCount = mhi_vap_stats->stats.ackFailure; stats->AggregatedPacketCount = mhi_vap_stats->stats.transmittedAmsdu; } static void _mtlk_core_get_vap_info_stats (mtlk_core_t* core, struct driver_vap_info *vap_info) { mtlk_mhi_stats_vap_t *mhi_vap_stats; MTLK_ASSERT((core) || (vap_info)); mhi_vap_stats = &core->mhi_vap_stat; mtlk_core_get_tr181_wlan_stats(core, &vap_info->vap_stats); /* todo: These 4 counters are 64-bit, but actual values are 32-bit. Check * if 64 bit values are needed and implement. */ vap_info->TransmittedOctetsInAMSDUCount = mhi_vap_stats->stats.transmittedOctetsInAmsdu; vap_info->ReceivedOctetsInAMSDUCount = mhi_vap_stats->stats.amsduBytes; vap_info->TransmittedOctetsInAMPDUCount = mhi_vap_stats->stats.transmittedOctetsInAmpdu; vap_info->ReceivedOctetsInAMPDUCount = mhi_vap_stats->stats.octetsInAmpdu; vap_info->RTSSuccessCount = mhi_vap_stats->stats.rtsSuccessCount; vap_info->RTSFailureCount = mhi_vap_stats->stats.rtsFailure; vap_info->TransmittedAMSDUCount = mhi_vap_stats->stats.transmittedAmsdu; vap_info->FailedAMSDUCount = mhi_vap_stats->stats.failedAmsdu; vap_info->AMSDUAckFailureCount = mhi_vap_stats->stats.amsduAckFailure; vap_info->ReceivedAMSDUCount = mhi_vap_stats->stats.amsdu; vap_info->TransmittedAMPDUCount = mhi_vap_stats->stats.transmittedAmpdu; vap_info->TransmittedMPDUsInAMPDUCount = mhi_vap_stats->stats.transmittedMpduInAmpdu; vap_info->AMPDUReceivedCount = mhi_vap_stats->stats.ampdu; vap_info->MPDUInReceivedAMPDUCount = mhi_vap_stats->stats.mpduInAmpdu; vap_info->ImplicitBARFailureCount = mhi_vap_stats->stats.implicitBarFailure; vap_info->ExplicitBARFailureCount = mhi_vap_stats->stats.explicitBarFailure; vap_info->TwentyMHzFrameTransmittedCount = mhi_vap_stats->stats.transmitBw20; vap_info->FortyMHzFrameTransmittedCount = mhi_vap_stats->stats.transmitBw40; vap_info->SwitchChannel20To40 = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_CHANNEL_SWITCH_20_TO_40); vap_info->SwitchChannel40To20 = _mtlk_core_get_cnt(mtlk_core_get_master(core), MTLK_CORE_CNT_CHANNEL_SWITCH_40_TO_20); vap_info->FrameDuplicateCount = _mtlk_core_get_cnt(core, MTLK_CORE_CNT_RX_PACKETS_DISCARDED_DRV_DUPLICATE); } #endif /* MTLK_LEGACY_STATISTICS */ int __MTLK_IFUNC mtlk_core_send_iwpriv_config_to_fw (mtlk_core_t *core) { int res = MTLK_ERR_OK; wave_radio_t *radio = wave_vap_radio_get(core->vap_handle); if (mtlk_vap_is_master(core->vap_handle)) { res = _mtlk_core_set_radar_detect(core, WAVE_RADIO_PDB_GET_INT(radio, PARAM_DB_RADIO_DFS_RADAR_DETECTION)); if (MTLK_ERR_OK != res) goto end; res = mtlk_core_cfg_init_cca_threshold(core); } end: return res; }
38.025488
276
0.714149
[ "object", "model", "3d" ]
a0d980a5798a6ecbe0c249df26b5da1d15a96ef6
4,042
h
C
Converter/include/converter_utils.h
joaori/PotreeConverter
aeefe3c007ba4687827e997855957f84e3107ab4
[ "BSD-2-Clause" ]
468
2015-01-21T19:38:59.000Z
2022-03-31T07:51:37.000Z
Converter/include/converter_utils.h
joaori/PotreeConverter
aeefe3c007ba4687827e997855957f84e3107ab4
[ "BSD-2-Clause" ]
421
2015-01-02T07:20:09.000Z
2022-03-30T10:44:28.000Z
Converter/include/converter_utils.h
joaori/PotreeConverter
aeefe3c007ba4687827e997855957f84e3107ab4
[ "BSD-2-Clause" ]
356
2015-02-05T13:40:19.000Z
2022-03-23T18:16:09.000Z
#pragma once #include <memory> #include <string> #include <iostream> #include <fstream> #include <filesystem> #include <thread> #include <mutex> #include <atomic> #include <map> //#include "LasLoader/LasLoader.h" #include "unsuck/unsuck.hpp" #include "Vector3.h" using std::ios; using std::thread; using std::mutex; using std::lock_guard; using std::atomic_int64_t; namespace fs = std::filesystem; struct LASPointF2 { int32_t x; int32_t y; int32_t z; uint16_t intensity; uint8_t returnNumber; uint8_t classification; uint8_t scanAngleRank; uint8_t userData; uint16_t pointSourceID; uint16_t r; uint16_t g; uint16_t b; }; struct Source { string path; uint64_t filesize; uint64_t numPoints = 0; int bytesPerPoint = 0; Vector3 min; Vector3 max; }; struct State { string name = ""; atomic_int64_t pointsTotal = 0; atomic_int64_t pointsProcessed = 0; atomic_int64_t bytesProcessed = 0; double duration = 0.0; std::map<string, string> values; int numPasses = 3; int currentPass = 0; // starts with index 1! interval: [1, numPasses] mutex mtx; double progress() { return double(pointsProcessed) / double(pointsTotal); } }; struct BoundingBox { Vector3 min; Vector3 max; BoundingBox() { this->min = { Infinity,Infinity,Infinity }; this->max = { -Infinity,-Infinity,-Infinity }; } BoundingBox(Vector3 min, Vector3 max) { this->min = min; this->max = max; } }; // see https://www.forceflow.be/2013/10/07/morton-encodingdecoding-through-bit-interleaving-implementations/ // method to seperate bits from a given integer 3 positions apart inline uint64_t splitBy3(unsigned int a) { uint64_t x = a & 0x1fffff; // we only look at the first 21 bits x = (x | x << 32) & 0x1f00000000ffff; // shift left 32 bits, OR with self, and 00011111000000000000000000000000000000001111111111111111 x = (x | x << 16) & 0x1f0000ff0000ff; // shift left 32 bits, OR with self, and 00011111000000000000000011111111000000000000000011111111 x = (x | x << 8) & 0x100f00f00f00f00f; // shift left 32 bits, OR with self, and 0001000000001111000000001111000000001111000000001111000000000000 x = (x | x << 4) & 0x10c30c30c30c30c3; // shift left 32 bits, OR with self, and 0001000011000011000011000011000011000011000011000011000100000000 x = (x | x << 2) & 0x1249249249249249; return x; } // see https://www.forceflow.be/2013/10/07/morton-encodingdecoding-through-bit-interleaving-implementations/ inline uint64_t mortonEncode_magicbits(unsigned int x, unsigned int y, unsigned int z) { uint64_t answer = 0; answer |= splitBy3(x) | splitBy3(y) << 1 | splitBy3(z) << 2; return answer; } inline BoundingBox childBoundingBoxOf(Vector3 min, Vector3 max, int index) { BoundingBox box; auto size = max - min; Vector3 center = min + (size * 0.5); if ((index & 0b100) == 0) { box.min.x = min.x; box.max.x = center.x; } else { box.min.x = center.x; box.max.x = max.x; } if ((index & 0b010) == 0) { box.min.y = min.y; box.max.y = center.y; } else { box.min.y = center.y; box.max.y = max.y; } if ((index & 0b001) == 0) { box.min.z = min.z; box.max.z = center.z; } else { box.min.z = center.z; box.max.z = max.z; } return box; } inline void dbgPrint_ts_later(string message, bool now = false) { static vector<string> data; static mutex mtx; lock_guard<mutex> lock(mtx); data.push_back(message); if (now) { for (auto& message : data) { cout << message << endl; } data.clear(); } } struct Options { vector<string> source; string encoding = "DEFAULT"; // "BROTLI", "UNCOMPRESSED" string outdir = ""; string name = ""; string method = ""; string chunkMethod = ""; //vector<string> flags; vector<string> attributes; bool generatePage = false; string pageName = ""; string pageTitle = ""; bool keepChunks = false; bool noChunking = false; bool noIndexing = false; };
22.965909
146
0.662791
[ "vector" ]
a0db78646bb37e2b42c64bc2db4a7df8a1029451
2,563
h
C
Engine/Core/Surface/PolygonalSurface/Hitbox/Hitbox.h
gregory-vovchok/YEngine
e28552e52588bd90db01dd53e5fc817d0a26d146
[ "BSD-2-Clause" ]
null
null
null
Engine/Core/Surface/PolygonalSurface/Hitbox/Hitbox.h
gregory-vovchok/YEngine
e28552e52588bd90db01dd53e5fc817d0a26d146
[ "BSD-2-Clause" ]
null
null
null
Engine/Core/Surface/PolygonalSurface/Hitbox/Hitbox.h
gregory-vovchok/YEngine
e28552e52588bd90db01dd53e5fc817d0a26d146
[ "BSD-2-Clause" ]
1
2020-12-04T08:57:03.000Z
2020-12-04T08:57:03.000Z
#ifndef HITBOX_H #define HITBOX_H #include <Engine/Core/String/StringANSI/StringANSI.h> #include <Engine/Core/Surface/AbstractSurface/AbstractSurface.h> #include <Engine/Core/Transformation/ModelView/ModelView.h> #include <Engine/Core/Shape/Mesh/Mesh.h> #include <Engine/Core/Container/MagicPointer/MagicPointer.h> #include <Engine/Core/Scene/ObjectScene/ObjectScene.h> class Hitbox: public AbstractObject { public: enum: int64 { HITBOX_CLASS = 288230376151711744 }; public: class ShapeInfo: public MagicNode { friend class Hitbox; friend class PolygonalSurface; private: MagicPointer<Mesh> mesh; private: StringANSI name; private: int32 collisionGroupIndex; private: bool collisionEnable; private: bool collisionPolygonsInfoEnable; public: ShapeInfo(void); public: ShapeInfo(Mesh* _mesh, StringANSI _name, int32 _collisionGroupIndex, bool _collisionEnable = true, bool _collisionPolygonsInfoEnable = false); public: Mesh* GetMesh(void)const; public: StringANSI GetName(void)const; public: int32 GetCollisionGroupIndex(void)const; public: bool GetCollisionEnable(void)const; public: bool GetCollisionPolygonsInfoEnable(void)const; public: virtual bool SaveToFile(File& _file); public: virtual bool LoadFromFile(File& _file); }; private: enum { DESTROY_HITBOX_MESSAGE = 189, INIT_HITBOX_MESSAGE = 190 }; friend class PolygonalSurface; friend class GraphicsSurface; private: MagicList<ShapeInfo> shapes; private: static StringANSI hitboxesSuffix; private: static StringANSI hitboxesDir; public: Hitbox(void); public: virtual ~Hitbox(void); public: bool IsExist(void)const; public: virtual void Destroy(void); public: bool AddShape(Mesh* _mesh, StringANSI _name, int32 _collisionGroupIndex, bool _collisionEnable = true, bool _collisionPolygonsInfoEnable = false); public: bool RemoveShape(StringANSI _name); public: MagicList<ShapeInfo>& GetShapes(void); public: static void _SetFileSuffix(StringANSI _suffix); public: static StringANSI _GetFileSuffix(void); public: static StringANSI _GetDir(void); public: virtual bool SaveToFile(StringANSI _path = ""); public: virtual bool SaveToFile(File& _file); public: virtual bool SaveAsToFile(StringANSI _name); public: virtual bool SaveAsToFile(File& _file, StringANSI _name); public: virtual bool LoadFromFile(StringANSI _path, bool _auto = true); public: virtual bool LoadFromFile(File& _file); public: static Hitbox* _LoadFromFile(StringANSI _path, bool _auto = true); public: static Hitbox* _LoadFromFile(File& _file); }; #endif
38.833333
155
0.783067
[ "mesh", "shape" ]
a0de1acb9c0be9861ca95ba4b6e216e5452a7a68
4,275
h
C
include/entity/AccountStatementMarket.h
captain-igloo/greenthumb
39d62004e6f6b6fa7da52b3f6ff1c198b04e1d72
[ "MIT" ]
3
2019-04-08T19:17:51.000Z
2019-05-21T01:01:29.000Z
include/entity/AccountStatementMarket.h
captain-igloo/greenthumb
39d62004e6f6b6fa7da52b3f6ff1c198b04e1d72
[ "MIT" ]
1
2019-04-30T23:39:06.000Z
2019-07-27T00:07:20.000Z
include/entity/AccountStatementMarket.h
captain-igloo/greenthumb
39d62004e6f6b6fa7da52b3f6ff1c198b04e1d72
[ "MIT" ]
1
2019-02-28T09:22:18.000Z
2019-02-28T09:22:18.000Z
/** * Copyright 2016 Colin Doig. Distributed under the MIT license. */ #ifndef ENTITY_ACCOUNTSTATEMENTMARKET_H #define ENTITY_ACCOUNTSTATEMENTMARKE_H #include <ctime> #include <soci.h> #include <string> namespace greenthumb { namespace entity { /** * Represents a row in account_statement_market. */ class AccountStatementMarket { public: /** * Populate account_statement_market from account_statement_item. */ static void Populate(); /** * Retrieve a page of results from account_statement_market. * * @param fromRecord The offset. * @param pageSize The number of rows to return. */ static std::vector<AccountStatementMarket> FetchAccountStatementMarketPage(uint32_t fromRecord, uint32_t pageSize); /** * The total number of rows in account_statement_market. */ static uint32_t GetNumberRows(); /** * Insert a row in account_statement_market. */ void Insert(); /** * Sets the id * * @param id The id. */ void SetId(const uint64_t id); /** * Gets the id. */ const uint64_t GetId() const; /** * Sets the exchange id. * * @param exchangeId The exchange id. */ void SetExchangeId(const uint32_t exchangeId); /** * Gets the exchange id. */ const uint32_t GetExchangeId() const; /** * Sets the item date. * * @param The item date. */ void SetItemDate(const std::tm& itemDate); /** * Gets the item date. */ const std::tm& GetItemDate() const; /** * Sets the total balance of AUS and UK wallets. * * @param The balance. */ void SetBalance(const double balance); /** * Gets the total balance of AUS and UK wallets. */ const double GetBalance() const; /** * Sets the profit / loss made on the market. * * @param amount The amount. */ void SetAmount(const double amount); /** * Gets the profit / loss made on the market. */ const double GetAmount() const; void SetEventId(const uint64_t eventId); const uint64_t GetEventId() const; void SetFullMarketName(const std::string& fullMarketName); const std::string& GetFullMarketName() const; void SetTotalBalance(const double totalBalance); const double GetTotalBalance() const; protected: private: uint64_t id; uint32_t exchangeId; std::tm itemDate; double balance; double amount; uint64_t eventId; std::string fullMarketName; double totalBalance; }; } } namespace soci { template<> struct type_conversion<greenthumb::entity::AccountStatementMarket> { typedef values base_type; static void from_base(const values& v, indicator ind, greenthumb::entity::AccountStatementMarket& ase) { ase.SetId(v.get<int>("id")); ase.SetExchangeId(v.get<int>("exchange_id")); ase.SetItemDate(v.get<std::tm>("item_date")); ase.SetBalance(v.get<double>("balance")); ase.SetAmount(v.get<double>("amount")); ase.SetEventId(v.get<long long>("event_id")); ase.SetFullMarketName(v.get<std::string>("full_market_name")); ase.SetTotalBalance(v.get<double>("total_balance")); } static void to_base(const greenthumb::entity::AccountStatementMarket& ase, values& v, indicator& ind) { v.set("id", ase.GetId()); v.set("exchange_id", ase.GetExchangeId()); v.set("item_date", ase.GetItemDate()); v.set("balance", ase.GetBalance()); v.set("amount", ase.GetAmount()); v.set("event_id", ase.GetEventId()); v.set("full_market_name", ase.GetFullMarketName()); v.set("total_balance", ase.GetTotalBalance()); ind = i_ok; } }; } #endif // ENTITY_ACCOUNTSTATEMENTMARKET_H
26.067073
123
0.567251
[ "vector" ]
a0f236aba121d8c7cedf9c830ed390e460ccd40a
52,304
c
C
lib/core/src/rcPortalOpr.c
DICE-UNC/iRODS-FUSE-Mod
8f8e965493a03bcb085df0b6467e7dfcce308d0f
[ "BSD-3-Clause" ]
null
null
null
lib/core/src/rcPortalOpr.c
DICE-UNC/iRODS-FUSE-Mod
8f8e965493a03bcb085df0b6467e7dfcce308d0f
[ "BSD-3-Clause" ]
1
2015-09-24T04:20:30.000Z
2015-09-24T04:20:30.000Z
lib/core/src/rcPortalOpr.c
DICE-UNC/iRODS-FUSE-Mod
8f8e965493a03bcb085df0b6467e7dfcce308d0f
[ "BSD-3-Clause" ]
null
null
null
/*** Copyright (c), The Regents of the University of California *** *** For more information please refer to files in the COPYRIGHT directory ***/ #include "rcPortalOpr.h" #include "dataObjOpen.h" #include "dataObjWrite.h" #include "dataObjRead.h" #include "dataObjLseek.h" #include "fileLseek.h" #include "dataObjOpr.h" #include "rodsLog.h" #include "rcGlobalExtern.h" #ifdef USE_BOOST #include <boost/thread/thread.hpp> #include <boost/thread/mutex.hpp> #include <boost/thread/condition.hpp> #else #ifdef PARA_OPR #include <pthread.h> #endif #endif // BOOST int sendTranHeader (int sock, int oprType, int flags, rodsLong_t offset, rodsLong_t length) { transferHeader_t myHeader; int retVal; myHeader.oprType = htonl (oprType); myHeader.flags = htonl (flags); myHtonll (offset, (rodsLong_t *) &myHeader.offset); myHtonll (length, (rodsLong_t *) &myHeader.length); retVal = myWrite (sock, (void *) &myHeader, sizeof (myHeader), SOCK_TYPE, NULL); if (retVal != sizeof (myHeader)) { rodsLog (LOG_ERROR, "sendTranHeader: toWrite = %d, written = %d", sizeof (myHeader), retVal); if (retVal < 0) return (retVal); else return (SYS_COPY_LEN_ERR); } else { return (0); } } int rcvTranHeader (int sock, transferHeader_t *myHeader) { int retVal; transferHeader_t tmpHeader; retVal = myRead (sock, (void *) &tmpHeader, sizeof (tmpHeader), SOCK_TYPE, NULL, NULL); if (retVal != sizeof (tmpHeader)) { rodsLog (LOG_ERROR, "rcvTranHeader: toread = %d, read = %d", sizeof (tmpHeader), retVal); if (retVal < 0) return (retVal); else return (SYS_COPY_LEN_ERR); } myHeader->oprType = htonl (tmpHeader.oprType); myHeader->flags = htonl (tmpHeader.flags); myNtohll (tmpHeader.offset, &myHeader->offset); myNtohll (tmpHeader.length, &myHeader->length); return (0); } int fillBBufWithFile (rcComm_t *conn, bytesBuf_t *myBBuf, char *locFilePath, rodsLong_t dataSize) { int in_fd, status; if (dataSize > 10 * MAX_SZ_FOR_SINGLE_BUF) { rodsLog (LOG_ERROR, "fillBBufWithFile: dataSize %lld too large", dataSize); return (USER_FILE_TOO_LARGE); } else if (dataSize > MAX_SZ_FOR_SINGLE_BUF) { rodsLog (LOG_NOTICE, "fillBBufWithFile: dataSize %lld too large", dataSize); } #ifdef windows_platform in_fd = iRODSNt_bopen(locFilePath, O_RDONLY,0); #else in_fd = open (locFilePath, O_RDONLY, 0); #endif if (in_fd < 0) { /* error */ status = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, status, "cannot open file %s, status = %d", locFilePath, status); return (status); } myBBuf->buf = malloc (dataSize); myBBuf->len = dataSize; conn->transStat.bytesWritten = dataSize; status = myRead (in_fd, myBBuf->buf, (int) dataSize, FILE_DESC_TYPE, NULL, NULL); close (in_fd); return (status); } int putFileToPortal (rcComm_t *conn, portalOprOut_t *portalOprOut, char *locFilePath, char *objPath, rodsLong_t dataSize) { portList_t *myPortList; int i, sock, in_fd; int numThreads; rcPortalTransferInp_t myInput[MAX_NUM_CONFIG_TRAN_THR]; #ifdef PARA_OPR #ifdef USE_BOOST boost::thread* tid[MAX_NUM_CONFIG_TRAN_THR]; #else pthread_t tid[MAX_NUM_CONFIG_TRAN_THR]; #endif // BOOST #endif int retVal = 0; if (portalOprOut == NULL || portalOprOut->numThreads <= 0) { rodsLog (LOG_ERROR, "putFileToPortal: invalid portalOprOut"); return (SYS_INVALID_PORTAL_OPR); } numThreads = portalOprOut->numThreads; myPortList = &portalOprOut->portList; if (portalOprOut->numThreads > MAX_NUM_CONFIG_TRAN_THR) { for (i = 0; i < portalOprOut->numThreads; i++) { sock = connectToRhostPortal (myPortList->hostAddr, myPortList->portNum, myPortList->cookie, myPortList->windowSize); if (sock > 0) { close (sock); } } rodsLog (LOG_ERROR, "putFileToPortal: numThreads %d too large", portalOprOut->numThreads); return (SYS_INVALID_PORTAL_OPR); } initFileRestart (conn, locFilePath, objPath, dataSize, portalOprOut->numThreads); #ifdef PARA_OPR memset (tid, 0, sizeof (tid)); #endif memset (myInput, 0, sizeof (myInput)); if (numThreads == 1) { sock = connectToRhostPortal (myPortList->hostAddr, myPortList->portNum, myPortList->cookie, myPortList->windowSize); if (sock < 0) { return (sock); } #ifdef windows_platform in_fd = iRODSNt_bopen(locFilePath, O_RDONLY,0); #else in_fd = open (locFilePath, O_RDONLY, 0); #endif if (in_fd < 0) { /* error */ retVal = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, retVal, "cannot open file %s, status = %d", locFilePath, retVal); return (retVal); } fillRcPortalTransferInp (conn, &myInput[0], sock, in_fd, 0); rcPartialDataPut (&myInput[0]); if (myInput[0].status < 0) { return (myInput[0].status); } else { if (dataSize <= 0 || myInput[0].bytesWritten == dataSize) { #if 0 /* done at end of API */ if (conn->fileRestart.info.numSeg > 0) { /* file restart */ clearLfRestartFile (&conn->fileRestart); } #endif return (0); } else { rodsLog (LOG_ERROR, "putFileToPortal: bytesWritten %lld dataSize %lld mismatch", myInput[0].bytesWritten, dataSize); return (SYS_COPY_LEN_ERR); } } } else { #ifdef PARA_OPR rodsLong_t totalWritten = 0; for (i = 0; i < numThreads; i++) { sock = connectToRhostPortal (myPortList->hostAddr, myPortList->portNum, myPortList->cookie, myPortList->windowSize); if (sock < 0) { return (sock); } in_fd = open (locFilePath, O_RDONLY, 0); if (in_fd < 0) { /* error */ retVal = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, retVal, "cannot open file %s, status = %d", locFilePath, retVal); continue; } fillRcPortalTransferInp (conn, &myInput[i], sock, in_fd, i); #ifdef USE_BOOST tid[i] = new boost::thread( rcPartialDataPut, &myInput[i] ); #else pthread_create (&tid[i], pthread_attr_default, (void *(*)(void *)) rcPartialDataPut, (void *) &myInput[i]); #endif /* BOOST */ } if (retVal < 0) return (retVal); for ( i = 0; i < numThreads; i++) { if (tid[i] != 0) { #ifdef USE_BOOST tid[i]->join(); #else pthread_join (tid[i], NULL); #endif } totalWritten += myInput[i].bytesWritten; if (myInput[i].status < 0) { retVal = myInput[i].status; } } if (retVal < 0) { return (retVal); } else { if (dataSize <= 0 || totalWritten == dataSize) { #if 0 /* done at end of API */ if (conn->fileRestart.info.numSeg > 0) { /* file restart */ clearLfRestartFile (&conn->fileRestart); } #endif if (gGuiProgressCB != NULL) gGuiProgressCB (&conn->operProgress); return (0); } else { rodsLog (LOG_ERROR, "putFileToPortal: totalWritten %lld dataSize %lld mismatch", totalWritten, dataSize); return (SYS_COPY_LEN_ERR); } } #else /* PARA_OPR */ return (SYS_PARA_OPR_NO_SUPPORT); #endif /* PARA_OPR */ } } int fillRcPortalTransferInp (rcComm_t *conn, rcPortalTransferInp_t *myInput, int destFd, int srcFd, int threadNum) { if (myInput == NULL) return (SYS_INTERNAL_NULL_INPUT_ERR); myInput->conn = conn; myInput->destFd = destFd; myInput->srcFd = srcFd; myInput->threadNum = threadNum; return (0); } void rcPartialDataPut (rcPortalTransferInp_t *myInput) { transferHeader_t myHeader; int destFd; int srcFd; void *buf; transferStat_t *myTransStat; rodsLong_t curOffset = 0; rcComm_t *conn; fileRestartInfo_t *info; int threadNum; #ifdef PARA_DEBUG printf ("rcPartialDataPut: thread %d at start\n", myInput->threadNum); #endif if (myInput == NULL) { rodsLog (LOG_ERROR, "rcPartialDataPut: NULL input"); return; } conn = myInput->conn; info = &conn->fileRestart.info; threadNum = myInput->threadNum; myTransStat = &myInput->conn->transStat; destFd = myInput->destFd; srcFd = myInput->srcFd; buf = malloc (TRANS_BUF_SZ); myInput->bytesWritten = 0; if (gGuiProgressCB != NULL) { conn->operProgress.flag = 1; } while (myInput->status >= 0) { rodsLong_t toPut; myInput->status = rcvTranHeader (destFd, &myHeader); #ifdef PARA_DEBUG printf ("rcPartialDataPut: thread %d after rcvTranHeader\n", myInput->threadNum); #endif if (myInput->status < 0) { break; } if (myHeader.oprType == DONE_OPR) { break; } if (myHeader.offset != curOffset) { curOffset = myHeader.offset; if (lseek (srcFd, curOffset, SEEK_SET) < 0) { myInput->status = UNIX_FILE_LSEEK_ERR - errno; rodsLogError (LOG_ERROR, myInput->status, "rcPartialDataPut: lseek to %lld error, status = %d", curOffset, myInput->status); break; } if (info->numSeg > 0) /* file restart */ info->dataSeg[threadNum].offset = curOffset; } toPut = myHeader.length; while (toPut > 0) { int toRead, bytesRead, bytesWritten; if (toPut > TRANS_BUF_SZ) { toRead = TRANS_BUF_SZ; } else { toRead = toPut; } bytesRead = myRead (srcFd, buf, toRead, FILE_DESC_TYPE, &bytesRead, NULL); if (bytesRead != toRead) { myInput->status = SYS_COPY_LEN_ERR - errno; rodsLogError (LOG_ERROR, myInput->status, "rcPartialDataPut: toPut %lld, bytesRead %d", toPut, bytesRead); break; } bytesWritten = myWrite (destFd, buf, bytesRead, SOCK_TYPE, &bytesWritten); if (bytesWritten != bytesRead) { myInput->status = SYS_COPY_LEN_ERR - errno; rodsLogError (LOG_ERROR, myInput->status, "rcPartialDataPut: toWrite %d, bytesWritten %d, errno = %d", bytesRead, bytesWritten, errno); break; } toPut -= bytesWritten; if (info->numSeg > 0) { /* file restart */ info->dataSeg[threadNum].len += bytesWritten; conn->fileRestart.writtenSinceUpdated += bytesWritten; if (threadNum == 0 && conn->fileRestart.writtenSinceUpdated >= RESTART_FILE_UPDATE_SIZE) { int status; /* time to write to the restart file */ status = writeLfRestartFile (conn->fileRestart.infoFile, &conn->fileRestart.info); if (status < 0) { rodsLog (LOG_ERROR, "putFile: writeLfRestartFile for %s, status = %d", conn->fileRestart.info.fileName, status); } conn->fileRestart.writtenSinceUpdated = 0; } } } curOffset += myHeader.length; myInput->bytesWritten += myHeader.length; /* should lock this. But window browser is the only one using it */ myTransStat->bytesWritten += myHeader.length; /* should lock this. but it is info only */ if (gGuiProgressCB != NULL) { conn->operProgress.curFileSizeDone += myHeader.length; if (myInput->threadNum == 0) gGuiProgressCB (&conn->operProgress); } } free (buf); close (srcFd); mySockClose (destFd); } int putFile (rcComm_t *conn, int l1descInx, char *locFilePath, char *objPath, rodsLong_t dataSize) { int in_fd, status; bytesBuf_t dataObjWriteInpBBuf; openedDataObjInp_t dataObjWriteInp; int bytesWritten; rodsLong_t totalWritten = 0; int bytesRead; int progressCnt = 0; fileRestartInfo_t *info = &conn->fileRestart.info; rodsLong_t lastUpdateSize = 0; #ifdef windows_platform in_fd = iRODSNt_bopen(locFilePath, O_RDONLY,0); #else in_fd = open (locFilePath, O_RDONLY, 0); #endif if (in_fd < 0) { /* error */ status = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, status, "cannot open file %s, status = %d", locFilePath, status); return (status); } bzero (&dataObjWriteInp, sizeof (dataObjWriteInp)); dataObjWriteInpBBuf.buf = malloc (TRANS_BUF_SZ); dataObjWriteInpBBuf.len = 0; dataObjWriteInp.l1descInx = l1descInx; initFileRestart (conn, locFilePath, objPath, dataSize, 1); if (gGuiProgressCB != NULL) conn->operProgress.flag = 1; while ((dataObjWriteInpBBuf.len = myRead (in_fd, dataObjWriteInpBBuf.buf, TRANS_BUF_SZ, FILE_DESC_TYPE, &bytesRead, NULL)) > 0) { /* Write to the data object */ dataObjWriteInp.len = dataObjWriteInpBBuf.len; bytesWritten = rcDataObjWrite (conn, &dataObjWriteInp, &dataObjWriteInpBBuf); if (bytesWritten < dataObjWriteInp.len) { rodsLog (LOG_ERROR, "putFile: Read %d bytes, Wrote %d bytes.\n ", dataObjWriteInp.len, bytesWritten); free (dataObjWriteInpBBuf.buf); close (in_fd); return (SYS_COPY_LEN_ERR); } else { totalWritten += bytesWritten; conn->transStat.bytesWritten = totalWritten; if (info->numSeg > 0) { /* file restart */ info->dataSeg[0].len += bytesWritten; if (totalWritten - lastUpdateSize >= RESTART_FILE_UPDATE_SIZE) { /* time to write to the restart file */ status = writeLfRestartFile (conn->fileRestart.infoFile, &conn->fileRestart.info); if (status < 0) { rodsLog (LOG_ERROR, "putFile: writeLfRestartFile for %s, status = %d", locFilePath, status); free (dataObjWriteInpBBuf.buf); close (in_fd); return status; } lastUpdateSize = totalWritten; } } if (gGuiProgressCB != NULL) { if (progressCnt >= (MAX_PROGRESS_CNT - 1)) { conn->operProgress.curFileSizeDone += ((MAX_PROGRESS_CNT - 1) * TRANS_BUF_SZ + bytesWritten); gGuiProgressCB (&conn->operProgress); progressCnt = 0; } else { progressCnt ++; } } } } free (dataObjWriteInpBBuf.buf); close (in_fd); if (dataSize <= 0 || totalWritten == dataSize) { #if 0 /* done at end of API */ if (info->numSeg > 0) { /* file restart */ clearLfRestartFile (&conn->fileRestart); } #endif if (gGuiProgressCB != NULL) { conn->operProgress.curFileSizeDone = conn->operProgress.curFileSize; gGuiProgressCB (&conn->operProgress); } return (0); } else { rodsLog (LOG_ERROR, "putFile: totalWritten %lld dataSize %lld mismatch", totalWritten, dataSize); return (SYS_COPY_LEN_ERR); } } int getIncludeFile (rcComm_t *conn, bytesBuf_t *dataObjOutBBuf, char *locFilePath) { int status, out_fd, bytesWritten; if (strcmp (locFilePath, STDOUT_FILE_NAME) == 0) { if (dataObjOutBBuf->len <= 0) { return (0); } bytesWritten = fwrite (dataObjOutBBuf->buf, dataObjOutBBuf->len, 1, stdout); if (bytesWritten == 1) bytesWritten = dataObjOutBBuf->len; } else { #ifdef windows_platform out_fd = iRODSNt_bopen(locFilePath, O_WRONLY | O_CREAT | O_TRUNC, 0640); #else out_fd = open (locFilePath, O_WRONLY | O_CREAT | O_TRUNC, 0640); #endif if (out_fd < 0) { /* error */ status = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, status, "cannot open file %s, status = %d", locFilePath, status); return (status); } if (dataObjOutBBuf->len <= 0) { close (out_fd); return 0; } bytesWritten = myWrite (out_fd, dataObjOutBBuf->buf, dataObjOutBBuf->len, FILE_DESC_TYPE, NULL); close (out_fd); } if (bytesWritten != dataObjOutBBuf->len) { rodsLog (LOG_ERROR, "getIncludeFile: Read %d bytes, Wrote %d bytes. errno = %d\n ", dataObjOutBBuf->len, bytesWritten, errno); return (SYS_COPY_LEN_ERR); } else { conn->transStat.bytesWritten = bytesWritten; return (0); } } int getFile (rcComm_t *conn, int l1descInx, char *locFilePath, char *objPath, rodsLong_t dataSize) { int out_fd, status; bytesBuf_t dataObjReadInpBBuf; openedDataObjInp_t dataObjReadInp; int bytesWritten, bytesRead; rodsLong_t totalWritten = 0; int progressCnt = 0; fileRestartInfo_t *info = &conn->fileRestart.info; rodsLong_t lastUpdateSize = 0; if (strcmp (locFilePath, STDOUT_FILE_NAME) == 0) { /* streaming to stdout */ out_fd =1; } else { #ifdef windows_platform out_fd = iRODSNt_bopen(locFilePath, O_WRONLY | O_CREAT | O_TRUNC, 0640); #else out_fd = open (locFilePath, O_WRONLY | O_CREAT | O_TRUNC, 0640); #endif } if (out_fd < 0) { /* error */ status = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, status, "cannot open file %s, status = %d", locFilePath, status); return (status); } bzero (&dataObjReadInp, sizeof (dataObjReadInp)); dataObjReadInpBBuf.buf = malloc (TRANS_BUF_SZ); dataObjReadInpBBuf.len = dataObjReadInp.len = TRANS_BUF_SZ; dataObjReadInp.l1descInx = l1descInx; initFileRestart (conn, locFilePath, objPath, dataSize, 1); if (gGuiProgressCB != NULL) conn->operProgress.flag = 1; while ((bytesRead = rcDataObjRead (conn, &dataObjReadInp, &dataObjReadInpBBuf)) > 0) { if (out_fd == 1) { bytesWritten = fwrite (dataObjReadInpBBuf.buf, bytesRead, 1, stdout); if (bytesWritten == 1) bytesWritten = bytesRead; } else { bytesWritten = myWrite (out_fd, dataObjReadInpBBuf.buf, bytesRead, FILE_DESC_TYPE, NULL); } if (bytesWritten != bytesRead) { rodsLog (LOG_ERROR, "getFile: Read %d bytes, Wrote %d bytes.\n ", bytesRead, bytesWritten); free (dataObjReadInpBBuf.buf); if (out_fd != 1) close (out_fd); return (SYS_COPY_LEN_ERR); } else { totalWritten += bytesWritten; conn->transStat.bytesWritten = totalWritten; if (info->numSeg > 0) { /* file restart */ info->dataSeg[0].len += bytesWritten; if (totalWritten - lastUpdateSize >= RESTART_FILE_UPDATE_SIZE) { /* time to write to the restart file */ status = writeLfRestartFile (conn->fileRestart.infoFile, &conn->fileRestart.info); if (status < 0) { rodsLog (LOG_ERROR, "getFile: writeLfRestartFile for %s, status = %d", locFilePath, status); free (dataObjReadInpBBuf.buf); if (out_fd != 1) close (out_fd); return status; } lastUpdateSize = totalWritten; } } if (gGuiProgressCB != NULL) { if (progressCnt >= (MAX_PROGRESS_CNT - 1)) { conn->operProgress.curFileSizeDone += ((MAX_PROGRESS_CNT - 1) * TRANS_BUF_SZ + bytesWritten); gGuiProgressCB (&conn->operProgress); progressCnt = 0; } else { progressCnt ++; } } } } free (dataObjReadInpBBuf.buf); if (out_fd != 1) close (out_fd); #if 0 /* XXXXXXX testing only for no len check */ if (dataSize <= 0 || totalWritten == dataSize) { #else if (bytesRead >= 0) { #endif #if 0 /* done at end of API */ if (info->numSeg > 0) { /* file restart */ clearLfRestartFile (&conn->fileRestart); } #endif if (gGuiProgressCB != NULL) { conn->operProgress.curFileSizeDone = conn->operProgress.curFileSize; gGuiProgressCB (&conn->operProgress); } return (0); } else { rodsLog (LOG_ERROR, "getFile: totalWritten %lld dataSize %lld mismatch", totalWritten, dataSize); #if 0 /* XXXXXXX testing only for no len check */ return (SYS_COPY_LEN_ERR); #else return bytesRead; #endif } } int getFileFromPortal (rcComm_t *conn, portalOprOut_t *portalOprOut, char *locFilePath, char *objPath, rodsLong_t dataSize) { portList_t *myPortList; int i, sock, out_fd; int numThreads; rcPortalTransferInp_t myInput[MAX_NUM_CONFIG_TRAN_THR]; #ifdef USE_BOOST boost::thread* tid[MAX_NUM_CONFIG_TRAN_THR]; #else #ifdef PARA_OPR pthread_t tid[MAX_NUM_CONFIG_TRAN_THR]; #endif #endif // BOOST int retVal = 0; if (portalOprOut == NULL || portalOprOut->numThreads <= 0) { rodsLog (LOG_ERROR, "getFileFromPortal: invalid portalOprOut"); return (SYS_INVALID_PORTAL_OPR); } numThreads = portalOprOut->numThreads; myPortList = &portalOprOut->portList; if (portalOprOut->numThreads > MAX_NUM_CONFIG_TRAN_THR) { /* drain the connection or it will be stuck */ for (i = 0; i < numThreads; i++) { sock = connectToRhostPortal (myPortList->hostAddr, myPortList->portNum, myPortList->cookie, myPortList->windowSize); if (sock > 0) { close (sock); } } rodsLog (LOG_ERROR, "getFileFromPortal: numThreads %d too large", numThreads); return (SYS_INVALID_PORTAL_OPR); } #ifdef PARA_OPR memset (tid, 0, sizeof (tid)); #endif memset (myInput, 0, sizeof (myInput)); initFileRestart (conn, locFilePath, objPath, dataSize, portalOprOut->numThreads); if (numThreads == 1) { sock = connectToRhostPortal (myPortList->hostAddr, myPortList->portNum, myPortList->cookie, myPortList->windowSize); if (sock < 0) { return (sock); } #ifdef windows_platform out_fd = iRODSNt_bopen(locFilePath, O_WRONLY | O_CREAT | O_TRUNC, 0640); #else out_fd = open (locFilePath, O_WRONLY | O_CREAT | O_TRUNC, 0640); #endif if (out_fd < 0) { /* error */ retVal = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, retVal, "cannot open file %s, status = %d", locFilePath, retVal); return (retVal); } fillRcPortalTransferInp (conn, &myInput[0], out_fd, sock, 0640); rcPartialDataGet (&myInput[0]); if (myInput[0].status < 0) { return (myInput[0].status); } else { if (dataSize <= 0 || myInput[0].bytesWritten == dataSize) { #if 0 /* done at end of API */ if (conn->fileRestart.info.numSeg > 0) { /* file restart */ clearLfRestartFile (&conn->fileRestart); } #endif return (0); } else { rodsLog (LOG_ERROR, "getFileFromPortal:bytesWritten %lld dataSize %lld mismatch", myInput[0].bytesWritten, dataSize); return (SYS_COPY_LEN_ERR); } } } else { #ifdef PARA_OPR rodsLong_t totalWritten = 0; for (i = 0; i < numThreads; i++) { sock = connectToRhostPortal (myPortList->hostAddr, myPortList->portNum, myPortList->cookie, myPortList->windowSize); if (sock < 0) { return (sock); } if (i == 0) { out_fd = open (locFilePath, O_WRONLY | O_CREAT | O_TRUNC,0640); } else { out_fd = open (locFilePath, O_WRONLY, 0640); } if (out_fd < 0) { /* error */ retVal = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, retVal, "cannot open file %s, status = %d", locFilePath, retVal); CLOSE_SOCK (sock); continue; } fillRcPortalTransferInp (conn, &myInput[i], out_fd, sock, i); #ifdef USE_BOOST tid[i] = new boost::thread( rcPartialDataGet, &myInput[i] ); #else pthread_create (&tid[i], pthread_attr_default, (void *(*)(void *)) rcPartialDataGet, (void *) &myInput[i]); #endif } if (retVal < 0) { return (retVal); } for ( i = 0; i < numThreads; i++) { if (tid[i] != 0) { #ifdef USE_BOOST tid[i]->join(); #else pthread_join (tid[i], NULL); #endif } totalWritten += myInput[i].bytesWritten; if (myInput[i].status < 0) { retVal = myInput[i].status; } } if (retVal < 0) { return (retVal); } else { if (dataSize <= 0 || totalWritten == dataSize) { #if 0 /* done at end of API */ if (conn->fileRestart.info.numSeg > 0) { /* file restart */ clearLfRestartFile (&conn->fileRestart); } #endif if (gGuiProgressCB != NULL) gGuiProgressCB (&conn->operProgress); return (0); } else { rodsLog (LOG_ERROR, "getFileFromPortal: totalWritten %lld dataSize %lld mismatch", totalWritten, dataSize); return (SYS_COPY_LEN_ERR); } } #else /* PARA_OPR */ return (SYS_PARA_OPR_NO_SUPPORT); #endif /* PARA_OPR */ } } void rcPartialDataGet (rcPortalTransferInp_t *myInput) { transferHeader_t myHeader; int destFd; int srcFd; void *buf; transferStat_t *myTransStat; rodsLong_t curOffset = 0; rcComm_t *conn; fileRestartInfo_t *info; int threadNum; #ifdef PARA_DEBUG printf ("rcPartialDataGet: thread %d at start\n", myInput->threadNum); #endif if (myInput == NULL) { rodsLog (LOG_ERROR, "rcPartialDataGet: NULL input"); return; } conn = myInput->conn; info = &conn->fileRestart.info; threadNum = myInput->threadNum; myTransStat = &myInput->conn->transStat; destFd = myInput->destFd; srcFd = myInput->srcFd; buf = malloc (TRANS_BUF_SZ); myInput->bytesWritten = 0; if (gGuiProgressCB != NULL) { conn = myInput->conn; conn->operProgress.flag = 1; } while (myInput->status >= 0) { rodsLong_t toGet; myInput->status = rcvTranHeader (srcFd, &myHeader); #ifdef PARA_DEBUG printf ("rcPartialDataGet: thread %d after rcvTranHeader\n", myInput->threadNum); #endif if (myInput->status < 0) { break; } if (myHeader.oprType == DONE_OPR) { break; } if (myHeader.offset != curOffset) { curOffset = myHeader.offset; if (lseek (destFd, curOffset, SEEK_SET) < 0) { myInput->status = UNIX_FILE_LSEEK_ERR - errno; rodsLogError (LOG_ERROR, myInput->status, "rcPartialDataGet: lseek to %lld error, status = %d", curOffset, myInput->status); break; } if (info->numSeg > 0) /* file restart */ info->dataSeg[threadNum].offset = curOffset; } toGet = myHeader.length; while (toGet > 0) { int toRead, bytesRead, bytesWritten; if (toGet > TRANS_BUF_SZ) { toRead = TRANS_BUF_SZ; } else { toRead = toGet; } bytesRead = myRead (srcFd, buf, toRead, SOCK_TYPE, &bytesRead, NULL); if (bytesRead != toRead) { myInput->status = SYS_COPY_LEN_ERR - errno; rodsLogError (LOG_ERROR, myInput->status, "rcPartialDataGet: toGet %lld, bytesRead %d", toGet, bytesRead); break; } bytesWritten = myWrite (destFd, buf, bytesRead, FILE_DESC_TYPE, &bytesWritten); if (bytesWritten != bytesRead) { myInput->status = SYS_COPY_LEN_ERR - errno; rodsLogError (LOG_ERROR, myInput->status, "rcPartialDataGet: toWrite %d, bytesWritten %d", bytesRead, bytesWritten); break; } toGet -= bytesWritten; if (info->numSeg > 0) { /* file restart */ info->dataSeg[threadNum].len += bytesWritten; conn->fileRestart.writtenSinceUpdated += bytesWritten; if (threadNum == 0 && conn->fileRestart.writtenSinceUpdated >= RESTART_FILE_UPDATE_SIZE) { int status; /* time to write to the restart file */ status = writeLfRestartFile (conn->fileRestart.infoFile, &conn->fileRestart.info); if (status < 0) { rodsLog (LOG_ERROR, "putFile: writeLfRestartFile for %s, status = %d", conn->fileRestart.info.fileName, status); } conn->fileRestart.writtenSinceUpdated = 0; } } } curOffset += myHeader.length; myInput->bytesWritten += myHeader.length; /* should lock this. But window browser is the only one using it */ myTransStat->bytesWritten += myHeader.length; /* should lock this. but it is info only */ if (gGuiProgressCB != NULL) { conn->operProgress.curFileSizeDone += myHeader.length; if (myInput->threadNum == 0) gGuiProgressCB (&conn->operProgress); } } free (buf); close (destFd); CLOSE_SOCK (srcFd); } #ifdef RBUDP_TRANSFER /* putFileToPortalRbudp - The client side of putting a file using * Rbudp. If locFilePath is NULL, the local file has already been opned * and locFd should be used. If sendRate and packetSize are 0, it will * try to set it based on env and default. */ int putFileToPortalRbudp (portalOprOut_t *portalOprOut, char *locFilePath, char *objPath, int locFd, rodsLong_t dataSize, int veryVerbose, int sendRate, int packetSize) { portList_t *myPortList; int status; rbudpSender_t rbudpSender; int mysendRate, mypacketSize; char *tmpStr; if (portalOprOut == NULL || portalOprOut->numThreads != 1) { rodsLog (LOG_ERROR, "putFileToPortal: invalid portalOprOut"); return (SYS_INVALID_PORTAL_OPR); } myPortList = &portalOprOut->portList; bzero (&rbudpSender, sizeof (rbudpSender)); status = initRbudpClient (&rbudpSender.rbudpBase, myPortList); if (status < 0) { rodsLog (LOG_ERROR, "putFileToPortalRbudp: initRbudpClient error for %s", myPortList->hostAddr); return (status); } rbudpSender.rbudpBase.verbose = veryVerbose; if (sendRate <= 0) { if ((tmpStr = getenv (RBUDP_SEND_RATE_KW)) != NULL) { mysendRate = atoi (tmpStr); } else { mysendRate = DEF_UDP_SEND_RATE; } } else { mysendRate = sendRate; } if (packetSize <= 0) { if ((tmpStr = getenv (RBUDP_PACK_SIZE_KW)) != NULL) { mypacketSize = atoi (tmpStr); } else { mypacketSize = DEF_UDP_PACKET_SIZE; } } else { mypacketSize = packetSize; } if (locFilePath == NULL) { status = sendfileByFd (&rbudpSender, mysendRate, mypacketSize, locFd); } else { status = rbSendfile (&rbudpSender, mysendRate, mypacketSize, locFilePath); } sendClose (&rbudpSender); if (status < 0) { rodsLog (LOG_ERROR, "putFileToPortalRbudp: sendfile error for %s:%d", myPortList->hostAddr, myPortList->portNum & 0xffff0000); return (status); } return (status); } /* getFileToPortalRbudp - The client side of getting a file using * Rbudp. If locFilePath is NULL, the local file has already been opned * and locFd should be used. If sendRate and packetSize are 0, it will * try to set it based on env and default. */ int getFileToPortalRbudp (portalOprOut_t *portalOprOut, char *locFilePath, int locFd, rodsLong_t dataSize, int veryVerbose, int packetSize) { portList_t *myPortList; int status; rbudpReceiver_t rbudpReceiver; int mypacketSize; char *tmpStr; if (portalOprOut == NULL || portalOprOut->numThreads != 1) { rodsLog (LOG_ERROR, "getFileToPortalRbudp: invalid portalOprOut"); return (SYS_INVALID_PORTAL_OPR); } myPortList = &portalOprOut->portList; bzero (&rbudpReceiver, sizeof (rbudpReceiver)); status = initRbudpClient (&rbudpReceiver.rbudpBase, myPortList); if (status < 0) { rodsLog (LOG_ERROR, "getFileToPortalRbudp: initRbudpClient error for %s", myPortList->hostAddr); return (status); } rbudpReceiver.rbudpBase.verbose = veryVerbose; if (packetSize <= 0) { if ((tmpStr = getenv (RBUDP_PACK_SIZE_KW)) != NULL) { mypacketSize = atoi (tmpStr); } else { mypacketSize = DEF_UDP_PACKET_SIZE; } } else { mypacketSize = packetSize; } if (locFilePath == NULL) { status = getfileByFd (&rbudpReceiver, locFd, mypacketSize); } else { status = getfile (&rbudpReceiver, NULL, locFilePath, mypacketSize); } recvClose (&rbudpReceiver); if (status < 0) { rodsLog (LOG_ERROR, "getFileToPortalRbudp: getfile error for %s", myPortList->hostAddr); return (status); } return (status); } int initRbudpClient (rbudpBase_t *rbudpBase, portList_t *myPortList) { int tcpSock; int tcpPort, udpPort; int status; struct sockaddr_in localUdpAddr; int udpLocalPort; if ((udpPort = getUdpPortFromPortList (myPortList)) == 0) { rodsLog (LOG_ERROR, "putFileToPortalRbudp: udpPort == 0"); return (SYS_INVALID_PORTAL_OPR); } tcpPort = getTcpPortFromPortList (myPortList); tcpSock = connectToRhostPortal (myPortList->hostAddr, tcpPort, myPortList->cookie, myPortList->windowSize); if (tcpSock < 0) { return (tcpSock); } rbudpBase->udpSockBufSize = UDPSOCKBUF; rbudpBase->tcpPort = tcpPort; rbudpBase->tcpSockfd = tcpSock; rbudpBase->hasTcpSock = 0; /* so it will close properly */ rbudpBase->udpRemotePort = udpPort; /* connect to the server's UDP port */ status = passiveUDP (rbudpBase, myPortList->hostAddr); if (status < 0) { rodsLog (LOG_ERROR, "initRbudpClient: passiveUDP connect to %s error. status = %d", myPortList->hostAddr, status); return (SYS_UDP_CONNECT_ERR + status); } /* inform the server of the UDP port */ rbudpBase->udpLocalPort = setLocalAddr (rbudpBase->udpSockfd, &localUdpAddr); if (rbudpBase->udpLocalPort < 0) return rbudpBase->udpLocalPort; udpLocalPort = htonl (rbudpBase->udpLocalPort); status = writen (rbudpBase->tcpSockfd, (char *) &udpLocalPort, sizeof (udpLocalPort)); if (status != sizeof (udpLocalPort)) { rodsLog (LOG_ERROR, "initRbudpClient: writen error. towrite %d, bytes written %d ", sizeof (udpLocalPort), status); return (SYS_UDP_CONNECT_ERR); } return 0; } #endif /* RBUDP_TRANSFER */ int initFileRestart (rcComm_t *conn, char *fileName, char *objPath, rodsLong_t fileSize, int numThr) { fileRestart_t *fileRestart = &conn->fileRestart; fileRestartInfo_t *info = &fileRestart->info; if (fileRestart->flags != FILE_RESTART_ON || fileSize < MIN_RESTART_SIZE || numThr <= 0) { info->numSeg = 0; /* indicate no restart */ return 0; } if (numThr > MAX_NUM_CONFIG_TRAN_THR) { rodsLog (LOG_NOTICE, "initFileRestart: input numThr %d larger than max %d ", numThr, MAX_NUM_CONFIG_TRAN_THR); info->numSeg = 0; /* indicate no restart */ return 0; } info->numSeg = numThr; info->fileSize = fileSize; rstrcpy (info->fileName, fileName, MAX_NAME_LEN); rstrcpy (info->objPath, objPath, MAX_NAME_LEN); bzero (info->dataSeg, sizeof (dataSeg_t) * MAX_NUM_CONFIG_TRAN_THR); return 0; } int writeLfRestartFile (char *infoFile, fileRestartInfo_t *info) { bytesBuf_t *packedBBuf = NULL; int status, fd; status = packStruct ((void *) info, &packedBBuf, "FileRestartInfo_PI", RodsPackTable, 0, XML_PROT); if (status < 0) { rodsLog (LOG_ERROR, "writeLfRestartFile: packStruct error for %s, status = %d", info->fileName, status); return status; } if (packedBBuf == NULL) { rodsLog (LOG_ERROR, "writeLfRestartFile: packStruct error for %s, status = %d", info->fileName, status); return status; } // cppcheck - Possible null pointer dereference: packedBBuf /* write it to a file */ fd = open (infoFile, O_CREAT|O_TRUNC|O_WRONLY, 0640); if (fd < 0) { status = UNIX_FILE_OPEN_ERR - errno; rodsLog (LOG_ERROR, "writeLfRestartFile: open failed for %s, status = %d", infoFile, status); return (status); } status = write (fd, packedBBuf->buf, packedBBuf->len); close (fd); if (packedBBuf != NULL) { clearBBuf (packedBBuf); free (packedBBuf); } if (status < 0) { status = UNIX_FILE_WRITE_ERR - errno; rodsLog (LOG_ERROR, "writeLfRestartFile: write failed for %s, status = %d", infoFile, status); return (status); } return status; } int readLfRestartFile (char *infoFile, fileRestartInfo_t **info) { int status, fd; #ifndef USE_BOOST_FS struct stat statbuf; #endif rodsLong_t mySize; char *buf; *info = NULL; #ifdef USE_BOOST_FS path p (infoFile); if (!exists (p) || !is_regular_file (p)) { status = UNIX_FILE_STAT_ERR - errno; return (status); } else if ((mySize = file_size(p)) <= 0) { status = UNIX_FILE_STAT_ERR - errno; rodsLog (LOG_ERROR, "readLfRestartFile restart infoFile size is 0 for %s", infoFile); return (status); } #else /* USE_BOOST_FS */ status = stat (infoFile, &statbuf); if (status < 0) { status = UNIX_FILE_STAT_ERR - errno; return (status); } if ( statbuf.st_size == 0) { status = UNIX_FILE_STAT_ERR - errno; rodsLog (LOG_ERROR, "readLfRestartFile restart infoFile size is 0 for %s", infoFile); return (status); } mySize = statbuf.st_size; #endif /* USE_BOOST_FS */ /* read the restart infoFile */ fd = open (infoFile, O_RDONLY, 0640); if (fd < 0) { status = UNIX_FILE_OPEN_ERR - errno; rodsLog (LOG_ERROR, "readLfRestartFile open failed for %s, status = %d", infoFile, status); return (status); } buf = (char *) calloc (1, 2 * mySize); if (buf == NULL) { close (fd); return SYS_MALLOC_ERR; } status = read (fd, buf, mySize); if (status != mySize) { rodsLog (LOG_ERROR, "readLfRestartFile error failed for %s, toread %d, read %d", infoFile, mySize, status); status = UNIX_FILE_READ_ERR - errno; close (fd); free (buf); return (status); } close (fd); status = unpackStruct (buf, (void **) info, "FileRestartInfo_PI", NULL, XML_PROT); if (status < 0) { rodsLog (LOG_ERROR, "readLfRestartFile: unpackStruct error for %s, status = %d", infoFile, status); } // close (fd); // cppcheck - Deallocating a deallocated pointer: fd free (buf); return (status); } int clearLfRestartFile (fileRestart_t *fileRestart) { unlink (fileRestart->infoFile); bzero (&fileRestart->info, sizeof (fileRestartInfo_t)); return 0; } int lfRestartPutWithInfo (rcComm_t *conn, fileRestartInfo_t *info) { rodsLong_t curOffset = 0; bytesBuf_t dataObjWriteInpBBuf; int status, i; int localFd, irodsFd; dataObjInp_t dataObjOpenInp; openedDataObjInp_t dataObjWriteInp; openedDataObjInp_t dataObjLseekInp; openedDataObjInp_t dataObjCloseInp; fileLseekOut_t *dataObjLseekOut = NULL; int writtenSinceUpdated = 0; rodsLong_t gap; #ifdef windows_platform localFd = iRODSNt_bopen(info->fileName, O_RDONLY,0); #else localFd = open (info->fileName, O_RDONLY, 0); #endif if (localFd < 0) { /* error */ status = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, status, "cannot open file %s, status = %d", info->fileName, status); return (status); } bzero (&dataObjOpenInp, sizeof (dataObjOpenInp)); rstrcpy (dataObjOpenInp.objPath, info->objPath, MAX_NAME_LEN); dataObjOpenInp.openFlags = O_WRONLY; addKeyVal (&dataObjOpenInp.condInput, FORCE_FLAG_KW, ""); irodsFd = rcDataObjOpen (conn, &dataObjOpenInp); if (irodsFd < 0) { /* error */ rodsLogError (LOG_ERROR, irodsFd, "cannot open target file %s, status = %d", info->objPath, irodsFd); close (localFd); return (irodsFd); } bzero (&dataObjWriteInp, sizeof (dataObjWriteInp)); dataObjWriteInpBBuf.buf = malloc (TRANS_BUF_SZ); dataObjWriteInpBBuf.len = 0; dataObjWriteInp.l1descInx = irodsFd; memset (&dataObjLseekInp, 0, sizeof (dataObjLseekInp)); dataObjLseekInp.whence = SEEK_SET; for (i = 0; i < info->numSeg; i++) { gap = info->dataSeg[i].offset - curOffset; if (gap < 0) { /* should not be here */ } else if (gap > 0) { rodsLong_t tmpLen, *lenToUpdate; if (i == 0) { /* should not be here */ tmpLen = 0; lenToUpdate = &tmpLen; } else { lenToUpdate = &info->dataSeg[i - 1].len; } status = putSeg (conn, gap, localFd, &dataObjWriteInp, &dataObjWriteInpBBuf, TRANS_BUF_SZ, &writtenSinceUpdated, info, lenToUpdate); if (status < 0) break; curOffset += gap; } if (info->dataSeg[i].len > 0) { curOffset += info->dataSeg[i].len; if (lseek (localFd, curOffset, SEEK_SET) < 0) { status = UNIX_FILE_LSEEK_ERR - errno; rodsLogError (LOG_ERROR, status, "lfRestartWithInfo: lseek to %lld error for %s", curOffset, info->fileName); break; } dataObjLseekInp.l1descInx = irodsFd; dataObjLseekInp.offset = curOffset; status = rcDataObjLseek (conn, &dataObjLseekInp, &dataObjLseekOut); if (status < 0) { rodsLogError (LOG_ERROR, status, "lfRestartWithInfo: rcDataObjLseek to %lld error for %s", curOffset, info->objPath); break; } else { if (dataObjLseekOut != NULL) free (dataObjLseekOut); } } } if (status >= 0) { gap = info->fileSize - curOffset; if (gap > 0) { status = putSeg (conn, gap, localFd, &dataObjWriteInp, &dataObjWriteInpBBuf, TRANS_BUF_SZ, &writtenSinceUpdated, info, &info->dataSeg[i - 1].len); } } free (dataObjWriteInpBBuf.buf); close (localFd); memset (&dataObjCloseInp, 0, sizeof (dataObjCloseInp)); dataObjCloseInp.l1descInx = irodsFd; rcDataObjClose (conn, &dataObjCloseInp); return status; } int putSeg (rcComm_t *conn, rodsLong_t segSize, int localFd, openedDataObjInp_t *dataObjWriteInp, bytesBuf_t *dataObjWriteInpBBuf, int bufLen, int *writtenSinceUpdated, fileRestartInfo_t *info, rodsLong_t *dataSegLen) { rodsLong_t gap = segSize; int bytesWritten; int status; while (gap > 0) { int toRead; if (gap > bufLen) { toRead = bufLen; } else { toRead = (int) gap; } dataObjWriteInpBBuf->len = myRead (localFd, dataObjWriteInpBBuf->buf, toRead, FILE_DESC_TYPE, NULL, NULL); /* Write to the data object */ dataObjWriteInp->len = dataObjWriteInpBBuf->len; bytesWritten = rcDataObjWrite (conn, dataObjWriteInp, dataObjWriteInpBBuf); if (bytesWritten < dataObjWriteInp->len) { rodsLog (LOG_ERROR, "putFile: Read %d bytes, Wrote %d bytes.\n ", dataObjWriteInp->len, bytesWritten); return (SYS_COPY_LEN_ERR); } else { gap -= toRead; *writtenSinceUpdated += toRead; *dataSegLen += toRead; if (*writtenSinceUpdated >= RESTART_FILE_UPDATE_SIZE) { status = writeLfRestartFile (conn->fileRestart.infoFile, info); if (status < 0) { rodsLog (LOG_ERROR, "putSeg: writeLfRestartFile for %s, status = %d", info->fileName, status); return status; } *writtenSinceUpdated = 0; } } } return 0; } int lfRestartGetWithInfo (rcComm_t *conn, fileRestartInfo_t *info) { rodsLong_t curOffset = 0; bytesBuf_t dataObjReadInpBBuf; int status, i; int localFd, irodsFd; dataObjInp_t dataObjOpenInp; openedDataObjInp_t dataObjReadInp; openedDataObjInp_t dataObjLseekInp; openedDataObjInp_t dataObjCloseInp; fileLseekOut_t *dataObjLseekOut = NULL; int writtenSinceUpdated = 0; rodsLong_t gap; #ifdef windows_platform localFd = iRODSNt_bopen(info->fileName, O_RDONLY,0); #else localFd = open (info->fileName, O_RDWR, 0); #endif if (localFd < 0) { /* error */ status = USER_FILE_DOES_NOT_EXIST - errno; rodsLogError (LOG_ERROR, status, "cannot open local file %s, status = %d", info->fileName, status); return (status); } bzero (&dataObjOpenInp, sizeof (dataObjOpenInp)); rstrcpy (dataObjOpenInp.objPath, info->objPath, MAX_NAME_LEN); dataObjOpenInp.openFlags = O_RDONLY; irodsFd = rcDataObjOpen (conn, &dataObjOpenInp); if (irodsFd < 0) { /* error */ rodsLogError (LOG_ERROR, irodsFd, "cannot open iRODS src file %s, status = %d", info->objPath, irodsFd); close (localFd); return (irodsFd); } bzero (&dataObjReadInp, sizeof (dataObjReadInp)); dataObjReadInpBBuf.buf = malloc (TRANS_BUF_SZ); dataObjReadInpBBuf.len = 0; dataObjReadInp.l1descInx = irodsFd; memset (&dataObjLseekInp, 0, sizeof (dataObjLseekInp)); dataObjLseekInp.whence = SEEK_SET; dataObjLseekInp.l1descInx = irodsFd; for (i = 0; i < info->numSeg; i++) { gap = info->dataSeg[i].offset - curOffset; if (gap < 0) { /* should not be here */ } else if (gap > 0) { rodsLong_t tmpLen, *lenToUpdate; if (i == 0) { /* should not be here */ tmpLen = 0; lenToUpdate = &tmpLen; } else { lenToUpdate = &info->dataSeg[i - 1].len; } status = getSeg (conn, gap, localFd, &dataObjReadInp, &dataObjReadInpBBuf, TRANS_BUF_SZ, &writtenSinceUpdated, info, lenToUpdate); if (status < 0) break; curOffset += gap; } if (info->dataSeg[i].len > 0) { curOffset += info->dataSeg[i].len; if (lseek (localFd, curOffset, SEEK_SET) < 0) { status = UNIX_FILE_LSEEK_ERR - errno; rodsLogError (LOG_ERROR, status, "lfRestartWithInfo: lseek to %lld error for %s", curOffset, info->fileName); break; } dataObjLseekInp.offset = curOffset; status = rcDataObjLseek (conn, &dataObjLseekInp, &dataObjLseekOut); if (status < 0) { rodsLogError (LOG_ERROR, status, "lfRestartWithInfo: rcDataObjLseek to %lld error for %s", curOffset, info->objPath); break; } else { if (dataObjLseekOut != NULL) free (dataObjLseekOut); } } } if (status >= 0) { gap = info->fileSize - curOffset; if (gap > 0) { status = getSeg (conn, gap, localFd, &dataObjReadInp, &dataObjReadInpBBuf, TRANS_BUF_SZ, &writtenSinceUpdated, info, &info->dataSeg[i - 1].len); } } free (dataObjReadInpBBuf.buf); close (localFd); memset (&dataObjCloseInp, 0, sizeof (dataObjCloseInp)); dataObjCloseInp.l1descInx = irodsFd; rcDataObjClose (conn, &dataObjCloseInp); return status; } int getSeg (rcComm_t *conn, rodsLong_t segSize, int localFd, openedDataObjInp_t *dataObjReadInp, bytesBuf_t *dataObjReadInpBBuf, int bufLen, int *writtenSinceUpdated, fileRestartInfo_t *info, rodsLong_t *dataSegLen) { rodsLong_t gap = segSize; int bytesWritten, bytesRead; int status; while (gap > 0) { int toRead; if (gap > bufLen) { toRead = bufLen; } else { toRead = (int) gap; } dataObjReadInp->len = dataObjReadInpBBuf->len = toRead; bytesRead = rcDataObjRead (conn, dataObjReadInp, dataObjReadInpBBuf); if (bytesRead < 0) { rodsLog (LOG_ERROR, "getSeg: rcDataObjRead error. status = %d", bytesRead); return bytesRead; } else if (bytesRead == 0) { /* EOF */ rodsLog (LOG_ERROR, "getSeg: rcDataObjRead error. EOF reached. toRead = %d", toRead); return SYS_COPY_LEN_ERR; } bytesWritten = myWrite (localFd, dataObjReadInpBBuf->buf, bytesRead, FILE_DESC_TYPE, NULL); if (bytesWritten != bytesRead) { rodsLog (LOG_ERROR, "getSeg: Read %d bytes, Wrote %d bytes.\n ", bytesRead, bytesWritten); return (SYS_COPY_LEN_ERR); } else { gap -= bytesWritten; *writtenSinceUpdated += bytesWritten; *dataSegLen += bytesWritten; if (*writtenSinceUpdated >= RESTART_FILE_UPDATE_SIZE) { status = writeLfRestartFile (conn->fileRestart.infoFile, info); if (status < 0) { rodsLog (LOG_ERROR, "getSeg: writeLfRestartFile for %s, status = %d", info->fileName, status); return status; } *writtenSinceUpdated = 0; } } } return 0; } int catDataObj (rcComm_t *conn, char *objPath) { dataObjInp_t dataObjOpenInp; openedDataObjInp_t dataObjCloseInp; openedDataObjInp_t dataObjReadInp; bytesBuf_t dataObjReadOutBBuf; int l1descInx; int bytesRead; memset (&dataObjOpenInp, 0, sizeof (dataObjOpenInp)); rstrcpy (dataObjOpenInp.objPath, objPath, MAX_NAME_LEN); dataObjOpenInp.openFlags = O_RDONLY; l1descInx = rcDataObjOpen (conn, &dataObjOpenInp); if (l1descInx < 0) { rodsLogError (LOG_ERROR, l1descInx, "catDataObj: rcDataObjOpen error for %s", objPath); return l1descInx; } bzero (&dataObjReadInp, sizeof (dataObjReadInp)); dataObjReadOutBBuf.buf = malloc (TRANS_BUF_SZ + 1); dataObjReadOutBBuf.len = TRANS_BUF_SZ + 1; dataObjReadInp.l1descInx = l1descInx; dataObjReadInp.len = TRANS_BUF_SZ; while ((bytesRead = rcDataObjRead (conn, &dataObjReadInp, &dataObjReadOutBBuf)) > 0) { char *buf = (char *) dataObjReadOutBBuf.buf; buf[bytesRead] = '\0'; printf ("%s", buf); } free (dataObjReadOutBBuf.buf); printf ("\n"); memset (&dataObjCloseInp, 0, sizeof (dataObjCloseInp)); dataObjCloseInp.l1descInx = l1descInx; rcDataObjClose (conn, &dataObjCloseInp); return 0; }
30.91253
80
0.592287
[ "object" ]
9d0190b627b701b04b5542900891aee3a048033d
8,756
h
C
Thirdparty/ut432pubsrc/Core/Inc/UnStack.h
stijn-volckaert/UT99VulkanDrv
37d0751ce6474ca62465895579529eebc0c4a2dc
[ "Apache-2.0" ]
12
2021-03-20T13:15:46.000Z
2022-03-29T22:35:37.000Z
Thirdparty/ut432pubsrc/Core/Inc/UnStack.h
stijn-volckaert/UT99VulkanDrv
37d0751ce6474ca62465895579529eebc0c4a2dc
[ "Apache-2.0" ]
4
2021-11-14T19:52:39.000Z
2022-03-27T12:02:31.000Z
Thirdparty/ut432pubsrc/Core/Inc/UnStack.h
stijn-volckaert/UT99VulkanDrv
37d0751ce6474ca62465895579529eebc0c4a2dc
[ "Apache-2.0" ]
1
2020-11-03T14:03:46.000Z
2020-11-03T14:03:46.000Z
/*============================================================================= UnStack.h: UnrealScript execution stack definition. Copyright 1997-1999 Epic Games, Inc. All Rights Reserved. Revision history: * Created by Tim Sweeney =============================================================================*/ class UStruct; /*----------------------------------------------------------------------------- Constants & types. -----------------------------------------------------------------------------*/ // Sizes. enum {MAX_STRING_CONST_SIZE = 256 }; enum {MAX_CONST_SIZE = 16 *sizeof(TCHAR) }; enum {MAX_FUNC_PARMS = 16 }; // // UnrealScript intrinsic return value declaration. // #define RESULT_DECL void*const Result // // guardexec mechanism for script debugging. // #define unguardexecSlow unguardfSlow(( TEXT("(%s @ %s : %04X)"), Stack.Object->GetFullName(), Stack.Node->GetFullName(), Stack.Code - &Stack.Node->Script(0) )) #define unguardexec unguardf (( TEXT("(%s @ %s : %04X)"), Stack.Object->GetFullName(), Stack.Node->GetFullName(), Stack.Code - &Stack.Node->Script(0) )) // // State flags. // enum EStateFlags { // State flags. STATE_Editable = 0x00000001, // State should be user-selectable in UnrealEd. STATE_Auto = 0x00000002, // State is automatic (the default state). STATE_Simulated = 0x00000004, // State executes on client side. }; // // Function flags. // enum EFunctionFlags { // Function flags. FUNC_Final = 0x00000001, // Function is final (prebindable, non-overridable function). FUNC_Defined = 0x00000002, // Function has been defined (not just declared). FUNC_Iterator = 0x00000004, // Function is an iterator. FUNC_Latent = 0x00000008, // Function is a latent state function. FUNC_PreOperator = 0x00000010, // Unary operator is a prefix operator. FUNC_Singular = 0x00000020, // Function cannot be reentered. FUNC_Net = 0x00000040, // Function is network-replicated. FUNC_NetReliable = 0x00000080, // Function should be sent reliably on the network. FUNC_Simulated = 0x00000100, // Function executed on the client side. FUNC_Exec = 0x00000200, // Executable from command line. FUNC_Native = 0x00000400, // Native function. FUNC_Event = 0x00000800, // Event function. FUNC_Operator = 0x00001000, // Operator function. FUNC_Static = 0x00002000, // Static function. FUNC_NoExport = 0x00004000, // Don't export intrinsic function to C++. FUNC_Const = 0x00008000, // Function doesn't modify this object. FUNC_Invariant = 0x00010000, // Return value is purely dependent on parameters; no state dependencies or internal state changes. // Combinations of flags. FUNC_FuncInherit = FUNC_Exec | FUNC_Event, FUNC_FuncOverrideMatch = FUNC_Exec | FUNC_Final | FUNC_Latent | FUNC_PreOperator | FUNC_Iterator | FUNC_Static, FUNC_NetFuncFlags = FUNC_Net | FUNC_NetReliable, }; // // Evaluatable expression item types. // enum EExprToken { // Variable references. EX_LocalVariable = 0x00, // A local variable. EX_InstanceVariable = 0x01, // An object variable. EX_DefaultVariable = 0x02, // Default variable for a concrete object. // Tokens. EX_Return = 0x04, // Return from function. EX_Switch = 0x05, // Switch. EX_Jump = 0x06, // Goto a local address in code. EX_JumpIfNot = 0x07, // Goto if not expression. EX_Stop = 0x08, // Stop executing state code. EX_Assert = 0x09, // Assertion. EX_Case = 0x0A, // Case. EX_Nothing = 0x0B, // No operation. EX_LabelTable = 0x0C, // Table of labels. EX_GotoLabel = 0x0D, // Goto a label. EX_EatString = 0x0E, // Ignore a dynamic string. EX_Let = 0x0F, // Assign an arbitrary size value to a variable. EX_DynArrayElement = 0x10, // Dynamic array element.!! EX_New = 0x11, // New object allocation. EX_ClassContext = 0x12, // Class default metaobject context. EX_MetaCast = 0x13, // Metaclass cast. EX_LetBool = 0x14, // Let boolean variable. // EX_EndFunctionParms = 0x16, // End of function call parameters. EX_Self = 0x17, // Self object. EX_Skip = 0x18, // Skippable expression. EX_Context = 0x19, // Call a function through an object context. EX_ArrayElement = 0x1A, // Array element. EX_VirtualFunction = 0x1B, // A function call with parameters. EX_FinalFunction = 0x1C, // A prebound function call with parameters. EX_IntConst = 0x1D, // Int constant. EX_FloatConst = 0x1E, // Floating point constant. EX_StringConst = 0x1F, // String constant. EX_ObjectConst = 0x20, // An object constant. EX_NameConst = 0x21, // A name constant. EX_RotationConst = 0x22, // A rotation constant. EX_VectorConst = 0x23, // A vector constant. EX_ByteConst = 0x24, // A byte constant. EX_IntZero = 0x25, // Zero. EX_IntOne = 0x26, // One. EX_True = 0x27, // Bool True. EX_False = 0x28, // Bool False. EX_NativeParm = 0x29, // Native function parameter offset. EX_NoObject = 0x2A, // NoObject. EX_IntConstByte = 0x2C, // Int constant that requires 1 byte. EX_BoolVariable = 0x2D, // A bool variable which requires a bitmask. EX_DynamicCast = 0x2E, // Safe dynamic class casting. EX_Iterator = 0x2F, // Begin an iterator operation. EX_IteratorPop = 0x30, // Pop an iterator level. EX_IteratorNext = 0x31, // Go to next iteration. EX_StructCmpEq = 0x32, // Struct binary compare-for-equal. EX_StructCmpNe = 0x33, // Struct binary compare-for-unequal. EX_UnicodeStringConst = 0x34, // Unicode string constant. // EX_StructMember = 0x36, // Struct member. // EX_GlobalFunction = 0x38, // Call non-state version of a function. // Native conversions. EX_MinConversion = 0x39, // Minimum conversion token. EX_RotatorToVector = 0x39, EX_ByteToInt = 0x3A, EX_ByteToBool = 0x3B, EX_ByteToFloat = 0x3C, EX_IntToByte = 0x3D, EX_IntToBool = 0x3E, EX_IntToFloat = 0x3F, EX_BoolToByte = 0x40, EX_BoolToInt = 0x41, EX_BoolToFloat = 0x42, EX_FloatToByte = 0x43, EX_FloatToInt = 0x44, EX_FloatToBool = 0x45, // EX_ObjectToBool = 0x47, EX_NameToBool = 0x48, EX_StringToByte = 0x49, EX_StringToInt = 0x4A, EX_StringToBool = 0x4B, EX_StringToFloat = 0x4C, EX_StringToVector = 0x4D, EX_StringToRotator = 0x4E, EX_VectorToBool = 0x4F, EX_VectorToRotator = 0x50, EX_RotatorToBool = 0x51, EX_ByteToString = 0x52, EX_IntToString = 0x53, EX_BoolToString = 0x54, EX_FloatToString = 0x55, EX_ObjectToString = 0x56, EX_NameToString = 0x57, EX_VectorToString = 0x58, EX_RotatorToString = 0x59, EX_MaxConversion = 0x60, // Maximum conversion token. // Natives. EX_ExtendedNative = 0x60, EX_FirstNative = 0x70, EX_Max = 0x1000, }; // // Latent functions. // enum EPollSlowFuncs { EPOLL_Sleep = 384, EPOLL_FinishAnim = 385, EPOLL_FinishInterpolation = 302, }; /*----------------------------------------------------------------------------- Execution stack helpers. -----------------------------------------------------------------------------*/ // // Information about script execution at one stack level. // struct CORE_API FFrame : public FOutputDevice { // Variables. UStruct* Node; UObject* Object; BYTE* Code; BYTE* Locals; // Constructors. FFrame( UObject* InObject ); FFrame( UObject* InObject, UStruct* InNode, INT CodeOffset, void* InLocals ); // Functions. void Step( UObject* Context, RESULT_DECL ); void Serialize( const TCHAR* V, enum EName Event ); INT ReadInt(); UObject* ReadObject(); FLOAT ReadFloat(); INT ReadWord(); FName ReadName(); }; // // Information about script execution at the main stack level. // This part of an actor's script state is saveable at any time. // struct CORE_API FStateFrame : public FFrame { // Variables. FFrame* CurrentFrame; UState* StateNode; QWORD ProbeMask; INT LatentAction; // Functions. FStateFrame( UObject* InObject ); const TCHAR* Describe(); }; /*----------------------------------------------------------------------------- Script execution helpers. -----------------------------------------------------------------------------*/ // // Base class for UnrealScript iterator lists. // struct FIteratorList { FIteratorList* Next; FIteratorList() {} FIteratorList( FIteratorList* InNext ) : Next( InNext ) {} FIteratorList* GetNext() { return (FIteratorList*)Next; } }; /*----------------------------------------------------------------------------- The End. -----------------------------------------------------------------------------*/
34.608696
160
0.623458
[ "object", "vector" ]
9d051d76a93820f2fa406a8cb8bc619a1156e4c2
39,967
h
C
repos/plywood/src/math/math/ply-math/Vector.h
tiaanl/plywood
c3a77306cdeb590ebf2ff193ca8965a4bd7de3e7
[ "MIT" ]
null
null
null
repos/plywood/src/math/math/ply-math/Vector.h
tiaanl/plywood
c3a77306cdeb590ebf2ff193ca8965a4bd7de3e7
[ "MIT" ]
null
null
null
repos/plywood/src/math/math/ply-math/Vector.h
tiaanl/plywood
c3a77306cdeb590ebf2ff193ca8965a4bd7de3e7
[ "MIT" ]
null
null
null
/*------------------------------------ ///\ Plywood C++ Framework \\\/ https://plywood.arc80.com/ ------------------------------------*/ #pragma once #include <ply-math/Core.h> #include <ply-math/Box.h> #include <ply-math/BoolVector.h> namespace ply { struct Quaternion; struct Float2; struct Float3; struct Float4; //------------------------------------------------------------------------------------------------ /*! A vector with two floating-point components `x` and `y`. */ struct Float2 { /*! \beginGroup */ float x; float y; /*! \endGroup */ /*! \category Constructors Constructs an uninitialized `Float2`. */ PLY_INLINE Float2() = default; /*! Constructs a `Float2` with both components set to `t`. Float2 v = {1}; StdOut::text() << v; // "{1, 1}" */ PLY_INLINE Float2(float t) : x{t}, y{t} { } /*! Constructs a `Float2` from the given components. Float2 v = {1, 0}; */ PLY_INLINE Float2(float x, float y) : x{x}, y{y} { } /*! \category Assignment Operator Copy assignment. Declared with an [lvalue ref-qualifier](https://en.cppreference.com/w/cpp/language/member_functions#ref-qualified_member_functions) so that it's an error to assign to an rvalue. a.normalized() = b; // error */ PLY_INLINE void operator=(const Float2& arg) & { x = arg.x; y = arg.y; } /*! \category Arithmetic Operators \category Comparison Functions \category Geometric Functions \category Length Functions Returns the square of the length of the vector. */ PLY_INLINE float length2() const { return x * x + y * y; } /*! Returns the length of the vector. Equivalent to `sqrtf(this->length2())`. */ PLY_INLINE float length() const { return sqrtf(length2()); } /*! Returns `true` if the squared length of the vector is sufficiently close to 1.0. The threshold is given by `thresh`. */ PLY_INLINE bool isUnit(float thresh = 0.001f) const { return fabsf(1.f - length2()) < thresh; } /*! Returns a unit-length vector having the same direction as `this`. No safety check is performed. */ PLY_NO_DISCARD Float2 normalized() const; /*! Returns a unit-length vector having the same direction as `this` with safety checks. */ PLY_NO_DISCARD Float2 safeNormalized(const Float2& fallback = {1, 0}, float epsilon = 1e-20f) const; /*! \category Conversion Functions Converts to another 2D vector type such as `IntVec2` or `Int2<s16>`. Float2 a = {4, 5}; IntVec2 b = a.to<IntVec2>(); */ template <typename OtherVec2> PLY_INLINE OtherVec2 to() const { using T = decltype(OtherVec2::x); PLY_STATIC_ASSERT(sizeof(OtherVec2) == sizeof(T) * 2); return {(T) x, (T) y}; } /*! \category Color Functions \beginGroup Convenience functions for interpreting the vector as a color. The `r()` and `g()` functions are aliases for the `x` and `y` components respectively. Float4 c = {1.0f, 0.8f}; StdOut::text().format("{}, {}", c.r(), c.g()); // "1.0, 0.8" */ PLY_INLINE float& r() { return x; } PLY_INLINE float r() const { return x; } PLY_INLINE float& g() { return y; } PLY_INLINE float g() const { return y; } /*! \endGroup */ /*! \category Swizzle Functions \beginGroup Returns a new vector whose components are taken from the given indices. `x` and `y` are at indices 0 and 1 respectively. Similar to [GLSL swizzling](https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Swizzling) except that the components are specified by numeric index, and you can't use it to modify the original vector; only to read from it. Float2 v = {4, 5}; StdOut::text() << v.swizzle(1, 0); // "{5, 4}" StdOut::text() << v.swizzle(0, 1, 1, 0); // "{4, 5, 5, 4}" These functions work correctly in the current version of all major compilers even though they use type punning, which is undefined behavior in standard C++. */ PLY_INLINE PLY_NO_DISCARD Float2 swizzle(u32 i0, u32 i1) const; PLY_INLINE PLY_NO_DISCARD Float3 swizzle(u32 i0, u32 i1, u32 i2) const; PLY_INLINE PLY_NO_DISCARD Float4 swizzle(u32 i0, u32 i1, u32 i2, u32 i3) const; /*! \endGroup */ }; /*! \addToClass Float2 \category Arithmetic Operators Unary negation. */ PLY_INLINE Float2 operator-(const Float2& a) { return {-a.x, -a.y}; } /*! \beginGroup Returns a vector whose components are the result of applying the given operation to the corresponding components of `a` and `b`. Each component is acted on independently. StdOut::text() << Float2{2, 3} * Float2{4, 1}; // "{8, 3}" If you specify a scalar value in place of a `Float2`, it will be promoted to a `Float2` by replicating the value to each component. StdOut::text() << Float2{2, 3} * 2; // "{4, 6}" StdOut::text() << 8 / Float2{2, 4}; // "{4, 2}" */ PLY_INLINE Float2 operator+(const Float2& a, const Float2& b) { return {a.x + b.x, a.y + b.y}; } PLY_INLINE Float2 operator-(const Float2& a, const Float2& b) { return {a.x - b.x, a.y - b.y}; } PLY_INLINE Float2 operator*(const Float2& a, const Float2& b) { return {a.x * b.x, a.y * b.y}; } PLY_INLINE Float2 operator/(const Float2& a, const Float2& b) { return {a.x / b.x, a.y / b.y}; } /*! \endGroup */ PLY_INLINE Float2 operator/(const Float2& a, float b) { float oob = 1.f / b; return {a.x * oob, a.y * oob}; } /*! \beginGroup In-place versions of the above operators. Float2 v = {2, 3}; v *= {4, 1}; StdOut::text() << v; // "{8, 3}" */ PLY_INLINE void operator+=(Float2& a, const Float2& b) { a.x += b.x; a.y += b.y; } PLY_INLINE void operator-=(Float2& a, const Float2& b) { a.x -= b.x; a.y -= b.y; } PLY_INLINE void operator*=(Float2& a, const Float2& b) { a.x *= b.x; a.y *= b.y; } PLY_INLINE void operator/=(Float2& a, const Float2& b) { a.x /= b.x; a.y /= b.y; } /*! \endGroup */ PLY_INLINE void operator/=(Float2& a, float b) { float oob = 1.f / b; a.x *= oob; a.y *= oob; } /*! \category Geometric Functions Returns the dot product of two vectors. StdOut::text() << dot(Float2{1, 0}, Float2{3, 4}); // "2" */ PLY_INLINE float dot(const Float2& a, const Float2& b) { return a.x * b.x + a.y * b.y; } /*! Returns the cross product of two vectors. StdOut::text() << cross(Float2{1, 0}, Float2{3, 4}); // "4" */ PLY_INLINE float cross(const Float2& a, const Float2& b) { return a.x * b.y - a.y * b.x; } /*! \category Componentwise Functions Returns a copy of `v` with each component constrained to lie within the range determined by the corresponding components of `mins` and `maxs`. Float2 v = {3, 1.5f}; StdOut::text() << clamp(v, Float2{0, 1}, Float2{1, 2}); // "{1, 1.5}" StdOut::text() << clamp(v, 0, 1); // "{1, 1}" */ PLY_INLINE Float2 clamp(const Float2& v, const Float2& mins, const Float2& maxs) { return {clamp(v.x, mins.x, maxs.x), clamp(v.y, mins.y, maxs.y)}; } /*! Returns a vector with each component set to the absolute value of the corresponding component of `a`. StdOut::text() << abs(Float2{-2, 3}); // "{2, 3}" */ PLY_INLINE Float2 abs(const Float2& a) { return {fabsf(a.x), fabsf(a.y)}; } /*! Returns a vector with each component set to the corresponding component of `a` raised to the power of the corresponding component of `b`. StdOut::text() << pow(Float2{1, 2}, Float2{2, 3}); // "{1, 8}" StdOut::text() << pow(Float2{1, 2}, 2); // "{1, 4}" */ PLY_INLINE Float2 pow(const Float2& a, const Float2& b) { return {powf(a.x, b.x), powf(a.y, b.y)}; } /*! Returns a vector with each component set to minimum of the corresponding components of `a` and `b`. StdOut::text() << min(Float2{0, 1}, Float2{1, 0}); // "{0, 0}" */ PLY_INLINE Float2 min(const Float2& a, const Float2& b) { return {min(a.x, b.x), min(a.y, b.y)}; } /*! Returns a vector with each component set to maximum of the corresponding components of `a` and `b`. StdOut::text() << max(Float2{0, 1}, Float2{1, 0}); // "{1, 1}" */ PLY_INLINE Float2 max(const Float2& a, const Float2& b) { return {max(a.x, b.x), max(a.y, b.y)}; } /*! \category Comparison Functions \beginGroup Returns `true` if the vectors are equal (or not equal) using floating-point comparison. In particular, `Float2{0.f} == Float2{-0.f}` is `true`. */ PLY_INLINE bool operator==(const Float2& a, const Float2& b) { return a.x == b.x && a.y == b.y; } PLY_INLINE bool operator!=(const Float2& a, const Float2& b) { return !(a == b); } /*! \endGroup */ /*! Returns `true` if `a` is approximately equal to `b`. The tolerance is given by `epsilon`. Float2 v = {0.9999f, 0.0001f}; StdOut::text() << isNear(v, Float2{1, 0}, 1e-3f); // "true" */ PLY_INLINE bool isNear(const Float2& a, const Float2& b, float epsilon) { return (b - a).length2() <= square(epsilon); } /*! \beginGroup These functions compare each component individually. The result of each comparison is returned in a `Bool2`. Call `all()` to check if the result was `true` for all components, or call `any()` to check if the result was `true` for any component. StdOut::text() << all(Float2{1, 2} > Float2{0, 1}); // "true" These functions are useful for testing whether a point is inside a box. See the implementation of `Box<>::contains` for an example. */ PLY_INLINE Bool2 operator<(const Float2& a, const Float2& b) { return {a.x < b.x, a.y < b.y}; } PLY_INLINE Bool2 operator<=(const Float2& a, const Float2& b) { return {a.x <= b.x, a.y <= b.y}; } PLY_INLINE Bool2 operator>(const Float2& a, const Float2& b) { return {a.x > b.x, a.y > b.y}; } PLY_INLINE Bool2 operator>=(const Float2& a, const Float2& b) { return {a.x >= b.x, a.y >= b.y}; } /*! \endGroup */ /*! \category Rounding Functions \beginGroup Returns a vector with each component set to the rounded result of the corresponding component of `vec`. The optional `spacing` argument can be used to round to arbitrary spacings. Most precise when `spacing` is a power of 2. StdOut::text() << roundUp(Float2{-0.3f, 1.4f}); // "{0, 2}" StdOut::text() << roundDown(Float2{1.8f}, 0.5f); // "{1.5, 1.5}" */ PLY_INLINE Float2 roundUp(const Float2& value, float spacing = 1) { return {roundUp(value.x, spacing), roundUp(value.y, spacing)}; } PLY_INLINE Float2 roundDown(const Float2& value, float spacing = 1) { return {roundDown(value.x, spacing), roundDown(value.y, spacing)}; } PLY_INLINE Float2 roundNearest(const Float2& value, float spacing = 1) { // Good to let the compiler see the spacing so it can optimize the divide by constant return {roundNearest(value.x, spacing), roundNearest(value.y, spacing)}; } /*! \endGroup */ /*! Returns `true` if every component of `vec` is already rounded. The optional `spacing` argument can be used to round to arbitrary spacings. Most precise when `spacing` is a power of 2. StdOut::text() << isRounded(Float2{1.5f, 2.5f}, 0.5f); // "true" */ PLY_INLINE bool isRounded(const Float2& value, float spacing = 1) { return roundNearest(value, spacing) == value; } //------------------------------------------------------------------------------------------------ /*! A vector with three floating-point components `x`, `y` and `z`. */ struct Float3 { /*! \beginGroup */ float x; float y; float z; /*! \endGroup */ /*! \category Constructors Constructs an uninitialized `Float3`. */ PLY_INLINE Float3() = default; /*! Constructs a `Float3` with all components set to `t`. Float3 v = {1}; StdOut::text() << v; // "{1, 1, 1}" */ PLY_INLINE Float3(float t) : x{t}, y{t}, z{t} { } // Catch the case where 2 scalars are passed to constructor. // This would otherwise promote the first scalar to Float2: Float3(float, float) = delete; /*! Constructs a `Float3` from the given components. Float3 v = {1, 0, 0}; */ PLY_INLINE Float3(float x, float y, float z) : x{x}, y{y}, z{z} { } /*! Constructs a `Float3` from a `Float2` and a third component. Float2 a = {1, 2}; StdOut::text() << Float3{a, 0}; // "{1, 2, 0}" */ PLY_INLINE Float3(const Float2& v, float z) : x{v.x}, y{v.y}, z{z} { } /*! \category Assignment Operator Copy assignment. Declared with an [lvalue ref-qualifier](https://en.cppreference.com/w/cpp/language/member_functions#ref-qualified_member_functions) so that it's an error to assign to an rvalue. a.normalized() = b; // error */ PLY_INLINE void operator=(const Float3& arg) & { x = arg.x; y = arg.y; z = arg.z; } /*! \category Arithmetic Operators \category Comparison Functions \category Geometric Functions \category Length Functions Returns the square of the length of the vector. */ PLY_INLINE float length2() const { return x * x + y * y + z * z; } /*! Returns the length of the vector. Equivalent to `sqrtf(this->length2())`. */ PLY_INLINE float length() const { return sqrtf(length2()); } /*! Returns `true` if the squared length of the vector is sufficiently close to 1.0. The threshold is given by `thresh`. */ PLY_INLINE bool isUnit(float thresh = 0.001f) const { return fabsf(1.f - length2()) < thresh; } /*! Returns a unit-length vector having the same direction as `this`. No safety check is performed. */ PLY_NO_DISCARD Float3 normalized() const; /*! Returns a unit-length vector having the same direction as `this` with safety checks. */ PLY_NO_DISCARD Float3 safeNormalized(const Float3& fallback = {1, 0, 0}, float epsilon = 1e-20f) const; /*! \category Conversion Functions Returns a const reference to the first two components as a `Float2` using type punning. This should only be used as a temporary expression. Float3 v = {4, 5, 6}; StdOut::text() << v.asFloat2(); // "{4, 5}" */ PLY_INLINE const Float2& asFloat2() const { PLY_PUN_SCOPE return reinterpret_cast<const Float2&>(*this); } /*! Converts to another 3D vector type such as `IntVec3` or `Int3<s16>`. Float3 a = {4, 5, 6}; IntVec3 b = a.to<IntVec3>(); */ template <typename OtherVec3> PLY_INLINE OtherVec3 to() const { using T = decltype(OtherVec3::x); PLY_STATIC_ASSERT(sizeof(OtherVec3) == sizeof(T) * 3); return {(T) x, (T) y, (T) z}; } /*! \category Color Functions \beginGroup Convenience functions for interpreting the vector as a color. The `r()`, `g()` and `b()` functions are aliases for the `x`, `y` and `z` components respectively. Float3 c = {1.0f, 0.8f, 0.7f}; StdOut::text().format("{}, {}, {}", c.r(), c.g(), c.b()); // "1.0, 0.8, 0.7" */ PLY_INLINE float& r() { return x; } PLY_INLINE float r() const { return x; } PLY_INLINE float& g() { return y; } PLY_INLINE float g() const { return y; } PLY_INLINE float& b() { return z; } PLY_INLINE float b() const { return z; } /*! \endGroup */ /*! \category Swizzle Functions \beginGroup Returns a new vector whose components are taken from the given indices. `x`, `y` and `z` are at indices 0, 1 and 2 respectively. Similar to [GLSL swizzling](https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Swizzling) except that the components are specified by numeric index, and you can't use it to modify the original vector; only to read from it. Float3 v = {4, 5, 6}; StdOut::text() << v.swizzle(1, 0); // "{5, 4}" StdOut::text() << v.swizzle(2, 0, 2, 1); // "{6, 4, 6, 5}" These functions work correctly in the current version of all major compilers even though they use type punning, which is undefined behavior in standard C++. */ PLY_INLINE PLY_NO_DISCARD Float2 swizzle(u32 i0, u32 i1) const; PLY_INLINE PLY_NO_DISCARD Float3 swizzle(u32 i0, u32 i1, u32 i2) const; PLY_INLINE PLY_NO_DISCARD Float4 swizzle(u32 i0, u32 i1, u32 i2, u32 i3) const; /*! \endGroup */ }; /*! \addToClass Float3 \category Arithmetic Operators Unary negation. */ PLY_INLINE Float3 operator-(const Float3& a) { return {-a.x, -a.y, -a.z}; } /*! \beginGroup Returns a vector whose components are the result of applying the given operation to the corresponding components of `a` and `b`. Each component is acted on independently. StdOut::text() << Float3{2, 3, 2} * Float3{4, 1, 2}; // "{8, 3, 4}" If you specify a scalar value in place of a `Float3`, it will be promoted to a `Float3` by replicating the value to each component. StdOut::text() << Float3{2, 3, 2} * 2; // "{4, 6, 4}" StdOut::text() << 8 / Float3{2, 4, 1}; // "{4, 2, 8}" */ PLY_INLINE Float3 operator+(const Float3& a, const Float3& b) { return {a.x + b.x, a.y + b.y, a.z + b.z}; } PLY_INLINE Float3 operator-(const Float3& a, const Float3& b) { return {a.x - b.x, a.y - b.y, a.z - b.z}; } PLY_INLINE Float3 operator*(const Float3& a, const Float3& b) { return {a.x * b.x, a.y * b.y, a.z * b.z}; } PLY_INLINE Float3 operator/(const Float3& a, const Float3& b) { return {a.x / b.x, a.y / b.y, a.z / b.z}; } /*! \endGroup */ PLY_INLINE Float3 operator/(const Float3& a, float b) { float oob = 1.f / b; return {a.x * oob, a.y * oob, a.z * oob}; } /*! \beginGroup In-place versions of the above operators. Float3 v = {2, 3, 2}; v *= {4, 1, 2}; StdOut::text() << v; // "{8, 3, 4}" */ PLY_INLINE void operator+=(Float3& a, const Float3& b) { a.x += b.x; a.y += b.y; a.z += b.z; } PLY_INLINE void operator-=(Float3& a, const Float3& b) { a.x -= b.x; a.y -= b.y; a.z -= b.z; } PLY_INLINE void operator*=(Float3& a, const Float3& b) { a.x *= b.x; a.y *= b.y; a.z *= b.z; } PLY_INLINE void operator/=(Float3& a, const Float3& b) { a.x /= b.x; a.y /= b.y; a.z /= b.z; } /*! \endGroup */ PLY_INLINE void operator/=(Float3& a, float b) { float oob = 1.f / b; a.x *= oob; a.y *= oob; a.z *= oob; } /*! \category Geometric Functions Returns the dot product of two vectors. StdOut::text() << dot(Float3{2, 3, 1}, Float3{4, 5, 1}); // "24" */ PLY_INLINE float dot(const Float3& a, const Float3& b) { return a.x * b.x + a.y * b.y + a.z * b.z; } /*! Returns the cross product of two vectors. StdOut::text() << cross(Float3{1, 0, 0}, Float3{0, 1, 0}); // "{0, 0, 1}" */ Float3 cross(const Float3& a, const Float3& b); /*! \category Componentwise Functions Returns a copy of `v` with each component constrained to lie within the range determined by the corresponding components of `mins` and `maxs`. Float3 v = {3, 1.5f, 0}; StdOut::text() << clamp(v, Float3{0, 1, 2}, Float3{1, 2, 3}); // "{1, 1.5, 2}" StdOut::text() << clamp(v, 0, 1); // "{1, 1, 0}" */ Float3 clamp(const Float3& v, const Float3& mins, const Float3& maxs); /*! Returns a vector with each component set to the absolute value of the corresponding component of `a`. StdOut::text() << abs(Float3{-2, 3, 0}); // "{2, 3, 0}" */ PLY_INLINE Float3 abs(const Float3& a) { return {fabsf(a.x), fabsf(a.y), fabsf(a.z)}; } /*! Returns a vector with each component set to the corresponding component of `a` raised to the power of the corresponding component of `b`. StdOut::text() << pow(Float3{1, 2, 2}, Float3{2, 3, 1}); // "{1, 8, 2}" StdOut::text() << pow(Float3{1, 2, 3}, 2); // "{1, 4, 9}" */ Float3 pow(const Float3& a, const Float3& b); /*! Returns a vector with each component set to minimum of the corresponding components of `a` and `b`. StdOut::text() << min(Float3{0, 1, 0}, Float3{1, 0, 1}); // "{0, 0, 0}" */ PLY_INLINE Float3 min(const Float3& a, const Float3& b) { return {min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)}; } /*! Returns a vector with each component set to maximum of the corresponding components of `a` and `b`. StdOut::text() << max(Float3{0, 1, 0}, Float3{1, 0, 1}); // "{1, 1, 1}" */ PLY_INLINE Float3 max(const Float3& a, const Float3& b) { return {max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)}; } /*! \category Comparison Functions \beginGroup Returns `true` if the vectors are equal (or not equal) using floating-point comparison. In particular, `Float3{0.f} == Float3{-0.f}` is `true`. */ PLY_INLINE bool operator==(const Float3& a, const Float3& b) { return a.x == b.x && a.y == b.y && a.z == b.z; } PLY_INLINE bool operator!=(const Float3& a, const Float3& b) { return !(a == b); } /*! \endGroup */ /*! Returns `true` if `a` is approximately equal to `b`. The tolerance is given by `epsilon`. Float3 v = {0.9999f, 0.0001f, 1.9999f}; StdOut::text() << isNear(v, Float3{1, 0, 2}, 1e-3f); // "true" */ PLY_INLINE bool isNear(const Float3& a, const Float3& b, float epsilon) { return (b - a).length2() <= square(epsilon); } /*! \beginGroup These functions compare each component individually. The result of each comparison is returned in a `Bool3`. Call `all()` to check if the result was `true` for all components, or call `any()` to check if the result was `true` for any component. StdOut::text() << all(Float3{1, 2, 3} > Float3{0, 1, 2}); // "true" These functions are useful for testing whether a point is inside a box. See the implementation of `Box<>::contains` for an example. */ PLY_INLINE Bool3 operator<(const Float3& a, const Float3& b) { return {a.x < b.x, a.y < b.y, a.z < b.z}; } PLY_INLINE Bool3 operator<=(const Float3& a, const Float3& b) { return {a.x <= b.x, a.y <= b.y, a.z <= b.z}; } PLY_INLINE Bool3 operator>(const Float3& a, const Float3& b) { return {a.x > b.x, a.y > b.y, a.z > b.z}; } PLY_INLINE Bool3 operator>=(const Float3& a, const Float3& b) { return {a.x >= b.x, a.y >= b.y, a.z >= b.z}; } /*! \endGroup */ /*! \category Rounding Functions \beginGroup Returns a vector with each component set to the rounded result of the corresponding component of `vec`. The optional `spacing` argument can be used to round to arbitrary spacings. Most precise when `spacing` is a power of 2. StdOut::text() << roundUp(Float3{-0.3f, 1.4f, 0.8f}); // "{0, 2, 1}" StdOut::text() << roundDown(Float3{1.8f}, 0.5f); // "{1.5, 1.5, 1.5}" */ PLY_INLINE Float3 roundUp(const Float3& value, float spacing = 1) { return {roundUp(value.x, spacing), roundUp(value.y, spacing), roundUp(value.z, spacing)}; } PLY_INLINE Float3 roundDown(const Float3& value, float spacing = 1) { return {roundDown(value.x, spacing), roundDown(value.y, spacing), roundDown(value.z, spacing)}; } PLY_INLINE Float3 roundNearest(const Float3& value, float spacing = 1) { return {roundNearest(value.x, spacing), roundNearest(value.y, spacing), roundNearest(value.z, spacing)}; } /*! \endGroup */ /*! Returns `true` if every component of `vec` is already rounded. The optional `spacing` argument can be used to round to arbitrary spacings. Most precise when `spacing` is a power of 2. StdOut::text() << isRounded(Float3{1.5f, 0.5f, 0}, 0.5f); // "true" */ PLY_INLINE bool isRounded(const Float3& value, float spacing = 1) { return roundNearest(value, spacing) == value; } //------------------------------------------------------------------------------------------------ /*! A vector with four floating-point components `x`, `y`, `z` and `w`. */ struct Float4 { /*! \beginGroup `w` is the fourth component. It follows `z` sequentially in memory. */ float x; float y; float z; float w; /*! \endGroup */ /*! \category Constructors Constructs an uninitialized `Float4`. */ PLY_INLINE Float4() = default; /*! Constructs a `Float4` with all components set to `t`. Float4 v = {1}; StdOut::text() << v; // "{1, 1, 1, 1}" */ PLY_INLINE Float4(float t) : x{t}, y{t}, z{t}, w{t} { } // Catch wrong number of scalars passed to constructor. // This would otherwise promote the first argument to Float2 or Float3: Float4(float, float) = delete; Float4(float, float, float) = delete; /*! Constructs a `Float4` from the given components. Float4 v = {1, 0, 0, 0}; */ PLY_INLINE Float4(float x, float y, float z, float w) : x{x}, y{y}, z{z}, w{w} { } /*! Constructs a `Float4` from a `Float3` and a fourth component. Float3 a = {1, 2, 3}; StdOut::text() << Float4{a, 0}; // "{1, 2, 3, 0}" */ PLY_INLINE Float4(const Float3& v, float w) : x{v.x}, y{v.y}, z{v.z}, w{w} { } /*! Constructs a `Float4` from a `Float2` and two additional components. Float2 a = {1, 2}; StdOut::text() << Float4{a, 0, 0}; // "{1, 2, 0, 0}" */ PLY_INLINE Float4(const Float2& v, float z, float w) : x{v.x}, y{v.y}, z{z}, w{w} { } /*! \category Assignment Operator Copy assignment. Declared with an [lvalue ref-qualifier](https://en.cppreference.com/w/cpp/language/member_functions#ref-qualified_member_functions) so that it's an error to assign to an rvalue. a.normalized() = b; // error */ PLY_INLINE void operator=(const Float4& arg) & { x = arg.x; y = arg.y; z = arg.z; w = arg.w; } /*! \category Arithmetic Operators \category Comparison Functions \category Geometric Functions \category Length Functions Returns the square of the length of the vector. */ float length2() const { return x * x + y * y + z * z + w * w; } /*! Returns the length of the vector. Equivalent to `sqrtf(this->length2())`. */ float length() const { return sqrtf(length2()); } /*! Returns `true` if the squared length of the vector is sufficiently close to 1.0. The threshold is given by `thresh`. */ PLY_INLINE bool isUnit(float thresh = 0.001f) const { return fabsf(1.f - length2()) < thresh; } /*! Returns a unit-length vector having the same direction as `this`. No safety check is performed. */ PLY_NO_DISCARD Float4 normalized() const; /*! Returns a unit-length vector having the same direction as `this` with safety checks. */ PLY_NO_DISCARD Float4 safeNormalized(const Float4& fallback = {1, 0, 0, 0}, float epsilon = 1e-20f) const; /*! \category Conversion Functions Returns a const reference to the first two components as a `Float2` using type punning. This should only be used as a temporary expression. Float4 v = {4, 5, 6, 7}; StdOut::text() << v.asFloat2(); // "{4, 5}" */ PLY_INLINE const Float2& asFloat2() const { PLY_PUN_SCOPE return reinterpret_cast<const Float2&>(*this); } /*! Returns a const reference to the first three components as a `Float3` using type punning. This should only be used as a temporary expression. Float4 v = {4, 5, 6, 7}; StdOut::text() << v.asFloat3(); // "{4, 5, 6}" */ PLY_INLINE const Float3& asFloat3() const { PLY_PUN_SCOPE return reinterpret_cast<const Float3&>(*this); } /*! Casts to `Quaternion` using type punning. This should only be used as a temporary expression. */ PLY_INLINE const Quaternion& asQuaternion() const; /*! Converts to another 4D vector type such as `IntVec4` or `Int4<s16>`. Float4 a = {4, 5, 6, 7}; IntVec4 b = a.to<IntVec4>(); */ template <typename OtherVec4> OtherVec4 to() const { using T = decltype(OtherVec4::x); PLY_STATIC_ASSERT(sizeof(OtherVec4) == sizeof(T) * 4); return {(T) x, (T) y, (T) z, (T) w}; } /*! \category Color Functions \beginGroup Convenience functions for interpreting the vector as a color. The `r()`, `g()`, `b()` and `a()` functions are aliases for the `x`, `y`, `z` and `w` components respectively. Float4 c = {1.0f, 0.8f, 0.7f, 0.5f}; StdOut::text().format("{}, {}, {}, {}", c.r(), c.g(), c.b(), c.a()); // prints "1.0, 0.8, 0.7, 0.5" */ PLY_INLINE float& r() { return x; } PLY_INLINE float r() const { return x; } PLY_INLINE float& g() { return y; } PLY_INLINE float g() const { return y; } PLY_INLINE float& b() { return z; } PLY_INLINE float b() const { return z; } PLY_INLINE float& a() { return w; } PLY_INLINE float a() const { return w; } /*! \endGroup */ /*! \category Swizzle Functions \beginGroup Returns a new vector whose components are taken from the given indices. `x`, `y`, `z` and `w` are at indices 0, 1, 2 and 3 respectively. Similar to [GLSL swizzling](https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Swizzling) except that the components are specified by numeric index, and you can't use it to modify the original vector; only to read from it. Float4 v = {4, 5, 6, 0}; StdOut::text() << v.swizzle(1, 0); // "{5, 4}" StdOut::text() << v.swizzle(2, 3, 2, 1); // "{6, 0, 6, 5}" These functions work correctly in the current version of all major compilers even though they use type punning, which is undefined behavior in standard C++. */ PLY_INLINE PLY_NO_DISCARD Float2 swizzle(u32 i0, u32 i1) const; PLY_INLINE PLY_NO_DISCARD Float3 swizzle(u32 i0, u32 i1, u32 i2) const; PLY_INLINE PLY_NO_DISCARD Float4 swizzle(u32 i0, u32 i1, u32 i2, u32 i3) const; /*! \endGroup */ }; /*! \addToClass Float4 \category Arithmetic Operators Unary negation. */ PLY_INLINE Float4 operator-(const Float4& a) { return {-a.x, -a.y, -a.z, -a.w}; } /*! \beginGroup Returns a vector whose components are the result of applying the given operation to the corresponding components of `a` and `b`. Each component is acted on independently. StdOut::text() << Float4{2, 3, 2, 0} * Float4{4, 1, 2, 5}; // "{8, 3, 4, 0}" If you specify a scalar value in place of a `Float4`, it will be promoted to a `Float4` by replicating the value to each component. StdOut::text() << Float4{2, 3, 2, 0} * 2; // "{4, 6, 4, 0}" StdOut::text() << 8 / Float4{2, 4, 1, 8}; // "{4, 2, 8, 1}" */ PLY_INLINE Float4 operator+(const Float4& a, const Float4& b) { return {a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w}; } PLY_INLINE Float4 operator-(const Float4& a, const Float4& b) { return {a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w}; } PLY_INLINE Float4 operator*(const Float4& a, const Float4& b) { return {a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w}; } PLY_INLINE Float4 operator/(const Float4& a, const Float4& b) { return {a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w}; } /*! \endGroup */ PLY_INLINE Float4 operator/(const Float4& a, float b) { float oob = 1.f / b; return {a.x * oob, a.y * oob, a.z * oob, a.w * oob}; } /*! \beginGroup In-place versions of the above operators. Float4 v = {2, 3, 2, 0}; v *= {4, 1, 2, 5}; StdOut::text() << v; // "{8, 3, 4, 0}" */ PLY_INLINE void operator+=(Float4& a, const Float4& b) { a.x += b.x; a.y += b.y; a.z += b.z; a.w += b.w; } PLY_INLINE void operator-=(Float4& a, const Float4& b) { a.x -= b.x; a.y -= b.y; a.z -= b.z; a.w -= b.w; } PLY_INLINE void operator*=(Float4& a, const Float4& b) { a.x *= b.x; a.y *= b.y; a.z *= b.z; a.w *= b.w; } PLY_INLINE void operator/=(Float4& a, const Float4& b) { a.x /= b.x; a.y /= b.y; a.z /= b.z; a.w /= b.w; } /*! \endGroup */ PLY_INLINE void operator/=(Float4& a, float b) { float oob = 1.f / b; a.x *= oob; a.y *= oob; a.z *= oob; a.w *= oob; } /*! \category Geometric Functions Returns the dot product of two vectors. StdOut::text() << dot(Float4{2, 3, 1, 3}, Float4{4, 5, 1, 0}); // "24" */ PLY_INLINE float dot(const Float4& a, const Float4& b) { return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; } /*! \category Componentwise Functions Returns a copy of `v` with each component constrained to lie within the range determined by the corresponding components of `mins` and `maxs`. Float4 v = {3, 1.5f, 0, 0.5f}; StdOut::text() << clamp(v, Float4{0, 1, 2, 3}, Float4{1, 2, 3, 4}); // "{1, 1.5, 2, 3}" StdOut::text() << clamp(v, 0, 1); // "{1, 1, 0, 0.5f}" */ PLY_INLINE Float4 clamp(const Float4& v, const Float4& mins, const Float4& maxs) { return {clamp(v.x, mins.x, maxs.x), clamp(v.y, mins.y, maxs.y), clamp(v.z, mins.z, maxs.z), clamp(v.w, mins.w, maxs.w)}; } /*! Returns a vector with each component set to the absolute value of the corresponding component of `a`. StdOut::text() << abs(Float4{-2, 3, 0, -1}); // "{2, 3, 0, 1}" */ PLY_INLINE Float4 abs(const Float4& a) { return {fabsf(a.x), fabsf(a.y), fabsf(a.z), fabsf(a.w)}; } /*! Returns a vector with each component set to the corresponding component of `a` raised to the power of the corresponding component of `b`. StdOut::text() << pow(Float4{1, 2, 2, 3}, Float4{2, 3, 1, 2}); // "{1, 8, 2, 9}" StdOut::text() << pow(Float4{1, 2, 3, -2}, 2); // "{1, 4, 9, 4}" */ Float4 pow(const Float4& a, const Float4& b); /*! Returns a vector with each component set to minimum of the corresponding components of `a` and `b`. StdOut::text() << min(Float4{0, 1, 0, 1}, Float4{1, 0, 1, 0}); // "{0, 0, 0, 0}" */ PLY_INLINE Float4 min(const Float4& a, const Float4& b) { return {min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)}; } /*! Returns a vector with each component set to maximum of the corresponding components of `a` and `b`. StdOut::text() << max(Float4{0, 1, 0, 1}, Float4{1, 0, 1, 0}); // "{1, 1, 1, 1}" */ PLY_INLINE Float4 max(const Float4& a, const Float4& b) { return {max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)}; } /*! \category Comparison Functions \beginGroup Returns `true` if the vectors are equal (or not equal) using floating-point comparison. In particular, `Float4{0.f} == Float4{-0.f}` is `true`. */ PLY_INLINE bool operator==(const Float4& a, const Float4& b) { return a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w; } PLY_INLINE bool operator!=(const Float4& a, const Float4& b) { return !(a == b); } /*! \endGroup */ /*! Returns `true` if `a` is approximately equal to `b`. The tolerance is given by `epsilon`. Float4 v = {0.9999f, 0.0001f, 1.9999f, 3.0001f}; StdOut::text() << isNear(v, Float4{1, 0, 2, 3}, 1e-3f); // "true" */ PLY_INLINE bool isNear(const Float4& a, const Float4& b, float epsilon) { return (b - a).length2() <= square(epsilon); } /*! \beginGroup These functions compare each component individually. The result of each comparison is returned in a `Bool4`. Call `all()` to check if the result was `true` for all components, or call `any()` to check if the result was `true` for any component. StdOut::text() << all(Float4{1, 2, 3, 4} > Float4{0, 1, 2, 3}); // "true" These functions are useful for testing whether a point is inside a box. See the implementation of `Box<>::contains` for an example. */ PLY_INLINE Bool4 operator<(const Float4& a, const Float4& b) { return {a.x < b.x, a.y < b.y, a.z < b.z, a.w < b.w}; } PLY_INLINE Bool4 operator<=(const Float4& a, const Float4& b) { return {a.x <= b.x, a.y <= b.y, a.z <= b.z, a.w <= b.w}; } PLY_INLINE Bool4 operator>(const Float4& a, const Float4& b) { return {a.x > b.x, a.y > b.y, a.z > b.z, a.w > b.w}; } PLY_INLINE Bool4 operator>=(const Float4& a, const Float4& b) { return {a.x >= b.x, a.y >= b.y, a.z >= b.z, a.w >= b.w}; } /*! \endGroup */ /*! \category Rounding Functions \beginGroup Returns a vector with each component set to the rounded result of the corresponding component of `vec`. The optional `spacing` argument can be used to round to arbitrary spacings. Most precise when `spacing` is a power of 2. StdOut::text() << roundUp(Float4{-0.3f, 1.4f, 0.8f, -1.2f}); // "{0, 2, 1, -1}" StdOut::text() << roundDown(Float4{1.8f}, 0.5f); // "{1.5, 1.5, 1.5, 1.5}" */ PLY_INLINE Float4 roundUp(const Float4& vec, float spacing = 1) { return {roundUp(vec.x, spacing), roundUp(vec.y, spacing), roundUp(vec.z, spacing), roundUp(vec.w, spacing)}; } PLY_INLINE Float4 roundDown(const Float4& vec, float spacing = 1) { return {roundDown(vec.x, spacing), roundDown(vec.y, spacing), roundDown(vec.z, spacing), roundDown(vec.w, spacing)}; } PLY_INLINE Float4 roundNearest(const Float4& vec, float spacing = 1) { return {roundNearest(vec.x, spacing), roundNearest(vec.y, spacing), roundNearest(vec.z, spacing), roundNearest(vec.w, spacing)}; } /*! \endGroup */ /*! Returns `true` if every component of `vec` is already rounded. The optional `spacing` argument can be used to round to arbitrary spacings. Most precise when `spacing` is a power of 2. StdOut::text() << isRounded(Float4{1.5f, 0.5f, 0, 2}, 0.5f); // true */ PLY_INLINE bool isRounded(const Float4& vec, float spacing = 1) { return roundNearest(vec, spacing) == vec; } //--------------------------------- typedef Box<Float2> Rect; typedef Box<Float3> Box3D; Rect rectFromFov(float fovY, float aspect); //--------------------------------- PLY_INLINE PLY_NO_DISCARD Float2 Float2::swizzle(u32 i0, u32 i1) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 2 && i1 < 2); return {v[i0], v[i1]}; } PLY_INLINE PLY_NO_DISCARD Float3 Float2::swizzle(u32 i0, u32 i1, u32 i2) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 2 && i1 < 2 && i2 < 2); return {v[i0], v[i1], v[i2]}; } PLY_INLINE PLY_NO_DISCARD Float4 Float2::swizzle(u32 i0, u32 i1, u32 i2, u32 i3) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 2 && i1 < 2 && i2 < 2 && i3 < 2); return {v[i0], v[i1], v[i2], v[i3]}; } PLY_INLINE PLY_NO_DISCARD Float2 Float3::swizzle(u32 i0, u32 i1) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 3 && i1 < 3); return {v[i0], v[i1]}; } PLY_INLINE PLY_NO_DISCARD Float3 Float3::swizzle(u32 i0, u32 i1, u32 i2) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 3 && i1 < 3 && i2 < 3); return {v[i0], v[i1], v[i2]}; } PLY_INLINE PLY_NO_DISCARD Float4 Float3::swizzle(u32 i0, u32 i1, u32 i2, u32 i3) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 3 && i1 < 3 && i2 < 3 && i2 < 3); return {v[i0], v[i1], v[i2], v[i3]}; } PLY_INLINE PLY_NO_DISCARD Float2 Float4::swizzle(u32 i0, u32 i1) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 4 && i1 < 4); return {v[i0], v[i1]}; } PLY_INLINE PLY_NO_DISCARD Float3 Float4::swizzle(u32 i0, u32 i1, u32 i2) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 4 && i1 < 4 && i2 < 4); return {v[i0], v[i1], v[i2]}; } PLY_INLINE PLY_NO_DISCARD Float4 Float4::swizzle(u32 i0, u32 i1, u32 i2, u32 i3) const { PLY_PUN_SCOPE auto* v = (const float*) this; PLY_ASSERT(i0 < 4 && i1 < 4 && i2 < 4 && i2 < 4); return {v[i0], v[i1], v[i2], v[i3]}; } } // namespace ply
31.694687
110
0.597018
[ "vector", "3d" ]
9daee6e8d715862c1c9f7aec2fdf77004da2de43
6,361
c
C
lib/am335x_sdk/ti/drv/gpio/soc/k2g/GPIO_soc.c
brandonbraun653/Apollo
a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce
[ "MIT" ]
2
2021-12-27T10:19:01.000Z
2022-03-15T07:09:06.000Z
lib/am335x_sdk/ti/drv/gpio/soc/k2g/GPIO_soc.c
brandonbraun653/Apollo
a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce
[ "MIT" ]
null
null
null
lib/am335x_sdk/ti/drv/gpio/soc/k2g/GPIO_soc.c
brandonbraun653/Apollo
a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce
[ "MIT" ]
null
null
null
/** * \file k2g/GPIO_soc.c * * \brief K2G SOC specific GPIO hardware attributes. * * This file contains the GPIO hardware attributes like base address and * interrupt ids. */ /* * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include <ti/csl/csl_utils.h> #include <ti/csl/soc.h> #include <ti/csl/csl_types.h> #include <ti/csl/csl_device_interrupt.h> #include <ti/csl/cslr_bootcfg.h> #include <ti/csl/hw_types.h> #include <ti/drv/gpio/GPIO.h> #include <ti/drv/gpio/soc/GPIO_soc.h> /** \brief Number of gpio pins for each port */ #define GPIO_NUM_PINS_PER_PORT (144U) /** \brief Number of gpio ports present in the soc */ #define GPIO_NUM_PORTS (CSL_GPIO_CNT) GPIO_IntCfg GPIO_defaultIntCfg[GPIO_NUM_PORTS] = { /* GPIO port 0 pins */ { #ifdef _TMS320C6X OSAL_REGINT_INTVEC_EVENT_COMBINER, /* default DSP Interrupt vector number, can be set in GPIO_socSetInitCfg() API */ CSL_C66X_COREPAC_GPIOMUX_INT16, /* GPIO pin int mapped to GPIOMUX event sel 16 */ #else CSL_ARM_GIC_GPIOMUX_INT0 + 32, /* GPIO pin int mapped to GPIOMUX event sel 0 */ 0, #endif INVALID_INTC_MUX_NUM, /* CIC not used for GPIO pin 0 */ 0, 0 }, /* GPIO port 1 pins */ { #ifdef _TMS320C6X OSAL_REGINT_INTVEC_EVENT_COMBINER, CSL_C66X_COREPAC_GPIOMUX_INT17, #else CSL_ARM_GIC_GPIOMUX_INT1 + 32, 0, #endif INVALID_INTC_MUX_NUM, 0, 0 } }; /* GPIO Pin interrupt configurations */ GPIO_IntCfg GPIO_intCfgs[GPIO_NUM_PORTS][GPIO_NUM_PINS_PER_PORT]; /* GPIO Driver hardware attributes */ GPIO_v0_hwAttrsList GPIO_v0_hwAttrs = { { CSL_GPIO_0_REGS, &GPIO_intCfgs[0][0], NULL }, { CSL_GPIO_1_REGS, &GPIO_intCfgs[1][0], NULL } }; /* GPIO configuration structure */ CSL_PUBLIC_CONST GPIOConfigList GPIO_config = { { &GPIO_FxnTable_v0, NULL, &GPIO_v0_hwAttrs[0] }, { &GPIO_FxnTable_v0, NULL, &GPIO_v0_hwAttrs[1] }, { NULL, NULL, NULL } }; /** * \brief This API gets the SoC level of GPIO intial configuration * * \param index GPIO instance index. * \param cfg Pointer to GPIO SOC initial config. * * \return 0 success: -1: error * */ int32_t GPIO_socGetInitCfg(uint32_t index, GPIO_v0_HwAttrs *cfg) { int32_t ret = 0; if (index < GPIO_NUM_PORTS) { *cfg = GPIO_v0_hwAttrs[index]; } else { ret = -1; } return ret; } /** * \brief This API sets the SoC level of GPIO intial configuration * * \param index GPIO instance index. * \param cfg Pointer to GPIO SOC initial config. * * \return 0 success: -1: error * */ int32_t GPIO_socSetInitCfg(uint32_t index, const GPIO_v0_HwAttrs *cfg) { int32_t ret = 0; if (index < GPIO_NUM_PORTS) { GPIO_v0_hwAttrs[index] = *cfg; } else { ret = -1; } return ret; } /** * \brief This API gets the number of GPIO pins per port * and GPIO number of ports * * \param numPins pointer to numPins variable. * \param numPorts pointer to numPorts variable. * * \return none * */ void GPIO_socGetNumPinsPorts(uint32_t *numPins, uint32_t *numPorts) { *numPins = GPIO_NUM_PINS_PER_PORT; *numPorts = GPIO_NUM_PORTS; } /** * \brief This API sets the GPIO MUX for GPIO interrupts * * \param index GPIO instance index. * \param pinNum Pin number of the GPIO instance. * \param cfg pointer to GPIO interrupt configuration data * if NULL use the default configurations. * \param muxEvtSel Event slect number for ARM GPIOMUX interrupt. * * \return 0 success: -1: error * */ int32_t GPIO_socSetIntMux(uint32_t index, uint32_t pinNum, const GPIO_IntCfg *cfg, uint32_t muxEvtSel) { uint32_t intNum; uint32_t addr; GPIO_IntCfg *intCfg; int32_t retVal = 0; /* Get the GPIO pin interrupt number */ if (index == 0) { intNum = pinNum; } else if (index == 1U) { intNum = pinNum + GPIO_NUM_PINS_PER_PORT; if (intNum > 255U) { retVal = -1; } } else { retVal = -1; } if(retVal == 0) { /* Setup GPIO pin interrupt configurations */ intCfg = GPIO_v0_hwAttrs[index].intCfg + pinNum; if (cfg == NULL) { *intCfg = GPIO_defaultIntCfg[index]; } else { *intCfg = *cfg; } /* Setup GPIO interrupt event mux Control */ addr = CSL_BOOT_CFG_REGS + CSL_BOOTCFG_EVENT_MUXCTL0 + muxEvtSel; HW_WR_REG8(addr, intNum); } return (retVal); }
25.242063
124
0.645968
[ "vector" ]
9db7db66e5b18a9038768b56f369b87351f0ec1a
4,922
h
C
Frameworks/CNISDKCoreKit.framework/Headers/CNISDKAPIManager+CheckIn.h
conichiGMBH/conichi-ios-sdk-wiki
d5e7ee9bcecfdd9ac476e47643f4966c68b7ce3d
[ "BSD-4-Clause" ]
null
null
null
Frameworks/CNISDKCoreKit.framework/Headers/CNISDKAPIManager+CheckIn.h
conichiGMBH/conichi-ios-sdk-wiki
d5e7ee9bcecfdd9ac476e47643f4966c68b7ce3d
[ "BSD-4-Clause" ]
null
null
null
Frameworks/CNISDKCoreKit.framework/Headers/CNISDKAPIManager+CheckIn.h
conichiGMBH/conichi-ios-sdk-wiki
d5e7ee9bcecfdd9ac476e47643f4966c68b7ce3d
[ "BSD-4-Clause" ]
null
null
null
// // CNISDKAPIManager+CheckIn.h // conichiSDK // // Created by Anton Domashnev on 8/11/15. // Copyright (c) 2015 conichi. All rights reserved. // #import "CNISDKAPIManager.h" @class CNISDKGuest; @class CNISDKCheckin; NS_ASSUME_NONNULL_BEGIN /** * `CNISDKCheckInFilter` is a class used to filter and sort NSArray with CNISDKCheckin objects */ @interface CNISDKCheckInFilter : NSObject /** * Filters given checkins array by venue, select the newest one * * @param guest given guest * @param venue in which venue we are looking for checkin * @param checkIns array of CNISDKCheckin objects to filter * * @return the newest checkin in the given venue from the given checkIns array */ - (nullable CNISDKCheckin *)lastGuestCheckIn:(CNISDKGuest *)guest inVenue:(CNISDKVenue *)venue fromCheckIns:(NSArray<CNISDKCheckin *> *)checkIns; /** * Filters given checkins array by status 'closed' and get last * * @param checkIns array of CNISDKCheckin objects * * @return the newest checkin from the given checkIns array with 'closed' status */ - (nullable CNISDKCheckin *)lastClosedCheckInfromCheckIns:(NSArray<CNISDKCheckin *> *)checkIns; /** * Filters given checkins array by status 'open' and get last * * @param checkIns array of CNISDKCheckin objects * * @return the newest checkin from the given checkIns array with 'open' status */ - (nullable CNISDKCheckin *)lastOpenCheckInfromCheckIns:(NSArray<CNISDKCheckin *> *)checkIns; /** * Sorts given checkins array by createdAt and get last * * @param guest given guest * @param checkIns array of CNISDKCheckin objects * * @return the newest checkin from the given checkIns array */ - (nullable CNISDKCheckin *)lastGuestCheckIn:(CNISDKGuest *)guest fromCheckIns:(NSArray<CNISDKCheckin *> *)checkIns; @end /** * `CNISDKAPIManager+CheckIn` is a category on CNISDKAPIManager that extends it's functionality with checkin related methods */ @interface CNISDKAPIManager (CheckIn) /** * Fetch all given guest's checkins * * @param guest for which guest should fetch checkins * @param completion - callback block with two parameters * 1. Array of CNISDKCheckin objects * 2. NSError object if request failed */ - (void)fetchCheckInsForGuest:(CNISDKGuest *)guest completion:(nullable CNISDKIDErrorBlock)completion; /** * Fetch detail checkin information for the given checkin object * * @param checkin checkin object to be filled with detail information out * @param completion callback block with two parameters * 1. CNISDKCheckin object if succeeded * 2. NSError object if request failed */ - (void)fetchDetailCheckInInformation:(CNISDKCheckin *)checkin completion:(nullable CNISDKIDErrorBlock)completion; /** * Add rating for the provided checkin. This method will update the given checkin object instead of creating a new one * * @param rating new checkin rating * @param checkin checkin object to rate * @param completion - callback block with two parameters * 1. up to date CNISDKCheckin object * 2. NSError object if request failed */ - (void)addRating:(NSNumber *)rating toCurrentVenueCheckin:(CNISDKCheckin *)checkin completion:(nullable CNISDKIDErrorBlock)completion; /** * Add rating for the checkin with the given id * * @param rating new checkin rating * @param checkinID checkin conichi id to rate * @param completion - callback block with two parameters * 1. new CNISDKCheckin object * 2. NSError object if request failed */ - (void)addRating:(NSNumber *)rating toCheckinWithID:(NSString *)checkinID completion:(nullable CNISDKIDErrorBlock)completion; /** * Creates the check-in object on the conichi backend for the given guest in the given venue * * @param guestID conichi ID of the guest to be checked in * @param venueID conichi ID of the venue where the guest should be checked in * @param completion callback with two parameters * 1. New CNISDKCheckin object if open * 2. NSError object if request failed */ - (void)checkinGuestWithID:(NSString *)guestID inVenueWithID:(NSString *)venueID completion:(nullable CNISDKIDErrorBlock)completion; /** * Uploads the signature svg for the given checkin * * @param checkinID conichi ID of the checkin to upload the signature to * @param signatureSVGData NSData of the signature SVG * @param completion callback with two parameters * 1. updated CNISDKCheckin object if successful * 2. NSError object if request failed */ - (void)uploadSignatureForCheckinWithID:(NSString *)checkinID signatureSVGData:(NSData *)signatureSVGData completion:(nullable CNISDKIDErrorBlock)completion; @end NS_ASSUME_NONNULL_END
36.459259
157
0.713531
[ "object" ]
9db7e03cc6dad111e8800726bdcc450033bab279
944
h
C
Receiver/battery_parameters_receiver.h
clean-code-craft-tcq-1/stream-bms-data-preetikadyan
02034ab7c6ea5e50e7682ac5084bcd75efb8192b
[ "MIT" ]
null
null
null
Receiver/battery_parameters_receiver.h
clean-code-craft-tcq-1/stream-bms-data-preetikadyan
02034ab7c6ea5e50e7682ac5084bcd75efb8192b
[ "MIT" ]
1
2021-06-21T16:22:15.000Z
2021-06-21T16:22:15.000Z
Receiver/battery_parameters_receiver.h
clean-code-craft-tcq-1/stream-bms-data-preetikadyan
02034ab7c6ea5e50e7682ac5084bcd75efb8192b
[ "MIT" ]
2
2021-06-08T09:04:13.000Z
2021-06-21T13:52:34.000Z
#pragma once #include <iostream> #include <vector> #include <string> using namespace std; class Battery_Parameter_Receiver { vector<int> temperature_values; vector<int> soc_values; public: // get data via pipe from console which is written by Sender bool get_data_from_console(); //Extract Temperature values from Sender data void get_temperature_values(string sender_data); // Extract SOC Values from Sender data void get_soc_values(string sender_data); // Calculate maximum value for a parameter of input stream int calculate_parameter_max(vector<int> parameter_values, string parameter_type); // Calculate minimum value for a parameter of input stream int calculate_parameter_min(vector<int> parameter_values, string parameter_type); // Calculate Simple moving average value for last 5 values in the input stream of a parameter int calculate_parameter_sma(vector<int> parameter_values, string parameter_type); };
30.451613
94
0.795551
[ "vector" ]
9db8c5489e363d1d3bb674b78f9ed1925103d7ec
55,470
h
C
include/restincurl/restincurl.h
jgaa/RESTinCurl
cef61e43354063213d476eeb4b212becae238a4b
[ "MIT" ]
10
2019-11-12T04:36:35.000Z
2022-01-28T17:02:01.000Z
pp_analytics_app/client/src/include/restincurl/restincurl.h
cryptohackathon/enclaved-FE
eb485807edc97da43eede232b63ba53f63b84aa7
[ "Apache-2.0" ]
1
2021-09-22T20:41:39.000Z
2021-10-04T16:53:56.000Z
include/restincurl/restincurl.h
jgaa/RESTinCurl
cef61e43354063213d476eeb4b212becae238a4b
[ "MIT" ]
null
null
null
#pragma once /* MIT License Copyright (c) 2018 Jarle Aase Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. On Github: https://github.com/jgaa/RESTinCurl */ /*! \file */ #include <algorithm> #include <atomic> #include <deque> #include <exception> #include <functional> #include <iostream> #include <iterator> #include <map> #include <memory> #include <mutex> #include <string> #include <thread> #include <vector> #include <assert.h> #include <curl/curl.h> #include <curl/easy.h> #include <fcntl.h> #include <string.h> #include <sys/select.h> #include <sys/time.h> #include <unistd.h> #ifdef RESTINCURL_WITH_OPENSSL_THREADS # include <openssl/crypto.h> #endif /*! \def RESTINCURL_MAX_CONNECTIONS * \brief Max concurrent connections * * This option restrains the maximum number of concurrent * connections that will be used at any time. It sets * libcurl's `CURLMOPT_MAXCONNECTS` option, and also * puts any new requests in a waiting queue. As soon as * some active request finish, the oldest waiting request * will be served (FIFO queue). * * The default value is 32 */ #ifndef RESTINCURL_MAX_CONNECTIONS # define RESTINCURL_MAX_CONNECTIONS 32L #endif /*! \def RESTINCURL_ENABLE_ASYNC * \brief Enables or disables asynchronous mode. * * In asynchronous mode, many requests can be * served simultaneously using a worker-thread. * In synchronous mode, you use the current * thread to serve only one request at the time. * * Default is 1 (asynchronous mode enabled). */ #ifndef RESTINCURL_ENABLE_ASYNC # define RESTINCURL_ENABLE_ASYNC 1 #endif /*! \def RESTINCURL_IDLE_TIMEOUT_SEC * \brief How long to wait for the next request before the idle worker-thread is stopped. * * This will delete curl's connection-cache and cause a new thread to be created * and new connections to be made if there are new requests at at later time. * * Note that this option is only relevant in asynchronous mode. * * Default is 60 seconds. */ #ifndef RESTINCURL_IDLE_TIMEOUT_SEC # define RESTINCURL_IDLE_TIMEOUT_SEC 60 #endif /*! \def RESTINCURL_LOG_VERBOSE_ENABLE * \brief Enable very verbose logging * * This option enabled very verbose logging, suitable to * pinpoint problems during development / porting of the library itself. * * Default is 0 (disabled). */ #ifndef RESTINCURL_LOG_VERBOSE_ENABLE # define RESTINCURL_LOG_VERBOSE_ENABLE 0 #endif #if defined(_LOGFAULT_H) && !defined (RESTINCURL_LOG) && !defined (RESTINCURL_LOG_TRACE) # define RESTINCURL_LOG(msg) LFLOG_DEBUG << "restincurl: " << msg # if RESTINCURL_LOG_VERBOSE_ENABLE # define RESTINCURL_LOG_TRACE(msg) LFLOG_IFALL_TRACE("restincurl: " << msg) # endif // RESTINCURL_LOG_VERBOSE_ENABLE #endif #if defined(RESTINCURL_USE_SYSLOG) || defined(RESTINCURL_USE_ANDROID_NDK_LOG) # ifdef RESTINCURL_USE_SYSLOG # include <syslog.h> # endif # ifdef RESTINCURL_USE_ANDROID_NDK_LOG # include <android/log.h> # endif # include <sstream> # define RESTINCURL_LOG(msg) ::restincurl::Log(restincurl::LogLevel::DEBUG).Line() << msg #endif /*! \def RESTINCURL_ENABLE_DEFAULT_LOGGER * \brief Enables a simple built-in logger * * RESTinCurl has a very simple built in logger. * * It writes to either std::clog, the Unix syslog or Androids log facility. * * - Define RESTINCURL_USE_SYSLOG to use syslog * - Define RESTINCURL_USE_ANDROID_NDK_LOG to use the Android NDK logger. * * By default, it will write to std::clog. * * Default value is 0 (disabled) */ #ifndef RESTINCURL_ENABLE_DEFAULT_LOGGER # define RESTINCURL_ENABLE_DEFAULT_LOGGER 0 #endif /*! \def RESTINCURL_LOG * \brief Macro to log debug messages * * If you want to log messages from the library to your own log facility, you * may define this macro to do so. * * Note that the logging statements in the library expect the log `msg` to be * std::ostream compliant. The macro must be able to deal with statement such as: * - RESTINCURL_LOG("test"); * - RESTINCURL_LOG("test " << 1 << " and " << 2); * * If you manually define this macro, you should not define `RESTINCURL_ENABLE_DEFAULT_LOGGER`. */ #ifndef RESTINCURL_LOG # if RESTINCURL_ENABLE_DEFAULT_LOGGER # define RESTINCURL_LOG(msg) std::clog << msg << std::endl # else # define RESTINCURL_LOG(msg) # endif #endif /*! \def RESTINCURL_LOG_TRACE * \brief Macro to log debug messages * * If you want to log trace-messages from the library to your own log facility, you * may define this macro to do so. * * Note that the logging statements in the library expect the log `msg` to be * std::ostream compliant. The macro must be able to deal with statement such as: * - RESTINCURL_LOG_TRACE("test"); * - RESTINCURL_LOG_TRACE("test " << 1 << " and " << 2); * * If you manually define this macro, you should not define `RESTINCURL_ENABLE_DEFAULT_LOGGER`. * * This macro is only called if `RESTINCURL_LOG_VERBOSE_ENABLE` is defined and not 0. */ #ifndef RESTINCURL_LOG_TRACE # if RESTINCURL_LOG_VERBOSE_ENABLE # define RESTINCURL_LOG_TRACE(msg) RESTINCURL_LOG(msg) # else # define RESTINCURL_LOG_TRACE(msg) # endif #endif namespace restincurl { #if defined(RESTINCURL_USE_SYSLOG) || defined(RESTINCURL_USE_ANDROID_NDK_LOG) enum class LogLevel { DEBUG }; class Log { public: Log(const LogLevel level) : level_{level} {} ~Log() { # ifdef RESTINCURL_USE_SYSLOG static const std::array<int, 1> syslog_priority = { LOG_DEBUG }; static std::once_flag syslog_opened; std::call_once(syslog_opened, [] { openlog(nullptr, 0, LOG_USER); }); # endif # ifdef RESTINCURL_USE_ANDROID_NDK_LOG static const std::array<int, 1> android_priority = { ANDROID_LOG_DEBUG }; # endif const auto msg = out_.str(); # ifdef RESTINCURL_USE_SYSLOG syslog(syslog_priority.at(static_cast<int>(level_)), "%s", msg.c_str()); # endif # ifdef RESTINCURL_USE_ANDROID_NDK_LOG __android_log_write(android_priority.at(static_cast<int>(level_)), "restincurl", msg.c_str()); # endif } std::ostringstream& Line() { return out_; } private: const LogLevel level_; std::ostringstream out_; }; #endif using lock_t = std::lock_guard<std::mutex>; /*! The Result from a request\ */ struct Result { Result() = default; Result(const CURLcode& code) { curl_code = code; msg = curl_easy_strerror(code); } /*! Check if the reqtest appears to be successful */ bool isOk() const noexcept { if (curl_code == CURLE_OK) { if ((http_response_code >= 200) && (http_response_code < 300)) { return true; } } return false; } /*! The CURLcode returned by libcurl for this request. * * CURLE_OK (or 0) indicates success. */ CURLcode curl_code = {}; /*! The HTTP result code for the request */ long http_response_code = {}; /*! If the request was unsuccessful (curl_code != 0), the error string reported by libcurl. */ std::string msg; /*! The body of the request returned by the server. * * Note that if you specified your own body handler or body variable, for the request, `body` will be empty. */ std::string body; }; enum class RequestType { GET, PUT, POST, HEAD, DELETE, PATCH, OPTIONS, INVALID }; /*! Completion debug_callback * * This callback is called when a request completes, or fails. * * \param result The result of the request. */ using completion_fn_t = std::function<void (const Result& result)>; /*! Base class for RESTinCurl exceptions */ class Exception : public std::runtime_error { public: Exception(const std::string& msg) : runtime_error(msg) {} }; /*! Exception thrown when some system function, like `pipe()` failed. */ class SystemException : public Exception { public: SystemException(const std::string& msg, const int e) : Exception(msg + " " + strerror(e)), err_{e} {} int getErrorCode() const noexcept { return err_; } private: const int err_; }; /*! Exception thrown when a curl library method failed. */ class CurlException : public Exception { public: CurlException(const std::string msg, const CURLcode err) : Exception(msg + '(' + std::to_string(err) + "): " + curl_easy_strerror(err)) , err_{err} {} CurlException(const std::string msg, const CURLMcode err) : Exception(msg + '(' + std::to_string(err) + "): " + curl_multi_strerror(err)) , err_{err} {} int getErrorCode() const noexcept { return err_; } private: const int err_; }; class EasyHandle { public: using ptr_t = std::unique_ptr<EasyHandle>; using handle_t = decltype(curl_easy_init()); EasyHandle() { RESTINCURL_LOG("EasyHandle created: " << handle_); } ~EasyHandle() { Close(); } void Close() { if (handle_) { RESTINCURL_LOG("Cleaning easy-handle " << handle_); curl_easy_cleanup(handle_); handle_ = nullptr; } } operator handle_t () const noexcept { return handle_; } private: handle_t handle_ = curl_easy_init(); }; /*! Curl option wrapper class * * This is just a thin C++ wrapper over Curl's `curl_easy_setopt()` method. */ class Options { public: Options(EasyHandle& eh) : eh_{eh} {} /*! Set an option * * \param opt CURLoption enum to change * \param value Value to set */ template <typename T> Options& Set(const CURLoption& opt, const T& value) { const auto ret = curl_easy_setopt(eh_, opt, value); if (ret) { throw CurlException( std::string("Setting option ") + std::to_string(opt), ret); } return *this; } /*! Set an option * * \param opt CURLoption enum to change * \param value String value to set */ Options& Set(const CURLoption& opt, const std::string& value) { return Set(opt, value.c_str()); } private: EasyHandle& eh_; }; /*! Abstract base class for Data Handlers * * Data handlers are used to handle libcurl's callback requirements * for input and output data. */ struct DataHandlerBase { virtual ~DataHandlerBase() = default; }; /*! Template implementation for input data to curl during a request. * * This handler deals with the data received from the HTTP server * during a request. This implementation will typically use * T=std::string and just store the received data in a string. For * json/XML payloads that's probably all you need. But if you receive * binary data, you may want to use a container like std::vector or std::deque in stead. */ template <typename T> struct InDataHandler : public DataHandlerBase{ InDataHandler(T& data) : data_{data} { RESTINCURL_LOG_TRACE("InDataHandler address: " << this); } static size_t write_callback(char *ptr, size_t size, size_t nitems, void *userdata) { assert(userdata); auto self = reinterpret_cast<InDataHandler *>(userdata); const auto bytes = size * nitems; if (bytes > 0) { std::copy(ptr, ptr + bytes, std::back_inserter(self->data_)); } return bytes; } T& data_; }; /*! Template implementation for output data to curl during a request. * * This handler deals with the data sent to the HTTP server * during a request (POST, PATCH etc). This implementation will typically use * T=std::string and just store the data in a string. For * json/XML payloads that's probably all you need. But if you send * binary data, you may want to use a container like std::vector or std::deque in stead. */ template <typename T> struct OutDataHandler : public DataHandlerBase { OutDataHandler() = default; OutDataHandler(const T& v) : data_{v} {} OutDataHandler(T&& v) : data_{std::move(v)} {} static size_t read_callback(char *bufptr, size_t size, size_t nitems, void *userdata) { assert(userdata); OutDataHandler *self = reinterpret_cast<OutDataHandler *>(userdata); const auto bytes = size * nitems; auto out_bytes = std::min<size_t>(bytes, (self->data_.size() - self->sendt_bytes_)); std::copy(self->data_.cbegin() + self->sendt_bytes_, self->data_.cbegin() + (self->sendt_bytes_ + out_bytes), bufptr); self->sendt_bytes_ += out_bytes; RESTINCURL_LOG_TRACE("Sent " << out_bytes << " of total " << self->data_.size() << " bytes."); return out_bytes; } T data_; size_t sendt_bytes_ = 0; }; class Request { public: using ptr_t = std::unique_ptr<Request>; Request() : eh_{std::make_unique<EasyHandle>()} { } Request(EasyHandle::ptr_t&& eh) : eh_{std::move(eh)} { } ~Request() { if (headers_) { curl_slist_free_all(headers_); } } void Prepare(const RequestType rq, completion_fn_t completion) { request_type_ = rq; SetRequestType(); completion_ = std::move(completion); } // Synchronous execution. void Execute() { const auto result = curl_easy_perform(*eh_); CallCompletion(result); } void Complete(CURLcode cc, const CURLMSG& /*msg*/) { CallCompletion(cc); } EasyHandle& GetEasyHandle() noexcept { assert(eh_); return *eh_; } RequestType GetRequestType() noexcept { return request_type_; } void SetDefaultInHandler(std::unique_ptr<DataHandlerBase> ptr) { default_in_handler_ = std::move(ptr); } void SetDefaultOutHandler(std::unique_ptr<DataHandlerBase> ptr) { default_out_handler_ = std::move(ptr); } using headers_t = curl_slist *; headers_t& GetHeaders() { return headers_; } std::string& getDefaultInBuffer() { return default_data_buffer_; } private: void CallCompletion(CURLcode cc) { Result result(cc); curl_easy_getinfo (*eh_, CURLINFO_RESPONSE_CODE, &result.http_response_code); RESTINCURL_LOG("Complete: http code: " << result.http_response_code); if (completion_) { if (!default_data_buffer_.empty()) { result.body = std::move(default_data_buffer_); } completion_(result); } } void SetRequestType() { switch(request_type_) { case RequestType::GET: curl_easy_setopt(*eh_, CURLOPT_HTTPGET, 1L); break; case RequestType::PUT: headers_ = curl_slist_append(headers_, "Transfer-Encoding: chunked"); curl_easy_setopt(*eh_, CURLOPT_UPLOAD, 1L); break; case RequestType::POST: headers_ = curl_slist_append(headers_, "Transfer-Encoding: chunked"); curl_easy_setopt(*eh_, CURLOPT_UPLOAD, 0L); curl_easy_setopt(*eh_, CURLOPT_POST, 1L); break; case RequestType::HEAD: curl_easy_setopt(*eh_, CURLOPT_NOBODY, 1L); break; case RequestType::OPTIONS: curl_easy_setopt(*eh_, CURLOPT_CUSTOMREQUEST, "OPTIONS"); break; case RequestType::PATCH: headers_ = curl_slist_append(headers_, "Transfer-Encoding: chunked"); curl_easy_setopt(*eh_, CURLOPT_CUSTOMREQUEST, "PATCH"); break; case RequestType::DELETE: curl_easy_setopt(*eh_, CURLOPT_CUSTOMREQUEST, "DELETE"); break; default: throw Exception("Unsupported request type" + std::to_string(static_cast<int>(request_type_))); } } EasyHandle::ptr_t eh_; RequestType request_type_ = RequestType::INVALID; completion_fn_t completion_; std::unique_ptr<DataHandlerBase> default_out_handler_; std::unique_ptr<DataHandlerBase> default_in_handler_; headers_t headers_ = nullptr; std::string default_data_buffer_; }; #if RESTINCURL_ENABLE_ASYNC class Signaler { enum FdUsage { FD_READ = 0, FD_WRITE = 1}; public: using pipefd_t = std::array<int, 2>; Signaler() { auto status = pipe(pipefd_.data()); if (status) { throw SystemException("pipe", status); } for(auto fd : pipefd_) { int flags = 0; if (-1 == (flags = fcntl(fd, F_GETFL, 0))) flags = 0; fcntl(fd, F_SETFL, flags | O_NONBLOCK); } } ~Signaler() { for(auto fd : pipefd_) { close(fd); } } void Signal() { char byte = {}; RESTINCURL_LOG_TRACE("Signal: Signaling!"); if (write(pipefd_[FD_WRITE], &byte, 1) != 1) { throw SystemException("write pipe", errno); } } int GetReadFd() { return pipefd_[FD_READ]; } bool WasSignalled() { bool rval = false; char byte = {}; while(read(pipefd_[FD_READ], &byte, 1) > 0) { RESTINCURL_LOG_TRACE("Signal: Was signalled"); rval = true; } return rval; } private: pipefd_t pipefd_; }; /*! Thread support for the TLS layer used by libcurl. * * Some TLS libraries require that you supply callback functions * to deal with thread synchronization. * * See https://curl.haxx.se/libcurl/c/threadsafe.html * * You can deal with this yourself, or in the case * that RESTinCurl support your TLS library, you can use * this class. * * Currently supported libraries: * * - Opeenssl (only required for OpenSSL <= 1.0.2) * define `RESTINCURL_WITH_OPENSSL_THREADS` * * The class is written so that you can use it in your code, and * it will only do something when the appropriate define is set. * * This class is only available when `RESTINCURL_ENABLE_ASYNC` is nonzero. */ class TlsLocker { public: #ifdef RESTINCURL_WITH_OPENSSL_THREADS static void opensslLockCb(int mode, int type, char *, int) { if(mode & CRYPTO_LOCK) { lock(); } else { unlock(); } } static unsigned long getThreadId(void) { return reinterpret_cast<unsigned long>(::this_thread::get_id()); } /*! Enable the built-in support. */ static void tlsLockInit() { CRYPTO_set_id_callback((unsigned long (*)())getThreadId); CRYPTO_set_locking_callback((void (*)())opensslLockCb); } /*! Free up resources used when finished using TLS. */ static void tlsLockKill() { CRYPTO_set_locking_callback(NULL); } #else /*! Enable the built-in support. */ static void tlsLOckInit() { ; // Do nothing } /*! Free up resources used when finished using TLS. */ static void tlsLockKill() { ; // Do nothing } #endif private: static void lock() { mutex_.lock(); } static void unlock() { mutex_.unlock(); } static std::mutex mutex_; }; class Worker { class WorkerThread { public: WorkerThread(std::function<void ()> && fn) : thread_{std::move(fn)} {} ~WorkerThread() { if (thread_.get_id() == std::this_thread::get_id()) { // Allow the thread to finish exiting the lambda thread_.detach(); } } void Join() const { std::call_once(joined_, [this] { const_cast<WorkerThread *>(this)->thread_.join(); }); } bool Joinable() const { return thread_.joinable(); } operator std::thread& () { return thread_; } private: std::thread thread_; mutable std::once_flag joined_; }; public: Worker() = default; ~Worker() { if (thread_ && thread_->Joinable()) { Close(); Join(); } } void PrepareThread() { // Must only be called when the mutex_ is acquired! assert(!mutex_.try_lock()); if (abort_ || done_) { return; } if (!thread_) { thread_ = std::make_shared<WorkerThread>([&] { try { RESTINCURL_LOG("Starting thread " << std::this_thread::get_id()); Init(); Run(); Clean(); } catch (const std::exception& ex) { RESTINCURL_LOG("Worker: " << ex.what()); } RESTINCURL_LOG("Exiting thread " << std::this_thread::get_id()); lock_t lock(mutex_); thread_.reset(); }); } assert(!abort_); assert(!done_); } static std::unique_ptr<Worker> Create() { return std::make_unique<Worker>(); } void Enqueue(Request::ptr_t req) { RESTINCURL_LOG_TRACE("Queuing request "); lock_t lock(mutex_); PrepareThread(); queue_.push_back(std::move(req)); Signal(); } void Join() const { decltype(thread_) thd; { lock_t lock(mutex_); if (thread_ && thread_->Joinable()) { thd = thread_; } } if (thd) { thd->Join(); } } // Let the current transfers complete, then quit void CloseWhenFinished() { { lock_t lock(mutex_); close_pending_ = true; } Signal(); } // Shut down now. Abort all transfers void Close() { { lock_t lock(mutex_); abort_ = true; } Signal(); } // Check if the run loop has finished. bool IsDone() const { lock_t lock(mutex_); return done_; } bool HaveThread() const noexcept { lock_t lock(mutex_); if (thread_) { return true; } return false; } size_t GetNumActiveRequests() const { lock_t lock(mutex_); return ongoing_.size(); } private: void Signal() { signal_.Signal(); } void Dequeue() { decltype(queue_) tmp; { lock_t lock(mutex_); if ((queue_.size() + ongoing_.size()) <= RESTINCURL_MAX_CONNECTIONS) { tmp = std::move(queue_); pending_entries_in_queue_ = false; } else { auto remains = std::min<size_t>(RESTINCURL_MAX_CONNECTIONS - ongoing_.size(), queue_.size()); if (remains) { auto it = queue_.begin(); RESTINCURL_LOG_TRACE("Adding only " << remains << " of " << queue_.size() << " requests from queue: << RESTINCURL_MAX_CONNECTIONS=" << RESTINCURL_MAX_CONNECTIONS); while(remains--) { assert(it != queue_.end()); tmp.push_back(std::move(*it)); ++it; } queue_.erase(queue_.begin(), it); } else { assert(ongoing_.size() == RESTINCURL_MAX_CONNECTIONS); RESTINCURL_LOG_TRACE("Adding no entries from queue: RESTINCURL_MAX_CONNECTIONS=" << RESTINCURL_MAX_CONNECTIONS); } pending_entries_in_queue_ = true; } } for(auto& req: tmp) { assert(req); const auto& eh = req->GetEasyHandle(); RESTINCURL_LOG_TRACE("Adding request: " << eh); ongoing_[eh] = std::move(req); const auto mc = curl_multi_add_handle(handle_, eh); if (mc != CURLM_OK) { throw CurlException("curl_multi_add_handle", mc); } } } void Init() { if ((handle_ = curl_multi_init()) == nullptr) { throw std::runtime_error("curl_multi_init() failed"); } curl_multi_setopt(handle_, CURLMOPT_MAXCONNECTS, RESTINCURL_MAX_CONNECTIONS); } void Clean() { if (handle_) { RESTINCURL_LOG_TRACE("Calling curl_multi_cleanup: " << handle_); curl_multi_cleanup(handle_); handle_ = nullptr; } } bool EvaluateState(const bool transfersRunning, const bool doDequeue) const noexcept { lock_t lock(mutex_); RESTINCURL_LOG_TRACE("Run loop: transfers_running=" << transfersRunning << ", do_dequeue=" << doDequeue << ", close_pending_=" << close_pending_); return !abort_ && (transfersRunning || !close_pending_); } auto GetNextTimeout() const noexcept { return std::chrono::steady_clock::now() + std::chrono::seconds(RESTINCURL_IDLE_TIMEOUT_SEC); } void Run() { int transfers_running = -1; fd_set fdread = {}; fd_set fdwrite = {}; fd_set fdexcep = {}; bool do_dequeue = true; auto timeout = GetNextTimeout(); while (EvaluateState(transfers_running, do_dequeue)) { if (do_dequeue) { Dequeue(); do_dequeue = false; } /* timeout or readable/writable sockets */ const bool initial_ideling = transfers_running == -1; curl_multi_perform(handle_, &transfers_running); if ((transfers_running == 0) && initial_ideling) { transfers_running = -1; // Let's ignore close_pending_ until we have seen a request } // Shut down the thread if we have been idling too long if (transfers_running <= 0) { if (timeout < std::chrono::steady_clock::now()) { RESTINCURL_LOG("Idle timeout. Will shut down the worker-thread."); break; } } else { timeout = GetNextTimeout(); } int numLeft = {}; while (auto m = curl_multi_info_read(handle_, &numLeft)) { assert(m); auto it = ongoing_.find(m->easy_handle); if (it != ongoing_.end()) { RESTINCURL_LOG("Finishing request with easy-handle: " << (EasyHandle::handle_t)it->second->GetEasyHandle() << "; with result: " << m->data.result << " expl: '" << curl_easy_strerror(m->data.result) << "'; with msg: " << m->msg); try { it->second->Complete(m->data.result, m->msg); } catch(const std::exception& ex) { RESTINCURL_LOG("Complete threw: " << ex.what()); } if (m->msg == CURLMSG_DONE) { curl_multi_remove_handle(handle_, m->easy_handle); } it->second->GetEasyHandle().Close(); ongoing_.erase(it); } else { RESTINCURL_LOG("Failed to find easy_handle in ongoing!"); assert(false); } } { lock_t lock(mutex_); // Avoid using select() as a timer when we need to exit anyway if (abort_ || (!transfers_running && close_pending_)) { break; } } auto next_timeout = std::chrono::duration_cast<std::chrono::milliseconds>( timeout - std::chrono::steady_clock::now()); long sleep_duration = std::max<long>(1, next_timeout.count()); /* extract sleep_duration value */ FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); int maxfd = -1; if (transfers_running > 0) { curl_multi_timeout(handle_, &sleep_duration); if (sleep_duration < 0) { sleep_duration = 1000; } /* get file descriptors from the transfers */ const auto mc = curl_multi_fdset(handle_, &fdread, &fdwrite, &fdexcep, &maxfd); RESTINCURL_LOG_TRACE("maxfd: " << maxfd); if (mc != CURLM_OK) { throw CurlException("curl_multi_fdset", mc); } if (maxfd == -1) { // Curl want's us to revisit soon sleep_duration = 50; } } // active transfers struct timeval tv = {}; tv.tv_sec = sleep_duration / 1000; tv.tv_usec = (sleep_duration % 1000) * 1000; const auto signalfd = signal_.GetReadFd(); RESTINCURL_LOG_TRACE("Calling select() with timeout of " << sleep_duration << " ms. Next timeout in " << next_timeout.count() << " ms. " << transfers_running << " active transfers."); FD_SET(signalfd, &fdread); maxfd = std::max(signalfd, maxfd) + 1; const auto rval = select(maxfd, &fdread, &fdwrite, &fdexcep, &tv); RESTINCURL_LOG_TRACE("select(" << maxfd << ") returned: " << rval); if (rval > 0) { if (FD_ISSET(signalfd, &fdread)) { RESTINCURL_LOG_TRACE("FD_ISSET was true: "); do_dequeue = signal_.WasSignalled(); } } if (pending_entries_in_queue_) { do_dequeue = true; } } // loop lock_t lock(mutex_); if (close_pending_ || abort_) { done_ = true; } } bool close_pending_ {false}; bool abort_ {false}; bool done_ {false}; bool pending_entries_in_queue_ = false; decltype(curl_multi_init()) handle_ = {}; mutable std::mutex mutex_; std::shared_ptr<WorkerThread> thread_; std::deque<Request::ptr_t> queue_; std::map<EasyHandle::handle_t, Request::ptr_t> ongoing_; Signaler signal_; }; #endif // RESTINCURL_ENABLE_ASYNC /*! Convenient interface to build requests. * * Even if this is a light-weight wrapper around libcurl, we have a * simple and modern way to define our requests that contains * convenience-methods for the most common use-cases. */ class RequestBuilder { // noop handler for incoming data static size_t write_callback(char *ptr, size_t size, size_t nitems, void *userdata) { const auto bytes = size * nitems; return bytes; } static int debug_callback(CURL *handle, curl_infotype type, char *data, size_t size, void *userp) { std::string msg; switch(type) { case CURLINFO_TEXT: msg = "==> Info: "; break; case CURLINFO_HEADER_OUT: msg = "=> Send header: "; break; case CURLINFO_DATA_OUT: msg = "=> Send data: "; break; case CURLINFO_SSL_DATA_OUT: msg = "=> Send SSL data: "; break; case CURLINFO_HEADER_IN: msg = "<= Recv header: "; break; case CURLINFO_DATA_IN: msg = "<= Recv data: "; break; case CURLINFO_SSL_DATA_IN: msg = "<= Recv SSL data: "; break; case CURLINFO_END: // Don't seems to be used msg = "<= End: "; break; } std::copy(data, data + size, std::back_inserter(msg)); RESTINCURL_LOG(handle << " " << msg); return 0; } public: using ptr_t = std::unique_ptr<RequestBuilder>; RequestBuilder( #if RESTINCURL_ENABLE_ASYNC Worker& worker #endif ) : request_{std::make_unique<Request>()} , options_{std::make_unique<class Options>(request_->GetEasyHandle())} #if RESTINCURL_ENABLE_ASYNC , worker_(worker) #endif {} ~RequestBuilder() { } protected: RequestBuilder& Prepare(RequestType rt, const std::string& url) { assert(request_type_ == RequestType::INVALID); assert(!is_built_); request_type_ = rt; url_ = url; return *this; } public: /*! * \name Type of request * * Use one of these functions to declare what HTTP request you want to use. * * \param url Url to call. Must be a complete URL, starting with * "http://" or "https://" * * Note that you must use only only one of these methods in one request. */ //@{ /*! Use a HTTP GET request */ RequestBuilder& Get(const std::string& url) { return Prepare(RequestType::GET, url); } /*! Use a HTTP HEAD request */ RequestBuilder& Head(const std::string& url) { return Prepare(RequestType::HEAD, url); } /*! Use a HTTP POST request */ RequestBuilder& Post(const std::string& url) { return Prepare(RequestType::POST, url); } /*! Use a HTTP PUT request */ RequestBuilder& Put(const std::string& url) { return Prepare(RequestType::PUT, url); } /*! Use a HTTP PATCH request */ RequestBuilder& Patch(const std::string& url) { return Prepare(RequestType::PATCH, url); } /*! Use a HTTP DELETE request */ RequestBuilder& Delete(const std::string& url) { return Prepare(RequestType::DELETE, url); } /*! Use a HTTP OPTIONS request */ RequestBuilder& Options(const std::string& url) { return Prepare(RequestType::OPTIONS, url); } //@} /*! Specify a HTTP header for the request. * * \param value The value of the header-line, properly formatted according to the relevant HTTP specifications. */ RequestBuilder& Header(const char *value) { assert(value); assert(!is_built_); request_->GetHeaders() = curl_slist_append(request_->GetHeaders(), value); return *this; } /*! Specify a HTTP header for the request. * * \param name Name of the header * \param value The value of the header * * This is a convenience method that will build the appropriate header for you. */ RequestBuilder& Header(const std::string& name, const std::string& value) { const auto v = name + ": " + value; return Header(v.c_str()); } /*! Sets the content-type to "Application/json; charset=utf-8" */ RequestBuilder& WithJson() { return Header("Content-type: Application/json; charset=utf-8"); } /*! Sets the content-type to "Application/json; charset=utf-8" * * \param body Json payload to send with the request. */ RequestBuilder& WithJson(std::string body) { WithJson(); return SendData(std::move(body)); } /*! Sets the accept header to "Application/json" */ RequestBuilder& AcceptJson() { return Header("Accept: Application/json"); } /*! Sets a Curl options. * * \param opt CURLoption enum specifying the option * \param value Value to set. * * It is critical that the type of the value is of the same type that * libcurl is expecting for the option. RESTinCurl makes no attempt * to validate or cast the values. * * Please refer to the libcurl documentation for curl_easy_setopt() */ template <typename T> RequestBuilder& Option(const CURLoption& opt, const T& value) { assert(!is_built_); options_->Set(opt, value); return *this; } /*! Enables or disables trace logging for requests. * * The trace logging will show detailed information about what * libcurl does and data sent and received during a request. * * Basically it sets `CURLOPT_DEBUGFUNCTION` and `CURLOPT_VERBOSE`. */ RequestBuilder& Trace(bool enable = true) { if (enable) { Option(CURLOPT_DEBUGFUNCTION, debug_callback); Option(CURLOPT_VERBOSE, 1L); } else { Option(CURLOPT_VERBOSE, 0L); } return *this; } /*! Set request timeout * * \param timeout Timeout in milliseconds. Set to -1 to use the default. */ RequestBuilder& RequestTimeout(const long timeout) { request_timeout_ = timeout; return *this; } /*! Set the connect timeout for a request * * \param timeout Timeout in milliseconds. Set to -1 to use the default. */ RequestBuilder& ConnectTimeout(const long timeout) { connect_timeout_ = timeout; return *this; } /*! Specify Data Handler for outbound data * * You can use this method when you need to use a Data Handler, rather than a simple string, * to provide the data for a POST, PUT etc. request. * * \param dh Data Handler instance. * * Note that the Data Handler is passed by reference. It is your responsibility that the * instance is present at least until the request has finished (your code owns the Data Handler instance). */ template <typename T> RequestBuilder& SendData(OutDataHandler<T>& dh) { assert(!is_built_); options_->Set(CURLOPT_READFUNCTION, dh.read_callback); options_->Set(CURLOPT_READDATA, &dh); have_data_out_ = true; return *this; } /*! Convenience method to specify a object that contains the data to send during a request. * * \param data Data to send. Typically this will be a std::string, std::vector<char> or a similar * object. * * RESTinCurl takes ownership of this data (by moving it). */ template <typename T> RequestBuilder& SendData(T data) { assert(!is_built_); auto handler = std::make_unique<OutDataHandler<T>>(std::move(data)); auto& handler_ref = *handler; request_->SetDefaultOutHandler(std::move(handler)); return SendData(handler_ref); } /*! Specify Data Handler for inbound data * * You can use this method when you need to use a Data Handler, rather than a simple string, * to receive data during the request. * * \param dh Data Handler instance. * * Note that the Data Handler is passed by reference. It is your responsibility that the * instance is present at least until the request has finished (your code owns the Data Handler instance). */ template <typename T> RequestBuilder& StoreData(InDataHandler<T>& dh) { assert(!is_built_); options_->Set(CURLOPT_WRITEFUNCTION, dh.write_callback); options_->Set(CURLOPT_WRITEDATA, &dh); have_data_in_ = true; return *this; } /*! Convenience method to specify a object that receives incoming data during a request. * * \param data Buffer to hold incoming data. Typically this will be a std::string, * std::vector<char> or a similar object. * * Note that data is passed by reference. It is your responsibility that the * instance is present at least until the request has finished (your code owns the object). */ template <typename T> RequestBuilder& StoreData(T& data) { assert(!is_built_); auto handler = std::make_unique<InDataHandler<T>>(data); auto& handler_ref = *handler; request_->SetDefaultInHandler(std::move(handler)); return StoreData(handler_ref); } /*! Do not process incoming data * * The response body will be read from the network, but * not buffered and not available for later * inspection. */ RequestBuilder& IgnoreIncomingData() { options_->Set(CURLOPT_WRITEFUNCTION, write_callback); have_data_in_ = true; return *this; } /*! Specify a callback that will be called when the request is complete (or failed). * * \param fn Callback to be called * * For asynchronous requests, the callback will be called from the worker-thread shared * by all requests and timers for the client instance. It is imperative that you return * immediately, and don't keep the thread busy more than strictly required. If you need * do do some computing or IO in response to the information you receive, you should * do that in another thread. */ RequestBuilder& WithCompletion(completion_fn_t fn) { assert(!is_built_); completion_ = std::move(fn); return *this; } /*! HTTP Basic Authentication * * Authenticate the request with HTTP Basic Authentication. * * \param name Name to authenticate with * \param passwd Password to authenticate with * * Note that if name or password is empty, authentication is * ignored. This makes it simple to add optional authentication * to your project, by simply assigning values to the strings * you pass here, or not. */ RequestBuilder& BasicAuthentication(const std::string& name, const std::string& passwd) { assert(!is_built_); if (!name.empty() && !passwd.empty()) { options_->Set(CURLOPT_USERNAME, name.c_str()); options_->Set(CURLOPT_PASSWORD, passwd.c_str()); } return *this; } /*! Set a Curl compatible read handler. * * \param handler Curl C API read handler * * You probably don't need to call this directly. */ RequestBuilder& SetReadHandler(size_t (*handler)(char *, size_t , size_t , void *), void *userdata) { options_->Set(CURLOPT_READFUNCTION, handler); options_->Set(CURLOPT_READDATA, userdata); have_data_out_ = true; return *this; } /*! Set a Curl compatible write handler. * * \param handler Curl C API write handler * * You probably don't need to call this directly. */ RequestBuilder& SetWriteHandler(size_t (*handler)(char *, size_t , size_t , void *), void *userdata) { options_->Set(CURLOPT_WRITEFUNCTION,handler); options_->Set(CURLOPT_WRITEDATA, userdata); have_data_in_ = true; return *this; } void Build() { if (!is_built_) { // Set up Data Handlers if (!have_data_in_) { // Use a default std::string. We expect json anyway... this->StoreData(request_->getDefaultInBuffer()); } if (have_data_out_) { options_->Set(CURLOPT_UPLOAD, 1L); } if (request_timeout_ >= 0) { options_->Set(CURLOPT_TIMEOUT_MS, request_timeout_); } if (connect_timeout_ >= 0) { options_->Set(CURLOPT_CONNECTTIMEOUT_MS, connect_timeout_); } // Set headers if (request_->GetHeaders()) { options_->Set(CURLOPT_HTTPHEADER, request_->GetHeaders()); } // TODO: Prepare the final url (we want nice, correctly encoded request arguments) options_->Set(CURLOPT_URL, url_); RESTINCURL_LOG("Preparing connect to: " << url_); // Prepare request request_->Prepare(request_type_, std::move(completion_)); is_built_ = true; } } /*! Execute the request synchronously * * This will execute the request and call the callback (if you declared one) in the * current thread before the method returns. * * \throws restincurl::Exception derived exceptions on error * * This method is available even when `RESTINCURL_ENABLE_ASYNC` is enabled ( != 0). */ void ExecuteSynchronous() { Build(); request_->Execute(); } #if RESTINCURL_ENABLE_ASYNC /*! Execute the request asynchronously * * This will queue the request for processing. If the number of active requests are * less than `RESTINCURL_MAX_CONNECTIONS`, the request will start executing almost immediately. * * The method returns immediately. * * \throws restincurl::Exception derived exceptions on error * * This method is only available when `RESTINCURL_ENABLE_ASYNC` is nonzero. */ void Execute() { Build(); worker_.Enqueue(std::move(request_)); } #endif private: std::unique_ptr<Request> request_; std::unique_ptr<class Options> options_; std::string url_; RequestType request_type_ = RequestType::INVALID; bool have_data_in_ = false; bool have_data_out_ = false; bool is_built_ = false; completion_fn_t completion_; long request_timeout_ = 10000L; // 10 seconds long connect_timeout_ = 3000L; // 1 second #if RESTINCURL_ENABLE_ASYNC Worker& worker_; #endif }; /*! The high level abstraction of the Curl library. * * An instance of a Client will, if asynchronous mode is enabled, create a * worker-thread when the first request is made. This single worker-thread * is then shared between all requests made for this client. When no requests * are active, the thread will wait for a while (see RESTINCURL_IDLE_TIMEOUT_SEC), * keeping libcurl's connection-cache warm, to serve new requests as efficiently as * possible. When the idle time period expires, the thread will terminate and * close the connection-cache associated with the client. * If a new request is made later on, a new worker-thread will be created. */ class Client { public: /*! Constructor * * \param init Set to true if you need to initialize libcurl. * * Libcurl require us to call an initialization method once, before using the library. * If you use libcurl exclusively from RESTinCurl, `init` needs to be `true` (default). If * you use RESTinCurl in a project that already initialize libcurl, you should pass `false` * to the constructor. * * RESTinCurl will only call libcurl's initialization once, no matter how many times you * call the constructor. It's therefore safe to always use the default value when you want RESTinCurl * to deal with libcurl's initialization. */ Client(const bool init = true) { if (init) { static std::once_flag flag; std::call_once(flag, [] { RESTINCURL_LOG("One time initialization of curl."); curl_global_init(CURL_GLOBAL_DEFAULT); }); } } /*! Destructor * * The destructor will try to clean up resources (when in asynchronous mode) * ant may wait for a little while for IO operations to stop and the worker-thread to * finish. * * This is to prevent your application for crashing if you exit the main thread while * the worker-thread is still working and accessing memory own by the Client instance. */ virtual ~Client() { #if RESTINCURL_ENABLE_ASYNC if (worker_) { try { worker_->Close(); } catch (const std::exception& ex) { RESTINCURL_LOG("~Client(): " << ex.what()); } } #endif } /*! Build a request * * Requests are "built" using a series of statements * to fully express what you want to do and how you want RESTinCurl to do it. * * Example * \code restincurl::Client client; client.Build()->Get("https://api.example.com") .AcceptJson() .Header("X-Client", "restincurl") .WithCompletion([&](const Result& result) { // Do something }) .Execute(); \endcode */ std::unique_ptr<RequestBuilder> Build() { return std::make_unique<RequestBuilder>( #if RESTINCURL_ENABLE_ASYNC *worker_ #endif ); } #if RESTINCURL_ENABLE_ASYNC /*! Shut down the event-loop and clean up internal resources when all active and queued requests are done. * * This method is only available when `RESTINCURL_ENABLE_ASYNC` is nonzero. */ void CloseWhenFinished() { worker_->CloseWhenFinished(); } /*! Close the client. * * This method aborts any and all requests. * * The worked-thread will exit shortly after this method is * called, if it was running. * * This method is only available when `RESTINCURL_ENABLE_ASYNC` is nonzero. */ void Close() { worker_->Close(); } /*! Wait for the worker-thread to finish. * * You should call Close() first. * * This method is only available when `RESTINCURL_ENABLE_ASYNC` is nonzero. */ void WaitForFinish() { worker_->Join(); } /*! Check if the client instance has a worker-thread. * * This method is only available when `RESTINCURL_ENABLE_ASYNC` is nonzero. */ bool HaveWorker() const { return worker_->HaveThread(); } /*! Get the number of active / ongoing requests. * * This method is only available when `RESTINCURL_ENABLE_ASYNC` is nonzero. */ size_t GetNumActiveRequests() { return worker_->GetNumActiveRequests(); } #endif private: #if RESTINCURL_ENABLE_ASYNC std::unique_ptr<Worker> worker_ = std::make_unique<Worker>(); #endif }; } // namespace
33.761412
119
0.548405
[ "object", "vector" ]
9dc1c1ec09d7dc711556d14c18fe80fbd9868f68
632
h
C
Lib/Common/CompileData.h
Freddan-67/V3DLib
dcefc24a9a399ee1f5d1aa5529f44d9fd2486929
[ "MIT" ]
44
2021-01-16T14:17:15.000Z
2022-03-11T19:53:59.000Z
Lib/Common/CompileData.h
RcCreeperTech/V3DLib
38eb8d55b8276de5cf703d8e13fb9b5f220c49f0
[ "MIT" ]
8
2021-01-16T17:52:02.000Z
2021-12-18T22:38:00.000Z
Lib/Common/CompileData.h
RcCreeperTech/V3DLib
38eb8d55b8276de5cf703d8e13fb9b5f220c49f0
[ "MIT" ]
7
2021-01-16T14:25:47.000Z
2022-02-03T16:34:45.000Z
#ifndef _V3DLIB_COMMON_COMPILEDATA_H_ #define _V3DLIB_COMMON_COMPILEDATA_H_ #include <string> #include <vector> #include "Target/instr/Reg.h" namespace V3DLib { struct CompileData { std::string liveness_dump; std::string target_code_before_optimization; std::string target_code_before_regalloc; std::string target_code_before_liveness; std::string allocated_registers_dump; std::string reg_usage_dump; int num_accs_introduced = 0; int num_instructions_combined = 0; std::string dump() const; void clear(); }; extern CompileData compile_data; } // namespace V3DLib #endif // _V3DLIB_COMMON_COMPILEDATA_H_
22.571429
46
0.786392
[ "vector" ]
9dc22d33bdf0c16e79a2d1ef9180882099f40a3a
1,890
h
C
framework/platform/bpl/ugw/cfg/cal/calpp_param_list.h
marcos-mxl/prplMesh
de16b3f74cf90d5d269e4b6f43723a34bc065917
[ "BSD-2-Clause-Patent" ]
1
2019-05-01T14:45:06.000Z
2019-05-01T14:45:06.000Z
framework/platform/bpl/ugw/cfg/cal/calpp_param_list.h
marcos-mxl/prplMesh
de16b3f74cf90d5d269e4b6f43723a34bc065917
[ "BSD-2-Clause-Patent" ]
8
2019-05-26T08:19:32.000Z
2019-06-03T14:41:05.000Z
framework/platform/bpl/ugw/cfg/cal/calpp_param_list.h
marcos-mxl/prplMesh
de16b3f74cf90d5d269e4b6f43723a34bc065917
[ "BSD-2-Clause-Patent" ]
2
2019-05-01T14:46:58.000Z
2019-05-02T15:23:56.000Z
/* SPDX-License-Identifier: BSD-2-Clause-Patent * * Copyright (c) 2016-2019 Intel Corporation * * This code is subject to the terms of the BSD+Patent license. * See LICENSE file for more details. */ #ifndef __COMMON_CALPP_PARAM_LIST_H__ #define __COMMON_CALPP_PARAM_LIST_H__ #include <iterator> #include <memory> #include <string> extern "C" { #include "help_structs.h" } // extern "C" namespace beerocks { namespace bpl { class cal_param_list { public: class iterator : public std::iterator<std::bidirectional_iterator_tag, cal_param_list> { public: iterator(ObjList *obj, ParamList *param); iterator(const cal_param_list &param_list); ~iterator(); iterator(const iterator &); iterator &operator=(const iterator &); bool operator==(const iterator &rhs) const; bool operator!=(const iterator &rhs) const; iterator &operator++(); iterator operator++(int); iterator &operator--(); iterator operator--(int); reference operator*() const; pointer operator->(); protected: std::unique_ptr<cal_param_list> m_it; }; cal_param_list(ObjList *obj, ParamList *param = nullptr); ~cal_param_list() = default; // non-owning reference so nothing to destroy // copy/assignment/move are all default actions - only define if tests fail iterator begin(); iterator end(); iterator find_param(const std::string &name); std::string operator[](const std::string &name); bool is_name(const std::string &name) const; std::string get_name(); std::string get_value(); private: ObjList *m_obj; // non-owning reference to object holding this param_list // required to get begin()/end() iterators. ParamList *m_param; }; } // namespace bpl } // namespace beerocks #endif // __COMMON_CALPP_PARAM_LIST_H__
26.619718
92
0.669312
[ "object" ]
9dc5d16bea36901ec4839772033e1ca6da4a6675
94,869
c
C
PainterEngine/Architecture/PainterEngine_Console.c
neko-para/PainterEngine
ab71c49887c563f4a43361334365c3a88f99e1c4
[ "BSD-3-Clause" ]
3
2021-05-27T03:20:59.000Z
2021-06-04T12:06:27.000Z
PainterEngine/Architecture/PainterEngine_Console.c
deepthinkler/PainterEngine
9ef5838ae430ec1c9a7f7c25cf3f5e1e7023a28f
[ "BSD-3-Clause" ]
null
null
null
PainterEngine/Architecture/PainterEngine_Console.c
deepthinkler/PainterEngine
9ef5838ae430ec1c9a7f7c25cf3f5e1e7023a28f
[ "BSD-3-Clause" ]
null
null
null
#include "PainterEngine_Console.h" static char const fox_console_logo[]={0x54,0x52,0x41,0x57,0x40,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x1c,0x0,0xf2,0x0,0x8b,0x0,0xf2,0x0,0x9e,0x0,0xf2,0x0,0xae,0x0,0xf2,0x0,0x40,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x4,0x0,0xff,0x0,0x68,0x0,0xff,0x0,0x7a,0x0,0xff,0x0,0x30,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x47,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x6f,0x0,0xff,0x0,0x2b,0x0,0xff,0x0,0x7a,0x0,0xff,0x0,0xbc,0x0,0xff,0x0,0x27,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x69,0x0,0xff,0x0,0xa7,0x0,0xff,0x0,0x4f,0x0,0xff,0x0,0x9b,0x0,0xff,0x0,0x9a,0x0,0xff,0x0,0x3b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x54,0x0,0xff,0x0,0xd6,0x0,0xff,0x0,0x29,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x76,0x0,0xff,0x0,0xa3,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x1e,0x0,0xff,0x0,0xb7,0x0,0xff,0x0,0x22,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x37,0x0,0xff,0x0,0xaa,0x0,0xff,0x0,0x87,0x0,0xff,0x0,0x2c,0x0,0xff,0x0,0x9c,0x0,0xff,0x0,0x2b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb0,0x0,0xff,0x0,0x34,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x79,0x0,0xff,0x0,0x5f,0x0,0xff,0x0,0x3e,0x0,0xff,0x0,0xbd,0x0,0xff,0x0,0x82,0x0,0xff,0x0,0x2a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x57,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x6b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7a,0x0,0xff,0x0,0x8a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x24,0x0,0xff,0x0,0x77,0x0,0xff,0x0,0x4b,0x0,0xff,0x0,0xd8,0x0,0xff,0x0,0x45,0x0,0xff,0x0,0x4e,0x0,0xff,0x0,0xa0,0x0,0xff,0x0,0x93,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x18,0x0,0xff,0x0,0xdb,0x0,0xff,0x0,0x72,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x29,0x0,0xff,0x0,0xa1,0x0,0xff,0x0,0x1,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8c,0x0,0xff,0x0,0x55,0x0,0xff,0x0,0x7b,0x0,0xff,0x0,0x59,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x55,0x0,0xff,0x0,0xb5,0x0,0xff,0x0,0x11,0x0,0xff,0x0,0x6,0x0,0xff,0x0,0xed,0x0,0xff,0x0,0x83,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa3,0x0,0xff,0x0,0x31,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x16,0x0,0xff,0x0,0x9b,0x0,0xff,0x0,0x31,0x0,0xff,0x0,0x9a,0x0,0xff,0x0,0xd,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x39,0x0,0xff,0x0,0xb1,0x0,0xff,0x0,0x4,0x0,0xff,0x0,0x6,0x0,0xff,0x0,0xb1,0x0,0xff,0x0,0x8f,0x0,0xff,0x0,0x84,0x0,0xff,0x0,0x95,0x0,0xff,0x0,0x83,0x0,0xff,0x0,0x14,0x0,0xff,0x0,0x81,0x0,0xff,0x0,0x51,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x5f,0x0,0xff,0x0,0x8e,0x0,0xff,0x0,0x2e,0x0,0xff,0x0,0x99,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7f,0x0,0xff,0x0,0xad,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8,0x0,0xff,0x0,0x21,0x0,0xff,0x0,0x27,0x0,0xff,0x0,0x50,0x0,0xff,0x0,0x83,0x0,0xff,0x0,0xc0,0x0,0xff,0x0,0xfe,0x0,0xff,0x0,0x44,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8c,0x0,0xff,0x0,0x72,0x0,0xff,0x0,0x45,0x0,0xff,0x0,0x9a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x10,0x0,0xff,0x0,0x51,0x0,0xff,0x0,0x3,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7,0x0,0xff,0x0,0x9c,0x0,0xff,0x0,0xd9,0x0,0xff,0x0,0x1b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8d,0x0,0xff,0x0,0x59,0x0,0xff,0x0,0x56,0x0,0xff,0x0,0x93,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x86,0x0,0xff,0x0,0xd1,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xf,0x0,0xff,0x0,0x17,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x83,0x0,0xff,0x0,0x5b,0x0,0xff,0x0,0x3f,0x0,0xff,0x0,0x9c,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa7,0x0,0xff,0x0,0x91,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2d,0x0,0xff,0x0,0x5a,0x0,0xff,0x0,0x7f,0x0,0xff,0x0,0x7e,0x0,0xff,0x0,0xe7,0x0,0xff,0x0,0x83,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x81,0x0,0xff,0x0,0x7c,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xbb,0x0,0xff,0x0,0xf,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x12,0x0,0xff,0x0,0xc4,0x0,0xff,0x0,0x29,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xd,0x0,0xff,0x0,0x6f,0x0,0xff,0x0,0xb2,0x0,0xff,0x0,0xc5,0x0,0xff,0x0,0xb8,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0x7b,0x0,0xff,0x0,0x50,0x0,0xff,0x0,0xc4,0x0,0xff,0x0,0x2d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9b,0x0,0xff,0x0,0xd0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x99,0x0,0xff,0x0,0xaa,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8a,0x0,0xff,0x0,0x9d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2f,0x0,0xff,0x0,0xb1,0x0,0xff,0x0,0xd5,0x0,0xff,0x0,0xc0,0x0,0xff,0x0,0x8c,0x0,0xff,0x0,0x3a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x67,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x18,0x0,0xff,0x0,0x86,0x0,0xff,0x0,0xb8,0x0,0xff,0x0,0x2a,0x0,0xff,0x0,0x8,0x0,0xff,0x0,0x39,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x24,0x0,0xff,0x0,0xb0,0x0,0xff,0x0,0xc,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x96,0x0,0xff,0x0,0xe5,0x0,0xff,0x0,0x99,0x0,0xff,0x0,0x23,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb1,0x0,0xff,0x0,0x71,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x77,0x0,0xff,0x0,0x60,0x0,0xff,0x0,0x1a,0x0,0xff,0x0,0x36,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x35,0x0,0xff,0x0,0x24,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9a,0x0,0xff,0x0,0x5b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x20,0x0,0xff,0x0,0xe4,0x0,0xff,0x0,0xb3,0x0,0xff,0x0,0x6,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xe,0x0,0xff,0x0,0xd2,0x0,0xff,0x0,0x32,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x88,0x0,0xff,0x0,0x26,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x38,0x0,0xff,0x0,0x64,0x0,0xff,0x0,0xaf,0x0,0xff,0x0,0x65,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x6e,0x0,0xff,0x0,0x8d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x37,0x0,0xff,0x0,0xed,0x0,0xff,0x0,0x6a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x4c,0x0,0xff,0x0,0xe5,0x0,0xff,0x0,0x5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x3c,0x0,0xff,0x0,0x94,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa5,0x0,0xff,0x0,0xd5,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xb9,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2a,0x0,0xff,0x0,0xa7,0x0,0xff,0x0,0x2,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x30,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xb6,0x0,0xff,0x0,0x4b,0x0,0xff,0x0,0xc5,0x0,0xff,0x0,0x56,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x5e,0x0,0xff,0x0,0xe0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x77,0x0,0xff,0x0,0x8a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x55,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x5d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa5,0x0,0xff,0x0,0x5d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2a,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x52,0x0,0xff,0x0,0x2e,0x0,0xff,0x0,0x5c,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x34,0x0,0xff,0x0,0xdc,0x0,0xff,0x0,0x13,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8c,0x0,0xff,0x0,0x68,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x25,0x0,0xff,0x0,0x33,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x48,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x11,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x14,0x0,0xff,0x0,0xe2,0x0,0xff,0x0,0x7a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xae,0x0,0xff,0x0,0x2e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x87,0x0,0xff,0x0,0x98,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0xe2,0x0,0xff,0x0,0x43,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x84,0x0,0xff,0x0,0x4b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x61,0x0,0xff,0x0,0xc7,0x0,0xff,0x0,0x67,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc4,0x0,0xff,0x0,0x86,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x78,0x0,0xff,0x0,0xab,0x0,0xff,0x0,0x89,0x0,0xff,0x0,0x83,0x0,0xff,0x0,0xce,0x0,0xff,0x0,0x94,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc1,0x0,0xff,0x0,0x94,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x74,0x0,0xff,0x0,0x42,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x5d,0x0,0xff,0x0,0x9d,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0x2c,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x89,0x0,0xff,0x0,0xbe,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x16,0x0,0xff,0x0,0xed,0x0,0xff,0x0,0x6a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x4,0x0,0xff,0x0,0xe4,0x0,0xff,0x0,0x57,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x27,0x0,0xff,0x0,0xf2,0x0,0xff,0x0,0xd2,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x75,0x0,0xff,0x0,0x4d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x63,0x0,0xff,0x0,0x2c,0x0,0xff,0x0,0xa1,0x0,0xff,0x0,0x5f,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x29,0x0,0xff,0x0,0xd2,0x0,0xff,0x0,0x1d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xd,0x0,0xff,0x0,0x4,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x58,0x0,0xff,0x0,0xc2,0x0,0xff,0x0,0x2c,0x0,0xff,0x0,0xee,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x30,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7d,0x0,0xff,0x0,0x63,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa8,0x0,0xff,0x0,0xb0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xac,0x0,0xff,0x0,0x7f,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x87,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x66,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xf8,0x0,0xff,0x0,0xb2,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x63,0x0,0xff,0x0,0x80,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa0,0x0,0xff,0x0,0x69,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x46,0x0,0xff,0x0,0xba,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x10,0x0,0xff,0x0,0x5f,0x0,0xff,0x0,0xd,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xd,0x0,0xff,0x0,0xd4,0x0,0xff,0x0,0x47,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x23,0x0,0xff,0x0,0x9c,0x0,0xff,0x0,0x5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x6c,0x0,0xff,0x0,0xc5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa4,0x0,0xff,0x0,0x70,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x82,0x0,0xff,0x0,0xc7,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xaf,0x0,0xff,0x0,0x54,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x20,0x0,0xff,0x0,0x3b,0x0,0xff,0x0,0x1d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x23,0x0,0xff,0x0,0xde,0x0,0xff,0x0,0x34,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x35,0x0,0xff,0x0,0xaf,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xe,0x0,0xff,0x0,0xd7,0x0,0xff,0x0,0x36,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x90,0x0,0xff,0x0,0x92,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2f,0x0,0xff,0x0,0x70,0x0,0xff,0x0,0x2a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x3,0x0,0xff,0x0,0xcd,0x0,0xff,0x0,0x67,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x96,0x0,0xff,0x0,0x84,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa6,0x0,0xff,0x0,0x88,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x5d,0x0,0xff,0x0,0xae,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xbb,0x0,0xff,0x0,0x82,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xf,0x0,0xff,0x0,0xb9,0x0,0xff,0x0,0x23,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x61,0x0,0xff,0x0,0xae,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x44,0x0,0xff,0x0,0xbf,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x23,0x0,0xff,0x0,0x39,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb2,0x0,0xff,0x0,0x90,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x67,0x0,0xff,0x0,0xa6,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x27,0x0,0xff,0x0,0xc6,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x40,0x0,0xff,0x0,0xbc,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x94,0x0,0xff,0x0,0xb7,0x0,0xff,0x0,0x66,0x0,0xff,0x0,0x40,0x0,0xff,0x0,0x26,0x0,0xff,0x0,0x18,0x0,0xff,0x0,0x12,0x0,0xff,0x0,0x2b,0x0,0xff,0x0,0x49,0x0,0xff,0x0,0x9f,0x0,0xff,0x0,0x76,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9e,0x0,0xff,0x0,0x60,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8,0x0,0xff,0x0,0xde,0x0,0xff,0x0,0x1e,0x0,0xff,0x0,0x53,0x0,0xff,0x0,0xa3,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7e,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0x8f,0x0,0xff,0x0,0xba,0x0,0xff,0x0,0xb5,0x0,0xff,0x0,0xae,0x0,0xff,0x0,0x97,0x0,0xff,0x0,0x8a,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0xbf,0x0,0xff,0x0,0x10,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x16,0x0,0xff,0x0,0xb3,0x0,0xff,0x0,0x19,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x6,0x0,0xff,0x0,0xec,0x0,0xff,0x0,0x31,0x0,0xff,0x0,0x88,0x0,0xff,0x0,0x72,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x47,0x0,0xff,0x0,0x99,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x6,0x0,0xff,0x0,0x14,0x0,0xff,0x0,0x10,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x61,0x0,0xff,0x0,0x9e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x63,0x0,0xff,0x0,0xb1,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb,0x0,0xff,0x0,0xc8,0x0,0xff,0x0,0x72,0x0,0xff,0x0,0xbe,0x0,0xff,0x0,0x16,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7d,0x0,0xff,0x0,0x62,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb2,0x0,0xff,0x0,0x70,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa3,0x0,0xff,0x0,0x90,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0xd1,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x6a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x81,0x0,0xff,0x0,0x2b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x3b,0x0,0xff,0x0,0xb6,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc1,0x0,0xff,0x0,0x5a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x17,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xc1,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x19,0x0,0xff,0x0,0x80,0x0,0xff,0x0,0x5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8f,0x0,0xff,0x0,0x4d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x12,0x0,0xff,0x0,0xc7,0x0,0xff,0x0,0x26,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x4b,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x21,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x39,0x0,0xff,0x0,0x8f,0x0,0xff,0x0,0x1c,0x0,0xff,0x0,0xb,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x43,0x0,0xff,0x0,0xc7,0x0,0xff,0x0,0x6c,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x3b,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb2,0x0,0xff,0x0,0xa1,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc,0x0,0xff,0x0,0xd2,0x0,0xff,0x0,0xf7,0x0,0xff,0x0,0x2e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x76,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x80,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x6c,0x0,0xff,0x0,0xcd,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x23,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x1f,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x32,0x0,0xff,0x0,0x97,0x0,0xff,0x0,0x73,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7d,0x0,0xff,0x0,0x8e,0x0,0xff,0x0,0x5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x87,0x0,0xff,0x0,0xc5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9f,0x0,0xff,0x0,0x9d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xf,0x0,0xff,0x0,0xa3,0x0,0xff,0x0,0x1d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8,0x0,0xff,0x0,0xa4,0x0,0xff,0x0,0x69,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x83,0x0,0xff,0x0,0xb0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x1e,0x0,0xff,0x0,0xd0,0x0,0xff,0x0,0x23,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x87,0x0,0xff,0x0,0xa7,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7e,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xce,0x0,0xff,0x0,0x10,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x89,0x0,0xff,0x0,0xae,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0xa3,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xca,0x0,0xff,0x0,0x87,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0x86,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0xed,0x0,0xff,0x0,0x55,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x83,0x0,0xff,0x0,0xbe,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x1e,0x0,0xff,0x0,0xd2,0x0,0xff,0x0,0x25,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x18,0x0,0xff,0x0,0xb8,0x0,0xff,0x0,0x9b,0x0,0xff,0x0,0x15,0x0,0xff,0x0,0x86,0x0,0xff,0x0,0x74,0x0,0xff,0x0,0x1e,0x0,0xff,0x0,0x84,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x6d,0x0,0xff,0x0,0xd7,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa0,0x0,0xff,0x0,0xa1,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x56,0x0,0xff,0x0,0x96,0x0,0xff,0x0,0xa6,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x30,0x0,0xff,0x0,0x87,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x3d,0x0,0xff,0x0,0xe3,0x0,0xff,0x0,0xe,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x22,0x0,0xff,0x0,0xca,0x0,0xff,0x0,0x1d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x4,0x0,0xff,0x0,0xb,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x44,0x0,0xff,0x0,0x99,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0xc,0x0,0xff,0x0,0xde,0x0,0xff,0x0,0x3b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9c,0x0,0xff,0x0,0x9b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x48,0x0,0xff,0x0,0xc3,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xcd,0x0,0xff,0x0,0x71,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xe,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x32,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x10,0x0,0xff,0x0,0x4a,0x0,0xff,0x0,0x3e,0x0,0xff,0x0,0x7,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x36,0x0,0xff,0x0,0xcc,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xab,0x0,0xff,0x0,0xb4,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x72,0x0,0xff,0x0,0xbf,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x52,0x0,0xff,0x0,0x88,0x0,0xff,0x0,0xaf,0x0,0xff,0x0,0xe6,0x0,0xff,0x0,0x82,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x27,0x0,0xff,0x0,0xd2,0x0,0xff,0x0,0x18,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x62,0x0,0xff,0x0,0xe7,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc9,0x0,0xff,0x0,0x7c,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x3,0x0,0xff,0x0,0x5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x38,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xc1,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x22,0x0,0xff,0x0,0xdd,0x0,0xff,0x0,0x24,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x13,0x0,0xff,0x0,0xf1,0x0,0xff,0x0,0x42,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x27,0x0,0xff,0x0,0xe5,0x0,0xff,0x0,0x24,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x13,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x94,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x49,0x0,0xff,0x0,0x67,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x18,0x0,0xff,0x0,0xde,0x0,0xff,0x0,0x2e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x9e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x82,0x0,0xff,0x0,0xcc,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x82,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xb,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x6f,0x0,0xff,0x0,0xbe,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc,0x0,0xff,0x0,0xd3,0x0,0xff,0x0,0x37,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x72,0x0,0xff,0x0,0xf4,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xbf,0x0,0xff,0x0,0x97,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2f,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x46,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x4e,0x0,0xff,0x0,0xda,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x5,0x0,0xff,0x0,0xd0,0x0,0xff,0x0,0x3f,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0xeb,0x0,0xff,0x0,0x50,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xd2,0x0,0xff,0x0,0x5a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7,0x0,0xff,0x0,0xfd,0x0,0xff,0x0,0x62,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x21,0x0,0xff,0x0,0xdf,0x0,0xff,0x0,0x26,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x4f,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x97,0x0,0xff,0x0,0xc5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x17,0x0,0xff,0x0,0xd7,0x0,0xff,0x0,0x2c,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xde,0x0,0xff,0x0,0x5e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2,0x0,0xff,0x0,0xd7,0x0,0xff,0x0,0x46,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xd3,0x0,0xff,0x0,0x61,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa,0x0,0xff,0x0,0xed,0x0,0xff,0x0,0x55,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x29,0x0,0xff,0x0,0xe1,0x0,0xff,0x0,0x20,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc9,0x0,0xff,0x0,0x3e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc9,0x0,0xff,0x0,0x6f,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xd8,0x0,0xff,0x0,0x6f,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x71,0x0,0xff,0x0,0xdd,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x38,0x0,0xff,0x0,0xfb,0x0,0xff,0x0,0x24,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x38,0x0,0xff,0x0,0xcd,0x0,0xff,0x0,0x8,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb8,0x0,0xff,0x0,0x90,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xe3,0x0,0xff,0x0,0x75,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc7,0x0,0xff,0x0,0xaf,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x42,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x27,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9b,0x0,0xff,0x0,0xbe,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x8b,0x0,0xff,0x0,0xb4,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xf4,0x0,0xff,0x0,0x80,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0xf6,0x0,0xff,0x0,0x75,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x36,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x45,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x4,0x0,0xff,0x0,0xed,0x0,0xff,0x0,0x5e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb8,0x0,0xff,0x0,0xe4,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xa4,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2d,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x6c,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x80,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0xc9,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x49,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xd6,0x0,0xff,0x0,0x10,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xe,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xbe,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x3e,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x99,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc8,0x0,0xff,0x0,0xf3,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xd1,0x0,0xff,0x0,0xf0,0x0,0xff,0x0,0x2f,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xd3,0x0,0xff,0x0,0x6c,0x0,0xff,0x0,0x9d,0x0,0xff,0x0,0x50,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x2c,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xcf,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x1b,0x0,0xff,0x0,0xf3,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x4e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x3e,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x6a,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x5e,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xa5,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa2,0x0,0xff,0x0,0x7a,0x0,0xff,0x0,0x87,0x0,0xff,0x0,0x7e,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x59,0x0,0xff,0x0,0xd3,0x0,0xff,0x0,0xc6,0x0,0xff,0x0,0x2d,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x89,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xf5,0x0,0xff,0x0,0xa3,0x0,0xff,0x0,0x6c,0x0,0xff,0x0,0x4c,0x0,0xff,0x0,0x2a,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xa4,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x1b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7,0x0,0xff,0x0,0xf0,0x0,0xff,0x0,0xcd,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x6,0x0,0xff,0x0,0xc8,0x0,0xff,0x0,0xbe,0x0,0xff,0x0,0x94,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x7d,0x0,0xff,0x0,0xa7,0x0,0xff,0x0,0xb6,0x0,0xff,0x0,0x4b,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x9,0x0,0xff,0x0,0x6f,0x0,0xff,0x0,0xc0,0x0,0xff,0x0,0xdc,0x0,0xff,0x0,0xe8,0x0,0xff,0x0,0xf4,0x0,0xff,0x0,0xed,0x0,0xff,0x0,0xe1,0x0,0xff,0x0,0xc4,0x0,0xff,0x0,0xda,0x0,0xff,0x0,0xf4,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x6d,0x0,0xff,0x0,0x27,0x0,0xff,0x0,0x41,0x0,0xff,0x0,0x48,0x0,0xff,0x0,0x4f,0x0,0xff,0x0,0x51,0x0,0xff,0x0,0x51,0x0,0xff,0x0,0x59,0x0,0xff,0x0,0x59,0x0,0xff,0x0,0x59,0x0,0xff,0x0,0x5f,0x0,0xff,0x0,0x5e,0x0,0xff,0x0,0x5e,0x0,0xff,0x0,0x5d,0x0,0xff,0x0,0x5d,0x0,0xff,0x0,0x5d,0x0,0xff,0x0,0x5b,0x0,0xff,0x0,0x25,0x0,0xff,0x0,0x4f,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xa9,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xc3,0x0,0xff,0x0,0xc6,0x0,0xff,0x0,0xc9,0x0,0xff,0x0,0x58,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0xb3,0x0,0xff,0x0,0x9e,0x0,0xff,0x0,0xd3,0x0,0xff,0x0,0x60,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0xff,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,0xff,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x5,0xf2,0x0,0x0,0x4,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x1,0xf2,0x0,0x1,0x1,0xf2,0x0,0x23,0x3,0xf2,0x0,0x4b,0x5,0xf2,0x0,0x70,0x4,0xf2,0x0,0x9d,0x4,0xf2,0x0,0xb0,0x3,0xf2,0x0,0xbb,0x2,0xf2,0x0,0xab,0x2,0xf2,0x0,0x91,0x1,0xf2,0x0,0xc4,0x1,0xf2,0x0,0xa2,0x2,0xf2,0x0,0x65,0x2,0xf2,0x0,0x77,0x2,0xf2,0x0,0x7e,0x1,0xf2,0x0,0x85,0x1,0xf2,0x0,0x87,0x1,0xf2,0x0,0x87,0x0,0xf2,0x0,0x8e,0x0,0xf2,0x0,0x8e,0x1,0xf2,0x0,0x8e,0x0,0xf2,0x0,0x93,0x0,0xf2,0x0,0x92,0x0,0xf2,0x0,0x92,0x0,0xf2,0x0,0x92,0x0,0xf2,0x0,0x92,0x0,0xf2,0x0,0x91,0x1,0xf2,0x0,0x8b,0x2,0xf2,0x0,0x8c,0x2,0xf2,0x0,0x66,0x1,0xf2,0x0,0x8c,0x0,0xf2,0x0,0xaa,0x4,0xf2,0x0,0x5c,0x2,0xf2,0x0,0x96,0x0,0xf2,0x0,0x55,0x0,0xf2,0x0,0x75,0x0,0xf2,0x0,0x81,0x0,0xf2,0x0,0x33,0x0,0xf2,0x0,0x8e,0x0,0xf2,0x0,0x78,0x0,0xf2,0x0,0x9b,0x0,0xf2,0x0,0x37,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0x0,0xf2,0x0,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0xff,0xff,0xff,0x0,0x0,}; char const PC_ScriptPreload[]="#name \"shell\"\r\n\ #runtime stack 1024\r\n\ host int print(string s);\r\n\ host int printimage(string s);\r\n\ host int printshape(string s,int color);\r\n\ host int printanimation(string s);\r\n\ host int printpartical(int x,int y,string texture,string script,string _init,string _create,string _update);\r\n\ host int printroundcursor(string s,int color);\r\n\ host int playanimation(int id,string s);\r\n\ host int setimagemask(int id,string s);\r\n\ host int runscriptfunction(string key,string func);\r\n\ host int close();\r\n\ host int loadtexture(string path,string key);\r\n\ host int loadshape(string path,string key);\r\n\ host int loadanimation(string path,string key);\r\n\ host int loadscript(string path,string key);\r\n"; px_void PX_ConsoleUpdateEx(PX_Console *pc) { px_int i,y=10; PX_ConsoleColumn *pCc; while (pc->pObjects.size>pc->max_column) { pCc=(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,0)); PX_ObjectDelete(pCc->Object); PX_VectorErase(&pc->pObjects,0); } for (i=0;i<pc->pObjects.size;i++) { pCc=(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,i)); switch(pCc->Object->Type) { case PX_OBJECT_TYPE_AUTOTEXT: { PX_ObjectSetPosition(pCc->Object,0,(px_float)y,0); y+=PX_Object_AutoTextGetHeight(pCc->Object); } break; case PX_OBJECT_TYPE_IMAGE: { PX_ObjectSetPosition(pCc->Object,0,(px_float)y,0); y+=(px_int)PX_ObjectGetHeight(pCc->Object); } break; case PX_OBJECT_TYPE_ANIMATION: { PX_ObjectSetPosition(pCc->Object,0,(px_float)y,0); y+=(px_int)PX_ObjectGetHeight(pCc->Object); } break; case PX_OBJECT_TYPE_PARTICAL: break; case PX_OBJECT_TYPE_SHAPE: { PX_ObjectSetPosition(pCc->Object,0,(px_float)y,0); y+=(px_int)PX_ObjectGetHeight(pCc->Object); } break; case PX_OBJECT_TYPE_ROUNDCURSOR: { PX_Object_RoundCursor *pRc=PX_Object_GetRoundCursor(pCc->Object); PX_ObjectSetPosition(pCc->Object,(px_float)pc->runtime->width/2,(px_float)y+pRc->shape->height/2,0); y+=(px_int)PX_ObjectGetHeight(pCc->Object); } break; default: { PX_ObjectSetPosition(pCc->Object,0,(px_float)y,0); y+=(px_int)PX_ObjectGetHeight(pCc->Object); } break; } } PX_ObjectSetPosition(pc->Input,0,(px_float)y,0); } PX_Object * PX_ConsolePrintText(PX_Console *pc,px_char *text) { PX_ConsoleColumn obj; PX_Object *pObject=PX_Object_AutoTextCreate(&pc->runtime->mp_ui,PX_Object_ScrollAreaGetIncludedObjects(pc->Area),0,0,pc->runtime->width-1); if (pObject) { obj.Object=pObject; obj.id=pc->id++; PX_Object_AutoTextSetTextColor(pObject,PX_COLOR(255,0,255,0)); PX_Object_AutoTextSetText(pObject,text); PX_VectorPushback(&pc->pObjects,&obj); PX_ConsoleUpdateEx(pc); PX_Object_ScrollAreaMoveToBottom(pc->Area); } return pObject; } PX_Object * PX_ConsolePrintImage(PX_Console *pc,px_char *res_image_key) { PX_ConsoleColumn obj; PX_Resource *pimageRes; PX_Object *pObject; if(pimageRes=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,res_image_key)) { if (pimageRes->Type==PX_RESOURCE_TYPE_TEXTURE) { pObject=PX_Object_ImageCreate(&pc->runtime->mp_ui,PX_Object_ScrollAreaGetIncludedObjects(pc->Area),0,0,&pimageRes->texture); PX_Object_ImageSetAlign(pObject,PX_OBJECT_ALIGN_TOP|PX_OBJECT_ALIGN_LEFT); PX_ObjectSetSize(pObject,(px_float)pimageRes->texture.width,(px_float)pimageRes->texture.height,0); obj.Object=pObject; obj.id=pc->id++; PX_VectorPushback(&pc->pObjects,&obj); PX_ConsoleUpdateEx(pc); PX_Object_ScrollAreaMoveToBottom(pc->Area); } else return PX_NULL; } else { return PX_NULL; } return pObject; } PX_Object * PX_ConsolePrintShape(PX_Console *pc,px_char *res_image_key,px_color color) { PX_ConsoleColumn obj; PX_Resource *pShape; PX_Object *pObject; if(pShape=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,res_image_key)) { if (pShape->Type==PX_RESOURCE_TYPE_SHAPE) { pObject=PX_Object_ShapeCreate(&pc->runtime->mp_ui,PX_Object_ScrollAreaGetIncludedObjects(pc->Area),0,0,&pShape->shape); PX_Object_ShapeSetAlign(pObject,PX_OBJECT_ALIGN_TOP|PX_OBJECT_ALIGN_LEFT); PX_Object_ShapeSetBlendColor(pObject,color); PX_ObjectSetSize(pObject,(px_float)pShape->shape.width,(px_float)pShape->shape.height,0); obj.Object=pObject; obj.id=pc->id++; PX_VectorPushback(&pc->pObjects,&obj); PX_ConsoleUpdateEx(pc); PX_Object_ScrollAreaMoveToBottom(pc->Area); } else return PX_NULL; } else { return PX_NULL; } return pObject; } PX_Object * PX_ConsolePrintAnimation(PX_Console *pc,px_char *res_animation_key) { PX_ConsoleColumn obj; PX_Resource *pAnimationRes; PX_Object *pObject; px_rect rect; if(pAnimationRes=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,res_animation_key)) { if (pAnimationRes->Type==PX_RESOURCE_TYPE_ANIMATIONLIBRARY) { pObject=PX_Object_AnimationCreate(&pc->runtime->mp_ui,PX_Object_ScrollAreaGetIncludedObjects(pc->Area),0,0,&pAnimationRes->animationlibrary); PX_Object_AnimationSetAlign(pObject,PX_OBJECT_ALIGN_TOP|PX_OBJECT_ALIGN_LEFT); rect=PX_AnimationGetSize(&PX_Object_GetAnimation(pObject)->animation); PX_ObjectSetSize(pObject,(px_float)rect.width,(px_float)rect.height,0); obj.Object=pObject; obj.id=pc->id++; PX_VectorPushback(&pc->pObjects,&obj); PX_ConsoleUpdateEx(pc); PX_Object_ScrollAreaMoveToBottom(pc->Area); } else return PX_NULL; } else { return PX_NULL; } return pObject; } PX_Object * PX_ConsolePrintPartical(PX_Console *pc,px_int x,px_int y,px_char *res_texture,px_char *script,px_char *_init,px_char *_create,px_char *_updata) { PX_ConsoleColumn obj; PX_Resource *pTextureRes,*pScriptRes; PX_Object *pObject; if(!(pTextureRes=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,res_texture))) { return PX_NULL; } if (pTextureRes->Type!=PX_RESOURCE_TYPE_TEXTURE) { return PX_NULL; } if(!(pScriptRes=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,script))) { return PX_NULL; } if (pScriptRes->Type!=PX_RESOURCE_TYPE_SCRIPT) { return PX_NULL; } pObject=PX_Object_ParticalCreate(&pc->runtime->mp_ui,PX_Object_ScrollAreaGetIncludedObjects(pc->Area),x,y,0,&pTextureRes->texture,&pScriptRes->Script,_init,_create,_updata); PX_ObjectSetSize(pObject,0,0,0); obj.Object=pObject; obj.id=pc->id++; PX_VectorPushback(&pc->pObjects,&obj); return pObject; } PX_Object * PX_ConsoleShowImage(PX_Console *pc,px_char *res_image_key) { PX_ConsoleColumn obj; PX_Resource *pimageRes; PX_Object *pObject; if(pimageRes=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,res_image_key)) { if (pimageRes->Type==PX_RESOURCE_TYPE_TEXTURE) { pObject=PX_Object_ImageCreate(&pc->runtime->mp_ui,PX_Object_ScrollAreaGetIncludedObjects(pc->Area),0,0,&pimageRes->texture); PX_Object_ImageSetAlign(pObject,PX_OBJECT_ALIGN_TOP|PX_OBJECT_ALIGN_LEFT); obj.Object=pObject; obj.id=pc->id++; PX_VectorPushback(&pc->pObjects,&obj); PX_ConsoleUpdateEx(pc); PX_Object_ScrollAreaMoveToBottom(pc->Area); } else return PX_NULL; } else { return PX_NULL; } return pObject; } px_void PC_ConsolePlayAnimation(PX_Console *pc,px_int id,px_char *animation_name) { px_int i; PX_ConsoleColumn *pCc; for (i=0;i<pc->pObjects.size;i++) { pCc=PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,i); if(pCc->id==id) { if (pCc->Object->Type==PX_OBJECT_TYPE_ANIMATION) { PX_AnimationSetCurrentPlayAnimationByName(&PX_Object_GetAnimation(pCc->Object)->animation,animation_name); return; } } } } px_void PC_ConsoleSetImageMask(PX_Console *pc,px_int id,px_char *mask_key) { px_int i; PX_ConsoleColumn *pCc; for (i=0;i<pc->pObjects.size;i++) { pCc=PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,i); if(pCc->id==id) { if (pCc->Object->Type==PX_OBJECT_TYPE_IMAGE) { PX_Resource *pimageRes; if(pimageRes=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,mask_key)) { if (pimageRes->Type==PX_RESOURCE_TYPE_TEXTURE) { PX_Object_ImageSetMask(pCc->Object,&pimageRes->texture); } } } return; } } } PX_Object * PC_ConsoleCreateRoundCursor(PX_Console *pc,px_char *shape_key,px_color clr) { PX_ConsoleColumn obj; PX_Resource *pShape; PX_Object *pObject; if(pShape=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,shape_key)) { if (pShape->Type==PX_RESOURCE_TYPE_SHAPE) { pObject=PX_Object_RoundCursorCreate(&pc->runtime->mp_ui,PX_Object_ScrollAreaGetIncludedObjects(pc->Area),0,0,&pShape->shape,clr); PX_ObjectSetSize(pObject,(px_float)pShape->shape.width,(px_float)pShape->shape.height,0); obj.Object=pObject; obj.id=pc->id++; PX_VectorPushback(&pc->pObjects,&obj); PX_ConsoleUpdateEx(pc); PX_Object_ScrollAreaMoveToBottom(pc->Area); } else return PX_NULL; } else { return PX_NULL; } return pObject; } px_bool PC_ConsoleVM_Print(PX_ScriptVM_Instance *Ins) { PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } PX_ConsolePrintText(pc,PX_ScriptVM_STACK(Ins,0)._string.buffer); PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,pc->pObjects.size-1)->id)); return PX_TRUE; } px_bool PC_ConsoleVM_PrintImage(PX_ScriptVM_Instance *Ins) { PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } PX_ConsolePrintImage(pc,PX_ScriptVM_STACK(Ins,0)._string.buffer); PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,pc->pObjects.size-1)->id)); return PX_TRUE; } px_bool PC_ConsoleVM_PrintShape(PX_ScriptVM_Instance *Ins) { px_color clr; PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,1).type!=PX_SCRIPTVM_VARIABLE_TYPE_INT) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } clr._argb.ucolor=PX_ScriptVM_STACK(Ins,1)._uint; PX_ConsolePrintShape(pc,PX_ScriptVM_STACK(Ins,0)._string.buffer,clr); PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,pc->pObjects.size-1)->id)); return PX_TRUE; } px_bool PC_ConsoleVM_PrintAnimation(PX_ScriptVM_Instance *Ins) { PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } PX_ConsolePrintAnimation(pc,PX_ScriptVM_STACK(Ins,0)._string.buffer); PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,pc->pObjects.size-1)->id)); return PX_TRUE; } px_bool PC_ConsoleVM_PlayAnimation(PX_ScriptVM_Instance *Ins) { PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_INT) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,1).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } PC_ConsolePlayAnimation(pc,PX_ScriptVM_STACK(Ins,0)._int,PX_ScriptVM_STACK(Ins,1)._string.buffer); return PX_TRUE; } px_bool PC_ConsoleVM_SetImageMask(PX_ScriptVM_Instance *Ins) { PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_INT) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,1).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } PC_ConsoleSetImageMask(pc,PX_ScriptVM_STACK(Ins,0)._int,PX_ScriptVM_STACK(Ins,1)._string.buffer); return PX_TRUE; } px_bool PC_ConsoleVM_Close(PX_ScriptVM_Instance *Ins) { PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; PX_ConsoleShow(pc,PX_FALSE); return PX_TRUE; } px_bool PC_ConsoleVM_PrintPartical(PX_ScriptVM_Instance *Ins) { PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_INT) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,1).type!=PX_SCRIPTVM_VARIABLE_TYPE_INT) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,2).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,3).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,4).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,5).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,6).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if(PX_ConsolePrintPartical(\ pc,\ PX_ScriptVM_STACK(Ins,0)._int,\ PX_ScriptVM_STACK(Ins,1)._int,\ PX_ScriptVM_STACK(Ins,2)._string.buffer,\ PX_ScriptVM_STACK(Ins,3)._string.buffer,\ PX_ScriptVM_STACK(Ins,4)._string.buffer,\ PX_ScriptVM_STACK(Ins,5)._string.buffer,\ PX_ScriptVM_STACK(Ins,6)._string.buffer\ )) PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,pc->pObjects.size-1)->id)); else PX_ConsolePrintText(pc,"Could not Create Partical Launcher"); return PX_TRUE; } px_bool PC_ConsoleVM_PrintRoundCursor(PX_ScriptVM_Instance *Ins) { px_color clr; PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,1).type!=PX_SCRIPTVM_VARIABLE_TYPE_INT) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } clr._argb.ucolor=PX_ScriptVM_STACK(Ins,1)._uint; PC_ConsoleCreateRoundCursor(pc,PX_ScriptVM_STACK(Ins,0)._string.buffer,clr); PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,pc->pObjects.size-1)->id)); return PX_TRUE; } px_void PC_ConsoleRunScriptFunction(PX_Console *pc,px_char *script_key,px_char *func_name) { PX_Resource *pScriptRes; if(pScriptRes=PX_ResourceLibraryGet(&pc->runtime->ResourceLibrary,script_key)) { if (pScriptRes->Type==PX_RESOURCE_TYPE_SCRIPT) { PX_ScriptVM_RegistryHostFunction(&pScriptRes->Script,"PRINT",PC_ConsoleVM_Print);//Print PX_ScriptVM_RegistryHostFunction(&pScriptRes->Script,"PRINTIMAGE",PC_ConsoleVM_PrintImage);//Print Image PX_ScriptVM_RegistryHostFunction(&pScriptRes->Script,"PRINTSHAPE",PC_ConsoleVM_PrintShape);//Print Shape PX_ScriptVM_RegistryHostFunction(&pScriptRes->Script,"PRINTANIMATION",PC_ConsoleVM_PrintAnimation);//Print Animation PX_ScriptVM_RegistryHostFunction(&pScriptRes->Script,"PRINTPARTICAL",PC_ConsoleVM_PrintPartical);//Print Partical if(!PX_ScriptVM_InstanceRunFunction(&pScriptRes->Script,0,pc,"_BOOT",PX_NULL,0)) { return; } if(!PX_ScriptVM_InstanceRunFunction(&pScriptRes->Script,0,pc,func_name,PX_NULL,0)) { return ; } } else return; } else { return; } } px_bool PC_ConsoleVM_RunScriptFunction(PX_ScriptVM_Instance *Ins) { PX_Console *pc=(PX_Console *)Ins->pThread[Ins->T].user_runtime_data; if (PX_ScriptVM_STACK(Ins,0).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } if (PX_ScriptVM_STACK(Ins,1).type!=PX_SCRIPTVM_VARIABLE_TYPE_STRING) { PX_ScriptVM_RET(Ins,PX_ScriptVM_Variable_int(0)); return PX_TRUE; } PC_ConsoleRunScriptFunction(pc,PX_ScriptVM_STACK(Ins,0)._string.buffer,PX_ScriptVM_STACK(Ins,1)._string.buffer); return PX_TRUE; } px_bool PX_ConsoleExecute(PX_Console *pc,char *pshellstr) { px_memory bin; px_string shell; PX_ScriptVM_Instance Ins; PX_SCRIPT_LIBRARY lib; px_string asmcodeString; px_memorypool mp_calc;//6M mp_calc=MP_Create(MP_Malloc(&pc->runtime->mp,PE_MEMORY_CALC_SIZE),PE_MEMORY_CALC_SIZE); if(mp_calc.StartAddr==PX_NULL) return PX_FALSE; PX_ConsolePrintText(pc,pshellstr); MP_Reset(&mp_calc); PX_MemoryInit(&mp_calc,&bin); PX_StringInit(&mp_calc,&shell); PX_StringCat(&shell,(char *)PC_ScriptPreload); if(pc->script_header_append) PX_StringCat(&shell,(char *)pc->script_header_append); PX_StringCat(&shell,"export void main(){\r\n"); PX_StringCat(&shell,pshellstr); PX_StringCat(&shell,"\r\n}"); if(!PX_ScriptCompilerInit(&lib,&mp_calc)) { MP_Free(&pc->runtime->mp,mp_calc.StartAddr); return PX_FALSE; } if(!PX_ScriptCompilerLoad(&lib,(px_char *)shell.buffer)) { MP_Free(&pc->runtime->mp,mp_calc.StartAddr); return PX_FALSE; } PX_StringFree(&shell); PX_StringInit(&mp_calc,&asmcodeString); if(PX_ScriptCompilerCompile(&lib,"shell",&asmcodeString,32)) { PX_ScriptAsmOptimization(&asmcodeString); if(!PX_ScriptAsmCompile(&mp_calc,asmcodeString.buffer,&bin)) { MP_Free(&pc->runtime->mp,mp_calc.StartAddr); return PX_FALSE; } } else { MP_Free(&pc->runtime->mp,mp_calc.StartAddr); return PX_FALSE; } PX_StringFree(&asmcodeString); PX_ScriptCompilerFree(&lib); if(!PX_ScriptVM_InstanceInit(&Ins,&mp_calc,bin.buffer,bin.usedsize)) { MP_Free(&pc->runtime->mp,mp_calc.StartAddr); return PX_FALSE; } PX_MemoryFree(&bin); PX_ScriptVM_RegistryHostFunction(&Ins,"PRINT",PC_ConsoleVM_Print);//Print PX_ScriptVM_RegistryHostFunction(&Ins,"PRINTIMAGE",PC_ConsoleVM_PrintImage);//Print Image PX_ScriptVM_RegistryHostFunction(&Ins,"PRINTSHAPE",PC_ConsoleVM_PrintShape);//Print Shape PX_ScriptVM_RegistryHostFunction(&Ins,"PRINTANIMATION",PC_ConsoleVM_PrintAnimation);//Print Animation PX_ScriptVM_RegistryHostFunction(&Ins,"PRINTPARTICAL",PC_ConsoleVM_PrintPartical);//Print Partical PX_ScriptVM_RegistryHostFunction(&Ins,"PLAYANIMATION",PC_ConsoleVM_PlayAnimation);//play Animation PX_ScriptVM_RegistryHostFunction(&Ins,"SETIMAGEMASK",PC_ConsoleVM_SetImageMask);//SetImage Mask PX_ScriptVM_RegistryHostFunction(&Ins,"RUNSCRIPTFUNCTION",PC_ConsoleVM_RunScriptFunction);//Load PatricalScript PX_ScriptVM_RegistryHostFunction(&Ins,"PRINTROUNDCURSOR",PC_ConsoleVM_PrintRoundCursor);//print roundcursor PX_ScriptVM_RegistryHostFunction(&Ins,"CLOSE",PC_ConsoleVM_Close);//close if (pc->registry_call) { pc->registry_call(&Ins); } if(!PX_ScriptVM_InstanceRunFunction(&Ins,0,pc,"_BOOT",PX_NULL,0)) { MP_Free(&pc->runtime->mp,mp_calc.StartAddr); return PX_FALSE; } if(!PX_ScriptVM_InstanceRunFunction(&Ins,0,pc,"MAIN",PX_NULL,0)) { MP_Free(&pc->runtime->mp,mp_calc.StartAddr); return PX_FALSE; } PX_ScriptVM_InstanceFree(&Ins); #if defined(PX_DEBUG_MODE) && defined(PX_MEMORYPOOL_DEBUG_CHECK) MP_UnreleaseInfo(&mp_calc); #endif MP_Free(&pc->runtime->mp,mp_calc.StartAddr); return PX_TRUE; } px_void PX_ConsoleOnEnter(PX_Object *Obj,PX_Object_Event e,px_void *user_ptr) { PX_Console *pc=(PX_Console *)Obj->User_ptr; PX_Object_Edit *pEdit=PX_Object_GetEdit(pc->Input); if (e.Event==PX_OBJECT_EVENT_KEYDOWN) { if (e.Param_uint[0]==13) { if(!PX_ConsoleExecute(pc,pEdit->text.buffer)) { PX_Object_AutoTextSetTextColor(PX_ConsolePrintText(pc,"Invalid shell code."),PX_COLOR(255,255,0,0)); } PX_Object_EditSetText(pc->Input,""); } } if (e.Event==PX_OBJECT_EVENT_CURSORRDOWN) { PX_Object_EditSetFocus(pc->Input); } } px_void PX_ConsoleOnMouseDown(PX_Object *Obj,PX_Object_Event e,px_void *user_ptr) { PX_Console *pc=(PX_Console *)Obj->User_ptr; if (e.Event==PX_OBJECT_EVENT_CURSORDOWN) { PX_Object_EditSetFocus(pc->Input); } } px_bool PC_ConsoleInit(PX_Console *pc) { pc->show=PX_FALSE; pc->max_column=PC_CONSOLE_DEFAULT_MAX_COLUMN; pc->column=0; if(!(pc->Root=PX_ObjectCreate(&pc->runtime->mp_ui,0,0,0,0,0,0,0))) return PX_FALSE; if(!(pc->Area=PX_Object_ScrollAreaCreate(&pc->runtime->mp_ui,pc->Root,0,0,pc->runtime->width,pc->runtime->height))) return PX_FALSE; pc->Area->User_ptr=pc; PX_ObjectRegisterEvent(pc->Area,PX_OBJECT_EVENT_KEYDOWN,PX_ConsoleOnEnter,PX_NULL); PX_ObjectRegisterEvent(pc->Area,PX_OBJECT_EVENT_CURSORDOWN,PX_ConsoleOnMouseDown,PX_NULL); PX_Object_ScrollAreaSetBorder(pc->Area,PX_FALSE); if(!(pc->Input=PX_Object_EditCreate(&pc->runtime->mp_ui,PX_Object_ScrollAreaGetIncludedObjects(pc->Area),0,0,pc->runtime->width-1,PX_FontGetCharactorHeight()+4,PX_COLOR(255,0,255,0)))) return PX_FALSE; PX_Object_EditSetCursorColor(pc->Input,PX_COLOR(255,0,255,0)); PX_Object_EditSetTextColor(pc->Input,PX_COLOR(255,0,255,0)); PX_Object_EditSetBorderColor(pc->Input,PX_COLOR(255,0,255,0)); PX_Object_EditSetOffset(pc->Input,2,3); PX_Object_ScrollAreaSetBkColor(pc->Area,PX_COLOR(255,0,0,0)); pc->id=1; PX_VectorInit(&pc->runtime->mp_ui,&pc->pObjects,sizeof(PX_ConsoleColumn),PC_CONSOLE_DEFAULT_MAX_COLUMN); ////////////////////////////////////////////////////////////////////////// //logo if(!PX_ResourceLibraryLoad(&pc->runtime->ResourceLibrary,PX_RESOURCE_TYPE_TEXTURE,(px_byte *)fox_console_logo,sizeof(fox_console_logo),"console_logo"))return PX_FALSE; PX_ConsoleShowImage(pc,"console_logo"); PX_ConsolePrintText(pc," PainterEngine JIT Compilation Console\n StoryScript Shell For StoryVM\n Code By DBinary Build on 2019\n Refer To:www.GitHub.com/matrixcascade\n"); return PX_TRUE; } px_bool PX_ConsoleInitialize(PX_Runtime *runtime,PX_Console *pc) { //console initialize pc->runtime=runtime; pc->registry_call=PX_NULL; pc->script_header_append=PX_NULL; if(!PC_ConsoleInit(pc))return PX_FALSE; return PX_TRUE; } px_void PX_ConsolePostEvent(PX_Console *pc,PX_Object_Event e) { px_int i; if(pc->show) { if (e.Event==PX_OBJECT_EVENT_KEYDOWN) { if (e.Param_uint[0]==36) { PX_ConsoleShow(pc,PX_FALSE); return; } } if (e.Event!=PX_OBJECT_EVENT_CURSORMOVE) { PX_ObjectPostEvent(pc->Root,e); } else { for (i=0;i<pc->pObjects.size;i++) { PX_ConsoleColumn *pCcObject=PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,i); if (pCcObject->Object->Type==PX_OBJECT_TYPE_ROUNDCURSOR) { PX_ObjectPostEvent(pCcObject->Object,e); } } } } else { if (e.Event==PX_OBJECT_EVENT_KEYDOWN) { if (e.Param_uint[0]==36) { PX_ConsoleShow(pc,PX_TRUE); } } } } px_void PX_ConsoleUpdate(PX_Console *pc,px_dword elpased) { PX_ObjectUpdate(pc->Area,elpased); } px_void PX_ConsoleShow(PX_Console *pc,px_bool b) { pc->show=b; } px_void PX_ConsoleRender(PX_Console *pc,px_dword elpased) { if(pc->show) { PX_ObjectRender(&pc->runtime->RenderSurface,pc->Area,elpased); } } px_void PX_ConsoleRegistryHostCall(PX_Console *pc,console_registry_hostcall call_func) { pc->registry_call=call_func; } px_void PX_ConsoleRegistryScriptHeader(PX_Console *pc,px_char *header) { pc->script_header_append=header; } px_void PX_ConsoleClear(PX_Console *pc) { PX_ConsoleColumn *pCc; px_int i; for (i=0;i<pc->pObjects.size;i++) { pCc=(PX_VECTORAT(PX_ConsoleColumn,&pc->pObjects,i)); PX_ObjectDelete(pCc->Object); } PX_VectorClear(&pc->pObjects); }
111.087822
71,049
0.765519
[ "object", "shape" ]
9dcc0d65d8027eaf27bd467e26e504f7a2a11afe
2,959
h
C
include/apeIUnitTexture.h
wterkaj/ApertusVR
424ec5515ae08780542f33cc4841a8f9a96337b3
[ "MIT" ]
158
2016-11-17T19:37:51.000Z
2022-03-21T19:57:55.000Z
include/apeIUnitTexture.h
wterkaj/ApertusVR
424ec5515ae08780542f33cc4841a8f9a96337b3
[ "MIT" ]
94
2016-11-18T09:55:57.000Z
2021-01-14T08:50:40.000Z
include/apeIUnitTexture.h
wterkaj/ApertusVR
424ec5515ae08780542f33cc4841a8f9a96337b3
[ "MIT" ]
51
2017-05-24T10:20:25.000Z
2022-03-17T15:07:02.000Z
/*MIT License Copyright (c) 2018 MTA SZTAKI Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ #ifndef APE_IUNITTEXTURE_H #define APE_IUNITTEXTURE_H #include <string> #include <vector> #include "apeEntity.h" #include "apeTexture.h" #include "apeVector2.h" #include "apeICamera.h" namespace ape { class IUnitTexture : public Texture { public: struct Parameters { ape::MaterialWeakPtr material; std::string fileName; Parameters() { this->material = ape::MaterialWeakPtr(); this->fileName = std::string(); } Parameters(ape::MaterialWeakPtr material, std::string fileName) { this->material = material; this->fileName = fileName; } }; struct Filtering { ape::Texture::Filtering minFilter; ape::Texture::Filtering magFilter; ape::Texture::Filtering mipFilter; Filtering() { this->minFilter = ape::Texture::Filtering::F_NONE; this->magFilter = ape::Texture::Filtering::F_NONE; this->mipFilter = ape::Texture::Filtering::F_NONE; } Filtering(ape::Texture::Filtering minFilter, ape::Texture::Filtering magFilter, ape::Texture::Filtering mipFilter) { this->minFilter = minFilter; this->magFilter = magFilter; this->mipFilter = mipFilter; } }; protected: IUnitTexture(std::string name) : Texture(name, Entity::TEXTURE_UNIT) {} virtual ~IUnitTexture() {}; public: virtual void setParameters(ape::MaterialWeakPtr material, std::string fileName) = 0; virtual Parameters getParameters() = 0; virtual void setTextureScroll(float u, float v) = 0; virtual ape::Vector2 getTextureScroll() = 0; virtual void setTextureAddressingMode(ape::Texture::AddressingMode addressingMode) = 0; virtual ape::Texture::AddressingMode getTextureAddressingMode() = 0; virtual void setTextureFiltering(ape::Texture::Filtering minFilter, ape::Texture::Filtering magFilter, ape::Texture::Filtering mipFilter) = 0; virtual Filtering getTextureFiltering() = 0; }; } #endif
27.915094
144
0.741129
[ "vector" ]
9dcc6a26f9bce1cd9e09fb1a8d6d2612e6c86ec7
7,662
c
C
find_edge.c
matvii/adam-asteroid
b85287ba8077158c6f1525d11fc668673cefa332
[ "CC-BY-4.0" ]
16
2017-06-24T03:49:40.000Z
2022-01-31T21:47:17.000Z
find_edge.c
matvii/adam-asteroid
b85287ba8077158c6f1525d11fc668673cefa332
[ "CC-BY-4.0" ]
1
2018-01-12T13:18:51.000Z
2018-01-12T13:18:51.000Z
find_edge.c
matvii/adam-asteroid
b85287ba8077158c6f1525d11fc668673cefa332
[ "CC-BY-4.0" ]
6
2018-01-12T13:12:52.000Z
2021-09-24T12:27:39.000Z
#include<string.h> #include<stdio.h> #include<stdlib.h> #include<math.h> #include"utils.h" int linesegment_intersect(double *a,double *b,double *x,double *y,double *p,double *dpx,double *dpy,double* dpox,double* dpoy) { /* * Check whether line determined by points a,b *intersects the line segment determined by x,y *If intersection, inters=true and the intersection is x+t(y-x) *p=(px,py) *dpx=[dpx/dx0,dpx/dx1,dpx/dy0,dpx/dy1] IF x=(x0,y0), y=(x1,y1). NOTE THAT *HERE x=(x0,x1) y=(y0,y1). SO dpx is derivative wrt 1.point x-coord, *1.point y-coord, 2.point x-coord 2.point y-coord *dtdx=[dt/dx0 dt/dy0], dtdy=[dt/dx1,dt/dy1];Checks whether line determined by point a,b */ double eps=1E-10; int inters=0; double t=0; double b0=b[0]; double b1=b[1]; double a0=a[0]; double a1=a[1]; double x0=x[0]; double x1=x[1]; double y0=y[0]; double y1=y[1]; double dtdx[2],dtdy[2]; double denom=(b0-a0)*(x1-y1)-(b1-a1)*(x0-y0); double s; if(fabs(denom)<eps) return 0; t=((a0-x0)*(b1-a1)-(a1-x1)*(b0-a0))/denom; if(t<0 || t>1) return 0; s=-((x0-a0)*(y1-x1)-(x1-a1)*(y0-x0))/denom; if(s<0 || s>1) return 0; p[0]=x[0]+t*(y[0]-x[0]); p[1]=x[1]+t*(y[1]-x[1]); dtdx[0]=(a1-b1)*(a1*(b0-y0)+b1*y0-b0*y1+a0*(-b1+y1))/pow(denom,2); dtdx[1]=(a1 - b1)*(-b1*x0 + a1*(-b0 + x0) + a0*(b1 - x1) + b0*x1)/pow(denom,2); dtdy[0]=(a0 - b0)*(-b1*y0 + a1*(-b0 + y0) + a0*(b1 - y1) + b0*y1)/pow(denom,2); dtdy[1]=-(a0 - b0)*(-b1*x0 + a1*(-b0 + x0) + a0*(b1 - x1) + b0*x1)/pow(denom,2); dpx[0]=1+dtdx[0]*(y0-x0)-t; dpx[1]=dtdy[0]*(y0-x0); dpx[2]=dtdx[1]*(y0-x0)+t; dpx[3]=dtdy[1]*(y0-x0); dpy[0]=dtdx[0]*(y1-x1); dpy[1]=1+dtdy[0]*(y1-x1)-t; dpy[2]=dtdx[1]*(y1-x1); dpy[3]=dtdy[1]*(y1-x1)+t; //// double ddenom=pow(a1*(x0 - y0) + b1*(-x0 + y0) - (a0 - b0)*(x1 - y1),2); dpox[0]=(pow(b1,2)*pow(x0 - y0,2) + pow(a0 - b0,2)*pow(x1 - y1,2) +b1*(x0 - y0)*(-2*b0*x1 + x1*y0 + a0*(x1 - y1) + 2*b0*y1 - x0*y1) - a1*(x0 - y0)*(-2*b0*x1 + b1*(x0 - y0) + x1*y0 + a0*(x1 - y1) + 2*b0*y1 - x0*y1))/ddenom; //dp[0]/doffx dpox[1]=-((a1 - b1)*(x1 - y1)*(a1*(x0 - y0) + x1*y0 - x0*y1 + a0*(-x1 + y1)))/ddenom; //dp[1]/doffx dpoy[0]=-((a0 - b0)*(x0 - y0)*(-(x1*y0) + a1*(-x0 + y0) + a0*(x1 - y1) + x0*y1))/ddenom; //dp[0]/doffy dpoy[1]=(pow(a1,2)*pow(x0 - y0,2) + pow(b1,2)*pow(x0 - y0,2) - a1*(x0 - y0)*(2*b1*(x0 - y0) + (a0 - b0)*(x1 - y1)) + 2*(a0 - b0)*b1*(x0 - y0)*(x1 - y1) - (a0 - b0)*(x1 - y1)*(-(x1*y0) + b0*(x1 - y1) + x0*y1))/ddenom; return 1; } void find_edge(int *tlist,double *vlist2,int nfac,int nvert,int *visible,double *offset,double *a,double *b,int *cledge,double *clpoint,int *inters,double *dclpx,double *dclpy,double *dclpdoffx,double *dclpdoffy) { /* * *Find outer edge that line a->b intersects *We assume the shape is already rotated and projected to plane *determined by the z axis. *Adj is the nvertxnvert adjavency matrix, where Adj(i,j)!=0 if vertices i *and j are connected by an edge *OUTPUT *cledge closest edge to a, corresponds to vertices cledge[0] and cledge[1] * clt is t value corresponding to the intersection point, *clpoint=vlist(cledge[0],:)+clt*(vlist(cledge[1],:)-vlist(cledge[0],:)) */ double eps=1E-10; int *A=calloc(nvert*nvert,sizeof(int)); int i1,i2,i3; double u1,u2,w1,w2,n3; double *v1,*v2,*v3; double interp[2],ip[2]; double dpx[4],dpy[4]; double dist,cldist=1E9; double doffx[2],doffy[2]; double *vlist=calloc(3*nvert,sizeof(double)); memcpy(vlist,vlist2,sizeof(double)*nvert*3); // memcpy(A,Adj,sizeof(int)*nvert*nvert); double bbx[2],bby[2]; double offx=offset[0]; double offy=offset[1]; //Add offsets to vlist for(int j=0;j<nvert;j++) { vlist[3*j]+=offx; vlist[3*j+1]+=offy; } bbx[0]=minv(vlist,nvert,0); bbx[1]=maxv(vlist,nvert,0); bby[0]=minv(vlist,nvert,1); bby[1]=maxv(vlist,nvert,1); int t=1; double p[2]; double b11,b12,b21,b22; double bv11,bv12,bv21,bv22; a[0]=offx; a[1]=offy; p[0]=a[0]+t*(b[0]-a[0]); p[1]=a[1]+t*(b[1]-a[1]); while(p[0]<bbx[1] && p[0]>bbx[0] && p[1]<bby[1] && p[1]>bby[0]) { t++; p[0]=a[0]+t*(b[0]-a[0]); p[1]=a[1]+t*(b[1]-a[1]); } // b11=fmin(0,p[0]); // b12=fmin(0,p[1]); // b21=fmax(0,p[0]); // b22=fmax(0,p[1]); // p is a point on line a-b outside the shape. We use p to find the closest //and farthest intersection points of model and and chord a->b. clpoint[0]=0; clpoint[1]=0; int sinters=0; for(int j=0;j<nfac;j++) { i1=tlist[3*j]-1; i2=tlist[3*j+1]-1; i3=tlist[3*j+2]-1; if(visible[j]==0) continue; v1=vlist+3*i1; v2=vlist+3*i2; v3=vlist+3*i3; // bv11=fmin(v1[0],fmin(v2[0],v3[0])); // bv12=fmin(v1[1],fmin(v2[1],v3[1])); // bv21=fmax(v1[0],fmax(v2[0],v3[0])); // bv22=fmax(v1[1],fmax(v2[1],v3[1])); // if(b12>bv22 || b22<bv12) // continue; // if(b21<bv11 || bv21<b11) // continue; if(linesegment_intersect(a,p,v1,v2,ip,dpx,dpy,doffx,doffy)) { sinters=1; //ip is the intersection point of line a->b and the current edge dist=sqrt(pow(ip[0]-p[0],2)+pow(ip[1]-p[1],2)); if(dist<cldist) { cldist=dist; cledge[0]=i1; cledge[1]=i2; clpoint[0]=ip[0]; clpoint[1]=ip[1]; memcpy(dclpx,dpx,sizeof(double)*4); memcpy(dclpy,dpy,sizeof(double)*4); memcpy(dclpdoffx,doffx,2*sizeof(double)); memcpy(dclpdoffy,doffy,2*sizeof(double)); } } if(linesegment_intersect(a,p,v2,v3,ip,dpx,dpy,doffx,doffy)) { sinters=1; dist=sqrt(pow(ip[0]-p[0],2)+pow(ip[1]-p[1],2)); if(dist<cldist) { cldist=dist; cledge[0]=i2; cledge[1]=i3; clpoint[0]=ip[0]; clpoint[1]=ip[1]; memcpy(dclpx,dpx,sizeof(double)*4); memcpy(dclpy,dpy,sizeof(double)*4); memcpy(dclpdoffx,doffx,2*sizeof(double)); memcpy(dclpdoffy,doffy,2*sizeof(double)); } } if(linesegment_intersect(a,p,v3,v1,ip,dpx,dpy,doffx,doffy)) { sinters=1; dist=sqrt(pow(ip[0]-p[0],2)+pow(ip[1]-p[1],2)); if(dist<cldist) { cldist=dist; cledge[0]=i3; cledge[1]=i1; clpoint[0]=ip[0]; clpoint[1]=ip[1]; memcpy(dclpx,dpx,sizeof(double)*4); memcpy(dclpy,dpy,sizeof(double)*4); memcpy(dclpdoffx,doffx,2*sizeof(double)); memcpy(dclpdoffy,doffy,2*sizeof(double)); } } } free(A); free(vlist); *inters=sinters; }
34.205357
239
0.481597
[ "shape", "model" ]
9dd4f263d07e560c4a8a9ca615bc03252fb6be07
1,833
h
C
larbin-2.6.3/src/utils/PersistentFifo.h
imyouxia/Source
624df9ffeb73d9ce918d5f7ef77bae6b9919e30a
[ "MIT" ]
115
2016-08-02T02:07:12.000Z
2022-03-04T01:44:13.000Z
larbin-2.6.3/src/utils/PersistentFifo.h
EmpTan/Source
624df9ffeb73d9ce918d5f7ef77bae6b9919e30a
[ "MIT" ]
null
null
null
larbin-2.6.3/src/utils/PersistentFifo.h
EmpTan/Source
624df9ffeb73d9ce918d5f7ef77bae6b9919e30a
[ "MIT" ]
46
2016-08-09T09:54:27.000Z
2021-03-05T10:47:55.000Z
// Larbin // Sebastien Ailleret // 06-01-00 -> 12-06-01 /* this fifo is stored on disk */ #ifndef PERSFIFO_H #define PERSFIFO_H #include <dirent.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <string.h> #include "types.h" #include "utils/url.h" #include "utils/text.h" #include "utils/connexion.h" #include "utils/mypthread.h" class PersistentFifo { protected: uint in, out; #ifdef THREAD_OUTPUT pthread_mutex_t lock; #endif // number of the file used for reading int fin, fout; // name of files uint fileNameLength; char *fileName; // Make fileName fit with this number void makeName (uint nb); // Give a file name for this int int getNumber (char *file); // Change the file used for reading void updateRead (); // Change the file used for writing void updateWrite (); // buffer used for readLine char outbuf[BUF_SIZE]; // number of char used in this buffer uint outbufPos; // buffer used for readLine char buf[BUF_SIZE]; // number of char used in this buffer uint bufPos, bufEnd; // sockets for reading and writing int rfds, wfds; // read a line on rfds char *readLine (); // write an url in the out file (buffered write) void writeUrl (char *s); // Flush the out Buffer in the outFile void flushOut (); public: /* Specific constructor */ PersistentFifo (bool reload, char *baseName); /* Destructor */ ~PersistentFifo (); /* get the first object (non totally blocking) * return NULL if there is none */ url *tryGet (); /* get the first object (non totally blocking) * probably crash if there is none */ url *get (); /* add an object in the fifo */ void put (url *obj); /* how many items are there inside ? */ int getLength (); }; #endif // PERSFIFO_H
21.564706
50
0.672668
[ "object" ]
9dd674d86852e6110b8d518d6725865897e849a1
1,649
h
C
GTE/Samples/Mathematics/ShortestPath/CpuShortestPath.h
Cadcorp/GeometricTools
5fc64438e05dfb5a2b179eb20e02bb4ed9ddc224
[ "BSL-1.0" ]
null
null
null
GTE/Samples/Mathematics/ShortestPath/CpuShortestPath.h
Cadcorp/GeometricTools
5fc64438e05dfb5a2b179eb20e02bb4ed9ddc224
[ "BSL-1.0" ]
1
2021-04-07T09:16:45.000Z
2021-04-07T09:16:45.000Z
GTE/Samples/Mathematics/ShortestPath/CpuShortestPath.h
Cadcorp/GeometricTools
5fc64438e05dfb5a2b179eb20e02bb4ed9ddc224
[ "BSL-1.0" ]
null
null
null
// David Eberly, Geometric Tools, Redmond WA 98052 // Copyright (c) 1998-2020 // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt // https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt // Version: 4.0.2019.08.13 #pragma once #include <Graphics/Texture2.h> #include <Mathematics/Array2.h> #include <stack> using namespace gte; class CpuShortestPath { public: CpuShortestPath(std::shared_ptr<Texture2> const& weights); void Compute(std::stack<std::pair<int, int>>& path); private: // The weights texture stores (F(x,y), W1(x,y), W2(x,y), W3(x,y)), where // F(x,y) is the height field and the edge weights are // W1(x,y) = W((x,y),(x+1,y)) = (F(x+1,y) + F(x,y))/2 // W2(x,y) = W((x,y),(x,y+1)) = (F(x,y+1) + F(x,y))/2 // W3(x,y) = W((x,y),(x+1,y+1)) = (F(x+1,y+1) + F(x,y))/sqrt(2) struct Weights { // For more readable code using names rather than indices for // components of Vector4<float> float h, w1, w2, w3; }; // The minimum distance to pixel at (x,y) and the previous neighbor // (xPrevious,yPrevious) that led to this minimum. struct Node { Node(float dist = 0.0f, int xPrev = -1, int yPrev = -1); float distance; int xPrevious, yPrevious; }; // The 'weights' input is mSize-by-mSize. int mSize; // Use the Array2 object to access 'weights' using 2-tuple locations. Array2<Weights> mWeights; // Keep track of the distances and the previous pixel that led to the // minimum distance for the current pixel. Array2<Node> mNodes; };
31.113208
76
0.624015
[ "object" ]
9dd77a3d3b0f912d8905dab851aa0db511b67737
5,985
h
C
CommonLib/cxCProcParms.h
chrishoen/Dev_NP_TTA_NewCProc
95a0d59e6079e6f42a11cfe5da5ec41221f67227
[ "MIT" ]
null
null
null
CommonLib/cxCProcParms.h
chrishoen/Dev_NP_TTA_NewCProc
95a0d59e6079e6f42a11cfe5da5ec41221f67227
[ "MIT" ]
null
null
null
CommonLib/cxCProcParms.h
chrishoen/Dev_NP_TTA_NewCProc
95a0d59e6079e6f42a11cfe5da5ec41221f67227
[ "MIT" ]
null
null
null
#pragma once /*============================================================================== Parameters class whose values are read from a command file. ==============================================================================*/ //****************************************************************************** //****************************************************************************** //****************************************************************************** #include "risCmdLineParms.h" #include "tsDefs.h" //****************************************************************************** //****************************************************************************** //****************************************************************************** namespace CX { //****************************************************************************** //****************************************************************************** //****************************************************************************** // This is a class that contains parameter member variables. The values of // the parameters are set by reading a text file that contains command lines. // Each command line is of the form "command argument1 argument2 ...". // // The command files are partitioned into different sections and only one // section can be read at a time to set member variables that are specified // in it. // // The command files are managed by a CmdLineFile object. This opens the // file, reads each line in it, parses the line into a CmdLineCmd command // object, passes the command object to this object for command execution, // and then closes the file. // // This class inherits from BaseCmdLineParms, which inherits from // BaseCmdLineExec. BaseCmdLineParms provides a method that uses a // CmdLineFile object to read and process the file. BaseCmdLineExec provides // an abstract execute(cmd) method to which inheritors provide an overload // that is called by the CmdLineFile object for each command in the file. // This execute method then sets a member variables, according to the // command. // // This class can contain member variables that also inherit from // BaseCmdLineExec. This provides for command files that have a nested // structure. If so, then this class is the root. // class CProcParms : public Ris::BaseCmdLineParms { public: //*************************************************************************** //*************************************************************************** //*************************************************************************** // Constants. static const int cMaxStringSize = 100; //*************************************************************************** //*************************************************************************** //*************************************************************************** // Members. // If true then enable aux alarm input overrides. bool mAuxOverrideEnable; // If true then enable hlc input overrides. bool mHLCOverrideEnable; // If true then enable hlc input overrides with a simulated sinusoid. bool mHLCSimSinEnable; // Simulated sinusoid period and amplitude limits. double mHLCSimSinPeriod; double mHLCSimSinAmpHi; double mHLCSimSinAmpLo; // HLC measurements. double mHLCOffsetESS; double mHLCOffsetSA; double mHLCThreshLo; int mHLCTimerPeriod; double mHLCStepTime; //*************************************************************************** //*************************************************************************** //*************************************************************************** // Members. // Test code. int mTestCode; //*************************************************************************** //*************************************************************************** //*************************************************************************** // Members. // If true then enable print view and initialize it with the // given ip address. Print view routes debug prints from the // backend threads to print view consoles on a host. bool mPrintViewEnable; char mPrintViewIPAddress[30]; //*************************************************************************** //*************************************************************************** //*************************************************************************** // Expanded members that are not read from the parms file. //*************************************************************************** //*************************************************************************** //*************************************************************************** // Methods. // Constructor, typedef Ris::BaseCmdLineParms BaseClass; CProcParms(); void reset(); void show(); // Base class override: Execute a command from the command file to set a // member variable. This is called by the associated command file object // for each command in the file. void execute(Ris::CmdLineCmd* aCmd) override; // Calculate expanded member variables. This is called after the entire // section of the command file has been processed. void expand() override; }; //****************************************************************************** //****************************************************************************** //****************************************************************************** // Global instance. #ifdef _CXCPROCPARMS_CPP_ CProcParms gCProcParms; #else extern CProcParms gCProcParms; #endif //****************************************************************************** //****************************************************************************** //****************************************************************************** }//namespace
40.714286
80
0.386299
[ "object" ]
9dde753e45cb488c793fa347700b3e6909a5e189
5,351
c
C
experimental/algorithm/LAGraph_AllKCore.c
GraphBLAS/LAgraph
9844af8501aa91e73dd3ef3613424ea130e8d47a
[ "BSD-2-Clause" ]
null
null
null
experimental/algorithm/LAGraph_AllKCore.c
GraphBLAS/LAgraph
9844af8501aa91e73dd3ef3613424ea130e8d47a
[ "BSD-2-Clause" ]
null
null
null
experimental/algorithm/LAGraph_AllKCore.c
GraphBLAS/LAgraph
9844af8501aa91e73dd3ef3613424ea130e8d47a
[ "BSD-2-Clause" ]
null
null
null
//------------------------------------------------------------------------------ // LAGraph_AllKCore: Full K-core Decomposition Using the GraphBLAS API //------------------------------------------------------------------------------ // LAGraph, (c) 2022 by The LAGraph Contributors, All Rights Reserved. // SPDX-License-Identifier: BSD-2-Clause // Contributed by Pranav Konduri, Texas A&M University //------------------------------------------------------------------------------ #define LG_FREE_WORK \ { \ GrB_free (&deg) ; \ GrB_free (&q) ; \ GrB_free (&delta) ; \ GrB_free (&done) ; \ } #define LG_FREE_ALL \ { \ LG_FREE_WORK \ GrB_free (decomp) ; \ } #include "LG_internal.h" int LAGraph_KCore_All ( // outputs: GrB_Vector *decomp, // kcore decomposition uint64_t *kmax, // inputs: LAGraph_Graph G, // input graph char *msg ) { LG_CLEAR_MSG ; // declare items GrB_Matrix A = NULL; GrB_Vector deg = NULL, q = NULL, done = NULL, delta = NULL; LG_ASSERT (decomp != NULL, GrB_NULL_POINTER) ; (*decomp) = NULL ; LG_TRY (LAGraph_CheckGraph (G, msg)) ; if (G->kind == LAGraph_ADJACENCY_UNDIRECTED || (G->kind == LAGraph_ADJACENCY_DIRECTED && G->is_symmetric_structure == LAGraph_TRUE)) { // the structure of A is known to be symmetric A = G->A ; } else { // A is not known to be symmetric LG_ASSERT_MSG (false, -1005, "G->A must be symmetric") ; } // no self edges can be present LG_ASSERT_MSG (G->nself_edges == 0, -1004, "G->nself_edges must be zero") ; //create work scalars uint64_t level = 0; //don't set at 1 in case of empty graph getting returned as kmax = 1 GrB_Index n, todo, nvals, maxDeg ; GRB_TRY (GrB_Matrix_nrows(&n, A)) ; //create deg vector using out_degree property LG_TRY (LAGraph_Cached_OutDegree(G, msg)) ; GRB_TRY (GrB_Vector_dup(&deg, G->out_degree)) ; //original deg vector is technically 1-core since 0 is omitted GRB_TRY (GrB_Vector_nvals(&todo, deg)) ; //use todo instead of n since some values are omitted (1-core) //retrieve the max degree level of the graph GRB_TRY (GrB_reduce(&maxDeg, GrB_NULL, GrB_MAX_MONOID_INT64, G->out_degree, GrB_NULL)) ; //select int type for work vectors and semirings GrB_Type int_type = (maxDeg > INT32_MAX) ? GrB_INT64 : GrB_INT32 ; GRB_TRY (GrB_Vector_new(&q, int_type, n)); GRB_TRY (GrB_Vector_new(&done, GrB_BOOL, n)) ; GRB_TRY (GrB_Vector_new(&delta, int_type, n)) ; //set output to int64 GRB_TRY (GrB_Vector_new(decomp, int_type, n)) ; //change deg vector to int32 if needed if(int_type == GrB_INT32){ GRB_TRY (GrB_Vector_new(&deg, int_type, n)) ; GRB_TRY (GrB_assign (deg, G->out_degree, NULL, G->out_degree, GrB_ALL, n, NULL)) ; } // determine semiring types GrB_IndexUnaryOp valueEQ = (maxDeg > INT32_MAX) ? GrB_VALUEEQ_INT64 : GrB_VALUEEQ_INT32 ; GrB_IndexUnaryOp valueLE = (maxDeg > INT32_MAX) ? GrB_VALUELE_INT64 : GrB_VALUELE_INT32 ; GrB_BinaryOp minus_op = (maxDeg > INT32_MAX) ? GrB_MINUS_INT64 : GrB_MINUS_INT32 ; GrB_Semiring semiring = (maxDeg > INT32_MAX) ? LAGraph_plus_one_int64 : LAGraph_plus_one_int32 ; #if LG_SUITESPARSE GRB_TRY (GxB_set (done, GxB_SPARSITY_CONTROL, GxB_BITMAP + GxB_FULL)) ; // try this //GRB_TRY (GxB_set (*decomp, GxB_SPARSITY_CONTROL, GxB_BITMAP + GxB_FULL)) ; // try this ... likely not needed... #endif //printf ("\n================================== COMPUTING GrB_KCORE: ==================================\n") ; while(todo > 0){ //printf("Level: %ld, todo: %ld\n", level, todo) ; level++; // Creating q GRB_TRY (GrB_select (q, GrB_NULL, GrB_NULL, valueEQ, deg, level, GrB_NULL)) ; // get all nodes with degree = level GRB_TRY (GrB_Vector_nvals(&nvals, q)); //Assign values of deg into decomp (output) GRB_TRY (GrB_assign (*decomp, deg, NULL, level, GrB_ALL, n, GrB_NULL)) ; int round = 0; // while q not empty while(nvals > 0){ // Decrease todo by number of nvals todo = todo - nvals ; //add anything in q as true into the done list GRB_TRY (GrB_assign (done, q, NULL, (bool) true, GrB_ALL, n, GrB_DESC_S)) ; //structure to take care of 0-node cases // Create delta (the nodes who lost friends, and how many they lost) GRB_TRY (GrB_vxm (delta, GrB_NULL, GrB_NULL, semiring, q, A, GrB_NULL)); // Create new deg vector (keep anything not in done vector w/ replace command) GRB_TRY (GrB_eWiseAdd(deg, done, GrB_NULL, minus_op, deg, delta, GrB_DESC_RSC /* try GrB_DESC_RSC */)) ; // Update q, set new nvals GRB_TRY (GrB_select (q, GrB_NULL, GrB_NULL, valueLE, deg, level, GrB_NULL)) ; GRB_TRY (GrB_Vector_nvals(&nvals, q)) ; round++; } } //set kmax (*kmax) = level; LG_FREE_WORK ; return (GrB_SUCCESS) ; }
37.159722
128
0.567744
[ "vector" ]
9de426565d66c858e73ce83dbd7b86ceb1454cc5
660
h
C
include/specialElement.h
jackwadden/vasim
4c615cb8411b7dbbff6b83b527057a555b6f7e18
[ "BSD-3-Clause" ]
31
2016-09-18T20:26:29.000Z
2022-01-18T17:39:34.000Z
include/specialElement.h
jackwadden/vasim
4c615cb8411b7dbbff6b83b527057a555b6f7e18
[ "BSD-3-Clause" ]
33
2016-11-15T20:29:28.000Z
2021-07-06T16:14:11.000Z
include/specialElement.h
jackwadden/vasim
4c615cb8411b7dbbff6b83b527057a555b6f7e18
[ "BSD-3-Clause" ]
21
2016-10-12T19:42:08.000Z
2022-01-12T18:42:18.000Z
/** * @file */ // #ifndef SPECIAL_ELEMENT_H #define SPECIAL_ELEMENT_H #include "element.h" #include <vector> #include <string> #include <iostream> #include <unordered_map> class SpecialElement: public Element { public: SpecialElement(std::string id); ~SpecialElement(); virtual void enable(std::string id); virtual void disable(); virtual bool calculate() = 0; virtual bool isSpecialElement(); virtual std::string toString() = 0; virtual std::string toANML() = 0; virtual std::shared_ptr<MNRL::MNRLNode> toMNRLObj() = 0; virtual std::string toHDL(std::unordered_map<std::string, std::string> id_reg_map); }; #endif
22.758621
87
0.692424
[ "vector" ]
9df092cd5007ff3400d0e4d3af829528895f963a
19,420
h
C
bullet/BulletCollision/Gimpact/gim_hash_table.h
csabahruska/bullet
3a8dfa95c8778b2af43c0f81a4a1c2dfc4a1c6ff
[ "BSD-3-Clause" ]
14
2015-08-17T16:10:22.000Z
2020-12-15T21:07:46.000Z
bullet/BulletCollision/Gimpact/gim_hash_table.h
csabahruska/bullet
3a8dfa95c8778b2af43c0f81a4a1c2dfc4a1c6ff
[ "BSD-3-Clause" ]
1
2020-05-14T07:35:51.000Z
2020-05-15T01:42:07.000Z
bullet/BulletCollision/Gimpact/gim_hash_table.h
csabahruska/bullet
3a8dfa95c8778b2af43c0f81a4a1c2dfc4a1c6ff
[ "BSD-3-Clause" ]
8
2015-02-21T22:17:51.000Z
2021-03-31T18:27:51.000Z
#ifndef GIM_HASH_TABLE_H_INCLUDED #define GIM_HASH_TABLE_H_INCLUDED /*! \file gim_trimesh_data.h \author Francisco Leon Najera */ /* ----------------------------------------------------------------------------- This source file is part of GIMPACT Library. For the latest info, see http://gimpact.sourceforge.net/ Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371. email: projectileman@yahoo.com This library is free software; you can redistribute it and/or modify it under the terms of EITHER: (1) The GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The text of the GNU Lesser General Public License is included with this library in the file GIMPACT-LICENSE-LGPL.TXT. (2) The BSD-style license that is included with this library in the file GIMPACT-LICENSE-BSD.TXT. (3) The zlib/libpng license that is included with this library in the file GIMPACT-LICENSE-ZLIB.TXT. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details. ----------------------------------------------------------------------------- */ #include "gim_radixsort.h" #define GIM_INVALID_HASH 0xffffffff //!< A very very high value #define GIM_DEFAULT_HASH_TABLE_SIZE 380 #define GIM_DEFAULT_HASH_TABLE_NODE_SIZE 4 #define GIM_HASH_TABLE_GROW_FACTOR 2 #define GIM_MIN_RADIX_SORT_SIZE 860 //!< calibrated on a PIII template<typename T> struct GIM_HASH_TABLE_NODE { GUINT m_key; T m_data; GIM_HASH_TABLE_NODE() { } GIM_HASH_TABLE_NODE(const GIM_HASH_TABLE_NODE & value) { m_key = value.m_key; m_data = value.m_data; } GIM_HASH_TABLE_NODE(GUINT key, const T & data) { m_key = key; m_data = data; } bool operator <(const GIM_HASH_TABLE_NODE<T> & other) const { ///inverse order, further objects are first if(m_key < other.m_key) return true; return false; } bool operator >(const GIM_HASH_TABLE_NODE<T> & other) const { ///inverse order, further objects are first if(m_key > other.m_key) return true; return false; } bool operator ==(const GIM_HASH_TABLE_NODE<T> & other) const { ///inverse order, further objects are first if(m_key == other.m_key) return true; return false; } }; ///Macro for getting the key class GIM_HASH_NODE_GET_KEY { private: public: template<class T> inline GUINT operator()( const T& a) { return a.m_key; } }; ///Macro for comparing the key and the element class GIM_HASH_NODE_CMP_KEY_MACRO { private: public: template<class T> inline int operator() ( const T& a, GUINT key) { return ((int)(a.m_key - key)); } }; ///Macro for comparing Hash nodes class GIM_HASH_NODE_CMP_MACRO { private: public: template<class T> inline int operator() ( const T& a, const T& b ) { return ((int)(a.m_key - b.m_key)); } }; //! Sorting for hash table /*! switch automatically between quicksort and radixsort */ template<typename T> void gim_sort_hash_node_array(T * array, GUINT array_count) { if(array_count<GIM_MIN_RADIX_SORT_SIZE) { gim_heap_sort(array,array_count,GIM_HASH_NODE_CMP_MACRO()); } else { memcopy_elements_func cmpfunc; gim_radix_sort(array,array_count,GIM_HASH_NODE_GET_KEY(),cmpfunc); } } // Note: assumes long is at least 32 bits. #define GIM_NUM_PRIME 28 static const GUINT gim_prime_list[GIM_NUM_PRIME] = { 53ul, 97ul, 193ul, 389ul, 769ul, 1543ul, 3079ul, 6151ul, 12289ul, 24593ul, 49157ul, 98317ul, 196613ul, 393241ul, 786433ul, 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul, 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul, 1610612741ul, 3221225473ul, 4294967291ul }; inline GUINT gim_next_prime(GUINT number) { //Find nearest upper prime GUINT result_ind = 0; gim_binary_search(gim_prime_list,0,(GIM_NUM_PRIME-2),number,result_ind); // inv: result_ind < 28 return gim_prime_list[result_ind]; } //! A compact hash table implementation /*! A memory aligned compact hash table that coud be treated as an array. It could be a simple sorted array without the overhead of the hash key bucked, or could be a formely hash table with an array of keys. You can use switch_to_hashtable() and switch_to_sorted_array for saving space or increase speed. </br> <ul> <li> if node_size = 0, then this container becomes a simple sorted array allocator. reserve_size is used for reserve memory in m_nodes. When the array size reaches the size equivalent to 'min_hash_table_size', then it becomes a hash table by calling check_for_switching_to_hashtable. <li> If node_size != 0, then this container becomes a hash table for ever </ul> */ template<class T> class gim_hash_table { private: protected: typedef GIM_HASH_TABLE_NODE<T> _node_type; //!The nodes //array< _node_type, SuperAllocator<_node_type> > m_nodes; gim_array< _node_type > m_nodes; //SuperBufferedArray< _node_type > m_nodes; bool m_sorted; ///Hash table data management. The hash table has the indices to the corresponding m_nodes array GUINT * m_hash_table;//!< GUINT m_table_size;//!< GUINT m_node_size;//!< GUINT m_min_hash_table_size; //! Returns the cell index inline GUINT _find_cell(GUINT hashkey) { _node_type * nodesptr = m_nodes.pointer(); GUINT start_index = (hashkey%m_table_size)*m_node_size; GUINT end_index = start_index + m_node_size; while(start_index<end_index) { GUINT value = m_hash_table[start_index]; if(value != GIM_INVALID_HASH) { if(nodesptr[value].m_key == hashkey) return start_index; } start_index++; } return GIM_INVALID_HASH; } //! Find the avaliable cell for the hashkey, and return an existing cell if it has the same hash key inline GUINT _find_avaliable_cell(GUINT hashkey) { _node_type * nodesptr = m_nodes.pointer(); GUINT avaliable_index = GIM_INVALID_HASH; GUINT start_index = (hashkey%m_table_size)*m_node_size; GUINT end_index = start_index + m_node_size; while(start_index<end_index) { GUINT value = m_hash_table[start_index]; if(value == GIM_INVALID_HASH) { if(avaliable_index==GIM_INVALID_HASH) { avaliable_index = start_index; } } else if(nodesptr[value].m_key == hashkey) { return start_index; } start_index++; } return avaliable_index; } //! reserves the memory for the hash table. /*! \pre hash table must be empty \post reserves the memory for the hash table, an initializes all elements to GIM_INVALID_HASH. */ inline void _reserve_table_memory(GUINT newtablesize) { if(newtablesize==0) return; if(m_node_size==0) return; //Get a Prime size m_table_size = gim_next_prime(newtablesize); GUINT datasize = m_table_size*m_node_size; //Alloc the data buffer m_hash_table = (GUINT *)gim_alloc(datasize*sizeof(GUINT)); } inline void _invalidate_keys() { GUINT datasize = m_table_size*m_node_size; for(GUINT i=0;i<datasize;i++) { m_hash_table[i] = GIM_INVALID_HASH;// invalidate keys } } //! Clear all memory for the hash table inline void _clear_table_memory() { if(m_hash_table==NULL) return; gim_free(m_hash_table); m_hash_table = NULL; m_table_size = 0; } //! Invalidates the keys (Assigning GIM_INVALID_HASH to all) Reorders the hash keys inline void _rehash() { _invalidate_keys(); _node_type * nodesptr = m_nodes.pointer(); for(GUINT i=0;i<(GUINT)m_nodes.size();i++) { GUINT nodekey = nodesptr[i].m_key; if(nodekey != GIM_INVALID_HASH) { //Search for the avaliable cell in buffer GUINT index = _find_avaliable_cell(nodekey); if(m_hash_table[index]!=GIM_INVALID_HASH) {//The new index is alreade used... discard this new incomming object, repeated key btAssert(m_hash_table[index]==nodekey); nodesptr[i].m_key = GIM_INVALID_HASH; } else { //; //Assign the value for alloc m_hash_table[index] = i; } } } } //! Resize hash table indices inline void _resize_table(GUINT newsize) { //Clear memory _clear_table_memory(); //Alloc the data _reserve_table_memory(newsize); //Invalidate keys and rehash _rehash(); } //! Destroy hash table memory inline void _destroy() { if(m_hash_table==NULL) return; _clear_table_memory(); } //! Finds an avaliable hash table cell, and resizes the table if there isn't space inline GUINT _assign_hash_table_cell(GUINT hashkey) { GUINT cell_index = _find_avaliable_cell(hashkey); if(cell_index==GIM_INVALID_HASH) { //rehashing _resize_table(m_table_size+1); GUINT cell_index = _find_avaliable_cell(hashkey); btAssert(cell_index!=GIM_INVALID_HASH); } return cell_index; } //! erase by index in hash table inline bool _erase_by_index_hash_table(GUINT index) { if(index >= m_nodes.size()) return false; if(m_nodes[index].m_key != GIM_INVALID_HASH) { //Search for the avaliable cell in buffer GUINT cell_index = _find_cell(m_nodes[index].m_key); btAssert(cell_index!=GIM_INVALID_HASH); btAssert(m_hash_table[cell_index]==index); m_hash_table[cell_index] = GIM_INVALID_HASH; } return this->_erase_unsorted(index); } //! erase by key in hash table inline bool _erase_hash_table(GUINT hashkey) { if(hashkey == GIM_INVALID_HASH) return false; //Search for the avaliable cell in buffer GUINT cell_index = _find_cell(hashkey); if(cell_index ==GIM_INVALID_HASH) return false; GUINT index = m_hash_table[cell_index]; m_hash_table[cell_index] = GIM_INVALID_HASH; return this->_erase_unsorted(index); } //! insert an element in hash table /*! If the element exists, this won't insert the element \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted If so, the element has been inserted at the last position of the array. */ inline GUINT _insert_hash_table(GUINT hashkey, const T & value) { if(hashkey==GIM_INVALID_HASH) { //Insert anyway _insert_unsorted(hashkey,value); return GIM_INVALID_HASH; } GUINT cell_index = _assign_hash_table_cell(hashkey); GUINT value_key = m_hash_table[cell_index]; if(value_key!= GIM_INVALID_HASH) return value_key;// Not overrited m_hash_table[cell_index] = m_nodes.size(); _insert_unsorted(hashkey,value); return GIM_INVALID_HASH; } //! insert an element in hash table. /*! If the element exists, this replaces the element. \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted If so, the element has been inserted at the last position of the array. */ inline GUINT _insert_hash_table_replace(GUINT hashkey, const T & value) { if(hashkey==GIM_INVALID_HASH) { //Insert anyway _insert_unsorted(hashkey,value); return GIM_INVALID_HASH; } GUINT cell_index = _assign_hash_table_cell(hashkey); GUINT value_key = m_hash_table[cell_index]; if(value_key!= GIM_INVALID_HASH) {//replaces the existing m_nodes[value_key] = _node_type(hashkey,value); return value_key;// index of the replaced element } m_hash_table[cell_index] = m_nodes.size(); _insert_unsorted(hashkey,value); return GIM_INVALID_HASH; } ///Sorted array data management. The hash table has the indices to the corresponding m_nodes array inline bool _erase_sorted(GUINT index) { if(index>=(GUINT)m_nodes.size()) return false; m_nodes.erase_sorted(index); if(m_nodes.size()<2) m_sorted = false; return true; } //! faster, but unsorted inline bool _erase_unsorted(GUINT index) { if(index>=m_nodes.size()) return false; GUINT lastindex = m_nodes.size()-1; if(index<lastindex && m_hash_table!=0) { GUINT hashkey = m_nodes[lastindex].m_key; if(hashkey!=GIM_INVALID_HASH) { //update the new position of the last element GUINT cell_index = _find_cell(hashkey); btAssert(cell_index!=GIM_INVALID_HASH); //new position of the last element which will be swaped m_hash_table[cell_index] = index; } } m_nodes.erase(index); m_sorted = false; return true; } //! Insert in position ordered /*! Also checks if it is needed to transform this container to a hash table, by calling check_for_switching_to_hashtable */ inline void _insert_in_pos(GUINT hashkey, const T & value, GUINT pos) { m_nodes.insert(_node_type(hashkey,value),pos); this->check_for_switching_to_hashtable(); } //! Insert an element in an ordered array inline GUINT _insert_sorted(GUINT hashkey, const T & value) { if(hashkey==GIM_INVALID_HASH || size()==0) { m_nodes.push_back(_node_type(hashkey,value)); return GIM_INVALID_HASH; } //Insert at last position //Sort element GUINT result_ind=0; GUINT last_index = m_nodes.size()-1; _node_type * ptr = m_nodes.pointer(); bool found = gim_binary_search_ex( ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO()); //Insert before found index if(found) { return result_ind; } else { _insert_in_pos(hashkey, value, result_ind); } return GIM_INVALID_HASH; } inline GUINT _insert_sorted_replace(GUINT hashkey, const T & value) { if(hashkey==GIM_INVALID_HASH || size()==0) { m_nodes.push_back(_node_type(hashkey,value)); return GIM_INVALID_HASH; } //Insert at last position //Sort element GUINT result_ind; GUINT last_index = m_nodes.size()-1; _node_type * ptr = m_nodes.pointer(); bool found = gim_binary_search_ex( ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO()); //Insert before found index if(found) { m_nodes[result_ind] = _node_type(hashkey,value); } else { _insert_in_pos(hashkey, value, result_ind); } return result_ind; } //! Fast insertion in m_nodes array inline GUINT _insert_unsorted(GUINT hashkey, const T & value) { m_nodes.push_back(_node_type(hashkey,value)); m_sorted = false; return GIM_INVALID_HASH; } public: /*! <li> if node_size = 0, then this container becomes a simple sorted array allocator. reserve_size is used for reserve memory in m_nodes. When the array size reaches the size equivalent to 'min_hash_table_size', then it becomes a hash table by calling check_for_switching_to_hashtable. <li> If node_size != 0, then this container becomes a hash table for ever </ul> */ gim_hash_table(GUINT reserve_size = GIM_DEFAULT_HASH_TABLE_SIZE, GUINT node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE, GUINT min_hash_table_size = GIM_INVALID_HASH) { m_hash_table = NULL; m_table_size = 0; m_sorted = false; m_node_size = node_size; m_min_hash_table_size = min_hash_table_size; if(m_node_size!=0) { if(reserve_size!=0) { m_nodes.reserve(reserve_size); _reserve_table_memory(reserve_size); _invalidate_keys(); } else { m_nodes.reserve(GIM_DEFAULT_HASH_TABLE_SIZE); _reserve_table_memory(GIM_DEFAULT_HASH_TABLE_SIZE); _invalidate_keys(); } } else if(reserve_size!=0) { m_nodes.reserve(reserve_size); } } ~gim_hash_table() { _destroy(); } inline bool is_hash_table() { if(m_hash_table) return true; return false; } inline bool is_sorted() { if(size()<2) return true; return m_sorted; } bool sort() { if(is_sorted()) return true; if(m_nodes.size()<2) return false; _node_type * ptr = m_nodes.pointer(); GUINT siz = m_nodes.size(); gim_sort_hash_node_array(ptr,siz); m_sorted=true; if(m_hash_table) { _rehash(); } return true; } bool switch_to_hashtable() { if(m_hash_table) return false; if(m_node_size==0) m_node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE; if(m_nodes.size()<GIM_DEFAULT_HASH_TABLE_SIZE) { _resize_table(GIM_DEFAULT_HASH_TABLE_SIZE); } else { _resize_table(m_nodes.size()+1); } return true; } bool switch_to_sorted_array() { if(m_hash_table==NULL) return true; _clear_table_memory(); return sort(); } //!If the container reaches the bool check_for_switching_to_hashtable() { if(this->m_hash_table) return true; if(!(m_nodes.size()< m_min_hash_table_size)) { if(m_node_size == 0) { m_node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE; } _resize_table(m_nodes.size()+1); return true; } return false; } inline void set_sorted(bool value) { m_sorted = value; } //! Retrieves the amount of keys. inline GUINT size() const { return m_nodes.size(); } //! Retrieves the hash key. inline GUINT get_key(GUINT index) const { return m_nodes[index].m_key; } //! Retrieves the value by index /*! */ inline T * get_value_by_index(GUINT index) { return &m_nodes[index].m_data; } inline const T& operator[](GUINT index) const { return m_nodes[index].m_data; } inline T& operator[](GUINT index) { return m_nodes[index].m_data; } //! Finds the index of the element with the key /*! \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted If so, the element has been inserted at the last position of the array. */ inline GUINT find(GUINT hashkey) { if(m_hash_table) { GUINT cell_index = _find_cell(hashkey); if(cell_index==GIM_INVALID_HASH) return GIM_INVALID_HASH; return m_hash_table[cell_index]; } GUINT last_index = m_nodes.size(); if(last_index<2) { if(last_index==0) return GIM_INVALID_HASH; if(m_nodes[0].m_key == hashkey) return 0; return GIM_INVALID_HASH; } else if(m_sorted) { //Binary search GUINT result_ind = 0; last_index--; _node_type * ptr = m_nodes.pointer(); bool found = gim_binary_search_ex(ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO()); if(found) return result_ind; } return GIM_INVALID_HASH; } //! Retrieves the value associated with the index /*! \return the found element, or null */ inline T * get_value(GUINT hashkey) { GUINT index = find(hashkey); if(index == GIM_INVALID_HASH) return NULL; return &m_nodes[index].m_data; } /*! */ inline bool erase_by_index(GUINT index) { if(index > m_nodes.size()) return false; if(m_hash_table == NULL) { if(is_sorted()) { return this->_erase_sorted(index); } else { return this->_erase_unsorted(index); } } else { return this->_erase_by_index_hash_table(index); } return false; } inline bool erase_by_index_unsorted(GUINT index) { if(index > m_nodes.size()) return false; if(m_hash_table == NULL) { return this->_erase_unsorted(index); } else { return this->_erase_by_index_hash_table(index); } return false; } /*! */ inline bool erase_by_key(GUINT hashkey) { if(size()==0) return false; if(m_hash_table) { return this->_erase_hash_table(hashkey); } //Binary search if(is_sorted()==false) return false; GUINT result_ind = find(hashkey); if(result_ind!= GIM_INVALID_HASH) { return this->_erase_sorted(result_ind); } return false; } void clear() { m_nodes.clear(); if(m_hash_table==NULL) return; GUINT datasize = m_table_size*m_node_size; //Initialize the hashkeys. GUINT i; for(i=0;i<datasize;i++) { m_hash_table[i] = GIM_INVALID_HASH;// invalidate keys } m_sorted = false; } //! Insert an element into the hash /*! \return If GIM_INVALID_HASH, the object has been inserted succesfully. Else it returns the position of the existing element. */ inline GUINT insert(GUINT hashkey, const T & element) { if(m_hash_table) { return this->_insert_hash_table(hashkey,element); } if(this->is_sorted()) { return this->_insert_sorted(hashkey,element); } return this->_insert_unsorted(hashkey,element); } //! Insert an element into the hash, and could overrite an existing object with the same hash. /*! \return If GIM_INVALID_HASH, the object has been inserted succesfully. Else it returns the position of the replaced element. */ inline GUINT insert_override(GUINT hashkey, const T & element) { if(m_hash_table) { return this->_insert_hash_table_replace(hashkey,element); } if(this->is_sorted()) { return this->_insert_sorted_replace(hashkey,element); } this->_insert_unsorted(hashkey,element); return m_nodes.size(); } //! Insert an element into the hash,But if this container is a sorted array, this inserts it unsorted /*! */ inline GUINT insert_unsorted(GUINT hashkey,const T & element) { if(m_hash_table) { return this->_insert_hash_table(hashkey,element); } return this->_insert_unsorted(hashkey,element); } }; #endif // GIM_CONTAINERS_H_INCLUDED
21.506091
147
0.761535
[ "object", "transform" ]
9df26d33fa7cb505a179700177507ad85127d8f6
19,676
c
C
src/snaplib/snap/bindata.c
linz/snap
1505880b282290fc28bbbe0c4d4f69088ad81de0
[ "BSD-3-Clause" ]
7
2018-09-17T06:49:30.000Z
2020-10-10T19:12:31.000Z
src/snaplib/snap/bindata.c
linz/snap
1505880b282290fc28bbbe0c4d4f69088ad81de0
[ "BSD-3-Clause" ]
81
2016-11-09T01:18:19.000Z
2022-03-31T04:34:12.000Z
src/snaplib/snap/bindata.c
linz/snap
1505880b282290fc28bbbe0c4d4f69088ad81de0
[ "BSD-3-Clause" ]
5
2017-07-03T03:00:29.000Z
2022-01-25T07:05:08.000Z
#include "snapconfig.h" /* $Log: bindata.c,v $ Revision 1.1 1995/12/22 17:38:46 CHRIS Initial revision */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define BINDATA_C #include "util/chkalloc.h" #include "snapdata/survdata.h" #include "snap/snapglob.h" #include "snap/stnadj.h" #include "snap/bindata.h" #include "snap/bearing.h" #include "snap/genparam.h" #include "snap/rftrans.h" #include "snap/survfile.h" #include "util/pi.h" #include "util/errdef.h" #include "util/dateutil.h" #include "util/fileutil.h" #undef BINDATA_C static int64_t start_loc; static long maxsize = 0; int init_bindata( FILE *f ) { maxsize = 0; nbindata = 0; bindata_file = f ? f : snaptmpfile(); if( !bindata_file ) { handle_error( FATAL_ERROR, "Unable to open scratch file", NO_MESSAGE ); return FATAL_ERROR; } start_loc = ftell64( bindata_file ); return OK; } void end_bindata( void ) { write_bindata_header( 0, ENDDATA ); } void init_get_bindata(int64_t loc ) { if( loc == 0 ) loc = start_loc; fseek64( bindata_file, loc, SEEK_SET ); } int64_t write_bindata_header( long size, int type ) { int64_t loc; loc = ftell( bindata_file ); fwrite( &size, sizeof(size), 1, bindata_file ); fwrite( &type, sizeof(type), 1, bindata_file ); if( size > maxsize ) maxsize = size; if( type == SURVDATA ) nbindata++; return loc; } int read_bindata_header( long *size, int *type ) { if( fread( size, sizeof( long ), 1, bindata_file ) == 1 && fread( type, sizeof( int ), 1, bindata_file ) == 1 ) { return 1; } else { return 0; } } static void reset_survdata_pointers( survdata *sd ); int get_bindata( int bintype, bindata *b ) { long loc; int sts; /* Read the size and type of the next data item */ while( 1 ) { loc = ftell64( bindata_file ); sts = fread( &b->size, sizeof(b->size), 1, bindata_file ); if( sts ) sts = fread( &b->bintype, sizeof(b->bintype), 1, bindata_file ); if( !sts || b->bintype == ENDDATA ) { fseek64( bindata_file, loc, SEEK_SET ); return NO_MORE_DATA; } if( b->bintype < 0 || b->bintype > NOBINDATATYPES ) { handle_error( INTERNAL_ERROR, "Program error - invalid binary data type", "Error occurred in get_bindata"); return INVALID_DATA; } if( b->bintype == bintype || bintype == ANYDATATYPE ) break; fseek64(bindata_file, b->size, SEEK_CUR); } /* Check that we have enough room for the data, and if not allocate more */ if( b->allocsize < b->size ) { if( b->data ) check_free( b->data ); b->data = NULL; b->allocsize = 0; } if( !b->data ) { b->data = check_malloc( b->size ); b->allocsize = b->size; } if( fread( b->data, b->size, 1, bindata_file ) != 1 ) return FILE_READ_ERROR; b->loc = loc; switch (b->bintype) { case SURVDATA: reset_survdata_pointers( (survdata *) b->data ); break; case NOTEDATA: break; default: handle_error( INTERNAL_ERROR, "Program error - invalid binary data type", "Error occurred in get_bindata"); break; } return OK; } void update_bindata( bindata *b ) { int64_t loc; loc = ftell64( bindata_file ); fseek64( bindata_file, b->loc + sizeof(b->bintype) + sizeof(b->size), SEEK_SET ); fwrite( b->data, b->size, 1, bindata_file ); fseek64( bindata_file, loc, SEEK_SET ); } bindata *create_bindata( void ) { bindata *b; b = (bindata *) check_malloc( sizeof(bindata) ); if( maxsize > 0 ) { b->data = check_malloc( maxsize ); b->allocsize = maxsize; } else { b->data = NULL; b->allocsize = 0; } return b; } void delete_bindata( bindata *b ) { if( b->data ) check_free( b->data ); check_free( b ); } /* Routines for saving the survdata structure. All routines save 1) the survdata structure 2) the observation data 3) the classifications of the data 4) the systematic errors of the data 5) the covariance of the observations The two routines for saving the data are: 1) saving all the data 2) saving a selected subset When the data is loaded back from the binary file it is dumped into a contiguous block of memory. The internal pointers in the survdata structure are reset by assuming the order and size of the components within this structure. */ static long survdata_size( survdata *sd ) { return sizeof( survdata ) + sd->nobs * sd->obssize + sd->nclass * sizeof( classdata ) + sd->nsyserr * sizeof( syserrdata ) + (sd->ncvr ? (3L * sd->ncvr * (sd->ncvr+1)*sizeof(double)/2) : 0); } /* Save a subset of the data. The subset is based upon a) iobs. If iobs >= 0 then only the iobs observation is stored. b) type. If type >= 0 then only observations of specified type are stored. c) The unused flag. If IGNORE_OBS_BIT is set, then the obs is not saved. */ long save_survdata( survdata *sd ) { int64_t fileloc; long loc; // Cannot handle locations which are not within the range of long // at the moment (and on MSW 64 long is 4 bytes). This should be ok as // observations are loaded into the binary file before the covariance // which is the only bit likely to push the size over 2Gb. For the moment // accept this limitation - this can be fixed as/when the snap codebase // is overhauled. fileloc = write_bindata_header(survdata_size(sd), SURVDATA); loc = (long)fileloc; if (loc != fileloc) { loc = 0; handle_error( FATAL_ERROR, "Cannot save data in binary file - too much data",""); } fwrite( sd, sizeof(survdata), 1, bindata_file ); fwrite( sd->obs.odata, sd->obssize, sd->nobs, bindata_file ); if( sd->nclass ) { fwrite( sd->clsf, sizeof(classdata), sd->nclass, bindata_file ); } if( sd->nsyserr ) { fwrite( sd->syserr, sizeof(syserrdata), sd->nsyserr, bindata_file ); } if( sd->ncvr ) { int cvrsize; cvrsize = ((sd->ncvr) * (sd->ncvr+1))/2; fwrite( sd->cvr, sizeof(double), cvrsize, bindata_file ); fwrite( sd->calccvr, sizeof(double), cvrsize, bindata_file ); fwrite( sd->rescvr, sizeof(double), cvrsize, bindata_file ); } if( ! have_obs_ids ) { for( int i=0; i<sd->nobs; i++ ) { if( get_trgtdata(sd,i)->id != 0 ) { have_obs_ids = 1; break; } } } return loc; } long save_survdata_subset( survdata *sd, int iobs, int type ) { int nobs, nclass, nsyserr; int cvrperobs, cvrtype; int64_t loc; int i, i0, i1; /* Determine the possible range of observations */ if( iobs < 0 ) { i0 = 0; i1 = sd->nobs; } else if( iobs >= sd->nobs ) { return 0L; } else { i0 = iobs; i1 = iobs+1; } /* Count the observations to be loaded */ nobs = 0; nclass = 0; nsyserr = 0; for( i=i0; i<i1; i++ ) { trgtdata *t; t = get_trgtdata( sd, i ); if( type >= 0 && t->type != type ) continue; if( t->unused & IGNORE_OBS_BIT ) continue; if( t->id != 0 ) have_obs_ids = 1; nobs++; nclass += t->nclass; nsyserr += t->nsyserr; } if( nobs < 0 ) return 0L; /* Save the header */ cvrperobs = sd->ncvr/sd->nobs; if( !sd->cvr ) cvrperobs = 0; { int oldnobs, oldnclass, oldnsyserr, oldncvr; int64_t fileloc; oldnobs = sd->nobs; oldnclass = sd->nclass; oldnsyserr = sd->nsyserr; oldncvr = sd->ncvr; sd->nobs = nobs; sd->nclass = nclass; sd->nsyserr = nsyserr; sd->ncvr = cvrperobs * nobs; fileloc = write_bindata_header( survdata_size( sd ), SURVDATA ); loc = (long)fileloc; if (loc != fileloc) { loc = 0; handle_error(FATAL_ERROR, "Cannot save data in binary file - too much data", ""); } fwrite( sd, sizeof(survdata), 1, bindata_file ); sd->nobs = oldnobs; sd->nclass = oldnclass; sd->nsyserr = oldnsyserr; sd->ncvr = oldncvr; } /* Save the observations */ { unsigned char *data; int iclass, isyserr; int oldiclass, oldisyserr; data = (unsigned char *) (void *) sd->obs.odata; data += (i0*sd->obssize); iclass = 0; isyserr = 0; for( i = i0; i < i1; i++, data += sd->obssize ) { trgtdata *t; t = get_trgtdata( sd, i ); if( type >= 0 && t->type != type ) continue; if( t->unused & IGNORE_OBS_BIT ) continue; oldiclass = t->iclass; oldisyserr = t->isyserr; t->iclass = iclass; t->isyserr = isyserr; iclass += t->nclass; isyserr += t->nsyserr; fwrite( data, sd->obssize, 1, bindata_file ); t->iclass = oldiclass; t->isyserr = oldisyserr; } } /* Now dump the classifications and systematic errors */ if( nclass ) { for( i = i0; i < i1; i++ ) { trgtdata *t; t = get_trgtdata( sd, i ); if( type >= 0 && t->type != type ) continue; if( t->unused & IGNORE_OBS_BIT ) continue; fwrite( sd->clsf+t->iclass, sizeof(classdata), t->nclass, bindata_file ); } } if( nsyserr ) { for( i = i0; i < i1; i++ ) { trgtdata *t; t = get_trgtdata( sd, i ); if( type >= 0 && t->type != type ) continue; if( t->unused & IGNORE_OBS_BIT ) continue; fwrite( sd->syserr+t->isyserr, sizeof(syserrdata), t->nsyserr, bindata_file ); } } /* And finally the covariances */ if( cvrperobs ) for( cvrtype = 0; cvrtype < 3; cvrtype++ ) { int ir0, ir1, ir, njr, j, jr0; ltmat cvr = 0; switch( cvrtype ) { case 0: cvr = sd->cvr; break; case 1: cvr = sd->calccvr; break; case 2: cvr = sd->rescvr; break; } for( i = i0; i < i1; i++ ) { trgtdata *t; t = get_trgtdata( sd, i ); if( type >= 0 && t->type != type ) continue; if( t->unused & IGNORE_OBS_BIT ) continue; ir0 = i*cvrperobs; ir1 = ir0+cvrperobs; for( ir = ir0; ir < ir1; ir++ ) { njr = cvrperobs; for( j = i0; j <= i; j++ ) { if( j != i ) { trgtdata *t; t = get_trgtdata( sd, j ); if( type >= 0 && t->type != type ) continue; if( t->unused & IGNORE_OBS_BIT ) continue; jr0 = j * cvrperobs; njr=cvrperobs; } else { jr0 = ir0; njr = ir-ir0+1; } fwrite( &Lij(cvr,ir,jr0), sizeof(double), njr, bindata_file ); } } } } return loc; } /* Reset the pointers in a survdata entity, assuming that the data is located in a contiguous block of memory */ static void reset_survdata_pointers( survdata *sd ) { unsigned char *data; data = (unsigned char *) (void *) sd; data += sizeof( survdata ); switch( sd->format ) { case SD_OBSDATA: sd->obs.odata = (obsdata *) (void *) data; break; case SD_VECDATA: sd->obs.vdata = (vecdata *) (void *) data; break; case SD_PNTDATA: sd->obs.pdata = (pntdata *) (void *) data; break; } data += sd->nobs * sd->obssize; if( sd->nclass ) { sd->clsf = (classdata *) data; data += sd->nclass * sizeof( classdata ); } else { sd->clsf = NULL; } if( sd->nsyserr ) { sd->syserr = (syserrdata *) data; data += sd->nsyserr * sizeof( syserrdata ); } else { sd->syserr = NULL; } if( sd->ncvr ) { int cvrsize; cvrsize = (sd->ncvr * (sd->ncvr+1))/2 * sizeof(double); sd->cvr = (ltmat) (void *) data; data += cvrsize; sd->calccvr = (ltmat) (void *) data; data += cvrsize; sd->rescvr = (ltmat) (void *) data; } else { sd->cvr = sd->calccvr = sd->rescvr = (ltmat) 0; } } char *get_obs_classification_name( survdata *sd, trgtdata *t, int class_id ) { int ic; for( ic = 0; ic < t->nclass; ic++ ) { classdata *cd; cd = sd->clsf + ic + t->iclass; if( cd->class_id == class_id ) { return class_value_name( &obs_classes, class_id, cd->name_id ); } } return NULL; } void print_json_observation_types( FILE *out ) { int first=1; fprintf(out,"{\n"); for( int type=0; type<NOBSTYPE; type++ ) if( obstypecount[type] ) { if( first ) { first=0; } else { fprintf(out,","); } fprintf(out,"\n \"%s\": \"%s\"",datatype[type].code,datatype[type].name); } fprintf(out,"\n}\n"); } void print_json_observations( FILE *out ) { bindata *b = create_bindata(); init_get_bindata( 0L ); fprintf(out,"["); int first=1; while( get_bindata( SURVDATA, b ) == OK ) { int iobs; int ncvrrow=0; survdata *sd = (survdata *) b->data; if( first ) { first=0; } else { fprintf(out,","); } fprintf( out, "\n {\n \"obs\":\n [" ); for( iobs=0; iobs < sd->nobs; iobs++ ) { const char *fromstr="from"; const char *tostr="to"; const char *totype=fromstr; double *value=0; double *error=0; int nvalue=0; trgtdata *tgt=get_trgtdata(sd,iobs); if( iobs ) fprintf(out,","); fprintf( out, "\n {\n"); fprintf( out, " \"obsid\":%d,\n",tgt->obsid); fprintf( out, " \"srcid\":%d,\n",tgt->id); /* sd->from is 0 for point vector data */ /* Could be more rigorous here! */ if( sd->from ) { fprintf( out, " \"from\":\"%s\",\n",station_code(sd->from)); fprintf( out, " \"from_hgt\":%.4lf,\n",sd->fromhgt); totype=tostr; } if( tgt->to ) { fprintf( out, " \"%s\":\"%s\",\n",totype,station_code(tgt->to)); } else { fprintf( out, " \"%s\":null,\n",totype); } fprintf( out, " \"%s_hgt\":%.4lf,\n",totype,tgt->tohgt); if( sd->date == UNDEFINED_DATE ) { fprintf( out, " \"date\":null,\n"); } else { fprintf( out, " \"date\":\"%s\",\n",date_as_string(sd->date,0,0)); } fprintf( out, " \"type\":\"%s\",\n",datatype[tgt->type].code); fprintf( out, " \"errfct\":%.4lf,\n",tgt->errfct); switch( sd->format ) { case SD_OBSDATA: { obsdata *o=(obsdata *)(void *)tgt; value=&(o->value); error=&(o->error); nvalue=1; } break; case SD_VECDATA: { vecdata *v=(vecdata *)(void *)tgt; value=&(v->vector[0]); nvalue=3; ncvrrow+=3; } break; case SD_PNTDATA: { pntdata *p=(pntdata *)(void *)tgt; value=&(p->value); error=&(p->error); nvalue=1; } break; } if( nvalue ) { int ivalue; double factor=1.0; int ndp=datatype[tgt->type].dfltndp+2; if( datatype[tgt->type].isangle ) { ndp+=4; factor=RTOD; } fprintf( out, " \"value\": ["); for( ivalue=0; ivalue<nvalue; ivalue++ ) { if( ivalue ) fprintf(out,","); fprintf( out, "%.*lf", ndp,value[ivalue]*factor); } fprintf( out, "],\n"); if( error ) { fprintf( out, " \"error\": [%.*lf],\n", ndp+2,(*error)*factor); } } if( tgt->type == PB ) { fprintf( out, " \"projection\": \"%s\",\n", bproj_name(sd->reffrm)); } if( sd->format == SD_VECDATA ) { fprintf( out, " \"ref_frame\": \"%s\",\n", rftrans_name(rftrans_from_id(sd->reffrm))); } if( tgt->nclass ) { int iclass; fprintf( out, " \"classifications\": {"); for( iclass=0; iclass < tgt->nclass; iclass++ ) { classdata *clsf=sd->clsf+iclass+tgt->iclass; if( iclass ) fprintf(out,","); fprintf( out, "\n \"%s\":\"%s\"", classification_name(&obs_classes,clsf->class_id), class_value_name(&obs_classes,clsf->class_id,clsf->name_id)); } fprintf( out, "\n },\n"); } if( tgt->nsyserr ) { int isyserr; fprintf( out, " \"systematic_errors\": {"); for( isyserr=0; isyserr < tgt->nsyserr; isyserr++ ) { syserrdata *syserr=sd->syserr+isyserr+tgt->isyserr; if( isyserr ) fprintf(out,","); fprintf( out, "\n \"%s\":%.8le", param_type_name(PRM_SYSERR, syserr->prm_id), syserr->influence); } fprintf( out, "\n },\n"); } fprintf( out, " \"useobs\":%s,\n",tgt->unused ? "false" : "true"); fprintf( out, " \"file\":\"%s\",\n",survey_data_file_name(sd->file)); fprintf( out, " \"file_line_no\":%d\n",tgt->lineno); fprintf( out, " }"); } fprintf( out, "\n ]" ); if( ncvrrow ) { fprintf( out, ",\n \"covariance\": " ); print_ltmat_json(out,sd->cvr,ncvrrow,"%15.8le",4); } fprintf( out, "\n }"); } fprintf(out,"\n]\n"); delete_bindata(b); }
28.108571
93
0.473978
[ "vector" ]
9df72ee3a47f8708c1ce69764c2dd2437e3e1bc6
4,796
h
C
src/CudaLife/GpuLife.h
DhalEynn/Game-of-life-CUDA
a4e3bf79a10076316af073633f4561033fe60aee
[ "BSD-3-Clause", "Unlicense" ]
64
2015-03-03T20:26:19.000Z
2022-02-27T06:15:21.000Z
src/CudaLife/GpuLife.h
DhalEynn/Game-of-life-CUDA
a4e3bf79a10076316af073633f4561033fe60aee
[ "BSD-3-Clause", "Unlicense" ]
null
null
null
src/CudaLife/GpuLife.h
DhalEynn/Game-of-life-CUDA
a4e3bf79a10076316af073633f4561033fe60aee
[ "BSD-3-Clause", "Unlicense" ]
21
2015-02-13T09:56:29.000Z
2022-03-20T09:25:41.000Z
#pragma once #include "OpenGlCudaHelper.h" #include "CudaLifeFunctions.h" #include "CpuLife.h" namespace mf { template<typename NoCppFileNeeded = int> class TGpuLife { private: ubyte* d_lifeData; ubyte* d_lifeDataBuffer; ubyte* d_encLifeData; ubyte* d_encLifeDataBuffer; ubyte* d_lookupTable; /// If unsuccessful allocation occurs, size is saved and never tried to allocate again to avoid many /// unsuccessful allocations in the row. size_t m_unsuccessAllocSize; /// Current width of world. size_t m_worldWidth; /// Current height of world. size_t m_worldHeight; public: TGpuLife() : d_lifeData(nullptr) , d_lifeDataBuffer(nullptr) , d_encLifeData(nullptr) , d_encLifeDataBuffer(nullptr) , d_lookupTable(nullptr) , m_unsuccessAllocSize(std::numeric_limits<size_t>::max()) , m_worldWidth(0) , m_worldHeight(0) {} ~TGpuLife() { freeBuffers(); checkCudaErrors(cudaFree(d_lookupTable)); d_lookupTable = nullptr; } const ubyte* getLifeData() const { return d_lifeData; } ubyte* lifeData() { return d_lifeData; } const ubyte* getBpcLifeData() const { return d_encLifeData; } ubyte* bpcLifeData() { return d_encLifeData; } const ubyte* getLookupTable() { if (d_lookupTable == nullptr) { computeLookupTable(); } return d_lookupTable; } /// Returns true if buffers for given life algorithm type are allocated and ready for use. bool areBuffersAllocated(bool bitLife) const { if (bitLife) { return d_encLifeData != nullptr && d_encLifeDataBuffer != nullptr; } else { return d_lifeData != nullptr && d_lifeDataBuffer != nullptr; } } /// Frees all buffers and allocated buffers necessary for given algorithm type. bool allocBuffers(bool bitLife) { freeBuffers(); if (bitLife) { size_t worldSize = (m_worldWidth / 8) * m_worldHeight; if (worldSize >= m_unsuccessAllocSize) { return false; } if (cudaMalloc(&d_encLifeData, worldSize) || cudaMalloc(&d_encLifeDataBuffer, worldSize)) { // Allocation failed. freeBuffers(); m_unsuccessAllocSize = worldSize; return false; } } else { size_t worldSize = m_worldWidth * m_worldHeight; if (worldSize >= m_unsuccessAllocSize) { return false; } if (cudaMalloc(&d_lifeData, worldSize) || cudaMalloc(&d_lifeDataBuffer, worldSize)) { // Allocation failed. freeBuffers(); m_unsuccessAllocSize = worldSize; return false; } } return true; } /// Frees all dynamically allocated buffers (expect lookup table). void freeBuffers() { checkCudaErrors(cudaFree(d_lifeData)); d_lifeData = nullptr; checkCudaErrors(cudaFree(d_lifeDataBuffer)); d_lifeDataBuffer = nullptr; checkCudaErrors(cudaFree(d_encLifeData)); d_encLifeData = nullptr; checkCudaErrors(cudaFree(d_encLifeDataBuffer)); d_encLifeDataBuffer = nullptr; // Do not free lookup table. } /// Resizes the world and frees old buffers. /// Do not allocates new buffers (lazy allocation, buffers are allocated when needed). void resize(size_t newWidth, size_t newHeight) { freeBuffers(); m_worldWidth = newWidth; m_worldHeight = newHeight; } /// Initializes necessary arrays with values. Uses CPU life instance for random data generation. void initThis(bool bitLife, CpuLife& cpuLife, bool useBetterRandom) { std::vector<ubyte> encData; if (bitLife) { size_t worldSize = (worldWidth / 8) * worldHeight; encData.resize(worldSize); // Potential bad_alloc. cpuLife.init(&encData[0], worldSize, 0xFF, useBetterRandom); checkCudaErrors(cudaMemcpy(d_encLifeData, &encData[0], worldSize, cudaMemcpyHostToDevice)); } else { size_t worldSize = worldWidth * worldHeight; std::vector<ubyte> encData; encData.resize(worldSize); // Potential bad_alloc. cpuLife.init(&encData[0], worldSize, 0x1, useBetterRandom); checkCudaErrors(cudaMemcpy(d_lifeData, &encData[0], worldSize, cudaMemcpyHostToDevice)); } } bool iterate(size_t lifeIteratinos, bool useLookupTable, ushort threadsCount, bool bitLife, uint bitLifeBytesPerTrhead, bool useBigChunks) { if (bitLife) { return runBitLifeKernel(d_encLifeData, d_encLifeDataBuffer, useLookupTable ? d_lookupTable : nullptr, m_worldWidth, m_worldHeight, lifeIteratinos, threadsCount, bitLifeBytesPerTrhead, useBigChunks); } else { return runSimpleLifeKernel(d_lifeData, d_lifeDataBuffer, m_worldWidth, m_worldHeight, lifeIteratinos, threadsCount); } } private: void computeLookupTable() { checkCudaErrors(cudaMalloc((void**)&d_lookupTable, 1 << (6 * 3))); runPrecompute6x3EvaluationTableKernel(d_lookupTable); } }; typedef TGpuLife<> GpuLife; }
25.242105
105
0.706631
[ "vector" ]
9dfdcf1fdf5f90f8f8742d3f678c94730377fab0
4,513
h
C
components/sync/driver/sync_session_durations_metrics_recorder.h
DamieFC/chromium
54ce2d3c77723697efd22cfdb02aea38f9dfa25c
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2020-10-18T02:33:40.000Z
2020-10-18T02:33:40.000Z
components/sync/driver/sync_session_durations_metrics_recorder.h
DamieFC/chromium
54ce2d3c77723697efd22cfdb02aea38f9dfa25c
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
3
2021-05-17T16:28:52.000Z
2021-05-21T22:42:22.000Z
components/sync/driver/sync_session_durations_metrics_recorder.h
DamieFC/chromium
54ce2d3c77723697efd22cfdb02aea38f9dfa25c
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SYNC_DRIVER_SYNC_SESSION_DURATIONS_METRICS_RECORDER_H_ #define COMPONENTS_SYNC_DRIVER_SYNC_SESSION_DURATIONS_METRICS_RECORDER_H_ #include <memory> #include <vector> #include "base/scoped_observation.h" #include "base/timer/elapsed_timer.h" #include "components/keyed_service/core/keyed_service.h" #include "components/signin/public/identity_manager/identity_manager.h" #include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service_observer.h" namespace syncer { // Tracks the active browsing time that the user spends signed in and/or syncing // as fraction of their total browsing time. class SyncSessionDurationsMetricsRecorder : public syncer::SyncServiceObserver, public signin::IdentityManager::Observer { public: // Callers must ensure that the parameters outlive this object. SyncSessionDurationsMetricsRecorder( SyncService* sync_service, signin::IdentityManager* identity_manager); ~SyncSessionDurationsMetricsRecorder() override; // Informs this service that a session started at |session_start| time. void OnSessionStarted(base::TimeTicks session_start); void OnSessionEnded(base::TimeDelta session_length); // syncer::SyncServiceObserver: void OnStateChanged(syncer::SyncService* sync) override; // IdentityManager::Observer: void OnPrimaryAccountChanged( const signin::PrimaryAccountChangeEvent& event) override; void OnRefreshTokenUpdatedForAccount( const CoreAccountInfo& account_info) override; void OnRefreshTokenRemovedForAccount( const CoreAccountId& account_id) override; void OnRefreshTokensLoaded() override; void OnErrorStateOfRefreshTokenUpdatedForAccount( const CoreAccountInfo& account_info, const GoogleServiceAuthError& error) override; void OnAccountsInCookieUpdated( const signin::AccountsInCookieJarInfo& accounts_in_cookie_jar_info, const GoogleServiceAuthError& error) override; private: // The state the feature is in. The state starts as UNKNOWN. After it moves // out of UNKNOWN, it can alternate between OFF and ON. enum class FeatureState { UNKNOWN, OFF, ON }; static constexpr int GetFeatureStates(FeatureState feature1, FeatureState feature2); void LogSigninDuration(base::TimeDelta session_length); void LogSyncAndAccountDuration(base::TimeDelta session_length); bool ShouldLogUpdate(FeatureState new_sync_status, FeatureState new_account_status); void UpdateSyncAndAccountStatus(FeatureState new_sync_status, FeatureState new_account_status); void HandleSyncAndAccountChange(); // Returns |FeatureState::ON| iff there is a primary account with a valid // refresh token in the identity manager. FeatureState DeterminePrimaryAccountStatus() const; // Determines the syns status.. FeatureState DetermineSyncStatus() const; SyncService* const sync_service_; signin::IdentityManager* const identity_manager_; base::ScopedObservation<syncer::SyncService, syncer::SyncServiceObserver> sync_observation_{this}; base::ScopedObservation<signin::IdentityManager, signin::IdentityManager::Observer> identity_manager_observation_{this}; // Tracks the elapsed active session time while the browser is open. The timer // is absent if there's no active session. std::unique_ptr<base::ElapsedTimer> total_session_timer_; FeatureState signin_status_ = FeatureState::UNKNOWN; // Tracks the elapsed active session time in the current signin status. The // timer is absent if there's no active session. std::unique_ptr<base::ElapsedTimer> signin_session_timer_; // Whether or not Chrome curently has a valid refresh token for an account. FeatureState account_status_ = FeatureState::UNKNOWN; // Whether or not sync is currently active. FeatureState sync_status_ = FeatureState::UNKNOWN; // Tracks the elapsed active session time in the current sync and account // status. The timer is absent if there's no active session. std::unique_ptr<base::ElapsedTimer> sync_account_session_timer_; DISALLOW_COPY_AND_ASSIGN(SyncSessionDurationsMetricsRecorder); }; } // namespace syncer #endif // COMPONENTS_SYNC_DRIVER_SYNC_SESSION_DURATIONS_METRICS_RECORDER_H_
39.938053
80
0.773765
[ "object", "vector" ]
9dfea1064178c3afdd0f3fd6e43f38be0b1c4814
11,743
c
C
device/sensor/drv/drv_acc_st_ais328dq.c
jinlongliu/AliOS-Things
ce051172a775f987183e7aca88bb6f3b809ea7b0
[ "Apache-2.0" ]
4
2019-03-12T11:04:48.000Z
2019-10-22T06:06:53.000Z
device/sensor/drv/drv_acc_st_ais328dq.c
IamBaoMouMou/AliOS-Things
195a9160b871b3d78de6f8cf6c2ab09a71977527
[ "Apache-2.0" ]
3
2018-12-17T13:06:46.000Z
2018-12-28T01:40:59.000Z
device/sensor/drv/drv_acc_st_ais328dq.c
IamBaoMouMou/AliOS-Things
195a9160b871b3d78de6f8cf6c2ab09a71977527
[ "Apache-2.0" ]
2
2018-01-23T07:54:08.000Z
2018-01-23T11:38:59.000Z
/* * Copyright (C) 2015-2017 Alibaba Group Holding Limited * * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <aos/aos.h> #include <vfs_conf.h> #include <vfs_err.h> #include <vfs_register.h> #include <hal/base.h> #include "common.h" #include "sensor.h" #include "sensor_drv_api.h" #include "sensor_hal.h" #define AIS328DQ_I2C_ADDR1 (0x18) #define AIS328DQ_I2C_ADDR2 (0x19) #define AIS328DQ_I2C_ADDR_TRANS(n) ((n)<<1) #define AIS328DQ_I2C_ADDR AIS328DQ_I2C_ADDR_TRANS(AIS328DQ_I2C_ADDR1) #define AIS328DQ_ACC_WHO_AM_I 0x0F #define AIS328DQ_ACC_CTRL_REG1 0x20 #define AIS328DQ_ACC_CTRL_REG2 0x21 #define AIS328DQ_ACC_CTRL_REG3 0x22 #define AIS328DQ_ACC_CTRL_REG4 0x23 #define AIS328DQ_ACC_CTRL_REG5 0x24 #define AIS328DQ_ACC_STATUS_REG 0x27 #define AIS328DQ_ACC_OUT_X_L 0x28 #define AIS328DQ_ACC_OUT_X_H 0x29 #define AIS328DQ_ACC_OUT_Y_L 0x2A #define AIS328DQ_ACC_OUT_Y_H 0x2B #define AIS328DQ_ACC_OUT_Z_L 0x2C #define AIS328DQ_ACC_OUT_Z_H 0x2D #define AIS328DQ_ACC_RANGE_2G (0x0) #define AIS328DQ_ACC_RANGE_4G (0x1) #define AIS328DQ_ACC_RANGE_8G (0x3) #define AIS328DQ_ACC_RANGE_MSK (0x30) #define AIS328DQ_ACC_RANGE_POS (4) #define AIS328DQ_ACC_SENSITIVITY_2G (980) #define AIS328DQ_ACC_SENSITIVITY_4G (1950) #define AIS328DQ_ACC_SENSITIVITY_8G (3910) #define AIS328DQ_ACC_CHIP_ID_VALUE (0x32) #define AIS328DQ_SHIFT_EIGHT_BITS (8) #define AIS328DQ_SHIFT_FOUR_BITS (4) #define AIS328DQ_16_BIT_SHIFT (0xFF) #define AIS328DQ_ACC_ODR_POWER_DOWN (0x00) #define AIS328DQ_ACC_ODR_0_5_HZ (0x40) #define AIS328DQ_ACC_ODR_1_HZ (0x60) #define AIS328DQ_ACC_ODR_2_HZ (0x80) #define AIS328DQ_ACC_ODR_5_HZ (0xA0) #define AIS328DQ_ACC_ODR_10_HZ (0xC0) #define AIS328DQ_ACC_ODR_50_HZ (0x20) #define AIS328DQ_ACC_ODR_100_HZ (0x28) #define AIS328DQ_ACC_ODR_400_HZ (0x30) #define AIS328DQ_ACC_ODR_1000_HZ (0x38) #define AIS328DQ_ACC_ODR_MSK (0xF8) #define AIS328DQ_ACC_ODR_POS (3) #define AIS328DQ_ACC_DEFAULT_ODR_100HZ (100) #define AIS328DQ_BDU_ENABLE (0x80) #define AIS328DQ_ACC_STATUS_ZYXDA (0x08) #define AIS328DQ_GET_BITSLICE(regvar, bitname)\ ((regvar & bitname##_MSK) >> bitname##_POS) #define AIS328DQ_SET_BITSLICE(regvar, bitname, val)\ ((regvar & ~bitname##_MSK) | ((val<<bitname##_POS)&bitname##_MSK)) static int32_t ais328dq_acc_factor[ACC_RANGE_MAX] = { AIS328DQ_ACC_SENSITIVITY_2G, AIS328DQ_ACC_SENSITIVITY_4G, AIS328DQ_ACC_SENSITIVITY_8G, 0 }; static int32_t cur_acc_factor = 0; i2c_dev_t ais328dq_ctx = { .port = 3, .config.address_width = 8, .config.freq = 400000, .config.dev_addr = AIS328DQ_I2C_ADDR, }; static int drv_acc_st_ais328dq_validate_id(i2c_dev_t* drv, uint8_t id_value) { uint8_t value = 0x00; int ret = 0; if(drv == NULL){ return -1; } ret = sensor_i2c_read(drv, AIS328DQ_ACC_WHO_AM_I, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } if (id_value != value){ return -1; } return 0; } static int drv_acc_st_ais328dq_set_power_mode(i2c_dev_t* drv, dev_power_mode_e mode) { uint8_t value = 0x00; int ret = 0; ret = sensor_i2c_read(drv, AIS328DQ_ACC_CTRL_REG1, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } switch(mode){ case DEV_POWER_ON:{ value = AIS328DQ_SET_BITSLICE(value,AIS328DQ_ACC_ODR,AIS328DQ_ACC_ODR_10_HZ); ret = sensor_i2c_write(drv, AIS328DQ_ACC_CTRL_REG1, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } }break; case DEV_POWER_OFF:{ value = AIS328DQ_SET_BITSLICE(value,AIS328DQ_ACC_ODR,AIS328DQ_ACC_ODR_POWER_DOWN); ret = sensor_i2c_write(drv, AIS328DQ_ACC_CTRL_REG1, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } }break; case DEV_SLEEP:{ value = AIS328DQ_SET_BITSLICE(value,AIS328DQ_ACC_ODR,AIS328DQ_ACC_ODR_10_HZ); ret = sensor_i2c_write(drv, AIS328DQ_ACC_CTRL_REG1, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } }break; default:break; } return 0; } static uint8_t drv_acc_st_ais328dq_hz2odr(uint32_t hz) { if(hz > 400) return AIS328DQ_ACC_ODR_1000_HZ; else if(hz > 100) return AIS328DQ_ACC_ODR_400_HZ; else if(hz > 50) return AIS328DQ_ACC_ODR_100_HZ; else if(hz > 10) return AIS328DQ_ACC_ODR_50_HZ; else if(hz > 5) return AIS328DQ_ACC_ODR_10_HZ; else if(hz > 2) return AIS328DQ_ACC_ODR_5_HZ; else if(hz > 1) return AIS328DQ_ACC_ODR_2_HZ; else return AIS328DQ_ACC_ODR_1_HZ; } static int drv_acc_st_ais328dq_set_odr(i2c_dev_t* drv, uint32_t hz) { int ret = 0; uint8_t value = 0x00; uint8_t odr = drv_acc_st_ais328dq_hz2odr(hz); ret = sensor_i2c_read(drv, AIS328DQ_ACC_CTRL_REG1, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } value = AIS328DQ_SET_BITSLICE(value,AIS328DQ_ACC_ODR,odr); ret = sensor_i2c_write(drv, AIS328DQ_ACC_CTRL_REG1, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } return 0; } static int drv_acc_st_ais328dq_set_range(i2c_dev_t* drv, uint32_t range) { int ret = 0; uint8_t value = 0x00; uint8_t tmp = 0; ret = sensor_i2c_read(drv, AIS328DQ_ACC_CTRL_REG4, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } switch (range){ case ACC_RANGE_2G:{ tmp = AIS328DQ_ACC_RANGE_2G; }break; case ACC_RANGE_4G:{ tmp = AIS328DQ_ACC_RANGE_4G; }break; case ACC_RANGE_8G:{ tmp = AIS328DQ_ACC_RANGE_8G; }break; default:break; } value = AIS328DQ_SET_BITSLICE(value,AIS328DQ_ACC_RANGE,tmp); ret = sensor_i2c_write(drv, AIS328DQ_ACC_CTRL_REG4, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } if((range >= ACC_RANGE_2G)&&(range <= ACC_RANGE_8G)){ cur_acc_factor = ais328dq_acc_factor[range]; } return 0; } static int drv_acc_st_ais328dq_set_bdu(i2c_dev_t* drv) { uint8_t value = 0x00; int ret = 0; ret = sensor_i2c_read(drv, AIS328DQ_ACC_CTRL_REG4, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } value |= AIS328DQ_BDU_ENABLE; ret = sensor_i2c_write(drv, AIS328DQ_ACC_CTRL_REG4, &value, I2C_DATA_LEN, I2C_OP_RETRIES); if(unlikely(ret)){ return ret; } return 0; } static void drv_acc_st_ais328dq_irq_handle(void) { /* no handle so far */ } static int drv_acc_st_ais328dq_open(void) { int ret = 0; ret = drv_acc_st_ais328dq_set_power_mode(&ais328dq_ctx, DEV_POWER_ON); if(unlikely(ret)){ return -1; } ret = drv_acc_st_ais328dq_set_range(&ais328dq_ctx, ACC_RANGE_8G); if(unlikely(ret)){ return -1; } ret = drv_acc_st_ais328dq_set_odr(&ais328dq_ctx, AIS328DQ_ACC_DEFAULT_ODR_100HZ); if(unlikely(ret)){ return -1; } return 0; } static int drv_acc_st_ais328dq_close(void) { int ret = 0; ret = drv_acc_st_ais328dq_set_power_mode(&ais328dq_ctx, DEV_POWER_OFF); if(unlikely(ret)){ return -1; } return 0; } static int drv_acc_st_ais328dq_read(void *buf, size_t len) { int ret = 0; size_t size; uint8_t reg[6]; accel_data_t *accel = (accel_data_t *)buf; if(buf == NULL){ return -1; } size = sizeof(accel_data_t); if(len < size){ return -1; } ret = sensor_i2c_read(&ais328dq_ctx, (AIS328DQ_ACC_OUT_X_L | 0x80), reg, 6, I2C_OP_RETRIES); if(unlikely(ret)){ return -1; } accel->data[DATA_AXIS_X] = (int16_t)((((int16_t)((int8_t)reg[1]))<< AIS328DQ_SHIFT_EIGHT_BITS)|(reg[0])); accel->data[DATA_AXIS_X] = accel->data[DATA_AXIS_X] >> AIS328DQ_SHIFT_FOUR_BITS; accel->data[DATA_AXIS_Y] = (int16_t)((((int16_t)((int8_t)reg[3]))<< AIS328DQ_SHIFT_EIGHT_BITS)|(reg[2])); accel->data[DATA_AXIS_Y] = accel->data[DATA_AXIS_Y] >> AIS328DQ_SHIFT_FOUR_BITS; accel->data[DATA_AXIS_Z] = (int16_t)((((int16_t)((int8_t)reg[5]))<< AIS328DQ_SHIFT_EIGHT_BITS)|(reg[4])); accel->data[DATA_AXIS_Z] = accel->data[DATA_AXIS_Z] >> AIS328DQ_SHIFT_FOUR_BITS; if(cur_acc_factor != 0){ accel->data[DATA_AXIS_X] = accel->data[DATA_AXIS_X] * cur_acc_factor / 1000; accel->data[DATA_AXIS_Y] = accel->data[DATA_AXIS_Y] * cur_acc_factor / 1000; accel->data[DATA_AXIS_Z] = accel->data[DATA_AXIS_Z] * cur_acc_factor / 1000; } accel->timestamp = aos_now_ms(); return (int)size; } static int drv_acc_st_ais328dq_ioctl(int cmd, unsigned long arg) { int ret = 0; dev_sensor_info_t *info = (dev_sensor_info_t *)arg; switch(cmd){ case SENSOR_IOCTL_ODR_SET:{ ret = drv_acc_st_ais328dq_set_odr(&ais328dq_ctx, arg); if(unlikely(ret)){ return -1; } }break; case SENSOR_IOCTL_RANGE_SET:{ ret = drv_acc_st_ais328dq_set_range(&ais328dq_ctx, arg); if(unlikely(ret)){ return -1; } }break; case SENSOR_IOCTL_SET_POWER:{ ret = drv_acc_st_ais328dq_set_power_mode(&ais328dq_ctx, arg); if(unlikely(ret)){ return -1; } }break; case SENSOR_IOCTL_GET_INFO:{ /* fill the dev info here */ info->model = "AIS328DQ"; info->range_max = 8; info->range_min = 2; info->unit = mg; }break; default:break; } return 0; } int drv_acc_st_ais328dq_init(void){ int ret = 0; sensor_obj_t sensor; memset(&sensor, 0, sizeof(sensor)); /* fill the sensor obj parameters here */ sensor.io_port = I2C_PORT; sensor.tag = TAG_DEV_ACC; sensor.path = dev_acc_path; sensor.open = drv_acc_st_ais328dq_open; sensor.close = drv_acc_st_ais328dq_close; sensor.read = drv_acc_st_ais328dq_read; sensor.write = NULL; sensor.ioctl = drv_acc_st_ais328dq_ioctl; sensor.irq_handle = drv_acc_st_ais328dq_irq_handle; ret = sensor_create_obj(&sensor); if(unlikely(ret)){ return -1; } ret = drv_acc_st_ais328dq_validate_id(&ais328dq_ctx, AIS328DQ_ACC_CHIP_ID_VALUE); if(unlikely(ret)){ return -1; } ret = drv_acc_st_ais328dq_set_range(&ais328dq_ctx, ACC_RANGE_8G); if(unlikely(ret)){ return -1; } ret = drv_acc_st_ais328dq_set_bdu(&ais328dq_ctx); if(unlikely(ret)){ return -1; } //set odr is 100hz, and will update ret = drv_acc_st_ais328dq_set_odr(&ais328dq_ctx, AIS328DQ_ACC_DEFAULT_ODR_100HZ); if(unlikely(ret)){ return -1; } /* update the phy sensor info to sensor hal */ LOG("%s %s successfully \n", SENSOR_STR, __func__); return 0; }
27.959524
112
0.632888
[ "model" ]
9dfea5a85c0f92c3d24ec1866f889351e8e66abb
3,684
h
C
src/libmach/macho.h
rdp/rogerpack2005-golang
e0bb46a57a9ccb8cd9c57bb066821a5e277c2cc2
[ "BSD-3-Clause" ]
20
2015-03-02T14:33:41.000Z
2022-03-20T03:29:21.000Z
src/libmach/macho.h
rdp/rogerpack2005-golang
e0bb46a57a9ccb8cd9c57bb066821a5e277c2cc2
[ "BSD-3-Clause" ]
2
2018-07-10T12:19:21.000Z
2020-07-09T02:01:25.000Z
src/libmach/macho.h
rdp/rogerpack2005-golang
e0bb46a57a9ccb8cd9c57bb066821a5e277c2cc2
[ "BSD-3-Clause" ]
4
2020-08-28T10:21:35.000Z
2021-09-23T20:42:24.000Z
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* * Definitions needed for accessing MACH object headers. */ typedef struct { uint32 magic; /* mach magic number identifier */ uint32 cputype; /* cpu specifier */ uint32 cpusubtype; /* machine specifier */ uint32 filetype; /* type of file */ uint32 ncmds; /* number of load commands */ uint32 sizeofcmds; /* the size of all the load commands */ uint32 flags; /* flags */ uint32 reserved; /* reserved */ } Machhdr; typedef struct { uint32 type; /* type of load command */ uint32 size; /* total size in bytes */ } MachCmd; typedef struct { MachCmd cmd; char segname[16]; /* segment name */ uint32 vmaddr; /* memory address of this segment */ uint32 vmsize; /* memory size of this segment */ uint32 fileoff; /* file offset of this segment */ uint32 filesize; /* amount to map from the file */ uint32 maxprot; /* maximum VM protection */ uint32 initprot; /* initial VM protection */ uint32 nsects; /* number of sections in segment */ uint32 flags; /* flags */ } MachSeg32; /* for 32-bit architectures */ typedef struct { MachCmd cmd; char segname[16]; /* segment name */ uvlong vmaddr; /* memory address of this segment */ uvlong vmsize; /* memory size of this segment */ uvlong fileoff; /* file offset of this segment */ uvlong filesize; /* amount to map from the file */ uint32 maxprot; /* maximum VM protection */ uint32 initprot; /* initial VM protection */ uint32 nsects; /* number of sections in segment */ uint32 flags; /* flags */ } MachSeg64; /* for 64-bit architectures */ typedef struct { MachCmd cmd; uint32 fileoff; /* file offset of this segment */ uint32 filesize; /* amount to map from the file */ } MachSymSeg; typedef struct { char sectname[16]; /* name of this section */ char segname[16]; /* segment this section goes in */ uint32 addr; /* memory address of this section */ uint32 size; /* size in bytes of this section */ uint32 offset; /* file offset of this section */ uint32 align; /* section alignment (power of 2) */ uint32 reloff; /* file offset of relocation entries */ uint32 nreloc; /* number of relocation entries */ uint32 flags; /* flags (section type and attributes)*/ uint32 reserved1; /* reserved (for offset or index) */ uint32 reserved2; /* reserved (for count or sizeof) */ } MachSect32; /* for 32-bit architectures */ typedef struct { char sectname[16]; /* name of this section */ char segname[16]; /* segment this section goes in */ uvlong addr; /* memory address of this section */ uvlong size; /* size in bytes of this section */ uint32 offset; /* file offset of this section */ uint32 align; /* section alignment (power of 2) */ uint32 reloff; /* file offset of relocation entries */ uint32 nreloc; /* number of relocation entries */ uint32 flags; /* flags (section type and attributes)*/ uint32 reserved1; /* reserved (for offset or index) */ uint32 reserved2; /* reserved (for count or sizeof) */ uint32 reserved3; /* reserved */ } MachSect64; /* for 64-bit architectures */ enum { MACH_CPU_TYPE_X86_64 = (1<<24)|7, MACH_CPU_TYPE_X86 = 7, MACH_CPU_SUBTYPE_X86 = 3, MACH_CPU_SUBTYPE_X86_64 = (1<<31)|3, MACH_EXECUTABLE_TYPE = 2, MACH_SEGMENT_32 = 1, /* 32-bit mapped segment */ MACH_SEGMENT_64 = 0x19, /* 64-bit mapped segment */ MACH_SYMSEG = 3, /* obsolete gdb symtab, reused by go */ MACH_UNIXTHREAD = 0x5, /* thread (for stack) */ }; #define MACH64_MAG ((0xcf<<24) | (0xfa<<16) | (0xed<<8) | 0xfe) #define MACH32_MAG ((0xce<<24) | (0xfa<<16) | (0xed<<8) | 0xfe)
36.475248
64
0.684582
[ "object" ]
3b022188033528e4a486c61b709020fe53f32ffc
3,903
h
C
src/hyperengine.h
berke/cryptominisat
f9423e0e38f2bfefdc16b3eaaee8553819d02bac
[ "MIT" ]
1
2021-12-03T08:31:15.000Z
2021-12-03T08:31:15.000Z
src/hyperengine.h
berke/cryptominisat
f9423e0e38f2bfefdc16b3eaaee8553819d02bac
[ "MIT" ]
6
2020-06-05T14:42:46.000Z
2020-07-15T19:13:09.000Z
src/hyperengine.h
berke/cryptominisat
f9423e0e38f2bfefdc16b3eaaee8553819d02bac
[ "MIT" ]
6
2020-06-05T13:32:05.000Z
2021-12-05T22:45:35.000Z
/****************************************** Copyright (c) 2016, Mate Soos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ***********************************************/ #include "cnf.h" #include "propby.h" #include "solvertypes.h" #include <vector> #include <set> #include "propengine.h" #include "mystack.h" using std::vector; using std::set; namespace CMSat { class HyperEngine : public PropEngine { public: ~HyperEngine() override; HyperEngine(const SolverConf *_conf, std::atomic<bool>* _must_interrupt_inter); size_t print_stamp_mem(size_t totalMem) const; size_t mem_used() const; size_t mem_used_stamp() const; bool use_depth_trick = true; bool perform_transitive_reduction = true; bool timedOutPropagateFull = false; Lit propagate_bfs( const uint64_t earlyAborTOut = std::numeric_limits<uint64_t>::max() ); Lit propagate_dfs( StampType stampType , uint64_t earlyAborTOut = std::numeric_limits<uint64_t>::max() ); set<BinaryClause> needToAddBinClause; ///<We store here hyper-binary clauses to be added at the end of propagateFull() set<BinaryClause> uselessBin; ///Add hyper-binary clause given this bin clause void add_hyper_bin(Lit p); ///Add hyper-binary clause given this large clause void add_hyper_bin(Lit p, const Clause& cl); void enqueue_with_acestor_info(const Lit p, const Lit ancestor, const bool redStep); private: Lit analyzeFail(PropBy propBy); void close_all_timestamps(const StampType stampType); Lit remove_which_bin_due_to_trans_red(Lit conflict, Lit thisAncestor, const bool thisStepRed); void remove_bin_clause(Lit lit); bool is_ancestor_of( const Lit conflict , Lit thisAncestor , const bool thisStepRed , const bool onlyIrred , const Lit lookingForAncestor ); //Find lowest common ancestor, once 'currAncestors' has been filled Lit deepest_common_ancestor(); PropResult prop_bin_with_ancestor_info( const Lit p , const Watched* k , PropBy& confl ); PropResult prop_normal_cl_with_ancestor_info( Watched* i , Watched*& j , const Lit p , PropBy& confl ); Lit prop_red_bin_dfs( StampType stampType , PropBy& confl , Lit& root , bool& restart ); Lit prop_irred_bin_dfs( StampType stampType , PropBy& confl , const Lit root , bool& restart ); Lit prop_larger_than_bin_cl_dfs( StampType stampType , PropBy& confl , Lit& root , bool& restart ); bool need_early_abort_dfs( StampType stampType , const size_t timeout ); //For proiorty propagations // MyStack<Lit> toPropNorm; MyStack<Lit> toPropBin; MyStack<Lit> toPropRedBin; vector<Lit> currAncestors; }; }
30.492188
128
0.684089
[ "vector" ]
3b0b3b8216c33cd92a24aa8adbca1eca15bbe430
17,496
h
C
iCloud/iCloud.h
kimjunghyeon/iCloudDocumentSync
fe74564d87c821040727b50f0725ef6ff2d3934c
[ "MIT" ]
2
2016-12-27T08:40:21.000Z
2016-12-27T08:40:25.000Z
iCloud/iCloud.h
kimjunghyeon/iCloudDocumentSync
fe74564d87c821040727b50f0725ef6ff2d3934c
[ "MIT" ]
null
null
null
iCloud/iCloud.h
kimjunghyeon/iCloudDocumentSync
fe74564d87c821040727b50f0725ef6ff2d3934c
[ "MIT" ]
null
null
null
// // iCloud.h // iCloud Document Sync // // Originally from iCloudPlayground // // Created by iRare Media on 3/23/13. // // #import <Foundation/Foundation.h> #import <iCloud/iCloudDocument.h> #define DOCUMENT_DIRECTORY @"Documents" /** iCloud Document Sync helps integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the 400+ lines that it usually takes). Updates and more details on this project can be found on [GitHub](http://www.github.com/iRareMedia/iCloudDocumentSync). If you like the project, please [star it](https://github.com/iRareMedia/iCloudDocumentSync) on GitHub! The `iCloud` class provides methods to integrate iCloud into document projects. <br /> Adding iCloud Document Sync to your project is easy. Follow these steps below to get everything up and running. 1. Drag the iCloud Framework into your project 2. Add `#import <iCloud/iCloud.h>` to your header file(s) iCloud Document Sync 3. Subscribe to the `<iCloudDelegate>` delegate. 4. Call the following methods to setup iCloud when your app starts: iCloud *cloud = [[iCloud alloc] init]; // This will help to begin the sync process and register for document updates. [cloud setDelegate:self]; // Only set this if you plan to use the delegate @warning Only available on iOS 5.0 and later on apps with valid code signing and entitlements. */ @class iCloud; @protocol iCloudDelegate; NS_CLASS_AVAILABLE_IOS(5_0) @interface iCloud : NSObject /** @name Delegate */ /** iCloud Delegate helps call methods when document processes begin or end */ @property (nonatomic, weak) id <iCloudDelegate> delegate; /** @name Properties */ /** Returns an NSMetadataQuery @return The iCloud NSMetadataQuery. */ + (NSMetadataQuery *)query; /** Returns a list of files stored in iCloud @return NSMutableArray (editable list) of files stored in iCloud. */ + (NSMutableArray *)fileList; /** Returns a list of the files from the previous iCloud Query @return NSMutableArray (editable list) of files in iCloud during the previous sync. */ + (NSMutableArray *)previousQueryResults; //Private Properties @property (strong) NSMetadataQuery *query; @property (strong) NSMutableArray *fileList; @property (strong) NSMutableArray *previousQueryResults; @property (strong) NSTimer *updateTimer; /** @name Checking for iCloud */ /** Check whether or not iCloud is available and that it can be accessed. Returns a boolean value. @discussion You should always check if iCloud is available before performing any iCloud operations. Additionally, you may want to check if your users want to opt-in to iCloud on a per-app basis. The Return value could be **NO** (iCloud Unavailable) for one or more of the following reasons: - iCloud is turned off by the user - The app is being run in the iOS Simulator - The entitlements profile, code signing identity, and/or provisioning profile is invalid @return YES if iCloud is available. NO if iCloud is not available. */ + (BOOL)checkCloudAvailability; /** @name Syncing with iCloud */ /** Check for and update the list of files stored in your app's iCloud Documents Folder. This method is automatically called by iOS when there are changes to files in the iCloud Directory. @param delegate The iCloud Class uses a delegate. The iCloudFilesDidChange:withNewFileNames: delegate method is triggered by this method. */ + (void)updateFilesWithDelegate:(id<iCloudDelegate>)delegate; /** @name Uploading to iCloud */ /** Create a document to upload to iCloud. @discussion iCloud Document Sync uses UIDocument and NSData to store and manage files. All of the heavy lifting with NSData and UIDocument is handled for you. There's no need to actually create or manage any files, just give iCloud Document Sync your data, and the rest is done for you. To create a new document or save an existing one (close the document), use this method. Below is a code example of how to use it. [iCloud saveDocumentWithName:@"Name.ext" withContent:[NSData data] withDelegate:self completion:^(UIDocument *cloudDocument, NSData *documentData, NSError *error) { if (error == nil) { // Code here to use the UIDocument or NSData objects which have been passed with the completion handler } }]; @param name The name of the UIDocument file being written to iCloud @param content The data to write to the UIDocument file @param handler Code block called when the document is successfully saved. The completion block passes UIDocument and NSData objects containing the saved document and it's contents in the form of NSData. The NSError object contains any error information if an error occurred, otherwise it will be nil. */ + (void)saveDocumentWithName:(NSString *)name withContent:(NSData *)content completion:(void (^)(UIDocument *cloudDocument, NSData *documentData, NSError *error))handler; /** Upload any local files that weren't created with iCloud or were created while offline @discussion Files in the local documents directory that do not already exist in iCloud will be **moved** into iCloud one by one. This process involves lots of file manipulation and as a result it may take a long time. This process will be performed on the background thread to avoid any lag or memory problems. When the upload processes end, the completion block is called on the main thread. [iCloud uploadLocalOfflineDocumentsWithDelegate:self repeatingHandler:^(NSString *fileName, NSError *error) { if (error == nil) { // This code block is called repeatedly until all files have been uploaded (or an upload has at least been attempted). // Code here to use the NSString (the name of the uploaded file) which have been passed with the repeating handler } } completion:^{ // Completion handler could be used to tell the user that the upload has completed }]; @param delegate The iCloud Class uses a delegate. The iCloudFileUploadConflictWithCloudFile:andLocalFile: delegate method is triggered by this method. @param repeatingHandler Code block called after each file is uploaded to iCloud. This block is called every-time a local file is uploaded, therefore it may be called multiple times. The NSError object contains any error information if an error occurred, otherwise it will be nil. @param completion Code block called after all files have been uploaded to iCloud. This block is only called once at the end of the method, regardless of any successes or failures that may have occurred during the upload(s). */ + (void)uploadLocalOfflineDocumentsWithDelegate:(id<iCloudDelegate>)delegate repeatingHandler:(void (^)(NSString *fileName, NSError *error))repeatingHandler completion:(void (^)(void))completion; /** @name Sharing iCloud Content */ /** Share an iCloud document by uploading it to a public URL. @discussion Upload a document stored in iCloud for a certain amount of time. @param name The name of the iCloud file being uploaded to a public URL @param handler Code block called when the document is successfully uploaded. The completion block passes NSURL, NSDate, and NSError objects. The NSURL object is the public URL where the file is available at. The NSDate object is the date that the URL expries on. The NSError object contains any error information if an error occurred, otherwise it will be nil. @return The public URL where the file is available at */ + (NSURL *)shareDocumentWithName:(NSString *)name completion:(void (^)(NSURL *sharedURL, NSDate *expirationDate, NSError *error))handler; /** @name Deleting content from iCloud */ /** Delete a document from iCloud. @param name The name of the UIDocument file to delete from iCloud @param handler Code block called when a file is successfully deleted from iCloud. The NSError object contains any error information if an error occurred, otherwise it will be nil. */ + (void)deleteDocumentWithName:(NSString *)name completion:(void (^)(NSError *error))handler; /** @name Getting content from iCloud */ /** Open a UIDocument stored in iCloud. If the document does not exist, a new blank document will be created using the documentName provided. You can use the doesFileExistInCloud: method to check if a file exists before calling this method. @discussion This method will attempt to open the specified document. If the file does not exist, a blank one will be created. The completion handler is called when the file is opened or created (either successfully or not). The completion handler contains a UIDocument, NSData, and NSError all of which contain information about the opened document. [iCloud retrieveCloudDocumentWithName:@"docName.ext" completion:^(UIDocument *cloudDocument, NSData *documentData, NSError *error) { if (error == nil) { NSString *fileName = [cloudDocument.fileURL lastPathComponent]; NSData *fileData = documentData; } }]; @param documentName The name of the UIDocument file in iCloud @param handler Code block called when the document is successfully retrieved (opened or downloaded). The completion block passes UIDocument and NSData objects containing the opened document and it's contents in the form of NSData. If there is an error, the NSError object will have an error message (may be nil if there is no error). */ + (void)retrieveCloudDocumentWithName:(NSString *)documentName completion:(void (^)(UIDocument *cloudDocument, NSData *documentData, NSError *error))handler; /** Check if a file exists in iCloud @param fileName The name of the UIDocument in iCloud @return BOOL value, YES if the file does exist in iCloud, NO if it does not */ + (BOOL)doesFileExistInCloud:(NSString *)fileName; /** Get a list of files stored in iCloud @return NSArray with a list of all the files currently stored in your app's iCloud Documents directory */ + (NSArray *)getListOfCloudFiles; /** @name Deprecated Methods */ /** DEPRECATED. Delete a document from iCloud. @param name The name of the UIDocument file to delete from iCloud @param delegate The iCloud Class requires a delegate. Make sure to set the delegate of iCloud before calling this method. The documentWasSaved delegate method is triggered by this method. @param handler Code block called when a file is successfully deleted from iCloud. The NSError object contains any error information if an error occurred, otherwise it will be nil. @deprecated This method is deprecated, use deleteDocumentWithName:completion: instead. */ + (void)deleteDocumentWithName:(NSString *)name withDelegate:(id<iCloudDelegate>)delegate completion:(void (^)(NSError *error))handler __deprecated; /** DEPRECATED. Create a document to upload to iCloud. @param name The name of the UIDocument file being written to iCloud @param content The data to write to the UIDocument file @param delegate The iCloud Class requires a delegate. Make sure to set the delegate of iCloud before calling this method. The documentWasSaved delegate method is triggered by this method. @param handler Code block called when the document is successfully saved. The completion block passes UIDocument and NSData objects containing the saved document and it's contents in the form of NSData. The NSError object contains any error information if an error occurred, otherwise it will be nil. @deprecated This method is deprecated, use saveDocumentWithName:withContent:completion: instead. */ + (void)saveDocumentWithName:(NSString *)name withContent:(NSData *)content withDelegate:(id<iCloudDelegate>)delegate completion:(void (^)(UIDocument *cloudDocument, NSData *documentData, NSError *error))handler __deprecated; /** DEPRECATED. Upload any local files that weren't created with iCloud or were created while offline @param delegate The iCloud Class requires a delegate. Make sure to set the delegate of iCloud before calling this method. @param handler Code block called when files are uploaded to iCloud. The NSError object contains any error information if an error occurred, otherwise it will be nil. @deprecated This method is deprecated, use uploadLocalOfflineDocumentsWithDelegate:repeatingHandler:completion: instead. */ + (void)uploadLocalOfflineDocumentsWithDelegate:(id<iCloudDelegate>)delegate completion:(void (^)(NSError *error))handler __deprecated; @end @class iCloud; /** The iCloudDelegate protocol defines the methods used to receive event notifications and allow for deeper control of the iCloud Class. */ @protocol iCloudDelegate <NSObject> /** @name Optional Delegate Methods */ @optional /** Tells the delegate that the files in iCloud have been modified @param files A list of the files now in the app's iCloud documents directory - each file in the array contains information such as file version, url, localized name, date, etc. @param fileNames A list of the file names now in the app's iCloud documents directory */ - (void)iCloudFilesDidChange:(NSMutableArray *)files withNewFileNames:(NSMutableArray *)fileNames; /** Sent to the delegate where there is a conflict between a local file and an iCloud file during an upload @discussion When both files have the same modification date and file content, iCloud Document Sync will not be able to automatically determine how to handle the conflict. As a result, this delegate method is called to pass the file information to the delegate which should be able to appropriately handle and resolve the conflict. The delegate should, if needed, present the user with a conflict resolution interface. iCloud Document Sync does not need to know the result of the attempted resolution, it will continue to upload all files which are not conflicting. It is important to note that **this method may be called more than once in a very short period of time** - be prepared to handle the data appropriately. This delegate method is called on the main thread using GCD. @param cloudFile An NSDictionary with the cloud file and various other information. This parameter contains the fileContent as NSData, fileURL as NSURL, and modifiedDate as NSDate. @param localFile An NSDictionary with the local file and various other information. This parameter contains the fileContent as NSData, fileURL as NSURL, and modifiedDate as NSDate. */ - (void)iCloudFileUploadConflictWithCloudFile:(NSDictionary *)cloudFile andLocalFile:(NSDictionary *)localFile; /** @name Deprecated Delegate Methods */ /** DEPRECATED. Called when there is an error while performing an iCloud process @param error An NSError with a message, error code, and information @deprecated Deprecated in version 6.1. use the NSError parameter available in corresponding methods' completion handlers. */ - (void)iCloudError:(NSError *)error __deprecated; /** DEPRECATED. Tells the delegate that there was an error while performing a process @param error Returns the NSError that occurred @deprecated Deprecated in version 6.0. Use the NSError parameter available in corresponding methods' completion handlers. */ - (void)cloudError:(NSError *)error __deprecated; /** DEPRECATED. Tells the delegate that the files in iCloud have been modified @param files Returns a list of the files now in the app's iCloud documents directory - each file in the array contains information such as file version, url, localized name, date, etc. @param fileNames Returns a list of the file names now in the app's iCloud documents directory @deprecated Deprecated in version 6.0. Use iCloudFilesDidChange:withNewFileNames: instead. */ - (void)fileListChangedWithFiles:(NSMutableArray *)files andFileNames:(NSMutableArray *)fileNames __deprecated; /** DEPRECATED. Tells the delegate that a document was successfully deleted. @deprecated Deprecated in version 6.0. Use the completion handlers in deleteDocumentWithName:completion: instead. */ - (void)documentWasDeleted __deprecated; /** DEPRECATED. Tells the delegate that a document was successfully saved @deprecated Deprecated in version 6.0. Use the completion handlers in saveDocumentWithName:withContent:completion: instead. */ - (void)documentWasSaved __deprecated; /** DEPRECATED. Tells the delegate that a document finished uploading @deprecated Deprecated in version 6.0. Use the completion handlers in uploadLocalOfflineDocumentsWithDelegate:repeatingHandler:completion: instead. */ - (void)documentsFinishedUploading __deprecated; /** DEPRECATED. Tells the delegate that a document started uploading @deprecated Deprecated in version 6.0. Delegate methods are no longer used to report method-specfic conditions and so this method is never called. Completion blocks are now used. */ - (void)documentsStartedUploading __deprecated; /** DEPRECATED. Tells the delegate that a document started downloading @deprecated Deprecated in version 6.0. Delegate methods are no longer used to report method-specfic conditions and so this method is never called. Completion blocks are now used. */ - (void)documentsStartedDownloading __deprecated; /** DEPRECATED. Tells the delegate that a document finished downloading @deprecated Deprecated in version 6.0. Delegate methods are no longer used to report method-specfic conditions and so this method is never called. Completion blocks are now used. */ - (void)documentsFinishedDownloading __deprecated; @end
59.917808
779
0.776578
[ "object" ]
6f0ba0346e1721e8f111833d9076718725110704
3,672
h
C
xiablo/Plugins/SketchFabPlugin/Source/GLTFExporter/Private/Json/SKGLTFJsonVariation.h
jing-interactive/ucd
8fc8722291f086a0c0037a94d11c14562375e862
[ "MIT" ]
1
2022-02-02T23:36:07.000Z
2022-02-02T23:36:07.000Z
xiablo/Plugins/SketchFabPlugin/Source/GLTFExporter/Private/Json/SKGLTFJsonVariation.h
jing-interactive/ucd
8fc8722291f086a0c0037a94d11c14562375e862
[ "MIT" ]
null
null
null
xiablo/Plugins/SketchFabPlugin/Source/GLTFExporter/Private/Json/SKGLTFJsonVariation.h
jing-interactive/ucd
8fc8722291f086a0c0037a94d11c14562375e862
[ "MIT" ]
null
null
null
// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "SKGLTFJsonIndex.h" #include "Json/SKGLTFJsonExtensions.h" #include "Json/SKGLTFJsonUtility.h" #include "Serialization/JsonSerializer.h" #include "Misc/Optional.h" struct FGLTFJsonVariantMaterial { FGLTFJsonMaterialIndex Material; int32 Index; FGLTFJsonVariantMaterial() : Material(INDEX_NONE) , Index(INDEX_NONE) { } template <class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>> void WriteObject(TJsonWriter<CharType, PrintPolicy>& JsonWriter, FGLTFJsonExtensions& Extensions) const { JsonWriter.WriteObjectStart(); JsonWriter.WriteValue(TEXT("material"), Material); if (Index != INDEX_NONE) { JsonWriter.WriteValue(TEXT("index"), Index); } JsonWriter.WriteObjectEnd(); } }; struct FGLTFJsonVariantNodeProperties { FGLTFJsonNodeIndex Node; TOptional<bool> bIsVisible; TOptional<FGLTFJsonMeshIndex> Mesh; TArray<FGLTFJsonVariantMaterial> Materials; template <class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>> void WriteObject(TJsonWriter<CharType, PrintPolicy>& JsonWriter, FGLTFJsonExtensions& Extensions) const { JsonWriter.WriteObjectStart(); if (Node != INDEX_NONE) { JsonWriter.WriteValue(TEXT("node"), Node); } JsonWriter.WriteObjectStart(TEXT("properties")); if (bIsVisible.IsSet()) { JsonWriter.WriteValue(TEXT("visible"), bIsVisible.GetValue()); } if (Mesh.IsSet()) { JsonWriter.WriteValue(TEXT("mesh"), Mesh.GetValue()); } FGLTFJsonUtility::WriteObjectArray(JsonWriter, TEXT("materials"), Materials, Extensions); JsonWriter.WriteObjectEnd(); JsonWriter.WriteObjectEnd(); } }; struct FGLTFJsonVariant { typedef TMap<FGLTFJsonNodeIndex, FGLTFJsonVariantNodeProperties> FNodeProperties; FString Name; bool bIsActive; FGLTFJsonTextureIndex Thumbnail; FNodeProperties Nodes; template <class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>> void WriteObject(TJsonWriter<CharType, PrintPolicy>& JsonWriter, FGLTFJsonExtensions& Extensions) const { JsonWriter.WriteObjectStart(); JsonWriter.WriteValue(TEXT("name"), Name); JsonWriter.WriteValue(TEXT("active"), bIsActive); if (Thumbnail != INDEX_NONE) { JsonWriter.WriteValue(TEXT("thumbnail"), Thumbnail); } JsonWriter.WriteArrayStart(TEXT("nodes")); for (const auto& DataPair: Nodes) { if (DataPair.Key != INDEX_NONE) { DataPair.Value.WriteObject(JsonWriter, Extensions); } } JsonWriter.WriteArrayEnd(); JsonWriter.WriteObjectEnd(); } }; struct FGLTFJsonVariantSet { FString Name; TArray<FGLTFJsonVariant> Variants; template <class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>> void WriteObject(TJsonWriter<CharType, PrintPolicy>& JsonWriter, FGLTFJsonExtensions& Extensions) const { JsonWriter.WriteObjectStart(); if (!Name.IsEmpty()) { JsonWriter.WriteValue(TEXT("name"), Name); } FGLTFJsonUtility::WriteObjectArray(JsonWriter, TEXT("variants"), Variants, Extensions); JsonWriter.WriteObjectEnd(); } }; struct FGLTFJsonVariation { FString Name; TArray<FGLTFJsonVariantSet> VariantSets; template <class CharType = TCHAR, class PrintPolicy = TPrettyJsonPrintPolicy<CharType>> void WriteObject(TJsonWriter<CharType, PrintPolicy>& JsonWriter, FGLTFJsonExtensions& Extensions) const { JsonWriter.WriteObjectStart(); if (!Name.IsEmpty()) { JsonWriter.WriteValue(TEXT("name"), Name); } FGLTFJsonUtility::WriteObjectArray(JsonWriter, TEXT("variantSets"), VariantSets, Extensions); JsonWriter.WriteObjectEnd(); } };
23.690323
104
0.747277
[ "mesh" ]
6f0e6c4cbaaafa743797ebd1c5674d02895287f0
958
h
C
panda/src/net/datagram_ui.h
sean5470/panda3d
ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d
[ "PHP-3.0", "PHP-3.01" ]
3
2020-01-02T08:43:36.000Z
2020-07-05T08:59:02.000Z
panda/src/net/datagram_ui.h
sean5470/panda3d
ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d
[ "PHP-3.0", "PHP-3.01" ]
null
null
null
panda/src/net/datagram_ui.h
sean5470/panda3d
ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d
[ "PHP-3.0", "PHP-3.01" ]
1
2020-03-11T17:38:45.000Z
2020-03-11T17:38:45.000Z
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file datagram_ui.h * @author drose * @date 2000-02-09 */ #ifndef DATAGRAM_UI_H #define DATAGRAM_UI_H /* * The functions defined here are used for testing purposes only by some of * the various test_* programs in this directory. They are not compiled into * the package library, libnet.so. These functions are handy for getting and * reporting a datagram from and to the user. They extend a datagram by * encoding information about the types of values stored in it. */ #include "pandabase.h" #include "netDatagram.h" istream &operator >> (istream &in, NetDatagram &datagram); ostream &operator << (ostream &out, const NetDatagram &datagram); #endif
29.030303
77
0.73382
[ "3d" ]
6f135aa63c8a5c5970467c2a1cace87b9507f644
2,275
h
C
Descending Europa/Temp/StagingArea/Data/il2cppOutput/System_System_Collections_Specialized_ListDictiona2044266038.h
screwylightbulb/europa
3dcc98369c8066cb2310143329535206751c8846
[ "MIT" ]
11
2016-07-22T19:58:09.000Z
2021-09-21T12:51:40.000Z
Descending Europa/Temp/StagingArea/Data/il2cppOutput/System_System_Collections_Specialized_ListDictiona2044266038.h
screwylightbulb/europa
3dcc98369c8066cb2310143329535206751c8846
[ "MIT" ]
1
2018-05-07T14:32:13.000Z
2018-05-08T09:15:30.000Z
iOS/Classes/Native/System_System_Collections_Specialized_ListDictiona2044266038.h
mopsicus/unity-share-plugin-ios-android
3ee99aef36034a1e4d7b156172953f9b4dfa696f
[ "MIT" ]
null
null
null
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Object struct Il2CppObject; // System.Collections.Specialized.ListDictionary/DictionaryNode struct DictionaryNode_t2044266038; #include "mscorlib_System_Object4170816371.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Collections.Specialized.ListDictionary/DictionaryNode struct DictionaryNode_t2044266038 : public Il2CppObject { public: // System.Object System.Collections.Specialized.ListDictionary/DictionaryNode::key Il2CppObject * ___key_0; // System.Object System.Collections.Specialized.ListDictionary/DictionaryNode::value Il2CppObject * ___value_1; // System.Collections.Specialized.ListDictionary/DictionaryNode System.Collections.Specialized.ListDictionary/DictionaryNode::next DictionaryNode_t2044266038 * ___next_2; public: inline static int32_t get_offset_of_key_0() { return static_cast<int32_t>(offsetof(DictionaryNode_t2044266038, ___key_0)); } inline Il2CppObject * get_key_0() const { return ___key_0; } inline Il2CppObject ** get_address_of_key_0() { return &___key_0; } inline void set_key_0(Il2CppObject * value) { ___key_0 = value; Il2CppCodeGenWriteBarrier(&___key_0, value); } inline static int32_t get_offset_of_value_1() { return static_cast<int32_t>(offsetof(DictionaryNode_t2044266038, ___value_1)); } inline Il2CppObject * get_value_1() const { return ___value_1; } inline Il2CppObject ** get_address_of_value_1() { return &___value_1; } inline void set_value_1(Il2CppObject * value) { ___value_1 = value; Il2CppCodeGenWriteBarrier(&___value_1, value); } inline static int32_t get_offset_of_next_2() { return static_cast<int32_t>(offsetof(DictionaryNode_t2044266038, ___next_2)); } inline DictionaryNode_t2044266038 * get_next_2() const { return ___next_2; } inline DictionaryNode_t2044266038 ** get_address_of_next_2() { return &___next_2; } inline void set_next_2(DictionaryNode_t2044266038 * value) { ___next_2 = value; Il2CppCodeGenWriteBarrier(&___next_2, value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
32.971014
131
0.799121
[ "object" ]
6f1953a6a793d467a5d88a12be09e26691a64a62
43,400
h
C
include/stxxl/bits/containers/btree/btree.h
ad-freiburg/stxxl
37874ce972d70c64123bf145b89f604acf4b0538
[ "BSL-1.0" ]
2
2016-05-27T08:46:03.000Z
2017-02-13T09:19:15.000Z
include/stxxl/bits/containers/btree/btree.h
ad-freiburg/stxxl
37874ce972d70c64123bf145b89f604acf4b0538
[ "BSL-1.0" ]
4
2016-09-27T12:47:08.000Z
2021-11-08T20:07:49.000Z
include/stxxl/bits/containers/btree/btree.h
ad-freiburg/stxxl
37874ce972d70c64123bf145b89f604acf4b0538
[ "BSL-1.0" ]
2
2018-08-29T13:40:13.000Z
2019-04-18T07:12:29.000Z
/*************************************************************************** * include/stxxl/bits/containers/btree/btree.h * * Part of the STXXL. See http://stxxl.org * * Copyright (C) 2006, 2008 Roman Dementiev <dementiev@ira.uka.de> * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) **************************************************************************/ #ifndef STXXL_CONTAINERS_BTREE_BTREE_HEADER #define STXXL_CONTAINERS_BTREE_BTREE_HEADER #include <algorithm> #include <limits> #include <map> #include <utility> #include <vector> #include <stxxl/bits/containers/btree/iterator.h> #include <stxxl/bits/containers/btree/iterator_map.h> #include <stxxl/bits/containers/btree/leaf.h> #include <stxxl/bits/containers/btree/node.h> #include <stxxl/bits/containers/btree/node_cache.h> #include <stxxl/bits/containers/btree/root_node.h> #include <stxxl/vector> namespace stxxl { namespace btree { template <class KeyType, class DataType, class KeyCompareWithMaxType, unsigned RawNodeSize, unsigned RawLeafSize, class PDAllocStrategy > class btree { static constexpr bool debug = false; public: using key_type = KeyType; using data_type = DataType; using key_compare = KeyCompareWithMaxType; using self_type = btree<KeyType, DataType, KeyCompareWithMaxType, RawNodeSize, RawLeafSize, PDAllocStrategy>; using alloc_strategy_type = PDAllocStrategy; using size_type = external_size_type; using difference_type = external_diff_type; using value_type = std::pair<const key_type, data_type>; using reference = value_type &; using const_reference = const value_type &; using pointer = value_type *; using const_pointer = value_type const*; // leaf type declarations using leaf_type = normal_leaf<key_type, data_type, key_compare, RawLeafSize, self_type>; friend class normal_leaf<key_type, data_type, key_compare, RawLeafSize, self_type>; using leaf_block_type = typename leaf_type::block_type; using leaf_bid_type = typename leaf_type::bid_type; using leaf_cache_type = node_cache<leaf_type, self_type>; friend class node_cache<leaf_type, self_type>; // iterator types using iterator = btree_iterator<self_type>; using const_iterator = btree_const_iterator<self_type>; friend class btree_iterator_base<self_type>; // iterator map type using iterator_map_type = iterator_map<self_type>; // node type declarations using node_type = normal_node<key_type, key_compare, RawNodeSize, self_type>; using node_block_type = typename node_type::block_type; friend class normal_node<key_type, key_compare, RawNodeSize, self_type>; using node_bid_type = typename node_type::bid_type; using node_cache_type = node_cache<node_type, self_type>; friend class node_cache<node_type, self_type>; using value_compare = typename leaf_type::value_compare; enum { min_node_size = node_type::min_size, max_node_size = node_type::max_size, min_leaf_size = leaf_type::min_size, max_leaf_size = leaf_type::max_size }; private: key_compare m_key_compare; mutable node_cache_type m_node_cache; mutable leaf_cache_type m_leaf_cache; iterator_map_type m_iterator_map; size_type m_size; unsigned int m_height; bool m_prefetching_enabled; foxxll::block_manager* m_bm; alloc_strategy_type m_alloc_strategy; using root_node_type = std::map<key_type, node_bid_type, key_compare>; using root_node_iterator_type = typename root_node_type::iterator; using root_node_const_iterator_type = typename root_node_type::const_iterator; using root_node_pair_type = std::pair<key_type, node_bid_type>; root_node_type m_root_node; iterator m_end_iterator; void insert_into_root(const std::pair<key_type, node_bid_type>& splitter) { std::pair<root_node_iterator_type, bool> result = m_root_node.insert(splitter); assert(result.second); tlx::unused(result); if (m_root_node.size() > max_node_size) // root overflow { TLX_LOG << "btree::insert_into_root, overflow happened, splitting"; node_bid_type left_bid; node_type* left_node = m_node_cache.get_new_node(left_bid); assert(left_node); node_bid_type right_bid; node_type* right_node = m_node_cache.get_new_node(right_bid); assert(right_node); const size_t old_size = m_root_node.size(); const size_t half = m_root_node.size() / 2; size_t i = 0; root_node_iterator_type it = m_root_node.begin(); typename node_block_type::iterator block_it = left_node->block().begin(); while (i < half) // copy smaller part { *block_it = *it; ++i; ++block_it; ++it; } left_node->block().info.cur_size = static_cast<unsigned int>(half); key_type left_key = (left_node->block()[half - 1]).first; block_it = right_node->block().begin(); while (i < old_size) // copy larger part { *block_it = *it; ++i; ++block_it; ++it; } const auto right_size = static_cast<size_t>(old_size - half); right_node->block().info.cur_size = right_size; key_type right_key = (right_node->block()[right_size - 1]).first; assert(old_size == right_node->size() + left_node->size()); // create new root node m_root_node.clear(); m_root_node.insert(root_node_pair_type(left_key, left_bid)); m_root_node.insert(root_node_pair_type(right_key, right_bid)); ++m_height; TLX_LOG << "btree Increasing height to " << m_height; if (m_node_cache.size() < (m_height - 1)) { FOXXLL_THROW2(std::runtime_error, "btree::bulk_construction", "The height of the tree (" << m_height << ") has exceeded the required capacity (" << (m_node_cache.size() + 1) << ") of the node cache. Increase the node cache size."); } } } template <class CacheType> void fuse_or_balance(root_node_iterator_type uit, CacheType& cache) { using local_node_type = typename CacheType::node_type; using local_bid_type = typename local_node_type::bid_type; root_node_iterator_type left_it, right_it; if (uit->first == m_key_compare.max_value()) { // uit is the last entry in the root assert(uit != m_root_node.begin()); right_it = uit; left_it = --uit; } else { left_it = uit; right_it = ++uit; assert(right_it != m_root_node.end()); } // now fuse or balance nodes pointed by leftIt and rightIt auto left_bid = static_cast<local_bid_type>(left_it->second); auto right_bid = static_cast<local_bid_type>(right_it->second); local_node_type* left_node = cache.get_node(left_bid, true); local_node_type* right_node = cache.get_node(right_bid, true); const size_t total_size = left_node->size() + right_node->size(); if (total_size <= right_node->max_nelements()) { // --- fuse --- // add the content of left_node to right_node right_node->fuse(*left_node); cache.unfix_node(right_bid); // 'delete_node' unfixes left_bid also cache.delete_node(left_bid); // delete left BID from the root m_root_node.erase(left_it); } else { // --- balance --- key_type new_splitter = right_node->balance(*left_node); // delete left BID from the root m_root_node.erase(left_it); // reinsert with the new key m_root_node.insert(root_node_pair_type(new_splitter, static_cast<node_bid_type>(left_bid))); cache.unfix_node(left_bid); cache.unfix_node(right_bid); } } void create_empty_leaf() { leaf_bid_type new_bid; leaf_type* new_leaf = m_leaf_cache.get_new_node(new_bid); assert(new_leaf); m_end_iterator = new_leaf->end(); // initialize end() iterator m_root_node.insert( root_node_pair_type(m_key_compare.max_value(), static_cast<node_bid_type>(new_bid))); } void deallocate_children() { if (m_height == 2) { // we have children leaves here for (root_node_const_iterator_type it = m_root_node.begin(); it != m_root_node.end(); ++it) { // delete from leaf cache and deallocate bid m_leaf_cache.delete_node(static_cast<leaf_bid_type>(it->second)); } } else { for (root_node_const_iterator_type it = m_root_node.begin(); it != m_root_node.end(); ++it) { node_type* node = m_node_cache.get_node(static_cast<node_bid_type>(it->second)); assert(node); node->deallocate_children(m_height - 1); // delete from node cache and deallocate bid m_node_cache.delete_node(static_cast<node_bid_type>(it->second)); } } } template <class InputIterator> void bulk_construction(InputIterator begin, InputIterator end, double node_fill_factor, double leaf_fill_factor) { assert(node_fill_factor >= 0.5); assert(leaf_fill_factor >= 0.5); key_type last_key = m_key_compare.max_value(); using key_bid_pair = std::pair<key_type, node_bid_type>; using key_bid_vector_type = typename stxxl::vector< key_bid_pair, 1, stxxl::random_pager<1>, node_block_type::raw_size >; key_bid_vector_type bids; leaf_bid_type new_bid; leaf_type* leaf = m_leaf_cache.get_new_node(new_bid); const size_t max_leaf_elements = static_cast<size_t>( leaf->max_nelements() * leaf_fill_factor); while (begin != end) { // write data in leaves // if *b not equal to the last element if (m_key_compare(begin->first, last_key) || m_key_compare(last_key, begin->first)) { ++m_size; if (leaf->size() == max_leaf_elements) { // overflow, need a new block bids.push_back(key_bid_pair(leaf->back().first, static_cast<node_bid_type>(new_bid))); leaf_type* new_leaf = m_leaf_cache.get_new_node(new_bid); assert(new_leaf); // Setting links leaf->succ() = new_leaf->my_bid(); new_leaf->pred() = leaf->my_bid(); leaf = new_leaf; } leaf->push_back(*begin); last_key = begin->first; } ++begin; } // rebalance the last leaf if (leaf->underflows() && !bids.empty()) { leaf_type* left_leaf = m_leaf_cache.get_node(static_cast<leaf_bid_type>(bids.back().second)); assert(left_leaf); if (left_leaf->size() + leaf->size() <= leaf->max_nelements()) { // can fuse leaf->fuse(*left_leaf); m_leaf_cache.delete_node(static_cast<leaf_bid_type>(bids.back().second)); bids.pop_back(); assert(!leaf->overflows() && !leaf->underflows()); } else { // need to rebalance const key_type new_splitter = leaf->balance(*left_leaf); bids.back().first = new_splitter; assert(!left_leaf->overflows() && !left_leaf->underflows()); } } assert(!leaf->overflows() && (!leaf->underflows() || m_size <= max_leaf_size)); m_end_iterator = leaf->end(); // initialize end() iterator bids.push_back(key_bid_pair(m_key_compare.max_value(), static_cast<node_bid_type>(new_bid))); const auto max_node_elements = static_cast<size_t>( max_node_size * node_fill_factor); //-tb fixes bug with only one child remaining in m_root_node while (bids.size() > node_type::max_nelements()) { key_bid_vector_type parent_bids; size_t nparents = foxxll::div_ceil(bids.size(), max_node_elements); assert(nparents >= 2); TLX_LOG << "btree bulk construct" << " bids.size=" << bids.size() << " nparents=" << nparents << " max_node_elements=" << max_node_elements << " node_type::max_nelements=" << node_type::max_nelements(); for (typename key_bid_vector_type::const_iterator it = bids.begin(); it != bids.end(); ) { node_bid_type new_bid; node_type* node = m_node_cache.get_new_node(new_bid); assert(node); for (size_t cnt = 0; cnt < max_node_elements && it != bids.end(); ++cnt, ++it) { node->push_back(*it); } TLX_LOG << "btree bulk construct node size : " << node->size() << " limits: " << node->min_nelements() << " " << node->max_nelements() << " max_node_elements: " << max_node_elements; if (node->underflows()) { // this can happen only at the end assert(it == bids.end()); assert(!parent_bids.empty()); node_type* left_node = m_node_cache.get_node(parent_bids.back().second); assert(left_node); if (left_node->size() + node->size() <= node->max_nelements()) { // can fuse TLX_LOG << "btree bulk construct fuse last nodes:" << " left_node.size=" << left_node->size() << " node.size=" << node->size(); node->fuse(*left_node); m_node_cache.delete_node(parent_bids.back().second); parent_bids.pop_back(); } else { // need to rebalance TLX_LOG << "btree bulk construct rebalance last nodes:" << " left_node.size=" << left_node->size() << " node.size=" << node->size(); const key_type new_splitter = node->balance(*left_node, false); parent_bids.back().first = new_splitter; TLX_LOG << "btree bulk construct after rebalance:" << " left_node.size=" << left_node->size() << " node.size=" << node->size(); assert(!left_node->overflows() && !left_node->underflows()); } } assert(!node->overflows() && !node->underflows()); parent_bids.push_back(key_bid_pair(node->back().first, new_bid)); } TLX_LOG << "btree parent_bids.size()=" << parent_bids.size() << " bids.size()=" << bids.size(); std::swap(parent_bids, bids); assert(nparents == bids.size() || (nparents - 1) == bids.size()); ++m_height; TLX_LOG << "Increasing height to " << m_height; if (m_node_cache.size() < (m_height - 1)) { FOXXLL_THROW2(std::runtime_error, "btree::bulk_construction", "The height of the tree (" << m_height << ") has exceeded the required capacity (" << (m_node_cache.size() + 1) << ") of the node cache. Increase the node cache size."); } } m_root_node.insert(bids.begin(), bids.end()); TLX_LOG << "btree bulk root_node_.size()=" << m_root_node.size(); } public: btree(const size_t node_cache_size_in_bytes, const size_t leaf_cache_size_in_bytes) : m_node_cache(node_cache_size_in_bytes, this, m_key_compare), m_leaf_cache(leaf_cache_size_in_bytes, this, m_key_compare), m_iterator_map(this), m_size(0), m_height(2), m_prefetching_enabled(true), m_bm(foxxll::block_manager::get_instance()) { TLX_LOG << "Creating a btree, addr=" << this; TLX_LOG << " bytes in a node: " << node_bid_type::size; TLX_LOG << " bytes in a leaf: " << leaf_bid_type::size; TLX_LOG << " elements in a node: " << node_block_type::size; TLX_LOG << " elements in a leaf: " << leaf_block_type::size; TLX_LOG << " size of a node element: " << sizeof(typename node_block_type::value_type); TLX_LOG << " size of a leaf element: " << sizeof(typename leaf_block_type::value_type); create_empty_leaf(); } btree(const key_compare& key_compare, const size_t node_cache_size_in_bytes, const size_t leaf_cache_size_in_bytes) : m_key_compare(key_compare), m_node_cache(node_cache_size_in_bytes, this, m_key_compare), m_leaf_cache(leaf_cache_size_in_bytes, this, m_key_compare), m_iterator_map(this), m_size(0), m_height(2), m_prefetching_enabled(true), m_bm(foxxll::block_manager::get_instance()) { TLX_LOG << "Creating a btree, addr=" << this; TLX_LOG << " bytes in a node: " << node_bid_type::size; TLX_LOG << " bytes in a leaf: " << leaf_bid_type::size; create_empty_leaf(); } //! non-copyable: delete copy-constructor btree(const btree&) = delete; //! non-copyable: delete assignment operator btree& operator = (const btree&) = delete; virtual ~btree() { try { deallocate_children(); } catch (...) { // no exceptions in destructor } } size_type size() const { return m_size; } size_type max_size() const { return std::numeric_limits<size_type>::max(); } bool empty() const { return !m_size; } std::pair<iterator, bool> insert(const value_type& x) { root_node_iterator_type it = m_root_node.lower_bound(x.first); assert(!m_root_node.empty()); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "Inserting new value into a leaf"; leaf_type* leaf = m_leaf_cache.get_node(static_cast<leaf_bid_type>(it->second), true); assert(leaf); std::pair<key_type, leaf_bid_type> splitter; std::pair<iterator, bool> result = leaf->insert(x, splitter); if (result.second) ++m_size; m_leaf_cache.unfix_node(static_cast<leaf_bid_type>(it->second)); //if(key_compare::max_value() == Splitter.first) if (!(m_key_compare(m_key_compare.max_value(), splitter.first) || m_key_compare(splitter.first, m_key_compare.max_value()))) return result; // no overflow/splitting happened TLX_LOG << "Inserting new value into root node"; insert_into_root(std::make_pair(splitter.first, node_bid_type(splitter.second))); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } // 'it' points to a node TLX_LOG << "Inserting new value into a node"; node_type* node = m_node_cache.get_node(static_cast<node_bid_type>(it->second), true); assert(node); std::pair<key_type, node_bid_type> splitter; std::pair<iterator, bool> result = node->insert(x, m_height - 1, splitter); if (result.second) ++m_size; m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); //if(key_compare::max_value() == Splitter.first) if (!(m_key_compare(m_key_compare.max_value(), splitter.first) || m_key_compare(splitter.first, m_key_compare.max_value()))) return result; // no overflow/splitting happened TLX_LOG << "Inserting new value into root node"; insert_into_root(splitter); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } iterator begin() { root_node_iterator_type it = m_root_node.begin(); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "btree: retrieving begin() from the first leaf"; leaf_type* leaf = m_leaf_cache.get_node(static_cast<leaf_bid_type>(it->second)); assert(leaf); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return leaf->begin(); } // 'it' points to a node TLX_LOG << "btree: retrieving begin() from the first node"; node_type* node = m_node_cache.get_node(static_cast<node_bid_type>(it->second), true); assert(node); iterator result = node->begin(m_height - 1); m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } const_iterator begin() const { root_node_const_iterator_type it = m_root_node.begin(); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "btree: retrieving begin() from the first leaf"; const leaf_type* leaf = m_leaf_cache.get_const_node(static_cast<leaf_bid_type>(it->second)); assert(leaf); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return leaf->begin(); } // 'it' points to a node TLX_LOG << "btree: retrieving begin() from the first node"; const node_type* node = m_node_cache.get_const_node(static_cast<node_bid_type>(it->second), true); assert(node); const_iterator result = node->begin(m_height - 1); m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } iterator end() { return m_end_iterator; } const_iterator end() const { return m_end_iterator; } data_type& operator [] (const key_type& k) { return (*((insert(value_type(k, data_type()))).first)).second; } iterator find(const key_type& k) { root_node_iterator_type it = m_root_node.lower_bound(k); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "Searching in a leaf"; leaf_type* leaf = m_leaf_cache.get_node(static_cast<leaf_bid_type>(it->second), true); assert(leaf); iterator result = leaf->find(k); m_leaf_cache.unfix_node(static_cast<leaf_bid_type>(it->second)); assert(result == end() || result->first == k); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } // 'it' points to a node TLX_LOG << "Searching in a node"; node_type* node = m_node_cache.get_node(static_cast<node_bid_type>(it->second), true); assert(node); iterator result = node->find(k, m_height - 1); m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(result == end() || result->first == k); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } const_iterator find(const key_type& k) const { root_node_const_iterator_type it = m_root_node.lower_bound(k); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "Searching in a leaf"; const leaf_type* leaf = m_leaf_cache.get_const_node(static_cast<leaf_bid_type>(it->second), true); assert(leaf); const_iterator result = leaf->find(k); m_leaf_cache.unfix_node(static_cast<leaf_bid_type>(it->second)); assert(result == end() || result->first == k); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } // 'it' points to a node TLX_LOG << "Searching in a node"; const node_type* node = m_node_cache.get_const_node(static_cast<node_bid_type>(it->second), true); assert(node); const_iterator result = node->find(k, m_height - 1); m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(result == end() || result->first == k); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } iterator lower_bound(const key_type& k) { root_node_iterator_type it = m_root_node.lower_bound(k); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "Searching lower bound in a leaf"; leaf_type* leaf = m_leaf_cache.get_node(static_cast<leaf_bid_type>(it->second), true); assert(leaf); iterator result = leaf->lower_bound(k); m_leaf_cache.unfix_node(static_cast<leaf_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } // 'it' points to a node TLX_LOG << "Searching lower bound in a node"; node_type* node = m_node_cache.get_node(static_cast<node_bid_type>(it->second), true); assert(node); iterator result = node->lower_bound(k, m_height - 1); m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } const_iterator lower_bound(const key_type& k) const { root_node_const_iterator_type it = m_root_node.lower_bound(k); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "Searching lower bound in a leaf"; const leaf_type* leaf = m_leaf_cache.get_const_node(static_cast<leaf_bid_type>(it->second), true); assert(leaf); const_iterator result = leaf->lower_bound(k); m_leaf_cache.unfix_node(static_cast<leaf_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } // 'it' points to a node TLX_LOG << "Searching lower bound in a node"; const node_type* node = m_node_cache.get_const_node(static_cast<node_bid_type>(it->second), true); assert(node); const_iterator result = node->lower_bound(k, m_height - 1); m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } iterator upper_bound(const key_type& k) { root_node_iterator_type it = m_root_node.upper_bound(k); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "Searching upper bound in a leaf"; leaf_type* Leaf = m_leaf_cache.get_node(static_cast<leaf_bid_type>(it->second), true); assert(Leaf); iterator result = Leaf->upper_bound(k); m_leaf_cache.unfix_node(static_cast<leaf_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } // 'it' points to a node TLX_LOG << "Searching upper bound in a node"; node_type* Node = m_node_cache.get_node(static_cast<node_bid_type>(it->second), true); assert(Node); iterator result = Node->upper_bound(k, m_height - 1); m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } const_iterator upper_bound(const key_type& k) const { root_node_const_iterator_type it = m_root_node.upper_bound(k); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "Searching upper bound in a leaf"; const leaf_type* leaf = m_leaf_cache.get_const_node(static_cast<leaf_bid_type>(it->second), true); assert(leaf); const_iterator result = leaf->upper_bound(k); m_leaf_cache.unfix_node(static_cast<leaf_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } // 'it' points to a node TLX_LOG << "Searching upper bound in a node"; const node_type* node = m_node_cache.get_const_node(static_cast<node_bid_type>(it->second), true); assert(node); const_iterator result = node->upper_bound(k, m_height - 1); m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } std::pair<iterator, iterator> equal_range(const key_type& k) { // l->first >= k iterator l = lower_bound(k); // if (k < l->first) if (l == end() || m_key_compare(k, l->first)) // then upper_bound == lower_bound return std::pair<iterator, iterator>(l, l); iterator u = l; // only one element ==k can exist ++u; assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); // then upper_bound == (lower_bound+1) return std::pair<iterator, iterator>(l, u); } std::pair<const_iterator, const_iterator> equal_range(const key_type& k) const { // l->first >= k const_iterator l = lower_bound(k); // if (k < l->first) if (l == end() || m_key_compare(k, l->first)) // then upper_bound == lower_bound return std::pair<const_iterator, const_iterator>(l, l); const_iterator u = l; // only one element ==k can exist ++u; assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); // then upper_bound == (lower_bound+1) return std::pair<const_iterator, const_iterator>(l, u); } size_type erase(const key_type& k) { root_node_iterator_type it = m_root_node.lower_bound(k); assert(it != m_root_node.end()); if (m_height == 2) // 'it' points to a leaf { TLX_LOG << "Deleting key from a leaf"; leaf_type* Leaf = m_leaf_cache.get_node(static_cast<leaf_bid_type>(it->second), true); assert(Leaf); size_type result = Leaf->erase(k); m_size -= result; m_leaf_cache.unfix_node(static_cast<leaf_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); if ((!Leaf->underflows()) || m_root_node.size() == 1) return result; // no underflow or root has a special degree 1 (too few elements) TLX_LOG << "btree: Fusing or rebalancing a leaf"; fuse_or_balance(it, m_leaf_cache); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } // 'it' points to a node TLX_LOG << "Deleting key from a node"; assert(m_root_node.size() >= 2); node_type* node = m_node_cache.get_node(static_cast<node_bid_type>(it->second), true); assert(node); size_type result = node->erase(k, m_height - 1); m_size -= result; m_node_cache.unfix_node(static_cast<node_bid_type>(it->second)); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); if (!node->underflows()) return result; // no underflow happened TLX_LOG << "Fusing or rebalancing a node"; fuse_or_balance(it, m_node_cache); if (m_root_node.size() == 1) { TLX_LOG << "btree Root has size 1 and height > 2"; TLX_LOG << "btree Deallocate root and decrease height"; it = m_root_node.begin(); node_bid_type root_bid = it->second; assert(it->first == m_key_compare.max_value()); node_type* root_node = m_node_cache.get_node(root_bid); assert(root_node); assert(root_node->back().first == m_key_compare.max_value()); m_root_node.clear(); m_root_node.insert(root_node->block().begin(), root_node->block().begin() + root_node->size()); m_node_cache.delete_node(root_bid); --m_height; TLX_LOG << "btree Decreasing height to " << m_height; } assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return result; } size_type count(const key_type& k) { if (find(k) == end()) return 0; return 1; } void erase(iterator pos) { assert(pos != end()); #ifndef NDEBUG size_type old_size = size(); #endif erase(pos->first); assert(size() == old_size - 1); } iterator insert(iterator /*pos*/, const value_type& x) { // pos ignored in the current version return insert(x).first; } void clear() { deallocate_children(); m_root_node.clear(); m_size = 0; m_height = 2, create_empty_leaf(); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); } template <class InputIterator> void insert(InputIterator b, InputIterator e) { while (b != e) { insert(*(b++)); } } template <class InputIterator> btree(InputIterator begin, InputIterator end, const key_compare& c_, const size_t node_cache_size_in_bytes, const size_t leaf_cache_size_in_bytes, bool range_sorted = false, double node_fill_factor = 0.75, double leaf_fill_factor = 0.6) : m_key_compare(c_), m_node_cache(node_cache_size_in_bytes, this, m_key_compare), m_leaf_cache(leaf_cache_size_in_bytes, this, m_key_compare), m_iterator_map(this), m_size(0), m_height(2), m_prefetching_enabled(true), m_bm(foxxll::block_manager::get_instance()) { TLX_LOG << "Creating a btree, addr=" << this; TLX_LOG << " bytes in a node: " << node_bid_type::size; TLX_LOG << " bytes in a leaf: " << leaf_bid_type::size; if (range_sorted == false) { create_empty_leaf(); insert(begin, end); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return; } bulk_construction(begin, end, node_fill_factor, leaf_fill_factor); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); } template <class InputIterator> btree(InputIterator begin, InputIterator end, const size_t node_cache_size_in_bytes, const size_t leaf_cache_size_in_bytes, bool range_sorted = false, double node_fill_factor = 0.75, double leaf_fill_factor = 0.6) : m_node_cache(node_cache_size_in_bytes, this, m_key_compare), m_leaf_cache(leaf_cache_size_in_bytes, this, m_key_compare), m_iterator_map(this), m_size(0), m_height(2), m_prefetching_enabled(true), m_bm(foxxll::block_manager::get_instance()) { TLX_LOG << "Creating a btree, addr=" << this; TLX_LOG << " bytes in a node: " << node_bid_type::size; TLX_LOG << " bytes in a leaf: " << leaf_bid_type::size; if (range_sorted == false) { create_empty_leaf(); insert(begin, end); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); return; } bulk_construction(begin, end, node_fill_factor, leaf_fill_factor); assert(m_leaf_cache.nfixed() == 0); assert(m_node_cache.nfixed() == 0); } void erase(iterator first, iterator last) { if (first == begin() && last == end()) clear(); else while (first != last) erase(first++); } key_compare key_comp() const { return m_key_compare; } value_compare value_comp() const { return value_compare(m_key_compare); } void swap(btree& obj) { std::swap(m_key_compare, obj.m_key_compare); // OK std::swap(m_node_cache, obj.m_node_cache); // OK std::swap(m_leaf_cache, obj.m_leaf_cache); // OK std::swap(m_iterator_map, obj.m_iterator_map); // must update all iterators std::swap(m_end_iterator, obj.m_end_iterator); std::swap(m_size, obj.m_size); std::swap(m_height, obj.m_height); std::swap(m_alloc_strategy, obj.m_alloc_strategy); std::swap(m_root_node, obj.m_root_node); } void enable_prefetching() { m_prefetching_enabled = true; } void disable_prefetching() { m_prefetching_enabled = false; } bool prefetching_enabled() { return m_prefetching_enabled; } void print_statistics(std::ostream& o) const { o << "Node cache statistics:" << std::endl; m_node_cache.print_statistics(o); o << "Leaf cache statistics:" << std::endl; m_leaf_cache.print_statistics(o); } void reset_statistics() { m_node_cache.reset_statistics(); m_leaf_cache.reset_statistics(); } }; template <class KeyType, class DataType, class KeyCompareWithMaxType, unsigned LogNodeSize, unsigned LogLeafSize, class PDAllocStrategy > inline bool operator == (const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& a, const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& b) { return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin()); } template <class KeyType, class DataType, class KeyCompareWithMaxType, unsigned LogNodeSize, unsigned LogLeafSize, class PDAllocStrategy > inline bool operator != (const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& a, const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& b) { return !(a == b); } template <class KeyType, class DataType, class KeyCompareWithMaxType, unsigned LogNodeSize, unsigned LogLeafSize, class PDAllocStrategy > inline bool operator < (const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& a, const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& b) { return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end()); } template <class KeyType, class DataType, class KeyCompareWithMaxType, unsigned LogNodeSize, unsigned LogLeafSize, class PDAllocStrategy > inline bool operator > (const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& a, const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& b) { return b < a; } template <class KeyType, class DataType, class KeyCompareWithMaxType, unsigned LogNodeSize, unsigned LogLeafSize, class PDAllocStrategy > inline bool operator <= (const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& a, const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& b) { return !(b < a); } template <class KeyType, class DataType, class KeyCompareWithMaxType, unsigned LogNodeSize, unsigned LogLeafSize, class PDAllocStrategy > inline bool operator >= (const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& a, const btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& b) { return !(a < b); } } // namespace btree } // namespace stxxl namespace std { template <class KeyType, class DataType, class KeyCompareWithMaxType, unsigned LogNodeSize, unsigned LogLeafSize, class PDAllocStrategy > void swap(stxxl::btree::btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& a, stxxl::btree::btree<KeyType, DataType, KeyCompareWithMaxType, LogNodeSize, LogLeafSize, PDAllocStrategy>& b) { if (&a != &b) a.swap(b); } } // namespace std #endif // !STXXL_CONTAINERS_BTREE_BTREE_HEADER
35.198702
199
0.57712
[ "vector" ]
6f1d61b8743dae4f0ed8ea48628504eac8766a10
2,627
h
C
sources/thelib/include/protocols/drm/basedrmappprotocolhandler.h
rdkcmf/rdkc-rms
65ab1efcee9e3de46a888c125f591cd48b815601
[ "Apache-2.0" ]
3
2020-07-30T19:41:00.000Z
2020-10-28T12:52:37.000Z
sources/thelib/include/protocols/drm/basedrmappprotocolhandler.h
rdkcmf/rdkc-rms
65ab1efcee9e3de46a888c125f591cd48b815601
[ "Apache-2.0" ]
null
null
null
sources/thelib/include/protocols/drm/basedrmappprotocolhandler.h
rdkcmf/rdkc-rms
65ab1efcee9e3de46a888c125f591cd48b815601
[ "Apache-2.0" ]
2
2020-05-11T03:19:00.000Z
2021-07-07T17:40:47.000Z
/** ########################################################################## # If not stated otherwise in this file or this component's LICENSE # file the following copyright and licenses apply: # # Copyright 2019 RDK Management # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ########################################################################## **/ #ifdef HAS_PROTOCOL_DRM #ifndef _BASEDRMAPPPROTOCOLHANDLER_H #define _BASEDRMAPPPROTOCOLHANDLER_H #include "application/baseappprotocolhandler.h" #include "protocols/drm/drmkeys.h" class BaseDRMProtocol; typedef enum { DRMSerializer_None = 0, DRMSerializer_Verimatrix = 1 } DRMSerializer; class DLLEXP BaseDRMAppProtocolHandler : public BaseAppProtocolHandler { private: Variant _urlCache; vector<uint64_t> _outboundHttpDrm; vector<uint64_t> _outboundHttpsDrm; DRMKeys *_pDRMQueue; uint32_t _lastSentId; public: BaseDRMAppProtocolHandler(Variant &configuration); virtual ~BaseDRMAppProtocolHandler(); virtual void RegisterProtocol(BaseProtocol *pProtocol); virtual void UnRegisterProtocol(BaseProtocol *pProtocol); //opens an OUTBOUNDXMLVARIANT or an OUTBOUNDBINVARIANT //and sends the variant bool Send(string ip, uint16_t port, Variant &variant, DRMSerializer serializer = DRMSerializer_Verimatrix); //opens an OUTBOUNDHTTPXMLVARIANT or an OUTBOUNDHTTPBINVARIANT //and sends the variant (with optional client certificate setting) bool Send(string url, Variant &variant, DRMSerializer serializer = DRMSerializer_Verimatrix, string serverCertificate = "", string clientCertificate = "", string clientCertificateKey = ""); //used internally static bool SignalProtocolCreated(BaseProtocol *pProtocol, Variant &parameters); virtual void ConnectionFailed(Variant &parameters); //this is called whenever a message is received virtual bool ProcessMessage(BaseDRMProtocol *pProtocol, Variant &lastSent, Variant &lastReceived); virtual DRMKeys *GetDRMQueue(); private: Variant &GetScaffold(string &uriString); vector<uint64_t> &GetTransport(bool isSsl); }; #endif /* _BASEDRMAPPPROTOCOLHANDLER_H */ #endif /* HAS_PROTOCOL_DRM */
32.432099
81
0.746479
[ "vector" ]
6f2369a20341e1d8bab46ca8a8146cc1e1dca6e7
14,734
c
C
hp_list/main.c
RinHizakura/concurrent-programs
3007917a2ee78468ab946f9f116c19695e7cf112
[ "BSD-2-Clause" ]
198
2021-04-06T13:36:47.000Z
2022-03-28T15:48:29.000Z
hp_list/main.c
RinHizakura/concurrent-programs
3007917a2ee78468ab946f9f116c19695e7cf112
[ "BSD-2-Clause" ]
7
2021-04-16T14:10:17.000Z
2021-08-10T09:29:12.000Z
hp_list/main.c
RinHizakura/concurrent-programs
3007917a2ee78468ab946f9f116c19695e7cf112
[ "BSD-2-Clause" ]
43
2021-04-07T02:47:48.000Z
2022-03-28T15:52:22.000Z
/* * Hazard pointers are a mechanism for protecting objects in memory from * being deleted by other threads while in use. This allows safe lock-free * data structures. */ #include <assert.h> #include <inttypes.h> #include <stdalign.h> #include <stdatomic.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <threads.h> static atomic_uint_fast64_t deletes = 0, inserts = 0; /* * Reference : * A more Pragmatic Implementation of the Lock-free, Ordered, Linked List * https://arxiv.org/abs/2010.15755 */ #ifdef RUNTIME_STAT enum { TRACE_nop = 0, TRACE_retry, /* the number of retries in the __list_find function. */ TRACE_contains, /* the number of wait-free contains in the __list_find function that curr pointer pointed. */ TRACE_traversal, /* the number of list element traversal in the __list_find function. */ TRACE_fail, /* the number of CAS() failures. */ TRACE_del, /* the number of list_delete operation failed and restart again. */ TRACE_ins, /* the number of list_insert operation failed and restart again. */ TRACE_inserts, /* the number of atomic_load operation in list_delete, list_insert and __list_find. */ TRACE_deletes /* the number of atomic_store operation in list_delete, list_insert and __list_find. */ }; struct runtime_statistics { atomic_uint_fast64_t retry, contains, traversal, fail; atomic_uint_fast64_t del, ins; atomic_uint_fast64_t load, store; }; static struct runtime_statistics stats = {0}; #define CAS(obj, expected, desired) \ ({ \ bool __ret = atomic_compare_exchange_strong(obj, expected, desired); \ if (!__ret) \ atomic_fetch_add(&stats.fail, 1); \ __ret; \ }) #define ATOMIC_LOAD(obj) \ ({ \ atomic_fetch_add(&stats.load, 1); \ atomic_load(obj); \ }) #define ATOMIC_STORE_EXPLICIT(obj, desired, order) \ do { \ atomic_fetch_add(&stats.store, 1); \ atomic_store_explicit(obj, desired, order); \ } while (0) #define TRACE(ops) \ do { \ if (TRACE_##ops) \ atomic_fetch_add(&stats.ops, 1); \ } while (0) static void do_analysis(void) { __atomic_thread_fence(__ATOMIC_SEQ_CST); #define TRACE_PRINT(ops) printf("%-10s: %ld\n", #ops, stats.ops); TRACE_PRINT(retry); TRACE_PRINT(contains); TRACE_PRINT(traversal); TRACE_PRINT(fail); TRACE_PRINT(del) TRACE_PRINT(ins); TRACE_PRINT(load); TRACE_PRINT(store); #undef TRACE_PRINT #define TRACE_PRINT(val) printf("%-10s: %ld\n", #val, val); TRACE_PRINT(deletes); TRACE_PRINT(inserts); #undef TRACE_PRINT } #else #define CAS(obj, expected, desired) \ ({ atomic_compare_exchange_strong(obj, expected, desired); }) #define ATOMIC_LOAD(obj) ({ atomic_load(obj); }) #define ATOMIC_STORE_EXPLICIT(obj, desired, order) \ do { \ atomic_store_explicit(obj, desired, order); \ } while (0) #define TRACE(ops) \ do { \ } while (0) static void do_analysis(void) { __atomic_thread_fence(__ATOMIC_SEQ_CST); fprintf(stderr, "inserts = %zu, deletes = %zu\n", inserts, deletes); } #endif /* RUNTIME_STAT */ #define RUNTIME_STAT_INIT() atexit(do_analysis) #define HP_MAX_THREADS 128 #define HP_MAX_HPS 5 /* This is named 'K' in the HP paper */ #define CLPAD (128 / sizeof(uintptr_t)) #define HP_THRESHOLD_R 0 /* This is named 'R' in the HP paper */ /* Maximum number of retired objects per thread */ #define HP_MAX_RETIRED (HP_MAX_THREADS * HP_MAX_HPS) #define TID_UNKNOWN -1 typedef struct { int size; uintptr_t *list; } retirelist_t; typedef struct list_hp list_hp_t; typedef void(list_hp_deletefunc_t)(void *); struct list_hp { int max_hps; alignas(128) atomic_uintptr_t *hp[HP_MAX_THREADS]; alignas(128) retirelist_t *rl[HP_MAX_THREADS * CLPAD]; list_hp_deletefunc_t *deletefunc; }; static thread_local int tid_v = TID_UNKNOWN; static atomic_int_fast32_t tid_v_base = ATOMIC_VAR_INIT(0); static inline int tid(void) { if (tid_v == TID_UNKNOWN) { tid_v = atomic_fetch_add(&tid_v_base, 1); assert(tid_v < HP_MAX_THREADS); } return tid_v; } /* Create a new hazard pointer array of size 'max_hps' (or a reasonable * default value if 'max_hps' is 0). The function 'deletefunc' will be * used to delete objects protected by hazard pointers when it becomes * safe to retire them. */ list_hp_t *list_hp_new(size_t max_hps, list_hp_deletefunc_t *deletefunc) { list_hp_t *hp = aligned_alloc(128, sizeof(*hp)); assert(hp); if (max_hps == 0) max_hps = HP_MAX_HPS; *hp = (list_hp_t){.max_hps = max_hps, .deletefunc = deletefunc}; for (int i = 0; i < HP_MAX_THREADS; i++) { hp->hp[i] = calloc(CLPAD * 2, sizeof(hp->hp[i][0])); hp->rl[i * CLPAD] = calloc(1, sizeof(*hp->rl[0])); for (int j = 0; j < hp->max_hps; j++) atomic_init(&hp->hp[i][j], 0); hp->rl[i * CLPAD]->list = calloc(HP_MAX_RETIRED, sizeof(uintptr_t)); } return hp; } /* Destroy a hazard pointer array and clean up all objects protected * by hazard pointers. */ void list_hp_destroy(list_hp_t *hp) { for (int i = 0; i < HP_MAX_THREADS; i++) { free(hp->hp[i]); retirelist_t *rl = hp->rl[i * CLPAD]; for (int j = 0; j < rl->size; j++) { void *data = (void *) rl->list[j]; hp->deletefunc(data); } free(rl->list); free(rl); } free(hp); } /* Clear all hazard pointers in the array for the current thread. * Progress condition: wait-free bounded (by max_hps) */ void list_hp_clear(list_hp_t *hp) { for (int i = 0; i < hp->max_hps; i++) atomic_store_explicit(&hp->hp[tid()][i], 0, memory_order_release); } /* This returns the same value that is passed as ptr. * Progress condition: wait-free population oblivious. */ uintptr_t list_hp_protect_ptr(list_hp_t *hp, int ihp, uintptr_t ptr) { atomic_store(&hp->hp[tid()][ihp], ptr); return ptr; } /* Same as list_hp_protect_ptr(), but explicitly uses memory_order_release. * Progress condition: wait-free population oblivious. */ uintptr_t list_hp_protect_release(list_hp_t *hp, int ihp, uintptr_t ptr) { atomic_store_explicit(&hp->hp[tid()][ihp], ptr, memory_order_release); return ptr; } /* Retire an object that is no longer in use by any thread, calling * the delete function that was specified in list_hp_new(). * * Progress condition: wait-free bounded (by the number of threads squared) */ void list_hp_retire(list_hp_t *hp, uintptr_t ptr) { retirelist_t *rl = hp->rl[tid() * CLPAD]; rl->list[rl->size++] = ptr; assert(rl->size < HP_MAX_RETIRED); if (rl->size < HP_THRESHOLD_R) return; for (size_t iret = 0; iret < rl->size; iret++) { uintptr_t obj = rl->list[iret]; bool can_delete = true; for (int itid = 0; itid < HP_MAX_THREADS && can_delete; itid++) { for (int ihp = hp->max_hps - 1; ihp >= 0; ihp--) { if (atomic_load(&hp->hp[itid][ihp]) == obj) { can_delete = false; break; } } } if (can_delete) { size_t bytes = (rl->size - iret) * sizeof(rl->list[0]); memmove(&rl->list[iret], &rl->list[iret + 1], bytes); rl->size--; hp->deletefunc((void *) obj); } } } #include <pthread.h> #define N_ELEMENTS 128 #define N_THREADS (128 / 2) #define MAX_THREADS 128 enum { HP_NEXT = 0, HP_CURR = 1, HP_PREV }; #define is_marked(p) (bool) ((uintptr_t)(p) &0x01) #define get_marked(p) ((uintptr_t)(p) | (0x01)) #define get_unmarked(p) ((uintptr_t)(p) & (~0x01)) #define get_marked_node(p) ((list_node_t *) get_marked(p)) #define get_unmarked_node(p) ((list_node_t *) get_unmarked(p)) typedef uintptr_t list_key_t; typedef struct list_node { alignas(128) uint32_t magic; alignas(128) atomic_uintptr_t next; list_key_t key; } list_node_t; /* Per list variables */ typedef struct list { atomic_uintptr_t head, tail; list_hp_t *hp; } list_t; #define LIST_MAGIC (0xDEADBEAF) list_node_t *list_node_new(list_key_t key) { list_node_t *node = aligned_alloc(128, sizeof(*node)); assert(node); *node = (list_node_t){.magic = LIST_MAGIC, .key = key}; (void) atomic_fetch_add(&inserts, 1); return node; } void list_node_destroy(list_node_t *node) { if (!node) return; assert(node->magic == LIST_MAGIC); free(node); (void) atomic_fetch_add(&deletes, 1); } static void __list_node_delete(void *arg) { list_node_t *node = (list_node_t *) arg; list_node_destroy(node); } static bool __list_find(list_t *list, list_key_t *key, atomic_uintptr_t **par_prev, list_node_t **par_curr, list_node_t **par_next) { atomic_uintptr_t *prev = NULL; list_node_t *curr = NULL, *next = NULL; try_again: prev = &list->head; curr = (list_node_t *) ATOMIC_LOAD(prev); (void) list_hp_protect_ptr(list->hp, HP_CURR, (uintptr_t) curr); if (ATOMIC_LOAD(prev) != get_unmarked(curr)) { TRACE(retry); goto try_again; } while (true) { if (is_marked(curr)) TRACE(contains); next = (list_node_t *) ATOMIC_LOAD(&get_unmarked_node(curr)->next); (void) list_hp_protect_ptr(list->hp, HP_NEXT, get_unmarked(next)); /* On a CAS failure, the search function, "__list_find," will simply * have to go backwards in the list until an unmarked element is found * from which the search in increasing key order can be started. */ if (ATOMIC_LOAD(&get_unmarked_node(curr)->next) != (uintptr_t) next) { TRACE(retry); goto try_again; } if (ATOMIC_LOAD(prev) != get_unmarked(curr)) { TRACE(retry); goto try_again; } if (get_unmarked_node(next) == next) { if (!(get_unmarked_node(curr)->key < *key)) { *par_curr = curr; *par_prev = prev; *par_next = next; return (get_unmarked_node(curr)->key == *key); } prev = &get_unmarked_node(curr)->next; (void) list_hp_protect_release(list->hp, HP_PREV, get_unmarked(curr)); } else { uintptr_t tmp = get_unmarked(curr); if (!CAS(prev, &tmp, get_unmarked(next))) { TRACE(retry); goto try_again; } list_hp_retire(list->hp, get_unmarked(curr)); } curr = next; (void) list_hp_protect_release(list->hp, HP_CURR, get_unmarked(next)); TRACE(traversal); } } bool list_insert(list_t *list, list_key_t key) { list_node_t *curr = NULL, *next = NULL; atomic_uintptr_t *prev = NULL; list_node_t *node = list_node_new(key); while (true) { if (__list_find(list, &key, &prev, &curr, &next)) { list_node_destroy(node); list_hp_clear(list->hp); return false; } ATOMIC_STORE_EXPLICIT(&node->next, (uintptr_t) curr, memory_order_relaxed); uintptr_t tmp = get_unmarked(curr); if (CAS(prev, &tmp, (uintptr_t) node)) { list_hp_clear(list->hp); return true; } TRACE(ins); } } bool list_delete(list_t *list, list_key_t key) { list_node_t *curr, *next; atomic_uintptr_t *prev; while (true) { if (!__list_find(list, &key, &prev, &curr, &next)) { list_hp_clear(list->hp); return false; } uintptr_t tmp = get_unmarked(next); if (!CAS(&curr->next, &tmp, get_marked(next))) { TRACE(del); continue; } tmp = get_unmarked(curr); if (CAS(prev, &tmp, get_unmarked(next))) { list_hp_clear(list->hp); list_hp_retire(list->hp, get_unmarked(curr)); } else { list_hp_clear(list->hp); } return true; } } list_t *list_new(void) { list_t *list = calloc(1, sizeof(*list)); assert(list); list_node_t *head = list_node_new(0), *tail = list_node_new(UINTPTR_MAX); assert(head), assert(tail); list_hp_t *hp = list_hp_new(3, __list_node_delete); atomic_init(&head->next, (uintptr_t) tail); *list = (list_t){.hp = hp}; atomic_init(&list->head, (uintptr_t) head); atomic_init(&list->tail, (uintptr_t) tail); return list; } void list_destroy(list_t *list) { assert(list); list_node_t *prev = (list_node_t *) atomic_load(&list->head); list_node_t *node = (list_node_t *) atomic_load(&prev->next); while (node) { list_node_destroy(prev); prev = node; node = (list_node_t *) atomic_load(&prev->next); } list_node_destroy(prev); list_hp_destroy(list->hp); free(list); } static uintptr_t elements[MAX_THREADS + 1][N_ELEMENTS]; static void *insert_thread(void *arg) { list_t *list = (list_t *) arg; for (size_t i = 0; i < N_ELEMENTS; i++) (void) list_insert(list, (uintptr_t) &elements[tid()][i]); return NULL; } static void *delete_thread(void *arg) { list_t *list = (list_t *) arg; for (size_t i = 0; i < N_ELEMENTS; i++) (void) list_delete(list, (uintptr_t) &elements[tid()][i]); return NULL; } int main(void) { RUNTIME_STAT_INIT(); list_t *list = list_new(); pthread_t thr[N_THREADS]; for (size_t i = 0; i < N_THREADS; i++) pthread_create(&thr[i], NULL, (i & 1) ? delete_thread : insert_thread, list); for (size_t i = 0; i < N_THREADS; i++) pthread_join(thr[i], NULL); for (size_t i = 0; i < N_ELEMENTS; i++) { for (size_t j = 0; j < tid_v_base; j++) list_delete(list, (uintptr_t) &elements[j][i]); } list_destroy(list); return 0; }
29.586345
79
0.588571
[ "object" ]
6f28226db26a4f778af4a382b41e566964125fdb
1,042
h
C
Arduino Code/pid.h
01110111000001/GyroDancing
504aa5315ddde5f0072cc104514fbc7ce9731f73
[ "Unlicense" ]
null
null
null
Arduino Code/pid.h
01110111000001/GyroDancing
504aa5315ddde5f0072cc104514fbc7ce9731f73
[ "Unlicense" ]
1
2019-02-07T15:42:17.000Z
2019-02-07T15:42:17.000Z
Arduino Code/pid.h
01110111000001/GyroDancing
504aa5315ddde5f0072cc104514fbc7ce9731f73
[ "Unlicense" ]
1
2019-02-07T16:02:34.000Z
2019-02-07T16:02:34.000Z
#pragma once #include "PID_lib.h" double Setpoint = 107, Input, Output; //double Kp = 91, Ki = 0, Kd = 0; double Kp = 35, Ki = 1200, Kd = 0.15; //15 375 0.12 PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, REVERSE); uint8_t moder(uint8_t a) { if (a == 16 || a == 32) PORTC |= 0x01; else PORTC &= 0xfe; if (!(a == 1 || a == 4 || a == 16)) PORTC |= 0x04; else PORTC &= 0xfb; if (!(a == 1 || a == 2 || a == 16)) PORTC |= 0x02; else PORTC &= 0xfd; // digitalWrite(M3r, (b == 16 || b == 32)); // digitalWrite(M1r, !(b == 1 || b == 4 || b == 16)); // digitalWrite(M2r, !(b == 1 || b == 2 || b == 16)); return a; } uint8_t model(uint8_t a) { if (a == 16 || a == 32) PORTD |= 0x40; else PORTD &= 0xbf; if (!(a == 1 || a == 4 || a == 16)) PORTB |= 0x01; else PORTB &= 0xfe; if (!(a == 1 || a == 2 || a == 16)) PORTD |= 0x80; else PORTD &= 0x7f; // digitalWrite(M3l, (a == 16 || a == 32)); // digitalWrite(M1l, !(a == 1 || a == 4 || a == 16)); // digitalWrite(M2l, !(a == 1 || a == 2 || a == 16)); return a; }
28.944444
59
0.485605
[ "model" ]
6f294735d7cccad3494028afa1b90cecbfb1ec5d
4,756
h
C
Sources/FBClientService/ClientService.h
facebookarchive/ie-toolbar
cfcc1a8ffd6d6c7d8b1e12c8317ff728d2173cac
[ "Apache-2.0" ]
4
2016-05-12T23:53:32.000Z
2021-10-31T15:18:19.000Z
Sources/FBClientService/ClientService.h
facebookarchive/ie-toolbar
cfcc1a8ffd6d6c7d8b1e12c8317ff728d2173cac
[ "Apache-2.0" ]
null
null
null
Sources/FBClientService/ClientService.h
facebookarchive/ie-toolbar
cfcc1a8ffd6d6c7d8b1e12c8317ff728d2173cac
[ "Apache-2.0" ]
3
2015-01-10T18:23:22.000Z
2021-10-31T15:18:10.000Z
/** * Facebook Internet Explorer Toolbar Software License * Copyright (c) 2009 Facebook, Inc. * * Permission is hereby granted, free of charge, to any person or organization * obtaining a copy of the software and accompanying documentation covered by * this license (which, together with any graphical images included with such * software, are collectively referred to below as the "Software") to (a) use, * reproduce, display, distribute, execute, and transmit the Software, (b) * prepare derivative works of the Software (excluding any graphical images * included with the Software, which may not be modified or altered), and (c) * permit third-parties to whom the Software is furnished to do so, all * subject to the following: * * The copyright notices in the Software and this entire statement, including * the above license grant, this restriction and the following disclaimer, * must be included in all copies of the Software, in whole or in part, and * all derivative works of the Software, unless such copies or derivative * works are solely in the form of machine-executable object code generated by * a source language processor. * * Facebook, Inc. retains ownership of the Software and all associated * intellectual property rights. All rights not expressly granted in this * license are reserved by Facebook, Inc. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef CLIENTSERVICE_H #define CLIENTSERVICE_H #include "FBClientService_i.h" #include "IFBClientServiceEvents_CP.h" #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) #error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." #endif #include <memory> namespace facebook{ class ClientServiceImpl; class ATL_NO_VTABLE ClientService : public ATL::CComObjectRootEx<ATL::CComSingleThreadModel>, public ATL::CComCoClass<ClientService, &CLSID_FBClientService>, public ISupportErrorInfo, public ATL::IConnectionPointContainerImpl<ClientService>, public ATL::IDispatchImpl<IFBClientService, &IID_IFBClientService, &LIBID_FBClientServiceLib, 1, 0>, public CProxyIFBClientServiceEvents<ClientService> { // Types private: typedef std::auto_ptr<ClientServiceImpl> ClientServiceImplPtr; // Construction public: ClientService(); // Destruction public: ~ClientService(); // ATL declarations public: DECLARE_CLASSFACTORY_SINGLETON(ClientService) DECLARE_REGISTRY_RESOURCEID(IDR_FBCLIENTSERVICE1) DECLARE_NOT_AGGREGATABLE(ClientService) BEGIN_COM_MAP(ClientService) COM_INTERFACE_ENTRY(IFBClientService) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(ISupportErrorInfo) COM_INTERFACE_ENTRY(IConnectionPointContainer) END_COM_MAP() BEGIN_CONNECTION_POINT_MAP(ClientService) CONNECTION_POINT_ENTRY(__uuidof(IFBClientServiceEvents)) END_CONNECTION_POINT_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() // Interfaces implementations public: STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); STDMETHOD(getPokesCount)(ULONG* pokesCount); STDMETHOD(getMessagesCount)(ULONG* messagesCount); STDMETHOD(getRequestsCount)(ULONG* requestsCount); STDMETHOD(getEventsCount)(ULONG* eventsCount); STDMETHOD(getGroupsInvsCount)(ULONG* groupsInvsCount); STDMETHOD(getUser)(FBUserData* userData); STDMETHOD(getFriends)(SAFEARRAY** usersData); STDMETHOD(login)(ULONG parentWindow); STDMETHOD(logout)(void); STDMETHOD(isLoggedIn)(USHORT* loggedIn); STDMETHOD(setStatus)(BSTR statusMessage); STDMETHOD(canChangeStatus)(USHORT* allowed); STDMETHOD(updateView)(ULONG changeid); STDMETHOD(setSession)(BSTR session); // Methods public: HRESULT FinalConstruct(); void FinalRelease(); void fireUpdates(); // Members private: ClientServiceImplPtr service_; }; OBJECT_ENTRY_AUTO(__uuidof(FBClientService), ClientService) } #endif // CLIENTSERVICE_H
29.91195
472
0.787216
[ "object", "model" ]
6f2a4d70173014959c06cd2a79b63afe65c6f144
891
h
C
macOS_Demo/OpenCV Tests/ImageUtils.h
NeilNie/TEDx_Demo
cd098cc8afb31bd90e103a72445fe20259c85264
[ "Apache-2.0" ]
30
2016-10-27T20:40:22.000Z
2021-01-26T07:27:24.000Z
macOS_Demo/OpenCV Tests/ImageUtils.h
NeilNie/TEDx_Demo
cd098cc8afb31bd90e103a72445fe20259c85264
[ "Apache-2.0" ]
1
2018-03-02T07:33:54.000Z
2018-03-10T20:04:54.000Z
macOS_Demo/OpenCV Tests/ImageUtils.h
NeilNie/TEDx_Demo
cd098cc8afb31bd90e103a72445fe20259c85264
[ "Apache-2.0" ]
7
2016-11-18T10:28:57.000Z
2018-05-14T21:30:40.000Z
// // ImageUtils.h // LogoDetector // // Created by altaibayar tseveenbayar on 15/05/15. // Copyright (c) 2015 altaibayar tseveenbayar. All rights reserved. // #import <Foundation/Foundation.h> #import <Cocoa/Cocoa.h> #include <opencv2/opencv.hpp> @interface ImageUtils : NSObject extern const cv::Scalar RED; extern const cv::Scalar GREEN; extern const cv::Scalar BLUE; extern const cv::Scalar BLACK; extern const cv::Scalar WHITE; extern const cv::Scalar YELLOW; extern const cv::Scalar LIGHT_GRAY; + (cv::Mat) cvMatFromUIImage: (NSImage *) image; + (cv::Mat) cvMatGrayFromUIImage: (NSImage *)image; + (NSImage *) UIImageFromCVMat: (cv::Mat)cvMat; + (cv::Mat) mserToMat: (std::vector<cv::Point> *) mser; + (void) drawMser: (std::vector<cv::Point> *) mser intoImage: (cv::Mat *) image withColor: (cv::Scalar) color; + (std::vector<cv::Point>) maxMser: (cv::Mat *) gray; @end
24.081081
110
0.701459
[ "vector" ]
6f3d4768e91703f9c9125d3afe3393f76257a4c0
606
h
C
mapamok/src/projector.h
lexvandersluijs/ProCamToolkit
6760dcc68a2edeeede3f4d05c0ffd0feef1f3062
[ "MIT" ]
1
2016-09-27T22:28:54.000Z
2016-09-27T22:28:54.000Z
mapamok/src/projector.h
lexvandersluijs/ProCamToolkit
6760dcc68a2edeeede3f4d05c0ffd0feef1f3062
[ "MIT" ]
null
null
null
mapamok/src/projector.h
lexvandersluijs/ProCamToolkit
6760dcc68a2edeeede3f4d05c0ffd0feef1f3062
[ "MIT" ]
null
null
null
#pragma once class projector { public: void initializeFromMesh(ofMesh& mesh); void loadCalibration_interactive(); void loadCalibration_fromConfigFolder(string configFolder); void loadCalibration(string calibFolder); void saveCalibration(string configFolder); void updateCalibration(float aov, int flags, ofRectangle viewport); vector<cv::Point3f> objectPoints; vector<cv::Point2f> imagePoints; vector<bool> referencePoints; string name; cv::Mat rvec, tvec; ofMatrix4x4 modelMatrix; ofxCv::Intrinsics intrinsics; bool calibrationReady; projector() { calibrationReady = false; } };
21.642857
68
0.782178
[ "mesh", "vector" ]
6f42b329970b73812d465f16b16f40727e84609d
74,026
h
C
PWGJE/EMCALJetTasks/AliFJWrapper.h
hzanoli/AliPhysics
1378045736eac0d696943727b18540ba032979c3
[ "BSD-3-Clause" ]
null
null
null
PWGJE/EMCALJetTasks/AliFJWrapper.h
hzanoli/AliPhysics
1378045736eac0d696943727b18540ba032979c3
[ "BSD-3-Clause" ]
null
null
null
PWGJE/EMCALJetTasks/AliFJWrapper.h
hzanoli/AliPhysics
1378045736eac0d696943727b18540ba032979c3
[ "BSD-3-Clause" ]
1
2021-03-25T19:02:31.000Z
2021-03-25T19:02:31.000Z
#ifndef AliFJWrapper_H #define AliFJWrapper_H #include <vector> #include <TString.h> #if !defined(__CINT__) #include "AliLog.h" #include "FJ_includes.h" #include "AliJetShape.h" class AliFJWrapper { public: AliFJWrapper(const char *name, const char *title); virtual ~AliFJWrapper(); virtual void AddInputVector (Double_t px, Double_t py, Double_t pz, Double_t E, Int_t index = -99999); virtual void AddInputVector (const fastjet::PseudoJet& vec, Int_t index = -99999); virtual void AddInputVectors(const std::vector<fastjet::PseudoJet>& vecs, Int_t offsetIndex = -99999); virtual void AddInputGhost (Double_t px, Double_t py, Double_t pz, Double_t E, Int_t index = -99999); virtual const char *ClassName() const { return "AliFJWrapper"; } virtual void Clear(const Option_t* /*opt*/ = ""); virtual void ClearMemory(); virtual void CopySettingsFrom (const AliFJWrapper& wrapper); virtual void GetMedianAndSigma(Double_t& median, Double_t& sigma, Int_t remove = 0) const; fastjet::ClusterSequenceArea* GetClusterSequence() const { return fClustSeq; } fastjet::ClusterSequence* GetClusterSequenceSA() const { return fClustSeqSA; } fastjet::ClusterSequenceActiveAreaExplicitGhosts* GetClusterSequenceGhosts() const { return fClustSeqActGhosts; } const std::vector<fastjet::PseudoJet>& GetInputVectors() const { return fInputVectors; } const std::vector<fastjet::PseudoJet>& GetEventSubInputVectors() const { return fEventSubInputVectors; } const std::vector<fastjet::PseudoJet>& GetInputGhosts() const { return fInputGhosts; } const std::vector<fastjet::PseudoJet>& GetInclusiveJets() const { return fInclusiveJets; } const std::vector<fastjet::PseudoJet>& GetEventSubJets() const { return fEventSubJets; } const std::vector<fastjet::PseudoJet>& GetFilteredJets() const { return fFilteredJets; } std::vector<fastjet::PseudoJet> GetJetConstituents(UInt_t idx) const; std::vector<fastjet::PseudoJet> GetEventSubJetConstituents(UInt_t idx) const; std::vector<fastjet::PseudoJet> GetFilteredJetConstituents(UInt_t idx) const; Double_t GetMedianUsedForBgSubtraction() const { return fMedUsedForBgSub; } const char* GetName() const { return fName; } const char* GetTitle() const { return fTitle; } Double_t GetJetArea (UInt_t idx) const; Double_t GetEventSubJetArea (UInt_t idx) const; fastjet::PseudoJet GetJetAreaVector (UInt_t idx) const; fastjet::PseudoJet GetEventSubJetAreaVector (UInt_t idx) const; Double_t GetFilteredJetArea (UInt_t idx) const; fastjet::PseudoJet GetFilteredJetAreaVector(UInt_t idx) const; Double_t GetJetSubtractedPt (UInt_t idx) const; virtual std::vector<double> GetSubtractedJetsPts(Double_t median_pt = -1, Bool_t sorted = kFALSE); Bool_t GetLegacyMode() { return fLegacyMode; } Bool_t GetDoFilterArea() { return fDoFilterArea; } Double_t NSubjettiness(Int_t N, Int_t Algorithm, Double_t Radius, Double_t Beta, Int_t Option=0, Int_t Measure=0, Double_t Beta_SD=0.0, Double_t ZCut=0.1, Int_t SoftDropOn=0); Double32_t NSubjettinessDerivativeSub(Int_t N, Int_t Algorithm, Double_t Radius, Double_t Beta, Double_t JetR, fastjet::PseudoJet jet, Int_t Option=0, Int_t Measure=0, Double_t Beta_SD=0.0, Double_t ZCut=0.1, Int_t SoftDropOn=0); #ifdef FASTJET_VERSION const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetMass() const {return fGenSubtractorInfoJetMass ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetAngularity() const {return fGenSubtractorInfoJetAngularity ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetpTD() const {return fGenSubtractorInfoJetpTD ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetCircularity() const {return fGenSubtractorInfoJetCircularity ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetSigma2() const {return fGenSubtractorInfoJetSigma2 ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetConstituent() const {return fGenSubtractorInfoJetConstituent ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetLeSub() const {return fGenSubtractorInfoJetLeSub ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet1subjettiness_kt() const {return fGenSubtractorInfoJet1subjettiness_kt ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet2subjettiness_kt() const {return fGenSubtractorInfoJet2subjettiness_kt ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet3subjettiness_kt() const {return fGenSubtractorInfoJet3subjettiness_kt ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetOpeningAngle_kt() const {return fGenSubtractorInfoJetOpeningAngle_kt ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet1subjettiness_ca() const {return fGenSubtractorInfoJet1subjettiness_ca ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet2subjettiness_ca() const {return fGenSubtractorInfoJet2subjettiness_ca ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetOpeningAngle_ca() const {return fGenSubtractorInfoJetOpeningAngle_ca ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet1subjettiness_akt02() const {return fGenSubtractorInfoJet1subjettiness_akt02 ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet2subjettiness_akt02() const {return fGenSubtractorInfoJet2subjettiness_akt02 ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetOpeningAngle_akt02() const {return fGenSubtractorInfoJetOpeningAngle_akt02 ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet1subjettiness_onepassca() const {return fGenSubtractorInfoJet1subjettiness_onepassca ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJet2subjettiness_onepassca() const {return fGenSubtractorInfoJet2subjettiness_onepassca ; } const std::vector<fastjet::contrib::GenericSubtractorInfo> GetGenSubtractorInfoJetOpeningAngle_onepassca() const {return fGenSubtractorInfoJetOpeningAngle_onepassca ; } const std::vector<fastjet::PseudoJet> GetConstituentSubtrJets() const {return fConstituentSubtrJets ; } const std::vector<fastjet::PseudoJet> GetGroomedJets() const {return fGroomedJets ; } Int_t CreateGenSub(); // fastjet::contrib::GenericSubtractor Int_t CreateConstituentSub(); // fastjet::contrib::ConstituentSubtractor Int_t CreateEventConstituentSub(); //fastjet::contrib::ConstituentSubtractor Int_t CreateSoftDrop(); #endif virtual std::vector<double> GetGRNumerator() const { return fGRNumerator ; } virtual std::vector<double> GetGRDenominator() const { return fGRDenominator ; } virtual std::vector<double> GetGRNumeratorSub() const { return fGRNumeratorSub ; } virtual std::vector<double> GetGRDenominatorSub() const { return fGRDenominatorSub ; } virtual void RemoveLastInputVector(); virtual Int_t Run(); virtual Int_t Filter(); virtual void DoGenericSubtraction(const fastjet::FunctionOfPseudoJet<Double32_t>& jetshape, std::vector<fastjet::contrib::GenericSubtractorInfo>& output); virtual Int_t DoGenericSubtractionJetMass(); virtual Int_t DoGenericSubtractionGR(Int_t ijet); virtual Int_t DoGenericSubtractionJetAngularity(); virtual Int_t DoGenericSubtractionJetpTD(); virtual Int_t DoGenericSubtractionJetCircularity(); virtual Int_t DoGenericSubtractionJetSigma2(); virtual Int_t DoGenericSubtractionJetConstituent(); virtual Int_t DoGenericSubtractionJetLeSub(); virtual Int_t DoGenericSubtractionJet1subjettiness_kt(); virtual Int_t DoGenericSubtractionJet2subjettiness_kt(); virtual Int_t DoGenericSubtractionJet3subjettiness_kt(); virtual Int_t DoGenericSubtractionJetOpeningAngle_kt(); virtual Int_t DoGenericSubtractionJet1subjettiness_ca(); virtual Int_t DoGenericSubtractionJet2subjettiness_ca(); virtual Int_t DoGenericSubtractionJetOpeningAngle_ca(); virtual Int_t DoGenericSubtractionJet1subjettiness_akt02(); virtual Int_t DoGenericSubtractionJet2subjettiness_akt02(); virtual Int_t DoGenericSubtractionJetOpeningAngle_akt02(); virtual Int_t DoGenericSubtractionJet1subjettiness_onepassca(); virtual Int_t DoGenericSubtractionJet2subjettiness_onepassca(); virtual Int_t DoGenericSubtractionJetOpeningAngle_onepassca(); virtual Int_t DoConstituentSubtraction(); virtual Int_t DoEventConstituentSubtraction(); virtual Int_t DoSoftDrop(); void SetName(const char* name) { fName = name; } void SetTitle(const char* title) { fTitle = title; } void SetStrategy(const fastjet::Strategy &strat) { fStrategy = strat; } void SetAlgorithm(const fastjet::JetAlgorithm &algor) { fAlgor = algor; } void SetRecombScheme(const fastjet::RecombinationScheme &scheme) { fScheme = scheme; } void SetAreaType(const fastjet::AreaType &atype) { fAreaType = atype; } void SetNRepeats(Int_t nrepeat) { fNGhostRepeats = nrepeat; } void SetGhostArea(Double_t gharea) { fGhostArea = gharea; } void SetMaxRap(Double_t maxrap) { fMaxRap = maxrap; } void SetR(Double_t r) { fR = r; } void SetGridScatter(Double_t gridSc) { fGridScatter = gridSc; } void SetKtScatter(Double_t ktSc) { fKtScatter = ktSc; } void SetMeanGhostKt(Double_t meankt) { fMeanGhostKt = meankt; } void SetPluginAlgor(Int_t plugin) { fPluginAlgor = plugin; } void SetUseArea4Vector(Bool_t useA4v) { fUseArea4Vector = useA4v; } void SetupAlgorithmfromOpt(const char *option); void SetupAreaTypefromOpt(const char *option); void SetupSchemefromOpt(const char *option); void SetupStrategyfromOpt(const char *option); void SetLegacyMode (Bool_t mode) { fLegacyMode ^= mode; } void SetLegacyFJ(); void SetUseExternalBkg(Bool_t b, Double_t rho, Double_t rhom) { fUseExternalBkg = b; fRho = rho; fRhom = rhom;} void SetRMaxAndStep(Double_t rmax, Double_t dr) {fRMax = rmax; fDRStep = dr; } void SetRhoRhom (Double_t rho, Double_t rhom) { fUseExternalBkg = kTRUE; fRho = rho; fRhom = rhom;} // if using rho,rhom then fUseExternalBkg is true void SetMinJetPt(Double_t MinPt) {fMinJetPt=MinPt;} void SetEventSub(Bool_t b) {fEventSub = b;} void SetMaxDelR(Double_t r) {fMaxDelR = r;} void SetAlpha(Double_t a) {fAlpha = a;} protected: TString fName; //! TString fTitle; //! std::vector<fastjet::PseudoJet> fInputVectors; //! std::vector<fastjet::PseudoJet> fEventSubInputVectors; //! std::vector<fastjet::PseudoJet> fEventSubCorrectedVectors; //! std::vector<fastjet::PseudoJet> fInputGhosts; //! std::vector<fastjet::PseudoJet> fInclusiveJets; //! std::vector<fastjet::PseudoJet> fEventSubJets; //! std::vector<fastjet::PseudoJet> fFilteredJets; //! std::vector<double> fSubtractedJetsPt; //! std::vector<fastjet::PseudoJet> fConstituentSubtrJets; //! std::vector<fastjet::PseudoJet> fGroomedJets; //! fastjet::AreaDefinition *fAreaDef; //! fastjet::VoronoiAreaSpec *fVorAreaSpec; //! fastjet::GhostedAreaSpec *fGhostedAreaSpec; //! fastjet::JetDefinition *fJetDef; //! fastjet::JetDefinition::Plugin *fPlugin; //! #ifndef FASTJET_VERSION fastjet::RangeDefinition *fRange; //! #else fastjet::Selector *fRange; //! #endif fastjet::ClusterSequenceArea *fClustSeq; //! fastjet::ClusterSequenceArea *fClustSeqES; //! fastjet::ClusterSequence *fClustSeqSA; //! fastjet::ClusterSequenceActiveAreaExplicitGhosts *fClustSeqActGhosts; //! fastjet::Strategy fStrategy; //! fastjet::JetAlgorithm fAlgor; //! fastjet::RecombinationScheme fScheme; //! fastjet::AreaType fAreaType; //! Int_t fNGhostRepeats; //! Double_t fGhostArea; //! Double_t fMaxRap; //! Double_t fR; //! Double_t fMinJetPt; // no setters for the moment - used default values in the constructor Double_t fGridScatter; //! Double_t fKtScatter; //! Double_t fMeanGhostKt; //! Int_t fPluginAlgor; //! // extra parameters Double_t fMedUsedForBgSub; //! Bool_t fUseArea4Vector; //! // condition to stop the grooming (rejection of soft splitting) z > fZcut theta^fBeta Double_t fZcut; // fZcut = 0.1 Double_t fBeta; // fBeta = 0 Bool_t fEventSub; Double_t fMaxDelR; Double_t fAlpha; #ifdef FASTJET_VERSION fastjet::JetMedianBackgroundEstimator *fBkrdEstimator; //! //from contrib package fastjet::contrib::GenericSubtractor *fGenSubtractor; //! fastjet::contrib::ConstituentSubtractor *fConstituentSubtractor; //! fastjet::contrib::ConstituentSubtractor *fEventConstituentSubtractor; //! fastjet::contrib::SoftDrop *fSoftDrop; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetMass; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoGRNum; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoGRDen; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetAngularity; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetpTD; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetCircularity; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetSigma2; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetConstituent; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetLeSub; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet1subjettiness_kt; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet2subjettiness_kt; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet3subjettiness_kt; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetOpeningAngle_kt; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet1subjettiness_ca; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet2subjettiness_ca; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetOpeningAngle_ca; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet1subjettiness_akt02; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet2subjettiness_akt02; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetOpeningAngle_akt02; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet1subjettiness_onepassca; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJet2subjettiness_onepassca; //! std::vector<fastjet::contrib::GenericSubtractorInfo> fGenSubtractorInfoJetOpeningAngle_onepassca; //! #endif Bool_t fDoFilterArea; //! Bool_t fLegacyMode; //! Bool_t fUseExternalBkg; //! Double_t fRho; // pT background density Double_t fRhom; // mT background density Double_t fRMax; //! Double_t fDRStep; //! std::vector<double> fGRNumerator; //! std::vector<double> fGRDenominator; //! std::vector<double> fGRNumeratorSub; //! std::vector<double> fGRDenominatorSub; //! virtual void SubtractBackground(const Double_t median_pt = -1); private: AliFJWrapper(); AliFJWrapper(const AliFJWrapper& wrapper); AliFJWrapper& operator = (const AliFJWrapper& wrapper); }; #endif /*__CINT__*/ #endif /*AliFJWrapper_H*/ #ifdef AliFJWrapper_CXX #undef AliFJWrapper_CXX #if defined __GNUC__ #pragma GCC system_header #endif namespace fj = fastjet; //_________________________________________________________________________________________________ AliFJWrapper::AliFJWrapper(const char *name, const char *title) : fName (name) , fTitle (title) , fInputVectors ( ) , fEventSubInputVectors ( ) , fEventSubCorrectedVectors ( ) , fInputGhosts ( ) , fInclusiveJets ( ) , fEventSubJets ( ) , fFilteredJets ( ) , fSubtractedJetsPt ( ) , fConstituentSubtrJets ( ) , fGroomedJets ( ) , fAreaDef (0) , fVorAreaSpec (0) , fGhostedAreaSpec (0) , fJetDef (0) , fPlugin (0) , fRange (0) , fClustSeq (0) , fClustSeqES (0) , fClustSeqSA (0) , fClustSeqActGhosts (0) , fStrategy (fj::Best) , fAlgor (fj::kt_algorithm) , fScheme (fj::BIpt_scheme) , fAreaType (fj::active_area) , fNGhostRepeats (1) , fGhostArea (0.005) , fMaxRap (1.) , fR (0.4) , fMinJetPt (0.) , fGridScatter (1.0) , fKtScatter (0.1) , fMeanGhostKt (1e-100) , fPluginAlgor (0) , fMedUsedForBgSub (0) , fUseArea4Vector (kFALSE) , fZcut(0.1) , fBeta(0) , fEventSub (kFALSE) , fMaxDelR (-1) , fAlpha (0) #ifdef FASTJET_VERSION , fBkrdEstimator (0) , fGenSubtractor (0) , fConstituentSubtractor (0) , fEventConstituentSubtractor (0) , fSoftDrop ( ) , fGenSubtractorInfoJetMass ( ) , fGenSubtractorInfoGRNum ( ) , fGenSubtractorInfoGRDen ( ) , fGenSubtractorInfoJetAngularity ( ) , fGenSubtractorInfoJetpTD ( ) , fGenSubtractorInfoJetCircularity( ) , fGenSubtractorInfoJetSigma2() , fGenSubtractorInfoJetConstituent ( ) , fGenSubtractorInfoJetLeSub ( ) , fGenSubtractorInfoJet1subjettiness_kt ( ) , fGenSubtractorInfoJet2subjettiness_kt ( ) , fGenSubtractorInfoJet3subjettiness_kt ( ) , fGenSubtractorInfoJetOpeningAngle_kt ( ) , fGenSubtractorInfoJet1subjettiness_ca ( ) , fGenSubtractorInfoJet2subjettiness_ca ( ) , fGenSubtractorInfoJetOpeningAngle_ca ( ) , fGenSubtractorInfoJet1subjettiness_akt02 ( ) , fGenSubtractorInfoJet2subjettiness_akt02 ( ) , fGenSubtractorInfoJetOpeningAngle_akt02 ( ) , fGenSubtractorInfoJet1subjettiness_onepassca ( ) , fGenSubtractorInfoJet2subjettiness_onepassca ( ) , fGenSubtractorInfoJetOpeningAngle_onepassca ( ) #endif , fDoFilterArea (false) , fLegacyMode (false) , fUseExternalBkg (false) , fRho (0) , fRhom (0) , fRMax(2.) , fDRStep(0.04) , fGRNumerator() , fGRDenominator() , fGRNumeratorSub() , fGRDenominatorSub() { // Constructor. } //_________________________________________________________________________________________________ AliFJWrapper::~AliFJWrapper() { // Destructor. ClearMemory(); } //_________________________________________________________________________________________________ void AliFJWrapper::ClearMemory() { // Destructor. if (fAreaDef) { delete fAreaDef; fAreaDef = NULL; } if (fVorAreaSpec) { delete fVorAreaSpec; fVorAreaSpec = NULL; } if (fGhostedAreaSpec) { delete fGhostedAreaSpec; fGhostedAreaSpec = NULL; } if (fJetDef) { delete fJetDef; fJetDef = NULL; } if (fPlugin) { delete fPlugin; fPlugin = NULL; } if (fRange) { delete fRange; fRange = NULL; } if (fClustSeq) { delete fClustSeq; fClustSeq = NULL; } if (fClustSeqES) { delete fClustSeqES; fClustSeqES = NULL; } if (fClustSeqSA) { delete fClustSeqSA; fClustSeqSA = NULL; } if (fClustSeqActGhosts) { delete fClustSeqActGhosts; fClustSeqActGhosts = NULL; } #ifdef FASTJET_VERSION if (fBkrdEstimator) { delete fBkrdEstimator; fBkrdEstimator = NULL; } if (fGenSubtractor) { delete fGenSubtractor; fGenSubtractor = NULL; } if (fConstituentSubtractor) { delete fConstituentSubtractor; fConstituentSubtractor = NULL; } if (fSoftDrop) { delete fSoftDrop; fSoftDrop = NULL;} #endif } //_________________________________________________________________________________________________ void AliFJWrapper::CopySettingsFrom(const AliFJWrapper& wrapper) { // Copy some settings. // You very often want to keep most of the settings // but change only the algorithm or R - do it after call to this function fStrategy = wrapper.fStrategy; fAlgor = wrapper.fAlgor; fScheme = wrapper.fScheme; fAreaType = wrapper.fAreaType; fNGhostRepeats = wrapper.fNGhostRepeats; fGhostArea = wrapper.fGhostArea; fMaxRap = wrapper.fMaxRap; fR = wrapper.fR; fGridScatter = wrapper.fGridScatter; fKtScatter = wrapper.fKtScatter; fMeanGhostKt = wrapper.fMeanGhostKt; fPluginAlgor = wrapper.fPluginAlgor; fUseArea4Vector = wrapper.fUseArea4Vector; fZcut = wrapper.fZcut; fBeta = wrapper.fBeta; fLegacyMode = wrapper.fLegacyMode; fUseExternalBkg = wrapper.fUseExternalBkg; fRho = wrapper.fRho; fRhom = wrapper.fRhom; } //_________________________________________________________________________________________________ void AliFJWrapper::Clear(const Option_t */*opt*/) { // Simply clear the input vectors. // Make sure done on every event if the instance is reused // Reset the median to zero. fInputVectors.clear(); fEventSubInputVectors.clear(); fInputGhosts.clear(); fMedUsedForBgSub = 0; // for the moment brute force delete everything ClearMemory(); } //_________________________________________________________________________________________________ void AliFJWrapper::RemoveLastInputVector() { // Remove last input vector fInputVectors.pop_back(); fEventSubInputVectors.pop_back(); } //_________________________________________________________________________________________________ void AliFJWrapper::AddInputVector(Double_t px, Double_t py, Double_t pz, Double_t E, Int_t index) { // Make the input pseudojet. fastjet::PseudoJet inVec(px, py, pz, E); // Salvatore Aiola: not sure why this was done... //if (index > -99999) { inVec.set_user_index(index); //} else { //inVec.set_user_index(fInputVectors.size()); //} // add to the fj container of input vectors fInputVectors.push_back(inVec); if(fEventSub) fEventSubInputVectors.push_back(inVec); } //_________________________________________________________________________________________________ void AliFJWrapper::AddInputVector(const fj::PseudoJet& vec, Int_t index) { // Add an input pseudojet. fj::PseudoJet inVec = vec; // Salvatore Aiola: not sure why this was done... ///if (index > -99999) { inVec.set_user_index(index); //} else { //inVec.set_user_index(fInputVectors.size()); //} // add to the fj container of input vectors fInputVectors.push_back(inVec); //if(fEventSub) fEventSubInputVectors.push_back(inVec); } //_________________________________________________________________________________________________ void AliFJWrapper::AddInputVectors(const std::vector<fj::PseudoJet>& vecs, Int_t offsetIndex) { // Add the input from vector of pseudojets. for (UInt_t i = 0; i < vecs.size(); ++i) { fj::PseudoJet inVec = vecs[i]; if (offsetIndex > -99999) inVec.set_user_index(fInputVectors.size() + offsetIndex); // add to the fj container of input vectors fInputVectors.push_back(inVec); } //Is this correct? /* if(fEventSub){ for (UInt_t i = 0; i < vecs.size(); ++i) { fj::PseudoJet inVec = vecs[i]; if (offsetIndex > -99999) inVec.set_user_index(fEventSubInputVectors.size() + offsetIndex); // add to the fj container of input vectors fEventSubInputVectors.push_back(inVec); } }*/ } //_________________________________________________________________________________________________ void AliFJWrapper::AddInputGhost(Double_t px, Double_t py, Double_t pz, Double_t E, Int_t index) { // Make the input pseudojet. fastjet::PseudoJet inVec(px, py, pz, E); if (index > -99999) { inVec.set_user_index(index); } else { inVec.set_user_index(fInputGhosts.size()); } // add to the fj container of input vectors fInputGhosts.push_back(inVec); if (!fDoFilterArea) fDoFilterArea = kTRUE; } //_________________________________________________________________________________________________ Double_t AliFJWrapper::GetJetArea(UInt_t idx) const { // Get the jet area. Double_t retval = -1; // really wrong area.. if ( idx < fInclusiveJets.size() ) { retval = fClustSeq->area(fInclusiveJets[idx]); } else { AliError(Form("[e] ::GetJetArea wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ Double_t AliFJWrapper::GetEventSubJetArea(UInt_t idx) const { // Get the jet area. Double_t retval = -1; // really wrong area.. if ( idx < fEventSubJets.size() ) { retval = fClustSeqES->area(fEventSubJets[idx]); } else { AliError(Form("[e] ::GetJetArea wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ Double_t AliFJWrapper::GetFilteredJetArea(UInt_t idx) const { // Get the filtered jet area. Double_t retval = -1; // really wrong area.. if (fDoFilterArea && fClustSeqActGhosts && (idx<fFilteredJets.size())) { retval = fClustSeqActGhosts->area(fFilteredJets[idx]); } else { AliError(Form("[e] ::GetFilteredJetArea wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ fastjet::PseudoJet AliFJWrapper::GetJetAreaVector(UInt_t idx) const { // Get the jet area as vector. fastjet::PseudoJet retval; if ( idx < fInclusiveJets.size() ) { retval = fClustSeq->area_4vector(fInclusiveJets[idx]); } else { AliError(Form("[e] ::GetJetArea wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ fastjet::PseudoJet AliFJWrapper::GetEventSubJetAreaVector(UInt_t idx) const { // Get the jet area as vector. fastjet::PseudoJet retval; if ( idx < fEventSubJets.size() ) { retval = fClustSeqES->area_4vector(fEventSubJets[idx]); } else { AliError(Form("[e] ::GetJetArea wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ fastjet::PseudoJet AliFJWrapper::GetFilteredJetAreaVector(UInt_t idx) const { // Get the jet area as vector. fastjet::PseudoJet retval; if (fDoFilterArea && fClustSeqActGhosts && (idx<fFilteredJets.size())) { retval = fClustSeqActGhosts->area_4vector(fFilteredJets[idx]); } else { AliError(Form("[e] ::GetFilteredJetArea wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ std::vector<double> AliFJWrapper::GetSubtractedJetsPts(Double_t median_pt, Bool_t sorted) { // Get subtracted jets pTs, returns vector. SubtractBackground(median_pt); if (kTRUE == sorted) { std::sort(fSubtractedJetsPt.begin(), fSubtractedJetsPt.begin()); } return fSubtractedJetsPt; } //_________________________________________________________________________________________________ Double_t AliFJWrapper::GetJetSubtractedPt(UInt_t idx) const { // Get subtracted jets pTs, returns Double_t. Double_t retval = -99999.; // really wrong pt.. if ( idx < fSubtractedJetsPt.size() ) { retval = fSubtractedJetsPt[idx]; } return retval; } //_________________________________________________________________________________________________ std::vector<fastjet::PseudoJet> AliFJWrapper::GetJetConstituents(UInt_t idx) const { // Get jets constituents. std::vector<fastjet::PseudoJet> retval; if ( idx < fInclusiveJets.size() ) { retval = fClustSeq->constituents(fInclusiveJets[idx]); } else { AliError(Form("[e] ::GetJetConstituents wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ std::vector<fastjet::PseudoJet> AliFJWrapper::GetEventSubJetConstituents(UInt_t idx) const { // Get jets constituents. std::vector<fastjet::PseudoJet> retval; if ( idx < fEventSubJets.size() ) { retval = fClustSeqES->constituents(fEventSubJets[idx]); } else { AliError(Form("[e] ::GetJetConstituents wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ std::vector<fastjet::PseudoJet> AliFJWrapper::GetFilteredJetConstituents(UInt_t idx) const { // Get jets constituents. std::vector<fastjet::PseudoJet> retval; if ( idx < fFilteredJets.size() ) { if (fClustSeqSA) retval = fClustSeqSA->constituents(fFilteredJets[idx]); if (fClustSeqActGhosts) retval = fClustSeqActGhosts->constituents(fFilteredJets[idx]); } else { AliError(Form("[e] ::GetFilteredJetConstituents wrong index: %d",idx)); } return retval; } //_________________________________________________________________________________________________ void AliFJWrapper::GetMedianAndSigma(Double_t &median, Double_t &sigma, Int_t remove) const { // Get the median and sigma from fastjet. // User can also do it on his own because the cluster sequence is exposed (via a getter) if (!fClustSeq) { AliError("[e] Run the jfinder first."); return; } Double_t mean_area = 0; try { if(0 == remove) { fClustSeq->get_median_rho_and_sigma(*fRange, fUseArea4Vector, median, sigma, mean_area); } else { std::vector<fastjet::PseudoJet> input_jets = sorted_by_pt(fClustSeq->inclusive_jets()); input_jets.erase(input_jets.begin(), input_jets.begin() + remove); fClustSeq->get_median_rho_and_sigma(input_jets, *fRange, fUseArea4Vector, median, sigma, mean_area); input_jets.clear(); } } catch (fj::Error) { AliError(" [w] FJ Exception caught."); median = -1.; sigma = -1; } } //_________________________________________________________________________________________________ Int_t AliFJWrapper::Run() { // Run the actual jet finder. if (fAreaType == fj::voronoi_area) { // Rfact - check dependence - default is 1. // NOTE: hardcoded variable! fVorAreaSpec = new fj::VoronoiAreaSpec(1.); fAreaDef = new fj::AreaDefinition(*fVorAreaSpec); } else { fGhostedAreaSpec = new fj::GhostedAreaSpec(fMaxRap, fNGhostRepeats, fGhostArea, fGridScatter, fKtScatter, fMeanGhostKt); fAreaDef = new fj::AreaDefinition(*fGhostedAreaSpec, fAreaType); } // this is acceptable by fastjet: #ifndef FASTJET_VERSION fRange = new fj::RangeDefinition(fMaxRap - 0.95 * fR); #else fRange = new fj::Selector(fj::SelectorAbsRapMax(fMaxRap - 0.95 * fR)); #endif if (fAlgor == fj::plugin_algorithm) { if (fPluginAlgor == 0) { // SIS CONE ALGOR // NOTE: hardcoded split parameter Double_t overlap_threshold = 0.75; // NOTE: this actually splits a lot: thr/min(pt1,pt2) fPlugin = new fj::SISConePlugin(fR, overlap_threshold, 0, //search of stable cones - zero = until no more 1.0); // this should be seed effectively for proto jets fJetDef = new fastjet::JetDefinition(fPlugin); } else if (fPluginAlgor == 1) { // CDF cone // NOTE: hardcoded split parameter Double_t overlap_threshold = 0.75; // NOTE: this actually splits a lot: thr/min(pt1,pt2) fPlugin = new fj::CDFMidPointPlugin(fR, overlap_threshold, 1.0, //search of stable cones - zero = until no more 1.0); // this should be seed effectively for proto jets fJetDef = new fastjet::JetDefinition(fPlugin); } else { AliError("[e] Unrecognized plugin number!"); } } else { fJetDef = new fj::JetDefinition(fAlgor, fR, fScheme, fStrategy); } try { fClustSeq = new fj::ClusterSequenceArea(fInputVectors, *fJetDef, *fAreaDef); if(fEventSub){ DoEventConstituentSubtraction(); fClustSeqES = new fj::ClusterSequenceArea(fEventSubCorrectedVectors, *fJetDef, *fAreaDef); } } catch (fj::Error) { AliError(" [w] FJ Exception caught."); return -1; } // FJ3 :: Define an JetMedianBackgroundEstimator just in case it will be used #ifdef FASTJET_VERSION fBkrdEstimator = new fj::JetMedianBackgroundEstimator(fj::SelectorAbsRapMax(fMaxRap)); #endif if (fLegacyMode) { SetLegacyFJ(); } // for FJ 2.x even if fLegacyMode is set, SetLegacyFJ is dummy // inclusive jets: fInclusiveJets.clear(); fEventSubJets.clear(); fInclusiveJets = fClustSeq->inclusive_jets(0.0); if(fEventSub) fEventSubJets = fClustSeqES->inclusive_jets(0.0); return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::Filter() { // // AliFJWrapper::Filter // fJetDef = new fj::JetDefinition(fAlgor, fR, fScheme, fStrategy); if (fDoFilterArea) { if (fInputGhosts.size()>0) { try { fClustSeqActGhosts = new fj::ClusterSequenceActiveAreaExplicitGhosts(fInputVectors, *fJetDef, fInputGhosts, fGhostArea); } catch (fj::Error) { AliError(" [w] FJ Exception caught."); return -1; } fFilteredJets.clear(); fFilteredJets = fClustSeqActGhosts->inclusive_jets(0.0); } else { return -1; } } else { try { fClustSeqSA = new fastjet::ClusterSequence(fInputVectors, *fJetDef); } catch (fj::Error) { AliError(" [w] FJ Exception caught."); return -1; } fFilteredJets.clear(); fFilteredJets = fClustSeqSA->inclusive_jets(0.0); } return 0; } //_________________________________________________________________________________________________ void AliFJWrapper::SetLegacyFJ() { // This methods enable legacy behaviour (FastJet 2.x) when AliROOT is compiled with FastJet 3.x #ifdef FASTJET_VERSION std::cout << "WARNING! Setting FastJet in legacy mode" << std::endl; if (fGhostedAreaSpec) { fGhostedAreaSpec->set_fj2_placement(kTRUE); } if (fBkrdEstimator) { fBkrdEstimator->set_provide_fj2_sigma(kTRUE); fBkrdEstimator->set_use_area_4vector(kFALSE); } #endif } //_________________________________________________________________________________________________ void AliFJWrapper::SubtractBackground(Double_t median_pt) { // Subtract the background (specify the value - see below the meaning). // Negative argument means the bg will be determined with the current algorithm // this is the default behavior. Zero is allowed // Note: user may set the switch for area4vector based subtraction. Double_t median = 0; Double_t sigma = 0; Double_t mean_area = 0; // clear the subtracted jet pt's vector<double> fSubtractedJetsPt.clear(); // check what was specified (default is -1) if (median_pt < 0) { try { fClustSeq->get_median_rho_and_sigma(*fRange, fUseArea4Vector, median, sigma, mean_area); } catch (fj::Error) { AliError(" [w] FJ Exception caught."); median = -9999.; sigma = -1; fMedUsedForBgSub = median; return; } fMedUsedForBgSub = median; } else { // we do not know the sigma in this case sigma = -1; if (0.0 == median_pt) { // AliWarning(Form(" [w] Median specified for bg subtraction is ZERO: %f", median_pt )) << endl; fMedUsedForBgSub = 0.; } else { fMedUsedForBgSub = median_pt; } } // subtract: for (unsigned i = 0; i < fInclusiveJets.size(); i++) { if ( fUseArea4Vector ) { // subtract the background using the area4vector fj::PseudoJet area4v = fClustSeq->area_4vector(fInclusiveJets[i]); fj::PseudoJet jet_sub = fInclusiveJets[i] - area4v * fMedUsedForBgSub; fSubtractedJetsPt.push_back(jet_sub.perp()); // here we put only the pt of the jet - note: this can be negative } else { // subtract the background using scalars // fj::PseudoJet jet_sub = fInclusiveJets[i] - area * fMedUsedForBgSub_; Double_t area = fClustSeq->area(fInclusiveJets[i]); // standard subtraction Double_t pt_sub = fInclusiveJets[i].perp() - fMedUsedForBgSub * area; fSubtractedJetsPt.push_back(pt_sub); // here we put only the pt of the jet - note: this can be negative } } } //_________________________________________________________________________________________________ void AliFJWrapper::DoGenericSubtraction(const fastjet::FunctionOfPseudoJet<Double32_t>& jetshape, std::vector<fastjet::contrib::GenericSubtractorInfo>& output) { //Do generic subtraction for 1subjettiness #ifdef FASTJET_VERSION CreateGenSub(); // clear the generic subtractor info vector output.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::contrib::GenericSubtractorInfo info_jetshape; if(fInclusiveJets[i].perp()>1.e-4) double subtracted_shape = (*fGenSubtractor)(jetshape, fInclusiveJets[i], info_jetshape); output.push_back(info_jetshape); } #endif } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetMass() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION CreateGenSub(); // Define jet shape AliJetShapeMass shapeMass; // clear the generic subtractor info vector fGenSubtractorInfoJetMass.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::contrib::GenericSubtractorInfo info; if(fInclusiveJets[i].perp()>1.e-4) double subtracted_shape = (*fGenSubtractor)(shapeMass, fInclusiveJets[i], info); fGenSubtractorInfoJetMass.push_back(info); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionGR(Int_t ijet) { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION CreateGenSub(); if(ijet>fInclusiveJets.size()) return 0; fGRNumerator.clear(); fGRDenominator.clear(); fGRNumeratorSub.clear(); fGRDenominatorSub.clear(); // Define jet shape for(Double_t r = 0.; r<fRMax; r+=fDRStep) { AliJetShapeGRNum shapeGRNum(r,fDRStep); AliJetShapeGRDen shapeGRDen(r,fDRStep); // clear the generic subtractor info vector fGenSubtractorInfoGRNum.clear(); fGenSubtractorInfoGRDen.clear(); fj::contrib::GenericSubtractorInfo infoNum; fj::contrib::GenericSubtractorInfo infoDen; if(fInclusiveJets[ijet].perp()>1.e-4) { double sub_num = (*fGenSubtractor)(shapeGRNum, fInclusiveJets[ijet], infoNum); double sub_den = (*fGenSubtractor)(shapeGRDen, fInclusiveJets[ijet], infoDen); } fGenSubtractorInfoGRNum.push_back(infoNum); fGenSubtractorInfoGRDen.push_back(infoDen); fGRNumerator.push_back(infoNum.unsubtracted()); fGRDenominator.push_back(infoDen.unsubtracted()); fGRNumeratorSub.push_back(infoNum.second_order_subtracted()); fGRDenominatorSub.push_back(infoDen.second_order_subtracted()); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetAngularity() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION CreateGenSub(); // Define jet shape AliJetShapeAngularity shapeAngularity; // clear the generic subtractor info vector fGenSubtractorInfoJetAngularity.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::contrib::GenericSubtractorInfo infoAng; if(fInclusiveJets[i].perp()>1.e-4) double subtracted_shape = (*fGenSubtractor)(shapeAngularity, fInclusiveJets[i], infoAng); fGenSubtractorInfoJetAngularity.push_back(infoAng); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetpTD() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION CreateGenSub(); // Define jet shape AliJetShapepTD shapepTD; // clear the generic subtractor info vector fGenSubtractorInfoJetpTD.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::contrib::GenericSubtractorInfo infopTD; if(fInclusiveJets[i].perp()>1.e-4) double subtracted_shape = (*fGenSubtractor)(shapepTD, fInclusiveJets[i], infopTD); fGenSubtractorInfoJetpTD.push_back(infopTD); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetCircularity() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION CreateGenSub(); // Define jet shape AliJetShapeCircularity shapecircularity; // clear the generic subtractor info vector fGenSubtractorInfoJetCircularity.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::contrib::GenericSubtractorInfo infoCirc; if(fInclusiveJets[i].perp()>1.e-4) double subtracted_shape = (*fGenSubtractor)(shapecircularity, fInclusiveJets[i], infoCirc); fGenSubtractorInfoJetCircularity.push_back(infoCirc); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetSigma2() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION CreateGenSub(); // Define jet shape AliJetShapeSigma2 shapesigma2; // clear the generic subtractor info vector fGenSubtractorInfoJetSigma2.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::contrib::GenericSubtractorInfo infoSigma; if(fInclusiveJets[i].perp()>1.e-4) double subtracted_shape = (*fGenSubtractor)(shapesigma2, fInclusiveJets[i], infoSigma); fGenSubtractorInfoJetSigma2.push_back(infoSigma); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetConstituent() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION CreateGenSub(); // Define jet shape AliJetShapeConstituent shapeconst; // clear the generic subtractor info vector fGenSubtractorInfoJetConstituent.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::contrib::GenericSubtractorInfo infoConst; if(fInclusiveJets[i].perp()>1.e-4) double subtracted_shape = (*fGenSubtractor)(shapeconst, fInclusiveJets[i], infoConst); fGenSubtractorInfoJetConstituent.push_back(infoConst); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetLeSub() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION CreateGenSub(); // Define jet shape AliJetShapeLeSub shapeLeSub; // clear the generic subtractor info vector fGenSubtractorInfoJetLeSub.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::contrib::GenericSubtractorInfo infoLeSub; if(fInclusiveJets[i].perp()>1.e-4) double subtracted_shape = (*fGenSubtractor)(shapeLeSub, fInclusiveJets[i], infoLeSub); fGenSubtractorInfoJetLeSub.push_back(infoLeSub); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet1subjettiness_kt() { //Do generic subtraction for 1subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape1subjettiness_kt shape1subjettiness_kt; DoGenericSubtraction(shape1subjettiness_kt, fGenSubtractorInfoJet1subjettiness_kt); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet2subjettiness_kt() { //Do generic subtraction for 2subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape2subjettiness_kt shape2subjettiness_kt; DoGenericSubtraction(shape2subjettiness_kt, fGenSubtractorInfoJet2subjettiness_kt); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet3subjettiness_kt() { //Do generic subtraction for 3subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape3subjettiness_kt shape3subjettiness_kt; DoGenericSubtraction(shape3subjettiness_kt, fGenSubtractorInfoJet3subjettiness_kt); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetOpeningAngle_kt() { //Do generic subtraction for 2subjettiness axes opening angle #ifdef FASTJET_VERSION // Define jet shape AliJetShapeOpeningAngle_kt shapeOpeningAngle_kt; DoGenericSubtraction(shapeOpeningAngle_kt, fGenSubtractorInfoJetOpeningAngle_kt); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet1subjettiness_ca() { //Do generic subtraction for 1subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape1subjettiness_ca shape1subjettiness_ca; DoGenericSubtraction(shape1subjettiness_ca, fGenSubtractorInfoJet1subjettiness_ca); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet2subjettiness_ca() { //Do generic subtraction for 2subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape2subjettiness_ca shape2subjettiness_ca; DoGenericSubtraction(shape2subjettiness_ca, fGenSubtractorInfoJet2subjettiness_ca); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetOpeningAngle_ca() { //Do generic subtraction for 2subjettiness axes opening angle #ifdef FASTJET_VERSION // Define jet shape AliJetShapeOpeningAngle_ca shapeOpeningAngle_ca; DoGenericSubtraction(shapeOpeningAngle_ca, fGenSubtractorInfoJetOpeningAngle_ca); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet1subjettiness_akt02() { //Do generic subtraction for 1subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape1subjettiness_akt02 shape1subjettiness_akt02; DoGenericSubtraction(shape1subjettiness_akt02, fGenSubtractorInfoJet1subjettiness_akt02); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet2subjettiness_akt02() { //Do generic subtraction for 2subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape2subjettiness_akt02 shape2subjettiness_akt02; DoGenericSubtraction(shape2subjettiness_akt02, fGenSubtractorInfoJet2subjettiness_akt02); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetOpeningAngle_akt02() { //Do generic subtraction for 2subjettiness axes opening angle #ifdef FASTJET_VERSION // Define jet shape AliJetShapeOpeningAngle_akt02 shapeOpeningAngle_akt02; DoGenericSubtraction(shapeOpeningAngle_akt02, fGenSubtractorInfoJetOpeningAngle_akt02); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet1subjettiness_onepassca() { //Do generic subtraction for 1subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape1subjettiness_onepassca shape1subjettiness_onepassca; DoGenericSubtraction(shape1subjettiness_onepassca, fGenSubtractorInfoJet1subjettiness_onepassca); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJet2subjettiness_onepassca() { //Do generic subtraction for 2subjettiness #ifdef FASTJET_VERSION // Define jet shape AliJetShape2subjettiness_onepassca shape2subjettiness_onepassca; DoGenericSubtraction(shape2subjettiness_onepassca, fGenSubtractorInfoJet2subjettiness_onepassca); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoGenericSubtractionJetOpeningAngle_onepassca() { //Do generic subtraction for 2subjettiness axes opening angle #ifdef FASTJET_VERSION // Define jet shape AliJetShapeOpeningAngle_onepassca shapeOpeningAngle_onepassca; DoGenericSubtraction(shapeOpeningAngle_onepassca, fGenSubtractorInfoJetOpeningAngle_onepassca); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoConstituentSubtraction() { //Do constituent subtraction #ifdef FASTJET_VERSION CreateConstituentSub(); // fConstituentSubtractor->set_alpha(/* double alpha */); // fConstituentSubtractor->set_max_deltaR(/* double max_deltaR */); //clear constituent subtracted jets fConstituentSubtrJets.clear(); for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::PseudoJet subtracted_jet(0.,0.,0.,0.); if(fInclusiveJets[i].perp()>0.) subtracted_jet = (*fConstituentSubtractor)(fInclusiveJets[i]); fConstituentSubtrJets.push_back(subtracted_jet); } if(fConstituentSubtractor) { delete fConstituentSubtractor; fConstituentSubtractor = NULL; } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoEventConstituentSubtraction() { //Do constituent subtraction #ifdef FASTJET_VERSION CreateEventConstituentSub(); fEventSubCorrectedVectors = fEventConstituentSubtractor->subtract_event(fEventSubInputVectors,fMaxRap); //second argument max rap? //clear constituent subtracted jets if(fEventConstituentSubtractor) { delete fEventConstituentSubtractor; fEventConstituentSubtractor = NULL; } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::DoSoftDrop() { //Do grooming #ifdef FASTJET_VERSION CreateSoftDrop(); //clear groomed jets fGroomedJets.clear(); //fastjet::Subtractor fjsub (fBkrdEstimator); //fSoftDrop->set_subtractor(&fjsub); //fSoftDrop->set_input_jet_is_subtracted(false); //?? for (unsigned i = 0; i < fInclusiveJets.size(); i++) { fj::PseudoJet groomed_jet(0.,0.,0.,0.); if(fInclusiveJets[i].perp()>0.){ groomed_jet = (*fSoftDrop)(fInclusiveJets[i]); groomed_jet.set_user_index(i); //index of the corresponding inclusve jet if(groomed_jet!=0) fGroomedJets.push_back(groomed_jet); } } if(fSoftDrop) { delete fSoftDrop; fSoftDrop = NULL; } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::CreateSoftDrop() { //Do grooming #ifdef FASTJET_VERSION if (fSoftDrop) { delete fSoftDrop; } // protect against memory leaks fSoftDrop = new fj::contrib::SoftDrop(fBeta,fZcut); fSoftDrop->set_verbose_structure(kTRUE); #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::CreateGenSub() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION if (fGenSubtractor) { delete fGenSubtractor; } // protect against memory leaks if (fUseExternalBkg) { fGenSubtractor = new fj::contrib::GenericSubtractor(fRho,fRhom); } else { fGenSubtractor = new fj::contrib::GenericSubtractor(fBkrdEstimator); #if FASTJET_VERSION_NUMBER >= 30100 fGenSubtractor->set_common_bge_for_rho_and_rhom(); // see contrib 1.020 GenericSubtractor.hh line 62 #endif } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::CreateConstituentSub() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION if (fConstituentSubtractor) { delete fConstituentSubtractor; } // protect against memory leaks // see ConstituentSubtractor.hh signatures // ConstituentSubtractor(double rho, double rhom=0, double alpha=0, double maxDeltaR=-1) if (fUseExternalBkg) { fConstituentSubtractor = new fj::contrib::ConstituentSubtractor(fRho,fRhom,fAlpha,fMaxDelR); } else { fConstituentSubtractor = new fj::contrib::ConstituentSubtractor(fBkrdEstimator); } #endif return 0; } //_________________________________________________________________________________________________ Int_t AliFJWrapper::CreateEventConstituentSub() { //Do generic subtraction for jet mass #ifdef FASTJET_VERSION if (fEventConstituentSubtractor) { delete fEventConstituentSubtractor; } // protect against memory leaks // see ConstituentSubtractor.hh signatures // ConstituentSubtractor(double rho, double rhom=0, double alpha=0, double maxDeltaR=-1) if (fUseExternalBkg) fEventConstituentSubtractor = new fj::contrib::ConstituentSubtractor(fRho,fRhom,fAlpha,fMaxDelR); else fEventConstituentSubtractor = new fj::contrib::ConstituentSubtractor(fBkrdEstimator); #endif return 0; } //_________________________________________________________________________________________________ void AliFJWrapper::SetupAlgorithmfromOpt(const char *option) { // Setup algorithm from char. std::string opt(option); if (!opt.compare("kt")) fAlgor = fj::kt_algorithm; if (!opt.compare("antikt")) fAlgor = fj::antikt_algorithm; if (!opt.compare("cambridge")) fAlgor = fj::cambridge_algorithm; if (!opt.compare("genkt")) fAlgor = fj::genkt_algorithm; if (!opt.compare("cambridge_passive")) fAlgor = fj::cambridge_for_passive_algorithm; if (!opt.compare("genkt_passive")) fAlgor = fj::genkt_for_passive_algorithm; if (!opt.compare("ee_kt")) fAlgor = fj::ee_kt_algorithm; if (!opt.compare("ee_genkt")) fAlgor = fj::ee_genkt_algorithm; if (!opt.compare("plugin")) fAlgor = fj::plugin_algorithm; } //_________________________________________________________________________________________________ void AliFJWrapper::SetupAreaTypefromOpt(const char *option) { // Setup area type from char. std::string opt(option); if (!opt.compare("active")) fAreaType = fj::active_area; if (!opt.compare("invalid")) fAreaType = fj::invalid_area; if (!opt.compare("active_area_explicit_ghosts")) fAreaType = fj::active_area_explicit_ghosts; if (!opt.compare("one_ghost_passive")) fAreaType = fj::one_ghost_passive_area; if (!opt.compare("passive")) fAreaType = fj::passive_area; if (!opt.compare("voronoi")) fAreaType = fj::voronoi_area; } //_________________________________________________________________________________________________ void AliFJWrapper::SetupSchemefromOpt(const char *option) { // // setup scheme from char // std::string opt(option); if (!opt.compare("BIpt")) fScheme = fj::BIpt_scheme; if (!opt.compare("BIpt2")) fScheme = fj::BIpt2_scheme; if (!opt.compare("E")) fScheme = fj::E_scheme; if (!opt.compare("pt")) fScheme = fj::pt_scheme; if (!opt.compare("pt2")) fScheme = fj::pt2_scheme; if (!opt.compare("Et")) fScheme = fj::Et_scheme; if (!opt.compare("Et2")) fScheme = fj::Et2_scheme; } //_________________________________________________________________________________________________ void AliFJWrapper::SetupStrategyfromOpt(const char *option) { // Setup strategy from char. std::string opt(option); if (!opt.compare("Best")) fStrategy = fj::Best; if (!opt.compare("N2MinHeapTiled")) fStrategy = fj::N2MinHeapTiled; if (!opt.compare("N2Tiled")) fStrategy = fj::N2Tiled; if (!opt.compare("N2PoorTiled")) fStrategy = fj::N2PoorTiled; if (!opt.compare("N2Plain")) fStrategy = fj::N2Plain; if (!opt.compare("N3Dumb")) fStrategy = fj::N3Dumb; if (!opt.compare("NlnN")) fStrategy = fj::NlnN; if (!opt.compare("NlnN3pi")) fStrategy = fj::NlnN3pi; if (!opt.compare("NlnN4pi")) fStrategy = fj::NlnN4pi; if (!opt.compare("NlnNCam4pi")) fStrategy = fj::NlnNCam4pi; if (!opt.compare("NlnNCam2pi2R")) fStrategy = fj::NlnNCam2pi2R; if (!opt.compare("NlnNCam")) fStrategy = fj::NlnNCam; if (!opt.compare("plugin")) fStrategy = fj::plugin_strategy; } Double_t AliFJWrapper::NSubjettiness(Int_t N, Int_t Algorithm, Double_t Radius, Double_t Beta, Int_t Option, Int_t Measure, Double_t Beta_SD, Double_t ZCut, Int_t SoftDropOn){ //Option 0=Nsubjettiness result, 1=opening angle between axes in Eta-Phi plane, 2=Distance between axes in Eta-Phi plane fJetDef = new fj::JetDefinition(fAlgor, fR*2, fScheme, fStrategy ); //the *2 is becasue of a handful of jets that end up missing a track for some reason. try { fClustSeqSA = new fastjet::ClusterSequence(fInputVectors, *fJetDef); // ClustSeqSA = new fastjet::ClusterSequenceArea(fInputVectors, *fJetDef, *fAreaDef); } catch (fj::Error) { AliError(" [w] FJ Exception caught."); return -1; } fFilteredJets.clear(); fFilteredJets = fClustSeqSA->inclusive_jets(fMinJetPt-0.1); //becasue this is < not <= Double_t Result=-1; Double_t Result_SoftDrop=-1; std::vector<fastjet::PseudoJet> SubJet_Axes; //this is actually not subjet axis...but just axis fj::PseudoJet SubJet1_Axis; fj::PseudoJet SubJet2_Axis; std::vector<fastjet::PseudoJet> SubJets; fj::PseudoJet SubJet1; fj::PseudoJet SubJet2; if (Option==3 || Option==4 || SoftDropOn==1){ //Added for quality control of the DeltaR-Nsubjettiness variable (comparing Nsubjettiness and soft drop results) Beta_SD=0.0; //change these later so they are actually variable. currently not variable due to Kine trains ZCut=0.1; fj::contrib::SoftDrop Soft_Drop(Beta_SD,ZCut); //Soft_Drop.set_tagging_mode(); //if the first two subjets fail the soft drop criteria a jet = 0 is returned----clarify what this actually is fj::PseudoJet Soft_Dropped_Jet=Soft_Drop(fFilteredJets[0]); if (Soft_Dropped_Jet==0) Result_SoftDrop=-3; else{ if (Soft_Dropped_Jet.constituents().size()>1){ if (Option==3) Result_SoftDrop=Soft_Dropped_Jet.structure_of<fj::contrib::SoftDrop>().delta_R(); else if (Option==4) Result_SoftDrop=Soft_Dropped_Jet.structure_of<fj::contrib::SoftDrop>().symmetry(); } if (SoftDropOn==1 && Soft_Dropped_Jet.constituents().size()>=N) fFilteredJets[0]=Soft_Dropped_Jet; else if (SoftDropOn==1 && Soft_Dropped_Jet.constituents().size()<N) return -1; } } Beta = 1.0; fR=0.4; if (Algorithm==0){ if (Measure==0){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::KT_Axes(), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Measure==1){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::KT_Axes(), fj::contrib::UnnormalizedMeasure(Beta)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } } else if (Algorithm==1) { fj::contrib::Nsubjettiness nSub(N, fj::contrib::CA_Axes(), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==2){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::AntiKT_Axes(Radius), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==3) { fj::contrib::Nsubjettiness nSub(N, fj::contrib::WTA_KT_Axes(), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==4) { fj::contrib::Nsubjettiness nSub(N, fj::contrib::WTA_CA_Axes(), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==5){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_KT_Axes(), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==6){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_CA_Axes(), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==7){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_AntiKT_Axes(Radius), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==8){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_WTA_KT_Axes(), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==9){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_WTA_CA_Axes(), fj::contrib::NormalizedMeasure(Beta,fR)); Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } else if (Algorithm==10){ //fj::contrib::Nsubjettiness nSub(N, fj::contrib::MultiPass_Axes(100), fj::contrib::NormalizedMeasure(Beta,fR)); fj::contrib::Nsubjettiness nSub(N, fj::contrib::MultiPass_Axes(100), fj::contrib::NormalizedCutoffMeasure(Beta,fR,10.0)); //testing for KineTrain Result= nSub.result(fFilteredJets[0]); SubJet_Axes=nSub.currentAxes(); SubJets=nSub.currentSubjets(); } SubJet1_Axis=SubJet_Axes[0]; Double_t SubJet1_Eta=SubJet1_Axis.pseudorapidity(); Double_t SubJet2_Eta=0.0; Double_t SubJet1_Phi=SubJet1_Axis.phi(); if(SubJet1_Phi < -1*TMath::Pi()) SubJet1_Phi += (2*TMath::Pi()); else if (SubJet1_Phi > TMath::Pi()) SubJet1_Phi -= (2*TMath::Pi()); Double_t SubJet2_Phi=0.0; Double_t DeltaPhi=-5; if (SubJet_Axes.size()>1){ SubJet2_Axis=SubJet_Axes[1]; SubJet2_Eta=SubJet2_Axis.pseudorapidity(); SubJet2_Phi=SubJet2_Axis.phi(); if(SubJet2_Phi < -1*TMath::Pi()) SubJet2_Phi += (2*TMath::Pi()); else if (SubJet2_Phi > TMath::Pi()) SubJet2_Phi -= (2*TMath::Pi()); DeltaPhi=SubJet1_Phi-SubJet2_Phi; if(DeltaPhi < -1*TMath::Pi()) DeltaPhi += (2*TMath::Pi()); else if (DeltaPhi > TMath::Pi()) DeltaPhi -= (2*TMath::Pi()); } SubJet1=SubJets[0]; Double_t SubJet1Eta=SubJet1.pseudorapidity(); Double_t SubJet2Eta=0.0; Double_t SubJet1Phi=SubJet1.phi(); if(SubJet1Phi < -1*TMath::Pi()) SubJet1Phi += (2*TMath::Pi()); else if (SubJet1Phi > TMath::Pi()) SubJet1Phi -= (2*TMath::Pi()); Double_t SubJet2Phi=0.0; Double_t DeltaPhiSubJets=-5; Double_t SubJet1LeadingTrackPt=-3.0; Double_t SubJet2LeadingTrackPt=-3.0; std::vector<fj::PseudoJet> SubJet1Tracks = SubJet1.constituents(); for (Int_t i=0; i<SubJet1Tracks.size(); i++){ if (SubJet1Tracks[i].perp() > SubJet1LeadingTrackPt) SubJet1LeadingTrackPt=SubJet1Tracks[i].perp(); } if (SubJet_Axes.size()>1){ SubJet2=SubJets[1]; SubJet2Eta=SubJet2.pseudorapidity(); SubJet2Phi=SubJet2.phi(); if(SubJet2Phi < -1*TMath::Pi()) SubJet2Phi += (2*TMath::Pi()); else if (SubJet2Phi > TMath::Pi()) SubJet2Phi -= (2*TMath::Pi()); DeltaPhiSubJets=SubJet1Phi-SubJet2Phi; if(DeltaPhiSubJets < -1*TMath::Pi()) DeltaPhiSubJets += (2*TMath::Pi()); else if (DeltaPhiSubJets > TMath::Pi()) DeltaPhiSubJets -= (2*TMath::Pi()); std::vector<fj::PseudoJet> SubJet2Tracks = SubJet2.constituents(); for (Int_t i=0; i<SubJet2Tracks.size(); i++){ if (SubJet2Tracks[i].perp() > SubJet2LeadingTrackPt) SubJet2LeadingTrackPt=SubJet2Tracks[i].perp(); } } if (Option==0) return Result; else if (Option==1 && SubJet_Axes.size()>1 && N==2) return TMath::Sqrt(TMath::Power(SubJet1_Eta-SubJet2_Eta,2)+TMath::Power(DeltaPhi,2)); else if (Option==2 && SubJet_Axes.size()>1 && N==2) return TMath::Sqrt(TMath::Power(SubJet1_Eta-SubJet2_Eta,2)+TMath::Power(DeltaPhi,2)); else if ((Option==3 || Option==4) && N==2) return Result_SoftDrop; else if (Option==5 && SubJets.size()>1 && N==2) return SubJet1.perp(); else if (Option==6 && SubJets.size()>1 && N==2) return SubJet2.perp(); else if (Option==7 && SubJets.size()>1 && N==2) return TMath::Sqrt(TMath::Power(SubJet1Eta-SubJet2Eta,2)+TMath::Power(DeltaPhiSubJets,2)); else if (Option==8 && SubJets.size()>1 && N==2) return SubJet1LeadingTrackPt; else if (Option==9 && SubJets.size()>1 && N==2) return SubJet2LeadingTrackPt; else return -2; } Double32_t AliFJWrapper::NSubjettinessDerivativeSub(Int_t N, Int_t Algorithm, Double_t Radius, Double_t Beta, Double_t JetR, fastjet::PseudoJet jet, Int_t Option, Int_t Measure, Double_t Beta_SD, Double_t ZCut, Int_t SoftDropOn){ //For derivative subtraction Double_t Result=-1; std::vector<fastjet::PseudoJet> SubJet_Axes; fj::PseudoJet SubJet1_Axis; fj::PseudoJet SubJet2_Axis; if (SoftDropOn==1){ // Beta_SD=0.0; //change these later so they are actually variable. currently not variable due to Kine trains // ZCut=0.1; fj::contrib::SoftDrop Soft_Drop(Beta_SD,ZCut); //Soft_Drop.set_tagging_mode(); //if the first two subjets fail the soft drop criteria a jet = 0 is returned----clarify what this actually is fj::PseudoJet Soft_Dropped_Jet=Soft_Drop(jet); if (Soft_Dropped_Jet==0) return -3; else{ if (Soft_Dropped_Jet.constituents().size()>=N) jet=Soft_Dropped_Jet; else if (Soft_Dropped_Jet.constituents().size()<N) return -1; } } Beta = 1.0; JetR=0.4; if (Algorithm==0){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::KT_Axes(), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==1) { fj::contrib::Nsubjettiness nSub(N, fj::contrib::CA_Axes(), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==2){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::AntiKT_Axes(Radius), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==3) { fj::contrib::Nsubjettiness nSub(N, fj::contrib::WTA_KT_Axes(), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==4) { fj::contrib::Nsubjettiness nSub(N, fj::contrib::WTA_CA_Axes(), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==5){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_KT_Axes(), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==6){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_CA_Axes(), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==7){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_AntiKT_Axes(Radius), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==8){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_WTA_KT_Axes(), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==9){ fj::contrib::Nsubjettiness nSub(N, fj::contrib::OnePass_WTA_CA_Axes(), fj::contrib::NormalizedMeasure(Beta,JetR)); Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } else if (Algorithm==10){ //fj::contrib::Nsubjettiness nSub(N, fj::contrib::MultiPass_Axes(100), fj::contrib::NormalizedMeasure(Beta,JetR)); fj::contrib::Nsubjettiness nSub(N, fj::contrib::MultiPass_Axes(100), fj::contrib::NormalizedCutoffMeasure(Beta,JetR,10.0)); //testing for Kine trains Result= nSub.result(jet); SubJet_Axes=nSub.currentAxes(); } SubJet1_Axis=SubJet_Axes[0]; Double_t SubJet1_Eta=SubJet1_Axis.pseudorapidity(); Double_t SubJet2_Eta; Double_t SubJet1_Phi=SubJet1_Axis.phi(); if(SubJet1_Phi < -1*TMath::Pi()) SubJet1_Phi += (2*TMath::Pi()); else if (SubJet1_Phi > TMath::Pi()) SubJet1_Phi -= (2*TMath::Pi()); Double_t SubJet2_Phi; Double_t DeltaPhi=-5; if (SubJet_Axes.size()>1){ SubJet2_Axis=SubJet_Axes[1]; SubJet2_Eta=SubJet2_Axis.pseudorapidity(); SubJet2_Phi=SubJet2_Axis.phi(); if(SubJet2_Phi < -1*TMath::Pi()) SubJet2_Phi += (2*TMath::Pi()); else if (SubJet2_Phi > TMath::Pi()) SubJet2_Phi -= (2*TMath::Pi()); DeltaPhi=SubJet1_Phi-SubJet2_Phi; if(DeltaPhi < -1*TMath::Pi()) DeltaPhi += (2*TMath::Pi()); else if (DeltaPhi > TMath::Pi()) DeltaPhi -= (2*TMath::Pi()); } if (Option==0) return Result; else if (Option==1 && SubJet_Axes.size()>1 && N==2) return TMath::Sqrt(TMath::Power(SubJet1_Eta-SubJet2_Eta,2)+TMath::Power(DeltaPhi,2)); else if (Option==2 && SubJet_Axes.size()>1 && N==2) return TMath::Sqrt(TMath::Power(SubJet1_Eta-SubJet2_Eta,2)+TMath::Power(DeltaPhi,2)); else return -2; } #endif
42.863926
260
0.702388
[ "shape", "vector" ]
6f461dd7418f629b623ef9fa9764c28e1817a4db
11,294
h
C
11/debian-10/postgresql-repmgr-11.11.0-15-linux-amd64-debian-10/files/postgresql/include/geos/operation/buffer/OffsetSegmentGenerator.h
molliezhang/radondb-postgresql-kubernetes-1
7a3cbb050eb708a6db209e0effc8e5a4b34a2900
[ "Apache-2.0" ]
9
2021-05-26T08:31:36.000Z
2021-09-13T08:13:12.000Z
11/debian-10/postgresql-repmgr-11.11.0-15-linux-amd64-debian-10/files/postgresql/include/geos/operation/buffer/OffsetSegmentGenerator.h
molliezhang/radondb-postgresql-kubernetes-1
7a3cbb050eb708a6db209e0effc8e5a4b34a2900
[ "Apache-2.0" ]
4
2021-05-26T07:53:54.000Z
2021-06-16T11:08:15.000Z
11/debian-10/postgresql-repmgr-11.11.0-15-linux-amd64-debian-10/files/postgresql/include/geos/operation/buffer/OffsetSegmentGenerator.h
molliezhang/radondb-postgresql-kubernetes-1
7a3cbb050eb708a6db209e0effc8e5a4b34a2900
[ "Apache-2.0" ]
4
2021-05-26T06:56:52.000Z
2021-08-11T10:36:40.000Z
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2011 Sandro Santilli <strk@kbt.io> * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * ********************************************************************** * * Last port: operation/buffer/OffsetSegmentGenerator.java r378 (JTS-1.12) * **********************************************************************/ #ifndef GEOS_OP_BUFFER_OFFSETSEGMENTGENERATOR_H #define GEOS_OP_BUFFER_OFFSETSEGMENTGENERATOR_H #include <geos/export.h> #include <vector> #include <geos/algorithm/LineIntersector.h> // for composition #include <geos/geom/Coordinate.h> // for composition #include <geos/geom/LineSegment.h> // for composition #include <geos/operation/buffer/BufferParameters.h> // for composition #include <geos/operation/buffer/OffsetSegmentString.h> // for composition #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class #endif // Forward declarations namespace geos { namespace geom { class CoordinateSequence; class PrecisionModel; } } namespace geos { namespace operation { // geos.operation namespace buffer { // geos.operation.buffer /** * Generates segments which form an offset curve. * Supports all end cap and join options * provided for buffering. * Implements various heuristics to * produce smoother, simpler curves which are * still within a reasonable tolerance of the * true curve. * * @author Martin Davis * */ class GEOS_DLL OffsetSegmentGenerator { public: /* * @param nBufParams buffer parameters, this object will * keep a reference to the passed parameters * so caller must make sure the object is * kept alive for the whole lifetime of * the buffer builder. */ OffsetSegmentGenerator(const geom::PrecisionModel* newPrecisionModel, const BufferParameters& bufParams, double distance); /** * Tests whether the input has a narrow concave angle * (relative to the offset distance). * In this case the generated offset curve will contain self-intersections * and heuristic closing segments. * This is expected behaviour in the case of buffer curves. * For pure offset curves, * the output needs to be further treated * before it can be used. * * @return true if the input has a narrow concave angle */ bool hasNarrowConcaveAngle() const { return _hasNarrowConcaveAngle; } void initSideSegments(const geom::Coordinate& nS1, const geom::Coordinate& nS2, int nSide); /// Get coordinates by taking ownership of them // /// After this call, the coordinates reference in /// this object are dropped. Calling twice will /// segfault... /// /// FIXME: refactor memory management of this /// void getCoordinates(std::vector<geom::CoordinateSequence*>& to) { to.push_back(segList.getCoordinates()); } void closeRing() { segList.closeRing(); } /// Adds a CW circle around a point void createCircle(const geom::Coordinate& p, double distance); /// Adds a CW square around a point void createSquare(const geom::Coordinate& p, double distance); /// Add first offset point void addFirstSegment() { segList.addPt(offset1.p0); } /// Add last offset point void addLastSegment() { segList.addPt(offset1.p1); } void addNextSegment(const geom::Coordinate& p, bool addStartPoint); /// \brief /// Add an end cap around point p1, terminating a line segment /// coming from p0 void addLineEndCap(const geom::Coordinate& p0, const geom::Coordinate& p1); void addSegments(const geom::CoordinateSequence& pts, bool isForward) { segList.addPts(pts, isForward); } private: /** * Factor which controls how close offset segments can be to * skip adding a filler or mitre. */ static const double OFFSET_SEGMENT_SEPARATION_FACTOR; // 1.0E-3; /** * Factor which controls how close curve vertices on inside turns * can be to be snapped */ static const double INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR; // 1.0E-3; /** * Factor which controls how close curve vertices can be to be snapped */ static const double CURVE_VERTEX_SNAP_DISTANCE_FACTOR; // 1.0E-6; /** * Factor which determines how short closing segs can be for round buffers */ static const int MAX_CLOSING_SEG_LEN_FACTOR = 80; /** \brief * the max error of approximation (distance) between a quad segment and * the true fillet curve */ double maxCurveSegmentError; // 0.0 /** \brief * The angle quantum with which to approximate a fillet curve * (based on the input # of quadrant segments) */ double filletAngleQuantum; /// The Closing Segment Factor controls how long "closing /// segments" are. Closing segments are added at the middle of /// inside corners to ensure a smoother boundary for the buffer /// offset curve. In some cases (particularly for round joins /// with default-or-better quantization) the closing segments /// can be made quite short. This substantially improves /// performance (due to fewer intersections being created). /// /// A closingSegFactor of 0 results in lines to the corner vertex. /// A closingSegFactor of 1 results in lines halfway /// to the corner vertex. /// A closingSegFactor of 80 results in lines 1/81 of the way /// to the corner vertex (this option is reasonable for the very /// common default situation of round joins and quadrantSegs >= 8). /// /// The default is 1. /// int closingSegLengthFactor; // 1; /// Owned by this object, destroyed by dtor // /// This actually gets created multiple times /// and each of the old versions is pushed /// to the ptLists std::vector to ensure all /// created CoordinateSequences are properly /// destroyed. /// OffsetSegmentString segList; double distance; const geom::PrecisionModel* precisionModel; const BufferParameters& bufParams; algorithm::LineIntersector li; geom::Coordinate s0, s1, s2; geom::LineSegment seg0; geom::LineSegment seg1; geom::LineSegment offset0; geom::LineSegment offset1; int side; bool _hasNarrowConcaveAngle; // =false void addCollinear(bool addStartPoint); /// The mitre will be beveled if it exceeds the mitre ratio limit. // /// @param offset0 the first offset segment /// @param offset1 the second offset segment /// @param distance the offset distance /// void addMitreJoin(const geom::Coordinate& p, const geom::LineSegment& offset0, const geom::LineSegment& offset1, double distance); /// Adds a limited mitre join connecting the two reflex offset segments. // /// A limited mitre is a mitre which is beveled at the distance /// determined by the mitre ratio limit. /// /// @param offset0 the first offset segment /// @param offset1 the second offset segment /// @param distance the offset distance /// @param mitreLimit the mitre limit ratio /// void addLimitedMitreJoin( const geom::LineSegment& offset0, const geom::LineSegment& offset1, double distance, double mitreLimit); /// \brief /// Adds a bevel join connecting the two offset segments /// around a reflex corner. // /// @param offset0 the first offset segment /// @param offset1 the second offset segment /// void addBevelJoin(const geom::LineSegment& offset0, const geom::LineSegment& offset1); static const double PI; // 3.14159265358979 // Not in JTS, used for single-sided buffers int endCapIndex; void init(double newDistance); /** * Use a value which results in a potential distance error which is * significantly less than the error due to * the quadrant segment discretization. * For QS = 8 a value of 100 is reasonable. * This should produce a maximum of 1% distance error. */ static const double SIMPLIFY_FACTOR; // 100.0; /// Adds the offset points for an outside (convex) turn // /// @param orientation /// @param addStartPoint /// void addOutsideTurn(int orientation, bool addStartPoint); /// Adds the offset points for an inside (concave) turn // /// @param orientation /// @param addStartPoint /// void addInsideTurn(int orientation, bool addStartPoint); /** \brief * Compute an offset segment for an input segment on a given * side and at a given distance. * * The offset points are computed in full double precision, * for accuracy. * * @param seg the segment to offset * @param side the side of the segment the offset lies on * @param distance the offset distance * @param offset the points computed for the offset segment */ void computeOffsetSegment(const geom::LineSegment& seg, int side, double distance, geom::LineSegment& offset); /** * Adds points for a circular fillet around a reflex corner. * * Adds the start and end points * * @param p base point of curve * @param p0 start point of fillet curve * @param p1 endpoint of fillet curve * @param direction the orientation of the fillet * @param radius the radius of the fillet */ void addDirectedFillet(const geom::Coordinate& p, const geom::Coordinate& p0, const geom::Coordinate& p1, int direction, double radius); /** * Adds points for a circular fillet arc between two specified angles. * * The start and end point for the fillet are not added - * the caller must add them if required. * * @param direction is -1 for a CW angle, 1 for a CCW angle * @param radius the radius of the fillet */ void addDirectedFillet(const geom::Coordinate& p, double startAngle, double endAngle, int direction, double radius); private: // An OffsetSegmentGenerator cannot be copied because of member "const BufferParameters& bufParams" // Not declaring these functions triggers MSVC warning C4512: "assignment operator could not be generated" OffsetSegmentGenerator(const OffsetSegmentGenerator&); void operator=(const OffsetSegmentGenerator&); }; } // namespace geos::operation::buffer } // namespace geos::operation } // namespace geos #ifdef _MSC_VER #pragma warning(pop) #endif #endif // ndef GEOS_OP_BUFFER_OFFSETSEGMENTGENERATOR_H
30.942466
110
0.648132
[ "geometry", "object", "vector" ]
6f4c824e863fac0a6e3103dd29d17a7beb7fbdea
1,631
h
C
lib/Utilities/rtosim/OsimUtilities.h
mitkof6/rtosim
3fd90cad7159bd478c4650279a99100da8d1aeda
[ "Apache-2.0" ]
null
null
null
lib/Utilities/rtosim/OsimUtilities.h
mitkof6/rtosim
3fd90cad7159bd478c4650279a99100da8d1aeda
[ "Apache-2.0" ]
null
null
null
lib/Utilities/rtosim/OsimUtilities.h
mitkof6/rtosim
3fd90cad7159bd478c4650279a99100da8d1aeda
[ "Apache-2.0" ]
null
null
null
/* -------------------------------------------------------------------------- * * Copyright (c) 2010-2016 C. Pizzolato, M. Reggiani * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * * -------------------------------------------------------------------------- */ #ifndef rtosim_OsimUtilities_h #define rtosim_OsimUtilities_h #include <vector> #include <OpenSim/OpenSim.h> namespace rtosim { std::vector<std::string> getMarkerNamesFromModel(const std::string& modelFilename); std::vector<std::string> getCoordinateNamesFromModel(const std::string& modelFilename); std::vector<std::string> getMarkerNamesOnBody(const OpenSim::Body& body); std::string getMostPosteriorMarker(const std::vector<std::string>& markerNames, OpenSim::Model& model); } #endif
49.424242
107
0.517474
[ "vector", "model" ]
6f5469ea492bc3338437d8ac266a3170379baff1
7,712
h
C
ompi/contrib/vt/vt/tools/vtdyn/vt_dyn.h
urids/XSCALAMPI
38624f682211d55c047183637fed8dbcc09f6d74
[ "BSD-3-Clause-Open-MPI" ]
1
2015-12-16T08:16:23.000Z
2015-12-16T08:16:23.000Z
ompi/contrib/vt/vt/tools/vtdyn/vt_dyn.h
urids/XSCALAMPI
38624f682211d55c047183637fed8dbcc09f6d74
[ "BSD-3-Clause-Open-MPI" ]
null
null
null
ompi/contrib/vt/vt/tools/vtdyn/vt_dyn.h
urids/XSCALAMPI
38624f682211d55c047183637fed8dbcc09f6d74
[ "BSD-3-Clause-Open-MPI" ]
3
2015-11-29T06:00:56.000Z
2021-03-29T07:03:29.000Z
/** * VampirTrace * http://www.tu-dresden.de/zih/vampirtrace * * Copyright (c) 2005-2013, ZIH, TU Dresden, Federal Republic of Germany * * Copyright (c) 1998-2005, Forschungszentrum Juelich, Juelich Supercomputing * Centre, Federal Republic of Germany * * See the file COPYING in the package base directory for details **/ #ifndef _VT_DYN_H_ #define _VT_DYN_H_ #include "config.h" #include "vt_defs.h" #include "vt_inttypes.h" #include "rfg_filter.h" #include "BPatch.h" #include "BPatch_addressSpace.h" #include "BPatch_flowGraph.h" #include "BPatch_function.h" #include "BPatch_image.h" #include <iostream> #include <string> #include <vector> #define STRBUFSIZE 1024 // define the following macro to exclude regions from instrumentation which // require using a trap // (see description of BPatch_addressSpace::allowTraps and // BPatch_point::usesTrap_NP in the Dyninst Programmer's Guide for more // details) #define NOTRAPS // // mutation modes // typedef enum { // either create/attach to a process, instrument, and execute // MODE_CREATE, MODE_ATTACH, // or open, instrument, and rewrite binary MODE_REWRITE } MutationT; // // structure that contains the mutator parameters // (i.e. command line options) // struct ParamsS { ParamsS() : mode( MODE_CREATE ), mutatee_pid( -1 ), verbose_level( 1 ), detach( true ), outer_loops( false ), inner_loops( false ), loop_iters( false ), ignore_no_dbg( false ), show_usage( false ), show_version( false ) {} MutationT mode; // mutation mode std::string mutatee; // mutatee executable name int mutatee_pid; // mutatee PID std::vector<std::string> mutatee_args; // mutatee arguments std::vector<std::string> shlibs; // shared libs. to instrument std::string filtfile; // pathname of filter file std::string outfile; // file name of binary to rewrite uint32_t verbose_level; // verbose level bool detach; // flag: detach from mutatee? bool outer_loops; // flag: instrument outer loops? bool inner_loops; // flag: instrument inner loops? bool loop_iters; // flag: instrument loop iterations? bool ignore_no_dbg; // flag: ignore funcs. without debug? bool show_usage; // flag: show usage text? bool show_version; // flag: show VampirTrace version? }; // // MutatorC class // class MutatorC { public: // constructor MutatorC(); // destructor ~MutatorC(); // run the mutator bool run(); private: // // base structure for regions (=functions, loop, or loop iterations) // to instrument // struct RegionS { // // structure for region source code location // struct SclS { SclS() : line_number( 0 ) {} // check whether source code location is valid bool valid() const { return ( line_number > 0 && file_name.length() > 0 ); } std::string file_name; // source file name uint32_t line_number; // line number within source file }; // // structure for region instrumentation points // struct InstPointsS { InstPointsS() : entries( 0 ), exits( 0 ) {} const BPatch_Vector<BPatch_point*> * entries; // entry points const BPatch_Vector<BPatch_point*> * exits; // exit points }; // constructor RegionS( const std::string & _name, const SclS & _scl, const InstPointsS & _inst_points ); // destructor virtual ~RegionS(); // new operator to check number of created regions // (returns 0 if VT_MAX_DYNINST_REGIONS will be exceeded) static inline void * operator new( size_t size ) throw(); // the overloaded new operator calls malloc(), so we have to have a // delete operator which calls free() static inline void operator delete( void * ptr ); // counter of regions to instrument (max. VT_MAX_DYNINST_REGIONS) static uint32_t Count; // region index uint32_t index; // region name std::string name; // region source code location SclS scl; // region instrumentation points InstPointsS inst_points; }; // // structure for loop regions to instrument // struct LoopS : RegionS { // // type for loop iteration regions // typedef RegionS IterationT; // constructor LoopS( const std::string & _name, const SclS & _scl, const InstPointsS & _inst_points, IterationT * _iteration = 0 ) : RegionS( _name, _scl, _inst_points ), iteration( _iteration ) {} // destructor ~LoopS() { if( iteration ) delete iteration; } // loop iteration region to instrument IterationT * iteration; }; // // structure for function regions to instrument // struct FunctionS : RegionS { // constructor FunctionS( const std::string & _name, const SclS & _scl, const InstPointsS & _inst_points, const std::vector<LoopS*> & _loops = std::vector<LoopS*>() ) : RegionS( _name, _scl, _inst_points ), loops( _loops ) {} // loops within the function std::vector<LoopS*> loops; // destructor ~FunctionS() { for( uint32_t i = 0; i < loops.size(); i++ ) delete loops[i]; } }; // create/attach to a process or open binary for rewriting bool initialize(); // continue execution of mutatee or rewrite binary bool finalize( bool & error ); // get functions to instrument bool getFunctions( std::vector<FunctionS*> & funcRegions ) const; // instrument functions bool instrumentFunctions( const std::vector<FunctionS*> & funcRegions ) const; // instrument a region entry inline bool instrumentRegionEntry( const RegionS * region, const bool isLoop ) const; // instrument a region exit inline bool instrumentRegionExit( const RegionS * region, const bool isLoop ) const; // check whether module is excluded from instrumentation inline bool constraintModule( const std::string & name ) const; // check whether region is excluded from instrumentation inline bool constraintRegion( const std::string & name ) const; // check whether mutatee uses MPI inline bool isMPI() const; // find function in mutatee inline BPatch_function * findFunction( const std::string & name ) const; // find instrumentation point(s) in a function (where=BPatch_function*) // or in a loop (where=BPatch_flowGraph*) // If NOTRAPS is defined, this function returns NULL, if inserting // instrumentation at found point(s) requires using a trap. inline BPatch_Vector<BPatch_point*> * findPoint( void * where, BPatch_procedureLocation loc, BPatch_basicBlockLoop * loop = 0 ) const; // entire Dyninst library object BPatch m_bpatch; // mutatee's process or binary edit object BPatch_addressSpace * m_appAddrSpace; // mutatee's image object BPatch_image * m_appImage; // instrumentation functions to insert at entry/exit points // BPatch_function * m_vtStartFunc; BPatch_function * m_vtEndFunc; // RFG filter object to include/exclude functions from instrumenting RFG_Filter * m_filter; }; #endif // _VT_DYN_H_
27.347518
80
0.625
[ "object", "vector" ]
6f5d723855c014e943fba79677df9d6257d34ab5
2,022
h
C
Source/UMenu/Public/GlobalMenuStyle.h
robcog-iai/UMenu
e260417ff66070ff2d31c1bab4433c22d045c48e
[ "BSD-3-Clause" ]
1
2019-02-13T02:22:33.000Z
2019-02-13T02:22:33.000Z
Source/UMenu/Public/GlobalMenuStyle.h
jobunk/UMenu
58a5cf5ad5388152687f2a2fe4a42a59ad24299e
[ "BSD-3-Clause" ]
null
null
null
Source/UMenu/Public/GlobalMenuStyle.h
jobunk/UMenu
58a5cf5ad5388152687f2a2fe4a42a59ad24299e
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2018, Institute for Artificial Intelligence - University of Bremen #pragma once #include "SlateWidgetStyleContainerBase.h" #include "SlateWidgetStyle.h" #include "SlateBasics.h" #include "GlobalMenuStyle.generated.h" // Provides a group of global style settings for our game menus! USTRUCT() struct UMENU_API FGlobalStyle : public FSlateWidgetStyle { GENERATED_USTRUCT_BODY() // Stores a list of Brushes we are using (we aren't using any) into OutBrushes. virtual void GetResources(TArray<const FSlateBrush*>& OutBrushes) const override; // Stores the TypeName for our widget style. static const FName TypeName; // Retrieves the type name for our global style, which will be used by our Style Set to load the right file. virtual const FName GetTypeName() const override; // Allows us to set default values for our various styles. static const FGlobalStyle& GetDefault(); // Style that define the appearance of all menu buttons. UPROPERTY(EditAnywhere, Category = Appearance) FButtonStyle MenuButtonStyle; // Style that defines the text on all of our menu buttons. UPROPERTY(EditAnywhere, Category = Appearance) FTextBlockStyle MenuButtonTextStyle; // Style that defines the text for our menu title. UPROPERTY(EditAnywhere, Category = Appearance) FTextBlockStyle MenuTitleStyle; // Style for the editable text box UPROPERTY(EditAnywhere, Category = Appearance) FEditableTextBoxStyle TextBox; }; // Provides a widget style container to allow us to edit properties in-editor UCLASS(hidecategories = Object, MinimalAPI) class UGlobalMenuStyle : public USlateWidgetStyleContainerBase { GENERATED_UCLASS_BODY() public: // This is our actual Style object. UPROPERTY(EditAnywhere, Category = Appearance, meta = (ShowOnlyInnerProperties)) FGlobalStyle MenuStyle; // Retrievs the style that this container manages. virtual const struct FSlateWidgetStyle* const GetStyle() const override { return static_cast<const struct FSlateWidgetStyle*>(&MenuStyle); } };
33.147541
110
0.78091
[ "object" ]
6f61ee3eee45092ecc4e8aff918c31a1c4c808a1
2,867
c
C
model/v2alpha1_job_template_spec.c
ityuhui/client-c
1d30380d7ba0fe9b5e97626e0f7507be4ce8f96d
[ "curl", "Apache-2.0" ]
null
null
null
model/v2alpha1_job_template_spec.c
ityuhui/client-c
1d30380d7ba0fe9b5e97626e0f7507be4ce8f96d
[ "curl", "Apache-2.0" ]
null
null
null
model/v2alpha1_job_template_spec.c
ityuhui/client-c
1d30380d7ba0fe9b5e97626e0f7507be4ce8f96d
[ "curl", "Apache-2.0" ]
null
null
null
#include <stdlib.h> #include <string.h> #include <stdio.h> #include "v2alpha1_job_template_spec.h" v2alpha1_job_template_spec_t *v2alpha1_job_template_spec_create( v1_object_meta_t *metadata, v1_job_spec_t *spec ) { v2alpha1_job_template_spec_t *v2alpha1_job_template_spec_local_var = malloc(sizeof(v2alpha1_job_template_spec_t)); if (!v2alpha1_job_template_spec_local_var) { return NULL; } v2alpha1_job_template_spec_local_var->metadata = metadata; v2alpha1_job_template_spec_local_var->spec = spec; return v2alpha1_job_template_spec_local_var; } void v2alpha1_job_template_spec_free(v2alpha1_job_template_spec_t *v2alpha1_job_template_spec) { listEntry_t *listEntry; v1_object_meta_free(v2alpha1_job_template_spec->metadata); v1_job_spec_free(v2alpha1_job_template_spec->spec); free(v2alpha1_job_template_spec); } cJSON *v2alpha1_job_template_spec_convertToJSON(v2alpha1_job_template_spec_t *v2alpha1_job_template_spec) { cJSON *item = cJSON_CreateObject(); // v2alpha1_job_template_spec->metadata if(v2alpha1_job_template_spec->metadata) { cJSON *metadata_local_JSON = v1_object_meta_convertToJSON(v2alpha1_job_template_spec->metadata); if(metadata_local_JSON == NULL) { goto fail; //model } cJSON_AddItemToObject(item, "metadata", metadata_local_JSON); if(item->child == NULL) { goto fail; } } // v2alpha1_job_template_spec->spec if(v2alpha1_job_template_spec->spec) { cJSON *spec_local_JSON = v1_job_spec_convertToJSON(v2alpha1_job_template_spec->spec); if(spec_local_JSON == NULL) { goto fail; //model } cJSON_AddItemToObject(item, "spec", spec_local_JSON); if(item->child == NULL) { goto fail; } } return item; fail: if (item) { cJSON_Delete(item); } return NULL; } v2alpha1_job_template_spec_t *v2alpha1_job_template_spec_parseFromJSON(cJSON *v2alpha1_job_template_specJSON){ v2alpha1_job_template_spec_t *v2alpha1_job_template_spec_local_var = NULL; // v2alpha1_job_template_spec->metadata cJSON *metadata = cJSON_GetObjectItemCaseSensitive(v2alpha1_job_template_specJSON, "metadata"); v1_object_meta_t *metadata_local_nonprim = NULL; if (metadata) { metadata_local_nonprim = v1_object_meta_parseFromJSON(metadata); //nonprimitive } // v2alpha1_job_template_spec->spec cJSON *spec = cJSON_GetObjectItemCaseSensitive(v2alpha1_job_template_specJSON, "spec"); v1_job_spec_t *spec_local_nonprim = NULL; if (spec) { spec_local_nonprim = v1_job_spec_parseFromJSON(spec); //nonprimitive } v2alpha1_job_template_spec_local_var = v2alpha1_job_template_spec_create ( metadata ? metadata_local_nonprim : NULL, spec ? spec_local_nonprim : NULL ); return v2alpha1_job_template_spec_local_var; end: return NULL; }
30.178947
115
0.761423
[ "model" ]
6f701b9f824384c594a6cb8a791f6eaec4359b8b
5,631
h
C
usr/i686-w64-mingw32.shared.posix/qt5/include/QtWidgets/qlayoutitem.h
stdgregwar/mxe_qt5_boost
04c371d5b7827d157311fd277003d9eba629a9e6
[ "RSA-MD" ]
1
2017-07-03T08:33:45.000Z
2017-07-03T08:33:45.000Z
usr/i686-w64-mingw32.shared.posix/qt5/include/QtWidgets/qlayoutitem.h
stdgregwar/mxe_qt5_boost
04c371d5b7827d157311fd277003d9eba629a9e6
[ "RSA-MD" ]
null
null
null
usr/i686-w64-mingw32.shared.posix/qt5/include/QtWidgets/qlayoutitem.h
stdgregwar/mxe_qt5_boost
04c371d5b7827d157311fd277003d9eba629a9e6
[ "RSA-MD" ]
null
null
null
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QLAYOUTITEM_H #define QLAYOUTITEM_H #include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qsizepolicy.h> #include <QtCore/qrect.h> #include <limits.h> QT_BEGIN_NAMESPACE static const Q_DECL_UNUSED int QLAYOUTSIZE_MAX = INT_MAX/256/16; class QLayout; class QLayoutItem; class QSpacerItem; class QWidget; class QSize; class Q_WIDGETS_EXPORT QLayoutItem { public: inline explicit QLayoutItem(Qt::Alignment alignment = Qt::Alignment()); virtual ~QLayoutItem(); virtual QSize sizeHint() const = 0; virtual QSize minimumSize() const = 0; virtual QSize maximumSize() const = 0; virtual Qt::Orientations expandingDirections() const = 0; virtual void setGeometry(const QRect&) = 0; virtual QRect geometry() const = 0; virtual bool isEmpty() const = 0; virtual bool hasHeightForWidth() const; virtual int heightForWidth(int) const; virtual int minimumHeightForWidth(int) const; virtual void invalidate(); virtual QWidget *widget(); virtual QLayout *layout(); virtual QSpacerItem *spacerItem(); Qt::Alignment alignment() const { return align; } void setAlignment(Qt::Alignment a); virtual QSizePolicy::ControlTypes controlTypes() const; protected: Qt::Alignment align; }; inline QLayoutItem::QLayoutItem(Qt::Alignment aalignment) : align(aalignment) { } class Q_WIDGETS_EXPORT QSpacerItem : public QLayoutItem { public: QSpacerItem(int w, int h, QSizePolicy::Policy hData = QSizePolicy::Minimum, QSizePolicy::Policy vData = QSizePolicy::Minimum) : width(w), height(h), sizeP(hData, vData) { } ~QSpacerItem(); void changeSize(int w, int h, QSizePolicy::Policy hData = QSizePolicy::Minimum, QSizePolicy::Policy vData = QSizePolicy::Minimum); QSize sizeHint() const; QSize minimumSize() const; QSize maximumSize() const; Qt::Orientations expandingDirections() const; bool isEmpty() const; void setGeometry(const QRect&); QRect geometry() const; QSpacerItem *spacerItem(); QSizePolicy sizePolicy() const { return sizeP; } private: int width; int height; QSizePolicy sizeP; QRect rect; }; class Q_WIDGETS_EXPORT QWidgetItem : public QLayoutItem { Q_DISABLE_COPY(QWidgetItem) public: explicit QWidgetItem(QWidget *w) : wid(w) { } ~QWidgetItem(); QSize sizeHint() const; QSize minimumSize() const; QSize maximumSize() const; Qt::Orientations expandingDirections() const; bool isEmpty() const; void setGeometry(const QRect&); QRect geometry() const; virtual QWidget *widget(); bool hasHeightForWidth() const; int heightForWidth(int) const; QSizePolicy::ControlTypes controlTypes() const; protected: QWidget *wid; }; class Q_WIDGETS_EXPORT QWidgetItemV2 : public QWidgetItem { public: explicit QWidgetItemV2(QWidget *widget); ~QWidgetItemV2(); QSize sizeHint() const; QSize minimumSize() const; QSize maximumSize() const; int heightForWidth(int width) const; private: enum { Dirty = -123, HfwCacheMaxSize = 3 }; inline bool useSizeCache() const; void updateCacheIfNecessary() const; inline void invalidateSizeCache() { q_cachedMinimumSize.setWidth(Dirty); q_hfwCacheSize = 0; } mutable QSize q_cachedMinimumSize; mutable QSize q_cachedSizeHint; mutable QSize q_cachedMaximumSize; mutable QSize q_cachedHfws[HfwCacheMaxSize]; mutable short q_firstCachedHfw; mutable short q_hfwCacheSize; void *d; friend class QWidgetPrivate; Q_DISABLE_COPY(QWidgetItemV2) }; QT_END_NAMESPACE #endif // QLAYOUTITEM_H
30.93956
77
0.699165
[ "geometry" ]
6f775e07967161908a2b5f76dfe8a3d9304fd0e3
72,239
h
C
src/lambdas/headers/JoinTuple.h
venkate5hgunda/CSE598-Spring22-Group22-NetsDB
6c2dabd1a3b3f5901a97c788423fdd93cc0015d4
[ "Apache-2.0" ]
13
2022-01-17T16:14:26.000Z
2022-03-30T02:06:04.000Z
src/lambdas/headers/JoinTuple.h
venkate5hgunda/CSE598-Spring22-Group22-NetsDB
6c2dabd1a3b3f5901a97c788423fdd93cc0015d4
[ "Apache-2.0" ]
1
2022-01-28T23:17:14.000Z
2022-01-28T23:17:14.000Z
src/lambdas/headers/JoinTuple.h
venkate5hgunda/CSE598-Spring22-Group22-NetsDB
6c2dabd1a3b3f5901a97c788423fdd93cc0015d4
[ "Apache-2.0" ]
3
2022-01-18T02:13:53.000Z
2022-03-06T19:28:19.000Z
#ifndef JOIN_TUPLE_H #define JOIN_TUPLE_H #include "JoinMap.h" #include "SinkMerger.h" #include "SinkShuffler.h" #include "JoinTupleBase.h" #include "PDBPage.h" #include "RecordIterator.h" #include "PartitionedHashSet.h" namespace pdb { // Join types typedef enum { HashPartitionedJoin, BroadcastJoin, LocalJoin } JoinType; template <typename T> void copyFrom(T& out, Handle<T>& in) { if (in != nullptr) out = *in; else std::cout << "Error in copyFrom: in is nullptr" << std::endl; } template <typename T> void copyFrom(T& out, T& in) { out = in; } template <typename T> void copyFrom(Handle<T>& out, Handle<T>& in) { out = in; } template <typename T> void copyFrom(Handle<T>& out, T& in) { if (out != nullptr) *out = in; else std::cout << "Error in copyFrom: out is nullptr" << std::endl; } template <typename T> void copyTo(T& out, Handle<T>& in) { char* location = (char*)&out; location -= REF_COUNT_PREAMBLE_SIZE; in = (RefCountedObject<T>*)location; } template <typename T> void copyTo(Handle<T>& out, Handle<T>& in) { in = out; } // this checks to see if the class is abstract // used like: decltype (IsAbstract <Foo> :: val) a; // the type of a will be Handle <Foo> if foo is abstract, and Foo otherwise. // template <typename T> struct IsAbstract { template <typename U> static U test(U x, int); template <typename U, typename... Rest> static Handle<U> test(U& x, Rest...); static decltype(test<T>(*((T*)0), 1)) val; }; // this template is used to hold a tuple made of one row from each of a number of columns in a // TupleSet template <typename HoldMe, typename MeTo> class JoinTuple : public JoinTupleBase { public: // this stores the base type decltype(IsAbstract<HoldMe>::val) myData; // and this is the recursion MeTo myOtherData; // e.g. TypeToCreate::allocate(processMe, offset + positions[whichPos]); static void* allocate(TupleSet& processMe, int where) { std::vector<Handle<HoldMe>>* me = new std::vector<Handle<HoldMe>>; if (me == nullptr){ std::cout << "JoinTuple.h: Failed to allocate memory" << std::endl; exit(1); } std::cout << "Allocated column at where=" << where << std::endl; processMe.addColumn(where, me, true); return me; } // JiaNote: add the below two functions to facilitate JoinMap merging for broadcast join void copyDataFrom(Handle<HoldMe> me) { pdb::copyFrom(myData, me); //std::cout << "copyFrom: " ; //std::cout << me->toString() << std::endl; } void copyDataFrom(HoldMe me) { pdb::copyFrom(myData, me); //std::cout << "copyFrom: "; //std::cout << me.toString() << ","; //std::cout << myData.toString() << std::endl; } void copyFrom(void* input, int whichPos) { std::vector<Handle<HoldMe>>& me = *((std::vector<Handle<HoldMe>>*)input); pdb::copyFrom(myData, me[whichPos]); } void copyTo(void* input, int whichPos) { std::vector<Handle<HoldMe>>& me = *((std::vector<Handle<HoldMe>>*)input); if (whichPos >= me.size()) { Handle<HoldMe> temp = makeObject<HoldMe>(); pdb::copyTo(myData, temp); me.push_back(temp); } else { pdb::copyTo(myData, me[whichPos]); } //std::cout << "from :"; //std::cout << myData.toString() << std::endl; //std::cout << "copyTo :"; //std::cout << me[whichPos]->toString() << std::endl; } static void truncate(void* input, int i) { std::vector<Handle<HoldMe>>& valColumn = *((std::vector<Handle<HoldMe>>*)(input)); valColumn.erase(valColumn.begin(), valColumn.begin() + i); } static void eraseEnd(void* input, int i) { std::vector<Handle<HoldMe>>& valColumn = *((std::vector<Handle<HoldMe>>*)(input)); valColumn.resize(i); } }; /***** CODE TO CREATE A SET OF ATTRIBUTES IN A TUPLE SET *****/ // this adds a new column to processMe of type TypeToCreate. This is added at position offset + // positions[whichPos] // e.g. createCols<RHSType>(columns, *output, 0, 0, positions); // e.g. createCols<RHSType>( // columns, *output, attsToIncludeInOutput.getAtts().size(), 0, positions); template <typename TypeToCreate> typename std::enable_if<sizeof(TypeToCreate::myOtherData) == 0, void>::type createCols( void** putUsHere, TupleSet& processMe, int offset, int whichPos, std::vector<int> positions) { putUsHere[whichPos] = TypeToCreate::allocate(processMe, offset + positions[whichPos]); } // recursive version of the above template <typename TypeToCreate> typename std::enable_if<sizeof(TypeToCreate::myOtherData) != 0, void>::type createCols( void** putUsHere, TupleSet& processMe, int offset, int whichPos, std::vector<int> positions) { putUsHere[whichPos] = TypeToCreate::allocate(processMe, offset + positions[whichPos]); createCols<decltype(TypeToCreate::myOtherData)>( putUsHere, processMe, offset, whichPos + 1, positions); } // JiaNote: add below two functions to c a join tuple from another join tuple /**** CODE TO COPY A JOIN TUPLE FROM ANOTHER JOIN TUPLE ****/ // this is the non-recursive version of packData; called if the type does NOT have a field called // myOtherData, in which case // we can just directly copy the data template <typename TypeToPackData> typename std::enable_if<(sizeof(TypeToPackData::myOtherData) == 0) && (sizeof(TypeToPackData::myData) != 0), void>::type packData(TypeToPackData& arg, TypeToPackData data) { arg.copyDataFrom(data.myData); } // this is the recursive version of packData; called if the type has a field called myOtherData to // which we can recursively pack values to. template <typename TypeToPackData> typename std::enable_if<(sizeof(TypeToPackData::myOtherData) != 0) && (sizeof(TypeToPackData::myData) != 0), void>::type packData(TypeToPackData& arg, TypeToPackData data) { arg.copyDataFrom(data.myData); packData(arg.myOtherData, data.myOtherData); } /***** CODE TO PACK A JOIN TUPLE FROM A SET OF VALUES SPREAD ACCROSS COLUMNS *****/ // this is the non-recursive version of pack; called if the type does NOT have a field called // "myData", in which case // we can just directly copy the data template <typename TypeToPack> typename std::enable_if<sizeof(TypeToPack::myOtherData) == 0, void>::type pack( TypeToPack& arg, int whichPosInTupleSet, int whichVec, void** us) { arg.copyFrom(us[whichVec], whichPosInTupleSet); } // this is the recursive version of pack; called if the type has a field called "myData" to which we // can recursively // pack values to. Basically, what it does is to accept a pointer to a list of pointers to various // std :: vector // objects. We are going to recurse through the list of vectors, and for each vector, we record the // entry at // the position whichPosInTupleSet template <typename TypeToPack> typename std::enable_if<sizeof(TypeToPack::myOtherData) != 0, void>::type pack( TypeToPack& arg, int whichPosInTupleSet, int whichVec, void** us) { arg.copyFrom(us[whichVec], whichPosInTupleSet); pack(arg.myOtherData, whichPosInTupleSet, whichVec + 1, us); } /***** CODE TO UNPACK A JOIN TUPLE FROM A SET OF VALUES SPREAD ACCROSS COLUMNS *****/ // this is the non-recursive version of unpack template <typename TypeToUnPack> typename std::enable_if<sizeof(TypeToUnPack::myOtherData) == 0, void>::type unpack( TypeToUnPack& arg, int whichPosInTupleSet, int whichVec, void** us) { arg.copyTo(us[whichVec], whichPosInTupleSet); } // this is analagous to pack, except that it unpacks this tuple into an array of vectors template <typename TypeToUnPack> typename std::enable_if<sizeof(TypeToUnPack::myOtherData) != 0, void>::type unpack( TypeToUnPack& arg, int whichPosInTupleSet, int whichVec, void** us) { arg.copyTo(us[whichVec], whichPosInTupleSet); unpack(arg.myOtherData, whichPosInTupleSet, whichVec + 1, us); } /***** CODE TO ERASE DATA FROM THE END OF A SET OF VECTORS *****/ // this is the non-recursive version of eraseEnd template <typename TypeToTruncate> typename std::enable_if<sizeof(TypeToTruncate::myOtherData) == 0, void>::type eraseEnd(int i, int whichVec, void** us) { TypeToTruncate::eraseEnd(us[whichVec], i); } // recursive version template <typename TypeToTruncate> typename std::enable_if<sizeof(TypeToTruncate::myOtherData) != 0, void>::type eraseEnd(int i, int whichVec, void** us) { TypeToTruncate::eraseEnd(us[whichVec], i); eraseEnd<decltype(TypeToTruncate::myOtherData)>(i, whichVec + 1, us); } /***** CODE TO TRUNCATE A SET OF VECTORS *****/ // this is the non-recursive version of truncate template <typename TypeToTruncate> typename std::enable_if<sizeof(TypeToTruncate::myOtherData) == 0, void>::type truncate(int i, int whichVec, void** us) { TypeToTruncate::truncate(us[whichVec], i); } // this function goes through a list of vectors, and truncates each of them so that the first i // entries of each vector is removed template <typename TypeToTruncate> typename std::enable_if<sizeof(TypeToTruncate::myOtherData) != 0, void>::type truncate(int i, int whichVec, void** us) { TypeToTruncate::truncate(us[whichVec], i); truncate<decltype(TypeToTruncate::myOtherData)>(i, whichVec + 1, us); } // this clsas is used to encapaulte the computation that is responsible for probing a partitioned hash table template <typename RHSType> class PartitionedJoinProbe : public ComputeExecutor { private: // this is the output TupleSet that we return TupleSetPtr output; // number of partitions on a node int numPartitionsPerNode; // number of nodes int numNodes; // the attribute to operate on int whichAtt; // to setup the output tuple set TupleSetSetupMachine myMachine; // the hash talbe we are processing std::vector<Handle<JoinMap<RHSType>>> inputTables; // the list of counts for matches of each of the input tuples std::vector<uint32_t> counts; // this is the list of all of the output columns in the output TupleSetPtr void** columns; // used to create space of attributes in the case that the atts from attsToIncludeInOutput are // not the first bunch of atts // inside of the output tuple int offset; public: ~PartitionedJoinProbe() { } // when we probe a partitioned hash table, a subset of the atts that we need to put into the output stream // are stored in the hash table... the positions // of these packed atts are stored in typesStoredInHash, so that they can be extracted. // inputSchema, attsToOperateOn, and attsToIncludeInOutput // are standard for executors: they tell us the details of the input that are streaming in, as // well as the identity of the has att, and // the atts that will be streamed to the output, from the input. needToSwapLHSAndRhs is true if // it's the case that theatts stored in the // hash table need to come AFTER the atts being streamed through the join PartitionedJoinProbe(PartitionedHashSetPtr partitionedHashTable, int numPartitionsPerNode, int numNodes, std::vector<int>& positions, TupleSpec& inputSchema, TupleSpec& attsToOperateOn, TupleSpec& attsToIncludeInOutput, bool needToSwapLHSAndRhs) : myMachine(inputSchema, attsToIncludeInOutput) { std::cout << "*****Created a PartitionedJoinProbe instance with numPartitionsPerNode=" << numPartitionsPerNode << ", numNodes=" << numNodes << std::endl; this->numPartitionsPerNode = numPartitionsPerNode; this->numNodes = numNodes; // extract the hash table we've been given for (int i = 0; i < partitionedHashTable->getNumPages(); i++) { void * hashTable = partitionedHashTable->getPage(i, true); Record<JoinMap<RHSType>> * input = (Record<JoinMap<RHSType>>*)hashTable; Handle<JoinMap<RHSType>> inputTable = input->getRootObject(); inputTables.push_back(inputTable); } // set up the output tuple output = std::make_shared<TupleSet>(); columns = new void*[positions.size()]; if (columns == nullptr) { std::cout << "Error: No memory on heap" << std::endl; exit(1); } if (needToSwapLHSAndRhs) { offset = positions.size(); createCols<RHSType>(columns, *output, 0, 0, positions); } else { offset = 0; createCols<RHSType>( columns, *output, attsToIncludeInOutput.getAtts().size(), 0, positions); } // this is the input attribute that we will hash in order to try to find matches std::vector<int> matches = myMachine.match(attsToOperateOn); whichAtt = matches[0]; } std::string getType() override { return "PartitionedJoinProbe"; } TupleSetPtr process(TupleSetPtr input) override { std::vector<size_t> inputHash = input->getColumn<size_t>(whichAtt); // redo the vector of hash counts if it's not the correct size if (counts.size() != inputHash.size()) { counts.resize(inputHash.size()); } // now, run through and attempt to hash int overallCounter = 0; for (int i = 0; i < inputHash.size(); i++) { size_t value = inputHash[i]; //to see which hash the i-th element should go size_t index = value % (this->numPartitionsPerNode * this->numNodes)% this->numPartitionsPerNode; JoinMap<RHSType>& inputTableRef = *(inputTables[index]); // deal with all of the matches int numHits = inputTableRef.count(value); if (numHits > 0) { auto a = inputTableRef.lookup(value); int aSize = a.size(); if (numHits != aSize) { numHits = aSize; std::cout << "WARNING: counts() and lookup() return inconsistent results" << std::endl; } for (int which = 0; which < numHits; which++) { unpack(a[which], overallCounter, 0, columns); overallCounter++; } } // remember how many matches we had counts[i] = numHits; std::cout << "hash=" << value <<", index=" << index << ", counts[" << i << "]=" << numHits << std::endl; } // truncate if we have extra eraseEnd<RHSType>(overallCounter, 0, columns); // and finally, we need to relpicate the input data myMachine.replicate(input, output, counts, offset); // outta here! return output; } }; // this clsas is used to encapaulte the computation that is responsible for probing a hash table template <typename RHSType> class JoinProbe : public ComputeExecutor { private: // this is the output TupleSet that we return TupleSetPtr output; // the attribute to operate on int whichAtt; // to setup the output tuple set TupleSetSetupMachine myMachine; // the hash talbe we are processing Handle<JoinMap<RHSType>> inputTable; // the list of counts for matches of each of the input tuples std::vector<uint32_t> counts; // this is the list of all of the output columns in the output TupleSetPtr void** columns; // used to create space of attributes in the case that the atts from attsToIncludeInOutput are // not the first bunch of atts // inside of the output tuple int offset; public: ~JoinProbe() { } // when we probe a hash table, a subset of the atts that we need to put into the output stream // are stored in the hash table... the positions // of these packed atts are stored in typesStoredInHash, so that they can be extracted. // inputSchema, attsToOperateOn, and attsToIncludeInOutput // are standard for executors: they tell us the details of the input that are streaming in, as // well as the identity of the has att, and // the atts that will be streamed to the output, from the input. needToSwapLHSAndRhs is true if // it's the case that theatts stored in the // hash table need to come AFTER the atts being streamed through the join JoinProbe(void* hashTable, std::vector<int>& positions, TupleSpec& inputSchema, TupleSpec& attsToOperateOn, TupleSpec& attsToIncludeInOutput, bool needToSwapLHSAndRhs) : myMachine(inputSchema, attsToIncludeInOutput) { // extract the hash table we've been given Record<JoinMap<RHSType>>* input = (Record<JoinMap<RHSType>>*)hashTable; if (input == nullptr) { inputTable = nullptr; } else { inputTable = input->getRootObject(); } //std::cout << "inputTable->size()=" << inputTable->size() << std::endl; // set up the output tuple output = std::make_shared<TupleSet>(); columns = new void*[positions.size()]; std::cout << "To get Prober: positions.size()=" << positions.size() << std::endl; if (columns == nullptr) { std::cout << "Error: No memory on heap, thrown from JoinProbe constructor" << std::endl; exit(1); } if (needToSwapLHSAndRhs) { offset = positions.size(); createCols<RHSType>(columns, *output, 0, 0, positions); } else { offset = 0; createCols<RHSType>( columns, *output, attsToIncludeInOutput.getAtts().size(), 0, positions); } // this is the input attribute that we will hash in order to try to find matches std::vector<int> matches = myMachine.match(attsToOperateOn); whichAtt = matches[0]; std::cout << "JoinProber is created with "<< output->getNumColumns() << " columns and whichAtt is " << whichAtt << std::endl; } std::string getType() override { return "JoinProbe"; } TupleSetPtr process(TupleSetPtr input) override { if (inputTable == nullptr) { return nullptr; } //std::cout << "whichAtt = " << whichAtt << std::endl; std::vector<size_t> inputHash = input->getColumn<size_t>(whichAtt); //std::cout << "inputHash.size()=" << inputHash.size() << std::endl; JoinMap<RHSType>& inputTableRef = *inputTable; // redo the vector of hash counts if it's not the correct size if (counts.size() != inputHash.size()) { counts.resize(inputHash.size()); } // now, run through and attempt to hash int overallCounter = 0; for (int i = 0; i < inputHash.size(); i++) { // deal with all of the matches int numHits = inputTableRef.count(inputHash[i]); if (numHits > 0) { auto a = inputTableRef.lookup(inputHash[i]); if (numHits != a.size()) { numHits = a.size(); std::cout << "WARNING: count() and lookup() return inconsistent results" << std::endl; } for (int which = 0; which < numHits; which++) { unpack(a[which], overallCounter, 0, columns); overallCounter++; } } // remember how many matches we had counts[i] = numHits; } //std::cout << "count=" << overallCounter << std::endl; // truncate if we have extra eraseEnd<RHSType>(overallCounter, 0, columns); // and finally, we need to relpicate the input data myMachine.replicate(input, output, counts, offset); // outta here! return output; } }; // JiaNote: this class is used to create a SinkMerger object that merges multiple JoinSinks for // broadcast join (writeOut()) and partition join (writeVectorOut()) template <typename RHSType> class JoinSinkMerger : public SinkMerger { public: ~JoinSinkMerger() {} JoinSinkMerger() {} JoinSinkMerger(int partitionId) { this->partitionId = partitionId; } int partitionId; int numHashKeys = 0; int mapIndex = 0; int listIndex = 0; int getNumHashKeys() override { return this->numHashKeys; } Handle<Object> createNewOutputContainer() override { // we simply create a new map to store the output Handle<JoinMap<RHSType>> returnVal = makeObject<JoinMap<RHSType>>(); return returnVal; } //for broadcast join void writeOut(Handle<Object> mergeMe, Handle<Object>& mergeToMe) override { // get the map we are adding to Handle<JoinMap<RHSType>> mergedMap = unsafeCast<JoinMap<RHSType>>(mergeToMe); JoinMap<RHSType>& myMap = *mergedMap; Handle<JoinMap<RHSType>> mapToMerge = unsafeCast<JoinMap<RHSType>>(mergeMe); JoinMap<RHSType>& theOtherMap = *mapToMerge; int counter = 0; for (JoinMapIterator<RHSType> iter = theOtherMap.begin(); iter != theOtherMap.end(); ++iter) { if (counter < mapIndex) { counter++; continue; } std::shared_ptr<JoinRecordList<RHSType>> myList = *iter; size_t mySize = myList->size(); size_t myHash = myList->getHash(); if (mySize > 0) { this->numHashKeys = this->numHashKeys + 1; for (size_t i = listIndex; i < mySize; i++) { try { RHSType* temp = &(myMap.push(myHash)); packData(*temp, ((*myList)[i])); } catch (NotEnoughSpace& n) { std::cout << "ERROR: join data is too large to be built in one map, " "results are truncated!" << std::endl; mapIndex = counter; listIndex = i; return; } } listIndex = 0; } counter++; } mapIndex = 0; } //for hash partitioned join void writeVectorOut(Handle<Object> mergeMe, Handle<Object>& mergeToMe) override { // get the map we are adding to Handle<JoinMap<RHSType>> mergedMap = unsafeCast<JoinMap<RHSType>>(mergeToMe); JoinMap<RHSType>& myMap = *mergedMap; Handle<Vector<Handle<JoinMap<RHSType>>>> mapsToMerge = unsafeCast<Vector<Handle<JoinMap<RHSType>>>>(mergeMe); Vector<Handle<JoinMap<RHSType>>>& theOtherMaps = *mapsToMerge; std::cout << "to merge maps with " << theOtherMaps.size() << " elements and mapIndex=" << mapIndex << ", listIndex=" << listIndex << std::endl; for (int i = 0; i < theOtherMaps.size(); i++) { JoinMap<RHSType>& theOtherMap = *(theOtherMaps[i]); if (theOtherMap.getPartitionId() != partitionId) { continue; } std::cout << "my Id is "<<partitionId <<", theOtherMap.getPartitionId()="<<theOtherMap.getPartitionId() << ", size="<< theOtherMap.size() << std::endl; int counter=0; for (JoinMapIterator<RHSType> iter = theOtherMap.begin(); iter != theOtherMap.end(); ++iter) { if (counter < mapIndex) { counter++; continue; } std::shared_ptr<JoinRecordList<RHSType>> myList = *iter; size_t mySize = myList->size(); size_t myHash = myList->getHash(); if (mySize > 0) { this->numHashKeys = this->numHashKeys + 1; for (size_t j = listIndex; j < mySize; j++) { try { RHSType* temp = &(myMap.push(myHash)); packData(*temp, ((*myList)[j])); } catch (NotEnoughSpace& n) { myMap.setUnused(myHash); listIndex = j; mapIndex = counter; std::cout << "FATAL ERROR: join data is too large to be built in one map, " "results are truncated with listIndex=" << listIndex << ", mapIndex=" << mapIndex << std::endl; exit(1); } } listIndex = 0; } counter++; } mapIndex = 0; } } }; // JiaNote: this class is used to create a special JoinSource that will generate a stream of // TupleSets from a series of JoinMaps template <typename RHSType> class PartitionedJoinMapTupleSetIterator : public ComputeSource { private: // my partition id size_t myPartitionId; // function to call to get another vector to process std::function<PDBPagePtr()> getAnotherVector; // function to call to free the vector std::function<void(PDBPagePtr)> doneWithVector; // this is the vector to process Handle<Vector<Handle<JoinMap<RHSType>>>> iterateOverMe; // the pointer to current page holding the vector, and the last page that we previously // processed Record<Vector<Handle<JoinMap<RHSType>>>>*myRec, *lastRec; // the page that contains the record PDBPagePtr myPage, lastPage; // how many objects to put into a chunk size_t chunkSize; // where we are in the Vector size_t pos; // the current JoinMap Handle<JoinMap<RHSType>> curJoinMap; // where we are in the JoinMap JoinMapIterator<RHSType> curJoinMapIter; // end iterator JoinMapIterator<RHSType> joinMapEndIter; // where we are in the Record list size_t posInRecordList; // and the tuple set we return TupleSetPtr output; // the hash column in the output TupleSet std::vector<size_t>* hashColumn; // this is the list of output columns except the hash column in the output TupleSet void** columns; // whether we have processed all pages bool isDone; std::shared_ptr<JoinRecordList<RHSType>> myList = nullptr; size_t myListSize = 0; size_t myHash = 0; RecordIteratorPtr myIter = nullptr; public: // the first param is the partition id of this iterator // the second param is a callback function that the iterator will call in order to obtain the // page holding the next vector to iterate // over. The third param is a callback that the iterator will call when the specified page is // done being processed and can be // freed. The fourth param tells us how many objects to put into a tuple set. // The fifth param tells us positions of those packed columns. PartitionedJoinMapTupleSetIterator(size_t myPartitionId, std::function<PDBPagePtr()> getAnotherVector, std::function<void(PDBPagePtr)> doneWithVector, size_t chunkSize, std::vector<int> positions) : getAnotherVector(getAnotherVector), doneWithVector(doneWithVector), chunkSize(chunkSize) { // set my partition id this->myPartitionId = myPartitionId; // create the tuple set that we'll return during iteration output = std::make_shared<TupleSet>(); // extract the vector from the input page myPage = getAnotherVector(); if (myPage != nullptr) { myIter = make_shared<RecordIterator>(myPage); if (myIter->hasNext() == true) { myRec = (Record<Vector<Handle<JoinMap<RHSType>>>>*)(myIter->next()); } else { myRec = nullptr; } } else { myIter = nullptr; myRec = nullptr; } if (myRec != nullptr) { iterateOverMe = myRec->getRootObject(); std::cout << myPartitionId << ": PartitionedJoinMapTupleSetIterator: Got iterateOverMe, positions.size()="<< positions.size() << std::endl; // create the output vector for objects and put it into the tuple set columns = new void*[positions.size()]; if (columns == nullptr) { std::cout << "Error: No memory on heap" << std::endl; exit(1); } createCols<RHSType>(columns, *output, 0, 0, positions); // create the output vector for hash value and put it into the tuple set hashColumn = new std::vector<size_t>(); if (hashColumn == nullptr) { std::cout << "Error: No memory on heap" << std::endl; exit(1); } output->addColumn(positions.size(), hashColumn, true); std::cout << myPartitionId << ": PartitionedJoinMapTupleSetIterator: now we have " << output->getNumColumns() << " columns in the output" << std::endl; isDone = false; } else { iterateOverMe = nullptr; output = nullptr; isDone = true; } // we are at position zero pos = 0; curJoinMap = nullptr; posInRecordList = 0; // and we have no data so far lastRec = nullptr; lastPage = nullptr; } void setChunkSize(size_t chunkSize) override { this->chunkSize = chunkSize; } size_t getChunkSize() override { return this->chunkSize; } // returns the next tuple set to process, or nullptr if there is not one to process TupleSetPtr getNextTupleSet() override { // JiaNote: below two lines are necessary to fix a bug that iterateOverMe may be nullptr // when first time get to here if (isDone == true) { return nullptr; } size_t posToRecover = pos; Handle<JoinMap<RHSType>> curJoinMapToRecover = curJoinMap; JoinMapIterator<RHSType> curJoinMapIterToRecover = curJoinMapIter; JoinMapIterator<RHSType> joinMapEndIterToRecover = joinMapEndIter; size_t posInRecordListToRecover = posInRecordList; std::shared_ptr<JoinRecordList<RHSType>> myListToRecover = myList; size_t myListSizeToRecover = myListSize; size_t myHashToRecover = myHash; int overallCounter = 0; hashColumn->clear(); while (true) { // if we made it here with lastRec being a valid pointer, then it means // that we have gone through an entire cycle, and so all of the data that // we will ever reference stored in lastRec has been fluhhed through the // pipeline; hence, we can kill it if (lastRec != nullptr) { lastRec = nullptr; } // if we have finished processing of current map, we need to get next map for processing while ((curJoinMap == nullptr) && (pos < iterateOverMe->size())) { curJoinMap = (*iterateOverMe)[pos]; pos++; if (curJoinMap != nullptr){ if (curJoinMap->getNumPartitions() >0) { if (((curJoinMap->getPartitionId() % curJoinMap->getNumPartitions()) == myPartitionId)&&(curJoinMap->size()>0)) { std::cout << "We've got a non-null map with partitionId=" << myPartitionId << ", pos=" << pos <<", size=" << curJoinMap->size() << ", in page Id="<<myPage->getPageID() << ", referenceCount="<< myPage->getRefCount()<< std::endl; //curJoinMap->print(); curJoinMapIter = curJoinMap->begin(); joinMapEndIter = curJoinMap->end(); posInRecordList = 0; } else { curJoinMap = nullptr; } } else { curJoinMap = nullptr; std::cout << "Warning: a map has 0 partitions" << std::endl; } } } // there are two possibilities, first we find my map, second we come to end of this page if (curJoinMap != nullptr) { //initialize the states if we currently do not have a list in the map to traverse yet if (myList == nullptr) { if (curJoinMapIter != joinMapEndIter) { myList = *curJoinMapIter; myListSize = myList->size(); myHash = myList->getHash(); posInRecordList = 0; } } //loop to fill in the output tupleset while (curJoinMapIter != joinMapEndIter) { for (size_t i = posInRecordList; i < myListSize; i++) { try { //put the input object into the tupleset unpack((*myList)[i], overallCounter, 0, columns); } catch (NotEnoughSpace& n) { //if we cannot write out the whole map, we roll back to the initial state when we enter this function. pos = posToRecover; curJoinMap = curJoinMapToRecover; curJoinMapIter = curJoinMapIterToRecover; joinMapEndIter = joinMapEndIterToRecover; posInRecordList = posInRecordListToRecover; myList = myListToRecover; myListSize = myListSizeToRecover; myHash = myHashToRecover; std::cout << "PartitionedJoinMapTupleSetIterator roll back with partitionId=" << myPartitionId << ", pos="<< pos << ", myListSize=" << myListSize << ", myHash=" << myHash << ", posInRecordList=" << posInRecordList << std::endl; throw n; } hashColumn->push_back(myHash); posInRecordList++; overallCounter++; if (overallCounter == this->chunkSize) { hashColumn->resize(overallCounter); eraseEnd<RHSType>(overallCounter, 0, columns); return output; } } if (posInRecordList >= myListSize) { ++curJoinMapIter; if (curJoinMapIter != joinMapEndIter) { myList = *curJoinMapIter; myListSize = myList->size(); myHash = myList->getHash(); } else { myList = nullptr; myListSize = 0; myHash = 0; } posInRecordList = 0; } } //we have finished the lists in this join map curJoinMap = nullptr; }//while if ((curJoinMap == nullptr) && (pos == iterateOverMe->size())) { iterateOverMe = nullptr; pos = 0; lastRec = myRec; } // if we have come to the end of the iterateOverMe, we need fetch a new rec or even a new page while (iterateOverMe == nullptr) { // this means that we got to the end of the vector if (myIter != nullptr) { if (myIter->hasNext() == true) { myRec = (Record<Vector<Handle<JoinMap<RHSType>>>>*)myIter->next(); } else { myRec = nullptr; } } else { myRec = nullptr; } if (myRec == nullptr) { lastPage = myPage; // try to get another vector myPage = getAnotherVector(); if (myPage != nullptr) { myIter = std::make_shared<RecordIterator>(myPage); if (myIter->hasNext() == true) { myRec = (Record<Vector<Handle<JoinMap<RHSType>>>>*)(myIter->next()); } else { myRec = nullptr; myIter = nullptr; } } else { myRec = nullptr; myIter = nullptr; } if (lastPage != nullptr) { doneWithVector(lastPage); lastPage = nullptr; } iterateOverMe = nullptr; if (myPage == nullptr){ isDone = true; if (overallCounter > 0) { hashColumn->resize(overallCounter); eraseEnd<RHSType>(overallCounter, 0, columns); overallCounter = 0; return output; } return nullptr; } } if (myRec != nullptr) { // and reset everything iterateOverMe = myRec->getRootObject(); pos = 0; } } // our counter hasn't been full, so we continue the loop } isDone = true; iterateOverMe = nullptr; return nullptr; } ~PartitionedJoinMapTupleSetIterator() { // if lastRec is not a nullptr, then it means that we have not yet freed it if ((lastRec != nullptr) && (lastPage != nullptr)) { makeObjectAllocatorBlock(4096, true); doneWithVector(lastPage); } lastRec = nullptr; lastPage = nullptr; myRec = nullptr; myPage = nullptr; } }; // JiaNote: this class is used to create a Shuffler that picks all JoinMaps that belong to one node, // and push back JoinMaps to another vector. template <typename RHSType> class JoinSinkShuffler : public SinkShuffler { private: int nodeId; int curListIndex = 0; int curMapIndex = 0; PDBLoggerPtr logger = nullptr; public: ~JoinSinkShuffler() {} JoinSinkShuffler() { } void setNodeId(int nodeId) override { this->nodeId = nodeId; logger = std::make_shared<PDBLogger>("repartition"+std::to_string(nodeId)+".log"); } int getNodeId() override { return nodeId; } void setListIndex(int index) { curListIndex = index; } int getListIndex() { return curListIndex; } void setMapIndex(int index) { curMapIndex = index; } int getMapIndex() { return curMapIndex; } Handle<Object> createNewOutputContainer() override { // we simply create a new map to store the output Handle<Vector<Handle<JoinMap<RHSType>>>> returnVal = makeObject<Vector<Handle<JoinMap<RHSType>>>>(); return returnVal; } bool writeOut(Handle<Object> shuffleMe, Handle<Object>& shuffleToMe) override { // get the map we are adding to if (shuffleMe == nullptr) { std::cout << "Error: To shuffle a NULL JoinMap" << std::endl; return true; } if (shuffleToMe == nullptr) { std::cout << "Error: To shuffle to a NULL Vector of JoinMap" << std::endl; return true; } Handle<JoinMap<RHSType>> theOtherMap = unsafeCast<JoinMap<RHSType>>(shuffleMe); JoinMap<RHSType> mapToShuffle = *theOtherMap; Handle<Vector<Handle<JoinMap<RHSType>>>> shuffledMaps = unsafeCast<Vector<Handle<JoinMap<RHSType>>>, Object>(shuffleToMe); Vector<Handle<JoinMap<RHSType>>>& myMaps = *shuffledMaps; Handle<JoinMap<RHSType>> thisMap=nullptr; try { thisMap = makeObject<JoinMap<RHSType>>(mapToShuffle.size()-getMapIndex(), mapToShuffle.getPartitionId(), mapToShuffle.getNumPartitions()); } catch (NotEnoughSpace& n) { std::cout << nodeId << ": Can't allocate for new map with " << mapToShuffle.size() << " elements" << std::endl; logger->writeLn("Can't allocate for new map with "); logger->writeInt(mapToShuffle.size()); logger->writeLn(" elements"); if (mapToShuffle.size() > 1000000000) { exit(1); } return false; } JoinMap<RHSType>& myMap = *thisMap; int counter = 0; int mapIndex = getMapIndex(); int numPacked = 0; std::cout << nodeId <<": this map has " << mapToShuffle.size() << " elements with mapIndex="<< getMapIndex() << ", listIndex=" << getListIndex() << std::endl; logger->writeInt(mapToShuffle.size()); logger->writeLn(" elements with mapIndex="); logger->writeInt(getMapIndex()); logger->writeLn(", listIndex="); logger->writeInt(getListIndex()); for (JoinMapIterator<RHSType> iter = mapToShuffle.begin(); iter != mapToShuffle.end(); ++iter) { if (counter < mapIndex) { counter++; continue; } std::shared_ptr<JoinRecordList<RHSType>> myList = *iter; if (myList == nullptr) { std::cout << "meet a null list in JoinRecordList" << std::endl; continue; } size_t mySize = myList->size(); size_t myHash = myList->getHash(); if (mySize > 0) { int listIndex = getListIndex(); for (size_t i = listIndex; i < mySize; i++) { if (myMap.count(myHash) == 0) { try { RHSType* temp = &(myMap.push(myHash)); packData(*temp, ((*myList)[i])); //std::cout << temp->myData.toString(); numPacked++; } catch (NotEnoughSpace& n) { myMap.setUnused(myHash); //myMap.print(); setListIndex(i); setMapIndex(counter); std::cout << nodeId << ":1: Run out of space in shuffling, to allocate a new page with listIndex=" << getListIndex() << ", mapIndex=" << getMapIndex() << ", mapSize="<< myMap.size()<<std::endl; logger->writeLn(":1: Run out of space in shuffling, to allocate a new page with listIndex="); logger->writeInt(getListIndex()); logger->writeLn(", mapIndex="); logger->writeInt(getMapIndex()); logger->writeLn(", mapSize="); logger->writeInt(myMap.size()); if (myMap.size() != 0) { myMaps.push_back(thisMap); } return false; } } else { RHSType* temp = nullptr; try { temp = &(myMap.push(myHash)); } catch (NotEnoughSpace& n) { //we may loose one element here, but no better way to handle this std::cout << nodeId<<":mapSize=" << myMap.size()<<std::endl; myMap.setUnused(myHash); //myMap.print(); setListIndex(i); setMapIndex(counter); std::cout << nodeId << ":2: Run out of space in shuffling, to allocate a new page with listIndex=" << getListIndex() << ", mapIndex=" << getMapIndex() << ", mapSize="<<myMap.size() << std::endl; logger->writeLn(":2: Run out of space in shuffling, to allocate a new page with listIndex="); logger->writeInt(getListIndex()); logger->writeLn(", mapIndex="); logger->writeInt(getMapIndex()); logger->writeLn(", mapSize="); logger->writeInt(myMap.size()); if (myMap.size() != 0) { myMaps.push_back(thisMap); } return false; } try { packData(*temp, ((*myList)[i])); //std::cout << temp->myData.toString(); numPacked++; } catch (NotEnoughSpace& n) { myMap.setUnused(myHash); //myMap.print(); setListIndex(i); setMapIndex(counter); std::cout << nodeId << ":3: Run out of space in shuffling, to allocate a new page with listIndex=" << getListIndex() << ", mapIndex=" << getMapIndex() << ", mapSize="<<myMap.size() << std::endl; logger->writeLn(":3: Run out of space in shuffling, to allocate a new page with listIndex="); logger->writeInt(getListIndex()); logger->writeLn(", mapIndex="); logger->writeInt(getMapIndex()); logger->writeLn(", mapSize="); logger->writeInt(myMap.size()); if (myMap.size() != 0) { myMaps.push_back(thisMap); } return false; } } } setListIndex(0); } counter++; } // Push back when the whole map has been copied. If it throws exception // earlier than this point, we save the positions of the map and the // index of the list where we stopped so that we can resume again on the // next call. try { myMaps.push_back(thisMap); //myMaps[myMaps.size()-1]->print(); } catch (NotEnoughSpace& n) { std::cout << nodeId <<": Run out of space in shuffling at the beginning of processing a map, to allocate a new page with listIndex=" << getListIndex() << ", mapIndex=" << getMapIndex() << std::endl; return false; } setMapIndex(0); return true; } }; // JiaNote: this class is used to create a special JoinSink that are partitioned into multiple // JoinMaps template <typename RHSType> class PartitionedJoinSink : public ComputeSink { private: // number of partitions int numPartitionsPerNode; // number of nodes for shuffling int numNodes; // tells us which attribute is the key int keyAtt; // if useTheseAtts[i] = j, it means that the i^th attribute that we need to extract from the // input tuple is j std::vector<int> useTheseAtts; // if whereEveryoneGoes[i] = j, it means that the i^th entry in useTheseAtts goes in the j^th // slot in the holder tuple std::vector<int> whereEveryoneGoes; // this is the list of columns that we are processing void** columns = nullptr; public: ~PartitionedJoinSink() { } PartitionedJoinSink(int numPartitionsPerNode, int numNodes, TupleSpec& inputSchema, TupleSpec& attsToOperateOn, TupleSpec& additionalAtts, std::vector<int>& whereEveryoneGoes) : whereEveryoneGoes(whereEveryoneGoes) { this->numPartitionsPerNode = numPartitionsPerNode; this->numNodes = numNodes; // used to manage attributes and set up the output TupleSetSetupMachine myMachine(inputSchema); // figure out the key att std::vector<int> matches = myMachine.match(attsToOperateOn); keyAtt = matches[0]; // now, figure out the attributes that we need to store in the hash table useTheseAtts = myMachine.match(additionalAtts); } Handle<Object> createNewOutputContainer() override { // we create a vector of maps to store the output Handle<Vector<Handle<Vector<Handle<JoinMap<RHSType>>>>>> returnVal = makeObject<Vector<Handle<Vector<Handle<JoinMap<RHSType>>>>>>(numNodes); for (int i = 0; i < numNodes; i++) { Handle<Vector<Handle<JoinMap<RHSType>>>> myVector = makeObject<Vector<Handle<JoinMap<RHSType>>>>(numPartitionsPerNode); for (int j = 0; j < numPartitionsPerNode; j++) { Handle<JoinMap<RHSType>> myMap = makeObject<JoinMap<RHSType>>( 2, i * numPartitionsPerNode + j, numPartitionsPerNode); myVector->push_back(myMap); } returnVal->push_back(myVector); } return returnVal; } void writeOut(TupleSetPtr input, Handle<Object>& writeToMe) override { //std::cout << "PartitionedJoinSink: write out tuples in this tuple set" << std::endl; // get the map we are adding to Handle<Vector<Handle<Vector<Handle<JoinMap<RHSType>>>>>> writeMe = unsafeCast<Vector<Handle<Vector<Handle<JoinMap<RHSType>>>>>>(writeToMe); // get all of the columns if (columns == nullptr) { columns = new void*[whereEveryoneGoes.size()]; if (columns == nullptr) { std::cout << "Error: No memory on heap" << std::endl; exit(1); } } int counter = 0; // before: for (auto &a: whereEveryoneGoes) { for (counter = 0; counter < whereEveryoneGoes.size(); counter++) { // before: columns[a] = (void *) &(input->getColumn <int> (useTheseAtts[counter])); columns[counter] = (void*)&(input->getColumn<int>(useTheseAtts[whereEveryoneGoes[counter]])); // before: counter++; } // this is where the hash attribute is located std::vector<size_t>& keyColumn = input->getColumn<size_t>(keyAtt); size_t length = keyColumn.size(); //std::cout << "length is " << length << std::endl; for (size_t i = 0; i < length; i++) { #ifndef NO_MOD_PARTITION size_t index = keyColumn[i] % (this->numPartitionsPerNode * this->numNodes); #else size_t index = (keyColumn[i] / (this->numPartitionsPerNode * this->numNodes)) % (this->numPartitionsPerNode * this->numNodes); #endif //std::cout << "index=" << index << std::endl; size_t nodeIndex = index / this->numPartitionsPerNode; size_t partitionIndex = index % this->numPartitionsPerNode; JoinMap<RHSType>& myMap = *((*((*writeMe)[nodeIndex]))[partitionIndex]); //std::cout << "nodeIndex=" << nodeIndex << ", partitionIndex=" <<partitionIndex // << ", myMap.size="<<myMap.size()<<std::endl; // try to add the key... this will cause an allocation for a new key/val pair if (myMap.count(keyColumn[i]) == 0) { try { RHSType& temp = myMap.push(keyColumn[i]); pack(temp, i, 0, columns); // if we get an exception, then we could not fit a new key/value pair } catch (NotEnoughSpace& n) { std::cout << "1: we are running out of space in writing join sink with nodeIndex=" << nodeIndex << ", hash=" << keyColumn[i] << ", partitionIndex=" << partitionIndex << std::endl; std::cout << i << ": nodeIndex=" << nodeIndex << ", partitionIndex=" <<partitionIndex << ", myMap.size="<<myMap.size()<<std::endl; // if we got here, then we ran out of space, and so we need to delete the // already-processed // data so that we can try again... myMap.setUnused(keyColumn[i]); truncate<RHSType>(i, 0, columns); keyColumn.erase(keyColumn.begin(), keyColumn.begin() + i); std::cout << "remove " << i << " from " << length << std::endl; throw n; } // the key is there } else { // and add the value RHSType* temp = nullptr; try { temp = &(myMap.push(keyColumn[i])); // an exception means that we couldn't complete the addition } catch (NotEnoughSpace& n) { std::cout << "2: we are running out of space in writing join sink with nodeIndex=" << nodeIndex << ", hash=" << keyColumn[i] << ", partitionIndex=" << partitionIndex << std::endl; std::cout << i << ": nodeIndex=" << nodeIndex << ", partitionIndex=" <<partitionIndex << ", myMap.size="<<myMap.size()<<std::endl; //we may loose one element here, but no better way to handle this myMap.setUnused(keyColumn[i]); truncate<RHSType>(i, 0, columns); keyColumn.erase(keyColumn.begin(), keyColumn.begin() + i); std::cout << "remove " << i << " from " << length << std::endl; throw n; } // now try to do the copy try { pack(*temp, i, 0, columns); // if the copy didn't work, pop the value off } catch (NotEnoughSpace& n) { std::cout << "3: we are running out of space in writing join sink with nodeIndex=" << nodeIndex << ", hash=" << keyColumn[i] << ", partitionIndex=" << partitionIndex << std::endl; std::cout << i << ": nodeIndex=" << nodeIndex << ", partitionIndex=" <<partitionIndex << ", myMap.size="<<myMap.size()<<std::endl; myMap.setUnused(keyColumn[i]); truncate<RHSType>(i, 0, columns); keyColumn.erase(keyColumn.begin(), keyColumn.begin() + i); std::cout << "remove " << i << " from " << length << std::endl; throw n; } } } } }; // this class is used to create a ComputeSink object that stores special objects that wrap up // multiple columns of a tuple template <typename RHSType> class JoinSink : public ComputeSink { private: // tells us which attribute is the key int keyAtt; size_t loopId=0; // if useTheseAtts[i] = j, it means that the i^th attribute that we need to extract from the // input tuple is j std::vector<int> useTheseAtts; // if whereEveryoneGoes[i] = j, it means that the i^th entry in useTheseAtts goes in the j^th // slot in the holder tuple std::vector<int> whereEveryoneGoes; // this is the list of columns that we are processing void** columns = nullptr; public: ~JoinSink() { std::cout << "JoinSink: cleanup columns" << std::endl; } JoinSink(TupleSpec& inputSchema, TupleSpec& attsToOperateOn, TupleSpec& additionalAtts, std::vector<int>& whereEveryoneGoes) : whereEveryoneGoes(whereEveryoneGoes) { // used to manage attributes and set up the output TupleSetSetupMachine myMachine(inputSchema); // figure out the key att std::vector<int> matches = myMachine.match(attsToOperateOn); keyAtt = matches[0]; // now, figure out the attributes that we need to store in the hash table useTheseAtts = myMachine.match(additionalAtts); } Handle<Object> createNewOutputContainer() override { std::cout << "JoinSink: to create new JoinMap instance" << std::endl; // we simply create a new map to store the output Handle<JoinMap<RHSType>> returnVal = makeObject<JoinMap<RHSType>>(); return returnVal; } void writeOut(TupleSetPtr input, Handle<Object>& writeToMe) override { loopId++; if (loopId%20000==0) std::cout << "JoinSink: write out "<< loopId <<" tuple sets" << std::endl; // get the map we are adding to Handle<JoinMap<RHSType>> writeMe = unsafeCast<JoinMap<RHSType>>(writeToMe); JoinMap<RHSType>& myMap = *writeMe; // get all of the columns if (columns == nullptr){ columns = new void*[whereEveryoneGoes.size()]; if (columns == nullptr) { std::cout << "Error: No memory on heap" << std::endl; exit(1); } } int counter = 0; // before: for (auto &a: whereEveryoneGoes) { for (counter = 0; counter < whereEveryoneGoes.size(); counter++) { // before: columns[a] = (void *) &(input->getColumn <int> (useTheseAtts[counter])); columns[counter] = (void*)&(input->getColumn<int>(useTheseAtts[whereEveryoneGoes[counter]])); // before: counter++; } // this is where the hash attribute is located std::vector<size_t>& keyColumn = input->getColumn<size_t>(keyAtt); size_t length = keyColumn.size(); for (size_t i = 0; i < length; i++) { // try to add the key... this will cause an allocation for a new key/val pair if (myMap.count(keyColumn[i]) == 0) { try { RHSType& temp = myMap.push(keyColumn[i]); pack(temp, i, 0, columns); // if we get an exception, then we could not fit a new key/value pair } catch (NotEnoughSpace& n) { // if we got here, then we ran out of space, and so we need to delete the // already-processed // data so that we can try again... myMap.setUnused(keyColumn[i]); truncate<RHSType>(i, 0, columns); keyColumn.erase(keyColumn.begin(), keyColumn.begin() + i); std::cout << "remove " << i << " from " << length << std::endl; std::cout << "JoinMap overflows the page with " << myMap.size() << " elements" << std::endl; throw n; } // the key is there } else { // and add the value RHSType* temp = nullptr; try { temp = &(myMap.push(keyColumn[i])); // an exception means that we couldn't complete the addition } catch (NotEnoughSpace& n) { //we may loose one element here, but no better way to handle this myMap.setUnused(keyColumn[i]); truncate<RHSType>(i, 0, columns); keyColumn.erase(keyColumn.begin(), keyColumn.begin() + i); std::cout << "remove " << i << " from " << length << std::endl; std::cout << "JoinMap overflows the page with " << myMap.size() << " elements" << std::endl; throw n; } // now try to do the copy try { pack(*temp, i, 0, columns); // if the copy didn't work, pop the value off } catch (NotEnoughSpace& n) { myMap.setUnused(keyColumn[i]); truncate<RHSType>(i, 0, columns); keyColumn.erase(keyColumn.begin(), keyColumn.begin() + i); std::cout << "remove " << i << " from " << length << std::endl; std::cout << "JoinMap overflows the page with " << myMap.size() << " elements" << std::endl; throw n; } } } } }; // all join singletons descend from this class JoinTupleSingleton { public: virtual ComputeExecutorPtr getProber(void* hashTable, std::vector<int>& positions, TupleSpec& inputSchema, TupleSpec& attsToOperateOn, TupleSpec& attsToIncludeInOutput, bool needToSwapLHSAndRhs) = 0; virtual ComputeExecutorPtr getPartitionedProber( PartitionedHashSetPtr partitionedHashTable, int numPartitionsPerNode, int numNodes, std::vector<int>& positions, TupleSpec& inputSchema, TupleSpec& attsToOperateOn, TupleSpec& attsToIncludeInOutput, bool needToSwapLHSAndRhs) = 0; virtual ComputeSinkPtr getSink(TupleSpec& consumeMe, TupleSpec& attsToOpOn, TupleSpec& projection, std::vector<int>& whereEveryoneGoes) = 0; virtual ComputeSinkPtr getPartitionedSink(int numPartitionsPerNode, int numNodes, TupleSpec& consumeMe, TupleSpec& attsToOpOn, TupleSpec& projection, std::vector<int>& whereEveryoneGoes) = 0; virtual ComputeSourcePtr getPartitionedSource(size_t myPartitionId, std::function<PDBPagePtr()> getAnotherVector, std::function<void(PDBPagePtr)> doneWithVector, size_t chunkSize, std::vector<int>& whereEveryoneGoes) = 0; virtual SinkMergerPtr getMerger(int partitionId) = 0; virtual SinkShufflerPtr getShuffler() = 0; }; // this is an actual class template <typename HoldMe> class JoinSingleton : public JoinTupleSingleton { // the actual data that we hold HoldMe myData; public: // gets a hash table prober ComputeExecutorPtr getProber(void* hashTable, std::vector<int>& positions, TupleSpec& inputSchema, TupleSpec& attsToOperateOn, TupleSpec& attsToIncludeInOutput, bool needToSwapLHSAndRhs) override { return std::make_shared<JoinProbe<HoldMe>>(hashTable, positions, inputSchema, attsToOperateOn, attsToIncludeInOutput, needToSwapLHSAndRhs); } ComputeExecutorPtr getPartitionedProber( PartitionedHashSetPtr partitionedHashTable, int numPartitionsPerNode, int numNodes, std::vector<int>& positions, TupleSpec& inputSchema, TupleSpec& attsToOperateOn, TupleSpec& attsToIncludeInOutput, bool needToSwapLHSAndRhs) override { return std::make_shared<PartitionedJoinProbe<HoldMe>>( partitionedHashTable, numPartitionsPerNode, numNodes, positions, inputSchema, attsToOperateOn, attsToIncludeInOutput, needToSwapLHSAndRhs); } // creates a compute sink for this particular type ComputeSinkPtr getSink(TupleSpec& consumeMe, TupleSpec& attsToOpOn, TupleSpec& projection, std::vector<int>& whereEveryoneGoes) override { return std::make_shared<JoinSink<HoldMe>>( consumeMe, attsToOpOn, projection, whereEveryoneGoes); } // JiaNote: create a partitioned sink for this particular type ComputeSinkPtr getPartitionedSink(int numPartitionsPerNode, int numNodes, TupleSpec& consumeMe, TupleSpec& attsToOpOn, TupleSpec& projection, std::vector<int>& whereEveryoneGoes) override { return std::make_shared<PartitionedJoinSink<HoldMe>>( numPartitionsPerNode, numNodes, consumeMe, attsToOpOn, projection, whereEveryoneGoes); } // JiaNote: create a partitioned source for this particular type ComputeSourcePtr getPartitionedSource(size_t myPartitionId, std::function<PDBPagePtr()> getAnotherVector, std::function<void(PDBPagePtr)> doneWithVector, size_t chunkSize, std::vector<int>& whereEveryoneGoes) override { return std::make_shared<PartitionedJoinMapTupleSetIterator<HoldMe>>( myPartitionId, getAnotherVector, doneWithVector, chunkSize, whereEveryoneGoes); } // JiaNote: create a merger SinkMergerPtr getMerger(int partitionId) override { return std::make_shared<JoinSinkMerger<HoldMe>>(partitionId); } // JiaNote: create a shuffler SinkShufflerPtr getShuffler() override { return std::make_shared<JoinSinkShuffler<HoldMe>>(); } }; typedef std::shared_ptr<JoinTupleSingleton> JoinTuplePtr; inline int findType(std::string& findMe, std::vector<std::string>& typeList) { for (int i = 0; i < typeList.size(); i++) { //std::cout << "typeList[" << i << "]=" << typeList[i] << std::endl; if (typeList[i] == findMe) { typeList[i] = std::string(""); return i; } } return -1; } template <typename In1> typename std::enable_if<std::is_base_of<JoinTupleBase, In1>::value, JoinTuplePtr>::type findCorrectJoinTuple(std::vector<std::string>& typeList, std::vector<int>& whereEveryoneGoes); template <typename In1, typename... Rest> typename std::enable_if<sizeof...(Rest) != 0 && !std::is_base_of<JoinTupleBase, In1>::value, JoinTuplePtr>::type findCorrectJoinTuple(std::vector<std::string>& typeList, std::vector<int>& whereEveryoneGoes); template <typename In1, typename In2, typename... Rest> typename std::enable_if<std::is_base_of<JoinTupleBase, In1>::value, JoinTuplePtr>::type findCorrectJoinTuple(std::vector<std::string>& typeList, std::vector<int>& whereEveryoneGoes); template <typename In1> typename std::enable_if<!std::is_base_of<JoinTupleBase, In1>::value, JoinTuplePtr>::type findCorrectJoinTuple(std::vector<std::string>& typeList, std::vector<int>& whereEveryoneGoes); template <typename In1> typename std::enable_if<!std::is_base_of<JoinTupleBase, In1>::value, JoinTuplePtr>::type findCorrectJoinTuple(std::vector<std::string>& typeList, std::vector<int>& whereEveryoneGoes) { // we must always have one type... //std::cout << "to find correct join tuple" << std::endl; JoinTuplePtr returnVal; std::string in1Name = getTypeName<Handle<In1>>(); std::cout << "in1Name is " << in1Name << std::endl; std::cout << "to find type for " << in1Name << std::endl; int in1Pos = findType(in1Name, typeList); std::cout << "in1Pos is " << in1Pos << std::endl; if (in1Pos != -1) { whereEveryoneGoes.push_back(in1Pos); typeList[in1Pos] = in1Name; std::cout << "typeList[" << in1Pos << "]=" << in1Name << std::endl; return std::make_shared<JoinSingleton<JoinTuple<In1, char[0]>>>(); } else { std::cout << "Why did we not find a type?\n"; exit(1); } } template <typename In1> typename std::enable_if<std::is_base_of<JoinTupleBase, In1>::value, JoinTuplePtr>::type findCorrectJoinTuple(std::vector<std::string>& typeList, std::vector<int>& whereEveryoneGoes) { return std::make_shared<JoinSingleton<In1>>(); } template <typename In1, typename... Rest> typename std::enable_if<sizeof...(Rest) != 0 && !std::is_base_of<JoinTupleBase, In1>::value, JoinTuplePtr>::type findCorrectJoinTuple(std::vector<std::string>& typeList, std::vector<int>& whereEveryoneGoes) { JoinTuplePtr returnVal; std::string in1Name = getTypeName<Handle<In1>>(); int in1Pos = findType(in1Name, typeList); if (in1Pos != -1) { returnVal = findCorrectJoinTuple<JoinTuple<In1, char[0]>, Rest...>(typeList, whereEveryoneGoes); whereEveryoneGoes.push_back(in1Pos); typeList[in1Pos] = in1Name; } else { returnVal = findCorrectJoinTuple<Rest...>(typeList, whereEveryoneGoes); } return returnVal; } template <typename In1, typename In2, typename... Rest> typename std::enable_if<std::is_base_of<JoinTupleBase, In1>::value, JoinTuplePtr>::type findCorrectJoinTuple(std::vector<std::string>& typeList, std::vector<int>& whereEveryoneGoes) { JoinTuplePtr returnVal; std::string in2Name = getTypeName<Handle<In2>>(); int in2Pos = findType(in2Name, typeList); if (in2Pos != -1) { returnVal = findCorrectJoinTuple<JoinTuple<In2, In1>, Rest...>(typeList, whereEveryoneGoes); whereEveryoneGoes.push_back(in2Pos); typeList[in2Pos] = in2Name; } else { returnVal = findCorrectJoinTuple<In1, Rest...>(typeList, whereEveryoneGoes); } return returnVal; } } #endif
40.289459
251
0.543335
[ "object", "vector" ]
6f8732c97746b316d42587deed1ba1000dc2f1a5
4,416
h
C
Source/Engine/Rendering/RenderingMemoryAllocator.h
everard/SELENE-Device
775bb5cf66ba9fdbc55eac7b216e035c36d82954
[ "MIT" ]
null
null
null
Source/Engine/Rendering/RenderingMemoryAllocator.h
everard/SELENE-Device
775bb5cf66ba9fdbc55eac7b216e035c36d82954
[ "MIT" ]
null
null
null
Source/Engine/Rendering/RenderingMemoryAllocator.h
everard/SELENE-Device
775bb5cf66ba9fdbc55eac7b216e035c36d82954
[ "MIT" ]
null
null
null
// Copyright (c) 2012 Nezametdinov E. Ildus // Licensed under the MIT License (see LICENSE.txt for details) #ifndef RENDERING_MEMORY_ALLOCATOR_H #define RENDERING_MEMORY_ALLOCATOR_H #include "RenderingMemoryBuffer.h" #include <limits> namespace selene { /** * \addtogroup Rendering * @{ */ /** * Represents rendering memory allocator. Allocates memory from specified rendering * memory buffer. Should be used only for simple object types (which do not allocate * memory in the heap), because destructor for constructed objects is never called. */ template <class T> class RenderingMemoryAllocator { public: // Type definitions according to C++11 Standard typedef T value_type; typedef T* pointer; typedef T& reference; typedef const T* const_pointer; typedef const T& const_reference; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; template <class U> class rebind { public: typedef RenderingMemoryAllocator<U> other; }; /** * \brief Constructs allocator with given memory buffer. * \param[in] memoryBuffer rendering memory buffer */ RenderingMemoryAllocator(RenderingMemoryBuffer& memoryBuffer): memoryBuffer_(&memoryBuffer) {} RenderingMemoryAllocator(const RenderingMemoryAllocator&) = default; template <class U> RenderingMemoryAllocator(const RenderingMemoryAllocator<U>& other): memoryBuffer_(other.memoryBuffer_) {} ~RenderingMemoryAllocator() {} RenderingMemoryAllocator& operator =(const RenderingMemoryAllocator&) = default; /** * \brief Allocates memory for given number of objects. * * This function ignores the second parameter, because there is no * need to search for free memory in rendering memory buffer. * \param[in] n number of objects * \return pointer to the allocated memory chunk */ pointer allocate(size_type n, const void*) { return allocate(n); } /** * \brief Allocates memory for given number of objects. * \param[in] n number of objects * \return pointer to the allocated memory chunk */ pointer allocate(size_type n) { return memoryBuffer_->allocateMemory<value_type>(n); } /** * \brief Does nothing. * * Rendering memory is deallocated with call to RenderingMemoryBuffer::clear() function. */ void deallocate(pointer, size_type) {} /** * \brief Returns the largest value that can meaningfully be * passed to allocate() function. * \return std::numeric_limits<size_type>::max() */ size_type max_size() const { return std::numeric_limits<size_type>::max(); } /** * \brief Constructs object of type T at p. * \param[in] p location at which object should be constructed * \param[in] val const reference to the object, which is used for * copy construction */ void construct(pointer p, const_reference val) { new(static_cast<void*>(p)) T(val); } /** * \brief Does nothing. * * Destructors of objects are never called. */ template <class U> void destroy(U*) {} private: template <class U> friend class RenderingMemoryAllocator; RenderingMemoryBuffer* memoryBuffer_; }; /** * @} */ } #endif
35.612903
110
0.510417
[ "object" ]
6f97ed59db09c006869eedd2a53ec36d46ba11f0
3,910
h
C
include/IronMind/Tensor.h
Cc618/Iron-Mind
c0143ccab5fe3fbeb63e49dd186d4b37789dd2f0
[ "MIT" ]
null
null
null
include/IronMind/Tensor.h
Cc618/Iron-Mind
c0143ccab5fe3fbeb63e49dd186d4b37789dd2f0
[ "MIT" ]
null
null
null
include/IronMind/Tensor.h
Cc618/Iron-Mind
c0143ccab5fe3fbeb63e49dd186d4b37789dd2f0
[ "MIT" ]
null
null
null
#pragma once // A tensor is a collection that gather // multiple values and have a shape #include <vector> #include <string> #include "IronMind/Loss.h" #include "IronMind/types.h" #include "IronMind/Initializer.h" namespace im { class Tensor { friend value_t Loss::Compare(const Tensor&, const Tensor&) const; friend void Initializer::Init(Tensor&); public: // Loads a tensor using buffer or file static Tensor Load(const std::vector<uint8_t>& BUFFER); static Tensor Load(const std::string& PATH); // Creates tensor plenty of values static Tensor Values(const shape_t& SHAPE, const value_t VAL=0.f); public: Tensor(); Tensor(const value_list_t& DATA, const shape_t& SHAPE); Tensor(const Tensor& OTHER); ~Tensor(); public: // The number of values size_t Size() const; shape_t Shape() const; // A pointer to all values const value_t *Data() const; // Reshapes the tensor // The tensor must contain // the same values after this call void Reshape(const shape_t SHAPE); // String representation functions std::string ToString() const; void Print() const; // To save it std::vector<uint8_t> ToBytes() const; void Save(const std::string& PATH) const; // Computes the weigthed sum // Optimized version of vector dot weights // If TRANSPOSE, WEIGHTS will be transposed // * This tensor must have one dimension (a shape like { n }) // * The second tensor must have two dimensions (a shape like { n, m }) // * The result will have a shape like { m } Tensor WeightedSum(const Tensor &WEIGHTS, const bool TRANSPOSE=false) const; // Computes the outer product of two vectors (one dimensional tensors) // * They must have shapes { n } and { m } // * The result has the shape { n, m } Tensor Outer(const Tensor &OTHER) const; // Applies the function f on each values Tensor &Map(void (*f)(float &val)); // Adds 1 to the shape DIMS times Tensor &ExpandDims(const size_t DIMS=1); // Set values to zero Tensor &Zero(); // Set values to VALUE Tensor &Set(const value_t VAL); public: // Access to an item value_t operator[](const shape_t& INDICES) const; value_t &operator[](const shape_t& INDICES); Tensor &operator=(const Tensor& OTHER); // Element wise operations Tensor &operator+=(const Tensor& OTHER); Tensor &operator-=(const Tensor& OTHER); Tensor &operator*=(const Tensor& OTHER); Tensor &operator/=(const Tensor& OTHER); Tensor operator+(const Tensor& OTHER) const; Tensor operator-(const Tensor& OTHER) const; Tensor operator*(const Tensor& OTHER) const; Tensor operator/(const Tensor& OTHER) const; Tensor &operator*=(const value_t v); Tensor operator*(const value_t v) const; private: // Unsafe constructor // !!! DATA is not duplicated // !!! DATA, SHAPE, SIZE are not verified Tensor(value_t *data, const shape_t& SHAPE, const size_t SIZE); private: // Inits the shape and size // !!! Don't use this function after construction void initShape(const shape_t& SHAPE); // Returns the index of the value with indices size_t posAt(const shape_t& INDICES) const; // Reallocates and copies the data // !!! The old data is not freed void duplicateData(); private: // The size is the product of each term of the shape // This is the number of values in data shape_t shape; size_t size; // Raw data value_t *data; }; } // namespace im
31.28
84
0.606394
[ "shape", "vector" ]
6f981ad6bc5fbfd50650b8a08e1073a1c15add86
4,328
h
C
src/lib/openjpip/channel_manager.h
PrecisionMetrics/openjpeg
eb2ebe92f93970bf82ee3b69c32a6975900e91a0
[ "BSD-2-Clause" ]
823
2015-02-16T08:42:47.000Z
2022-03-28T08:37:57.000Z
src/lib/openjpip/channel_manager.h
PrecisionMetrics/openjpeg
eb2ebe92f93970bf82ee3b69c32a6975900e91a0
[ "BSD-2-Clause" ]
832
2015-06-15T07:57:22.000Z
2022-03-31T12:41:46.000Z
src/lib/openjpip/channel_manager.h
OmicsDataAutomation/openjpeg
1b687cfd4b495a3f36c34093232dd28113019ad8
[ "BSD-2-Clause" ]
522
2015-03-10T18:53:47.000Z
2022-03-25T21:05:27.000Z
/* * $Id$ * * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2014, Professor Benoit Macq * Copyright (c) 2010-2011, Kaori Hagihara * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef CHANNEL_MANAGER_H_ # define CHANNEL_MANAGER_H_ #include <time.h> #include "query_parser.h" #include "cachemodel_manager.h" #include "auxtrans_manager.h" /** maximum length of channel identifier*/ #define MAX_LENOFCID 30 /** Channel parameters*/ typedef struct channel_param { cachemodel_param_t *cachemodel; /**< reference pointer to the cache model*/ char cid[MAX_LENOFCID]; /**< channel identifier*/ cnew_transport_t aux; /**< auxiliary transport*/ /* - a record of the client's capabilities and preferences to the extent that the server queues requests*/ time_t start_tm; /**< starting time*/ struct channel_param *next; /**< pointer to the next channel*/ } channel_param_t; /** Channel list parameters*/ typedef struct channellist_param { channel_param_t *first; /**< first channel pointer of the list*/ channel_param_t *last; /**< last channel pointer of the list*/ } channellist_param_t; /** * generate a channel list * * @return pointer to the generated channel list */ channellist_param_t * gene_channellist(void); /** * generate a channel under the channel list * * @param[in] query_param query parameters * @param[in] auxtrans auxiliary transport * @param[in] cachemodel reference cachemodel * @param[in] channellist channel list pointer * @return pointer to the generated channel */ channel_param_t * gene_channel(query_param_t query_param, auxtrans_param_t auxtrans, cachemodel_param_t *cachemodel, channellist_param_t *channellist); /** * set channel variable parameters * * @param[in] query_param query parameters * @param[in,out] channel pointer to the modifying channel */ void set_channel_variable_param(query_param_t query_param, channel_param_t *channel); /** * delete a channel * * @param[in] channel address of the deleting channel pointer * @param[in,out] channellist channel list pointer */ void delete_channel(channel_param_t **channel, channellist_param_t *channellist); /** * delete channel list * * @param[in,out] channellist address of the channel list pointer */ void delete_channellist(channellist_param_t **channellist); /** * print all channel parameters * * @param[in] channellist channel list pointer */ void print_allchannel(channellist_param_t *channellist); /** * search a channel by channel ID * * @param[in] cid channel identifier * @param[in] channellist channel list pointer * @return found channel pointer */ channel_param_t * search_channel(const char cid[], channellist_param_t *channellist); #endif /* !CHANNEL_MANAGER_H_ */
34.349206
110
0.710259
[ "model" ]
6f9aa1bbbeb0285896a5f3b4656204ecbaaa009a
7,055
c
C
3rd_party/tRNAscan-SE-1.3.1/probify.c
genomecuration/JAM
8b834d3efe32f79c48887c2797005619ac2c3a1d
[ "BSD-3-Clause" ]
null
null
null
3rd_party/tRNAscan-SE-1.3.1/probify.c
genomecuration/JAM
8b834d3efe32f79c48887c2797005619ac2c3a1d
[ "BSD-3-Clause" ]
null
null
null
3rd_party/tRNAscan-SE-1.3.1/probify.c
genomecuration/JAM
8b834d3efe32f79c48887c2797005619ac2c3a1d
[ "BSD-3-Clause" ]
null
null
null
/* probify.c * Convert counts to probabilities, using regularization. * SRE, Fri Sep 3 08:02:49 1993 * * Because our training sequence set is finite (and often small) * and our number of free parameters is large, we have a small * sample statistics problem in estimating each parameter. * * The simplest way to deal with this problem is to use the * so-called Laplace law of succession. If I have N sequences * with a base symbol assigned to some state, and see n A's, * I calculate the emission probability of A as (n+1)/(N+4), * i.e., adding 1 to the numerator and the number of possible * outcomes (4) to the denominator. A summary of the proof of * this appears in Berg & von Hippel (J Mol Biol 193:723-750, 1987). * It is referred to as the "plus-one prior" by David Haussler * and by us. * * The plus-one prior implies that we have no knowledge at all about * the prior probabilities; in absence of any data, the probabilities * default to 1/4. What if we do have prior information? (For instance, * for state transitions, we know that deletes and inserts are * relatively rare.) We use a generalization of the Laplace law * of succession: * n(x) + alpha * R(x) * P(x) = ------------------- * --- * \ n(i) + alpha * R(i) * /__ * i * * Here, R(x) is a "regularizer" and alpha is a weight applied * to the regularizer. Both were 1.0 in the plus-one prior. * Now, we can bias R(x) to reflect our prior expectations * about the probability distribution P(x). (In practice, * we calculate R(x) by specifying a prior probability distribution * and multiplying each term by the number of possible outcomes.) * alpha is a "confidence" term; the higher alpha is, the more * data it takes to outweigh the prior. We usually set alpha to * 1.0, but sometimes -- such as for insert state emissions, * where we may assert that the emission probabilities are * the same as random regardless of the data -- we might use * arbitrarily high alpha's to freeze certain probability distributions * at their priors. * * All this follows the description in Krogh et. al's HMM paper * (in press, JMB, 1993). * */ #include "structs.h" #include "funcs.h" /* Function: ProbifyCM() * * Purpose: Convert all the state transitions and symbol emissions in * a covariance model from counts to probabilities. * * Args: cm - the model to convert * * Return: (void). Counts in cm become probabilities. */ void ProbifyCM(struct cm_s *cm, struct prior_s *prior) { int k; for (k = 0; k < cm->nodes; k++) { if (cm->nd[k].type != BIFURC_NODE) { if (cm->nd[k].nxt == -1) ProbifyTransitionMatrix(cm->nd[k].tmx, cm->nd[k].type, END_NODE, prior); else ProbifyTransitionMatrix(cm->nd[k].tmx, cm->nd[k].type, cm->nd[k+1].type, prior); } switch (cm->nd[k].type) { case MATP_NODE: ProbifySingletEmission(cm->nd[k].il_emit, uINSL_ST, prior); ProbifySingletEmission(cm->nd[k].ir_emit, uINSR_ST, prior); ProbifySingletEmission(cm->nd[k].ml_emit, uMATL_ST, prior); ProbifySingletEmission(cm->nd[k].mr_emit, uMATR_ST, prior); ProbifyPairEmission(cm->nd[k].mp_emit, prior); break; case MATL_NODE: ProbifySingletEmission(cm->nd[k].il_emit, uINSL_ST, prior); ProbifySingletEmission(cm->nd[k].ml_emit, uMATL_ST, prior); break; case MATR_NODE: ProbifySingletEmission(cm->nd[k].ir_emit, uINSR_ST, prior); ProbifySingletEmission(cm->nd[k].mr_emit, uMATR_ST, prior); break; case BEGINR_NODE: ProbifySingletEmission(cm->nd[k].il_emit, uINSL_ST, prior); break; case ROOT_NODE: ProbifySingletEmission(cm->nd[k].il_emit, uINSL_ST, prior); ProbifySingletEmission(cm->nd[k].ir_emit, uINSR_ST, prior); break; case BIFURC_NODE: break; case BEGINL_NODE: break; default: Die("Unrecognized node type %d at node %d", cm->nd[k].type, k); } } } /* Function: ProbifyTransitionMatrix() * * Purpose: Convert the state transition matrix between two nodes * from counts to probabilities. * * Args: tmx: 6x6 state transition matrix of counts * from_node: e.g. MATP_NODE, type of node we transit from * to_node: type of node we transit to * prior: prior probability distributions * * Return: (void). Values in tmx become probabilities. */ void ProbifyTransitionMatrix(double tmx[STATETYPES][STATETYPES], int from_node, int to_node, struct prior_s *prior) { int i,j; double denom; for (i = 0; i < STATETYPES; i++) { /* if no transitions to DEL in prior, this must be an unused vector */ if (prior->tprior[from_node][to_node][i][0] > 0.0) { denom = 0.0; for (j = 0; j < STATETYPES; j++) { tmx[i][j] = tmx[i][j] + prior->talpha[i] * prior->tprior[from_node][to_node][i][j]; denom += tmx[i][j]; } for (j = 0; j < STATETYPES; j++) tmx[i][j] /= denom; } } } /* Function: ProbifySingletEmission() * * Purpose: Convert a singlet emission vector from counts to probabilities. * * Args: emvec: the emission vector * statetype: type of state: uMATL_ST, uMATR_ST, uINSL_ST, uINSR_ST * prior: prior probability distributions * * Return: (void). Values in emvec become probabilities. */ void ProbifySingletEmission(double emvec[ALPHASIZE], int statetype, struct prior_s *prior) { int x; double denom; double *em_prior; /* Choose the correct prior probability distribution to use. */ switch (statetype) { case uMATL_ST: em_prior = prior->matl_prior; break; case uMATR_ST: em_prior = prior->matr_prior; break; case uINSL_ST: em_prior = prior->insl_prior; break; case uINSR_ST: em_prior = prior->insr_prior; break; default: Die("statetype %d is not a singlet emitting state\n", statetype); } denom = 0.0; for (x = 0; x < ALPHASIZE; x++) { emvec[x] = emvec[x] + prior->emalpha[StatetypeIndex(statetype)] * em_prior[x]; denom += emvec[x]; } if (denom > 0.0) for (x = 0; x < ALPHASIZE; x++) emvec[x] /= denom; } /* Function: ProbifyPairEmission() * * Purpose: Convert a MATP pairwise emission matrix from counts to probabilities. * * Args: emx: the emission matrix * prior: prior probability distributions * * Return: (void). Values in emx become probabilities. */ void ProbifyPairEmission(double emx[ALPHASIZE][ALPHASIZE], struct prior_s *prior) { int x,y; double denom; denom = 0.0; for (x = 0; x < ALPHASIZE; x++) for (y = 0; y < ALPHASIZE; y++) { emx[x][y] = emx[x][y] + prior->emalpha[MATP_ST] * prior->matp_prior[x][y]; denom += emx[x][y]; } if (denom > 0.0) for (x = 0; x < ALPHASIZE; x++) for (y = 0; y < ALPHASIZE; y++) emx[x][y] /= denom; }
31.216814
90
0.633877
[ "vector", "model" ]
6f9b23032fc9f3c2fe33bc185e3b752c591212dd
6,741
h
C
sandbox/power10/gemm_template.h
nsait-linaro/blis
d5146582b1f1bcdccefe23925d3b114d40cd7e31
[ "BSD-3-Clause" ]
1,300
2015-01-03T23:27:03.000Z
2022-03-30T01:45:09.000Z
sandbox/power10/gemm_template.h
nsait-linaro/blis
d5146582b1f1bcdccefe23925d3b114d40cd7e31
[ "BSD-3-Clause" ]
523
2015-04-03T13:28:15.000Z
2022-03-30T06:38:59.000Z
sandbox/power10/gemm_template.h
nsait-linaro/blis
d5146582b1f1bcdccefe23925d3b114d40cd7e31
[ "BSD-3-Clause" ]
284
2015-02-08T21:31:26.000Z
2022-03-14T19:39:22.000Z
/* BLIS An object-based framework for developing high-performance BLAS-like libraries. Copyright (C) 2014, The University of Texas at Austin Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name(s) of the copyright holder(s) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "blis.h" /* Macro function template for creating BLIS GEMM kernels using the Goto method. This GEMM template assumes that the matrices are both not transposed. ch - kernel name prefix DTYPE_IN, DTYPE_OUT - datatypes of the input and output operands respectively NEW_PB - number of iterations of the innermost loop PACK_A, PACK_B - pack kernels names MICROKERNEL - microkernel function name K_MMA - number of outer products performed by an instruction MR, NR, MC, KC, NC - Cache blocking parameters B_ALIGN, A_ALIGN - Extra byte alignment for the pack matrix buffers */ #define GENERIC_GEMM( \ ch, \ DTYPE_IN, \ DTYPE_OUT, \ NEW_PB, \ PACK_A, \ PACK_B, \ MICROKERNEL, \ K_MMA, \ MR, \ NR, \ MC, \ KC, \ NC, \ B_ALIGN, \ A_ALIGN \ ) \ \ void GEMM_FUNC_NAME(ch) \ ( \ trans_t transa, \ trans_t transb, \ dim_t m, \ dim_t n, \ dim_t k, \ DTYPE_OUT* alpha, \ DTYPE_IN* a, inc_t rsa, inc_t csa, \ DTYPE_IN* b, inc_t rsb, inc_t csb, \ DTYPE_OUT* beta, \ DTYPE_OUT* c, inc_t rsc, inc_t csc \ ) \ { \ DTYPE_OUT zero = 0.0; \ DTYPE_OUT beta_ = *beta; \ \ DTYPE_IN * restrict btilde_sys = ( DTYPE_IN *) aligned_alloc( P10_PG_SIZE, B_ALIGN + KC * NC * sizeof( DTYPE_IN ) ); \ DTYPE_IN * restrict atilde_sys = ( DTYPE_IN *) aligned_alloc( P10_PG_SIZE, A_ALIGN + MC * KC * sizeof( DTYPE_IN ) ); \ \ DTYPE_IN * restrict btilde_usr = ( DTYPE_IN *)((char *)btilde_sys + B_ALIGN); \ DTYPE_IN * restrict atilde_usr = ( DTYPE_IN *)((char *)atilde_sys + A_ALIGN); \ \ const int rstep_c = MC * rsc; \ const int cstep_c = NC * csc; \ \ const int rstep_a = MC * rsa; \ const int cstep_a = KC * csa; \ \ const int rstep_b = KC * rsb; \ const int cstep_b = NC * csb; \ \ const int rstep_mt_c = MR * rsc; \ const int cstep_mt_c = NR * csc; \ \ DTYPE_OUT * restrict cblock = c; \ DTYPE_IN * restrict bblock = b; \ \ DTYPE_OUT tmp_cmicrotile[MR*NR]; \ int rsct = ( rsc == 1 ? 1 : NR ); \ int csct = ( rsc == 1 ? MR : 1 ); \ \ for ( int jc=0; jc<n; jc+=NC ) \ { \ int jb = bli_min( NC, n-jc ); \ DTYPE_IN * restrict apanel = a; \ DTYPE_IN * restrict bpanel = bblock; \ \ for ( int pc=0; pc<k; pc+=KC ) \ { \ int pb = bli_min( KC, k-pc ); \ PACK_B (NR, pb, jb, bpanel, rsb, csb, btilde_usr); \ \ int new_pb = NEW_PB; \ const int a_ps = new_pb * (K_MMA * MR); \ const int b_ps = new_pb * (K_MMA * NR); \ \ DTYPE_OUT * restrict cpanel = cblock; \ DTYPE_IN * restrict ablock = apanel; \ \ for ( int ic=0; ic<m; ic+=MC ) \ { \ int ib = bli_min( MC, m-ic ); \ \ /* pack_a (ib, pb, (uint32_t *) ablock, rsa, csa, (uint32_t *) atilde_usr ); */ \ PACK_A (MR, ib, pb, ablock, rsa, csa, atilde_usr ); \ \ DTYPE_OUT * restrict cmicrotile_col = cpanel; \ DTYPE_IN * restrict bmicropanel = btilde_usr; \ \ for ( int jr=0; jr<jb; jr+=NR ) \ { \ int jrb = bli_min( NR, jb-jr ); \ DTYPE_OUT * restrict cmicrotile = cmicrotile_col; \ DTYPE_IN * restrict amicropanel = atilde_usr; \ \ for ( int ir=0; ir<ib; ir+=MR ) \ { \ int irb = bli_min( MR, ib-ir ); \ \ if (jrb == NR && irb == MR) \ MICROKERNEL (new_pb, alpha, amicropanel, bmicropanel, beta, cmicrotile, rsc, csc, NULL, NULL); \ else \ { \ MICROKERNEL (new_pb, alpha, amicropanel, bmicropanel, &zero, tmp_cmicrotile, rsct, csct, NULL, NULL); \ \ for (int j=0; j<jrb;j++) \ for (int i=0; i<irb;i++) \ cmicrotile[i*rsc + j*csc] = \ beta_ * cmicrotile[i*rsc + j*csc] + \ tmp_cmicrotile[i*rsct + j*csct]; \ } \ amicropanel += a_ps; \ cmicrotile += rstep_mt_c; \ } \ bmicropanel += b_ps; \ cmicrotile_col += cstep_mt_c; \ } \ ablock += rstep_a; \ cpanel += rstep_c; \ } \ apanel += cstep_a; \ bpanel += rstep_b; \ } \ cblock += cstep_c; \ bblock += cstep_b; \ } \ \ free(btilde_sys); \ free(atilde_sys); \ }
37.243094
131
0.538496
[ "object" ]
6f9dcb62891d910ca779dbe21151b59adc0dfc94
6,223
h
C
dataserver/src/storage/store.h
jimdb-org/jimdb
927e4447879189597dbe7f91a7fe0e8865107ef4
[ "Apache-2.0" ]
59
2020-01-10T06:27:12.000Z
2021-12-16T06:37:36.000Z
dataserver/src/storage/store.h
jimdb-org/jimdb
927e4447879189597dbe7f91a7fe0e8865107ef4
[ "Apache-2.0" ]
null
null
null
dataserver/src/storage/store.h
jimdb-org/jimdb
927e4447879189597dbe7f91a7fe0e8865107ef4
[ "Apache-2.0" ]
3
2020-02-13T05:04:20.000Z
2020-06-29T01:07:48.000Z
// Copyright 2019 The JIMDB Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // implied. See the License for the specific language governing // permissions and limitations under the License. _Pragma("once"); #include <mutex> #include "metric.h" #include "dspb/api.pb.h" #include "field_value.h" #include "db/db.h" #include "raft/snapshot.h" // test fixture forward declare for friend class namespace jim { namespace test { namespace helper { class StoreTestFixture; }}} namespace jim { namespace ds { namespace storage { using IterPtr = db::IteratorPtr; using TxnErrorPtr = std::unique_ptr<dspb::TxnError>; static const size_t kRowPrefixLength = 4; static const size_t kDefaultMaxSelectLimit = 1000; class Store { public: Store(const basepb::Range& meta, std::unique_ptr<db::DB> db); ~Store(); Store(const Store&) = delete; Store& operator=(const Store&) = delete; int32_t GetTableID() const { return table_id_; } uint64_t GetRangeID() const { return range_id_; } std::string GetStartKey() const; void SetEndKey(std::string end_key); std::string GetEndKey() const; const basepb::KeySchema& GetKeySchema() const { return key_schema_; } void ResetMetric() { metric_.Reset(); } void CollectMetric(MetricStat* stat) { metric_.Collect(stat); } Status StatSize(uint64_t split_size, uint64_t *real_size, std::string *split_key, uint64_t *kv_count_1, uint64_t *kv_count_2); Status StatSize(const std::string & split_key, uint64_t* left_count, uint64_t* left_size, uint64_t* right_count, uint64_t* right_size); uint64_t PersistApplied() { return db_->PersistApplied(); } Status Split(uint64_t new_range_id, const std::string& split_key, uint64_t raft_index, std::unique_ptr<db::DB>& new_db); Status ApplySplit(const std::string& split_key, uint64_t raft_index); Status Destroy(); Status Get(const std::string& key, std::string* value, bool metric = true); Status Put(const std::string& key, const std::string& value, uint64_t raft_index); Status Delete(const std::string& key, uint64_t raft_index); Status DeleteRange(const std::string& start, const std::string& limit, uint64_t raft_index); Status GetTxnValue(const std::string& key, std::string& db_value); Status GetTxnValue(const std::string& key, dspb::TxnValue* value); uint64_t TxnPrepare(const dspb::PrepareRequest& req, uint64_t raft_index, dspb::PrepareResponse* resp); uint64_t TxnDecide(const dspb::DecideRequest& req, uint64_t raft_index, dspb::DecideResponse* resp); void TxnClearup(const dspb::ClearupRequest& req, uint64_t raft_index, dspb::ClearupResponse* resp); void TxnGetLockInfo(const dspb::GetLockInfoRequest& req, dspb::GetLockInfoResponse* resp); Status TxnSelect(const dspb::SelectRequest& req, dspb::SelectResponse* resp); Status TxnScan(const dspb::ScanRequest& req, dspb::ScanResponse* resp); Status TxnSelectFlow(const dspb::SelectFlowRequest& req, dspb::SelectFlowResponse* resp); Status IdxStatsGet(const dspb::IndexStatsRequest& req, dspb::IndexStatsResponse& resp); Status ColsStatsGet(const dspb::ColumnsStatsRequest& req, dspb::ColumnsStatsResponse& resp); public: uint64_t KvCount() { return kv_count_; } void SetKvCount(uint64_t kv_count) { kv_count_ = kv_count; } bool keyInScop(const std::string & key) const; IterPtr NewIterator(const std::string& start = "", const std::string& limit = ""); // ignore_value: only return key (value will be empty) for data cf Status NewIterators(IterPtr &data_iter, IterPtr &txn_iter, const std::string& start = "", const std::string& limit = "", bool ignore_value = false); Status GetSnapshot(uint64_t apply_index, std::string&& context, std::shared_ptr<raft::Snapshot>* snapshot); Status ApplySnapshotStart(uint64_t raft_index); Status ApplySnapshotData(const std::vector<std::string>& datas); Status ApplySnapshotFinish(uint64_t raft_index); void addMetricRead(uint64_t keys, uint64_t bytes); void addMetricWrite(uint64_t keys, uint64_t bytes); private: friend class ::jim::test::helper::StoreTestFixture; using KeyScope = std::pair<std::string, std::string>; KeyScope fixKeyScope(const std::string& start_key, const std::string& end_key) const; Status writeTxnValue(const dspb::TxnValue& value, db::WriteBatch* batch); TxnErrorPtr checkLockable(const std::string& key, const std::string& txn_id, bool *exist_flag); Status getCommittedInfo(const std::string& key, uint64_t& version, std::string& txn_id); TxnErrorPtr checkUniqueAndVersion(const dspb::TxnIntent& intent, const std::string& txn_id, bool local = false); uint64_t prepareLocal(const dspb::PrepareRequest& req, uint64_t version, dspb::PrepareResponse* resp); TxnErrorPtr prepareIntent(const dspb::PrepareRequest& req, const dspb::TxnIntent& intent, uint64_t version, db::WriteBatch* batch); Status commitIntent(const dspb::TxnIntent& intent, uint64_t version, const std::string& txn_id, uint64_t &bytes_written, db::WriteBatch* batch); TxnErrorPtr decidePrimary(const dspb::DecideRequest& req, uint64_t& bytes_written, db::WriteBatch* batch, dspb::DecideResponse* resp); TxnErrorPtr decideSecondary(const dspb::DecideRequest& req, const std::string& key, uint64_t& bytes_written, db::WriteBatch* batch); private: const int32_t table_id_ = 0; const uint64_t range_id_ = 0; const std::string start_key_; uint64_t kv_count_; std::string end_key_; mutable std::mutex key_lock_; std::unique_ptr<db::DB> db_; basepb::KeySchema key_schema_; Metric metric_; }; } /* namespace storage */ } /* namespace ds */ } /* namespace jim */
39.386076
139
0.721196
[ "vector" ]
6fa88f3869acb9490c7cadebe76d793ef8d96c94
666
h
C
source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCards/ACRViewPrivate.h
an888ha/AdaptiveCards
8e82b604e1da84ce4ec31e34993f9bf9242c2778
[ "MIT" ]
null
null
null
source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCards/ACRViewPrivate.h
an888ha/AdaptiveCards
8e82b604e1da84ce4ec31e34993f9bf9242c2778
[ "MIT" ]
null
null
null
source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCards/ACRViewPrivate.h
an888ha/AdaptiveCards
8e82b604e1da84ce4ec31e34993f9bf9242c2778
[ "MIT" ]
null
null
null
// // ACRViewPrivate // ACRViewPrivate.h // // Copyright © 2018 Microsoft. All rights reserved. // // #import "ACRView.h" #import "SharedAdaptiveCard.h" @interface ACRView() // Walk through adaptive cards elements and if images are found, download and process images concurrently and on different thread // from main thread, so images process won't block UI thread. - (void) addTasksToConcurrentQueue:(std::vector<std::shared_ptr<BaseCardElement>> const &) body; // Different method to just handle the actions so they wont be processed multiple times - (void) addActionsToConcurrentQueue:(std::vector<std::shared_ptr<BaseActionElement>> const &) actions; @end
33.3
129
0.761261
[ "vector" ]
6faacdd875d7570f187d4ae9da967429138988c2
3,985
h
C
src/Storm/Component/Pi.h
johnttaylor/foxtail
86e4e1d19d5e8f9c1d1064cf0939f4bf62615400
[ "BSD-3-Clause" ]
null
null
null
src/Storm/Component/Pi.h
johnttaylor/foxtail
86e4e1d19d5e8f9c1d1064cf0939f4bf62615400
[ "BSD-3-Clause" ]
null
null
null
src/Storm/Component/Pi.h
johnttaylor/foxtail
86e4e1d19d5e8f9c1d1064cf0939f4bf62615400
[ "BSD-3-Clause" ]
null
null
null
#ifndef Storm_Component_Pi_h_ #define Storm_Component_Pi_h_ /*----------------------------------------------------------------------------- * This file is part of the Colony.Apps Project. The Colony.Apps Project is an * open source project with a BSD type of licensing agreement. See the license * agreement (license.txt) in the top/ directory or on the Internet at * http://integerfox.com/colony.apps/license.txt * * Copyright (c) 2015-2020 John T. Taylor * * Redistributions of the source code must retain the above copyright notice. *----------------------------------------------------------------------------*/ /** @file */ #include "Storm/Component/Base.h" #include "Storm/Dm/MpSystemConfig.h" #include "Cpl/Dm/Mp/RefCounter.h" #include "Cpl/Dm/Mp/Float.h" #include "Cpl/Dm/Mp/Bool.h" /// Namespaces namespace Storm { /// Namespaces namespace Component { /** This concrete class implements a simple (P)roportional (I)ntegral controller that only allows the integral term to be a positive number. This class is simplification of a basic PID Controller (see https://en.wikipedia.org/wiki/PID_controller) The class has the following 'integral wind-up' protections: o Allows many external entities to explicitly inhibit the integral term. o The output of PI is clamped based on the configuration parameter piConstants.maxPvOut. When the output is clamped the integral term is inhibited. o The integral term is clamped such that integral term by itself (i.e. with zero error) does not exceed the maximum configured output of the PI. */ class Pi : public Base { public: /// Input Model Points struct Input_T { Cpl::Dm::Mp::Bool* pulseResetPi; //!< Triggers a reset-the-PI-controller request Cpl::Dm::Mp::Float* idtDeltaError; //!< The delta error (in degrees F) between the current IDT the 'active' setpoint Storm::Dm::MpSystemConfig* systemConfig; //!< Current system configuration based on equipment and current operating mode Cpl::Dm::Mp::RefCounter* freezePiRefCnt; //!< Reference Counter: When greater the zero the PI output value is 'frozen' (i.e. won't change value) and the internal integral term is not updated/changed Cpl::Dm::Mp::RefCounter* inhibitfRefCnt; //!< Reference Counter: When greater the zero the internal integral term is not update/changed. }; /// Output Model Points struct Output_T { Cpl::Dm::Mp::Float* pvOut; //!< Output of the PI Controller. This is unit-less positive number that ranges from 0.0 to piConstants.maxPvOut Cpl::Dm::Mp::Float* sumError; //!< An internal intermediate value/variable that represents the integral term of the PI Cpl::Dm::Mp::Bool* pvInhibited; //!< This flag is true if the PI Controller's integral is currently inhibited. Note: This flag includes any internal inhibiting of the integral term as well as being set true when the PI 'frozen' }; public: /// Constructor Pi( struct Input_T ins, struct Output_T outs ); /// See Storm::Component::Api bool start( Cpl::System::ElapsedTime::Precision_T& intervalTime ); protected: /// See Storm::Component::Base bool execute( Cpl::System::ElapsedTime::Precision_T currentTick, Cpl::System::ElapsedTime::Precision_T currentInterval ); protected: /// The Component's inputs Input_T m_in; /// The Component's outputs Output_T m_out; /// dt interval time - in milliseconds - as a float (instead of Precision_T struct) float m_dt; /// Previous sum error term float m_prevSumError; /// Previous OUT value float m_prevPvOut; /// Maximum Allowed sum error term float m_maxSumError; }; }; // end namespace }; // end namespace #endif // end header latch
38.317308
255
0.648432
[ "model" ]
6fad2be31f1e8c6522983ecb676e46bd530e47e8
847
h
C
aws-cpp-sdk-cognito-idp/include/aws/cognito-idp/model/VerifySoftwareTokenResponseType.h
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-cognito-idp/include/aws/cognito-idp/model/VerifySoftwareTokenResponseType.h
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-01-03T23:59:37.000Z
2022-01-03T23:59:37.000Z
aws-cpp-sdk-cognito-idp/include/aws/cognito-idp/model/VerifySoftwareTokenResponseType.h
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-11-09T12:02:58.000Z
2021-11-09T12:02:58.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/cognito-idp/CognitoIdentityProvider_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace CognitoIdentityProvider { namespace Model { enum class VerifySoftwareTokenResponseType { NOT_SET, SUCCESS, ERROR_ }; namespace VerifySoftwareTokenResponseTypeMapper { AWS_COGNITOIDENTITYPROVIDER_API VerifySoftwareTokenResponseType GetVerifySoftwareTokenResponseTypeForName(const Aws::String& name); AWS_COGNITOIDENTITYPROVIDER_API Aws::String GetNameForVerifySoftwareTokenResponseType(VerifySoftwareTokenResponseType value); } // namespace VerifySoftwareTokenResponseTypeMapper } // namespace Model } // namespace CognitoIdentityProvider } // namespace Aws
26.46875
131
0.812279
[ "model" ]
6fb9887b17a59ee54dc867fb6a893fa27b50c0eb
800
c
C
nitan/d/kaifeng/npc/gaoyanei.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
1
2019-03-27T07:25:16.000Z
2019-03-27T07:25:16.000Z
nitan/d/kaifeng/npc/gaoyanei.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
nitan/d/kaifeng/npc/gaoyanei.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
inherit NPC; void create() { set_name("高衙內",({"gao yanei", "gao", "yanei"})); set("age", 22); set("gender", "男性"); set("attitude", "peaceful"); set("str", 25); set("dex", 20); set("combat_exp", 50000); set("shen_type", 1); set_skill("unarmed", 80); set_skill("dodge", 80); set_skill("parry", 80); set_skill("sword", 80); set_skill("force", 80); set_temp("apply/attack", 80); set_temp("apply/defense", 80); set_temp("apply/damage", 40); set_temp("apply/armor", 80); setup(); carry_object("/d/beijing/npc/obj/guanfu4")->wear(); } int accept_fight(object me) { command("say 大爺我正想找人殺吶,今天算你倒黴。\n"); kill_ob(me); return 1; }
22.857143
59
0.50625
[ "object" ]
6fbb6f127f4819e207defdc81c3c699d44c4ea4f
3,784
h
C
sp/src/game/client/C_Env_Projected_Texture.h
map-labs-source/Map-Labs
29f60485c219dd8b4b0b4a7343c85ccad8ad1685
[ "Unlicense" ]
137
2019-07-13T03:40:58.000Z
2022-03-17T21:53:10.000Z
sp/src/game/client/C_Env_Projected_Texture.h
map-labs-source/Map-Labs
29f60485c219dd8b4b0b4a7343c85ccad8ad1685
[ "Unlicense" ]
140
2019-10-24T16:48:00.000Z
2022-03-27T06:17:50.000Z
sp/src/game/client/C_Env_Projected_Texture.h
map-labs-source/Map-Labs
29f60485c219dd8b4b0b4a7343c85ccad8ad1685
[ "Unlicense" ]
108
2019-09-30T22:00:56.000Z
2022-03-30T00:14:58.000Z
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #ifndef C_ENVPROJECTEDTEXTURE_H #define C_ENVPROJECTEDTEXTURE_H #ifdef _WIN32 #pragma once #endif #include "c_baseentity.h" #include "basetypes.h" #ifdef ASW_PROJECTED_TEXTURES //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- class C_EnvProjectedTexture : public C_BaseEntity { DECLARE_CLASS( C_EnvProjectedTexture, C_BaseEntity ); public: DECLARE_CLIENTCLASS(); void SetMaterial( IMaterial *pMaterial ); void SetLightColor( byte r, byte g, byte b, byte a ); void SetSize( float flSize ); void SetRotation( float flRotation ); virtual void OnDataChanged( DataUpdateType_t updateType ); void ShutDownLightHandle( void ); #ifdef MAPBASE virtual void Simulate(); #else virtual bool Simulate(); #endif void UpdateLight( void ); C_EnvProjectedTexture(); ~C_EnvProjectedTexture(); static void SetVisibleBBoxMinHeight( float flVisibleBBoxMinHeight ) { m_flVisibleBBoxMinHeight = flVisibleBBoxMinHeight; } static float GetVisibleBBoxMinHeight( void ) { return m_flVisibleBBoxMinHeight; } static C_EnvProjectedTexture *Create( ); private: inline bool IsBBoxVisible( void ); bool IsBBoxVisible( Vector vecExtentsMin, Vector vecExtentsMax ); ClientShadowHandle_t m_LightHandle; bool m_bForceUpdate; EHANDLE m_hTargetEntity; #ifdef MAPBASE bool m_bDontFollowTarget; #endif bool m_bState; bool m_bAlwaysUpdate; float m_flLightFOV; #ifdef MAPBASE float m_flLightHorFOV; #endif bool m_bEnableShadows; bool m_bLightOnlyTarget; bool m_bLightWorld; bool m_bCameraSpace; float m_flBrightnessScale; color32 m_LightColor; Vector m_CurrentLinearFloatLightColor; float m_flCurrentLinearFloatLightAlpha; #ifdef MAPBASE float m_flCurrentBrightnessScale; #endif float m_flColorTransitionTime; float m_flAmbient; float m_flNearZ; float m_flFarZ; char m_SpotlightTextureName[ MAX_PATH ]; CTextureReference m_SpotlightTexture; int m_nSpotlightTextureFrame; int m_nShadowQuality; #ifdef MAPBASE float m_flConstantAtten; float m_flLinearAtten; float m_flQuadraticAtten; float m_flShadowAtten; bool m_bAlwaysDraw; //bool m_bProjectedTextureVersion; #endif Vector m_vecExtentsMin; Vector m_vecExtentsMax; static float m_flVisibleBBoxMinHeight; }; bool C_EnvProjectedTexture::IsBBoxVisible( void ) { return IsBBoxVisible( GetAbsOrigin() + m_vecExtentsMin, GetAbsOrigin() + m_vecExtentsMax ); } #else //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- class C_EnvProjectedTexture : public C_BaseEntity { DECLARE_CLASS( C_EnvProjectedTexture, C_BaseEntity ); public: DECLARE_CLIENTCLASS(); C_EnvProjectedTexture(); ~C_EnvProjectedTexture(); virtual void OnDataChanged( DataUpdateType_t updateType ); void ShutDownLightHandle( void ); virtual void Simulate(); void UpdateLight( bool bForceUpdate ); bool ShadowsEnabled(); float GetFOV(); private: ClientShadowHandle_t m_LightHandle; EHANDLE m_hTargetEntity; bool m_bState; float m_flLightFOV; bool m_bEnableShadows; bool m_bLightOnlyTarget; bool m_bLightWorld; bool m_bCameraSpace; color32 m_cLightColor; float m_flAmbient; char m_SpotlightTextureName[ MAX_PATH ]; int m_nSpotlightTextureFrame; int m_nShadowQuality; bool m_bCurrentShadow; public: C_EnvProjectedTexture *m_pNext; }; C_EnvProjectedTexture* GetEnvProjectedTextureList(); #endif #endif // C_ENVPROJECTEDTEXTURE_H
22.795181
123
0.700846
[ "vector" ]
6fbd24fa133dc93aab4ee00a6a34f13fafa6fd65
18,302
c
C
wc3/libwww/ComLine/src/HTLine.c
Uvacoder/html-demo-code-and-experiments
1bd2ab50afe8f331396c37822301afa8e4903bcd
[ "Apache-2.0" ]
3
2021-11-15T07:54:37.000Z
2021-11-29T03:09:12.000Z
wc3/libwww/ComLine/src/HTLine.c
Uvacoder/html-demo-code-and-experiments
1bd2ab50afe8f331396c37822301afa8e4903bcd
[ "Apache-2.0" ]
26
2021-11-15T04:26:39.000Z
2021-11-17T00:17:06.000Z
wc3/libwww/ComLine/src/HTLine.c
Uvacoder/html-demo-code-and-experiments
1bd2ab50afe8f331396c37822301afa8e4903bcd
[ "Apache-2.0" ]
null
null
null
/* HTLine.c ** W3C COMMAND LINE TOOL ** ** (c) COPRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. ** @(#) $Id$ ** ** Authors: ** HFN Henrik Frystyk Nielsen, (frystyk@w3.org) ** ** History: ** Nov 24 95 First version */ #include "WWWLib.h" /* Global Library Include file */ #include "WWWApp.h" #include "WWWMIME.h" /* MIME parser/generator */ #include "WWWHTML.h" /* HTML parser/generator */ #include "WWWNews.h" /* News access module */ #include "WWWHTTP.h" /* HTTP access module */ #include "WWWFTP.h" #include "WWWFile.h" #include "WWWGophe.h" #include "WWWStream.h" #include "WWWTrans.h" #include "WWWInit.h" #include "HTLine.h" /* Implemented here */ #ifndef W3C_VERSION #define W3C_VERSION "unspecified" #endif #define APP_NAME "W3C-WebCon" #define APP_VERSION W3C_VERSION /* Default page for "-help" command line option */ #define W3C_HELP "http://www.w3.org/ComLine/README" #define DEFAULT_OUTPUT_FILE "w3c.out" #define DEFAULT_RULE_FILE "w3c.conf" #define DEFAULT_LOG_FILE "w3c.log" #define MILLIES 1000 #define DEFAULT_TIMEOUT 20 /* timeout in secs */ #define DEFAULT_HOPS 0 #define DEFAULT_FORMAT WWW_SOURCE typedef enum _CLFlags { CL_FILTER = 0x1, CL_COUNT = 0x2, CL_QUIET = 0x4, CL_VALIDATE = 0x8, CL_END_VALIDATE = 0x10, CL_CACHE_FLUSH = 0x20 } CLFlags; #define SHOW_MSG (!(cl->flags & CL_QUIET)) typedef struct _ComLine { HTRequest * request; HTParentAnchor * anchor; HTParentAnchor * dest; /* Destination for PUT etc. */ int timer; /* Timeout on socket */ char * cwd; /* Current dir URL */ char * rules; char * logfile; HTLog * log; char * outputfile; FILE * output; HTFormat format; /* Input format from console */ char * realm; /* For automated authentication */ char * user; char * password; CLFlags flags; } ComLine; HTChunk * post_result = NULL; /* ------------------------------------------------------------------------- */ PRIVATE int printer (const char * fmt, va_list pArgs) { return (vfprintf(stdout, fmt, pArgs)); } PRIVATE int tracer (const char * fmt, va_list pArgs) { return (vfprintf(stderr, fmt, pArgs)); } /* Create a Command Line Object ** ---------------------------- */ PRIVATE ComLine * ComLine_new (void) { ComLine * me; if ((me = (ComLine *) HT_CALLOC(1, sizeof(ComLine))) == NULL) HT_OUTOFMEM("ComLine_new"); me->timer = DEFAULT_TIMEOUT*MILLIES; me->cwd = HTGetCurrentDirectoryURL(); me->output = OUTPUT; /* Bind the ConLine object together with the Request Object */ me->request = HTRequest_new(); HTRequest_setOutputFormat(me->request, DEFAULT_FORMAT); HTRequest_setContext (me->request, me); return me; } /* Delete a Command Line Object ** ---------------------------- */ PRIVATE BOOL ComLine_delete (ComLine * me) { if (me) { HTRequest_delete(me->request); if (me->log) HTLog_close(me->log); if (me->output && me->output != STDOUT) fclose(me->output); HT_FREE(me->cwd); HT_FREE(me); return YES; } return NO; } PRIVATE void Cleanup (ComLine * me, int status) { ComLine_delete(me); HTProfile_delete(); #ifdef VMS exit(status ? status : 1); #else exit(status ? status : 0); #endif } PRIVATE void VersionInfo (const char * name) { HTPrint("\nW3C OpenSource Software"); HTPrint("\n-----------------------\n\n"); HTPrint("\tWebCon version %s\n", APP_VERSION); HTPrint("\tusing the W3C libwww library version %s.\n\n",HTLib_version()); HTPrint("\tTry \"%s -help\" for help\n\n", name ? name : APP_NAME); HTPrint("\tSee \"http://www.w3.org/ComLine/User/\" for user information\n"); HTPrint("\tSee \"http://www.w3.org/ComLine/\" for general information\n\n"); HTPrint("\tPlease send feedback to the <www-lib@w3.org> mailing list,\n"); HTPrint("\tsee \"http://www.w3.org/Library/#Forums\" for details\n\n"); } /* terminate_handler ** ----------------- ** This function is registered to handle the result of the request */ PRIVATE int terminate_handler (HTRequest * request, HTResponse * response, void * param, int status) { ComLine * cl = (ComLine *) HTRequest_context(request); if (status == HT_LOADED) { if (cl) { if (cl->flags & CL_COUNT) { HTPrint("Content Length found to be %ld\n", HTAnchor_length(cl->anchor)); } } } else { HTAlertCallback *cbf = HTAlert_find(HT_A_MESSAGE); if (cbf) (*cbf)(request, HT_A_MESSAGE, HT_MSG_NULL, NULL, HTRequest_error(request), NULL); } Cleanup(cl, (status/100 == 2) ? 0 : -1); return HT_OK; } PRIVATE BOOL PromptUsernameAndPassword (HTRequest * request, HTAlertOpcode op, int msgnum, const char * dfault, void * input, HTAlertPar * reply) { ComLine * cl = (ComLine *) HTRequest_context(request); char * realm = (char *) input; if (request && cl) { /* ** If we have a realm then check that it matches the realm ** that we got from the server. */ if (realm && cl->realm && !strcmp(cl->realm, realm)) { HTAlert_setReplyMessage(reply, cl->user ? cl->user : ""); HTAlert_setReplySecret(reply, cl->password ? cl->password : ""); return YES; } else { BOOL status = HTPrompt(request, op, msgnum, dfault, input, reply); return status ? HTPromptPassword(request, op, HT_MSG_PW, dfault, input, reply) : NO; } } return NO; } PRIVATE BOOL ParseCredentials (ComLine * cl, char * credentials) { if (cl && credentials) { char * start = credentials; char * end = credentials; /* Make sure we don't get inconsistent sets of information */ cl->realm = NULL; cl->user = NULL; cl->password = NULL; /* Find the username */ while (*end && *end!=':') end++; if (!*end) return NO; *end++ = '\0'; cl->user = start; start = end; /* Find the password */ while (*end && *end!='@') end++; if (!*end) return NO; *end++ = '\0'; cl->password = start; start = end; /* Find the realm */ cl->realm = start; } return YES; } /* ------------------------------------------------------------------------- */ /* MAIN PROGRAM */ /* ------------------------------------------------------------------------- */ int main (int argc, char ** argv) { int status = 0; int arg; int tokencount = 0; BOOL formdata = NO; HTChunk * keywords = NULL; /* From command line */ HTAssocList*formfields = NULL; HTMethod method = METHOD_GET; /* Default value */ ComLine * cl = ComLine_new(); BOOL cache = NO; /* Use persistent cache */ BOOL flush = NO; /* flush the persistent cache */ char * cache_root = NULL; /* Starts Mac GUSI socket library */ #ifdef GUSI GUSISetup(GUSIwithSIOUXSockets); GUSISetup(GUSIwithInternetSockets); #endif #ifdef __MWERKS__ /* STR */ InitGraf((Ptr) &qd.thePort); InitFonts(); InitWindows(); InitMenus(); TEInit(); InitDialogs(nil); InitCursor(); SIOUXSettings.asktosaveonclose = false; argc=ccommand(&argv); #endif /* Initiate W3C Reference Library with a client profile */ HTProfile_newNoCacheClient(APP_NAME, APP_VERSION); /* Need our own trace and print functions */ HTPrint_setCallback(printer); HTTrace_setCallback(tracer); /* ** Delete the default Username/password handler so that we can handle ** parameters handed to us from the command line. The default is set ** by the profile. */ HTAlert_deleteOpcode(HT_A_USER_PW); HTAlert_add(PromptUsernameAndPassword, HT_A_USER_PW); /* ** Add default content decoder. We insert a through line as it doesn't ** matter that we get an encoding that we don't know. */ HTFormat_addCoding("*", HTIdentityCoding, HTIdentityCoding, 0.3); /* Scan command Line for parameters */ for (arg=1; arg<argc; arg++) { if (*argv[arg] == '-') { /* - alone => filter */ if (argv[arg][1] == '\0') { cl->flags |= CL_FILTER; /* -? or -help: show the command line help page */ } else if (!strcmp(argv[arg],"-?") || !strcmp(argv[arg],"-help")) { cl->anchor = (HTParentAnchor *) HTAnchor_findAddress(W3C_HELP); tokencount = 1; /* non-interactive */ } else if (!strcmp(argv[arg], "-n")) { HTAlert_setInteractive(NO); /* Treat the keywords as form data with a <name> "=" <value> */ } else if (!strcmp(argv[arg], "-form")) { formdata = YES; /* from -- Initial represntation (only with filter) */ } else if (!strcmp(argv[arg], "-from")) { cl->format = (arg+1 < argc && *argv[arg+1] != '-') ? HTAtom_for(argv[++arg]) : WWW_HTML; /* to -- Final representation */ } else if (!strcmp(argv[arg], "-to")) { HTFormat format = (arg+1 < argc && *argv[arg+1] != '-') ? HTAtom_for(argv[++arg]) : DEFAULT_FORMAT; HTRequest_setOutputFormat(cl->request, format); /* destination for PUT, POST etc. */ } else if (!strcmp(argv[arg], "-dest")) { if (arg+1 < argc && *argv[arg+1] != '-') { char * dest = HTParse(argv[++arg], cl->cwd, PARSE_ALL); cl->dest = (HTParentAnchor *) HTAnchor_findAddress(dest); HT_FREE(dest); } /* source please */ } else if (!strcmp(argv[arg], "-source")) { HTRequest_setOutputFormat(cl->request, WWW_RAW); /* log file */ } else if (!strcmp(argv[arg], "-l")) { cl->logfile = (arg+1 < argc && *argv[arg+1] != '-') ? argv[++arg] : DEFAULT_LOG_FILE; /* Max forward hops in case of TRACE request */ } else if (!strcmp(argv[arg], "-hops") || !strcmp(argv[arg], "-maxforwards")) { int hops = (arg+1 < argc && *argv[arg+1] != '-') ? atoi(argv[++arg]) : DEFAULT_HOPS; if (hops >= 0) HTRequest_setMaxForwards(cl->request, hops); /* automated authentication of format user:password@realm */ } else if (!strncmp(argv[arg], "-auth", 5)) { char * credentials = (arg+1 < argc && *argv[arg+1] != '-') ? argv[++arg] : NULL; if (credentials) ParseCredentials(cl, credentials); /* rule file */ } else if (!strcmp(argv[arg], "-r")) { cl->rules = (arg+1 < argc && *argv[arg+1] != '-') ? argv[++arg] : DEFAULT_RULE_FILE; /* output filename */ } else if (!strcmp(argv[arg], "-o")) { cl->outputfile = (arg+1 < argc && *argv[arg+1] != '-') ? argv[++arg] : DEFAULT_OUTPUT_FILE; /* timeout -- Change the default request timeout */ } else if (!strcmp(argv[arg], "-timeout")) { int timeout = (arg+1 < argc && *argv[arg+1] != '-') ? atoi(argv[++arg]) : DEFAULT_TIMEOUT; if (timeout >= 1) cl->timer = timeout*MILLIES; /* preemptive or non-preemptive access */ } else if (!strcmp(argv[arg], "-single")) { HTRequest_setPreemptive(cl->request, YES); /* content Length Counter */ } else if (!strcmp(argv[arg], "-cl")) { cl->flags |= CL_COUNT; /* print version and exit */ } else if (!strcmp(argv[arg], "-version")) { VersionInfo(argv[0]); Cleanup(cl, 0); /* run in quiet mode */ } else if (!strcmp(argv[arg], "-q")) { cl->flags |= CL_QUIET; /* Start the persistent cache */ } else if (!strcmp(argv[arg], "-cache")) { cache = YES; /* Determine the cache root */ } else if (!strcmp(argv[arg], "-cacheroot")) { cache_root = (arg+1 < argc && *argv[arg+1] != '-') ? argv[++arg] : NULL; /* Persistent cache flush */ } else if (!strcmp(argv[arg], "-flush")) { flush = YES; /* Do a cache validation */ } else if (!strcmp(argv[arg], "-validate")) { cl->flags |= CL_VALIDATE; /* Do an end-to-end cache-validation */ } else if (!strcmp(argv[arg], "-endvalidate")) { cl->flags |= CL_END_VALIDATE; /* Force complete reload */ } else if (!strcmp(argv[arg], "-nocache")) { cl->flags |= CL_CACHE_FLUSH; #ifdef WWWTRACE /* trace flags */ } else if (!strncmp(argv[arg], "-v", 2)) { HTSetTraceMessageMask(argv[arg]+2); #endif /* GET method */ } else if (!strcasecomp(argv[arg], "-get")) { method = METHOD_GET; /* HEAD method */ } else if (!strcasecomp(argv[arg], "-head")) { method = METHOD_HEAD; /* DELETE method */ } else if (!strcasecomp(argv[arg], "-delete")) { method = METHOD_DELETE; /* POST Method */ } else if (!strcasecomp(argv[arg], "-post")) { method = METHOD_POST; /* PUT Method */ } else if (!strcasecomp(argv[arg], "-put")) { method = METHOD_PUT; /* OPTIONS Method */ } else if (!strcasecomp(argv[arg], "-options")) { method = METHOD_OPTIONS; /* TRACE Method */ } else if (!strcasecomp(argv[arg], "-trace")) { method = METHOD_TRACE; } else { if (SHOW_MSG) HTPrint("Bad Argument (%s)\n", argv[arg]); } } else { /* If no leading `-' then check for URL or keywords */ if (!tokencount) { char * ref = HTParse(argv[arg], cl->cwd, PARSE_ALL); cl->anchor = (HTParentAnchor *) HTAnchor_findAddress(ref); tokencount = 1; HT_FREE(ref); } else if (formdata) { /* Keywords are form data */ char * string = argv[arg]; if (tokencount++ <= 1) formfields = HTAssocList_new(); HTParseFormInput(formfields, string); } else { /* keywords are search tokens */ char * escaped = HTEscape(argv[arg], URL_XALPHAS); if (tokencount++ <= 1) keywords = HTChunk_new(128); else HTChunk_putc(keywords, ' '); HTChunk_puts(keywords, HTStrip(escaped)); HT_FREE(escaped); } } } if (!tokencount && !cl->flags & CL_FILTER) { VersionInfo(argv[0]); Cleanup(cl, 0); } /* Should we use persistent cache? */ if (cache) { HTCacheInit(cache_root, 20); /* Should we start by flushing? */ if (flush) HTCache_flushAll(); } /* ** Check whether we should do some kind of cache validation on ** the load */ if (cl->flags & CL_VALIDATE) HTRequest_setReloadMode(cl->request, HT_CACHE_VALIDATE); else if (cl->flags & CL_END_VALIDATE) HTRequest_setReloadMode(cl->request, HT_CACHE_END_VALIDATE); else if (cl->flags & CL_CACHE_FLUSH) HTRequest_setReloadMode(cl->request, HT_CACHE_FLUSH); /* Add progress notification */ if (cl->flags & CL_QUIET) HTAlert_deleteOpcode(HT_A_PROGRESS); /* Output file specified? */ if (cl->outputfile) { if ((cl->output = fopen(cl->outputfile, "wb")) == NULL) { if (SHOW_MSG) HTPrint("Can't open `%s'\\n",cl->outputfile); cl->output = OUTPUT; } } /* ** Set up the output. Even though we don't use this explicit, it is ** required in order to show the stream stack that we know that we are ** getting raw data output on the output stream of the request object. */ HTRequest_setOutputStream(cl->request, HTFWriter_new(cl->request, cl->output, YES)); /* Setting event timeout */ HTHost_setEventTimeout(cl->timer); /* ** Make sure that the first request is flushed immediately and not ** buffered in the output buffer */ HTRequest_setFlush(cl->request, YES); /* Log file specifed? */ if (cl->logfile) { cl->log = HTLog_open(cl->logfile, YES, YES); if (cl->log) HTNet_addAfter(HTLogFilter, NULL, cl->log, HT_ALL, HT_FILTER_LATE); } /* Just convert formats */ if (cl->flags & CL_FILTER) { #ifdef STDIN_FILENO HTRequest_setAnchor(cl->request, (HTAnchor *) cl->anchor); HTRequest_setPreemptive(cl->request, YES); HTLoadSocket(STDIN_FILENO, cl->request); #endif Cleanup(cl, 0); } /* Content Length Counter */ if (cl->flags & CL_COUNT) { HTRequest_setOutputStream(cl->request, HTContentCounter(HTBlackHole(), cl->request, 0x2000)); } /* Rule file specified? */ if (cl->rules) { char * rules = HTParse(cl->rules, cl->cwd, PARSE_ALL); if (!HTLoadRulesAutomatically(rules)) if (SHOW_MSG) HTPrint("Can't access rules\n"); HT_FREE(rules); } /* Add our own filter to update the history list */ HTNet_addAfter(terminate_handler, NULL, NULL, HT_ALL, HT_FILTER_LAST); /* Start the request */ switch (method) { case METHOD_GET: if (formdata) status = HTGetFormAnchor(formfields, (HTAnchor *) cl->anchor, cl->request); else if (keywords) status = HTSearchAnchor(keywords, (HTAnchor *) cl->anchor, cl->request); else status = HTLoadAnchor((HTAnchor *) cl->anchor, cl->request); break; case METHOD_HEAD: if (formdata) { HTRequest_setMethod(cl->request, METHOD_HEAD); status = HTGetFormAnchor(formfields, (HTAnchor *) cl->anchor, cl->request); } else if (keywords) { HTRequest_setMethod(cl->request, METHOD_HEAD); status = HTSearchAnchor(keywords, (HTAnchor *) cl->anchor, cl->request); } else status = HTHeadAnchor((HTAnchor *) cl->anchor, cl->request); break; case METHOD_DELETE: status = HTDeleteAnchor((HTAnchor *) cl->anchor, cl->request); break; case METHOD_POST: if (formdata) { HTParentAnchor * posted = NULL; #if 1 posted = HTPostFormAnchor(formfields, (HTAnchor *) cl->anchor, cl->request); status = posted ? YES : NO; #else /* If we want output to a chunk instead */ post_result = HTPostFormAnchorToChunk(formfields, (HTAnchor *) cl->anchor, cl->request); status = post_result ? YES : NO; #endif } else { if (SHOW_MSG) HTPrint("Nothing to post to this address\n"); status = NO; } break; case METHOD_PUT: status = HTPutDocumentAnchor(cl->anchor, (HTAnchor *) cl->dest, cl->request); break; case METHOD_OPTIONS: status = HTOptionsAnchor((HTAnchor *) cl->anchor, cl->request); break; case METHOD_TRACE: status = HTTraceAnchor((HTAnchor *) cl->anchor, cl->request); break; default: if (SHOW_MSG) HTPrint("Don't know this method\n"); break; } if (keywords) HTChunk_delete(keywords); if (formfields) HTAssocList_delete(formfields); if (status != YES) { if (SHOW_MSG) HTPrint("Sorry, can't access resource\n"); Cleanup(cl, -1); } /* Go into the event loop... */ HTEventList_loop(cl->request); /* Only gets here if event loop fails */ Cleanup(cl, 0); return 0; }
28.641628
88
0.60283
[ "object" ]
6fc89fe7c1ba19e0c62f2a94d994e94a8bbb5789
2,532
h
C
DEM/Low/src/Events/EventHandler.h
niello/deusexmachina
2f698054fe82d8b40a0a0e58b86d64ffed0de06c
[ "MIT" ]
15
2019-05-07T11:26:13.000Z
2022-01-12T18:26:45.000Z
DEM/Low/src/Events/EventHandler.h
niello/deusexmachina
2f698054fe82d8b40a0a0e58b86d64ffed0de06c
[ "MIT" ]
16
2021-10-04T17:15:31.000Z
2022-03-20T09:34:29.000Z
DEM/Low/src/Events/EventHandler.h
niello/deusexmachina
2f698054fe82d8b40a0a0e58b86d64ffed0de06c
[ "MIT" ]
2
2019-04-28T23:27:48.000Z
2019-05-07T11:26:18.000Z
#pragma once #include <Data/RefCounted.h> #include <Events/EventsFwd.h> // Abstract wrapper for different event callback types namespace Events { // NB: refcounting is required for unsubscribing from an event inside its handler class CEventHandler { protected: U16 RefCount = 0; U16 Priority; friend inline void DEMPtrAddRef(Events::CEventHandler* p) noexcept { ++p->RefCount; } friend inline void DEMPtrRelease(Events::CEventHandler* p) noexcept { n_assert_dbg(p->RefCount > 0); if (--p->RefCount == 0) n_delete(p); } public: virtual ~CEventHandler() = default; PEventHandler Next; CEventHandler(U16 _Priority = Priority_Default): Priority(_Priority) {} U16 GetPriority() const { return Priority; } virtual bool Invoke(CEventDispatcher* pDispatcher, const CEventBase& Event) = 0; bool operator()(CEventDispatcher* pDispatcher, const CEventBase& Event) { return Invoke(pDispatcher, Event); } }; //--------------------------------------------------------------------- class CEventHandlerCallback: public CEventHandler { private: CEventCallback Handler; public: CEventHandlerCallback(CEventCallback Func, U16 _Priority = Priority_Default): CEventHandler(_Priority), Handler(Func) {} virtual bool Invoke(CEventDispatcher* pDispatcher, const CEventBase& Event) { return (*Handler)(pDispatcher, Event); } }; //--------------------------------------------------------------------- class CEventHandlerFunctor: public CEventHandler { private: CEventFunctor Handler; public: CEventHandlerFunctor(CEventFunctor&& Func, U16 _Priority = Priority_Default): CEventHandler(_Priority), Handler(std::move(Func)) {} CEventHandlerFunctor(const CEventFunctor& Func, U16 _Priority = Priority_Default): CEventHandler(_Priority), Handler(Func) {} virtual bool Invoke(CEventDispatcher* pDispatcher, const CEventBase& Event) { return Handler(pDispatcher, Event); } }; //--------------------------------------------------------------------- template<typename T> class CEventHandlerMember: public CEventHandler { private: typedef bool(T::*CMemberFunc)(CEventDispatcher* pDispatcher, const CEventBase& Event); T* Object; CMemberFunc Handler; public: CEventHandlerMember(T* Obj, CMemberFunc Func, U16 _Priority = Priority_Default): CEventHandler(_Priority), Object(Obj), Handler(Func) {} virtual bool Invoke(CEventDispatcher* pDispatcher, const CEventBase& Event) { return (Object->*Handler)(pDispatcher, Event); } }; //--------------------------------------------------------------------- }
30.142857
140
0.676935
[ "object" ]
6fcd470fe31ca683d6886ff438236d0918e1aaeb
5,788
h
C
Interface/MasterWalletManager.h
fakecoinbase/elastosslashElastos.ELA.SPV.Cpp
b18eaeaa96e6c9049e3527c6e8b22a571aba35f6
[ "MIT" ]
null
null
null
Interface/MasterWalletManager.h
fakecoinbase/elastosslashElastos.ELA.SPV.Cpp
b18eaeaa96e6c9049e3527c6e8b22a571aba35f6
[ "MIT" ]
1
2021-02-04T05:57:09.000Z
2021-02-04T05:57:09.000Z
Reference_Test/Interface/MasterWalletManager.h
yiyaowen/ela-spvwallet-desktop
475095ee3c1f49bc7e23c5c341e959568d4f72b9
[ "MIT" ]
null
null
null
/* * Copyright (c) 2019 Elastos Foundation * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef __ELASTOS_SDK_MASTERWALLETMANAGER_H__ #define __ELASTOS_SDK_MASTERWALLETMANAGER_H__ #include <map> #include "IMasterWalletManager.h" namespace Elastos { namespace ElaWallet { class Config; class Lockable; class SPV_API_PUBLIC MasterWalletManager : public IMasterWalletManager { public: /** * Constructor * @param rootPath Specify directory for all config files, including mnemonic config files. Root should not be empty, otherwise will throw invalid argument exception. * @param netType Value can only be one of "MainNet", "TestNet", "RegTest", "PrvNet" * @param dataPath The path contains data of wallet created. If empty, data of wallet will store in rootPath. * @param config If netType is "MainNet" or "TestNet" or "RegTest", config will be ignore. * * If netType is "PrvNet", config must be provided as below: * { * "ELA": { * "GenesisAddress": "", * "ChainParameters": { * "MagicNumber": 20190808, * "StandardPort": 30018, * "DNSSeeds": [ "172.26.0.165" ], * "CheckPoints": [ * [0, "8df798783097be3a8f382f6537e47c7168d4bf4d741fa3fa8c48c607a06352cf", 1513936800, 486801407] * ] * } * }, * "IDChain": { * "GenesisAddress": "XKUh4GLhFJiqAMTF6HyWQrV9pK9HcGUdfJ", * "ChainParameters": { * "MagicNumber": 20190816, * "StandardPort": 30138, * "DNSSeeds": [ "172.26.0.165" ], * "CheckPoints": [ * [0, "56be936978c261b2e649d58dbfaf3f23d4a868274f5522cd2adb4308a955c4a3", 1513936800, 486801407] * ] * } * } * } */ explicit MasterWalletManager(const std::string &rootPath, const std::string &netType = "MainNet", const nlohmann::json &config = nlohmann::json(), const std::string &dataPath = ""); virtual ~MasterWalletManager(); virtual std::string GenerateMnemonic(const std::string &language, int wordCount = 12) const; virtual IMasterWallet *CreateMasterWallet( const std::string &masterWalletID, const std::string &mnemonic, const std::string &phrasePassword, const std::string &payPassword, bool singleAddress); virtual IMasterWallet *CreateMultiSignMasterWallet( const std::string &masterWalletID, const nlohmann::json &cosigners, uint32_t m, bool singleAddress, bool compatible = false, time_t timestamp = 0); virtual IMasterWallet *CreateMultiSignMasterWallet( const std::string &masterWalletID, const std::string &xprv, const std::string &payPassword, const nlohmann::json &cosigners, uint32_t m, bool singleAddress, bool compatible = false, time_t timestamp = 0); virtual IMasterWallet *CreateMultiSignMasterWallet( const std::string &masterWalletID, const std::string &mnemonic, const std::string &passphrase, const std::string &payPassword, const nlohmann::json &cosigners, uint32_t m, bool singleAddress, bool compatible = false, time_t timestamp = 0); virtual std::vector<IMasterWallet *> GetAllMasterWallets() const; virtual std::vector<std::string> GetAllMasterWalletID() const; virtual bool WalletLoaded(const std::string &masterWalletID) const; virtual IMasterWallet *GetMasterWallet( const std::string &masterWalletID) const; virtual void DestroyWallet( const std::string &masterWalletID); virtual IMasterWallet *ImportWalletWithKeystore( const std::string &masterWalletID, const nlohmann::json &keystoreContent, const std::string &backupPassword, const std::string &payPassword); virtual IMasterWallet *ImportWalletWithMnemonic( const std::string &masterWalletID, const std::string &mnemonic, const std::string &phrasePassword, const std::string &payPassword, bool singleAddress, time_t timestamp = 0); virtual IMasterWallet *ImportReadonlyWallet( const std::string &masterWalletID, const nlohmann::json &walletJson); virtual std::string GetVersion() const; virtual void FlushData(); protected: typedef std::map<std::string, IMasterWallet *> MasterWalletMap; MasterWalletManager(const MasterWalletMap &walletMap, const std::string &rootPath, const std::string &dataPath); void LoadMasterWalletID(); IMasterWallet *LoadMasterWallet(const std::string &masterWalletID) const; void checkRedundant(IMasterWallet *wallet) const; protected: Lockable *_lock; Config *_config; std::string _rootPath; std::string _dataPath; bool _p2pEnable; mutable MasterWalletMap _masterWalletMap; }; } } #endif //__ELASTOS_SDK_MASTERWALLETMANAGER_H__
33.456647
169
0.708535
[ "vector" ]
6fd2d7da7d2cf503bd196619fc6ee42d4d581437
899
c
C
nitan/d/xiakedao/midao8.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
1
2019-03-27T07:25:16.000Z
2019-03-27T07:25:16.000Z
nitan/d/xiakedao/midao8.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
nitan/d/xiakedao/midao8.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
// midao8.c 密道 #include <ansi.h> inherit ROOM; void create() { set("short", "密道"); set("long", @LONG 這是一條長長的密道,地面和石壁滿是灰塵,好像很久沒人來過了。 LONG ); set("exits", ([ "southdown" : __DIR__"midao7" ])); set("no_clean_up", 0); set("coor/x", -3090); set("coor/y", -25000); set("coor/z", -20); setup(); } void init() { object me = this_player(); if( random((int)me->query_skill("dodge",1)) <= 80) { me->receive_damage("qi", 50); me->receive_wound("qi", 50); message_vision(HIR"$N一不小心踩到地上的一個暗紐,... 啊...!\n"NOR, me); me->move(__DIR__"road3"); tell_object(me, HIR"你從山上滾了下來,只覺得渾身無處不疼,還受了幾處傷。\n"NOR); message("vision",HIR"只見"+query("name", me)+"從山上骨碌碌地滾了下來,躺在地上半天爬不起來!\n"NOR,environment(me),me); } }
26.441176
110
0.494994
[ "object" ]
6fd385589bd5c894cb581fcd6a3bb863b9751eac
15,270
h
C
fitneuron/include/differential_equations.h
TedBrookings/Brookings-et-al-2014
8f5115cd700759dea3b85a3b2214ba4f5dc06a32
[ "MIT" ]
null
null
null
fitneuron/include/differential_equations.h
TedBrookings/Brookings-et-al-2014
8f5115cd700759dea3b85a3b2214ba4f5dc06a32
[ "MIT" ]
null
null
null
fitneuron/include/differential_equations.h
TedBrookings/Brookings-et-al-2014
8f5115cd700759dea3b85a3b2214ba4f5dc06a32
[ "MIT" ]
null
null
null
#ifndef differential_equations_h #define differential_equations_h // compile flags are neccessary: // -I flag tells g++ where to look for Eigen //USE_COMPILE_FLAG -I${PROJECTDIR}/include //USE_COMPILE_FLAG -Wno-shadow -Wno-conversion #include <stdexcept> #include <list> #include <vector> #include <string> #include <tuple> #include <Eigen/Dense> #include "automatic_derivatives/Fad.h" #include "Trace.h" #include "constants.h" typedef Fad<double, 1> FDouble; #define USE_PHONY_6TH class DifferentialEquationException : public std::runtime_error { public: DifferentialEquationException() : std::runtime_error("DifferentialEquationException") {} DifferentialEquationException(const std::string & str) : std::runtime_error(str) {} }; // DiffEqFunctor is a pure virtual class. To derive a class from it: // define getDerivatives() // if there are any supplementary variables that could be targeted by traces // call addTraceTarget() for each one // then call ONE of the two initializeDiffEq() functions // (depending on if you want default state names or custom ones) // then call solve(initialStates) class DiffEqFunctor { public: DiffEqFunctor() : tInitial (0.0), tFinal (Inf), accuracyGoal (0.1), minDeltaT (0.0), stepSizeGain (0.5), algorithmOrder (4.0), maxSolveFailures (10), maxStepFailures (100), verbosity (0) {} virtual ~DiffEqFunctor() {} // initialize differential equation by attaching any traces void initializeDiffEq(std::list<Trace> & traces); // initialize differential equation by setting the number of states, // and attaching any traces void initializeDiffEq(std::list<Trace> & traces, size_t numStates); // initialize differential equation by setting the state names, (and // optionally state units), and attaching any traces void initializeDiffEq(std::list<Trace> & traces, const std::vector<std::string> & stateNames, const std::vector<std::string> & stateUnits = {}); // add a state to the DiffEqFunctor (before calling initialize), and // return the index to that state size_t addStateValue(std::string stateName="", std::string stateUnit="1"); // solve the differential equation, starting with initial states, // and integrating until tFinal void solve(const std::vector<double> & initialStates); // return the states after solve() completes std::vector<double> getFinalStates(void) const; // return the initial states std::vector<double> getInitialStates(void) const; // return the state names const std::vector<std::string> & getStateNames(void) const { return stateNames; } // return the number of function evaluations size_t getNumFunctionEvaluations(void) const { return numDerivatives; } // return the number of matrix exponentials size_t getNumMatrixExponentials(void) const { return numMatrixExponentials; } // starting time for solve() double tInitial; // stopping time for solve() double tFinal; // maximum error of any state over entire solve time interval double accuracyGoal; // minimum deltaT allowed for any step double minDeltaT; // how closely to adjust step size to max estimated size // in open interval (0, 1) double stepSizeGain; // what is the effective order of this algorithm? double algorithmOrder; // maximum number of times the solver can fail to converge size_t maxSolveFailures; // maximum number of times a timestep can fail to converge size_t maxStepFailures; // set level of output (0 = silent, increase for more output) int verbosity; // traces for perturbing and/or recording differential equation states std::list<Trace> traces; protected: // compute d/dt of each state virtual void getDerivatives(const std::vector<FDouble> & states, const double & time, std::vector<FDouble> & dStates) const = 0; // let traces target a variable for recording/clamping/fitting void addTraceTarget(double & target, const std::string & targetName, const std::string & targetUnits); private: // attach traces to differential equation object, so that recording, etc // can be carried out void attachTraces(std::list<Trace> & traces); // save the initial states in case solver must restart void saveInitialStates(const std::vector<double> & initialStates); // initialize bookkeeping for solve void initializeSolve(void); // allocate space for vectors, matrices, etc void allocateObjects(void); // return true if simulation is not complete, false otherwise bool continueSteps(void) const; // Repeatedly attempt to solve for the first time step inline void solveFirstStep(void); // Repeatedly attempt to solve for the next time step inline void solveStep(void); // update states, traces, bookkeeping void updateAfterSuccessfulTimestep(void); // set the value of deltaT for the first attempted step // -in event of minor error, set deltaT = 0 to restart ::solve() void setFirstDeltaT(void); // set the value of deltaT for the next call to timestep() // -in event of minor error, set deltaT = 0 to restart ::solve() void setDeltaT(void); // multiply deltaT by scale factor chosen based upon past error void scaleDeltaT(void); // predict states and derivatives of initial step void predictFirstStep(void); // predict state derivatives of next time step void predictStep(void); // advance the solution in time void timeStep(void); // get the largest time step that won't step past a trace action double getMaxTraceDeltaT(void) const; // predict the value of states at the middle and end of the time step void predictFutureStates(void); // get derivativesMat and derivativesVec, specifying instantaneous // linear approximation to differential equation: // d/dt states = derivativesMat * states + derivativesVec void getLinearizedDerivatives(const Eigen::VectorXd & stateVec, const double & time, Eigen::VectorXd & dStateVec, Eigen::MatrixXd & derivativesMat, Eigen::VectorXd & derivativesVec); // use Magnus expansion to solve differential equation void solveDynamicsEquations(void); // compute error (difference between predicted and actual states) double getPredictionError(void); // update the state predictor void updatePredictor(void); // predict the value of a given state specified by coefficients, at t + dT double predictState(const double & dT, const std::vector<double> & coefs) const; // compute augmented magnus matrix to solve time endpoint at 2nd-order void fillMagnus2ndOrder(const Eigen::MatrixXd & dMat, const Eigen::MatrixXd & dVec, const double & dT); // compute augmented magnus matrix to solve time endpoint at 4th-order void fillMagnusHalf4thOrder(const Eigen::MatrixXd & dMat1, const Eigen::VectorXd & dVec1, const Eigen::MatrixXd & dMat2, const Eigen::VectorXd & dVec2, const Eigen::MatrixXd & dMat3, const Eigen::VectorXd & dVec3, const double & dT); // compute augmented magnus matrix to solve time endpoint at 4th-order void fillMagnus4thOrder(const Eigen::MatrixXd & dMat1, const Eigen::VectorXd & dVec1, const Eigen::MatrixXd & dMat2, const Eigen::VectorXd & dVec2, const Eigen::MatrixXd & dMat3, const Eigen::VectorXd & dVec3, const double & dT); // compute augmented magnus matrix to solve time endpoint at 6th-order void fillMagnusPhony6thOrder(const Eigen::MatrixXd & dMat1, const Eigen::VectorXd & dVec1, const Eigen::MatrixXd & dMat2, const Eigen::VectorXd & dVec2, const Eigen::MatrixXd & dMat3, const Eigen::VectorXd & dVec3, const double & dT); // estimate error in magnus expansion double getMagnusError(void); // solve inhomogenous equation with augmented matrix: // [statesFinal, 1] = exp(magnus) * [statesInitial, 1] // via Padé approximant void expSolvePade(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial); // helper functions for expSolvePade: int scaleMagnus(const double & norm, const double & maxNorm); void pade3Solve(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial, size_t numSquares = 0); void pade5Solve(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial, size_t numSquares = 0); void pade7Solve(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial, size_t numSquares = 0); void pade9Solve(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial, size_t numSquares = 0); void pade13Solve(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial, size_t numSquares=0); void padeSolveSolution(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial); void padeSolveSolutionWithSquares(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial, size_t numSquares=0); // solve inhomogenous equation with augmented matrix: // [statesFinal, 1] = exp(magnus) * [statesInitial, 1] // via Truncated Taylor Series // Reference: A. H. Al-Mohy and N. J. Higham, A New Scaling and Squaring // Algorithm for the Matrix Exponential, SIAM J. Matrix Anal. Appl. 31(3): // 970-989, 2009. void expSolveTaylor(Eigen::VectorXd & statesFinal, const Eigen::VectorXd & statesInitial); // Compute optimal number of steps and degree of truncated Taylor series std::tuple<size_t, size_t> getTruncatedParameters(const double & normMagnus); // Estimate the p-th root of the 1-norm of magnus^p, for an integer p double estimatePNorm(const size_t & p); // initial values of state variables that evolve according to differential // equation Eigen::VectorXd startStates; // states and predicted states at beginning (1), midpoint (2), and end (3) // of interval Eigen::VectorXd states1; Eigen::VectorXd states2; Eigen::VectorXd states3; Eigen::VectorXd states3Order6; // states3 computed differently Eigen::VectorXd predictedStates; // matrix and vector linearization of differential equation Eigen::MatrixXd derivativesMatM1; Eigen::VectorXd derivativesVecM1; Eigen::MatrixXd derivativesMat0; Eigen::VectorXd derivativesVec0; Eigen::MatrixXd derivativesMat1; Eigen::VectorXd derivativesVec1; Eigen::MatrixXd derivativesMat1Left; Eigen::VectorXd derivativesVec1Left; Eigen::MatrixXd derivativesMat2; Eigen::VectorXd derivativesVec2; Eigen::MatrixXd derivativesMat3; Eigen::VectorXd derivativesVec3; Eigen::MatrixXd commMat1; Eigen::VectorXd commVec1; Eigen::MatrixXd commMat2; Eigen::VectorXd commVec2; // augmented magnus matrix (homogenous + inhomogenous parts) Eigen::MatrixXd magnus; // helper matrices and vectors for computing magnus Eigen::MatrixXd meanDerivMat; Eigen::VectorXd meanDerivVec; Eigen::MatrixXd deltaDerivMat; Eigen::VectorXd deltaDerivVec; Eigen::MatrixXd quadraticDerivMat; Eigen::VectorXd quadraticDerivVec; // helper matrices for expSolvePade Eigen::MatrixXd magnus2; Eigen::MatrixXd magnus4; Eigen::MatrixXd magnus6; Eigen::MatrixXd magnus8; Eigen::MatrixXd evenTerms; Eigen::MatrixXd oddTerms; Eigen::MatrixXd numerator; Eigen::MatrixXd denominator; Eigen::MatrixXd numeratorTimesStates1; // helper matrices and vectors for expSolveTaylor Eigen::VectorXd taylorTerm; std::vector<double> theta; Eigen::VectorXd testVector; Eigen::MatrixXd testMatrix; Eigen::VectorXi nonNegVector; Eigen::VectorXi oldNonNegVec; Eigen::VectorXd magnusPNonNeg; // d/dt of states Eigen::VectorXd dStates; // saved value of d/dt of states2 Eigen::VectorXd dStates2; // states vector that supports forward differentiation std::vector<FDouble> fStates; // d/dt states vector that supports forward differentitation std::vector<FDouble> dFStates; // simulation time long double t; // maximum remaining time until solve terminates long double tRemaining; // duration of current time step double deltaT; // discrepency between Magnus expansions of different orders double magnusError; // discrepency between predicted and computed states double predictionError; // specify maximum error per time for a time step double errPerT; // specify maximum error for this time step (now that deltaT is specified) double maxErr; // exponent used in setting deltaT given magnus error double errorPow; // minimum deltaT used by any time step in solution double minSolutionDeltaT; // maximum deltaT for this step (e.g. to not step past a trace action) double maxStepDeltaT; // deltaT from previous successful step double deltaTOld; // duration of the shortest trace double shortestTraceTime; // pointer to Trace with shortest time Trace const* shortestTracePtr; // pointer to Trace that terminates solve() Trace const* terminalTracePtr; // are the derivatives discontinuous at t1? bool discontinuous1; // do we need to restart due to error? bool restartSteps; // names of the state variables std::vector<std::string> stateNames; // units of the state variables (default to "none") std::vector<std::string> stateUnits; // map relating names of Trace targets to their underlying data std::map<std::string, TraceTarget> traceTargetMap; // number of states size_t numStates; // number of successful time steps size_t numTimeSteps; // total number of time steps, successful or no size_t totalTimeSteps; // number of times the solver failed to converge size_t numSolveFailures; // number of times this timestep failed to converge size_t numStepFailures; // greatest numStepFailures accross all steps in solution size_t greatestNumStepFailures; // number of times the derivatives have been evaluatated size_t numDerivatives; // number of times a matrix has been exponentiated size_t numMatrixExponentials; }; #endif
41.382114
94
0.671054
[ "object", "vector" ]
6fd64e07be5feb83fe3b260dee6c85d2ed377bc3
86,153
h
C
DLL Source Code/CvGameCoreDLLUtil/include/CvDllInterfaces.h
DelnarErsike/Civ5-Ranged-Counterattacks-Minimod
8c970ecd014f7be58da1e8d56d6a607d9ca489af
[ "BSD-3-Clause" ]
1
2019-08-01T16:15:06.000Z
2019-08-01T16:15:06.000Z
DLL Source Code/CvGameCoreDLLUtil/include/CvDllInterfaces.h
DelnarErsike/Civ5-Ranged-Counterattacks-Minimod
8c970ecd014f7be58da1e8d56d6a607d9ca489af
[ "BSD-3-Clause" ]
1
2019-12-24T14:07:00.000Z
2019-12-24T14:07:00.000Z
DLL Source Code/CvGameCoreDLLUtil/include/CvDllInterfaces.h
DelnarErsike/Civ5-Ranged-Counterattacks-Minimod
8c970ecd014f7be58da1e8d56d6a607d9ca489af
[ "BSD-3-Clause" ]
null
null
null
#pragma once //------------------------------------------------------------------------------ // DEFINES //------------------------------------------------------------------------------ #define DLLCALL __stdcall /* Some guidelines... Design Guidelines: * Must derive from ICvUnknown either directly or indirectly. * Must have a GUID defined in the global scope. * Must contain an inline function GetInterfaceId() that returns the GUID. * Must not change after being defined. * All functions must be declared with DLLCALL as their calling convention. * Functions that return interface instances must be of type ICvUnknown* or version 1 of the interface type. Naming Conventions: * Interfaces must be prefixed with ICv * Interfaces other than ICvUnknown must be post-fixed with a version number starting at 1. * Globally scoped GUIDs that relate to specific interfaces must be named guid<InterfaceName>. Usage Guidelines * Interface instances must be explicitly deleted in order to be correctly released by the DLL. * It's safe and encouraged to use interface instances inside of auto_ptr and shared_ptr types. Implementation Guidelines: * QueryInterface must support all interfaces that the implementation derives from (including ICvUnknown). * New instances may be returned as a result of a QueryInterface call. * NULL must be returned if QueryInterface does not support the interface. * A single implementation may implement multiple interfaces. * It's the implementer's responsibility that interface instances are cleaned up properly via Destroy(). */ ////////////////////////////////////////////////////////////////////////////////////////////////// /* Please note that the interfaces in the file should be considered FROZEN. These interfaces have been made public and any mods will be depending on these not changing. */ ////////////////////////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------ // GUIDs //------------------------------------------------------------------------------ // {D89BA82F-9FA3-4696-B3F4-52BDB101CFB2} static const GUID guidICvUnknown = {0xd89ba82f, 0x9fa3, 0x4696, 0xb3, 0xf4, 0x52, 0xbd, 0xb1, 0x1, 0xcf, 0xb2}; // {579A12E9-3C70-4276-8460-C941A5F9585F} static const GUID guidICvEnumerator = { 0x579a12e9, 0x3c70, 0x4276, { 0x84, 0x60, 0xc9, 0x41, 0xa5, 0xf9, 0x58, 0x5f } }; // {AE87F7BD-8510-444f-9D54-983D776485A6} static const GUID guidICvDLLDatabaseUtility1 = { 0xae87f7bd, 0x8510, 0x444f, { 0x9d, 0x54, 0x98, 0x3d, 0x77, 0x64, 0x85, 0xa6 } }; // {C004434C-878E-4bcd-BAB2-4CEE341D711B} static const GUID guidICvScriptSystemUtility1 = { 0xc004434c, 0x878e, 0x4bcd, { 0xba, 0xb2, 0x4c, 0xee, 0x34, 0x1d, 0x71, 0x1b } }; // {A309FA38-CF60-4239-A162-8586C0D1C7D3} static const GUID guidICvGameContext1 = { 0xa309fa38, 0xcf60, 0x4239, 0xa1, 0x62, 0x85, 0x86, 0xc0, 0xd1, 0xc7, 0xd3}; // {E75BA944-05DB-4D6C-96A6-A07B71CDBE77} static const GUID guidICvCity1 = { 0xe75ba944, 0x5db, 0x4d6c, { 0x96, 0xa6, 0xa0, 0x7b, 0x71, 0xcd, 0xbe, 0x77 } }; // {DA81A0DC-30B3-4773-8786-35D470E0EF64} static const GUID guidICvCombatInfo1 = { 0xda81a0dc, 0x30b3, 0x4773, { 0x87, 0x86, 0x35, 0xd4, 0x70, 0xe0, 0xef, 0x64 } }; // {61CA9E15-59FA-4980-AD88-27A71AC425A5} static const GUID guidICvDeal1 = { 0x61ca9e15, 0x59fa, 0x4980, { 0xad, 0x88, 0x27, 0xa7, 0x1a, 0xc4, 0x25, 0xa5 } }; // {33320CC0-47FD-4b67-A024-FFF3AA4F66C1} static const GUID guidICvDealAI1 = { 0x33320cc0, 0x47fd, 0x4b67, { 0xa0, 0x24, 0xff, 0xf3, 0xaa, 0x4f, 0x66, 0xc1 } }; // {5215A1C1-5649-46a7-A0D2-5819536A62F1} static const GUID guidICvDiplomacyAI1 = { 0x5215a1c1, 0x5649, 0x46a7, { 0xa0, 0xd2, 0x58, 0x19, 0x53, 0x6a, 0x62, 0xf1 } }; // {DC39D22C-12AE-4395-8A20-EEF145A77DD0} static const GUID guidICvGame1 = { 0xdc39d22c, 0x12ae, 0x4395, { 0x8a, 0x20, 0xee, 0xf1, 0x45, 0xa7, 0x7d, 0xd0 } }; // {637E8AEC-5B31-49d5-9814-76DCE305A29B} static const GUID guidICvGameAsynch1 = { 0x637e8aec, 0x5b31, 0x49d5, { 0x98, 0x14, 0x76, 0xdc, 0xe3, 0x5, 0xa2, 0x9b } }; // {8B71D2B1-3673-41a2-B663-C67C02E16F57} static const GUID guidICvMap1 = { 0x8b71d2b1, 0x3673, 0x41a2, { 0xb6, 0x63, 0xc6, 0x7c, 0x2, 0xe1, 0x6f, 0x57 } }; // {D97F1045-472F-48e7-8C61-5993DECC2677} static const GUID guidICvMissionData1 = { 0xd97f1045, 0x472f, 0x48e7, { 0x8c, 0x61, 0x59, 0x93, 0xde, 0xcc, 0x26, 0x77 } }; // {55B80DA7-D175-4ea7-B555-B98845DDDC8E} static const GUID guidICvNetMessageHandler1 = { 0x55b80da7, 0xd175, 0x4ea7, { 0xb5, 0x55, 0xb9, 0x88, 0x45, 0xdd, 0xdc, 0x8e } }; // {A8D76617-571D-40a5-B82C-FF0C51497C13} static const GUID guidICvNetMessageHandler2 = { 0xa8d76617, 0x571d, 0x40a5, { 0xb8, 0x2c, 0xff, 0xc, 0x51, 0x49, 0x7c, 0x13 } }; // {113A2A5B-907F-4a99-9756-9B76425D161D} static const GUID guidICvNetworkSyncronization1 = { 0x113a2a5b, 0x907f, 0x4a99, { 0x97, 0x56, 0x9b, 0x76, 0x42, 0x5d, 0x16, 0x1d } }; // {AE4C09EB-A092-45EB-9CA7-F4A5D2F88602} static const GUID guidICvPlayer1 = { 0xae4c09eb, 0xa092, 0x45eb, { 0x9c, 0xa7, 0xf4, 0xa5, 0xd2, 0xf8, 0x86, 0x2 } }; // {611993FC-2A77-44ee-82AF-28AE38380803} static const GUID guidICvPlot1 = { 0x611993fc, 0x2a77, 0x44ee, { 0x82, 0xaf, 0x28, 0xae, 0x38, 0x38, 0x8, 0x3 } }; // {C826212A-5D8B-46ea-B326-CB57C75B9578} static const GUID guidICvPreGame1 = { 0xc826212a, 0x5d8b, 0x46ea, { 0xb3, 0x26, 0xcb, 0x57, 0xc7, 0x5b, 0x95, 0x78 } }; // {2331CBF1-AD80-4c4a-A614-F377444529D9} static const GUID guidICvRandom1 = { 0x2331cbf1, 0xad80, 0x4c4a, { 0xa6, 0x14, 0xf3, 0x77, 0x44, 0x45, 0x29, 0xd9 } }; // {AC702E9C-8EF0-45de-9951-DDFE8BCC52CD} static const GUID guidICvTeam1 = { 0xac702e9c, 0x8ef0, 0x45de, { 0x99, 0x51, 0xdd, 0xfe, 0x8b, 0xcc, 0x52, 0xcd } }; // {9F157E04-4B2D-4797-9AA5-1325DE221607} static const GUID guidICvUnit1 = {0x9f157e04, 0x4b2d, 0x4797, 0x9a, 0xa5, 0x13, 0x25, 0xde, 0x22, 0x16, 0x7}; // {78F0497A-7A44-49a0-8D14-58AAB8C128B8} static const GUID guidICvUnitInfo1 = { 0x78f0497a, 0x7a44, 0x49a0, { 0x8d, 0x14, 0x58, 0xaa, 0xb8, 0xc1, 0x28, 0xb8 } }; // {F2DFB50A-AEDA-47cd-BF02-177A67944A74} static const GUID guidICvBuildingInfo1 = { 0xf2dfb50a, 0xaeda, 0x47cd, { 0xbf, 0x2, 0x17, 0x7a, 0x67, 0x94, 0x4a, 0x74 } }; // {944BCC2F-0BC6-4345-BCBD-82383470F32E} static const GUID guidICvImprovementInfo1 = { 0x944bcc2f, 0xbc6, 0x4345, { 0xbc, 0xbd, 0x82, 0x38, 0x34, 0x70, 0xf3, 0x2e } }; // {E0B39559-B03D-4338-BBE3-24C08DADD54E} static const GUID guidICvTechInfo1 = { 0xe0b39559, 0xb03d, 0x4338, { 0xbb, 0xe3, 0x24, 0xc0, 0x8d, 0xad, 0xd5, 0x4e } }; // {D347C353-2BA5-4da7-881F-46A5F860B74A} static const GUID guidICvBuildInfo1 = { 0xd347c353, 0x2ba5, 0x4da7, { 0x88, 0x1f, 0x46, 0xa5, 0xf8, 0x60, 0xb7, 0x4a } }; // {49C59819-A545-4c34-9328-CA3ACED932B8} static const GUID guidICvCivilizationInfo1 = { 0x49c59819, 0xa545, 0x4c34, { 0x93, 0x28, 0xca, 0x3a, 0xce, 0xd9, 0x32, 0xb8 } }; // {22CCAA13-6102-44e0-B1F6-94EE76A23BC1} static const GUID guidICvColorInfo1 = { 0x22ccaa13, 0x6102, 0x44e0, { 0xb1, 0xf6, 0x94, 0xee, 0x76, 0xa2, 0x3b, 0xc1 } }; // {1A87B286-5001-4661-9A89-8126AF132702} static const GUID guidICvDlcPackageInfo1 = { 0x1a87b286, 0x5001, 0x4661, { 0x9a, 0x89, 0x81, 0x26, 0xaf, 0x13, 0x27, 0x2 } }; // {FDA260CE-A5D3-4191-835F-1B99B360291D} static const GUID guidICvEraInfo1 = { 0xfda260ce, 0xa5d3, 0x4191, { 0x83, 0x5f, 0x1b, 0x99, 0xb3, 0x60, 0x29, 0x1d } }; // {CCA94937-D8F5-4755-BC1D-4DAE0DD71008} static const GUID guidICvFeatureInfo1 = { 0xcca94937, 0xd8f5, 0x4755, { 0xbc, 0x1d, 0x4d, 0xae, 0xd, 0xd7, 0x10, 0x8 } }; // {4E021163-B771-4cfb-98AA-4F7AD9BCA37E} static const GUID guidICvGameDeals1 = { 0x4e021163, 0xb771, 0x4cfb, { 0x98, 0xaa, 0x4f, 0x7a, 0xd9, 0xbc, 0xa3, 0x7e } }; // {BAAC0587-5B40-4611-A75A-190E3CB86F79} static const GUID guidICvGameOptionInfo1 = { 0xbaac0587, 0x5b40, 0x4611, { 0xa7, 0x5a, 0x19, 0xe, 0x3c, 0xb8, 0x6f, 0x79 } }; // {F1319991-D469-4202-9E95-C3AE01AE5646} static const GUID guidICvGameSpeedInfo1 = { 0xf1319991, 0xd469, 0x4202, { 0x9e, 0x95, 0xc3, 0xae, 0x1, 0xae, 0x56, 0x46 } }; // {7597D310-0517-4e27-80B3-CEA862385AC1} static const GUID guidICvHandicapInfo1 = { 0x7597d310, 0x517, 0x4e27, { 0x80, 0xb3, 0xce, 0xa8, 0x62, 0x38, 0x5a, 0xc1 } }; // {154AEB0B-7D94-4077-B711-352C3B1EDB88} static const GUID guidICvInterfaceModeInfo1 = { 0x154aeb0b, 0x7d94, 0x4077, { 0xb7, 0x11, 0x35, 0x2c, 0x3b, 0x1e, 0xdb, 0x88 } }; // {0E264A94-8802-4062-A0AD-0364D9DD29A3} static const GUID guidICvLeaderHeadInfo1 = { 0xe264a94, 0x8802, 0x4062, { 0xa0, 0xad, 0x3, 0x64, 0xd9, 0xdd, 0x29, 0xa3 } }; // {0DDF7A39-4801-47ce-8D9C-538ED9C4A479} static const GUID guidICvMinorCivInfo1 = { 0xddf7a39, 0x4801, 0x47ce, { 0x8d, 0x9c, 0x53, 0x8e, 0xd9, 0xc4, 0xa4, 0x79 } }; // {F3328352-CCFA-4d41-853F-D9E374D06013} static const GUID guidICvMissionInfo1 = { 0xf3328352, 0xccfa, 0x4d41, { 0x85, 0x3f, 0xd9, 0xe3, 0x74, 0xd0, 0x60, 0x13 } }; // {7917C933-2EDC-49af-B7F3-C065CBB5EB2C} static const GUID guidICvNetInitInfo1 = { 0x7917c933, 0x2edc, 0x49af, { 0xb7, 0xf3, 0xc0, 0x65, 0xcb, 0xb5, 0xeb, 0x2c } }; // {47189636-A5D4-4d0b-AA79-F970656F14EB} static const GUID guidICvNetLoadGameInfo1 = { 0x47189636, 0xa5d4, 0x4d0b, { 0xaa, 0x79, 0xf9, 0x70, 0x65, 0x6f, 0x14, 0xeb } }; // {1ED0AE82-0B7A-431e-AD52-E0EE05F8A56A} static const GUID guidICvPlayerColorInfo1 = { 0x1ed0ae82, 0xb7a, 0x431e, { 0xad, 0x52, 0xe0, 0xee, 0x5, 0xf8, 0xa5, 0x6a } }; // {8C315274-E9A7-4210-9B2E-0AF13C43C0B6} static const GUID guidICvPlayerOptionInfo1 = { 0x8c315274, 0xe9a7, 0x4210, { 0x9b, 0x2e, 0xa, 0xf1, 0x3c, 0x43, 0xc0, 0xb6 } }; // {79C1DABA-9D1D-421e-83CE-83F581582619} static const GUID guidICvPolicyInfo1 = { 0x79c1daba, 0x9d1d, 0x421e, { 0x83, 0xce, 0x83, 0xf5, 0x81, 0x58, 0x26, 0x19 } }; // {B1AC8C62-11CF-4ac9-8633-B387EBF9E0DA} static const GUID guidICvPromotionInfo1 = { 0xb1ac8c62, 0x11cf, 0x4ac9, { 0x86, 0x33, 0xb3, 0x87, 0xeb, 0xf9, 0xe0, 0xda } }; // {20415753-638D-4a6d-922F-8A9D11F6008E} static const GUID guidICvResourceInfo1 = { 0x20415753, 0x638d, 0x4a6d, { 0x92, 0x2f, 0x8a, 0x9d, 0x11, 0xf6, 0x0, 0x8e } }; // {0EDE50AB-37D4-4272-BDAF-0B25E2A05FAD} static const GUID guidICvTerrainInfo1 = { 0xede50ab, 0x37d4, 0x4272, { 0xbd, 0xaf, 0xb, 0x25, 0xe2, 0xa0, 0x5f, 0xad } }; // {53507549-1614-428e-899F-25FFAC803938} static const GUID guidICvWorldInfo1 = { 0x53507549, 0x1614, 0x428e, { 0x89, 0x9f, 0x25, 0xff, 0xac, 0x80, 0x39, 0x38 } }; // {AFEFDF63-DB01-412a-B370-162DBB452F0C} static const GUID guidICvVictoryInfo1 = { 0xafefdf63, 0xdb01, 0x412a, { 0xb3, 0x70, 0x16, 0x2d, 0xbb, 0x45, 0x2f, 0xc } }; // {297098FA-8CD6-4828-A885-0E1D58AFFDD4} static const GUID guidICvUnitCombatClassInfo1 = { 0x297098fa, 0x8cd6, 0x4828, { 0xa8, 0x85, 0xe, 0x1d, 0x58, 0xaf, 0xfd, 0xd4 } }; // {39474804-14F7-44e3-B551-A2498DCAD11C} static const GUID guidICvWorldBuilderMapLoader1 = { 0x39474804, 0x14f7, 0x44e3, { 0xb5, 0x51, 0xa2, 0x49, 0x8d, 0xca, 0xd1, 0x1c } }; // {D13F7E42-8644-4e60-8483-3A3EB8F0E8C1} static const GUID guidICvPathFinderUpdate1 = { 0xd13f7e42, 0x8644, 0x4e60, { 0x84, 0x83, 0x3a, 0x3e, 0xb8, 0xf0, 0xe8, 0xc1 } }; //------------------------------------------------------------------------------ // Forward declarations //------------------------------------------------------------------------------ struct lua_State; class FAutoArchive; class FIGameIniParser; class ICvBuildingInfo1; class ICvCity1; class ICvCombatInfo1; class ICvDLLDatabaseUtility1; class ICvDeal1; class ICvDlcPackageInfo1; class ICvEngineUtility1; class ICvGame1; class ICvGameAsynch1; class ICvImprovementInfo1; class ICvMap1; class ICvNetMessageHandler1; class ICvNetworkSyncronization1; class ICvNetInitInfo1; class ICvNetLoadGameInfo1; class ICvPlayer1; class ICvPlot1; class ICvPreGame1; class ICvRandom1; class ICvScriptSystemUtility1; class ICvTeam1; class ICvTechInfo1; class ICvUnit1; class ICvUnitInfo1; class ICvWorldBuilderMapLoader1; class ICvPathFinderUpdate1; //------------------------------------------------------------------------------ // Base Interfaces //------------------------------------------------------------------------------ class ICvUnknown { public: static GUID DLLCALL GetInterfaceId(){ return guidICvUnknown; } void DLLCALL operator delete(void* p) { if (p) { ICvUnknown* inst = (ICvUnknown*)(p); inst->Destroy(); } } virtual void* DLLCALL QueryInterface(GUID guidInterface) = 0; template<typename T> T* DLLCALL QueryInterface() { return static_cast<T*>(QueryInterface(T::GetInterfaceId())); } protected: virtual void DLLCALL Destroy() = 0; }; class ICvEnumerator : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId(){ return guidICvEnumerator; } virtual bool DLLCALL MoveNext() = 0; virtual void DLLCALL Reset() = 0; virtual ICvUnknown* DLLCALL GetCurrent() = 0; }; class ICvBuildInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvBuildInfo1; } virtual const char* DLLCALL GetType() = 0; virtual int DLLCALL GetImprovement() = 0; virtual int DLLCALL GetRoute() = 0; }; class ICvCivilizationInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvCivilizationInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual bool DLLCALL IsAIPlayable() = 0; virtual bool DLLCALL IsPlayable() = 0; virtual const char* DLLCALL GetShortDescription() = 0; virtual int DLLCALL GetDefaultPlayerColor() = 0; virtual int DLLCALL GetArtStyleType() = 0; virtual int DLLCALL GetNumCityNames() = 0; virtual const char* DLLCALL GetArtStylePrefix() = 0; virtual const char* DLLCALL GetArtStyleSuffix() = 0; virtual const char* DLLCALL GetDawnOfManAudio() = 0; virtual int DLLCALL GetCivilizationBuildings(int i) = 0; virtual bool DLLCALL IsLeaders(int i) = 0; virtual const char* DLLCALL GetCityNames(int i) = 0; virtual const char* DLLCALL GetSoundtrackKey() = 0; }; class ICvColorInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvColorInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const CvColorA& DLLCALL GetColor() = 0; }; class ICvDlcPackageInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvDlcPackageInfo1; } virtual GUID DLLCALL GetPackageID() = 0; }; class ICvEraInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvEraInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual int DLLCALL GetNumEraVOs() = 0; virtual const char* DLLCALL GetEraVO(int iIndex) = 0; virtual const char* DLLCALL GetArtPrefix() = 0; }; class ICvFeatureInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvFeatureInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual bool DLLCALL IsNoCoast() = 0; virtual bool DLLCALL IsNoRiver() = 0; virtual bool DLLCALL IsNoAdjacent() = 0; virtual bool DLLCALL IsRequiresFlatlands() = 0; virtual bool DLLCALL IsRequiresRiver() = 0; virtual bool DLLCALL IsNaturalWonder() = 0; virtual const char* DLLCALL GetArtDefineTag() = 0; virtual int DLLCALL GetWorldSoundscapeScriptId() = 0; virtual const char* DLLCALL GetEffectTypeTag() = 0; virtual bool DLLCALL IsTerrain(int i) = 0; }; class ICvGameDeals1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvGameDeals1; } virtual void DLLCALL AddProposedDeal(ICvDeal1* pDeal) = 0; virtual bool DLLCALL FinalizeDeal(PlayerTypes eFromPlayer, PlayerTypes eToPlayer, bool bAccepted) = 0; virtual ICvDeal1* DLLCALL GetTempDeal() = 0; virtual void DLLCALL SetTempDeal(ICvDeal1* pDeal) = 0; virtual PlayerTypes DLLCALL HasMadeProposal(PlayerTypes eFromPlayer) = 0; virtual bool DLLCALL ProposedDealExists(PlayerTypes eFromPlayer, PlayerTypes eToPlayer) = 0; virtual ICvDeal1* DLLCALL GetProposedDeal(PlayerTypes eFromPlayer, PlayerTypes eToPlayer) = 0; virtual ICvDeal1* DLLCALL GetCurrentDeal(PlayerTypes ePlayer, unsigned int index) = 0; virtual ICvDeal1* DLLCALL GetHistoricDeal(PlayerTypes ePlayer, unsigned int indx) = 0; virtual unsigned int DLLCALL GetNumCurrentDeals(PlayerTypes ePlayer) = 0; virtual unsigned int DLLCALL GetNumHistoricDeals(PlayerTypes ePlayer) = 0; virtual unsigned int DLLCALL CreateDeal() = 0; virtual ICvDeal1* DLLCALL GetDeal(unsigned int index) = 0; virtual void DLLCALL DestroyDeal(unsigned int index) = 0; }; class ICvGameOptionInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvGameOptionInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual bool DLLCALL GetDefault() = 0; }; class ICvGameSpeedInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvGameSpeedInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual int DLLCALL GetBarbPercent() = 0; }; class ICvHandicapInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvHandicapInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual int DLLCALL GetBarbSpawnMod() = 0; }; class ICvInterfaceModeInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvInterfaceModeInfo1; } virtual int DLLCALL GetMissionType() = 0; }; class ICvLeaderHeadInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvLeaderHeadInfo1; } virtual const char* DLLCALL GetDescription() = 0; virtual const char* DLLCALL GetArtDefineTag() = 0; }; class ICvMinorCivInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvMinorCivInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual int DLLCALL GetDefaultPlayerColor() const = 0; virtual int DLLCALL GetArtStyleType() const = 0; virtual int DLLCALL GetNumCityNames() const = 0; virtual const char* DLLCALL GetArtStylePrefix() const = 0; virtual const char* DLLCALL GetArtStyleSuffix() const = 0; virtual const char* DLLCALL GetCityNames(int i) const = 0; }; class ICvMissionInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvMissionInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; }; class ICvNetInitInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvNetInitInfo1; } virtual const char* DLLCALL GetDebugString() = 0; virtual bool DLLCALL Read(FDataStream& kStream) = 0; virtual bool DLLCALL Write(FDataStream& kStream) = 0; virtual bool DLLCALL Commit() = 0; }; class ICvNetLoadGameInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvNetLoadGameInfo1; } virtual bool DLLCALL Read(FDataStream& kStream) = 0; virtual bool DLLCALL Write(FDataStream& kStream) = 0; virtual bool DLLCALL Commit() = 0; }; class ICvPlayerColorInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvPlayerColorInfo1; } virtual const char* DLLCALL GetType() = 0; virtual ColorTypes DLLCALL GetColorTypePrimary() = 0; virtual ColorTypes DLLCALL GetColorTypeSecondary() = 0; }; class ICvPlayerOptionInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvPlayerOptionInfo1; } virtual bool DLLCALL GetDefault() = 0; }; class ICvPolicyInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvPolicyInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; }; class ICvPromotionInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvPromotionInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; }; class ICvResourceInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvResourceInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual int DLLCALL GetResourceClassType() = 0; virtual ResourceUsageTypes DLLCALL GetResourceUsage() = 0; virtual const char* DLLCALL GetIconString() = 0; virtual const char* DLLCALL GetArtDefineTag() = 0; virtual const char* DLLCALL GetArtDefineTagHeavy() = 0; virtual const char* DLLCALL GetAltArtDefineTag() = 0; virtual const char* DLLCALL GetAltArtDefineTagHeavy() = 0; virtual bool DLLCALL IsTerrain(int i) = 0; virtual bool DLLCALL IsFeature(int i) = 0; virtual bool DLLCALL IsFeatureTerrain(int i) = 0; }; class ICvTerrainInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvTerrainInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; virtual bool DLLCALL IsWater() = 0; virtual const char* DLLCALL GetArtDefineTag() = 0; virtual int DLLCALL GetWorldSoundscapeScriptId() = 0; virtual const char* DLLCALL GetEffectTypeTag() = 0; }; class ICvUnitCombatClassInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvUnitCombatClassInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; }; class ICvVictoryInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvVictoryInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescription() = 0; }; class ICvWorldInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvWorldInfo1; } virtual const char* DLLCALL GetType() = 0; virtual const char* DLLCALL GetDescriptionKey() = 0; virtual int DLLCALL GetDefaultPlayers() = 0; virtual int DLLCALL GetDefaultMinorCivs() = 0; }; class ICvGameContext1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvGameContext1; } virtual GUID DLLCALL GetDLLGUID() = 0; virtual const char * DLLCALL GetDLLVersion() = 0; virtual ICvNetworkSyncronization1* DLLCALL GetNetworkSyncronizer() = 0; virtual ICvNetMessageHandler1* DLLCALL GetNetMessageHandler() = 0; virtual ICvWorldBuilderMapLoader1* DLLCALL GetWorldBuilderMapLoader() = 0; virtual ICvPreGame1* DLLCALL GetPreGame() = 0; virtual ICvGame1* DLLCALL GetGame() = 0; virtual ICvGameAsynch1* DLLCALL GetGameAsynch() = 0; virtual ICvMap1* DLLCALL GetMap() = 0; virtual ICvTeam1* DLLCALL GetTeam(TeamTypes eTeam) = 0; // Infos Accessors virtual int DLLCALL GetInfoTypeForString(const char* szType, bool hideAssert = false) const = 0; virtual int DLLCALL GetInfoTypeForHash(uint uiHash, bool hideAssert = false) const = 0; virtual CivilizationTypes DLLCALL GetCivilizationInfoIndex(const char* pszType) = 0; virtual int DLLCALL GetNumPlayableCivilizationInfos() = 0; virtual int DLLCALL GetNumAIPlayableCivilizationInfos() = 0; virtual int DLLCALL GetNumPlayableMinorCivs() = 0; virtual int DLLCALL GetNumBuildInfos() = 0; virtual int DLLCALL GetNumBuildingInfos() = 0; virtual int DLLCALL GetNumCivilizationInfos() = 0; virtual int DLLCALL GetNumClimateInfos() = 0; virtual int DLLCALL GetNumColorInfos() = 0; virtual int DLLCALL GetNumEraInfos() = 0; virtual int DLLCALL GetNumFeatureInfos() = 0; virtual int DLLCALL GetNumGameOptionInfos() = 0; virtual int DLLCALL GetNumGameSpeedInfos() = 0; virtual int DLLCALL GetNumHandicapInfos() = 0; virtual int DLLCALL GetNumImprovementInfos() = 0; virtual int DLLCALL GetNumLeaderHeadInfos() = 0; virtual int DLLCALL GetNumMinorCivInfos() = 0; virtual int DLLCALL GetNumPlayerColorInfos() = 0; virtual int DLLCALL GetNumPolicyInfos() = 0; virtual int DLLCALL GetNumPromotionInfos() = 0; virtual int DLLCALL GetNumResourceInfos() = 0; virtual int DLLCALL GetNumSeaLevelInfos() = 0; virtual int DLLCALL GetNumTechInfos() = 0; virtual int DLLCALL GetNumTerrainInfos() = 0; virtual int DLLCALL GetNumUnitCombatClassInfos() = 0; virtual int DLLCALL GetNumUnitInfos() = 0; virtual int DLLCALL GetNumVictoryInfos() = 0; virtual int DLLCALL GetNumWorldInfos() = 0; virtual ICvBuildInfo1* DLLCALL GetBuildInfo(BuildTypes eBuildNum) = 0; virtual ICvBuildingInfo1* DLLCALL GetBuildingInfo(BuildingTypes eBuilding) = 0; virtual ICvCivilizationInfo1* DLLCALL GetCivilizationInfo(CivilizationTypes eCivilizationNum) = 0; virtual ICvColorInfo1* DLLCALL GetColorInfo(ColorTypes e) = 0; virtual ICvEraInfo1* DLLCALL GetEraInfo(EraTypes eEraNum) = 0; virtual ICvFeatureInfo1* DLLCALL GetFeatureInfo(FeatureTypes eFeatureNum) = 0; virtual ICvGameOptionInfo1* DLLCALL GetGameOptionInfo(GameOptionTypes eGameOptionNum) = 0; virtual ICvGameSpeedInfo1* DLLCALL GetGameSpeedInfo(GameSpeedTypes eGameSpeedNum) = 0; virtual ICvHandicapInfo1* DLLCALL GetHandicapInfo(HandicapTypes eHandicapNum) = 0; virtual ICvInterfaceModeInfo1* DLLCALL GetInterfaceModeInfo(InterfaceModeTypes e) = 0; virtual ICvImprovementInfo1* DLLCALL GetImprovementInfo(ImprovementTypes eImprovement) = 0; virtual ICvLeaderHeadInfo1* DLLCALL GetLeaderHeadInfo(LeaderHeadTypes eLeaderHeadNum) = 0; virtual ICvMinorCivInfo1* DLLCALL GetMinorCivInfo(MinorCivTypes eMinorCiv) = 0; virtual ICvMissionInfo1* DLLCALL GetMissionInfo(MissionTypes eMission) = 0; virtual ICvPlayerColorInfo1* DLLCALL GetPlayerColorInfo(PlayerColorTypes e) = 0; virtual ICvPlayerOptionInfo1* DLLCALL GetPlayerOptionInfo(PlayerOptionTypes ePlayerOptionNum) = 0; virtual ICvPolicyInfo1* DLLCALL GetPolicyInfo(PolicyTypes ePolicy) = 0; virtual ICvPromotionInfo1* DLLCALL GetPromotionInfo(PromotionTypes ePromotion) = 0; virtual ICvResourceInfo1* DLLCALL GetResourceInfo(ResourceTypes eResourceNum) = 0; virtual ICvTechInfo1* DLLCALL GetTechInfo(TechTypes eTech) = 0; virtual ICvTerrainInfo1* DLLCALL GetTerrainInfo(TerrainTypes eTerrainNum) = 0; virtual ICvUnitInfo1* DLLCALL GetUnitInfo(UnitTypes eUnit) = 0; virtual ICvUnitCombatClassInfo1* DLLCALL GetUnitCombatClassInfo(UnitCombatTypes eUnitCombat) = 0; virtual ICvVictoryInfo1* DLLCALL GetVictoryInfo(VictoryTypes eVictoryType) = 0; // Defines // ***** EXPOSED ***** // use very sparingly - this is costly virtual bool DLLCALL GetDefineSTRING(char* szBuffer, size_t lenBuffer, const char* szName, bool bReportErrors = true) = 0; virtual int DLLCALL GetMOVE_DENOMINATOR() const = 0; virtual int DLLCALL GetMAX_CITY_HIT_POINTS() const = 0; virtual float DLLCALL GetCITY_ZOOM_OFFSET() const = 0; virtual float DLLCALL GetCITY_ZOOM_LEVEL_1() const = 0; virtual float DLLCALL GetCITY_ZOOM_LEVEL_2() const = 0; virtual float DLLCALL GetCITY_ZOOM_LEVEL_3() const = 0; virtual int DLLCALL GetRUINS_IMPROVEMENT() const = 0; virtual int DLLCALL GetSHALLOW_WATER_TERRAIN() const = 0; virtual int DLLCALL GetDEFICIT_UNIT_DISBANDING_THRESHOLD() const = 0; virtual int DLLCALL GetLAST_UNIT_ART_ERA() const = 0; virtual int DLLCALL GetLAST_EMBARK_ART_ERA() const = 0; virtual int DLLCALL GetHEAVY_RESOURCE_THRESHOLD() const = 0; virtual int DLLCALL GetSTANDARD_HANDICAP() const = 0; virtual int DLLCALL GetSTANDARD_GAMESPEED() const = 0; virtual int DLLCALL GetLAST_BRIDGE_ART_ERA() const = 0; virtual int DLLCALL GetBARBARIAN_CIVILIZATION() const = 0; virtual int DLLCALL GetMINOR_CIVILIZATION() const = 0; virtual int DLLCALL GetBARBARIAN_HANDICAP() const = 0; virtual int DLLCALL GetBARBARIAN_LEADER() const = 0; virtual int DLLCALL GetMINOR_CIV_HANDICAP() const = 0; virtual int DLLCALL GetWALLS_BUILDINGCLASS() const = 0; virtual int DLLCALL GetAI_HANDICAP() const = 0; virtual int DLLCALL GetNUM_CITY_PLOTS() const = 0; virtual const char** DLLCALL GetHexDebugLayerNames() = 0; virtual float DLLCALL GetHexDebugLayerScale(const char* szLayerName) = 0; virtual bool DLLCALL GetHexDebugLayerString(ICvPlot1* pPlot, const char* szLayerName, PlayerTypes ePlayer, char* szBuffer, unsigned int uiBufferLength) = 0; virtual void DLLCALL Init() = 0; virtual void DLLCALL Uninit() = 0; virtual ICvScriptSystemUtility1* DLLCALL GetScriptSystemUtility() = 0; virtual const char* DLLCALL GetNotificationType(int NotificationID) const = 0; virtual bool DLLCALL GetLogging() = 0; virtual void DLLCALL SetLogging(bool bEnable) = 0; virtual int DLLCALL GetRandLogging() = 0; virtual void DLLCALL SetRandLogging(int iRandLoggingFlags) = 0; virtual bool DLLCALL GetAILogging() = 0; virtual void DLLCALL SetAILogging(bool bEnable) = 0; virtual bool DLLCALL GetAIPerfLogging() = 0; virtual void DLLCALL SetAIPerfLogging(bool bEnable) = 0; virtual bool DLLCALL GetBuilderAILogging() = 0; virtual void DLLCALL SetBuilderAILogging(bool bEnable) = 0; virtual bool DLLCALL GetPlayerAndCityAILogSplit() = 0; virtual void DLLCALL SetPlayerAndCityAILogSplit(bool bEnable) = 0; virtual bool DLLCALL GetTutorialLogging() = 0; virtual void DLLCALL SetTutorialLogging(bool bEnable) = 0; virtual bool DLLCALL GetTutorialDebugging() = 0; virtual void DLLCALL SetTutorialDebugging(bool bEnable) = 0; virtual bool DLLCALL GetAllowRClickMovementWhileScrolling() = 0; virtual void DLLCALL SetAllowRClickMovementWhileScrolling(bool bAllow) = 0; virtual bool DLLCALL GetPostTurnAutosaves() = 0; virtual void DLLCALL SetPostTurnAutosaves(bool bEnable) = 0; virtual ICvDLLDatabaseUtility1* DLLCALL GetDatabaseLoadUtility() = 0; virtual int* DLLCALL GetPlotDirectionX() = 0; virtual int* DLLCALL GetPlotDirectionY() = 0; virtual int* DLLCALL GetCityPlotX() = 0; virtual int* DLLCALL GetCityPlotY() = 0; virtual void DLLCALL SetGameDatabase(Database::Connection* pGameDatabase) = 0; virtual bool DLLCALL SetDLLIFace(ICvEngineUtility1* pDll) = 0; virtual bool DLLCALL IsGraphicsInitialized() const = 0; virtual void DLLCALL SetGraphicsInitialized(bool bVal) = 0; virtual void DLLCALL SetOutOfSyncDebuggingEnabled(bool isEnabled) = 0; virtual bool DLLCALL RandomNumberGeneratorSyncCheck(PlayerTypes ePlayer, ICvRandom1* pRandom, bool bIsHost) = 0; virtual unsigned int DLLCALL CreateRandomNumberGenerator() = 0; virtual ICvRandom1* DLLCALL GetRandomNumberGenerator(unsigned int index) = 0; virtual void DLLCALL DestroyRandomNumberGenerator(unsigned int index) = 0; virtual unsigned int DLLCALL CreateNetInitInfo() = 0; virtual ICvNetInitInfo1* DLLCALL GetNetInitInfo(unsigned int index) = 0; virtual void DLLCALL DestroyNetInitInfo(unsigned int index) = 0; virtual unsigned int DLLCALL CreateNetLoadGameInfo() = 0; virtual ICvNetLoadGameInfo1* DLLCALL GetNetLoadGameInfo(unsigned int index) = 0; virtual void DLLCALL DestroyNetLoadGameInfo(unsigned int index) = 0; virtual void DLLCALL TEMPOnHexUnitChanged(ICvUnit1* pUnit) = 0; virtual void DLLCALL TEMPOnHexUnitChangedAttack(ICvUnit1* pUnit) = 0; virtual ICvEnumerator* DLLCALL TEMPCalculatePathFinderUpdates(ICvUnit1* pHeadSelectedUnit, int iMouseMapX, int iMouseMapY) = 0; virtual void DLLCALL ResetPathFinder() = 0; }; //------------------------------------------------------------------------------ // Script System Utility Interfaces //------------------------------------------------------------------------------ class ICvScriptSystemUtility1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvScriptSystemUtility1; } //! Allows the DLL to register additional global functions and data to Lua. virtual void DLLCALL RegisterScriptLibraries(lua_State* L) = 0; virtual void DLLCALL PushCvCityInstance(lua_State* L, ICvCity1* pkCity) = 0; virtual ICvCity1* DLLCALL GetCvCityInstance(lua_State* L, int index, bool bErrorOnFail = true) = 0; virtual void DLLCALL PushCvDealInstance(lua_State* L, ICvDeal1* pkDeal) = 0; virtual ICvDeal1* DLLCALL GetCvDealInstance(lua_State* L, int index, bool bErrorOnFail = true) = 0; virtual void DLLCALL PushCvPlotInstance(lua_State* L, ICvPlot1* pkPlot) = 0; virtual ICvPlot1* DLLCALL GetCvPlotInstance(lua_State* L, int index, bool bErrorOnFail = true) = 0; virtual void DLLCALL PushCvUnitInstance(lua_State* L, ICvUnit1* pkUnit) = 0; virtual ICvUnit1* DLLCALL GetCvUnitInstance(lua_State* L, int index, bool bErrorOnFail = true) = 0; virtual void DLLCALL PushReplayFromStream(lua_State* L, FDataStream& stream) = 0; }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Building Info interfaces //------------------------------------------------------------------------------ class ICvBuildingInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvCombatInfo1; } virtual const char* DLLCALL GetType() const = 0; virtual const char* DLLCALL GetText() const = 0; virtual int DLLCALL GetPreferredDisplayPosition() const = 0; virtual bool DLLCALL IsBorderObstacle() const = 0; virtual bool DLLCALL IsPlayerBorderObstacle() const = 0; virtual const char* DLLCALL GetArtDefineTag() const = 0; virtual const bool DLLCALL GetArtInfoCulturalVariation() const = 0; virtual const bool DLLCALL GetArtInfoEraVariation() const = 0; virtual const bool DLLCALL GetArtInfoRandomVariation() const = 0; virtual const char* DLLCALL GetWonderSplashAudio() const = 0; }; //------------------------------------------------------------------------------ // City Interfaces //------------------------------------------------------------------------------ class ICvCity1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvCity1; } virtual int DLLCALL GetID() const = 0; virtual PlayerTypes DLLCALL GetOwner() const = 0; virtual int DLLCALL GetMaxHitPoints() const = 0; virtual void DLLCALL GetPosition(int& iX, int& iY) const = 0; virtual ICvPlot1* DLLCALL Plot() const = 0; virtual int DLLCALL GetPopulation() const = 0; virtual const char* DLLCALL GetName() const = 0; virtual bool DLLCALL CanBuyPlot(int iPlotX, int iPlotY, bool bIgnoreCost = false) = 0; virtual CitySizeTypes DLLCALL GetCitySizeType() const = 0; virtual const char* DLLCALL GetCityBombardEffectTag() const = 0; virtual TeamTypes DLLCALL GetTeam() const = 0; virtual bool DLLCALL IsPuppet() const = 0; virtual int DLLCALL GetX() const = 0; virtual int DLLCALL GetY() const = 0; virtual int DLLCALL GetStrengthValue(bool bForRangeStrike = false) const = 0; virtual int DLLCALL FoodDifference(bool bBottom = true) const = 0; virtual int DLLCALL GetFoodTurnsLeft() const = 0; virtual int DLLCALL GetYieldRate(int eIndex) const = 0; virtual int DLLCALL GetJONSCulturePerTurn() const = 0; virtual IDInfo DLLCALL GetIDInfo() const = 0; virtual bool DLLCALL IsWorkingPlot(ICvPlot1* pPlot) const = 0; virtual bool DLLCALL CanWork(ICvPlot1* pPlot) const = 0; virtual ICvPlot1* DLLCALL GetCityPlotFromIndex(int iIndex) const = 0; virtual FAutoArchive& DLLCALL GetSyncArchive() = 0; }; //------------------------------------------------------------------------------ // Combat Info interfaces //------------------------------------------------------------------------------ class ICvCombatInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvCombatInfo1; } virtual ICvUnit1* DLLCALL GetUnit(BattleUnitTypes unitType) const = 0; virtual ICvCity1* DLLCALL GetCity(BattleUnitTypes unitType) const = 0; virtual ICvPlot1* DLLCALL GetPlot() const = 0; virtual bool DLLCALL GetAttackerAdvances() const = 0; virtual bool DLLCALL GetVisualizeCombat() const = 0; virtual bool DLLCALL GetDefenderRetaliates() const = 0; virtual int DLLCALL GetNuclearDamageLevel() const = 0; virtual bool DLLCALL GetAttackIsRanged() const = 0; virtual bool DLLCALL GetAttackIsBombingMission() const = 0; virtual bool DLLCALL GetAttackIsAirSweep() const = 0; virtual bool DLLCALL GetDefenderCaptured() const = 0; virtual int DLLCALL GetDamageInflicted(BattleUnitTypes unitType) const = 0; virtual int DLLCALL GetFinalDamage(BattleUnitTypes unitType) const = 0; virtual const CvCombatMemberEntry* DLLCALL GetDamageMember(int iIndex) const = 0; virtual int DLLCALL GetDamageMemberCount() const = 0; virtual int DLLCALL GetMaxDamageMemberCount() const = 0; virtual void* DLLCALL TEMPGetRawCombatInfo() const = 0; }; //------------------------------------------------------------------------------ // Deal Interfaces //------------------------------------------------------------------------------ class ICvDeal1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvDeal1; } virtual PlayerTypes DLLCALL GetOtherPlayer(PlayerTypes eFromPlayer) = 0; virtual PlayerTypes DLLCALL GetToPlayer() = 0; virtual PlayerTypes DLLCALL GetFromPlayer() = 0; virtual unsigned int DLLCALL GetStartTurn() = 0; virtual unsigned int DLLCALL GetDuration() = 0; virtual unsigned int DLLCALL GetEndTurn() = 0; virtual void DLLCALL CopyFrom(ICvDeal1* pOtherDeal) = 0; virtual void DLLCALL Read(FDataStream& kStream) = 0; virtual void DLLCALL Write(FDataStream& kStream) = 0; }; //------------------------------------------------------------------------------ // Deal AI Interfaces //------------------------------------------------------------------------------ class ICvDealAI1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvDealAI1; } virtual ICvPlayer1* DLLCALL GetPlayer() = 0; virtual int DLLCALL DoHumanOfferDealToThisAI(ICvDeal1* pDeal) = 0; virtual void DLLCALL DoAcceptedDeal(PlayerTypes eFromPlayer, ICvDeal1* pDeal, int iDealValueToMe, int iValueImOffering, int iValueTheyreOffering) = 0; virtual int DLLCALL DoHumanDemand(ICvDeal1* pDeal) = 0; virtual void DLLCALL DoAcceptedDemand(PlayerTypes eFromPlayer, ICvDeal1* pDeal) = 0; virtual bool DLLCALL DoEqualizeDealWithHuman(ICvDeal1* pDeal, PlayerTypes eOtherPlayer, bool bDontChangeMyExistingItems, bool bDontChangeTheirExistingItems, bool &bDealGoodToBeginWith, bool &bCantMatchDeal) = 0; }; //------------------------------------------------------------------------------ // Diplomacy AI Interfaces //------------------------------------------------------------------------------ class ICvDiplomacyAI1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvDiplomacyAI1; } virtual void DLLCALL DoBeginDiploWithHuman() = 0; virtual const char* DLLCALL GetDiploStringForMessage(DiploMessageTypes eDiploMessage, PlayerTypes eForPlayer = NO_PLAYER, const char* szOptionalKey1 = "") = 0; virtual void DLLCALL TestUIDiploStatement(PlayerTypes eToPlayer, DiploStatementTypes eStatement, int iArg1) = 0; }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Game Interfaces //------------------------------------------------------------------------------ class ICvGame1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvGame1; } virtual ICvPlayer1* DLLCALL GetPlayer(const PlayerTypes ePlayer) = 0; virtual PlayerTypes DLLCALL GetActivePlayer() = 0; virtual TeamTypes DLLCALL GetActiveTeam() = 0; virtual int DLLCALL GetGameTurn() const = 0; virtual void DLLCALL ChangeNumGameTurnActive(int iChange, const char* why) = 0; virtual int DLLCALL CountHumanPlayersAlive() const = 0; virtual int DLLCALL CountNumHumanGameTurnActive() = 0; virtual bool DLLCALL CyclePlotUnits(ICvPlot1* pPlot, bool bForward = true, bool bAuto = false, int iCount = -1) = 0; virtual void DLLCALL CycleUnits(bool bClear, bool bForward = true, bool bWorkers = false) = 0; virtual void DLLCALL DoGameStarted() = 0; virtual void DLLCALL EndTurnTimerReset() = 0; virtual void DLLCALL EndTurnTimerSemaphoreDecrement() = 0; virtual void DLLCALL EndTurnTimerSemaphoreIncrement() = 0; virtual int DLLCALL GetAction(int iKeyStroke, bool bAlt, bool bShift, bool bCtrl) = 0; virtual int DLLCALL IsAction(int iKeyStroke, bool bAlt, bool bShift, bool bCtrl) = 0; virtual ImprovementTypes DLLCALL GetBarbarianCampImprovementType() = 0; virtual int DLLCALL GetElapsedGameTurns() const = 0; virtual bool DLLCALL GetFOW() = 0; virtual ICvGameDeals1* DLLCALL GetGameDeals() = 0; virtual GameSpeedTypes DLLCALL GetGameSpeedType() const = 0; virtual GameStateTypes DLLCALL GetGameState() = 0; virtual HandicapTypes DLLCALL GetHandicapType() const = 0; virtual ICvRandom1* DLLCALL GetRandomNumberGenerator() = 0; virtual int DLLCALL GetJonRandNum(int iNum, const char* pszLog) = 0; virtual int DLLCALL GetMaxTurns() const = 0; virtual int DLLCALL GetNumGameTurnActive() = 0; virtual PlayerTypes DLLCALL GetPausePlayer() = 0; virtual bool DLLCALL GetPbemTurnSent() const = 0; virtual ICvUnit1* DLLCALL GetPlotUnit(ICvPlot1* pPlot, int iIndex) = 0; virtual unsigned int DLLCALL GetVariableCitySizeFromPopulation(unsigned int nPopulation) = 0; virtual VictoryTypes DLLCALL GetVictory() const = 0; virtual int DLLCALL GetVotesNeededForDiploVictory() const = 0; virtual TeamTypes DLLCALL GetWinner() const = 0; virtual int DLLCALL GetWinningTurn() const = 0; virtual void DLLCALL HandleAction(int iAction) = 0; virtual bool DLLCALL HasTurnTimerExpired() = 0; virtual void DLLCALL Init(HandicapTypes eHandicap) = 0; virtual bool DLLCALL Init2() = 0; virtual void DLLCALL InitScoreCalculation() = 0; virtual void DLLCALL InitTacticalAnalysisMap(int iNumPlots) = 0; virtual bool DLLCALL IsCityScreenBlocked() = 0; virtual bool DLLCALL CanOpenCityScreen(PlayerTypes eOpener, ICvCity1* pCity) = 0; virtual bool DLLCALL IsDebugMode() const = 0; virtual bool DLLCALL IsFinalInitialized() const = 0; virtual bool DLLCALL IsGameMultiPlayer() const = 0; virtual bool DLLCALL IsHotSeat() const = 0; virtual bool IsMPOption(MultiplayerOptionTypes eIndex) const = 0; virtual bool DLLCALL IsNetworkMultiPlayer() const = 0; virtual bool IsOption(GameOptionTypes eIndex) const = 0; virtual bool DLLCALL IsPaused() = 0; virtual bool DLLCALL IsPbem() const = 0; virtual bool DLLCALL IsTeamGame() const = 0; virtual void DLLCALL LogGameState(bool bLogHeaders = false) = 0; virtual void DLLCALL ResetTurnTimer() = 0; virtual void DLLCALL SelectAll(ICvPlot1* pPlot) = 0; virtual void DLLCALL SelectGroup(ICvUnit1* pUnit, bool bShift, bool bCtrl, bool bAlt) = 0; virtual bool DLLCALL SelectionListIgnoreBuildingDefense() = 0; virtual void DLLCALL SelectionListMove(ICvPlot1* pPlot, bool bShift) = 0; virtual void DLLCALL SelectSettler(void) = 0; virtual void DLLCALL SelectUnit(ICvUnit1* pUnit, bool bClear, bool bToggle = false, bool bSound = false) = 0; virtual void DLLCALL SendPlayerOptions(bool bForce = false) = 0; virtual void DLLCALL SetDebugMode(bool bDebugMode) = 0; virtual void DLLCALL SetFinalInitialized(bool bNewValue) = 0; virtual void DLLCALL SetInitialTime(unsigned int uiNewValue) = 0; virtual void SetMPOption(MultiplayerOptionTypes eIndex, bool bEnabled) = 0; virtual void DLLCALL SetPausePlayer(PlayerTypes eNewValue) = 0; virtual void DLLCALL SetTimeStr(_Inout_z_cap_c_(256) char* szString, int iGameTurn, bool bSave) = 0; virtual bool DLLCALL TunerEverConnected() const = 0; virtual void DLLCALL Uninit() = 0; virtual void DLLCALL UnitIsMoving() = 0; virtual void DLLCALL Update() = 0; virtual void DLLCALL UpdateSelectionList() = 0; virtual void DLLCALL UpdateTestEndTurn() = 0; virtual void DLLCALL Read(FDataStream& kStream) = 0; virtual void DLLCALL Write(FDataStream& kStream) const = 0; virtual void DLLCALL ReadSupportingClassData(FDataStream& kStream) = 0; virtual void DLLCALL WriteSupportingClassData(FDataStream& kStream) const = 0; virtual void DLLCALL WriteReplay(FDataStream& kStream) const = 0; virtual bool DLLCALL CanMoveUnitTo(ICvUnit1* pUnit, ICvPlot1* pPlot) const = 0; }; /// Similar to the CvGame interface, but will not lock access. /// The methods are safe to call while the GameCore is processing. class ICvGameAsynch1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvGameAsynch1; } virtual PlayerTypes DLLCALL GetActivePlayer() = 0; virtual TeamTypes DLLCALL GetActiveTeam() = 0; virtual int DLLCALL GetGameTurn() const = 0; virtual GameSpeedTypes DLLCALL GetGameSpeedType() const = 0; virtual GameStateTypes DLLCALL GetGameState() = 0; virtual HandicapTypes DLLCALL GetHandicapType() const = 0; virtual int DLLCALL IsAction(int iKeyStroke, bool bAlt, bool bShift, bool bCtrl) = 0; virtual bool DLLCALL IsDebugMode() const = 0; virtual bool DLLCALL IsFinalInitialized() const = 0; virtual bool DLLCALL IsGameMultiPlayer() const = 0; virtual bool DLLCALL IsHotSeat() const = 0; virtual bool DLLCALL IsMPOption(MultiplayerOptionTypes eIndex) const = 0; virtual bool DLLCALL IsNetworkMultiPlayer() const = 0; virtual bool DLLCALL IsOption(GameOptionTypes eIndex) const = 0; virtual bool DLLCALL IsPaused() = 0; virtual bool DLLCALL IsPbem() const = 0; virtual bool DLLCALL IsTeamGame() const = 0; virtual bool DLLCALL TunerEverConnected() const = 0; }; //------------------------------------------------------------------------------ // Improvement Info interfaces //------------------------------------------------------------------------------ class ICvImprovementInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvImprovementInfo1; } virtual const char* DLLCALL GetType() const = 0; virtual const char* DLLCALL GetText() const = 0; virtual bool DLLCALL IsWater() const = 0; virtual bool DLLCALL IsDestroyedWhenPillaged() const = 0; virtual bool DLLCALL IsGoody() const = 0; virtual const char* DLLCALL GetArtDefineTag() const = 0; virtual ImprovementUsageTypes DLLCALL GetImprovementUsage() const = 0; virtual int DLLCALL GetWorldSoundscapeScriptId() const = 0; virtual bool DLLCALL GetTerrainMakesValid(int i) const = 0; virtual bool DLLCALL IsImprovementResourceMakesValid(int i) const = 0; }; //------------------------------------------------------------------------------ // Map Interfaces //------------------------------------------------------------------------------ class ICvMap1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvMap1; } virtual void DLLCALL Init(CvMapInitData* pInitData = NULL) = 0; virtual void DLLCALL Uninit() = 0; virtual void DLLCALL UpdateSymbolVisibility() = 0; virtual void DLLCALL UpdateLayout(bool bDebug) = 0; virtual void DLLCALL UpdateDeferredFog() = 0; virtual ICvCity1* DLLCALL FindCity( int iX, int iY, PlayerTypes eOwner = NO_PLAYER, TeamTypes eTeam = NO_TEAM, bool bSameArea = true, bool bCoastalOnly = false, TeamTypes eTeamAtWarWith = NO_TEAM, DirectionTypes eDirection = NO_DIRECTION, ICvCity1* pSkipCity = NULL) = 0; virtual int DLLCALL NumPlots() const = 0; virtual int DLLCALL PlotNum(int iX, int iY) const = 0; virtual int DLLCALL GetGridWidth() const = 0; virtual int DLLCALL GetGridHeight() const = 0; virtual bool DLLCALL IsWrapX() const = 0; virtual bool DLLCALL IsWrapY() const = 0; virtual ICvPlot1* DLLCALL GetPlotByIndex(int iIndex) const = 0; virtual ICvPlot1* DLLCALL GetPlot(int iX, int iY) const = 0; virtual void DLLCALL RecalculateLandmasses() = 0; virtual void DLLCALL Read(FDataStream& kStream) = 0; virtual void DLLCALL Write(FDataStream& kStream) const = 0; virtual int DLLCALL Validate() = 0; }; //------------------------------------------------------------------------------ // Mission Data Interfaces //------------------------------------------------------------------------------ class ICvMissionData1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvMissionData1; } virtual int DLLCALL GetData1() const = 0; virtual int DLLCALL GetData2() const = 0; virtual int DLLCALL GetFlags() const = 0; virtual int DLLCALL GetPushTurn() const = 0; virtual MissionTypes DLLCALL GetMissionType() const = 0; }; //------------------------------------------------------------------------------ // Network Message Handling interfaces //------------------------------------------------------------------------------ class ICvNetMessageHandler1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvNetMessageHandler1; } virtual void DLLCALL ResponseAdvancedStartAction(PlayerTypes ePlayer, AdvancedStartActionTypes eAction, int iX, int iY, int iData, bool bAdd) = 0; virtual void DLLCALL ResponseAutoMission(PlayerTypes ePlayer, int iUnitID) = 0; virtual void DLLCALL ResponseBarbarianRansom(PlayerTypes ePlayer, int iOptionChosen, int iUnitID) = 0; virtual void DLLCALL ResponseChangeWar(PlayerTypes ePlayer, TeamTypes eRivalTeam, bool bWar) = 0; virtual void DLLCALL ResponseCityBuyPlot(PlayerTypes ePlayer, int iCityID, int iX, int iY) = 0; virtual void DLLCALL ResponseCityDoTask(PlayerTypes ePlayer, int iCityID, TaskTypes eTask, int iData1, int iData2, bool bOption, bool bAlt, bool bShift, bool bCtrl) = 0; virtual void DLLCALL ResponseCityPopOrder(PlayerTypes ePlayer, int iCityID, int iNum) = 0; virtual void DLLCALL ResponseCityPurchase(PlayerTypes ePlayer, int iCityID, UnitTypes eUnitType, BuildingTypes eBuildingType, ProjectTypes eProjectType) = 0; virtual void DLLCALL ResponseCityPushOrder(PlayerTypes ePlayer, int iCityID, OrderTypes eOrder, int iData, bool bAlt, bool bShift, bool bCtrl) = 0; virtual void DLLCALL ResponseCitySwapOrder(PlayerTypes ePlayer, int iCityID, int iNum) = 0; virtual void DLLCALL ResponseChooseElection(PlayerTypes ePlayer, int iSelection, int iVoteId) = 0; virtual void DLLCALL ResponseDestroyUnit(PlayerTypes ePlayer, int iUnitID) = 0; virtual void DLLCALL ResponseDiplomacyFromUI(PlayerTypes ePlayer, PlayerTypes eOtherPlayer, FromUIDiploEventTypes eEvent, int iArg1, int iArg2) = 0; virtual void DLLCALL ResponseDiploVote(PlayerTypes ePlayer, PlayerTypes eVotePlayer) = 0; virtual void DLLCALL ResponseDoCommand(PlayerTypes ePlayer, int iUnitID, CommandTypes eCommand, int iData1, int iData2, bool bAlt) = 0; virtual void DLLCALL ResponseExtendedGame(PlayerTypes ePlayer) = 0; virtual void DLLCALL ResponseGiftUnit(PlayerTypes ePlayer, PlayerTypes eMinor, int iUnitID) = 0; virtual void DLLCALL ResponseGreatPersonChoice(PlayerTypes ePlayer, UnitTypes eGreatPersonUnit) = 0; virtual void DLLCALL ResponseLaunchSpaceship(PlayerTypes ePlayer, VictoryTypes eVictory) = 0; virtual void DLLCALL ResponseLiberatePlayer(PlayerTypes ePlayer, PlayerTypes eLiberatedPlayer, int iCityID) = 0; virtual void DLLCALL ResponseMinorCivGiftGold(PlayerTypes ePlayer, PlayerTypes eMinor, int iGold) = 0; virtual void DLLCALL ResponseMinorNoUnitSpawning(PlayerTypes ePlayer, PlayerTypes eMinor, bool bValue) = 0; virtual void DLLCALL ResponsePlayerDealFinalized(PlayerTypes eFromPlayer, PlayerTypes eToPlayer, PlayerTypes eActBy, bool bAccepted) = 0; virtual void DLLCALL ResponsePlayerOption(PlayerTypes ePlayer, PlayerOptionTypes eOption, bool bValue) = 0; virtual void DLLCALL ResponsePushMission(PlayerTypes ePlayer, int iUnitID, MissionTypes eMission, int iData1, int iData2, int iFlags, bool bShift) = 0; virtual void DLLCALL ResponseRenameCity(PlayerTypes ePlayer, int iCityID, _In_z_ const char* szName) = 0; virtual void DLLCALL ResponseRenameUnit(PlayerTypes ePlayer, int iUnitID, _In_z_ const char* szName) = 0; virtual void DLLCALL ResponseResearch(PlayerTypes ePlayer, TechTypes eTech, int iDiscover, bool bShift) = 0; virtual void DLLCALL ResponseReturnCivilian(PlayerTypes ePlayer, PlayerTypes eToPlayer, int iUnitID, bool bReturn) = 0; virtual void DLLCALL ResponseSellBuilding(PlayerTypes ePlayer, int iCityID, BuildingTypes eBuilding) = 0; virtual void DLLCALL ResponseSetCityAIFocus(PlayerTypes ePlayer, int iCityID, CityAIFocusTypes eFocus) = 0; virtual void DLLCALL ResponseSetCityAvoidGrowth(PlayerTypes ePlayer, int iCityID, bool bAvoidGrowth) = 0; virtual void DLLCALL ResponseSwapUnits(PlayerTypes ePlayer, int iUnitID, MissionTypes eMission, int iData1, int iData2, int iFlags, bool bShift) = 0; virtual void DLLCALL ResponseUpdateCityCitizens(PlayerTypes ePlayer, int iCityID) = 0; virtual void DLLCALL ResponseUpdatePolicies(PlayerTypes ePlayer, bool bNOTPolicyBranch, int iPolicyID, bool bValue) = 0; }; class ICvNetMessageHandler2 : public ICvNetMessageHandler1 { public: static GUID DLLCALL GetInterfaceId() { return guidICvNetMessageHandler2; } virtual void DLLCALL ResponseCityPurchase(PlayerTypes ePlayer, int iCityID, UnitTypes eUnitType, BuildingTypes eBuildingType, ProjectTypes eProjectType, int ePurchaseYield) = 0; virtual void DLLCALL ResponseFoundPantheon(PlayerTypes ePlayer, BeliefTypes eBelief) = 0; virtual void DLLCALL ResponseFoundReligion(PlayerTypes ePlayer, ReligionTypes eReligion, const char* szCustomName, BeliefTypes eBelief1, BeliefTypes eBelief2, BeliefTypes eBelief3, BeliefTypes eBelief4, int iCityX, int iCityY) = 0; virtual void DLLCALL ResponseEnhanceReligion(PlayerTypes ePlayer, ReligionTypes eReligion, const char* szCustomName, BeliefTypes eBelief1, BeliefTypes eBelief2, int iCityX, int iCityY) = 0; virtual void DLLCALL ResponseMayaBonusChoice(PlayerTypes ePlayer, UnitTypes eGreatPersonUnit) = 0; virtual void DLLCALL ResponseFaithGreatPersonChoice(PlayerTypes ePlayer, UnitTypes eGreatPersonUnit) = 0; virtual void DLLCALL ResponseMoveSpy(PlayerTypes ePlayer, int iSpyIndex, int iTargetPlayer, int iTargetCity, bool bAsDiplomat) = 0; virtual void DLLCALL ResponseStageCoup(PlayerTypes eSpyPlayer, int iSpyIndex) = 0; virtual void DLLCALL ResponseFaithPurchase(PlayerTypes ePlayer, FaithPurchaseTypes eFaithPurchaseType, int iFaithPurchaseIndex) = 0; virtual void DLLCALL ResponseMinorCivBullyGold(PlayerTypes ePlayer, PlayerTypes eMinor, int iGold) = 0; virtual void DLLCALL ResponseMinorCivBullyUnit(PlayerTypes ePlayer, PlayerTypes eMinor, UnitTypes eUnitType) = 0; virtual void DLLCALL ResponseMinorCivGiftTileImprovement(PlayerTypes eMajor, PlayerTypes eMinor, int iPlotX, int iPlotY) = 0; virtual void DLLCALL ResponseMinorCivBuyout(PlayerTypes eMajor, PlayerTypes eMinor) = 0; virtual void DLLCALL ResponsePledgeMinorProtection(PlayerTypes ePlayer, PlayerTypes eMinor, bool bValue, bool bPledgeNowBroken) = 0; virtual void DLLCALL ResponseResearch(PlayerTypes ePlayer, TechTypes eTech, int iDiscover, PlayerTypes ePlayerToStealFrom, bool bShift) = 0; }; //------------------------------------------------------------------------------ // Network sync interfaces //------------------------------------------------------------------------------ class ICvNetworkSyncronization1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvNetworkSyncronization1; } virtual void DLLCALL ClearCityDeltas() = 0; virtual void DLLCALL ClearPlayerDeltas() = 0; virtual void DLLCALL ClearPlotDeltas() = 0; virtual void DLLCALL ClearRandomDeltas() = 0; virtual void DLLCALL ClearUnitDeltas() = 0; virtual void DLLCALL SyncCities() = 0; virtual void DLLCALL SyncPlayers() = 0; virtual void DLLCALL SyncPlots() = 0; virtual void DLLCALL SyncUnits() = 0; }; class ICvPathFinderUpdate1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvPathFinderUpdate1; } virtual int DLLCALL GetX() const = 0; virtual int DLLCALL GetY() const = 0; virtual int DLLCALL GetTurnNumber() const = 0; }; //------------------------------------------------------------------------------ // Player Interfaces //------------------------------------------------------------------------------ class ICvPlayer1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvPlayer1; } virtual void DLLCALL Init(PlayerTypes eID) = 0; virtual void DLLCALL SetupGraphical() = 0; virtual void DLLCALL LaterInit () = 0; // what a lousy name. This is called after the map and other aspects have been created. virtual void DLLCALL Uninit() = 0; virtual bool DLLCALL IsHuman() const = 0; virtual bool DLLCALL IsBarbarian() const = 0; virtual const char* DLLCALL GetName() const = 0; virtual const char* const DLLCALL GetNickName() const = 0; virtual ArtStyleTypes DLLCALL GetArtStyleType() const = 0; virtual ICvUnit1* DLLCALL GetFirstReadyUnit() = 0; virtual bool DLLCALL HasBusyUnit() const = 0; virtual bool DLLCALL HasBusyUnitOrCity() const = 0; virtual int DLLCALL GetScore(bool bFinal = false, bool bVictory = false) const = 0; virtual ICvPlot1* DLLCALL GetStartingPlot() const = 0; virtual ICvCity1* DLLCALL GetCapitalCity() = 0; virtual bool DLLCALL IsHasLostCapital() const = 0; virtual void DLLCALL SetStartTime(uint uiStartTime) = 0; virtual bool DLLCALL IsMinorCiv() const = 0; virtual bool DLLCALL IsAlive() const = 0; virtual bool DLLCALL IsEverAlive() const = 0; virtual bool DLLCALL IsTurnActive() const = 0; virtual void DLLCALL SetTurnActive(bool bNewValue, bool bDoTurn = true) = 0; virtual PlayerTypes DLLCALL GetID() const = 0; virtual HandicapTypes DLLCALL GetHandicapType() const = 0; virtual CivilizationTypes DLLCALL GetCivilizationType() const = 0; virtual LeaderHeadTypes DLLCALL GetLeaderType() const = 0; virtual const char* DLLCALL GetLeaderTypeKey() const = 0; virtual EraTypes DLLCALL GetCurrentEra() const = 0; virtual TeamTypes DLLCALL GetTeam() const = 0; virtual PlayerColorTypes DLLCALL GetPlayerColor() const = 0; virtual bool DLLCALL IsOption(PlayerOptionTypes eIndex) const = 0; virtual ICvCity1* DLLCALL FirstCity(int* pIterIdx, bool bRev = false) = 0; virtual ICvCity1* DLLCALL NextCity(int* pIterIdx, bool bRev = false) = 0; virtual int DLLCALL GetNumCities() const = 0; virtual ICvCity1* DLLCALL GetCity(int iID) = 0; virtual ICvUnit1* DLLCALL FirstUnit(int* pIterIdx, bool bRev = false) = 0; virtual ICvUnit1* DLLCALL NextUnit(int* pIterIdx, bool bRev = false) = 0; virtual ICvUnit1* DLLCALL GetUnit(int iID) = 0; virtual int DLLCALL GetPlotDanger(ICvPlot1* pPlot) const = 0; virtual int DLLCALL GetCityDistanceHighwaterMark() const = 0; virtual void DLLCALL Disconnected() = 0; virtual void DLLCALL Reconnected() = 0; virtual void DLLCALL SetBusyUnitUpdatesRemaining(int iUpdateCount) = 0; virtual bool DLLCALL HasUnitsThatNeedAIUpdate() const = 0; virtual int DLLCALL GetNumPolicyBranchesFinished() const = 0; virtual void DLLCALL Read(FDataStream& kStream) = 0; virtual void DLLCALL Write(FDataStream& kStream) const = 0; virtual int DLLCALL GetGold() const = 0; virtual int DLLCALL CalculateBaseNetGold() = 0; virtual const char* DLLCALL GetEmbarkedGraphicOverride() = 0; virtual FAutoArchive& DLLCALL GetSyncArchive() = 0; virtual MinorCivTypes DLLCALL GetMinorCivType() const = 0; virtual ICvDiplomacyAI1* DLLCALL GetDiplomacyAI() = 0; virtual ICvDealAI1* DLLCALL GetDealAI() = 0; //Diplomacy virtual bool DLLCALL AddDiplomacyRequest(PlayerTypes ePlayerID, DiploUIStateTypes eDiploType, const char* pszMessage, LeaderheadAnimationTypes eAnimationType, int iExtraGameData = -1) = 0; virtual void DLLCALL ActiveDiplomacyRequestComplete() = 0; //Notifications virtual int DLLCALL AddNotification(NotificationTypes eNotificationType, const char* strMessage, const char* strSummary, int iX, int iY, int iGameDataIndex, int iExtraGameData = -1) = 0; virtual void DLLCALL ActivateNotification(int iLookupIndex) = 0; virtual void DLLCALL DismissNotification(int iLookupIndex, bool bUserInvoked) = 0; virtual bool DLLCALL MayUserDismissNotification(int iLookupIndex) = 0; virtual void DLLCALL RebroadcastNotifications(void) = 0; //! Get the current tech the player is researching and how many turns are left virtual bool DLLCALL GetCurrentResearchTech(TechTypes* pkTech, int *pkTurnsLeft) const = 0; }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Plot Interfaces //------------------------------------------------------------------------------ class ICvPlot1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvPlot1; } virtual TeamTypes DLLCALL GetTeam() const = 0; virtual FogOfWarModeTypes DLLCALL GetActiveFogOfWarMode() const = 0; virtual void DLLCALL UpdateCenterUnit() = 0; virtual bool DLLCALL IsAdjacent(ICvPlot1* pPlot) const = 0; virtual bool DLLCALL IsRiver() const = 0; virtual ICvPlot1* DLLCALL GetNeighboringPlot(DirectionTypes eDirection) const = 0; virtual int DLLCALL GetBuildTime(BuildTypes eBuild, PlayerTypes ePlayer) const = 0; virtual bool DLLCALL IsVisible(TeamTypes eTeam, bool bDebug) const = 0; virtual bool DLLCALL IsCity() const = 0; virtual bool DLLCALL IsEnemyCity(ICvUnit1* pUnit) const = 0; virtual bool DLLCALL IsFighting() const = 0; virtual bool DLLCALL IsTradeRoute (PlayerTypes ePlayer = NO_PLAYER) const = 0; virtual bool DLLCALL IsImpassable() const = 0; virtual void DLLCALL GetPosition(int& iX, int& iY) const = 0; virtual bool DLLCALL IsNEOfRiver() const = 0; virtual bool DLLCALL IsWOfRiver() const = 0; virtual bool DLLCALL IsNWOfRiver() const = 0; virtual FlowDirectionTypes DLLCALL GetRiverEFlowDirection() const = 0; virtual FlowDirectionTypes DLLCALL GetRiverSEFlowDirection() const = 0; virtual FlowDirectionTypes DLLCALL GetRiverSWFlowDirection() const = 0; virtual PlayerTypes DLLCALL GetOwner() const = 0; virtual PlotTypes DLLCALL GetPlotType() const = 0; virtual bool DLLCALL IsWater() const = 0; virtual bool DLLCALL IsHills() const = 0; virtual bool DLLCALL IsOpenGround() const = 0; virtual bool DLLCALL IsMountain() const = 0; virtual TerrainTypes DLLCALL GetTerrainType() const = 0; virtual FeatureTypes DLLCALL GetFeatureType() const = 0; virtual ResourceTypes DLLCALL GetResourceType(TeamTypes eTeam = NO_TEAM) const = 0; virtual int DLLCALL GetNumResource() const = 0; virtual ImprovementTypes DLLCALL GetImprovementType() const = 0; virtual bool DLLCALL IsImprovementPillaged() const = 0; virtual GenericWorldAnchorTypes DLLCALL GetWorldAnchor() const = 0; virtual int DLLCALL GetWorldAnchorData() const = 0; virtual RouteTypes DLLCALL GetRouteType() const = 0; virtual bool DLLCALL IsRoutePillaged() const = 0; virtual ICvCity1* DLLCALL GetPlotCity() const = 0; virtual ICvCity1* DLLCALL GetWorkingCity() const = 0; virtual bool DLLCALL IsRevealed(TeamTypes eTeam, bool bDebug) const = 0; virtual ImprovementTypes DLLCALL GetRevealedImprovementType(TeamTypes eTeam, bool bDebug) const = 0; virtual int DLLCALL GetBuildProgress(BuildTypes eBuild) const = 0; virtual bool DLLCALL GetAnyBuildProgress() const = 0; virtual void DLLCALL UpdateLayout(bool bDebug) = 0; virtual ICvUnit1* DLLCALL GetCenterUnit() = 0; virtual int DLLCALL GetNumUnits() const = 0; virtual ICvUnit1* DLLCALL GetUnitByIndex(int iIndex) const = 0; virtual void DLLCALL AddUnit(ICvUnit1* pUnit, bool bUpdate = true) = 0; virtual void DLLCALL RemoveUnit(ICvUnit1* pUnit, bool bUpdate = true) = 0; virtual const IDInfo* DLLCALL NextUnitNode(const IDInfo* pNode) const = 0; virtual IDInfo* DLLCALL NextUnitNode(IDInfo* pNode) = 0; virtual IDInfo* DLLCALL HeadUnitNode() = 0; virtual int DLLCALL GetPlotIndex() const = 0; virtual char DLLCALL GetContinentType() const = 0; virtual FAutoArchive& DLLCALL GetSyncArchive() = 0; }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Pregame interfaces //------------------------------------------------------------------------------ class ICvPreGame1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvPreGame1; } //TODO: This needs some MAJOR refactoring before it's production ready. // * Replace pascal casing w/ camel case // * Drop the STL containers for something DLL safe. // * Drop any of these that we aren't actually using. virtual PlayerTypes DLLCALL activePlayer() = 0; virtual int DLLCALL advancedStartPoints() = 0; virtual bool DLLCALL autorun() = 0; virtual float DLLCALL autorunTurnDelay() = 0; virtual int DLLCALL autorunTurnLimit() = 0; virtual CalendarTypes DLLCALL calendar() = 0; virtual bool DLLCALL canReadyLocalPlayer() = 0; virtual CvString DLLCALL civilizationAdjective(PlayerTypes p) = 0; virtual const CvString DLLCALL civilizationAdjectiveKey(PlayerTypes p) = 0; virtual CvString DLLCALL civilizationDescription(PlayerTypes p) = 0; virtual const CvString DLLCALL civilizationDescriptionKey(PlayerTypes p) = 0; virtual CivilizationTypes DLLCALL civilization(PlayerTypes p) = 0; virtual const CvString DLLCALL civilizationPassword(PlayerTypes p) = 0; virtual CvString DLLCALL civilizationShortDescription(PlayerTypes p) = 0; virtual const CvString DLLCALL civilizationShortDescriptionKey(PlayerTypes p) = 0; virtual const CvString DLLCALL civilizationKey(PlayerTypes p) = 0; virtual bool DLLCALL civilizationKeyAvailable(PlayerTypes p) = 0; virtual const GUID DLLCALL civilizationKeyPackageID(PlayerTypes p) = 0; virtual void DLLCALL clearDLCAllowed() = 0; virtual ClimateTypes DLLCALL climate() = 0; virtual void DLLCALL closeAllSlots() = 0; virtual void DLLCALL closeInactiveSlots() = 0; virtual const CvString DLLCALL emailAddress(PlayerTypes p) = 0; virtual const CvString DLLCALL emailAddress() = 0; virtual float DLLCALL endTurnTimerLength() = 0; virtual EraTypes DLLCALL era() = 0; virtual PlayerTypes DLLCALL findPlayerByNickname(const char * const name) = 0; virtual GameMode DLLCALL gameMode() = 0; virtual const CvString DLLCALL gameName() = 0; virtual bool DLLCALL gameStarted() = 0; virtual uint DLLCALL GetGameOptionCount() = 0; virtual bool DLLCALL GetGameOption(uint uiIndex, char* szOptionNameBuffer, uint nOptionNameBufferSize, int& iValue) = 0; virtual bool DLLCALL GetGameOption(const char* szOptionName, int& iValue) = 0; virtual bool DLLCALL GetGameOption(GameOptionTypes eOption, int& iValue) = 0; virtual uint DLLCALL GetMapOptionCount() = 0; virtual bool DLLCALL GetMapOption(uint uiIndex, char* szOptionNameBuffer, uint nOptionNameBuffersize, int& iValue) = 0; virtual bool DLLCALL GetMapOption(const char* szOptionName, int& iValue) = 0; virtual bool DLLCALL GetPersistSettings() = 0; virtual GameSpeedTypes DLLCALL gameSpeed() = 0; virtual int DLLCALL gameTurn() = 0; virtual GameTypes DLLCALL gameType() = 0; virtual GameStartTypes DLLCALL gameStartType() = 0; virtual HandicapTypes DLLCALL handicap(PlayerTypes p) = 0; virtual bool DLLCALL isDLCAllowed(const GUID& kDLCID) = 0; virtual bool DLLCALL isDLCAvailable(PlayerTypes p, const GUID& kDLCID) = 0; virtual bool DLLCALL isEarthMap() = 0; virtual bool DLLCALL isHotSeat() = 0; virtual bool DLLCALL isHotSeatGame() = 0; virtual bool DLLCALL isHuman(PlayerTypes p) = 0; virtual bool DLLCALL isInternetGame() = 0; virtual bool DLLCALL isMinorCiv(PlayerTypes p) = 0; virtual bool DLLCALL isNetworkMultiplayerGame() = 0; virtual bool DLLCALL isPitBoss() = 0; virtual bool DLLCALL isPlayable(PlayerTypes p) = 0; virtual bool DLLCALL isPlayByEmail() = 0; virtual bool DLLCALL isReady(PlayerTypes p) = 0; virtual bool DLLCALL isVictory(VictoryTypes v) = 0; virtual bool DLLCALL isWBMapScript() = 0; virtual bool DLLCALL isWhiteFlag(PlayerTypes p) = 0; virtual LeaderHeadTypes DLLCALL leaderHead(PlayerTypes p) = 0; virtual CvString DLLCALL leaderName(PlayerTypes p) = 0; virtual const CvString DLLCALL leaderNameKey(PlayerTypes p) = 0; virtual const CvString DLLCALL leaderKey(PlayerTypes p) = 0; virtual bool DLLCALL leaderKeyAvailable(PlayerTypes p) = 0; virtual const GUID DLLCALL leaderKeyPackageID(PlayerTypes p) = 0; virtual const CvString DLLCALL loadFileName() = 0; virtual void DLLCALL loadFromIni(FIGameIniParser& iniParser) = 0; virtual bool DLLCALL mapNoPlayers() = 0; virtual unsigned int DLLCALL mapRandomSeed() = 0; virtual bool DLLCALL loadWBScenario() = 0; virtual bool DLLCALL overrideScenarioHandicap() = 0; virtual const CvString DLLCALL mapScriptName() = 0; virtual int DLLCALL maxCityElimination() = 0; virtual int DLLCALL maxTurns() = 0; virtual MinorCivTypes DLLCALL minorCivType(PlayerTypes p) = 0; virtual bool DLLCALL multiplayerAIEnabled() = 0; virtual int DLLCALL netID(PlayerTypes p) = 0; virtual const CvString DLLCALL nickname(PlayerTypes p) = 0; virtual const CvString DLLCALL nicknameDisplayed(PlayerTypes p) = 0; virtual int DLLCALL numMinorCivs() = 0; virtual PlayerColorTypes DLLCALL playerColor(PlayerTypes p) = 0; virtual bool DLLCALL privateGame() = 0; virtual bool DLLCALL quickCombat() = 0; virtual bool DLLCALL quickMovement() = 0; virtual bool DLLCALL quickstart() = 0; virtual bool DLLCALL randomWorldSize() = 0; virtual bool DLLCALL randomMapScript() = 0; virtual void DLLCALL read(FDataStream& loadFrom, bool bReadVersion) = 0; virtual bool DLLCALL readPlayerSlotInfo(FDataStream& loadFrom, bool bReadVersion) = 0; virtual void DLLCALL resetGame() = 0; virtual void DLLCALL ResetGameOptions() = 0; virtual void DLLCALL ResetMapOptions() = 0; virtual void DLLCALL resetPlayer(PlayerTypes p) = 0; virtual void DLLCALL resetPlayers() = 0; virtual void DLLCALL resetSlots() = 0; virtual void DLLCALL restoreSlots() = 0; virtual void DLLCALL saveSlots() = 0; virtual SeaLevelTypes DLLCALL seaLevel() = 0; virtual void DLLCALL setActivePlayer(PlayerTypes p) = 0; virtual void DLLCALL setAdminPassword(const CvString & p) = 0; virtual void DLLCALL setAdvancedStartPoints(int a) = 0; virtual void DLLCALL setAlias(const CvString & a) = 0; virtual void DLLCALL setAutorun(bool isAutoStart) = 0; virtual void DLLCALL setAutorunTurnDelay(float turnDelay) = 0; virtual void DLLCALL setAutorunTurnLimit(int turnLimit) = 0; virtual void DLLCALL setBandwidth(BandwidthType b) = 0; virtual void DLLCALL setBandwidth(const CvString & b) = 0; virtual void DLLCALL setCalendar(CalendarTypes c) = 0; virtual void DLLCALL setCalendar(const CvString & c) = 0; virtual void DLLCALL setCivilization(PlayerTypes p, CivilizationTypes c) = 0; virtual void DLLCALL setCivilizationAdjective(PlayerTypes p, const CvString & a) = 0; virtual void DLLCALL setCivilizationDescription(PlayerTypes p, const CvString & d) = 0; virtual void DLLCALL setCivilizationPassword(PlayerTypes p, const CvString & pwd) = 0; virtual void DLLCALL setCivilizationShortDescription(PlayerTypes p, const CvString & d) = 0; virtual void DLLCALL setCivilizationKey(PlayerTypes p, const CvString & d) = 0; virtual void DLLCALL setCivilizationKeyPackageID(PlayerTypes p, const GUID & kKey) = 0; virtual void DLLCALL setClimate(ClimateTypes c) = 0; virtual void DLLCALL setClimate(const CvString & c) = 0; virtual void DLLCALL setCustomWorldSize(int iWidth, int iHeight, int iPlayers = 0, int iMinorCivs = 0) = 0; virtual void DLLCALL setDLCAllowed(const GUID& kDLCID, bool bState) = 0; virtual void DLLCALL setEarthMap(bool bIsEarthMap) = 0; virtual void DLLCALL setEmailAddress(PlayerTypes p, const CvString & a) = 0; virtual void DLLCALL setEmailAddress(const CvString & a) = 0; virtual void DLLCALL setEndTurnTimerLength(float f) = 0; virtual void DLLCALL setEra(EraTypes e) = 0; virtual void DLLCALL setEra(const CvString & e) = 0; virtual void DLLCALL setGameMode(GameMode g) = 0; virtual void DLLCALL setGameName(const CvString & g) = 0; virtual void DLLCALL setGameSpeed(GameSpeedTypes g) = 0; virtual void DLLCALL setGameSpeed(const CvString & g) = 0; virtual void DLLCALL setGameStarted(bool) = 0; virtual void DLLCALL setGameTurn(int turn) = 0; virtual bool DLLCALL SetGameOption(const char* szOptionName, int iValue) = 0; virtual bool DLLCALL SetGameOption(GameOptionTypes eOption, int iValue) = 0; virtual void DLLCALL setGameType(GameTypes g) = 0; virtual void DLLCALL setGameType(GameTypes g, GameStartTypes eStartType) = 0; virtual void DLLCALL setGameType(const CvString & g) = 0; virtual void DLLCALL setGameStartType(GameStartTypes g) = 0; virtual void DLLCALL setGameUpdateTime(int updateTime) = 0; virtual void DLLCALL setHandicap(PlayerTypes p, HandicapTypes h) = 0; virtual void DLLCALL setInternetGame(bool isInternetGame) = 0; virtual void DLLCALL setLeaderHead(PlayerTypes p, LeaderHeadTypes l) = 0; virtual void DLLCALL setLeaderName(PlayerTypes p, const CvString& n) = 0; virtual void DLLCALL setLeaderKey(PlayerTypes p, const CvString& n) = 0; virtual void DLLCALL setLeaderKeyPackageID(PlayerTypes p, const GUID & n) = 0; virtual void DLLCALL setLoadFileName(const CvString & fileName) = 0; virtual void DLLCALL setMapNoPlayers(bool p) = 0; virtual void DLLCALL setMapRandomSeed(unsigned int newSeed) = 0; virtual void DLLCALL setLoadWBScenario(bool b) = 0; virtual void DLLCALL setOverrideScenarioHandicap(bool b) = 0; virtual void DLLCALL setMapScriptName(const CvString & s) = 0; virtual bool DLLCALL SetMapOption(const char* szOptionName, int iValue) = 0; virtual void DLLCALL setMaxCityElimination(int m) = 0; virtual void DLLCALL setMaxTurns(int maxTurns) = 0; virtual void DLLCALL setMinorCivType(PlayerTypes p, MinorCivTypes m) = 0; virtual void DLLCALL setMinorCiv(PlayerTypes p, bool isMinor) = 0; virtual void DLLCALL setMultiplayerAIEnabled(bool isEnabled) = 0; virtual void DLLCALL setNetID(PlayerTypes p, int id) = 0; virtual void DLLCALL setNickname(PlayerTypes p, const CvString& n) = 0; virtual void DLLCALL setNumMinorCivs(int n) = 0; virtual void DLLCALL setPersistSettings(bool bPersist) = 0; virtual void DLLCALL setPlayable(PlayerTypes p, bool playable) = 0; virtual void DLLCALL setPlayerColor(PlayerTypes p, PlayerColorTypes c) = 0; virtual void DLLCALL setPrivateGame(bool isPrivateGame) = 0; virtual void DLLCALL setQuickCombat(bool isQuickCombat) = 0; virtual void DLLCALL setQuickMovement(bool isQuickCombat) = 0; virtual void DLLCALL setQuickHandicap(HandicapTypes h) = 0; virtual void DLLCALL setQuickHandicap(const CvString & h) = 0; virtual void DLLCALL setQuickstart(bool isQuickStart) = 0; virtual void DLLCALL setRandomWorldSize(bool isRandomWorldSize) = 0; virtual void DLLCALL setRandomMapScript(bool isRandomWorldScript) = 0; virtual void DLLCALL setReady(PlayerTypes p, bool bIsReady) = 0; virtual void DLLCALL setSeaLevel(SeaLevelTypes s) = 0; virtual void DLLCALL setSeaLevel(const CvString & s) = 0; virtual void DLLCALL setSlotClaim(PlayerTypes p, SlotClaim c) = 0; virtual void DLLCALL setSlotStatus(PlayerTypes eID, SlotStatus eSlotStatus) = 0; virtual void DLLCALL setSyncRandomSeed(unsigned int newSeed) = 0; virtual void DLLCALL setTeamType(PlayerTypes p, TeamTypes t) = 0; virtual void DLLCALL setTransferredMap(bool transferred) = 0; virtual void DLLCALL setTurnTimer(TurnTimerTypes t) = 0; virtual void DLLCALL setTurnTimer(const CvString & t) = 0; virtual void DLLCALL SetCityScreenBlocked(bool bCityScreenBlocked) = 0; virtual void DLLCALL setVersionString(const std::string & v) = 0; virtual void DLLCALL setVictory(VictoryTypes v, bool isValid) = 0; virtual void DLLCALL setVictories(const std::vector<bool> & v) = 0; virtual void DLLCALL setWhiteFlag(PlayerTypes p, bool flag) = 0; virtual void DLLCALL setWorldSize(WorldSizeTypes w, bool bResetSlots=true) = 0; virtual void DLLCALL setWorldSize(const CvString& w) = 0; virtual SlotClaim DLLCALL slotClaim(PlayerTypes p) = 0; virtual SlotStatus DLLCALL slotStatus(PlayerTypes eID) = 0; virtual unsigned int DLLCALL syncRandomSeed() = 0; virtual bool DLLCALL transferredMap() = 0; virtual TeamTypes DLLCALL teamType(PlayerTypes p) = 0; virtual TurnTimerTypes DLLCALL turnTimer() = 0; virtual const std::string DLLCALL versionString() = 0; virtual WorldSizeTypes DLLCALL worldSize() = 0; virtual ICvWorldInfo1* DLLCALL GetWorldInfo() = 0; virtual void DLLCALL write(FDataStream& saveTo) = 0; virtual int DLLCALL getActiveSlotCount() = 0; virtual int DLLCALL readActiveSlotCountFromSaveGame(FDataStream& loadFrom, bool bReadVersion) = 0; virtual StorageLocation DLLCALL LoadFileStorage() = 0; virtual void DLLCALL SetLoadFileName(const char* szFileName, StorageLocation eStorage) = 0; virtual ICvEnumerator* DLLCALL GetDLCAllowed() = 0; virtual ICvEnumerator* DLLCALL GetDLCAvailable(PlayerTypes p) = 0; virtual void DLLCALL SetDLCAvailable(PlayerTypes p, ICvEnumerator* pList) = 0; }; //------------------------------------------------------------------------------ // Random interfaces //------------------------------------------------------------------------------ class ICvRandom1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvRandom1; } virtual void DLLCALL Init(unsigned long ulSeed) = 0; virtual void DLLCALL Reset(unsigned long ulSeed = 0) = 0; virtual void DLLCALL CopyFrom(ICvRandom1* pOther) = 0; virtual unsigned short DLLCALL Get(unsigned short usNum, const char* pszLog = NULL) = 0; // Returns value from 0 to num-1 inclusive. virtual float DLLCALL GetFloat() = 0; virtual unsigned long DLLCALL GetSeed() const = 0; virtual void DLLCALL Read(FDataStream& Stream) = 0; virtual void DLLCALL Write(FDataStream& Stream) const = 0; }; //------------------------------------------------------------------------------ // Team interfaces //------------------------------------------------------------------------------ class ICvTeam1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvTeam1; } virtual bool DLLCALL CanEmbarkAllWaterPassage() const = 0; virtual int DLLCALL GetAtWarCount(bool bIgnoreMinors) const = 0; virtual EraTypes DLLCALL GetCurrentEra() const = 0; virtual PlayerTypes DLLCALL GetLeaderID() const = 0; virtual int DLLCALL GetProjectCount(ProjectTypes eIndex) const = 0; virtual int DLLCALL GetTotalSecuredVotes() const = 0; virtual void DLLCALL Init(TeamTypes eID) = 0; virtual bool DLLCALL IsAlive() const = 0; virtual bool DLLCALL IsAtWar(TeamTypes eIndex) const = 0; virtual bool DLLCALL IsBarbarian() const = 0; virtual bool DLLCALL IsBridgeBuilding() const = 0; virtual bool DLLCALL IsHasMet(TeamTypes eIndex) const = 0; virtual bool DLLCALL IsHomeOfUnitedNations() const = 0; virtual void DLLCALL Uninit() = 0; virtual void DLLCALL Read(FDataStream& kStream) = 0; virtual void DLLCALL Write(FDataStream& kStream) const = 0; // Techs //! Get the number of Techs the player has fully researched virtual int DLLCALL GetTechCount() const = 0; //! Get all the techs the player has researched virtual int DLLCALL GetTechs(TechTypes* pkTechArray, uint uiArraySize) const = 0; }; //------------------------------------------------------------------------------ // Tech Info interfaces //------------------------------------------------------------------------------ class ICvTechInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvTechInfo1; } virtual const char* DLLCALL GetDescription() const = 0; virtual const char* DLLCALL GetType() const = 0; virtual const char* DLLCALL GetText() const = 0; virtual int DLLCALL GetEra() const = 0; virtual const char* DLLCALL GetSound() const = 0; virtual const char* DLLCALL GetSoundMP() const = 0; }; //------------------------------------------------------------------------------ // Unit Interfaces //------------------------------------------------------------------------------ class ICvUnit1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvUnit1; } virtual int DLLCALL GetID() const = 0; virtual PlayerTypes DLLCALL GetOwner() const = 0; virtual int DLLCALL GetDamage() const = 0; virtual int DLLCALL GetMoves() const = 0; virtual bool DLLCALL IsSelected() const = 0; virtual int DLLCALL GetMaxHitPoints() const = 0; virtual CivilizationTypes DLLCALL GetCivilizationType() const = 0; virtual TeamTypes DLLCALL GetTeam() const = 0; virtual DomainTypes DLLCALL GetDomainType() const = 0; virtual bool DLLCALL IsCombatUnit() const = 0; virtual bool DLLCALL IsBarbarian() const = 0; virtual bool DLLCALL IsHoveringUnit() const = 0; virtual bool DLLCALL IsInvisible(TeamTypes eTeam, bool bDebug) const = 0; virtual bool DLLCALL CanMoveImpassable() const = 0; virtual DirectionTypes DLLCALL GetFacingDirection(bool checkLineOfSightProperty) const = 0; virtual ICvPlot1* DLLCALL GetPlot() const = 0; virtual ICvUnitInfo1* DLLCALL GetUnitInfo() const = 0; virtual bool DLLCALL IsEmbarked() const = 0; virtual bool DLLCALL IsGarrisoned() const = 0; virtual ICvMissionData1* DLLCALL GetHeadMissionData() const = 0; virtual UnitCombatTypes DLLCALL GetUnitCombatType() = 0; virtual int DLLCALL GetX() const = 0; virtual int DLLCALL GetY() const = 0; virtual void DLLCALL GetPosition(int& iX, int& iY) const = 0; virtual bool DLLCALL CanSwapWithUnitHere(_In_ ICvPlot1* pPlot) const = 0; virtual bool DLLCALL CanEmbarkOnto(_In_ ICvPlot1* pOriginPlot, _In_ ICvPlot1* pTargetPlot, bool bOverrideEmbarkedCheck = false) const = 0; virtual bool DLLCALL CanDisembarkOnto(_In_ ICvPlot1* pOriginPlot, _In_ ICvPlot1* pTargetPlot, bool bOverrideEmbarkedCheck = false) const = 0; virtual bool DLLCALL IsFirstTimeSelected () const = 0; virtual UnitTypes DLLCALL GetUnitType() const = 0; virtual bool DLLCALL IsDelayedDeathExported() const = 0; virtual bool DLLCALL IsBusy() const = 0; virtual void DLLCALL SetupGraphical() = 0; virtual CvString DLLCALL GetName() const = 0; virtual void DLLCALL DoCommand(CommandTypes eCommand, int iData1, int iData2) = 0; virtual bool DLLCALL CanDoInterfaceMode(InterfaceModeTypes eInterfaceMode, bool bTestVisibility = false) = 0; virtual IDInfo DLLCALL GetIDInfo() const = 0; virtual int DLLCALL MovesLeft() const = 0; virtual bool DLLCALL CanMoveInto(ICvPlot1* pPlot, byte bMoveFlags = 0) const = 0; virtual TeamTypes DLLCALL GetDeclareWarMove(ICvPlot1* pPlot) const = 0; virtual bool DLLCALL ReadyToSelect() const = 0; virtual bool DLLCALL CanWork() const = 0; virtual bool DLLCALL CanFound() const = 0; virtual FAutoArchive& DLLCALL GetSyncArchive() = 0; }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Unit Info Interfaces //------------------------------------------------------------------------------ class ICvUnitInfo1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvUnitInfo1; } virtual int DLLCALL GetCombat() const = 0; virtual int DLLCALL GetDomainType() const = 0; virtual const char* DLLCALL GetType() const = 0; virtual const char* DLLCALL GetText() const = 0; virtual UnitMoveRate DLLCALL GetMoveRate(int numHexes) const = 0; virtual const char* DLLCALL GetUnitArtInfoTag() const = 0; virtual bool DLLCALL GetUnitArtInfoCulturalVariation() const = 0; virtual bool DLLCALL GetUnitArtInfoEraVariation() const = 0; virtual int DLLCALL GetUnitFlagIconOffset() const = 0; }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // WorldBuilder Map Loader Interfaces //------------------------------------------------------------------------------ class ICvWorldBuilderMapLoader1 : public ICvUnknown { public: static GUID DLLCALL GetInterfaceId() { return guidICvWorldBuilderMapLoader1; } virtual const CvWorldBuilderMapLoaderMapInfo& DLLCALL GetCurrentMapInfo() = 0; virtual bool DLLCALL Preload( _In_z_ const wchar_t* wszFilename, bool bScenario) = 0; virtual void DLLCALL SetupGameOptions() = 0; virtual void DLLCALL SetupPlayers() = 0; virtual void DLLCALL SetInitialItems(bool bFirstCall) = 0; virtual bool DLLCALL InitMap() = 0; virtual bool DLLCALL Save( _In_z_ const wchar_t* wszFilename, const char *szMapName = NULL) = 0; virtual int DLLCALL LoadModData(lua_State *L) = 0; virtual void DLLCALL ValidateTerrain() = 0; virtual void DLLCALL ValidateCoast() = 0; virtual void DLLCALL ClearResources() = 0; virtual void DLLCALL ClearGoodies() = 0; virtual void DLLCALL ResetPlayerSlots() = 0; virtual void DLLCALL MapPlayerToSlot(uint uiPlayer, PlayerTypes ePlayerSlot) = 0; virtual unsigned int DLLCALL PreviewPlayableCivCount( _In_z_ const wchar_t* wszFilename) = 0; virtual int DLLCALL GetMapPreview(lua_State *L) = 0; virtual int DLLCALL GetMapPlayers(lua_State *L) = 0; virtual int DLLCALL AddRandomItems(lua_State *L) = 0; virtual int DLLCALL ScatterResources(lua_State *L) = 0; virtual int DLLCALL ScatterGoodies(lua_State *L) = 0; virtual PlayerTypes DLLCALL GetMapPlayerSlot(uint uiPlayer) = 0; virtual int DLLCALL GetMapPlayerCount() = 0; virtual void DLLCALL GenerateRandomMap(const char* szMapScript) = 0; }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Templates //------------------------------------------------------------------------------ template<typename T> class CvEnumerator { public: CvEnumerator(ICvEnumerator* pEnumerator) : m_Enumerator(pEnumerator) {} bool MoveNext() { return (m_Enumerator.get() != NULL)? m_Enumerator->MoveNext() : false; } void Reset() { if(m_Enumerator.get()) m_Enumerator->Reset(); } T* GetCurrent() { if(m_Enumerator.get() != NULL) { auto_ptr<ICvUnknown> pValue(m_Enumerator->GetCurrent()); return (pValue.get() != NULL)? pValue->QueryInterface<T>() : NULL; } else { return NULL; } } private: std::auto_ptr<ICvEnumerator> m_Enumerator; }; // Include any newer interfaces #include "CvDllInterfaces2.h"
45.899307
232
0.721391
[ "vector" ]
6fd7c25e1fc879326cb6116abf06f4dfe69d5916
3,933
h
C
LNote/Core/Audio/Core/OpenSLES/SLESAudioDevice.h
lriki/LNote
a009cb44f7ac7ede3be7237fe7fca52d4c70f393
[ "MIT" ]
null
null
null
LNote/Core/Audio/Core/OpenSLES/SLESAudioDevice.h
lriki/LNote
a009cb44f7ac7ede3be7237fe7fca52d4c70f393
[ "MIT" ]
null
null
null
LNote/Core/Audio/Core/OpenSLES/SLESAudioDevice.h
lriki/LNote
a009cb44f7ac7ede3be7237fe7fca52d4c70f393
[ "MIT" ]
null
null
null
//============================================================================= //【 SLESAudioDevice 】 //----------------------------------------------------------------------------- ///** // @file SLESAudioDevice.h // @brief SLESAudioDevice // @author Riki //*/ //============================================================================= #pragma once //------------------------------------------------------------------------- // //------------------------------------------------------------------------- #include <SLES/OpenSLES.h> #include <SLES/OpenSLES_Android.h> #include "../../../Base/Container/NodeList.h" #include "../../../System/Interface.h" #include "../../Interface.h" //------------------------------------------------------------------------- // //------------------------------------------------------------------------- namespace LNote { namespace Core { namespace Audio { namespace SLES { class AudioPlayerBase; /// 3D オーディオの計算に必要なパラメータ struct EmitterState { LVector3 Position; // setPosition() で設定された仮想座標 /* X3DAUDIO_EMITTER Emitter; X3DAUDIO_CONE EmitterCone; FLOAT32* EmitterAzimuths; X3DAUDIO_DSP_SETTINGS DSPSettings; // この中の DstChannelCount は AudioDevice::update3DState でセットされる FLOAT32* MatrixCoefficients; */ /// コンストラクタ EmitterState( u32 input_channels_ ); /// デストラクタ ~EmitterState(); static const int OUTPUTCHANNELS = 8; /// 座標の設定 void setPosition( const LVector3& pos_, lnfloat ld_inv_ ); /// X3DAUDIO_EMITTER に正しい座標を設定する void updatePosition( lnfloat ld_inv_ ); }; //============================================================================= // ■ AudioDevice クラス //----------------------------------------------------------------------------- ///** // @brief オーディオの管理クラス //*/ //============================================================================= class AudioDevice : public IAudioDevice , public Base::ReferenceObject { public: /// initialize() に渡す初期化データ struct Initdata { Base::LogFile* LogFile; }; public: /// コンストラクタ AudioDevice(); protected: /// デストラクタ virtual ~AudioDevice(); public: /// 初期化 LNRESULT initialize( const Initdata& init_data_ ); /// 終了処理 ( デストラクタでも呼ばれます ) void finalize(); /// IAudioPlayer を作成する virtual LNRESULT createAudioPlayer( IAudioPlayer** obj_, IAudioSource* source_, bool enable_3d_, LNAudioPlayType type_ ); /// 3D 音源のリスナー情報を設定する virtual LNRESULT setListenerState( const LVector3& position_, const LVector3& front_ ); /// 3D 音源の可聴距離の設定 virtual void setListenableDistance( lnfloat length_ ); /// 3D 音源の可聴距離の取得 virtual lnfloat getListenableDistance() { return mListenableDistance; } /// IAudioPlayer をリストから外す ( 各 AudioPlayer のデストラクタから呼ばれる ) virtual void removeAudioPlayer( IAudioPlayer* player_ ); SLEngineItf getSLEngineEngine() { return mSLEngineEngine; } private: typedef Base::NodeList< AudioPlayerBase > AudioPlayerList; private: SLObjectItf mSLEngineObject; SLEngineItf mSLEngineEngine; AudioPlayerList* mAudioPlayerList; lnfloat mListenableDistance; Base::LogFile* mLogFile; public: LN_REFOBJ_METHODS; }; //------------------------------------------------------------------------- // //------------------------------------------------------------------------- } // namespace SLES } // namespace Audio } // namespace Core } // namespace LNote //============================================================================= // end of file //=============================================================================
25.538961
126
0.44419
[ "3d" ]
6fe2360440df0a8d1d4c1b9e6ae3208425cbc8bd
1,429
h
C
components/dom_distiller/core/distillable_page_detector.h
zipated/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
components/dom_distiller/core/distillable_page_detector.h
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
components/dom_distiller/core/distillable_page_detector.h
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLABLE_PAGE_DETECTOR_H_ #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLABLE_PAGE_DETECTOR_H_ #include <memory> #include <vector> #include "base/macros.h" #include "components/dom_distiller/core/proto/adaboost.pb.h" namespace dom_distiller { // DistillablePageDetector provides methods to identify whether or not a page is // likely to be distillable based on a vector of derived features (see // dom_distiller::CalculateDerivedFeatures). It uses a simple AdaBoost-trained // model. class DistillablePageDetector { public: static const DistillablePageDetector* GetNewModel(); static const DistillablePageDetector* GetLongPageModel(); explicit DistillablePageDetector(std::unique_ptr<AdaBoostProto> proto); ~DistillablePageDetector(); // Returns true if the model classifies the vector of features as a // distillable page. bool Classify(const std::vector<double>& features) const; double Score(const std::vector<double>& features) const; double GetThreshold() const; private: std::unique_ptr<AdaBoostProto> proto_; double threshold_; DISALLOW_COPY_AND_ASSIGN(DistillablePageDetector); }; } // namespace dom_distiller #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLABLE_PAGE_DETECTOR_H_
33.232558
80
0.79916
[ "vector", "model" ]
6fe4a309a9bfe0a87ce8280f7e1cc359320a15bf
16,171
h
C
Cpp-C/Eta/TestTools/UnitTests/rsslVATest/watchlistTestFramework.h
mattpeacock/Elektron-SDK
5b2134f219cecbb8b796a7e6d629b2463bc52b84
[ "Apache-2.0" ]
null
null
null
Cpp-C/Eta/TestTools/UnitTests/rsslVATest/watchlistTestFramework.h
mattpeacock/Elektron-SDK
5b2134f219cecbb8b796a7e6d629b2463bc52b84
[ "Apache-2.0" ]
null
null
null
Cpp-C/Eta/TestTools/UnitTests/rsslVATest/watchlistTestFramework.h
mattpeacock/Elektron-SDK
5b2134f219cecbb8b796a7e6d629b2463bc52b84
[ "Apache-2.0" ]
null
null
null
/*|----------------------------------------------------------------------------- *| This source code is provided under the Apache 2.0 license -- *| and is provided AS IS with no warranty or guarantee of fit for purpose. -- *| See the project's LICENSE.md for details. -- *| Copyright (C) 2019 Refinitiv. All rights reserved. -- *|----------------------------------------------------------------------------- */ #ifndef VA_WATCHLIST_TEST_FRAMEWORK_H #define VA_WATCHLIST_TEST_FRAMEWORK_H #include "testFramework.h" #include "rtr/rsslReactor.h" #include "getTime.h" #include "gtest/gtest.h" #include <assert.h> #ifdef __cplusplus extern "C" { #endif typedef struct { /* Adjusts speed of time-sensitive tests. * Divides all timeouts by the specified value. Useful when running in slower environments * such as a debugger or valgrind where time-sensitive tests would otherwise fail. */ float speed; } WtfGlobalConfig; extern WtfGlobalConfig wtfGlobalConfig; RTR_C_INLINE void wtfClearGlobalConfig() { wtfGlobalConfig.speed = 1.0f; } static const RsslInt32 WTF_DEFAULT_RECONNECT_ATTEMPT_LIMIT = -1; static const RsslInt32 WTF_DEFAULT_RECONNECT_MIN_DELAY = 500; static const RsslInt32 WTF_DEFAULT_RECONNECT_MAX_DELAY = 3000; static const RsslInt32 WTF_DEFAULT_CONSUMER_LOGIN_STREAM_ID = 1; static const void* WTF_DEFAULT_LOGIN_USER_SPEC_PTR = (void*)0x55557777; static const RsslUInt WTF_MCAST_UPDATE_BUFFER_LIMIT = 10; RsslRDMMsg *rdmMsgCreateCopy(RsslRDMMsg *pRdmMsg); /* Test framework for the watchlist. Provides many convenience functions for connecting, logging * in, exchanging service information, and testing different payloads. */ /* Identifies the component associated with a test event or action. */ typedef enum { WTF_TC_INIT, WTF_TC_PROVIDER, /* Component is a Provider. */ WTF_TC_CONSUMER, /* Component is a Consumer. */ } WtfComponent; /*** Events ***/ /* Event structures contain information about events received in RsslReactor callback functions * of each component. In addition to providing the type of event, events may contain copies * of information received (these copies are cleaned up automatically on calls to wtfDispatch() * or cleanup) */ /* Types of Events. */ typedef enum { WTF_DE_INIT, WTF_DE_CHNL, /* Component should receive a channel event. */ WTF_DE_RSSL_MSG, /* Component should receive an RsslMsg. */ WTF_DE_RDM_MSG /* Component should receive an RsslRDMMsg. */ } WtfEventType; typedef struct { WtfComponent component; /* Type of component (provider or consumer) */ WtfEventType type; /* The type of event (e.g. msg event, channel event) */ TimeValue timeUsec; /* Time (in microseconds) at which the event occurred. */ } WtfEventBase; RTR_C_INLINE void wtfClearTestEventBase(WtfEventBase *pBase, WtfComponent component, WtfEventType type) { pBase->component = component; pBase->type = type; pBase->timeUsec = 0; } typedef struct { WtfEventBase base; RsslMsg *pRsslMsg; void *pUserSpec; RsslBuffer *pServiceName; RsslBool hasSeqNum; RsslBool seqNum; } WtfRsslMsgEvent; RTR_C_INLINE void wtfRsslMsgEventInit(WtfRsslMsgEvent *pEvent, WtfComponent component, RsslMsg *pRsslMsg) { pEvent->base.type = WTF_DE_RSSL_MSG; pEvent->base.component = component; pEvent->base.timeUsec = getTimeMicro(); pEvent->pRsslMsg = rsslCopyMsg(pRsslMsg, RSSL_CMF_ALL_FLAGS, 0, NULL); pEvent->pUserSpec = NULL; pEvent->pServiceName = NULL; pEvent->hasSeqNum = RSSL_FALSE; pEvent->seqNum = 0; } RTR_C_INLINE void wtfRsslMsgEventCleanup(WtfRsslMsgEvent *pEvent) { if (pEvent->pRsslMsg) rsslReleaseCopiedMsg(pEvent->pRsslMsg); if (pEvent->pServiceName) { free(pEvent->pServiceName->data); free(pEvent->pServiceName); } } typedef struct { WtfEventBase base; RsslRDMMsg *pRdmMsg; void *pUserSpec; RsslBuffer *pServiceName; } WtfRdmMsgEvent; void wtfRdmMsgEventInit(WtfRdmMsgEvent *pEvent, WtfComponent component, RsslRDMMsg *pRdmMsg); RTR_C_INLINE void wtfRdmMsgEventCleanup(WtfRdmMsgEvent *pEvent) { if (pEvent->pRdmMsg) free(pEvent->pRdmMsg); if (pEvent->pServiceName) { free(pEvent->pServiceName->data); free(pEvent->pServiceName); } } typedef struct { WtfEventBase base; RsslReactorChannelEventType channelEventType; RsslRet rsslErrorId; } WtfChannelEvent; RTR_C_INLINE void wtfClearChannelEvent(WtfChannelEvent *pEvent, WtfComponent component) { memset(pEvent, 0, sizeof(WtfChannelEvent)); pEvent->base.type = WTF_DE_CHNL; pEvent->base.component = component; pEvent->base.timeUsec = getTimeMicro(); pEvent->rsslErrorId = RSSL_RET_SUCCESS; } /* The set of events that can be received during a test. */ typedef union { WtfEventBase base; WtfRsslMsgEvent rsslMsg; WtfRdmMsgEvent rdmMsg; WtfChannelEvent channelEvent; } WtfEvent; bool wtfStartTestInt(); void wtfFinishTestInt(); void wtfCloseChannel(WtfComponent component); typedef struct WtfSubmitMsgOptionsEx WtfSubmitMsgOptionsEx; /* Used to read directly from RsslChannels (no reactor). * Used by wtfDispatch, and creates the same events. */ static void wtfDispatchRaw(RsslChannel *pChannel, WtfComponent component, time_t timeoutMsec); /* Used to write directly to RsslChannels (no reactor). * Used by wtfSubmitMsg. */ static void wtfSubmitMsgRaw(RsslChannel *pChannel, RsslMsg *pMsg, RsslRDMMsg *pRdmMsg, WtfSubmitMsgOptionsEx *pOptsEx); /******************/ /*** INTERFACES ***/ /******************/ /* These are the main interfaces to use when creating tests. * The functions are described here, but the existing tests should also be able to serve as a * guide for proper usage. */ typedef struct { RsslConnectionTypes connectionType; RsslBool useRawProvider; /* Provider server & channel do not use reactor. * Used for tests which may require special behavior * (such as internal extensions or not sending pings). */ } WtfInitOpts; RTR_C_INLINE void wtfClearInitOpts(WtfInitOpts *pOpts) { pOpts->connectionType = RSSL_CONN_TYPE_SOCKET; pOpts->useRawProvider = RSSL_FALSE; } /* Call before starting a series of tests. Initializes the framework, creates * provider & consumer reactors, and binds the provider component's server. */ void wtfInit(WtfInitOpts *pOpts); /* Call after finishing a series of tests. Cleans up component reactors and resources, * and closes the provider server. */ void wtfCleanup(); /* Call before starting a test. Initializes the test event queue. */ #define wtfStartTest() (rssl_test_start(), wtfStartTestInt()) /* Call when finishing a test. Closes component channels. */ #define wtfFinishTest() (wtfFinishTestInt(), rssl_test_finish()) /* Retrieves an event that was received while perforing an action or calling wtfDispatch(). */ WtfEvent *wtfGetEvent(); /* Uses notification & calls rsslReactorDispatch() on the given component's channel for the * specified time. * To ensure that previous events are not missed, this call will fail if events are still * present in the queue. */ void wtfDispatch(WtfComponent component, time_t timeoutMsec); /* Additional options for WtfSubmitMsg beyond RsslReactorSubmitMsgOptions. */ struct WtfSubmitMsgOptionsEx { RsslBool hasSeqNum:1; /* Indicates presence of seqNum. */ RsslUInt32 seqNum; /* Sequence number to send. Supported for components in raw (non-reactor) mode only * as sequence numbers are an internal extension and . */ }; RTR_C_INLINE void wtfClearSubmitMsgOptionsEx(WtfSubmitMsgOptionsEx *pOptsEx) { pOptsEx->hasSeqNum = RSSL_FALSE; pOptsEx->seqNum = 0; } /* Submits a message using rsslReactorSubmit(). If no events are expected, * set the noExpectedEvents parameter to call Dispatch automatically and verify this * (this should be true for most cases). */ void wtfSubmitMsg(RsslReactorSubmitMsgOptions *pOpts, WtfComponent component, WtfSubmitMsgOptionsEx *pOptsEx, RsslBool noEventsExpected); /* Gets an RsslMsg from an event. */ RTR_C_INLINE RsslMsg *wtfGetRsslMsg(WtfEvent *pEvent) { if (pEvent->base.type != WTF_DE_RSSL_MSG) return NULL; return pEvent->rsslMsg.pRsslMsg; } /* Gets an RsslRDMMsg from an event. */ RTR_C_INLINE RsslRDMMsg *wtfGetRdmMsg(WtfEvent *pEvent) { if (pEvent->base.type != WTF_DE_RDM_MSG) return NULL; return pEvent->rdmMsg.pRdmMsg; } /* Gets a WtfChannelEvent from an event. */ RTR_C_INLINE WtfChannelEvent *wtfGetChannelEvent(WtfEvent *pEvent) { if (pEvent->base.type != WTF_DE_CHNL) return NULL; return &pEvent->channelEvent; } typedef enum { WTF_CB_NONE, /* Do not use the domain-specific callback. */ WTF_CB_USE_DOMAIN_CB, /* Use the domain-specific callback. */ WTF_CB_RAISE_TO_DEFAULT_CB /* Raise it to the default message callback. */ } WtfCallbackAction; /* Options for wtfSetupConnection. */ typedef struct { RsslInt32 reconnectAttemptLimit; /* reconnectAttemptLimit used when connecting. */ RsslInt32 reconnectMinDelay; /* reconnectMaxDelay used when connecting consumer. */ RsslInt32 reconnectMaxDelay; /* reconnectMaxDelay used when connecting consumer. */ RsslBool login; /* Consumer logs in. */ RsslBool accept; /* Automatically accept connection on provider. */ RsslBool provideLoginRefresh; /* Provider automatically accepts login. */ RsslBool provideDefaultDirectory; /* Provider automatically provides a directory * containing Service1 when requested. */ RsslBool singleOpen; /* Enables SingleOpen on watchlist. */ RsslBool allowSuspectData; /* Enables AllowSuspectData on watchlist. */ WtfCallbackAction consumerLoginCallback; /* Enables consumer loginMsgCallback. */ WtfCallbackAction consumerDirectoryCallback; /* Enables consumer directoryMsgCallback. */ WtfCallbackAction consumerDictionaryCallback; /* Enables consumer dictionaryMsgCallback. */ WtfCallbackAction providerDictionaryCallback; /* Enables provider dictionaryMsgCallback. */ RsslUInt32 postAckTimeout; /* Sets watchlist post ack timeout. */ RsslUInt32 requestTimeout; /* Sets watchlist request timeout. */ RsslBool multicastGapRecovery; /* Provider's login response indicates * whether watchlist should recover from gaps. */ } WtfSetupConnectionOpts; /* Initializes commonly used settings of WtfSetupConnectionOpts. */ static void wtfClearSetupConnectionOpts(WtfSetupConnectionOpts *pOpts) { pOpts->reconnectAttemptLimit = WTF_DEFAULT_RECONNECT_ATTEMPT_LIMIT; pOpts->reconnectMinDelay = WTF_DEFAULT_RECONNECT_MIN_DELAY; pOpts->reconnectMaxDelay = WTF_DEFAULT_RECONNECT_MAX_DELAY; pOpts->login = RSSL_TRUE; pOpts->accept = RSSL_TRUE; pOpts->provideLoginRefresh = RSSL_TRUE; pOpts->provideDefaultDirectory = RSSL_TRUE; pOpts->singleOpen = RSSL_TRUE; pOpts->allowSuspectData = RSSL_TRUE; pOpts->consumerLoginCallback = WTF_CB_USE_DOMAIN_CB; pOpts->consumerDirectoryCallback = WTF_CB_USE_DOMAIN_CB; pOpts->consumerDictionaryCallback = WTF_CB_USE_DOMAIN_CB; pOpts->providerDictionaryCallback = WTF_CB_USE_DOMAIN_CB; pOpts->postAckTimeout = 15000; pOpts->requestTimeout = 15000; pOpts->multicastGapRecovery = RSSL_TRUE; } /*** Connections ***/ /* Perform a standard connect attempt. (Most tests connect in the same way, * options are provided for minor changes). */ void wtfSetupConnection(WtfSetupConnectionOpts *pOpts); /* Accepts the connection for the provider (waits for notification; same as * calling wtfAcceptWithTime(5000). */ void wtfAccept(); /* Accepts the connection for the provider (waits for notification up to the specified time). */ void wtfAcceptWithTime(time_t timeoutMsec); /* Gets channel information (wraps around rsslReactorGetChannelInfo). */ RsslRet wtfGetChannelInfo(WtfComponent component, RsslReactorChannelInfo *pChannelInfo); /* Returns the currently-used connection type for the test. */ RsslConnectionTypes wtfGetConnectionType(); /* Returns the default login stream ID used by the consumer when logging in. */ RsslInt32 wtfConsumerGetDefaultLoginStreamId(); /* Initializes a default login request for the consumer * (wraps around rsslInitDefaultRDMLoginRequest) */ void wtfInitDefaultLoginRequest(RsslRDMLoginRequest *pLoginRequest); /* Initializes a default login refresh for a provider to send. */ void wtfInitDefaultLoginRefresh(RsslRDMLoginRefresh *pLoginRefresh); /* Retrieves the channel of the component. */ RsslReactorChannel *wtfGetChannel(WtfComponent component); /* Sets an function containing "extra actions" to perform while in the msgCallback. */ void wtfSetConsumerMsgCallbackAction(void (*function)); /*** Login ***/ /* The username typically used on login. */ extern RsslBuffer loginUserName; /* Gets the stream ID on which the provider received the login request. */ RsslInt32 wtfGetProviderLoginStream(); /*** Directory & Services ***/ /* Gets the stream ID on which the provider received the directory requests. */ RsslInt32 wtfGetProviderDirectoryStream(); /* Gets the filter the provider received on the directory requests (when the consumer is using * the watchlist, this should contain all the filters). */ RsslUInt32 wtfGetProviderDirectoryFilter(); /* Initializes a directory refresh. */ void wtfInitDefaultDirectoryRefresh(RsslRDMDirectoryRefresh *pDirectoryRefresh, RsslRDMService *pSingleService); /* Most tests operate using a single default service, "Service1." */ /* Sets a RsslRDMService structure to the information used for Service 1. * Tests can use this as the base information and modify the state of the service. */ void wtfSetService1Info(RsslRDMService *pService); /* The name of Service1. */ extern RsslBuffer service1Name; /* The ID of Service1. */ extern RsslUInt16 service1Id; /*** Views ***/ /* Decodes a view payload and tests it against the expected list of contained elements. */ void wtfProviderTestView(RsslRequestMsg *pRequestMsg, void *elemList, RsslUInt32 elemCount, RsslUInt viewType); /* Returns a dictionary object populated by RDMFieldDictionary and enumtype.def. */ RsslDataDictionary *wtfGetDictionary(); /*** Symbol Lists. ***/ /* Describes a symbol list action to encode or decode. Used with wtfProviderEncodeSymbolList() * and wtfConsumerDecodeSymbolListDataBody() to test symbol list payloads. */ typedef struct { RsslMapEntryActions action; RsslBuffer itemName; } WtfSymbolAction; /* Encodes a symbol list payload. */ void wtfProviderEncodeSymbolListDataBody(RsslBuffer *pBuffer, WtfSymbolAction *symbolList, RsslUInt32 symbolCount); /* Decodes a symbol list payload. */ void wtfConsumerDecodeSymbolListDataBody(RsslBuffer *pBuffer, WtfSymbolAction *symbolList, RsslUInt32 symbolCount); typedef struct { RsslUInt viewType; /* Type of view to encode, if any. */ RsslInt *viewFieldList; /* For field ID views. */ RsslBuffer *viewElemList; /* For element name views. */ RsslUInt32 viewCount; /* Number of elements in viewFieldList/viewElemList. */ RsslBuffer *batchItemList; /* List of item names. */ RsslUInt32 batchItemCount; /* Number of names in batchItemList. */ RsslUInt slDataStreamFlags; /* Symbol list data stream flags to encode, if any. */ } WtfConsumerRequestPayloadOptions; RTR_C_INLINE void wtfClearConsumerRequestPayloadOptions(WtfConsumerRequestPayloadOptions *pOpts) { memset(pOpts, 0, sizeof(WtfConsumerRequestPayloadOptions)); } /* Encodes the given requestable payload data. Similar to other functions but this * allows testing combinations. */ void wtfConsumerEncodeRequestPayload(RsslBuffer *pBuffer, WtfConsumerRequestPayloadOptions *pOpts); /* Encodes Symbol List Request Behaviors (recommend using wtfConsumerEncodeRequestPayload) */ void wtfConsumerEncodeSymbolListRequestBehaviors(RsslBuffer *pBuffer, RsslUInt slDataStreamFlags); /* Encodes a batch request(recommend using wtfConsumerEncodeRequestPayload) */ void wtfConsumerEncodeBatchRequest(RsslBuffer *pBuffer, RsslBuffer* itemNameList, RsslUInt32 itemCount); /* Encodes a view request(recommend using wtfConsumerEncodeRequestPayload) */ void wtfConsumerEncodeViewRequest(RsslUInt32 viewType, RsslBuffer *pBuffer, RsslInt* fidIdList, RsslBuffer* eItemNameList, RsslUInt32 itemCount); #ifdef __cplusplus }; #endif #endif
35.30786
145
0.761363
[ "object" ]
6fe6d7a2ea3eef21e935ce161a05c9b2f8b497b6
173,255
h
C
Include/10.0.15063.0/winrt/windows.perception.spatial.surfaces.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
5
2020-05-29T06:22:17.000Z
2021-11-28T08:21:38.000Z
Include/10.0.15063.0/winrt/windows.perception.spatial.surfaces.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
null
null
null
Include/10.0.15063.0/winrt/windows.perception.spatial.surfaces.h
sezero/windows-sdk-headers
e8e9d4d50769ded01a2df905c6bf4355eb3fa8b5
[ "MIT" ]
5
2020-05-30T04:15:11.000Z
2021-11-28T08:48:56.000Z
/* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 8.01.0622 */ /* @@MIDL_FILE_HEADING( ) */ /* verify that the <rpcndr.h> version is high enough to compile this file*/ #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 500 #endif /* verify that the <rpcsal.h> version is high enough to compile this file*/ #ifndef __REQUIRED_RPCSAL_H_VERSION__ #define __REQUIRED_RPCSAL_H_VERSION__ 100 #endif #include "rpc.h" #include "rpcndr.h" #ifndef __RPCNDR_H_VERSION__ #error this stub requires an updated version of <rpcndr.h> #endif /* __RPCNDR_H_VERSION__ */ #ifndef COM_NO_WINDOWS_H #include "windows.h" #include "ole2.h" #endif /*COM_NO_WINDOWS_H*/ #ifndef __windows2Eperception2Espatial2Esurfaces_h__ #define __windows2Eperception2Espatial2Esurfaces_h__ #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif /* Forward Declarations */ #ifndef ____FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ #define ____FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ typedef interface __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo; #endif /* ____FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ */ #ifndef ____FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ #define ____FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ typedef interface __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo; #endif /* ____FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ */ #ifndef ____FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ #define ____FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ typedef interface __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo; #endif /* ____FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ */ #ifndef ____FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ #define ____FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ typedef interface __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo; #endif /* ____FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ */ #ifndef ____FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_FWD_DEFINED__ #define ____FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_FWD_DEFINED__ typedef interface __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh; #endif /* ____FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_FWD_DEFINED__ */ #ifndef ____FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_FWD_DEFINED__ #define ____FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_FWD_DEFINED__ typedef interface __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh; #endif /* ____FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_FWD_DEFINED__ */ #ifndef ____FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_FWD_DEFINED__ #define ____FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_FWD_DEFINED__ typedef interface __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable; #endif /* ____FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_FWD_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceInfo; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_FWD_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceMesh; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_FWD_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceMeshBuffer; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_FWD_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceMeshOptions; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_FWD_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceMeshOptionsStatics; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_FWD_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceObserver; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_FWD_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceObserverStatics; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_FWD_DEFINED__ */ #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_FWD_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_FWD_DEFINED__ typedef interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2; #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceObserverStatics2; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ #endif /* __cplusplus */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_FWD_DEFINED__ */ /* header files for imported files */ #include "inspectable.h" #include "AsyncInfo.h" #include "EventToken.h" #include "Windows.Foundation.h" #include "Windows.Foundation.Numerics.h" #include "Windows.Graphics.DirectX.h" #include "Windows.Perception.Spatial.h" #ifdef __cplusplus extern "C"{ #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0000 */ /* [local] */ #ifdef __cplusplus } /*extern "C"*/ #endif #include <windows.foundation.collections.h> #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { class SpatialSurfaceInfo; } /*Surfaces*/ } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceInfo; } /*Surfaces*/ } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0000 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0000_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0000_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4663 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4663 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4663_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4663_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0001 */ /* [local] */ #ifndef DEF___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE #define DEF___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("a6bdf94a-2697-5ff2-89dc-a17cecdcda6c")) IKeyValuePair<GUID,ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo*> : IKeyValuePair_impl<GUID,ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo*, ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceInfo*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IKeyValuePair`2<Guid, Windows.Perception.Spatial.Surfaces.SpatialSurfaceInfo>"; } }; typedef IKeyValuePair<GUID,ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo*> __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_t; #define ____FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo ABI::Windows::Foundation::Collections::__FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0001 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0001_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0001_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4664 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4664 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4664_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4664_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0002 */ /* [local] */ #ifndef DEF___FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE #define DEF___FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("6d328390-f279-5f39-9682-bba0cd81489b")) IIterator<__FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo*> : IIterator_impl<__FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo*> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterator`1<Windows.Foundation.Collections.IKeyValuePair`2<Guid, Windows.Perception.Spatial.Surfaces.SpatialSurfaceInfo>>"; } }; typedef IIterator<__FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo*> __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_t; #define ____FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo ABI::Windows::Foundation::Collections::__FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0002 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0002_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0002_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4665 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4665 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4665_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4665_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0003 */ /* [local] */ #ifndef DEF___FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE #define DEF___FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("868757d1-be21-51d9-8dee-a958b9deec71")) IIterable<__FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo*> : IIterable_impl<__FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo*> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterable`1<Windows.Foundation.Collections.IKeyValuePair`2<Guid, Windows.Perception.Spatial.Surfaces.SpatialSurfaceInfo>>"; } }; typedef IIterable<__FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo*> __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_t; #define ____FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ #define __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo ABI::Windows::Foundation::Collections::__FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0003 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0003_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0003_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4666 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4666 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4666_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4666_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0004 */ /* [local] */ #ifndef DEF___FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE #define DEF___FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("eaa722b9-2859-593d-bb66-0c538e415e71")) IMapView<GUID,ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo*> : IMapView_impl<GUID,ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo*, ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceInfo*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IMapView`2<Guid, Windows.Perception.Spatial.Surfaces.SpatialSurfaceInfo>"; } }; typedef IMapView<GUID,ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo*> __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_t; #define ____FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_FWD_DEFINED__ #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo ABI::Windows::Foundation::Collections::__FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { class SpatialSurfaceMesh; } /*Surfaces*/ } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceMesh; } /*Surfaces*/ } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0004 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0004_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0004_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4667 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4667 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4667_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4667_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0005 */ /* [local] */ #ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_USE #define DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("4680f7f6-44c5-5fc6-8d51-d6962915fa23")) IAsyncOperationCompletedHandler<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh*> : IAsyncOperationCompletedHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh*, ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMesh*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.AsyncOperationCompletedHandler`1<Windows.Perception.Spatial.Surfaces.SpatialSurfaceMesh>"; } }; typedef IAsyncOperationCompletedHandler<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh*> __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_t; #define ____FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_FWD_DEFINED__ #define __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_USE */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0005 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0005_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0005_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4668 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4668 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4668_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4668_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0006 */ /* [local] */ #ifndef DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_USE #define DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("f5938fad-a8a1-5f7e-9440-bdb781ad26b6")) IAsyncOperation<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh*> : IAsyncOperation_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh*, ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMesh*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.IAsyncOperation`1<Windows.Perception.Spatial.Surfaces.SpatialSurfaceMesh>"; } }; typedef IAsyncOperation<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceMesh*> __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_t; #define ____FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_FWD_DEFINED__ #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh ABI::Windows::Foundation::__FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { class SpatialSurfaceObserver; } /*Surfaces*/ } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { interface ISpatialSurfaceObserver; } /*Surfaces*/ } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif interface IInspectable; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0006 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0006_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0006_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4669 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4669 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4669_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4669_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0007 */ /* [local] */ #ifndef DEF___FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_USE #define DEF___FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("8b31274a-7693-52be-9014-b0f5f65a3539")) ITypedEventHandler<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver*,IInspectable*> : ITypedEventHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver*, ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceObserver*>,IInspectable*> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.TypedEventHandler`2<Windows.Perception.Spatial.Surfaces.SpatialSurfaceObserver, Object>"; } }; typedef ITypedEventHandler<ABI::Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver*,IInspectable*> __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_t; #define ____FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_FWD_DEFINED__ #define __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable ABI::Windows::Foundation::__FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { struct SpatialBoundingOrientedBox; } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0007 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0007_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0007_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4670 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4670 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4670_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4670_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0008 */ /* [local] */ #ifndef DEF___FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox_USE #define DEF___FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("09f88309-9f81-5207-bdb2-abef926db18f")) IReference<struct ABI::Windows::Perception::Spatial::SpatialBoundingOrientedBox> : IReference_impl<struct ABI::Windows::Perception::Spatial::SpatialBoundingOrientedBox> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.IReference`1<Windows.Perception.Spatial.SpatialBoundingOrientedBox>"; } }; typedef IReference<struct ABI::Windows::Perception::Spatial::SpatialBoundingOrientedBox> __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox_t; #define ____FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox_FWD_DEFINED__ #define __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox ABI::Windows::Foundation::__FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Graphics { namespace DirectX { enum DirectXPixelFormat; } /*DirectX*/ } /*Graphics*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0008 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0008_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0008_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4671 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4671 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4671_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4671_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0009 */ /* [local] */ #ifndef DEF___FIIterator_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE #define DEF___FIIterator_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("ea016190-ac80-5840-8f58-ff434c7b2907")) IIterator<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> : IIterator_impl<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterator`1<Windows.Graphics.DirectX.DirectXPixelFormat>"; } }; typedef IIterator<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> __FIIterator_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_t; #define ____FIIterator_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_FWD_DEFINED__ #define __FIIterator_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat ABI::Windows::Foundation::Collections::__FIIterator_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterator_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0009 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0009_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0009_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4672 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4672 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4672_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4672_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0010 */ /* [local] */ #ifndef DEF___FIIterable_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE #define DEF___FIIterable_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("3908f2c6-1aee-5129-b9a6-2a6e01d9507e")) IIterable<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> : IIterable_impl<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterable`1<Windows.Graphics.DirectX.DirectXPixelFormat>"; } }; typedef IIterable<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> __FIIterable_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_t; #define ____FIIterable_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_FWD_DEFINED__ #define __FIIterable_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat ABI::Windows::Foundation::Collections::__FIIterable_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterable_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0010 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0010_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0010_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4673 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4673 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4673_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4673_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0011 */ /* [local] */ #ifndef DEF___FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE #define DEF___FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("1edda1c2-0f6e-516c-80b8-7687dcd1280e")) IVectorView<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> : IVectorView_impl<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IVectorView`1<Windows.Graphics.DirectX.DirectXPixelFormat>"; } }; typedef IVectorView<enum ABI::Windows::Graphics::DirectX::DirectXPixelFormat> __FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_t; #define ____FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_FWD_DEFINED__ #define __FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat ABI::Windows::Foundation::Collections::__FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { class SpatialBoundingVolume; } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { interface ISpatialBoundingVolume; } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0011 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0011_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0011_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4674 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4674 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4674_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4674_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0012 */ /* [local] */ #ifndef DEF___FIIterator_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_USE #define DEF___FIIterator_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("eb8385c5-0775-5415-8f76-327e6e388ac5")) IIterator<ABI::Windows::Perception::Spatial::SpatialBoundingVolume*> : IIterator_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Perception::Spatial::SpatialBoundingVolume*, ABI::Windows::Perception::Spatial::ISpatialBoundingVolume*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterator`1<Windows.Perception.Spatial.SpatialBoundingVolume>"; } }; typedef IIterator<ABI::Windows::Perception::Spatial::SpatialBoundingVolume*> __FIIterator_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_t; #define ____FIIterator_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_FWD_DEFINED__ #define __FIIterator_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume ABI::Windows::Foundation::Collections::__FIIterator_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterator_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_USE */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0012 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0012_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0012_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4675 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4675 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4675_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4675_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0013 */ /* [local] */ #ifndef DEF___FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_USE #define DEF___FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { namespace Collections { template <> struct __declspec(uuid("89e8f1ee-3a2a-5b69-a786-cddcf7456a3a")) IIterable<ABI::Windows::Perception::Spatial::SpatialBoundingVolume*> : IIterable_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Perception::Spatial::SpatialBoundingVolume*, ABI::Windows::Perception::Spatial::ISpatialBoundingVolume*>> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.Collections.IIterable`1<Windows.Perception.Spatial.SpatialBoundingVolume>"; } }; typedef IIterable<ABI::Windows::Perception::Spatial::SpatialBoundingVolume*> __FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_t; #define ____FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_FWD_DEFINED__ #define __FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume ABI::Windows::Foundation::Collections::__FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_t /* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume_USE */ #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { enum SpatialPerceptionAccessStatus; } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0013 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0013_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0013_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4676 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4676 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4676_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4676_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0014 */ /* [local] */ #ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_USE #define DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("6ced54c8-7689-525a-80e1-956a9d85cd83")) IAsyncOperationCompletedHandler<enum ABI::Windows::Perception::Spatial::SpatialPerceptionAccessStatus> : IAsyncOperationCompletedHandler_impl<enum ABI::Windows::Perception::Spatial::SpatialPerceptionAccessStatus> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.AsyncOperationCompletedHandler`1<Windows.Perception.Spatial.SpatialPerceptionAccessStatus>"; } }; typedef IAsyncOperationCompletedHandler<enum ABI::Windows::Perception::Spatial::SpatialPerceptionAccessStatus> __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_t; #define ____FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_FWD_DEFINED__ #define __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_USE */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0014 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0014_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0014_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4677 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4677 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4677_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4677_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0015 */ /* [local] */ #ifndef DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_USE #define DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_USE #if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME) } /*extern "C"*/ namespace ABI { namespace Windows { namespace Foundation { template <> struct __declspec(uuid("b425d126-1069-563f-a863-44a30a8f071d")) IAsyncOperation<enum ABI::Windows::Perception::Spatial::SpatialPerceptionAccessStatus> : IAsyncOperation_impl<enum ABI::Windows::Perception::Spatial::SpatialPerceptionAccessStatus> { static const wchar_t* z_get_rc_name_impl() { return L"Windows.Foundation.IAsyncOperation`1<Windows.Perception.Spatial.SpatialPerceptionAccessStatus>"; } }; typedef IAsyncOperation<enum ABI::Windows::Perception::Spatial::SpatialPerceptionAccessStatus> __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_t; #define ____FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_FWD_DEFINED__ #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus ABI::Windows::Foundation::__FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_t /* ABI */ } /* Windows */ } /* Foundation */ } extern "C" { #endif //__cplusplus #endif /* DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus_USE */ #if defined(__cplusplus) } #endif // defined(__cplusplus) #include <Windows.Foundation.h> #if !defined(__windows2Efoundation2Enumerics_h__) #include <Windows.Foundation.Numerics.h> #endif // !defined(__windows2Efoundation2Enumerics_h__) #if !defined(__windows2Egraphics2Edirectx_h__) #include <Windows.Graphics.DirectX.h> #endif // !defined(__windows2Egraphics2Edirectx_h__) #if !defined(__windows2Eperception2Espatial_h__) #include <Windows.Perception.Spatial.h> #endif // !defined(__windows2Eperception2Espatial_h__) #if !defined(__windows2Estorage2Estreams_h__) #include <Windows.Storage.Streams.h> #endif // !defined(__windows2Estorage2Estreams_h__) #if defined(__cplusplus) extern "C" { #endif // defined(__cplusplus) #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CFoundation_CDateTime __x_ABI_CWindows_CFoundation_CDateTime; #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CFoundation_CNumerics_CVector3 __x_ABI_CWindows_CFoundation_CNumerics_CVector3; #endif #if !defined(__cplusplus) #if !defined(__cplusplus) typedef enum __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat; #endif /* end if !defined(__cplusplus) */ #endif #if !defined(__cplusplus) typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSpatialBoundingOrientedBox __x_ABI_CWindows_CPerception_CSpatial_CSpatialBoundingOrientedBox; #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { class SpatialCoordinateSystem; } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif #if !defined(__cplusplus) #if !defined(__cplusplus) typedef enum __x_ABI_CWindows_CPerception_CSpatial_CSpatialPerceptionAccessStatus __x_ABI_CWindows_CPerception_CSpatial_CSpatialPerceptionAccessStatus; #endif /* end if !defined(__cplusplus) */ #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { class SpatialSurfaceMeshBuffer; } /*Surfaces*/ } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif #ifdef __cplusplus namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { class SpatialSurfaceMeshOptions; } /*Surfaces*/ } /*Spatial*/ } /*Perception*/ } /*Windows*/ } #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0015 */ /* [local] */ #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Foundation { typedef struct DateTime DateTime; } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Foundation { namespace Numerics { typedef struct Vector3 Vector3; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Graphics { namespace DirectX { typedef enum DirectXPixelFormat DirectXPixelFormat; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { typedef struct SpatialBoundingOrientedBox SpatialBoundingOrientedBox; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif #ifdef __cplusplus } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { typedef enum SpatialPerceptionAccessStatus SpatialPerceptionAccessStatus; } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #endif extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0015_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0015_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4678 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4678 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4678_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4678_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0016 */ /* [local] */ #ifndef DEF___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo #define DEF___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0016 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0016_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0016_v0_0_s_ifspec; #ifndef ____FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ #define ____FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ /* interface __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* [unique][uuid][object] */ /* interface __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("a6bdf94a-2697-5ff2-89dc-a17cecdcda6c") __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Key( /* [retval][out] */ __RPC__out GUID *key) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Value( /* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceInfo **value) = 0; }; #else /* C style interface */ typedef struct __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Key )( __RPC__in __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [retval][out] */ __RPC__out GUID *key); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Value )( __RPC__in __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo **value); END_INTERFACE } __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl; interface __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo { CONST_VTBL struct __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_get_Key(This,key) \ ( (This)->lpVtbl -> get_Key(This,key) ) #define __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_get_Value(This,value) \ ( (This)->lpVtbl -> get_Value(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0017 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0017 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0017_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0017_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4679 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4679 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4679_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4679_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0018 */ /* [local] */ #ifndef DEF___FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo #define DEF___FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0018 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0018_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0018_v0_0_s_ifspec; #ifndef ____FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ #define ____FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ /* interface __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* [unique][uuid][object] */ /* interface __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("6d328390-f279-5f39-9682-bba0cd81489b") __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Current( /* [retval][out] */ __RPC__deref_out_opt __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **current) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HasCurrent( /* [retval][out] */ __RPC__out boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE MoveNext( /* [retval][out] */ __RPC__out boolean *hasCurrent) = 0; virtual HRESULT STDMETHODCALLTYPE GetMany( /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **items, /* [retval][out] */ __RPC__out unsigned int *actual) = 0; }; #else /* C style interface */ typedef struct __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Current )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [retval][out] */ __RPC__deref_out_opt __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **current); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HasCurrent )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [retval][out] */ __RPC__out boolean *hasCurrent); HRESULT ( STDMETHODCALLTYPE *MoveNext )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [retval][out] */ __RPC__out boolean *hasCurrent); HRESULT ( STDMETHODCALLTYPE *GetMany )( __RPC__in __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [in] */ unsigned int capacity, /* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **items, /* [retval][out] */ __RPC__out unsigned int *actual); END_INTERFACE } __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl; interface __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo { CONST_VTBL struct __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_get_Current(This,current) \ ( (This)->lpVtbl -> get_Current(This,current) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_get_HasCurrent(This,hasCurrent) \ ( (This)->lpVtbl -> get_HasCurrent(This,hasCurrent) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_MoveNext(This,hasCurrent) \ ( (This)->lpVtbl -> MoveNext(This,hasCurrent) ) #define __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetMany(This,capacity,items,actual) \ ( (This)->lpVtbl -> GetMany(This,capacity,items,actual) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0019 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0019 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0019_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0019_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4680 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4680 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4680_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4680_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0020 */ /* [local] */ #ifndef DEF___FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo #define DEF___FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0020 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0020_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0020_v0_0_s_ifspec; #ifndef ____FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ #define ____FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ /* interface __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* [unique][uuid][object] */ /* interface __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("868757d1-be21-51d9-8dee-a958b9deec71") __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE First( /* [retval][out] */ __RPC__deref_out_opt __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **first) = 0; }; #else /* C style interface */ typedef struct __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *First )( __RPC__in __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [retval][out] */ __RPC__deref_out_opt __FIIterator_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **first); END_INTERFACE } __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl; interface __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo { CONST_VTBL struct __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_First(This,first) \ ( (This)->lpVtbl -> First(This,first) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0021 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIIterable_1___FIKeyValuePair_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0021 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0021_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0021_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4681 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4681 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4681_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4681_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0022 */ /* [local] */ #ifndef DEF___FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo #define DEF___FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0022 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0022_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0022_v0_0_s_ifspec; #ifndef ____FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ #define ____FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ /* interface __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* [unique][uuid][object] */ /* interface __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("eaa722b9-2859-593d-bb66-0c538e415e71") __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE Lookup( /* [in] */ GUID key, /* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceInfo **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size( /* [retval][out] */ __RPC__out unsigned int *size) = 0; virtual HRESULT STDMETHODCALLTYPE HasKey( /* [in] */ GUID key, /* [retval][out] */ __RPC__out boolean *found) = 0; virtual HRESULT STDMETHODCALLTYPE Split( /* [out] */ __RPC__deref_out_opt __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **firstPartition, /* [out] */ __RPC__deref_out_opt __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **secondPartition) = 0; }; #else /* C style interface */ typedef struct __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *Lookup )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [in] */ GUID key, /* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [retval][out] */ __RPC__out unsigned int *size); HRESULT ( STDMETHODCALLTYPE *HasKey )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [in] */ GUID key, /* [retval][out] */ __RPC__out boolean *found); HRESULT ( STDMETHODCALLTYPE *Split )( __RPC__in __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo * This, /* [out] */ __RPC__deref_out_opt __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **firstPartition, /* [out] */ __RPC__deref_out_opt __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **secondPartition); END_INTERFACE } __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl; interface __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo { CONST_VTBL struct __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfoVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_Lookup(This,key,value) \ ( (This)->lpVtbl -> Lookup(This,key,value) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_get_Size(This,size) \ ( (This)->lpVtbl -> get_Size(This,size) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_HasKey(This,key,found) \ ( (This)->lpVtbl -> HasKey(This,key,found) ) #define __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_Split(This,firstPartition,secondPartition) \ ( (This)->lpVtbl -> Split(This,firstPartition,secondPartition) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0023 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0023 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0023_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0023_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4682 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4682 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4682_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4682_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0024 */ /* [local] */ #ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh #define DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0024 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0024_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0024_v0_0_s_ifspec; #ifndef ____FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_INTERFACE_DEFINED__ #define ____FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_INTERFACE_DEFINED__ /* interface __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh */ /* [unique][uuid][object] */ /* interface __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("4680f7f6-44c5-5fc6-8d51-d6962915fa23") __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE Invoke( /* [in] */ __RPC__in_opt __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh *asyncInfo, /* [in] */ AsyncStatus status) = 0; }; #else /* C style interface */ typedef struct __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMeshVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This); HRESULT ( STDMETHODCALLTYPE *Invoke )( __RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [in] */ __RPC__in_opt __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh *asyncInfo, /* [in] */ AsyncStatus status); END_INTERFACE } __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMeshVtbl; interface __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh { CONST_VTBL struct __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMeshVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_Invoke(This,asyncInfo,status) \ ( (This)->lpVtbl -> Invoke(This,asyncInfo,status) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0025 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0025 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0025_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0025_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4683 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4683 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4683_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4683_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0026 */ /* [local] */ #ifndef DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh #define DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0026 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0026_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0026_v0_0_s_ifspec; #ifndef ____FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_INTERFACE_DEFINED__ #define ____FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_INTERFACE_DEFINED__ /* interface __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh */ /* [unique][uuid][object] */ /* interface __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f5938fad-a8a1-5f7e-9440-bdb781ad26b6") __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh : public IInspectable { public: virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Completed( /* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh *handler) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Completed( /* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh **handler) = 0; virtual HRESULT STDMETHODCALLTYPE GetResults( /* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMesh **results) = 0; }; #else /* C style interface */ typedef struct __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMeshVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Completed )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh *handler); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Completed )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh **handler); HRESULT ( STDMETHODCALLTYPE *GetResults )( __RPC__in __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh * This, /* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh **results); END_INTERFACE } __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMeshVtbl; interface __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh { CONST_VTBL struct __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMeshVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_put_Completed(This,handler) \ ( (This)->lpVtbl -> put_Completed(This,handler) ) #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_get_Completed(This,handler) \ ( (This)->lpVtbl -> get_Completed(This,handler) ) #define __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_GetResults(This,results) \ ( (This)->lpVtbl -> GetResults(This,results) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0027 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0027 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0027_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0027_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4684 */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4684 */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4684_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces2Eidl_0000_4684_v0_0_s_ifspec; /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0028 */ /* [local] */ #ifndef DEF___FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable #define DEF___FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable #if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME) /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0028 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0028_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0028_v0_0_s_ifspec; #ifndef ____FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_INTERFACE_DEFINED__ #define ____FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_INTERFACE_DEFINED__ /* interface __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable */ /* [unique][uuid][object] */ /* interface __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable */ /* [unique][uuid][object] */ EXTERN_C const IID IID___FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("8b31274a-7693-52be-9014-b0f5f65a3539") __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE Invoke( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceObserver *sender, /* [in] */ __RPC__in_opt IInspectable *e) = 0; }; #else /* C style interface */ typedef struct __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectableVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable * This); HRESULT ( STDMETHODCALLTYPE *Invoke )( __RPC__in __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver *sender, /* [in] */ __RPC__in_opt IInspectable *e); END_INTERFACE } __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectableVtbl; interface __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable { CONST_VTBL struct __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectableVtbl *lpVtbl; }; #ifdef COBJMACROS #define __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_Invoke(This,sender,e) \ ( (This)->lpVtbl -> Invoke(This,sender,e) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0029 */ /* [local] */ #endif /* pinterface */ #endif /* DEF___FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable */ #if !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Perception_Spatial_Surfaces_ISpatialSurfaceInfo[] = L"Windows.Perception.Spatial.Surfaces.ISpatialSurfaceInfo"; #endif /* !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0029 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0029_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0029_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo */ /* [uuid][object] */ /* interface ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceInfo */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { MIDL_INTERFACE("F8E9EBE7-39B7-3962-BB03-57F56E1FB0A1") ISpatialSurfaceInfo : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Id( /* [out][retval] */ __RPC__out GUID *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_UpdateTime( /* [out][retval] */ __RPC__out ABI::Windows::Foundation::DateTime *value) = 0; virtual HRESULT STDMETHODCALLTYPE TryGetBounds( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem *coordinateSystem, /* [out][retval] */ __RPC__deref_out_opt __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox **value) = 0; virtual HRESULT STDMETHODCALLTYPE TryComputeLatestMeshAsync( /* [in] */ DOUBLE maxTrianglesPerCubicMeter, /* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh **value) = 0; virtual HRESULT STDMETHODCALLTYPE TryComputeLatestMeshWithOptionsAsync( /* [in] */ DOUBLE maxTrianglesPerCubicMeter, /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMeshOptions *options, /* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh **value) = 0; }; extern const __declspec(selectany) IID & IID_ISpatialSurfaceInfo = __uuidof(ISpatialSurfaceInfo); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfoVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Id )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [out][retval] */ __RPC__out GUID *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_UpdateTime )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CFoundation_CDateTime *value); HRESULT ( STDMETHODCALLTYPE *TryGetBounds )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialCoordinateSystem *coordinateSystem, /* [out][retval] */ __RPC__deref_out_opt __FIReference_1_Windows__CPerception__CSpatial__CSpatialBoundingOrientedBox **value); HRESULT ( STDMETHODCALLTYPE *TryComputeLatestMeshAsync )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [in] */ DOUBLE maxTrianglesPerCubicMeter, /* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh **value); HRESULT ( STDMETHODCALLTYPE *TryComputeLatestMeshWithOptionsAsync )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo * This, /* [in] */ DOUBLE maxTrianglesPerCubicMeter, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions *options, /* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceMesh **value); END_INTERFACE } __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfoVtbl; interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo { CONST_VTBL struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfoVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_get_Id(This,value) \ ( (This)->lpVtbl -> get_Id(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_get_UpdateTime(This,value) \ ( (This)->lpVtbl -> get_UpdateTime(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_TryGetBounds(This,coordinateSystem,value) \ ( (This)->lpVtbl -> TryGetBounds(This,coordinateSystem,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_TryComputeLatestMeshAsync(This,maxTrianglesPerCubicMeter,value) \ ( (This)->lpVtbl -> TryComputeLatestMeshAsync(This,maxTrianglesPerCubicMeter,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_TryComputeLatestMeshWithOptionsAsync(This,maxTrianglesPerCubicMeter,options,value) \ ( (This)->lpVtbl -> TryComputeLatestMeshWithOptionsAsync(This,maxTrianglesPerCubicMeter,options,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0030 */ /* [local] */ #if !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Perception_Spatial_Surfaces_ISpatialSurfaceMesh[] = L"Windows.Perception.Spatial.Surfaces.ISpatialSurfaceMesh"; #endif /* !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0030 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0030_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0030_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh */ /* [uuid][object] */ /* interface ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMesh */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { MIDL_INTERFACE("108F57D9-DF0D-3950-A0FD-F972C77C27B4") ISpatialSurfaceMesh : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SurfaceInfo( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceInfo **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_CoordinateSystem( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::ISpatialCoordinateSystem **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_TriangleIndices( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMeshBuffer **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VertexPositions( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMeshBuffer **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VertexPositionScale( /* [out][retval] */ __RPC__out ABI::Windows::Foundation::Numerics::Vector3 *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VertexNormals( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMeshBuffer **value) = 0; }; extern const __declspec(selectany) IID & IID_ISpatialSurfaceMesh = __uuidof(ISpatialSurfaceMesh); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SurfaceInfo )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceInfo **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_CoordinateSystem )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialCoordinateSystem **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_TriangleIndices )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VertexPositions )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VertexPositionScale )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CFoundation_CNumerics_CVector3 *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VertexNormals )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer **value); END_INTERFACE } __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshVtbl; interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh { CONST_VTBL struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_get_SurfaceInfo(This,value) \ ( (This)->lpVtbl -> get_SurfaceInfo(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_get_CoordinateSystem(This,value) \ ( (This)->lpVtbl -> get_CoordinateSystem(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_get_TriangleIndices(This,value) \ ( (This)->lpVtbl -> get_TriangleIndices(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_get_VertexPositions(This,value) \ ( (This)->lpVtbl -> get_VertexPositions(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_get_VertexPositionScale(This,value) \ ( (This)->lpVtbl -> get_VertexPositionScale(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_get_VertexNormals(This,value) \ ( (This)->lpVtbl -> get_VertexNormals(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMesh_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0031 */ /* [local] */ #if !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Perception_Spatial_Surfaces_ISpatialSurfaceMeshBuffer[] = L"Windows.Perception.Spatial.Surfaces.ISpatialSurfaceMeshBuffer"; #endif /* !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0031 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0031_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0031_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer */ /* [uuid][object] */ /* interface ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMeshBuffer */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { MIDL_INTERFACE("93CF59E0-871F-33F8-98B2-03D101458F6F") ISpatialSurfaceMeshBuffer : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Format( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::DirectX::DirectXPixelFormat *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Stride( /* [out][retval] */ __RPC__out UINT32 *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ElementCount( /* [out][retval] */ __RPC__out UINT32 *value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Data( /* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Storage::Streams::IBuffer **value) = 0; }; extern const __declspec(selectany) IID & IID_ISpatialSurfaceMeshBuffer = __uuidof(ISpatialSurfaceMeshBuffer); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBufferVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Format )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Stride )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This, /* [out][retval] */ __RPC__out UINT32 *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ElementCount )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This, /* [out][retval] */ __RPC__out UINT32 *value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Data )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer * This, /* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CStorage_CStreams_CIBuffer **value); END_INTERFACE } __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBufferVtbl; interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer { CONST_VTBL struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBufferVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_get_Format(This,value) \ ( (This)->lpVtbl -> get_Format(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_get_Stride(This,value) \ ( (This)->lpVtbl -> get_Stride(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_get_ElementCount(This,value) \ ( (This)->lpVtbl -> get_ElementCount(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_get_Data(This,value) \ ( (This)->lpVtbl -> get_Data(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshBuffer_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0032 */ /* [local] */ #if !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Perception_Spatial_Surfaces_ISpatialSurfaceMeshOptions[] = L"Windows.Perception.Spatial.Surfaces.ISpatialSurfaceMeshOptions"; #endif /* !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0032 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0032_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0032_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions */ /* [uuid][object] */ /* interface ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMeshOptions */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { MIDL_INTERFACE("D2759F89-3572-3D2D-A10D-5FEE9394AA37") ISpatialSurfaceMeshOptions : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VertexPositionFormat( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::DirectX::DirectXPixelFormat *value) = 0; virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_VertexPositionFormat( /* [in] */ ABI::Windows::Graphics::DirectX::DirectXPixelFormat value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_TriangleIndexFormat( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::DirectX::DirectXPixelFormat *value) = 0; virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_TriangleIndexFormat( /* [in] */ ABI::Windows::Graphics::DirectX::DirectXPixelFormat value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_VertexNormalFormat( /* [out][retval] */ __RPC__out ABI::Windows::Graphics::DirectX::DirectXPixelFormat *value) = 0; virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_VertexNormalFormat( /* [in] */ ABI::Windows::Graphics::DirectX::DirectXPixelFormat value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IncludeVertexNormals( /* [out][retval] */ __RPC__out boolean *value) = 0; virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_IncludeVertexNormals( /* [in] */ boolean value) = 0; }; extern const __declspec(selectany) IID & IID_ISpatialSurfaceMeshOptions = __uuidof(ISpatialSurfaceMeshOptions); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VertexPositionFormat )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat *value); /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_VertexPositionFormat )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [in] */ __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_TriangleIndexFormat )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat *value); /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_TriangleIndexFormat )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [in] */ __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_VertexNormalFormat )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [out][retval] */ __RPC__out __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat *value); /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_VertexNormalFormat )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [in] */ __x_ABI_CWindows_CGraphics_CDirectX_CDirectXPixelFormat value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IncludeVertexNormals )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [out][retval] */ __RPC__out boolean *value); /* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_IncludeVertexNormals )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions * This, /* [in] */ boolean value); END_INTERFACE } __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsVtbl; interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions { CONST_VTBL struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_get_VertexPositionFormat(This,value) \ ( (This)->lpVtbl -> get_VertexPositionFormat(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_put_VertexPositionFormat(This,value) \ ( (This)->lpVtbl -> put_VertexPositionFormat(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_get_TriangleIndexFormat(This,value) \ ( (This)->lpVtbl -> get_TriangleIndexFormat(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_put_TriangleIndexFormat(This,value) \ ( (This)->lpVtbl -> put_TriangleIndexFormat(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_get_VertexNormalFormat(This,value) \ ( (This)->lpVtbl -> get_VertexNormalFormat(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_put_VertexNormalFormat(This,value) \ ( (This)->lpVtbl -> put_VertexNormalFormat(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_get_IncludeVertexNormals(This,value) \ ( (This)->lpVtbl -> get_IncludeVertexNormals(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_put_IncludeVertexNormals(This,value) \ ( (This)->lpVtbl -> put_IncludeVertexNormals(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptions_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0033 */ /* [local] */ #if !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Perception_Spatial_Surfaces_ISpatialSurfaceMeshOptionsStatics[] = L"Windows.Perception.Spatial.Surfaces.ISpatialSurfaceMeshOptionsStatics"; #endif /* !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0033 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0033_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0033_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics */ /* [uuid][object] */ /* interface ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceMeshOptionsStatics */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { MIDL_INTERFACE("9B340ABF-9781-4505-8935-013575CAAE5E") ISpatialSurfaceMeshOptionsStatics : public IInspectable { public: virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SupportedVertexPositionFormats( /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SupportedTriangleIndexFormats( /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat **value) = 0; virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SupportedVertexNormalFormats( /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat **value) = 0; }; extern const __declspec(selectany) IID & IID_ISpatialSurfaceMeshOptionsStatics = __uuidof(ISpatialSurfaceMeshOptionsStatics); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStaticsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This, /* [out] */ __RPC__out TrustLevel *trustLevel); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SupportedVertexPositionFormats )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This, /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SupportedTriangleIndexFormats )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This, /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat **value); /* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SupportedVertexNormalFormats )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics * This, /* [out][retval] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CGraphics__CDirectX__CDirectXPixelFormat **value); END_INTERFACE } __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStaticsVtbl; interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics { CONST_VTBL struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStaticsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_get_SupportedVertexPositionFormats(This,value) \ ( (This)->lpVtbl -> get_SupportedVertexPositionFormats(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_get_SupportedTriangleIndexFormats(This,value) \ ( (This)->lpVtbl -> get_SupportedTriangleIndexFormats(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_get_SupportedVertexNormalFormats(This,value) \ ( (This)->lpVtbl -> get_SupportedVertexNormalFormats(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceMeshOptionsStatics_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0034 */ /* [local] */ #if !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Perception_Spatial_Surfaces_ISpatialSurfaceObserver[] = L"Windows.Perception.Spatial.Surfaces.ISpatialSurfaceObserver"; #endif /* !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0034 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0034_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0034_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver */ /* [uuid][object] */ /* interface ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceObserver */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { MIDL_INTERFACE("10B69819-DDCA-3483-AC3A-748FE8C86DF5") ISpatialSurfaceObserver : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE GetObservedSurfaces( /* [out][retval] */ __RPC__deref_out_opt __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **value) = 0; virtual HRESULT STDMETHODCALLTYPE SetBoundingVolume( /* [in] */ __RPC__in_opt ABI::Windows::Perception::Spatial::ISpatialBoundingVolume *bounds) = 0; virtual HRESULT STDMETHODCALLTYPE SetBoundingVolumes( /* [in] */ __RPC__in_opt __FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume *bounds) = 0; virtual HRESULT STDMETHODCALLTYPE add_ObservedSurfacesChanged( /* [in] */ __RPC__in_opt __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable *handler, /* [out][retval] */ __RPC__out EventRegistrationToken *token) = 0; virtual HRESULT STDMETHODCALLTYPE remove_ObservedSurfacesChanged( /* [in] */ EventRegistrationToken token) = 0; }; extern const __declspec(selectany) IID & IID_ISpatialSurfaceObserver = __uuidof(ISpatialSurfaceObserver); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *GetObservedSurfaces )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [out][retval] */ __RPC__deref_out_opt __FIMapView_2_GUID_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceInfo **value); HRESULT ( STDMETHODCALLTYPE *SetBoundingVolume )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [in] */ __RPC__in_opt __x_ABI_CWindows_CPerception_CSpatial_CISpatialBoundingVolume *bounds); HRESULT ( STDMETHODCALLTYPE *SetBoundingVolumes )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [in] */ __RPC__in_opt __FIIterable_1_Windows__CPerception__CSpatial__CSpatialBoundingVolume *bounds); HRESULT ( STDMETHODCALLTYPE *add_ObservedSurfacesChanged )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [in] */ __RPC__in_opt __FITypedEventHandler_2_Windows__CPerception__CSpatial__CSurfaces__CSpatialSurfaceObserver_IInspectable *handler, /* [out][retval] */ __RPC__out EventRegistrationToken *token); HRESULT ( STDMETHODCALLTYPE *remove_ObservedSurfacesChanged )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver * This, /* [in] */ EventRegistrationToken token); END_INTERFACE } __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverVtbl; interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver { CONST_VTBL struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_GetObservedSurfaces(This,value) \ ( (This)->lpVtbl -> GetObservedSurfaces(This,value) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_SetBoundingVolume(This,bounds) \ ( (This)->lpVtbl -> SetBoundingVolume(This,bounds) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_SetBoundingVolumes(This,bounds) \ ( (This)->lpVtbl -> SetBoundingVolumes(This,bounds) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_add_ObservedSurfacesChanged(This,handler,token) \ ( (This)->lpVtbl -> add_ObservedSurfacesChanged(This,handler,token) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_remove_ObservedSurfacesChanged(This,token) \ ( (This)->lpVtbl -> remove_ObservedSurfacesChanged(This,token) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserver_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0035 */ /* [local] */ #if !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Perception_Spatial_Surfaces_ISpatialSurfaceObserverStatics[] = L"Windows.Perception.Spatial.Surfaces.ISpatialSurfaceObserverStatics"; #endif /* !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0035 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0035_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0035_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics */ /* [uuid][object] */ /* interface ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceObserverStatics */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { MIDL_INTERFACE("165951ED-2108-4168-9175-87E027BC9285") ISpatialSurfaceObserverStatics : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE RequestAccessAsync( /* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus **result) = 0; }; extern const __declspec(selectany) IID & IID_ISpatialSurfaceObserverStatics = __uuidof(ISpatialSurfaceObserverStatics); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStaticsVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *RequestAccessAsync )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics * This, /* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CPerception__CSpatial__CSpatialPerceptionAccessStatus **result); END_INTERFACE } __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStaticsVtbl; interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics { CONST_VTBL struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStaticsVtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_RequestAccessAsync(This,result) \ ( (This)->lpVtbl -> RequestAccessAsync(This,result) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0036 */ /* [local] */ #if !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_INTERFACE_DEFINED__) extern const __declspec(selectany) _Null_terminated_ WCHAR InterfaceName_Windows_Perception_Spatial_Surfaces_ISpatialSurfaceObserverStatics2[] = L"Windows.Perception.Spatial.Surfaces.ISpatialSurfaceObserverStatics2"; #endif /* !defined(____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_INTERFACE_DEFINED__) */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0036 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0036_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0036_v0_0_s_ifspec; #ifndef ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_INTERFACE_DEFINED__ #define ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_INTERFACE_DEFINED__ /* interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 */ /* [uuid][object] */ /* interface ABI::Windows::Perception::Spatial::Surfaces::ISpatialSurfaceObserverStatics2 */ /* [uuid][object] */ EXTERN_C const IID IID___x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2; #if defined(__cplusplus) && !defined(CINTERFACE) } /* end extern "C" */ namespace ABI { namespace Windows { namespace Perception { namespace Spatial { namespace Surfaces { MIDL_INTERFACE("0F534261-C55D-4E6B-A895-A19DE69A42E3") ISpatialSurfaceObserverStatics2 : public IInspectable { public: virtual HRESULT STDMETHODCALLTYPE IsSupported( /* [out][retval] */ __RPC__out boolean *value) = 0; }; extern const __declspec(selectany) IID & IID_ISpatialSurfaceObserverStatics2 = __uuidof(ISpatialSurfaceObserverStatics2); } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ } /* end namespace */ extern "C" { #else /* C style interface */ typedef struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 * This, /* [in] */ __RPC__in REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 * This); ULONG ( STDMETHODCALLTYPE *Release )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 * This); HRESULT ( STDMETHODCALLTYPE *GetIids )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 * This, /* [out] */ __RPC__out ULONG *iidCount, /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids); HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 * This, /* [out] */ __RPC__deref_out_opt HSTRING *className); HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 * This, /* [out] */ __RPC__out TrustLevel *trustLevel); HRESULT ( STDMETHODCALLTYPE *IsSupported )( __RPC__in __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 * This, /* [out][retval] */ __RPC__out boolean *value); END_INTERFACE } __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2Vtbl; interface __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2 { CONST_VTBL struct __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_GetIids(This,iidCount,iids) \ ( (This)->lpVtbl -> GetIids(This,iidCount,iids) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_GetRuntimeClassName(This,className) \ ( (This)->lpVtbl -> GetRuntimeClassName(This,className) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_GetTrustLevel(This,trustLevel) \ ( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) ) #define __x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_IsSupported(This,value) \ ( (This)->lpVtbl -> IsSupported(This,value) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* ____x_ABI_CWindows_CPerception_CSpatial_CSurfaces_CISpatialSurfaceObserverStatics2_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0037 */ /* [local] */ #ifndef RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceInfo_DEFINED #define RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceInfo_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Perception_Spatial_Surfaces_SpatialSurfaceInfo[] = L"Windows.Perception.Spatial.Surfaces.SpatialSurfaceInfo"; #endif #ifndef RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMesh_DEFINED #define RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMesh_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMesh[] = L"Windows.Perception.Spatial.Surfaces.SpatialSurfaceMesh"; #endif #ifndef RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMeshBuffer_DEFINED #define RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMeshBuffer_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMeshBuffer[] = L"Windows.Perception.Spatial.Surfaces.SpatialSurfaceMeshBuffer"; #endif #ifndef RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMeshOptions_DEFINED #define RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMeshOptions_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Perception_Spatial_Surfaces_SpatialSurfaceMeshOptions[] = L"Windows.Perception.Spatial.Surfaces.SpatialSurfaceMeshOptions"; #endif #ifndef RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceObserver_DEFINED #define RUNTIMECLASS_Windows_Perception_Spatial_Surfaces_SpatialSurfaceObserver_DEFINED extern const __declspec(selectany) _Null_terminated_ WCHAR RuntimeClass_Windows_Perception_Spatial_Surfaces_SpatialSurfaceObserver[] = L"Windows.Perception.Spatial.Surfaces.SpatialSurfaceObserver"; #endif /* interface __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0037 */ /* [local] */ extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0037_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_windows2Eperception2Espatial2Esurfaces_0000_0037_v0_0_s_ifspec; /* Additional Prototypes for ALL interfaces */ /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif
44.907983
336
0.779429
[ "object" ]
6fe9f64ba5942f7c9c77769830bc8ba7f7afde70
1,438
h
C
src/addons/K2/K2Model.h
wangyanxing/Demi3D
73e684168bd39b894f448779d41fab600ba9b150
[ "MIT" ]
10
2015-03-04T04:27:15.000Z
2020-06-04T14:06:47.000Z
src/addons/K2/K2Model.h
wangyanxing/Demi3D
73e684168bd39b894f448779d41fab600ba9b150
[ "MIT" ]
null
null
null
src/addons/K2/K2Model.h
wangyanxing/Demi3D
73e684168bd39b894f448779d41fab600ba9b150
[ "MIT" ]
5
2015-10-17T19:09:58.000Z
2021-11-15T23:42:18.000Z
/********************************************************************** This source file is a part of Demi3D __ ___ __ __ __ | \|_ |\/|| _)| \ |__/|__| || __)|__/ Copyright (c) 2013-2014 Demi team https://github.com/wangyanxing/Demi3D Released under the MIT License https://github.com/wangyanxing/Demi3D/blob/master/License.txt ***********************************************************************/ #ifndef DiK2Model_h__ #define DiK2Model_h__ #include "K2Prerequisites.h" #include "Model.h" namespace Demi { /** Load a k2 mdf model */ class DEMI_K2_API DiK2Model : public DiModel { public: DiK2Model(const DiString& path); ~DiK2Model(); public: DiK2Animation* GetAnimation() { return mAnimation; } DiK2Skeleton* GetSkeleton() { return mSkeleton; } void Update(DiCamera*); void UpdateAnimation(float delta); private: void Load(const DiString& path); void PostLoad(); private: /// the actual animation sets DiK2Animation* mAnimation; /// the skeleton DiK2Skeleton* mSkeleton { nullptr }; /// full path to this asset folder DiString mName; /// the real data DiK2ModelAssetPtr mAsset; /// Materials DiVector<DiMaterialPtr> mMaterials; }; } #endif
21.147059
72
0.520862
[ "model" ]
6fef154dbaa31a0d4fe5fb1be039df92eac716d9
1,674
h
C
msdfgen.h
drjnmrh/msdfgen
08d798f30960001b065221538880871e64218282
[ "MIT" ]
null
null
null
msdfgen.h
drjnmrh/msdfgen
08d798f30960001b065221538880871e64218282
[ "MIT" ]
null
null
null
msdfgen.h
drjnmrh/msdfgen
08d798f30960001b065221538880871e64218282
[ "MIT" ]
1
2019-01-11T22:17:24.000Z
2019-01-11T22:17:24.000Z
#pragma once /* * MULTI-CHANNEL SIGNED DISTANCE FIELD GENERATOR v1.5 (2017-07-23) * --------------------------------------------------------------- * A utility by Viktor Chlumsky, (c) 2014 - 2017 * * The technique used to generate multi-channel distance fields in this code * has been developed by Viktor Chlumsky in 2014 for his master's thesis, * "Shape Decomposition for Multi-Channel Distance Fields". It provides improved * quality of sharp corners in glyphs and other 2D shapes in comparison to monochrome * distance fields. To reconstruct an image of the shape, apply the median of three * operation on the triplet of sampled distance field values. * */ #include "core/arithmetics.hpp" #include "core/Vector2.h" #include "core/Shape.h" #include "core/Bitmap.h" #include "core/edge-coloring.h" #include "core/render-sdf.h" #include "core/save-bmp.h" #define MSDFGEN_VERSION "1.5.1drjnmrh" namespace msdfgen { /// Generates a conventional single-channel signed distance field. void generateSDF(Bitmap<unsigned char> &output, const Shape &shape, double bound_l, double range, const Vector2 &scale, const Vector2 &translate); /// Gets current version const char* getVersion(); /// Generates a single-channel signed pseudo-distance field. //void generatePseudoSDF(Bitmap<float> &output, const Shape &shape, double range, const Vector2 &scale, const Vector2 &translate); /// Generates a multi-channel signed distance field. Edge colors must be assigned first! (see edgeColoringSimple) //void generateMSDF(Bitmap<FloatRGB> &output, const Shape &shape, double range, const Vector2 &scale, const Vector2 &translate, double edgeThreshold = 1.00000001); }
38.930233
163
0.732975
[ "render", "shape" ]
6ff358a27a374468b2bbe490149a6bed931fa183
13,149
c
C
spa/plugins/v4l2/v4l2-udev.c
dewiweb/pipewire
6e30e71aff1788c921b0ed01123a5d1ac43ff78f
[ "MIT" ]
null
null
null
spa/plugins/v4l2/v4l2-udev.c
dewiweb/pipewire
6e30e71aff1788c921b0ed01123a5d1ac43ff78f
[ "MIT" ]
null
null
null
spa/plugins/v4l2/v4l2-udev.c
dewiweb/pipewire
6e30e71aff1788c921b0ed01123a5d1ac43ff78f
[ "MIT" ]
null
null
null
/* Spa V4l2 udev monitor * * Copyright © 2018 Wim Taymans * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include <errno.h> #include <stddef.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <libudev.h> #include <spa/support/log.h> #include <spa/support/loop.h> #include <spa/support/plugin.h> #include <spa/utils/type.h> #include <spa/utils/keys.h> #include <spa/utils/names.h> #include <spa/monitor/device.h> #include <spa/monitor/utils.h> #define NAME "v4l2-udev" struct impl { struct spa_handle handle; struct spa_device device; struct spa_log *log; struct spa_loop *main_loop; struct spa_hook_list hooks; uint64_t info_all; struct spa_device_info info; struct udev *udev; struct udev_monitor *umonitor; struct spa_source source; }; static int impl_udev_open(struct impl *this) { if (this->udev == NULL) { this->udev = udev_new(); if (this->udev == NULL) return -ENOMEM; } return 0; } static int impl_udev_close(struct impl *this) { if (this->udev != NULL) udev_unref(this->udev); this->udev = NULL; return 0; } static uint32_t get_device_id(struct impl *this, struct udev_device *dev) { const char *str; if ((str = udev_device_get_devnode(dev)) == NULL) return SPA_ID_INVALID; if (!(str = strrchr(str, '/'))) return SPA_ID_INVALID; if (strlen(str) <= 6 || strncmp(str, "/video", 6) != 0) return SPA_ID_INVALID; return atoi(str + 6); } static int dehex(char x) { if (x >= '0' && x <= '9') return x - '0'; if (x >= 'A' && x <= 'F') return x - 'A' + 10; if (x >= 'a' && x <= 'f') return x - 'a' + 10; return -1; } static void unescape(const char *src, char *dst) { const char *s; char *d; int h1, h2; enum { TEXT, BACKSLASH, EX, FIRST } state = TEXT; for (s = src, d = dst; *s; s++) { switch (state) { case TEXT: if (*s == '\\') state = BACKSLASH; else *(d++) = *s; break; case BACKSLASH: if (*s == 'x') state = EX; else { *(d++) = '\\'; *(d++) = *s; state = TEXT; } break; case EX: h1 = dehex(*s); if (h1 < 0) { *(d++) = '\\'; *(d++) = 'x'; *(d++) = *s; state = TEXT; } else state = FIRST; break; case FIRST: h2 = dehex(*s); if (h2 < 0) { *(d++) = '\\'; *(d++) = 'x'; *(d++) = *(s-1); *(d++) = *s; } else *(d++) = (char) (h1 << 4) | h2; state = TEXT; break; } } switch (state) { case TEXT: break; case BACKSLASH: *(d++) = '\\'; break; case EX: *(d++) = '\\'; *(d++) = 'x'; break; case FIRST: *(d++) = '\\'; *(d++) = 'x'; *(d++) = *(s-1); break; } *d = 0; } static int emit_object_info(struct impl *this, uint32_t id, struct udev_device *dev) { struct spa_device_object_info info; const char *str; struct spa_dict_item items[20]; uint32_t n_items = 0; info = SPA_DEVICE_OBJECT_INFO_INIT(); info.type = SPA_TYPE_INTERFACE_Device; info.factory_name = SPA_NAME_API_V4L2_DEVICE; info.change_mask = SPA_DEVICE_OBJECT_CHANGE_MASK_FLAGS | SPA_DEVICE_OBJECT_CHANGE_MASK_PROPS; info.flags = 0; items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_ENUM_API,"udev"); items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_API, "v4l2"); items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_MEDIA_CLASS, "Video/Device"); items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_API_V4L2_PATH, udev_device_get_devnode(dev)); if ((str = udev_device_get_property_value(dev, "USEC_INITIALIZED")) && *str) items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PLUGGED_USEC, str); str = udev_device_get_property_value(dev, "ID_PATH"); if (!(str && *str)) str = udev_device_get_syspath(dev); if (str && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_BUS_PATH, str); } if ((str = udev_device_get_syspath(dev)) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SYSFS_PATH, str); } if ((str = udev_device_get_property_value(dev, "ID_ID")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_BUS_ID, str); } if ((str = udev_device_get_property_value(dev, "ID_BUS")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_BUS, str); } if ((str = udev_device_get_property_value(dev, "SUBSYSTEM")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SUBSYSTEM, str); } if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, str); } str = udev_device_get_property_value(dev, "ID_VENDOR_FROM_DATABASE"); if (!(str && *str)) { str = udev_device_get_property_value(dev, "ID_VENDOR_ENC"); if (!(str && *str)) { str = udev_device_get_property_value(dev, "ID_VENDOR"); } else { char *t = alloca(strlen(str) + 1); unescape(str, t); str = t; } } if (str && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_NAME, str); } if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, str); } str = udev_device_get_property_value(dev, "ID_V4L_PRODUCT"); if (!(str && *str)) { str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE"); if (!(str && *str)) { str = udev_device_get_property_value(dev, "ID_MODEL_ENC"); if (!(str && *str)) { str = udev_device_get_property_value(dev, "ID_MODEL"); } else { char *t = alloca(strlen(str) + 1); unescape(str, t); str = t; } } } if (str && *str) items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_NAME, str); if ((str = udev_device_get_property_value(dev, "ID_SERIAL")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SERIAL, str); } if ((str = udev_device_get_property_value(dev, "ID_V4L_CAPABILITIES")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_CAPABILITIES, str); } info.props = &SPA_DICT_INIT(items, n_items); spa_device_emit_object_info(&this->hooks, id, &info); return 1; } static void impl_on_fd_events(struct spa_source *source) { struct impl *this = source->data; struct udev_device *dev; const char *action; uint32_t id; dev = udev_monitor_receive_device(this->umonitor); if (dev == NULL) return; if ((id = get_device_id(this, dev)) == SPA_ID_INVALID) return; if ((action = udev_device_get_action(dev)) == NULL) action = "change"; if (strcmp(action, "add") == 0 || strcmp(action, "change") == 0) { emit_object_info(this, id, dev); } else { spa_device_emit_object_info(&this->hooks, id, NULL); } udev_device_unref(dev); } static int start_monitor(struct impl *this) { if (this->umonitor != NULL) return 0; this->umonitor = udev_monitor_new_from_netlink(this->udev, "udev"); if (this->umonitor == NULL) return -ENOMEM; udev_monitor_filter_add_match_subsystem_devtype(this->umonitor, "video4linux", NULL); udev_monitor_enable_receiving(this->umonitor); this->source.func = impl_on_fd_events; this->source.data = this; this->source.fd = udev_monitor_get_fd(this->umonitor);; this->source.mask = SPA_IO_IN | SPA_IO_ERR; spa_log_debug(this->log, "monitor %p", this->umonitor); spa_loop_add_source(this->main_loop, &this->source); return 0; } static int stop_monitor(struct impl *this) { if (this->umonitor == NULL) return 0; spa_loop_remove_source(this->main_loop, &this->source); udev_monitor_unref(this->umonitor); this->umonitor = NULL; return 0; } static int enum_devices(struct impl *this) { struct udev_enumerate *enumerate; struct udev_list_entry *devices; enumerate = udev_enumerate_new(this->udev); if (enumerate == NULL) return -ENOMEM; udev_enumerate_add_match_subsystem(enumerate, "video4linux"); udev_enumerate_scan_devices(enumerate); for (devices = udev_enumerate_get_list_entry(enumerate); devices; devices = udev_list_entry_get_next(devices)) { struct udev_device *dev; uint32_t id; dev = udev_device_new_from_syspath(this->udev, udev_list_entry_get_name(devices)); if (dev == NULL) continue; if ((id = get_device_id(this, dev)) != SPA_ID_INVALID) emit_object_info(this, id, dev); udev_device_unref(dev); } udev_enumerate_unref(enumerate); return 0; } static const struct spa_dict_item device_info_items[] = { { SPA_KEY_DEVICE_API, "udev" }, { SPA_KEY_DEVICE_NICK, "v4l2-udev" }, { SPA_KEY_API_UDEV_MATCH, "video4linux" }, }; static void emit_device_info(struct impl *this, bool full) { if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(device_info_items); spa_device_emit_info(&this->hooks, &this->info); this->info.change_mask = 0; } } static void impl_hook_removed(struct spa_hook *hook) { struct impl *this = hook->priv; if (spa_hook_list_is_empty(&this->hooks)) { stop_monitor(this); impl_udev_close(this); } } static int impl_device_add_listener(void *object, struct spa_hook *listener, const struct spa_device_events *events, void *data) { int res; struct impl *this = object; struct spa_hook_list save; spa_return_val_if_fail(this != NULL, -EINVAL); spa_return_val_if_fail(events != NULL, -EINVAL); if ((res = impl_udev_open(this)) < 0) return res; spa_hook_list_isolate(&this->hooks, &save, listener, events, data); emit_device_info(this, true); if ((res = enum_devices(this)) < 0) return res; if ((res = start_monitor(this)) < 0) return res; spa_hook_list_join(&this->hooks, &save); listener->removed = impl_hook_removed; listener->priv = this; return 0; } static const struct spa_device_methods impl_device = { SPA_VERSION_DEVICE_METHODS, .add_listener = impl_device_add_listener, }; static int impl_get_interface(struct spa_handle *handle, const char *type, void **interface) { struct impl *this; spa_return_val_if_fail(handle != NULL, -EINVAL); spa_return_val_if_fail(interface != NULL, -EINVAL); this = (struct impl *) handle; if (strcmp(type, SPA_TYPE_INTERFACE_Device) == 0) *interface = &this->device; else return -ENOENT; return 0; } static int impl_clear(struct spa_handle *handle) { struct impl *this = (struct impl *) handle; stop_monitor(this); impl_udev_close(this); return 0; } static size_t impl_get_size(const struct spa_handle_factory *factory, const struct spa_dict *params) { return sizeof(struct impl); } static int impl_init(const struct spa_handle_factory *factory, struct spa_handle *handle, const struct spa_dict *info, const struct spa_support *support, uint32_t n_support) { struct impl *this; spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(handle != NULL, -EINVAL); handle->get_interface = impl_get_interface; handle->clear = impl_clear; this = (struct impl *) handle; this->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log); this->main_loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Loop); if (this->main_loop == NULL) { spa_log_error(this->log, "a main-loop is needed"); return -EINVAL; } spa_hook_list_init(&this->hooks); this->device.iface = SPA_INTERFACE_INIT( SPA_TYPE_INTERFACE_Device, SPA_VERSION_DEVICE, &impl_device, this); this->info = SPA_DEVICE_INFO_INIT(); this->info_all = SPA_DEVICE_CHANGE_MASK_FLAGS | SPA_DEVICE_CHANGE_MASK_PROPS; this->info.flags = 0; return 0; } static const struct spa_interface_info impl_interfaces[] = { {SPA_TYPE_INTERFACE_Device,}, }; static int impl_enum_interface_info(const struct spa_handle_factory *factory, const struct spa_interface_info **info, uint32_t *index) { spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(info != NULL, -EINVAL); spa_return_val_if_fail(index != NULL, -EINVAL); if (*index >= SPA_N_ELEMENTS(impl_interfaces)) return 0; *info = &impl_interfaces[(*index)++]; return 1; } const struct spa_handle_factory spa_v4l2_udev_factory = { SPA_VERSION_HANDLE_FACTORY, SPA_NAME_API_V4L2_ENUM_UDEV, NULL, impl_get_size, impl_init, impl_enum_interface_info, };
25.093511
92
0.692676
[ "object" ]
6ff8acdab5bfd8e89b2607f47d0a3dbac1000657
7,347
h
C
src/gss.h
roost-im/node-gss
62c94fcdfaff1ca0bd8ae24c4b381a9be36b3c33
[ "MIT" ]
null
null
null
src/gss.h
roost-im/node-gss
62c94fcdfaff1ca0bd8ae24c4b381a9be36b3c33
[ "MIT" ]
null
null
null
src/gss.h
roost-im/node-gss
62c94fcdfaff1ca0bd8ae24c4b381a9be36b3c33
[ "MIT" ]
1
2019-10-03T18:59:35.000Z
2019-10-03T18:59:35.000Z
#ifndef NODE_GSS_GSS_H_ #define NODE_GSS_GSS_H_ #include <vector> #include <node.h> #include <node_buffer.h> #include <v8.h> #include <gssapi/gssapi.h> #include <gssapi/gssapi_krb5.h> namespace node_gss { template <class T> OM_uint32 NoopDeleter(OM_uint32* minor_status, T* obj) { return GSS_S_COMPLETE; } // This code assumes GSS_C_NO_CONTEXT, etc., are all 0. It seems C++ // doesn't like passing them as template arguments. template <class T, OM_uint32 (*Deleter)(OM_uint32*, T*) = NoopDeleter<T> > class GssHandle : public node::ObjectWrap { public: static void Init(v8::Handle<v8::Object> exports, const char* ctor) { v8::Local<v8::FunctionTemplate> tpl = v8::FunctionTemplate::New(New); tpl->SetClassName(v8::String::NewSymbol(ctor)); tpl->InstanceTemplate()->SetInternalFieldCount(1); tpl->PrototypeTemplate()->Set( v8::String::NewSymbol("isNull"), v8::FunctionTemplate::New(IsNull)->GetFunction()); exports->Set(v8::String::NewSymbol(ctor), tpl->GetFunction()); template_ = v8::Persistent<v8::FunctionTemplate>::New(tpl); } static GssHandle* New(T gss_obj = NULL) { v8::HandleScope scope; v8::Local<v8::Object> obj = template_->GetFunction()->NewInstance(); if (obj.IsEmpty()) return NULL; GssHandle* handle = ObjectWrap::Unwrap<GssHandle>(obj); handle->gss_obj_ = gss_obj; return handle; } static bool HasInstance(v8::Handle<v8::Value> value) { if (!value->IsObject()) return false; return template_->HasInstance(value->ToObject()); } const T& get() const { return gss_obj_; } T& get() { return gss_obj_; } private: static v8::Persistent<v8::FunctionTemplate> template_; GssHandle() : gss_obj_(0) { } ~GssHandle() { if (gss_obj_) { OM_uint32 dummy; // TODO(davidben): Check output and print something to stderr? // Shouldn't actually happen, but... Deleter(&dummy, &gss_obj_); } } static v8::Handle<v8::Value> New(const v8::Arguments& args) { v8::HandleScope scope; GssHandle* obj = new GssHandle(); obj->Wrap(args.This()); return args.This(); } static v8::Handle<v8::Value> IsNull(const v8::Arguments& args) { v8::HandleScope scope; if (!HasInstance(args.This())) { v8::ThrowException(v8::Exception::TypeError(v8::String::New( "Bad this pointer"))); return scope.Close(v8::Undefined()); } GssHandle* obj = node::ObjectWrap::Unwrap<GssHandle>(args.This()); return scope.Close(v8::Boolean::New(obj->gss_obj_ == NULL)); } T gss_obj_; }; template <class T, OM_uint32 (*Deleter)(OM_uint32*, T*)> v8::Persistent<v8::FunctionTemplate> GssHandle<T, Deleter>::template_; inline OM_uint32 ContextDeleter(OM_uint32* minor_status, gss_ctx_id_t* ctx) { return gss_delete_sec_context(minor_status, ctx, GSS_C_NO_BUFFER); } inline OM_uint32 OwnOidDeleter(OM_uint32* minor_status, gss_OID* oid) { delete[] static_cast<char*>((*oid)->elements); delete (*oid); *oid = GSS_C_NO_OID; return GSS_S_COMPLETE; } typedef GssHandle<gss_ctx_id_t, ContextDeleter> ContextHandle; typedef GssHandle<gss_cred_id_t, gss_release_cred> CredHandle; typedef GssHandle<gss_name_t, gss_release_name> NameHandle; // OIDs in GSSAPI are really annoying. Some are owned by the library // and static. But the ones in a gss_OID_set are dynamic. For sanity, // make a copy of those. In that case, we own them. // // TODO(davidben): This is silly. Makes more sense just to // unconditionally copy and own all our own OIDs. typedef GssHandle<gss_OID> OidHandle; typedef GssHandle<gss_OID, OwnOidDeleter> OwnOidHandle; // A bunch of macros for extracting types. #define BUFFER_ARGUMENT(index, name) \ gss_buffer_desc name; \ if (!NodeBufferAsGssBuffer(args[index], &name)) { \ v8::ThrowException(v8::Exception::TypeError(v8::String::New( \ "Expected Buffer as argument " #index))); \ return scope.Close(v8::Undefined()); \ } // This one is all kinds of special... #define OID_ARGUMENT(index, name) \ gss_OID name; \ if (OidHandle::HasInstance(args[index])) { \ name = node::ObjectWrap::Unwrap<OidHandle>( \ args[index]->ToObject())->get(); \ } else if (OwnOidHandle::HasInstance(args[index])) { \ name = node::ObjectWrap::Unwrap<OwnOidHandle>( \ args[index]->ToObject())->get(); \ } else if (args[index]->IsNull() || args[index]->IsUndefined()) { \ name = GSS_C_NO_OID; \ } else { \ v8::ThrowException(v8::Exception::TypeError(v8::String::New( \ "Expected OID as argument " #index))); \ return scope.Close(v8::Undefined()); \ } #define OID_SET_ARGUMENT(index, name) \ scoped_OID_set name; \ if (!ObjectToOidSet(args[index], &name)) { \ v8::ThrowException(v8::Exception::TypeError(v8::String::New( \ "Expected OID array as argument " #index))); \ return scope.Close(v8::Undefined()); \ } #define HANDLE_ARGUMENT(index, type, name) \ if (!type::HasInstance(args[index])) { \ v8::ThrowException(v8::Exception::TypeError(v8::String::New( \ "Expected " #type " as argument " #index))); \ return scope.Close(v8::Undefined()); \ } \ type* name = node::ObjectWrap::Unwrap<type>(args[index]->ToObject()); // RAII-ish gss_OID_set for temporaries we create. DOES NOT OWN ALL // IT'S DATA. In particular, the elements pointers of the individual // OIDs in the set are unowned. User must ensure they last long // enough. class scoped_OID_set { public: scoped_OID_set() { Update(); } void Append(gss_OID oid) { data_.push_back(*oid); Update(); } gss_OID_set oid_set() { return &oid_set_; } private: void Update() { oid_set_.count = data_.size(); oid_set_.elements = data_.empty() ? NULL : &data_[0]; } gss_OID_set_desc oid_set_; std::vector<gss_OID_desc> data_; }; bool ObjectToOidSet(v8::Handle<v8::Value> value, scoped_OID_set* out); v8::Local<v8::Array> OidSetToArray(gss_OID_set oid_set); bool NodeBufferAsGssBuffer(v8::Handle<v8::Value> value, gss_buffer_t out); // Various initialization functions. Groups by how functions are // organized in Section 2 of RFC2744 void ContextInit(v8::Handle<v8::Object> exports); void MessageInit(v8::Handle<v8::Object> exports); void CredInit(v8::Handle<v8::Object> exports); void NameInit(v8::Handle<v8::Object> exports); void MiscInit(v8::Handle<v8::Object> exports); } // namespace node_gss #endif // NODE_GSS_GSS_H_
37.484694
74
0.59902
[ "object", "vector" ]
6fff9174d2f247c546c140db13824564a040dd54
36,244
c
C
oocairo.c
osch/oocairo
a1d8efa420eb6c53d86c2ad9750c976829080656
[ "MIT" ]
17
2015-04-02T16:41:44.000Z
2021-09-22T08:12:58.000Z
oocairo.c
osch/oocairo
a1d8efa420eb6c53d86c2ad9750c976829080656
[ "MIT" ]
9
2015-04-02T17:34:30.000Z
2019-12-14T20:53:26.000Z
oocairo.c
osch/oocairo
a1d8efa420eb6c53d86c2ad9750c976829080656
[ "MIT" ]
6
2015-04-02T16:41:52.000Z
2021-10-20T22:31:10.000Z
/* Copyright (C) 2007-2008 Geoff Richards * Copyright (C) 2010-2011 Uli Schlachter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "oocairo.h" #include <cairo.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <assert.h> #ifdef CAIRO_HAS_PDF_SURFACE #include <cairo-pdf.h> #endif #ifdef CAIRO_HAS_PS_SURFACE #include <cairo-ps.h> #endif #ifdef CAIRO_HAS_SVG_SURFACE #include <cairo-svg.h> #endif #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 6, 0) #error "This Lua binding requires Cairo version 1.6 or better." #endif #if LUA_VERSION_NUM >= 502 #define lua_objlen(a, b) lua_rawlen(a, b) static int luaL_typerror (lua_State *L, int narg, const char *tname) { const char *msg = lua_pushfstring(L, "%s expected, got %s", tname, luaL_typename(L, narg)); return luaL_argerror(L, narg, msg); } #else #define lua_rawlen(a, b) do_not_use_lua_rawlen_use_lua_objlen_instead; #endif #if LUA_VERSION_NUM >= 503 #define oocairo_lua_isinteger(L, idx) lua_isinteger(L, idx) #else #define oocairo_lua_isinteger(L, idx) lua_isnumber(L, idx) #endif static const int ENDIANNESS_TEST_VAL = 1; #define IS_BIG_ENDIAN (!(*(const char *) &ENDIANNESS_TEST_VAL)) #define ENUM_VAL_TO_LUA_STRING_FUNC(type) \ static int \ type ## _to_lua (lua_State *L, cairo_ ## type ## _t val) { \ int i; \ for (i = 0; type ## _names[i]; ++i) { \ if (val == type ## _values[i]) { \ lua_pushstring(L, type ## _names[i]); \ return 1; \ } \ } \ return 0; \ } #define ENUM_VAL_FROM_LUA_STRING_FUNC(type) \ static cairo_ ## type ## _t \ type ## _from_lua (lua_State *L, int pos) { \ return type ## _values[luaL_checkoption(L, pos, 0, type ## _names)]; \ } static const char * const format_names[] = { "argb32", "rgb24", "a8", "a1", 0 }; static const cairo_format_t format_values[] = { CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_RGB24, CAIRO_FORMAT_A8, CAIRO_FORMAT_A1 }; ENUM_VAL_TO_LUA_STRING_FUNC(format) ENUM_VAL_FROM_LUA_STRING_FUNC(format) static const char * const antialias_names[] = { "default", "none", "gray", "subpixel", 0 }; static const cairo_antialias_t antialias_values[] = { CAIRO_ANTIALIAS_DEFAULT, CAIRO_ANTIALIAS_NONE, CAIRO_ANTIALIAS_GRAY, CAIRO_ANTIALIAS_SUBPIXEL }; ENUM_VAL_TO_LUA_STRING_FUNC(antialias) static cairo_antialias_t antialias_from_lua (lua_State *L, int pos) { if (lua_isboolean(L, pos)) /* A boolean value is interpreted as a signal to turn AA on or off. */ return lua_toboolean(L, pos) ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE; else return antialias_values[luaL_checkoption(L, pos, 0, antialias_names)]; } static const char * const subpixel_order_names[] = { "default", "rgb", "bgr", "vrgb", "vbgr", 0 }; static const cairo_subpixel_order_t subpixel_order_values[] = { CAIRO_SUBPIXEL_ORDER_DEFAULT, CAIRO_SUBPIXEL_ORDER_RGB, CAIRO_SUBPIXEL_ORDER_BGR, CAIRO_SUBPIXEL_ORDER_VRGB, CAIRO_SUBPIXEL_ORDER_VBGR }; ENUM_VAL_TO_LUA_STRING_FUNC(subpixel_order) ENUM_VAL_FROM_LUA_STRING_FUNC(subpixel_order) static const char * const hint_style_names[] = { "default", "none", "slight", "medium", "full", 0 }; static const cairo_hint_style_t hint_style_values[] = { CAIRO_HINT_STYLE_DEFAULT, CAIRO_HINT_STYLE_NONE, CAIRO_HINT_STYLE_SLIGHT, CAIRO_HINT_STYLE_MEDIUM, CAIRO_HINT_STYLE_FULL }; ENUM_VAL_TO_LUA_STRING_FUNC(hint_style) ENUM_VAL_FROM_LUA_STRING_FUNC(hint_style) static const char * const hint_metrics_names[] = { "default", "off", "on", 0 }; static const cairo_hint_metrics_t hint_metrics_values[] = { CAIRO_HINT_METRICS_DEFAULT, CAIRO_HINT_METRICS_OFF, CAIRO_HINT_METRICS_ON }; ENUM_VAL_TO_LUA_STRING_FUNC(hint_metrics) ENUM_VAL_FROM_LUA_STRING_FUNC(hint_metrics) static const char * const line_cap_names[] = { "butt", "round", "square", 0 }; static const cairo_line_cap_t line_cap_values[] = { CAIRO_LINE_CAP_BUTT, CAIRO_LINE_CAP_ROUND, CAIRO_LINE_CAP_SQUARE }; ENUM_VAL_TO_LUA_STRING_FUNC(line_cap) ENUM_VAL_FROM_LUA_STRING_FUNC(line_cap) static const char * const line_join_names[] = { "miter", "round", "bevel", 0 }; static const cairo_line_join_t line_join_values[] = { CAIRO_LINE_JOIN_MITER, CAIRO_LINE_JOIN_ROUND, CAIRO_LINE_JOIN_BEVEL }; ENUM_VAL_TO_LUA_STRING_FUNC(line_join) ENUM_VAL_FROM_LUA_STRING_FUNC(line_join) static const char * const fill_rule_names[] = { "winding", "even-odd", 0 }; static const cairo_fill_rule_t fill_rule_values[] = { CAIRO_FILL_RULE_WINDING, CAIRO_FILL_RULE_EVEN_ODD }; ENUM_VAL_TO_LUA_STRING_FUNC(fill_rule) ENUM_VAL_FROM_LUA_STRING_FUNC(fill_rule) static const char * const operator_names[] = { "clear", "source", "over", "in", "out", "atop", "dest", "dest-over", "dest-in", "dest-out", "dest-atop", "xor", "add", "saturate", #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hsl-hue", "hsl-saturation", "hsl-color", "hsl-luminosity", #endif 0 }; static const cairo_operator_t operator_values[] = { CAIRO_OPERATOR_CLEAR, CAIRO_OPERATOR_SOURCE, CAIRO_OPERATOR_OVER, CAIRO_OPERATOR_IN, CAIRO_OPERATOR_OUT, CAIRO_OPERATOR_ATOP, CAIRO_OPERATOR_DEST, CAIRO_OPERATOR_DEST_OVER, CAIRO_OPERATOR_DEST_IN, CAIRO_OPERATOR_DEST_OUT, CAIRO_OPERATOR_DEST_ATOP, CAIRO_OPERATOR_XOR, CAIRO_OPERATOR_ADD, #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0) CAIRO_OPERATOR_SATURATE #else CAIRO_OPERATOR_SATURATE, CAIRO_OPERATOR_MULTIPLY, CAIRO_OPERATOR_SCREEN, CAIRO_OPERATOR_OVERLAY, CAIRO_OPERATOR_DARKEN, CAIRO_OPERATOR_LIGHTEN, CAIRO_OPERATOR_COLOR_DODGE, CAIRO_OPERATOR_COLOR_BURN, CAIRO_OPERATOR_HARD_LIGHT, CAIRO_OPERATOR_SOFT_LIGHT, CAIRO_OPERATOR_DIFFERENCE, CAIRO_OPERATOR_EXCLUSION, CAIRO_OPERATOR_HSL_HUE, CAIRO_OPERATOR_HSL_SATURATION, CAIRO_OPERATOR_HSL_COLOR, CAIRO_OPERATOR_HSL_LUMINOSITY #endif }; ENUM_VAL_TO_LUA_STRING_FUNC(operator) ENUM_VAL_FROM_LUA_STRING_FUNC(operator) static const char * const content_names[] = { "color", "alpha", "color-alpha", 0 }; static const cairo_content_t content_values[] = { CAIRO_CONTENT_COLOR, CAIRO_CONTENT_ALPHA, CAIRO_CONTENT_COLOR_ALPHA }; ENUM_VAL_TO_LUA_STRING_FUNC(content) ENUM_VAL_FROM_LUA_STRING_FUNC(content) static const char * const extend_names[] = { "none", "repeat", "reflect", "pad", 0 }; static const cairo_extend_t extend_values[] = { CAIRO_EXTEND_NONE, CAIRO_EXTEND_REPEAT, CAIRO_EXTEND_REFLECT, CAIRO_EXTEND_PAD }; ENUM_VAL_TO_LUA_STRING_FUNC(extend) ENUM_VAL_FROM_LUA_STRING_FUNC(extend) static const char * const filter_names[] = { "fast", "good", "best", "nearest", "bilinear", "gaussian", 0 }; static const cairo_filter_t filter_values[] = { CAIRO_FILTER_FAST, CAIRO_FILTER_GOOD, CAIRO_FILTER_BEST, CAIRO_FILTER_NEAREST, CAIRO_FILTER_BILINEAR, CAIRO_FILTER_GAUSSIAN }; ENUM_VAL_TO_LUA_STRING_FUNC(filter) ENUM_VAL_FROM_LUA_STRING_FUNC(filter) static const char * const font_slant_names[] = { "normal", "italic", "oblique", 0 }; static const cairo_font_slant_t font_slant_values[] = { CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_SLANT_OBLIQUE }; ENUM_VAL_TO_LUA_STRING_FUNC(font_slant) ENUM_VAL_FROM_LUA_STRING_FUNC(font_slant) static const char * const font_weight_names[] = { "normal", "bold", 0 }; static const cairo_font_weight_t font_weight_values[] = { CAIRO_FONT_WEIGHT_NORMAL, CAIRO_FONT_WEIGHT_BOLD }; ENUM_VAL_TO_LUA_STRING_FUNC(font_weight) ENUM_VAL_FROM_LUA_STRING_FUNC(font_weight) static const char * const font_type_names[] = { "toy", "ft", "win32", "quartz", #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0) "user", #endif 0 }; static const cairo_font_type_t font_type_values[] = { CAIRO_FONT_TYPE_TOY, CAIRO_FONT_TYPE_FT, CAIRO_FONT_TYPE_WIN32, CAIRO_FONT_TYPE_QUARTZ, #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0) CAIRO_FONT_TYPE_USER, #endif }; ENUM_VAL_TO_LUA_STRING_FUNC(font_type) static const char * const surface_type_names[] = { "image", "pdf", "ps", "xlib", "xcb", "glitz", "quartz", "win32", "beos", "directfb", "svg", "os2", "win32-printing", "quartz-image", #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) "script", "qt", "recording", "vg", "gl", "drm", "tee", "xml", "skia", "subsurface", #endif 0 }; static const cairo_surface_type_t surface_type_values[] = { CAIRO_SURFACE_TYPE_IMAGE, CAIRO_SURFACE_TYPE_PDF, CAIRO_SURFACE_TYPE_PS, CAIRO_SURFACE_TYPE_XLIB, CAIRO_SURFACE_TYPE_XCB, CAIRO_SURFACE_TYPE_GLITZ, CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_SURFACE_TYPE_WIN32, CAIRO_SURFACE_TYPE_BEOS, CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_SURFACE_TYPE_SVG, CAIRO_SURFACE_TYPE_OS2, CAIRO_SURFACE_TYPE_WIN32_PRINTING, #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0) CAIRO_SURFACE_TYPE_QUARTZ_IMAGE #else CAIRO_SURFACE_TYPE_QUARTZ_IMAGE, CAIRO_SURFACE_TYPE_SCRIPT, CAIRO_SURFACE_TYPE_QT, CAIRO_SURFACE_TYPE_RECORDING, CAIRO_SURFACE_TYPE_VG, CAIRO_SURFACE_TYPE_GL, CAIRO_SURFACE_TYPE_DRM, CAIRO_SURFACE_TYPE_TEE, CAIRO_SURFACE_TYPE_XML, CAIRO_SURFACE_TYPE_SKIA, CAIRO_SURFACE_TYPE_SUBSURFACE, #endif }; ENUM_VAL_TO_LUA_STRING_FUNC(surface_type) #if defined(CAIRO_HAS_PDF_SURFACE) && CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) static const char *pdf_version_names[] = { "1.4", "1.5", 0 }; static const cairo_pdf_version_t pdf_version_values[] = { CAIRO_PDF_VERSION_1_4, CAIRO_PDF_VERSION_1_5 }; ENUM_VAL_FROM_LUA_STRING_FUNC(pdf_version) #endif #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) static const char *region_overlap_names[] = { "overlap-in", "overlap-out", "overlap-part", 0 }; static const cairo_region_overlap_t region_overlap_values[] = { CAIRO_REGION_OVERLAP_IN, CAIRO_REGION_OVERLAP_OUT, CAIRO_REGION_OVERLAP_PART }; ENUM_VAL_TO_LUA_STRING_FUNC(region_overlap) #endif static void to_lua_matrix (lua_State *L, cairo_matrix_t *mat, int pos) { double *matnums; int i; matnums = (double *) mat; for (i = 0; i < 6; ++i) { lua_pushnumber(L, matnums[i]); lua_rawseti(L, pos, i + 1); } } static void create_lua_matrix (lua_State *L, cairo_matrix_t *mat) { lua_createtable(L, 6, 0); to_lua_matrix(L, mat, lua_gettop(L)); luaL_getmetatable(L, OOCAIRO_MT_NAME_MATRIX); lua_setmetatable(L, -2); } static void from_lua_matrix (lua_State *L, cairo_matrix_t *mat, int pos) { double *matnums; int i; luaL_checktype(L, pos, LUA_TTABLE); matnums = (double *) mat; for (i = 0; i < 6; ++i) { lua_rawgeti(L, pos, i + 1); if (!lua_isnumber(L, -1)) luaL_error(L, "value %d in matrix isn't a number", i + 1); matnums[i] = lua_tonumber(L, -1); lua_pop(L, 1); } } #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) static int to_lua_rectangle (lua_State *L, cairo_rectangle_int_t *rect) { lua_newtable(L); #define DO(t) \ lua_pushstring(L, #t); \ lua_pushnumber(L, rect->t); \ lua_settable(L, -3) DO(x); DO(y); DO(width); DO(height); #undef DO return 1; } static void from_lua_rectangle (lua_State *L, cairo_rectangle_int_t *rect, int pos) { luaL_checktype(L, pos, LUA_TTABLE); #define DO(t) \ lua_pushstring(L, #t); \ lua_gettable(L, pos); \ if (!oocairo_lua_isinteger(L, -1)) { \ luaL_argerror(L, pos, "invalid rectangle: coordinates must be integer values"); \ } \ rect->t = lua_tointeger(L, -1); \ lua_pop(L, 1) DO(x); DO(y); DO(width); DO(height); #undef DO } static void from_lua_rectangle_list_element (lua_State *L, cairo_rectangle_int_t *rect, int list_pos, int element_index) { lua_rawgeti(L, list_pos, element_index); /* push rectangle from list */ if (lua_type(L, -1) != LUA_TTABLE) { luaL_argerror(L, list_pos, "list contains invalid rectangle"); } #define DO(t) \ lua_pushstring(L, #t); \ lua_gettable(L, -2); \ if (!oocairo_lua_isinteger(L, -1)) { \ luaL_argerror(L, list_pos, "list contains invalid rectangle: coordinates must be integer values"); \ } \ rect->t = lua_tointeger(L, -1); \ lua_pop(L, 1) DO(x); DO(y); DO(width); DO(height); lua_pop(L, 1); /* pop rectangle */ #undef DO } #endif static void create_lua_font_extents (lua_State *L, cairo_font_extents_t *extents) { lua_createtable(L, 0, 5); lua_pushliteral(L, "ascent"); lua_pushnumber(L, extents->ascent); lua_rawset(L, -3); lua_pushliteral(L, "descent"); lua_pushnumber(L, extents->descent); lua_rawset(L, -3); lua_pushliteral(L, "height"); lua_pushnumber(L, extents->height); lua_rawset(L, -3); lua_pushliteral(L, "max_x_advance"); lua_pushnumber(L, extents->max_x_advance); lua_rawset(L, -3); lua_pushliteral(L, "max_y_advance"); lua_pushnumber(L, extents->max_y_advance); lua_rawset(L, -3); } #define HANDLE_FONT_EXTENTS_FIELD(name) \ lua_pushliteral(L, #name); \ lua_rawget(L, -2); \ if (!lua_isnumber(L, -1)) \ luaL_error(L, "font extents entry '" #name "' must be a number"); \ extents->name = lua_tonumber(L, -1); \ lua_pop(L, 1); static void from_lua_font_extents (lua_State *L, cairo_font_extents_t *extents) { if (!lua_istable(L, -1)) luaL_error(L, "font extents value must be a table"); HANDLE_FONT_EXTENTS_FIELD(ascent) HANDLE_FONT_EXTENTS_FIELD(descent) HANDLE_FONT_EXTENTS_FIELD(height) HANDLE_FONT_EXTENTS_FIELD(max_x_advance) HANDLE_FONT_EXTENTS_FIELD(max_y_advance) } #undef HANDLE_FONT_EXTENTS_FIELD static void create_lua_text_extents (lua_State *L, cairo_text_extents_t *extents) { lua_createtable(L, 0, 6); lua_pushliteral(L, "x_bearing"); lua_pushnumber(L, extents->x_bearing); lua_rawset(L, -3); lua_pushliteral(L, "y_bearing"); lua_pushnumber(L, extents->y_bearing); lua_rawset(L, -3); lua_pushliteral(L, "width"); lua_pushnumber(L, extents->width); lua_rawset(L, -3); lua_pushliteral(L, "height"); lua_pushnumber(L, extents->height); lua_rawset(L, -3); lua_pushliteral(L, "x_advance"); lua_pushnumber(L, extents->x_advance); lua_rawset(L, -3); lua_pushliteral(L, "y_advance"); lua_pushnumber(L, extents->y_advance); lua_rawset(L, -3); } #define HANDLE_TEXT_EXTENTS_FIELD(name) \ lua_pushliteral(L, #name); \ lua_rawget(L, -2); \ if (!lua_isnumber(L, -1)) \ luaL_error(L, "text extents entry '" #name "' must be a number"); \ extents->name = lua_tonumber(L, -1); \ lua_pop(L, 1); static void from_lua_text_extents (lua_State *L, cairo_text_extents_t *extents) { if (!lua_istable(L, -1)) luaL_error(L, "text extents value must be a table"); HANDLE_TEXT_EXTENTS_FIELD(x_bearing) HANDLE_TEXT_EXTENTS_FIELD(y_bearing) HANDLE_TEXT_EXTENTS_FIELD(width) HANDLE_TEXT_EXTENTS_FIELD(height) HANDLE_TEXT_EXTENTS_FIELD(x_advance) HANDLE_TEXT_EXTENTS_FIELD(y_advance) } #undef HANDLE_TEXT_EXTENTS_FIELD #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0) #define GLYPHS_ALLOC(num) cairo_glyph_allocate(num) #define GLYPHS_FREE(glyphs) cairo_glyph_free(glyphs) #else #define GLYPHS_ALLOC(num) malloc(sizeof(cairo_glyph_t) * (num)) #define GLYPHS_FREE(glyphs) free(glyphs) #endif static void create_lua_glyph_array (lua_State *L, cairo_glyph_t *glyphs, int num_glyphs) { int i; lua_createtable(L, num_glyphs, 0); for (i = 0; i < num_glyphs; ++i) { lua_createtable(L, 3, 0); lua_pushnumber(L, glyphs[i].index); lua_rawseti(L, -2, 1); lua_pushnumber(L, glyphs[i].x); lua_rawseti(L, -2, 2); lua_pushnumber(L, glyphs[i].y); lua_rawseti(L, -2, 3); lua_rawseti(L, -2, i + 1); } } static void from_lua_glyph_array (lua_State *L, cairo_glyph_t **glyphs, int *num_glyphs, int pos) { int i; double n; luaL_checktype(L, pos, LUA_TTABLE); *num_glyphs = lua_objlen(L, pos); if (*num_glyphs == 0) { *glyphs = 0; return; } *glyphs = GLYPHS_ALLOC(*num_glyphs); if (!*glyphs) { return luaL_error(L, "out of memory"); } for (i = 0; i < *num_glyphs; ++i) { lua_rawgeti(L, pos, i + 1); if (!lua_istable(L, -1)) { free(*glyphs); luaL_error(L, "glyph %d is not a table", i + 1); } else if (lua_objlen(L, -1) != 3) { free(*glyphs); luaL_error(L, "glyph %d should contain exactly 3 numbers", i + 1); } lua_rawgeti(L, -1, 1); if (!lua_isnumber(L, -1)) { free(*glyphs); luaL_error(L, "index of glyph %d should be a number", i + 1); } n = lua_tonumber(L, -1); if (n < 0) { free(*glyphs); luaL_error(L, "index number of glyph %d is negative", i + 1); } (*glyphs)[i].index = (unsigned long) n; lua_pop(L, 1); lua_rawgeti(L, -1, 2); if (!lua_isnumber(L, -1)) { free(*glyphs); luaL_error(L, "x position for glyph %d should be a number", i + 1); } (*glyphs)[i].x = lua_tonumber(L, -1); lua_pop(L, 1); lua_rawgeti(L, -1, 3); if (!lua_isnumber(L, -1)) { free(*glyphs); luaL_error(L, "y position for glyph %d should be a number", i + 1); } (*glyphs)[i].y = lua_tonumber(L, -1); lua_pop(L, 2); } } #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0) static void create_lua_text_cluster_table (lua_State *L, cairo_text_cluster_t *clusters, int num, cairo_text_cluster_flags_t flags) { int i; lua_createtable(L, num, 1); lua_pushliteral(L, "backward"); lua_pushboolean(L, flags & CAIRO_TEXT_CLUSTER_FLAG_BACKWARD); lua_rawset(L, -3); for (i = 0; i < num; ++i) { lua_createtable(L, 2, 0); lua_pushnumber(L, clusters[i].num_bytes); lua_rawseti(L, -2, 1); lua_pushnumber(L, clusters[i].num_glyphs); lua_rawseti(L, -2, 2); lua_rawseti(L, -2, i + 1); } } static void from_lua_clusters_table (lua_State *L, cairo_text_cluster_t **clusters, int *num, cairo_text_cluster_flags_t *flags, int pos) { int i; int n; luaL_checktype(L, pos, LUA_TTABLE); *flags = 0; lua_pushliteral(L, "backward"); lua_getfield(L, -1, "backward"); if (lua_toboolean(L, -1)) *flags |= CAIRO_TEXT_CLUSTER_FLAG_BACKWARD; lua_pop(L, 1); *num = lua_objlen(L, pos); if (*num == 0) { *clusters = 0; return; } *clusters = cairo_text_cluster_allocate(*num); if (!*clusters) { return luaL_error(L, "out of memory"); } for (i = 0; i < *num; ++i) { lua_rawgeti(L, pos, i + 1); if (!lua_istable(L, -1)) { free(*clusters); luaL_error(L, "text cluster %d is not a table", i + 1); } else if (lua_objlen(L, -1) != 2) { free(*clusters); luaL_error(L, "text cluster %d should contain exactly 2 numbers", i + 1); } lua_rawgeti(L, -1, 1); if (!lua_isnumber(L, -1)) { free(*clusters); luaL_error(L, "number of bytes of text cluster %d should be a" " number", i + 1); } n = lua_tonumber(L, -1); if (n < 0) { free(*clusters); luaL_error(L, "number of bytes of text cluster %d is negative", i + 1); } (*clusters)[i].num_bytes = n; lua_pop(L, 1); lua_rawgeti(L, -1, 2); if (!lua_isnumber(L, -1)) { free(*clusters); luaL_error(L, "number of glyphs of text cluster %d should be a" " number", i + 1); } n = lua_tonumber(L, -1); if (n < 0) { free(*clusters); luaL_error(L, "number of glyphs of text cluster %d is negative", i + 1); } (*clusters)[i].num_glyphs = n; lua_pop(L, 2); } } #endif typedef struct SurfaceUserdata_ { /* This has to be first, because most users of this ignore the rest and * just treat a pointer to this structure as if it was a pointer to the * surface pointer. */ cairo_surface_t *surface; /* This stuff is only used for surfaces which are continuously written * to a file handle during their lifetime. */ lua_State *L; int fhref; const char *errmsg; int errmsg_free; /* true if errmsg must be freed */ /* This is only used for image surfaces initialized from data. A copy * is made and referenced here, and only freed when the surface object * is GCed. */ unsigned char *image_buffer; } SurfaceUserdata; static void init_surface_userdata (lua_State *L, SurfaceUserdata *ud) { ud->surface = 0; ud->L = L; ud->fhref = LUA_NOREF; ud->errmsg = 0; ud->errmsg_free = 0; ud->image_buffer = 0; } static cairo_pattern_t ** create_pattern_userdata (lua_State *L) { cairo_pattern_t **obj = lua_newuserdata(L, sizeof(cairo_pattern_t *)); *obj = 0; luaL_getmetatable(L, OOCAIRO_MT_NAME_PATTERN); lua_setmetatable(L, -2); return obj; } static cairo_font_face_t ** create_fontface_userdata (lua_State *L) { cairo_font_face_t **obj = lua_newuserdata(L, sizeof(cairo_font_face_t *)); *obj = 0; luaL_getmetatable(L, OOCAIRO_MT_NAME_FONTFACE); lua_setmetatable(L, -2); return obj; } static cairo_scaled_font_t ** create_scaledfont_userdata (lua_State *L) { cairo_scaled_font_t **obj = lua_newuserdata(L, sizeof(cairo_scaled_font_t *)); *obj = 0; luaL_getmetatable(L, OOCAIRO_MT_NAME_SCALEDFONT); lua_setmetatable(L, -2); return obj; } static cairo_font_options_t ** create_fontopt_userdata (lua_State *L) { cairo_font_options_t **obj = lua_newuserdata(L, sizeof(cairo_font_options_t *)); *obj = 0; luaL_getmetatable(L, OOCAIRO_MT_NAME_FONTOPT); lua_setmetatable(L, -2); return obj; } #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) static cairo_region_t ** create_region_userdata (lua_State *L) { cairo_region_t **obj = lua_newuserdata(L, sizeof(cairo_region_t *)); *obj = 0; luaL_getmetatable(L, OOCAIRO_MT_NAME_REGION); lua_setmetatable(L, -2); return obj; } #endif static cairo_t ** create_context_userdata (lua_State *L) { cairo_t **obj = lua_newuserdata(L, sizeof(cairo_t *)); *obj = 0; luaL_getmetatable(L, OOCAIRO_MT_NAME_CONTEXT); lua_setmetatable(L, -2); return obj; } static SurfaceUserdata * create_surface_userdata (lua_State *L) { SurfaceUserdata *ud = lua_newuserdata(L, sizeof(SurfaceUserdata)); init_surface_userdata(L, ud); luaL_getmetatable(L, OOCAIRO_MT_NAME_SURFACE); lua_setmetatable(L, -2); return ud; } #define PUSH(name, type, func, reference) \ int \ oocairo_ ## name ## _push (lua_State *L, type *obj) \ { \ type **o = create_ ## func ## _userdata(L); \ *o = reference(obj); \ return 1; \ } PUSH(pattern, cairo_pattern_t, pattern, cairo_pattern_reference) PUSH(font_face, cairo_font_face_t, fontface, cairo_font_face_reference) PUSH(scaled_font, cairo_scaled_font_t, scaledfont, cairo_scaled_font_reference) PUSH(font_options, cairo_font_options_t, fontopt, cairo_font_options_copy) PUSH(context, cairo_t, context, cairo_reference) #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) PUSH(region, cairo_region_t, region, cairo_region_reference) #endif int oocairo_surface_push (lua_State *L, cairo_surface_t *surface) { SurfaceUserdata *ud; ud = create_surface_userdata(L); ud->surface = cairo_surface_reference(surface); return 1; } int oocairo_matrix_push (lua_State *L, cairo_matrix_t *matrix) { create_lua_matrix(L, matrix); return 1; } static void free_surface_userdata (SurfaceUserdata *ud) { if (ud->surface) { cairo_surface_destroy(ud->surface); ud->surface = 0; } if (ud->fhref != LUA_NOREF) { luaL_unref(ud->L, LUA_REGISTRYINDEX, ud->fhref); ud->fhref = LUA_NOREF; } if (ud->errmsg) { if (ud->errmsg_free) free((char *) ud->errmsg); ud->errmsg = 0; ud->errmsg_free = 0; } if (ud->image_buffer) { free(ud->image_buffer); ud->image_buffer = 0; } } static char * my_strdup (const char *s) { char *copy = malloc(strlen(s) + 1); if (copy) { strcpy(copy, s); } return copy; } static cairo_status_t write_chunk_to_fh (void *closure, const unsigned char *buf, unsigned int lentowrite) { SurfaceUserdata *info = closure; lua_State *L = info->L; lua_rawgeti(L, LUA_REGISTRYINDEX, info->fhref); lua_getfield(L, -1, "write"); if (lua_isnil(L, -1)) { info->errmsg = "file handle does not have 'write' method"; lua_pop(L, 2); return CAIRO_STATUS_WRITE_ERROR; } lua_pushvalue(L, -2); lua_pushlstring(L, (const char *) buf, lentowrite); if (lua_pcall(L, 2, 0, 0)) { if (lua_isstring(L, -1)) { info->errmsg = my_strdup(lua_tostring(L, -1)); info->errmsg_free = 1; } lua_pop(L, 1); return CAIRO_STATUS_WRITE_ERROR; } lua_pop(L, 1); return CAIRO_STATUS_SUCCESS; } #if LUA_VERSION_NUM >= 502 static void get_gtk_module_function (lua_State *L, const char *name) { /* FIXME: Implement this again */ (void) name; luaL_error(L, "cannot access gtk with lua >= 5.2, TODO: Implement this again"); } #else static void get_gtk_module_function (lua_State *L, const char *name) { lua_getfield(L, LUA_GLOBALSINDEX, "gtk"); if (lua_isnil(L, -1)) luaL_error(L, "no global variable 'gtk', you need to load the module" " with require'gtk' before using this function"); lua_getfield(L, -1, name); if (lua_isnil(L, -1)) luaL_error(L, "could not find '%s' function in 'gtk' module table", name); lua_remove(L, -2); } #endif static int push_cairo_status (lua_State *L, cairo_status_t status) { if (status == CAIRO_STATUS_SUCCESS) return 0; lua_pushstring(L, cairo_status_to_string(status)); return 1; } #include "obj_context.c" #include "obj_font_face.c" #include "obj_font_opt.c" #include "obj_matrix.c" #include "obj_path.c" #include "obj_pattern.c" #include "obj_scaled_font.c" #include "obj_surface.c" #include "obj_region.c" static int format_stride_for_width (lua_State *L) { cairo_format_t fmt = format_from_lua(L, 1); int width = luaL_checknumber(L, 2); lua_pushnumber(L, cairo_format_stride_for_width(fmt, width)); return 1; } #define CHECK_VER(func, version) \ static int \ func (lua_State *L) { \ int major = luaL_checknumber(L, 1); \ int minor = luaL_checknumber(L, 2); \ int micro = luaL_checknumber(L, 3); \ \ if ((version) >= CAIRO_VERSION_ENCODE(major, minor, micro)) { \ lua_pushboolean(L, 1); \ } else { \ lua_pushboolean(L, 0); \ } \ return 1; \ } CHECK_VER(check_version, CAIRO_VERSION) CHECK_VER(check_runtime_version, cairo_version()) static const luaL_Reg constructor_funcs[] = { { "check_version", check_version }, { "check_runtime_version", check_runtime_version }, { "context_create", context_create }, { "context_create_gdk", context_create_gdk }, { "font_options_create", font_options_create }, { "format_stride_for_width", format_stride_for_width }, { "image_surface_create", image_surface_create }, { "image_surface_create_from_data", image_surface_create_from_data }, #ifdef CAIRO_HAS_PNG_FUNCTIONS { "image_surface_create_from_png", image_surface_create_from_png }, #endif { "matrix_create", cairmat_create }, { "pattern_create_for_surface", pattern_create_for_surface }, { "pattern_create_linear", pattern_create_linear }, #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) { "pattern_create_mesh", pattern_create_mesh }, #endif { "pattern_create_radial", pattern_create_radial }, { "pattern_create_rgb", pattern_create_rgb }, { "pattern_create_rgba", pattern_create_rgba }, #ifdef CAIRO_HAS_PDF_SURFACE { "pdf_surface_create", pdf_surface_create }, #endif #ifdef CAIRO_HAS_PS_SURFACE { "ps_get_levels", ps_get_levels }, { "ps_surface_create", ps_surface_create }, #endif { "scaled_font_create", scaled_font_create }, { "surface_create_similar", surface_create_similar }, #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) { "surface_create_similar_image", surface_create_similar_image }, #endif #ifdef CAIRO_HAS_SVG_SURFACE { "svg_surface_create", svg_surface_create }, { "svg_get_versions", svg_get_versions }, #endif #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0) { "toy_font_face_create", toy_font_face_create }, #endif #ifdef CAIRO_HAS_USER_FONT { "user_font_face_create", user_font_face_create }, #endif /* New in cairo 1.10 */ #ifdef CAIRO_HAS_RECORDING_SURFACE { "recording_surface_create", recording_surface_create }, { "recording_surface_ink_extents", recording_surface_ink_extents }, #endif #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) { "region_create", region_create }, { "region_create_rectangle", region_create_rectangle }, { "region_create_rectangles", region_create_rectangles }, #endif { 0, 0 } }; static void add_funcs_to_table (lua_State *L, const luaL_Reg *funcs) { const luaL_Reg *l; for (l = funcs; l->name; ++l) { lua_pushstring(L, l->name); lua_pushcfunction(L, l->func); lua_rawset(L, -3); } } static void create_object_metatable (lua_State *L, const char *mt_name, const char *debug_name, const luaL_Reg *methods) { if (luaL_newmetatable(L, mt_name)) { lua_pushliteral(L, "_NAME"); lua_pushstring(L, debug_name); lua_rawset(L, -3); lua_pushliteral(L, "__name"); lua_pushstring(L, debug_name); lua_rawset(L, -3); add_funcs_to_table(L, methods); lua_pushliteral(L, "__index"); lua_pushvalue(L, -2); lua_rawset(L, -3); if (strcmp(mt_name, OOCAIRO_MT_NAME_CONTEXT) == 0) { /* The MT for context objects has an extra field which we don't * use, but which allows the Lua-Gnome binding to recognize * the objects. */ lua_pushliteral(L, "_classname"); lua_pushstring(L, "cairo"); lua_rawset(L, -3); } } lua_pop(L, 1); } int luaopen_oocairo (lua_State *L) { #ifdef VALGRIND_LUA_MODULE_HACK /* Hack to allow Valgrind to access debugging info for the module. */ luaL_getmetatable(L, "_LOADLIB"); lua_pushnil(L); lua_setfield(L, -2, "__gc"); lua_pop(L, 1); #endif /* Create the table to return from 'require' */ lua_newtable(L); lua_pushliteral(L, "_NAME"); lua_pushliteral(L, "cairo"); lua_rawset(L, -3); lua_pushliteral(L, "_VERSION"); lua_pushliteral(L, VERSION); lua_rawset(L, -3); lua_pushliteral(L, "_CAIRO_VERSION"); lua_pushstring(L, CAIRO_VERSION_STRING); lua_rawset(L, -3); lua_pushliteral(L, "_CAIRO_RUNTIME_VERSION"); lua_pushstring(L, cairo_version_string()); lua_rawset(L, -3); add_funcs_to_table(L, constructor_funcs); /* Add boolean values to allow Lua code to find out what features are * supported in this build. */ lua_pushliteral(L, "HAS_PDF_SURFACE"); #ifdef CAIRO_HAS_PDF_SURFACE lua_pushboolean(L, 1); #else lua_pushboolean(L, 0); #endif lua_rawset(L, -3); lua_pushliteral(L, "HAS_PNG_FUNCTIONS"); #ifdef CAIRO_HAS_PNG_FUNCTIONS lua_pushboolean(L, 1); #else lua_pushboolean(L, 0); #endif lua_rawset(L, -3); lua_pushliteral(L, "HAS_PS_SURFACE"); #ifdef CAIRO_HAS_PS_SURFACE lua_pushboolean(L, 1); #else lua_pushboolean(L, 0); #endif lua_rawset(L, -3); lua_pushliteral(L, "HAS_SVG_SURFACE"); #ifdef CAIRO_HAS_SVG_SURFACE lua_pushboolean(L, 1); #else lua_pushboolean(L, 0); #endif lua_rawset(L, -3); lua_pushliteral(L, "HAS_USER_FONT"); #ifdef CAIRO_HAS_USER_FONT lua_pushboolean(L, 1); #else lua_pushboolean(L, 0); #endif lua_rawset(L, -3); lua_pushliteral(L, "HAS_RECORDING_SURFACE"); #ifdef CAIRO_HAS_RECORDING_SURFACE lua_pushboolean(L, 1); #else lua_pushboolean(L, 0); #endif lua_rawset(L, -3); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) #define ADD_MIME_TYPE(TYPE) \ lua_pushliteral(L, #TYPE); \ lua_pushstring(L, CAIRO_ ## TYPE); \ lua_rawset(L, -3); ADD_MIME_TYPE(MIME_TYPE_JP2); ADD_MIME_TYPE(MIME_TYPE_JPEG); ADD_MIME_TYPE(MIME_TYPE_PNG); ADD_MIME_TYPE(MIME_TYPE_URI); #endif /* This is needed to test the byte order which Cairo will use for storing * pixel components. */ lua_pushliteral(L, "BYTE_ORDER"); lua_pushlstring(L, IS_BIG_ENDIAN ? "argb" : "bgra", 4); lua_rawset(L, -3); /* Create the metatables for objects of different types. */ create_object_metatable(L, OOCAIRO_MT_NAME_CONTEXT, "cairo context object", context_methods); create_object_metatable(L, OOCAIRO_MT_NAME_FONTFACE, "cairo font face object", fontface_methods); create_object_metatable(L, OOCAIRO_MT_NAME_SCALEDFONT, "cairo scaled font object", scaledfont_methods); create_object_metatable(L, OOCAIRO_MT_NAME_FONTOPT, "cairo font options object", fontopt_methods); create_object_metatable(L, OOCAIRO_MT_NAME_MATRIX, "cairo matrix object", cairmat_methods); create_object_metatable(L, OOCAIRO_MT_NAME_PATH, "cairo path object", path_methods); create_object_metatable(L, OOCAIRO_MT_NAME_PATTERN, "cairo pattern object", pattern_methods); create_object_metatable(L, OOCAIRO_MT_NAME_SURFACE, "cairo surface object", surface_methods); #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) create_object_metatable(L, OOCAIRO_MT_NAME_REGION, "cairo region object", region_methods); #endif return 1; } /* vi:set ts=4 sw=4 expandtab: */
32.159716
110
0.661792
[ "object" ]
b5002199662e4c20c68b19e8584d4391b174a2ad
604,417
h
C
Source/GeneratedServices/Dialogflow/GTLRDialogflowObjects.h
JackYoustra/google-api-objectivec-client-for-rest
f95ab23734ece18ef377bdde1c33898aeaf801f1
[ "Apache-2.0" ]
3
2022-02-07T21:13:10.000Z
2022-02-08T07:22:19.000Z
Source/GeneratedServices/Dialogflow/GTLRDialogflowObjects.h
MaxMood96/google-api-objectivec-client-for-rest
1dbbd33278bc1059acc2bc697a51dd2185e454d7
[ "Apache-2.0" ]
null
null
null
Source/GeneratedServices/Dialogflow/GTLRDialogflowObjects.h
MaxMood96/google-api-objectivec-client-for-rest
1dbbd33278bc1059acc2bc697a51dd2185e454d7
[ "Apache-2.0" ]
null
null
null
// NOTE: This file was generated by the ServiceGenerator. // ---------------------------------------------------------------------------- // API: // Dialogflow API (dialogflow/v3) // Description: // Builds conversational interfaces (for example, chatbots, and voice-powered // apps and devices). // Documentation: // https://cloud.google.com/dialogflow/ #if SWIFT_PACKAGE || GTLR_USE_MODULAR_IMPORT @import GoogleAPIClientForRESTCore; #elif GTLR_BUILT_AS_FRAMEWORK #import "GTLR/GTLRObject.h" #else #import "GTLRObject.h" #endif #if GTLR_RUNTIME_VERSION != 3000 #error This file was generated by a different version of ServiceGenerator which is incompatible with this GTLR library source. #endif @class GTLRDialogflow_GoogleCloudDialogflowCxV3AdvancedSettings; @class GTLRDialogflow_GoogleCloudDialogflowCxV3AdvancedSettingsLoggingSettings; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Agent; @class GTLRDialogflow_GoogleCloudDialogflowCxV3AudioInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1AudioInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurn; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput_InjectedParameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput_DiagnosticInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput_SessionParameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1DtmfInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Environment; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EnvironmentTestCasesConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EnvironmentVersionConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EventHandler; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EventInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Form; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FormParameter; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Fulfillment; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Intent; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Intent_Labels; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentParameter; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Page; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1QueryInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage_Payload; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess_Metadata; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff_Metadata; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageTelephonyTransferCall; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageText; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1SessionInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1SessionInfo_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCase; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseError; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestError; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TextInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TransitionRoute; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequest_Payload; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestSentimentAnalysisResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponse_Payload; @class GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Changelog; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurn; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnUserInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnUserInput_InjectedParameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput_DiagnosticInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput_SessionParameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Deployment; @class GTLRDialogflow_GoogleCloudDialogflowCxV3DeploymentResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3DtmfInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3EntityType; @class GTLRDialogflow_GoogleCloudDialogflowCxV3EntityTypeEntity; @class GTLRDialogflow_GoogleCloudDialogflowCxV3EntityTypeExcludedPhrase; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Environment; @class GTLRDialogflow_GoogleCloudDialogflowCxV3EnvironmentTestCasesConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3EnvironmentVersionConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3EventHandler; @class GTLRDialogflow_GoogleCloudDialogflowCxV3EventInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Experiment; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentDefinition; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultConfidenceInterval; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultVersionMetrics; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Flow; @class GTLRDialogflow_GoogleCloudDialogflowCxV3FlowValidationResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Form; @class GTLRDialogflow_GoogleCloudDialogflowCxV3FormParameter; @class GTLRDialogflow_GoogleCloudDialogflowCxV3FormParameterFillBehavior; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Fulfillment; @class GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCases; @class GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase; @class GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent; @class GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentSetParameterAction; @class GTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata; @class GTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Intent; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Intent_Labels; @class GTLRDialogflow_GoogleCloudDialogflowCxV3IntentCoverage; @class GTLRDialogflow_GoogleCloudDialogflowCxV3IntentCoverageIntent; @class GTLRDialogflow_GoogleCloudDialogflowCxV3IntentInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3IntentParameter; @class GTLRDialogflow_GoogleCloudDialogflowCxV3IntentTrainingPhrase; @class GTLRDialogflow_GoogleCloudDialogflowCxV3IntentTrainingPhrasePart; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Match; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Match_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3MatchIntentRequest; @class GTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings; @class GTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Page; @class GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_Payload; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_WebhookHeaders; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_DiagnosticInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_WebhookPayloads_Item; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResourceName; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage_Payload; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess_Metadata; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageEndInteraction; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff_Metadata; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageMixedAudio; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessagePlayAudio; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageTelephonyTransferCall; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageText; @class GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutConfigRolloutStep; @class GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutState; @class GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings; @class GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettingsInsightsExportSettings; @class GTLRDialogflow_GoogleCloudDialogflowCxV3SentimentAnalysisResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType; @class GTLRDialogflow_GoogleCloudDialogflowCxV3SessionInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3SessionInfo_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3SpeechToTextSettings; @class GTLRDialogflow_GoogleCloudDialogflowCxV3SynthesizeSpeechConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TestCase; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseError; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TestConfig; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TestError; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TextInput; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverage; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverageTransition; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverageTransitionNode; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRoute; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroup; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverage; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverageCoverage; @class GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverageCoverageTransition; @class GTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage; @class GTLRDialogflow_GoogleCloudDialogflowCxV3VariantsHistory; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Version; @class GTLRDialogflow_GoogleCloudDialogflowCxV3VersionVariants; @class GTLRDialogflow_GoogleCloudDialogflowCxV3VersionVariantsVariant; @class GTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams; @class GTLRDialogflow_GoogleCloudDialogflowCxV3Webhook; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookGenericWebService; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookGenericWebService_RequestHeaders; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequest_Payload; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfo; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfo_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestSentimentAnalysisResult; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponse_Payload; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse; @class GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookServiceDirectoryConfig; @class GTLRDialogflow_GoogleCloudDialogflowV2AnnotatedMessagePart; @class GTLRDialogflow_GoogleCloudDialogflowV2ArticleAnswer; @class GTLRDialogflow_GoogleCloudDialogflowV2ArticleAnswer_Metadata; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1AnnotatedMessagePart; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1ArticleAnswer; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1ArticleAnswer_Metadata; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1Context; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1Context_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityTypeEntity; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1EventInput; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1EventInput_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1FaqAnswer; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1FaqAnswer_Metadata; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1Intent; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Payload; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCard; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCard; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCardButton; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageListSelect; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageListSelectItem; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContent; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageQuickReplies; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmText; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSuggestion; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSuggestions; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCard; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCardCell; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCardRow; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageText; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentParameter; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswers; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1Message; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1MessageAnnotation; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest_Payload; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_DiagnosticInfo; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_WebhookPayload; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1Sentiment; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1SentimentAnalysisResult; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1SmartReplyAnswer; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestArticlesResponse; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestFaqAnswersResponse; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestionResult; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestSmartRepliesResponse; @class GTLRDialogflow_GoogleCloudDialogflowV2beta1WebhookResponse_Payload; @class GTLRDialogflow_GoogleCloudDialogflowV2Context; @class GTLRDialogflow_GoogleCloudDialogflowV2Context_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowV2EntityType; @class GTLRDialogflow_GoogleCloudDialogflowV2EntityTypeEntity; @class GTLRDialogflow_GoogleCloudDialogflowV2EventInput; @class GTLRDialogflow_GoogleCloudDialogflowV2EventInput_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowV2FaqAnswer; @class GTLRDialogflow_GoogleCloudDialogflowV2FaqAnswer_Metadata; @class GTLRDialogflow_GoogleCloudDialogflowV2Intent; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentFollowupIntentInfo; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Payload; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCard; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCardButton; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCard; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCardButton; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCarouselSelect; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCarouselSelectItem; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageListSelect; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageListSelectItem; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContent; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageQuickReplies; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSelectItemInfo; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSimpleResponse; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSimpleResponses; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSuggestion; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSuggestions; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCard; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCardCell; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCardRow; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageText; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentParameter; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase; @class GTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrasePart; @class GTLRDialogflow_GoogleCloudDialogflowV2Message; @class GTLRDialogflow_GoogleCloudDialogflowV2MessageAnnotation; @class GTLRDialogflow_GoogleCloudDialogflowV2OriginalDetectIntentRequest; @class GTLRDialogflow_GoogleCloudDialogflowV2OriginalDetectIntentRequest_Payload; @class GTLRDialogflow_GoogleCloudDialogflowV2QueryResult; @class GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_DiagnosticInfo; @class GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_Parameters; @class GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_WebhookPayload; @class GTLRDialogflow_GoogleCloudDialogflowV2Sentiment; @class GTLRDialogflow_GoogleCloudDialogflowV2SentimentAnalysisResult; @class GTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType; @class GTLRDialogflow_GoogleCloudDialogflowV2SmartReplyAnswer; @class GTLRDialogflow_GoogleCloudDialogflowV2SuggestArticlesResponse; @class GTLRDialogflow_GoogleCloudDialogflowV2SuggestFaqAnswersResponse; @class GTLRDialogflow_GoogleCloudDialogflowV2SuggestionResult; @class GTLRDialogflow_GoogleCloudDialogflowV2SuggestSmartRepliesResponse; @class GTLRDialogflow_GoogleCloudDialogflowV2WebhookResponse_Payload; @class GTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata; @class GTLRDialogflow_GoogleCloudLocationLocation; @class GTLRDialogflow_GoogleCloudLocationLocation_Labels; @class GTLRDialogflow_GoogleCloudLocationLocation_Metadata; @class GTLRDialogflow_GoogleLongrunningOperation; @class GTLRDialogflow_GoogleLongrunningOperation_Metadata; @class GTLRDialogflow_GoogleLongrunningOperation_Response; @class GTLRDialogflow_GoogleRpcStatus; @class GTLRDialogflow_GoogleRpcStatus_Details_Item; @class GTLRDialogflow_GoogleTypeLatLng; // Generated comments include content from the discovery document; avoid them // causing warnings since clang's checks are some what arbitrary. #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdocumentation" NS_ASSUME_NONNULL_BEGIN // ---------------------------------------------------------------------------- // Constants - For some of the classes' properties below. // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult.result /** * Not specified. Should never be used. * * Value: "AGGREGATED_TEST_RESULT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult_Result_AggregatedTestResultUnspecified; /** * At least one test did not pass. * * Value: "FAILED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult_Result_Failed; /** * All the tests passed. * * Value: "PASSED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult_Result_Passed; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata.state /** * The operation is done, either cancelled or completed. * * Value: "DONE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata_State_Done; /** * The operation has been created. * * Value: "PENDING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata_State_Pending; /** * The operation is currently running. * * Value: "RUNNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata_State_Running; /** * State unspecified. * * Value: "STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata_State_StateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig.audioEncoding /** * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. * * Value: "AUDIO_ENCODING_AMR" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingAmr; /** * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. * * Value: "AUDIO_ENCODING_AMR_WB" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingAmrWb; /** * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio * Codec) is the recommended encoding because it is lossless (therefore * recognition is not compromised) and requires only about half the bandwidth * of `LINEAR16`. `FLAC` stream encoding supports 16-bit and 24-bit samples, * however, not all fields in `STREAMINFO` are supported. * * Value: "AUDIO_ENCODING_FLAC" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingFlac; /** * Uncompressed 16-bit signed little-endian samples (Linear PCM). * * Value: "AUDIO_ENCODING_LINEAR_16" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingLinear16; /** * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. * * Value: "AUDIO_ENCODING_MULAW" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingMulaw; /** * Opus encoded audio frames in Ogg container * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be * 16000. * * Value: "AUDIO_ENCODING_OGG_OPUS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingOggOpus; /** * Although the use of lossy encodings is not recommended, if a very low * bitrate encoding is required, `OGG_OPUS` is highly preferred over Speex * encoding. The [Speex](https://speex.org/) encoding supported by Dialogflow * API has a header byte in each block, as in MIME type * `audio/x-speex-with-header-byte`. It is a variant of the RTP Speex encoding * defined in [RFC 5574](https://tools.ietf.org/html/rfc5574). The stream is a * sequence of blocks, one block per RTP packet. Each block starts with a byte * containing the length of the block, in bytes, followed by one or more frames * of Speex data, padded to an integral number of bytes (octets) as specified * in RFC 5574. In other words, each RTP header is replaced with a single byte * containing the block length. Only Speex wideband is supported. * `sample_rate_hertz` must be 16000. * * Value: "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingSpeexWithHeaderByte; /** * Not specified. * * Value: "AUDIO_ENCODING_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig.modelVariant /** * No model variant specified. In this case Dialogflow defaults to * USE_BEST_AVAILABLE. * * Value: "SPEECH_MODEL_VARIANT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_ModelVariant_SpeechModelVariantUnspecified; /** * Use the best available variant of the Speech model that the caller is * eligible for. Please see the [Dialogflow * docs](https://cloud.google.com/dialogflow/docs/data-logging) for how to make * your project eligible for enhanced models. * * Value: "USE_BEST_AVAILABLE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_ModelVariant_UseBestAvailable; /** * Use an enhanced model variant: * If an enhanced variant does not exist for * the given model and request language, Dialogflow falls back to the standard * variant. The [Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) * describes which models have enhanced variants. * If the API caller isn't * eligible for enhanced models, Dialogflow returns an error. Please see the * [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) for * how to make your project eligible. * * Value: "USE_ENHANCED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_ModelVariant_UseEnhanced; /** * Use standard model variant even if an enhanced model is available. See the * [Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) * for details about enhanced models. * * Value: "USE_STANDARD" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_ModelVariant_UseStandard; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo.state /** * Indicates that the parameter does not have a value. * * Value: "EMPTY" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo_State_Empty; /** * Indicates that the parameter has a value. * * Value: "FILLED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo_State_Filled; /** * Indicates that the parameter value is invalid. This field can be used by the * webhook to invalidate the parameter and ask the server to collect it from * the user again. * * Value: "INVALID" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo_State_Invalid; /** * Not specified. This value should be never used. * * Value: "PARAMETER_STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo_State_ParameterStateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult.testResult /** * The test did not pass. * * Value: "FAILED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult_TestResult_Failed; /** * The test passed. * * Value: "PASSED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult_TestResult_Passed; /** * Not specified. Should never be used. * * Value: "TEST_RESULT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult_TestResult_TestResultUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference.type /** * Should never be used. * * Value: "DIFF_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_DiffTypeUnspecified; /** * The intent. * * Value: "INTENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_Intent; /** * The page. * * Value: "PAGE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_Page; /** * The parameters. * * Value: "PARAMETERS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_Parameters; /** * The message utterance. * * Value: "UTTERANCE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_Utterance; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse.mergeBehavior /** * `messages` will be appended to the list of messages waiting to be sent to * the user. * * Value: "APPEND" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse_MergeBehavior_Append; /** * Not specified. `APPEND` will be used. * * Value: "MERGE_BEHAVIOR_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse_MergeBehavior_MergeBehaviorUnspecified; /** * `messages` will replace the list of messages waiting to be sent to the user. * * Value: "REPLACE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse_MergeBehavior_Replace; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult.result /** * Not specified. Should never be used. * * Value: "AGGREGATED_TEST_RESULT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult_Result_AggregatedTestResultUnspecified; /** * At least one test did not pass. * * Value: "FAILED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult_Result_Failed; /** * All the tests passed. * * Value: "PASSED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult_Result_Passed; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3Deployment.state /** * The deployment failed. * * Value: "FAILED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Deployment_State_Failed; /** * The deployment is running. * * Value: "RUNNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Deployment_State_Running; /** * State unspecified. * * Value: "STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Deployment_State_StateUnspecified; /** * The deployment succeeded. * * Value: "SUCCEEDED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Deployment_State_Succeeded; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentResponse.responseType /** * Final response. * * Value: "FINAL" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentResponse_ResponseType_Final; /** * Partial response. e.g. Aggregated responses in a Fulfillment that enables * `return_partial_response` can be returned as partial response. WARNING: * partial response is not eligible for barge-in. * * Value: "PARTIAL" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentResponse_ResponseType_Partial; /** * Not specified. This should never happen. * * Value: "RESPONSE_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentResponse_ResponseType_ResponseTypeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3EntityType.autoExpansionMode /** * Allows an agent to recognize values that have not been explicitly listed in * the entity. * * Value: "AUTO_EXPANSION_MODE_DEFAULT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_AutoExpansionMode_AutoExpansionModeDefault; /** * Auto expansion disabled for the entity. * * Value: "AUTO_EXPANSION_MODE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_AutoExpansionMode_AutoExpansionModeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3EntityType.kind /** * List entity types contain a set of entries that do not map to canonical * values. However, list entity types can contain references to other entity * types (with or without aliases). * * Value: "KIND_LIST" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_Kind_KindList; /** * Map entity types allow mapping of a group of synonyms to a canonical value. * * Value: "KIND_MAP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_Kind_KindMap; /** * Regexp entity types allow to specify regular expressions in entries values. * * Value: "KIND_REGEXP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_Kind_KindRegexp; /** * Not specified. This value should be never used. * * Value: "KIND_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_Kind_KindUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3Experiment.state /** * The experiment is done. * * Value: "DONE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_Done; /** * The experiment is created but not started yet. * * Value: "DRAFT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_Draft; /** * The experiment with auto-rollout enabled has failed. * * Value: "ROLLOUT_FAILED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_RolloutFailed; /** * The experiment is running. * * Value: "RUNNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_Running; /** * State unspecified. * * Value: "STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_StateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric.countType /** * Average turn count in a session. * * Value: "AVERAGE_TURN_COUNT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_CountType_AverageTurnCount; /** * Count type unspecified. * * Value: "COUNT_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_CountType_CountTypeUnspecified; /** * Total number of occurrences of a 'NO_MATCH'. * * Value: "TOTAL_NO_MATCH_COUNT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_CountType_TotalNoMatchCount; /** * Total number of turn counts. * * Value: "TOTAL_TURN_COUNT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_CountType_TotalTurnCount; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric.type /** * Percentage of sessions where user hung up. * * Value: "ABANDONED_SESSION_RATE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_AbandonedSessionRate; /** * Percentage of sessions with the same user calling back. * * Value: "CALLBACK_SESSION_RATE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_CallbackSessionRate; /** * Percentage of contained sessions without user calling back in 24 hours. * * Value: "CONTAINED_SESSION_NO_CALLBACK_RATE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_ContainedSessionNoCallbackRate; /** * Percentage of sessions that were handed to a human agent. * * Value: "LIVE_AGENT_HANDOFF_RATE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_LiveAgentHandoffRate; /** * Metric unspecified. * * Value: "METRIC_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_MetricUnspecified; /** * Percentage of sessions reached Dialogflow 'END_PAGE' or 'END_SESSION'. * * Value: "SESSION_END_RATE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_SessionEndRate; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesRequest.dataFormat /** * Raw bytes. * * Value: "BLOB" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesRequest_DataFormat_Blob; /** * Unspecified format. * * Value: "DATA_FORMAT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesRequest_DataFormat_DataFormatUnspecified; /** * JSON format. * * Value: "JSON" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesRequest_DataFormat_Json; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata.state /** * The operation is done, either cancelled or completed. * * Value: "DONE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata_State_Done; /** * The operation has been created. * * Value: "PENDING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata_State_Pending; /** * The operation is currently running. * * Value: "RUNNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata_State_Running; /** * State unspecified. * * Value: "STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata_State_StateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowRequest.importOption /** * Fallback to default settings if some settings are not supported in the agent * to import into. E.g. Standard NLU will be used if custom NLU is not * available. * * Value: "FALLBACK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowRequest_ImportOption_Fallback; /** * Unspecified. Treated as `KEEP`. * * Value: "IMPORT_OPTION_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowRequest_ImportOption_ImportOptionUnspecified; /** * Always respect settings in exported flow content. It may cause a import * failure if some settings (e.g. custom NLU) are not supported in the agent to * import into. * * Value: "KEEP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowRequest_ImportOption_Keep; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig.audioEncoding /** * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. * * Value: "AUDIO_ENCODING_AMR" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingAmr; /** * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. * * Value: "AUDIO_ENCODING_AMR_WB" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingAmrWb; /** * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio * Codec) is the recommended encoding because it is lossless (therefore * recognition is not compromised) and requires only about half the bandwidth * of `LINEAR16`. `FLAC` stream encoding supports 16-bit and 24-bit samples, * however, not all fields in `STREAMINFO` are supported. * * Value: "AUDIO_ENCODING_FLAC" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingFlac; /** * Uncompressed 16-bit signed little-endian samples (Linear PCM). * * Value: "AUDIO_ENCODING_LINEAR_16" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingLinear16; /** * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. * * Value: "AUDIO_ENCODING_MULAW" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingMulaw; /** * Opus encoded audio frames in Ogg container * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be * 16000. * * Value: "AUDIO_ENCODING_OGG_OPUS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingOggOpus; /** * Although the use of lossy encodings is not recommended, if a very low * bitrate encoding is required, `OGG_OPUS` is highly preferred over Speex * encoding. The [Speex](https://speex.org/) encoding supported by Dialogflow * API has a header byte in each block, as in MIME type * `audio/x-speex-with-header-byte`. It is a variant of the RTP Speex encoding * defined in [RFC 5574](https://tools.ietf.org/html/rfc5574). The stream is a * sequence of blocks, one block per RTP packet. Each block starts with a byte * containing the length of the block, in bytes, followed by one or more frames * of Speex data, padded to an integral number of bytes (octets) as specified * in RFC 5574. In other words, each RTP header is replaced with a single byte * containing the block length. Only Speex wideband is supported. * `sample_rate_hertz` must be 16000. * * Value: "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingSpeexWithHeaderByte; /** * Not specified. * * Value: "AUDIO_ENCODING_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig.modelVariant /** * No model variant specified. In this case Dialogflow defaults to * USE_BEST_AVAILABLE. * * Value: "SPEECH_MODEL_VARIANT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_ModelVariant_SpeechModelVariantUnspecified; /** * Use the best available variant of the Speech model that the caller is * eligible for. Please see the [Dialogflow * docs](https://cloud.google.com/dialogflow/docs/data-logging) for how to make * your project eligible for enhanced models. * * Value: "USE_BEST_AVAILABLE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_ModelVariant_UseBestAvailable; /** * Use an enhanced model variant: * If an enhanced variant does not exist for * the given model and request language, Dialogflow falls back to the standard * variant. The [Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) * describes which models have enhanced variants. * If the API caller isn't * eligible for enhanced models, Dialogflow returns an error. Please see the * [Dialogflow docs](https://cloud.google.com/dialogflow/docs/data-logging) for * how to make your project eligible. * * Value: "USE_ENHANCED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_ModelVariant_UseEnhanced; /** * Use standard model variant even if an enhanced model is available. See the * [Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) * for details about enhanced models. * * Value: "USE_STANDARD" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_ModelVariant_UseStandard; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3Match.matchType /** * The query directly triggered an intent. * * Value: "DIRECT_INTENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_DirectIntent; /** * The query directly triggered an event. * * Value: "EVENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_Event; /** * The query was matched to an intent. * * Value: "INTENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_Intent; /** * Not specified. Should never be used. * * Value: "MATCH_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_MatchTypeUnspecified; /** * Indicates an empty query. * * Value: "NO_INPUT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_NoInput; /** * No match was found for the query. * * Value: "NO_MATCH" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_NoMatch; /** * The query was used for parameter filling. * * Value: "PARAMETER_FILLING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_ParameterFilling; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings.modelTrainingMode /** * NLU model training is automatically triggered when a flow gets modified. * User can also manually trigger model training in this mode. * * Value: "MODEL_TRAINING_MODE_AUTOMATIC" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelTrainingMode_ModelTrainingModeAutomatic; /** * User needs to manually trigger NLU model training. Best for large flows * whose models take long time to train. * * Value: "MODEL_TRAINING_MODE_MANUAL" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelTrainingMode_ModelTrainingModeManual; /** * Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used. * * Value: "MODEL_TRAINING_MODE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelTrainingMode_ModelTrainingModeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings.modelType /** * Use advanced NLU model. * * Value: "MODEL_TYPE_ADVANCED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelType_ModelTypeAdvanced; /** * Use standard NLU model. * * Value: "MODEL_TYPE_STANDARD" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelType_ModelTypeStandard; /** * Not specified. `MODEL_TYPE_STANDARD` will be used. * * Value: "MODEL_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelType_ModelTypeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig.audioEncoding /** * Uncompressed 16-bit signed little-endian samples (Linear PCM). Audio content * returned as LINEAR16 also contains a WAV header. * * Value: "OUTPUT_AUDIO_ENCODING_LINEAR_16" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingLinear16; /** * MP3 audio at 32kbps. * * Value: "OUTPUT_AUDIO_ENCODING_MP3" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingMp3; /** * MP3 audio at 64kbps. * * Value: "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingMp364Kbps; /** * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. * * Value: "OUTPUT_AUDIO_ENCODING_MULAW" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingMulaw; /** * Opus encoded audio wrapped in an ogg container. The result will be a file * which can be played natively on Android, and in browsers (at least Chrome * and Firefox). The quality of the encoding is considerably higher than MP3 * while using approximately the same bitrate. * * Value: "OUTPUT_AUDIO_ENCODING_OGG_OPUS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingOggOpus; /** * Not specified. * * Value: "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo.state /** * Indicates that the parameter does not have a value. * * Value: "EMPTY" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo_State_Empty; /** * Indicates that the parameter has a value. * * Value: "FILLED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo_State_Filled; /** * Indicates that the parameter value is invalid. This field can be used by the * webhook to invalidate the parameter and ask the server to collect it from * the user again. * * Value: "INVALID" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo_State_Invalid; /** * Not specified. This value should be never used. * * Value: "PARAMETER_STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo_State_ParameterStateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3RestoreAgentRequest.restoreOption /** * Fallback to default settings if some settings are not supported in the * target agent. * * Value: "FALLBACK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3RestoreAgentRequest_RestoreOption_Fallback; /** * Always respect the settings from the exported agent file. It may cause a * restoration failure if some settings (e.g. model type) are not supported in * the target agent. * * Value: "KEEP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3RestoreAgentRequest_RestoreOption_Keep; /** * Unspecified. Treated as KEEP. * * Value: "RESTORE_OPTION_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3RestoreAgentRequest_RestoreOption_RestoreOptionUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings.purgeDataTypes /** * Dialogflow history. This does not include Cloud logging, which is owned by * the user - not Dialogflow. * * Value: "DIALOGFLOW_HISTORY" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_PurgeDataTypes_DialogflowHistory; /** * Unspecified. Do not use. * * Value: "PURGE_DATA_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_PurgeDataTypes_PurgeDataTypeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings.redactionScope /** * On data to be written to disk or similar devices that are capable of holding * data even if power is disconnected. This includes data that are temporarily * saved on disk. * * Value: "REDACT_DISK_STORAGE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_RedactionScope_RedactDiskStorage; /** * Don't redact any kind of data. * * Value: "REDACTION_SCOPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_RedactionScope_RedactionScopeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings.redactionStrategy /** * Do not redact. * * Value: "REDACTION_STRATEGY_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_RedactionStrategy_RedactionStrategyUnspecified; /** * Call redaction service to clean up the data to be persisted. * * Value: "REDACT_WITH_SERVICE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_RedactionStrategy_RedactWithService; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType.entityOverrideMode /** * The collection of session entities overrides the collection of entities in * the corresponding custom entity type. * * Value: "ENTITY_OVERRIDE_MODE_OVERRIDE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType_EntityOverrideMode_EntityOverrideModeOverride; /** * The collection of session entities extends the collection of entities in the * corresponding custom entity type. Note: Even in this override mode calls to * `ListSessionEntityTypes`, `GetSessionEntityType`, `CreateSessionEntityType` * and `UpdateSessionEntityType` only return the additional entities added in * this session entity type. If you want to get the supplemented list, please * call EntityTypes.GetEntityType on the custom entity type and merge. * * Value: "ENTITY_OVERRIDE_MODE_SUPPLEMENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType_EntityOverrideMode_EntityOverrideModeSupplement; /** * Not specified. This value should be never used. * * Value: "ENTITY_OVERRIDE_MODE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType_EntityOverrideMode_EntityOverrideModeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult.testResult /** * The test did not pass. * * Value: "FAILED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult_TestResult_Failed; /** * The test passed. * * Value: "PASSED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult_TestResult_Passed; /** * Not specified. Should never be used. * * Value: "TEST_RESULT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult_TestResult_TestResultUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference.type /** * Should never be used. * * Value: "DIFF_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_DiffTypeUnspecified; /** * The intent. * * Value: "INTENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_Intent; /** * The page. * * Value: "PAGE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_Page; /** * The parameters. * * Value: "PARAMETERS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_Parameters; /** * The message utterance. * * Value: "UTTERANCE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_Utterance; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage.resourceType /** * Agent. * * Value: "AGENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Agent; /** * Entity type. * * Value: "ENTITY_TYPE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_EntityType; /** * Multiple entity types. * * Value: "ENTITY_TYPES" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_EntityTypes; /** * Flow. * * Value: "FLOW" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Flow; /** * Intent. * * Value: "INTENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Intent; /** * Intent parameter. * * Value: "INTENT_PARAMETER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_IntentParameter; /** * Multiple intents. * * Value: "INTENTS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Intents; /** * Intent training phrase. * * Value: "INTENT_TRAINING_PHRASE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_IntentTrainingPhrase; /** * Multiple training phrases. * * Value: "INTENT_TRAINING_PHRASES" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_IntentTrainingPhrases; /** * Page. * * Value: "PAGE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Page; /** * Multiple pages. * * Value: "PAGES" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Pages; /** * Unspecified. * * Value: "RESOURCE_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_ResourceTypeUnspecified; /** * Transition route group. * * Value: "TRANSITION_ROUTE_GROUP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_TransitionRouteGroup; /** * Webhook. * * Value: "WEBHOOK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Webhook; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage.severity /** * The agent may experience failures. * * Value: "ERROR" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_Severity_Error; /** * The agent doesn't follow Dialogflow best practices. * * Value: "INFO" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_Severity_Info; /** * Unspecified. * * Value: "SEVERITY_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_Severity_SeverityUnspecified; /** * The agent may not behave as expected. * * Value: "WARNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_Severity_Warning; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3Version.state /** * Version training failed. * * Value: "FAILED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Version_State_Failed; /** * Version is not ready to serve (e.g. training is running). * * Value: "RUNNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Version_State_Running; /** * Not specified. This value is not used. * * Value: "STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Version_State_StateUnspecified; /** * Training has succeeded and this version is ready to serve. * * Value: "SUCCEEDED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3Version_State_Succeeded; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams.ssmlGender /** * A female voice. * * Value: "SSML_VOICE_GENDER_FEMALE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams_SsmlGender_SsmlVoiceGenderFemale; /** * A male voice. * * Value: "SSML_VOICE_GENDER_MALE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams_SsmlGender_SsmlVoiceGenderMale; /** * A gender-neutral voice. * * Value: "SSML_VOICE_GENDER_NEUTRAL" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams_SsmlGender_SsmlVoiceGenderNeutral; /** * An unspecified gender, which means that the client doesn't care which gender * the selected voice will have. * * Value: "SSML_VOICE_GENDER_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams_SsmlGender_SsmlVoiceGenderUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse.mergeBehavior /** * `messages` will be appended to the list of messages waiting to be sent to * the user. * * Value: "APPEND" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse_MergeBehavior_Append; /** * Not specified. `APPEND` will be used. * * Value: "MERGE_BEHAVIOR_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse_MergeBehavior_MergeBehaviorUnspecified; /** * `messages` will replace the list of messages waiting to be sent to the user. * * Value: "REPLACE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse_MergeBehavior_Replace; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent.type /** * An existing conversation has closed. This is fired when a telephone call is * terminated, or a conversation is closed via the API. * * Value: "CONVERSATION_FINISHED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_ConversationFinished; /** * A new conversation has been opened. This is fired when a telephone call is * answered, or a conversation is created via the API. * * Value: "CONVERSATION_STARTED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_ConversationStarted; /** * An existing conversation has received a new message, either from API or * telephony. It is configured in * ConversationProfile.new_message_event_notification_config * * Value: "NEW_MESSAGE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_NewMessage; /** * Type not set. * * Value: "TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_TypeUnspecified; /** * Unrecoverable error during a telephone call. In general non-recoverable * errors only occur if something was misconfigured in the ConversationProfile * corresponding to the call. After a non-recoverable error, Dialogflow may * stop responding. We don't fire this event: * in an API call because we can * directly return the error, or, * when we can recover from an error. * * Value: "UNRECOVERABLE_ERROR" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_UnrecoverableError; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType.autoExpansionMode /** * Allows an agent to recognize values that have not been explicitly listed in * the entity. * * Value: "AUTO_EXPANSION_MODE_DEFAULT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_AutoExpansionMode_AutoExpansionModeDefault; /** * Auto expansion disabled for the entity. * * Value: "AUTO_EXPANSION_MODE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_AutoExpansionMode_AutoExpansionModeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType.kind /** * List entity types contain a set of entries that do not map to reference * values. However, list entity types can contain references to other entity * types (with or without aliases). * * Value: "KIND_LIST" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_Kind_KindList; /** * Map entity types allow mapping of a group of synonyms to a reference value. * * Value: "KIND_MAP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_Kind_KindMap; /** * Regexp entity types allow to specify regular expressions in entries values. * * Value: "KIND_REGEXP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_Kind_KindRegexp; /** * Not specified. This value should be never used. * * Value: "KIND_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_Kind_KindUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1Intent.defaultResponsePlatforms /** * Google Assistant See [Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) * * Value: "ACTIONS_ON_GOOGLE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_ActionsOnGoogle; /** * Facebook. * * Value: "FACEBOOK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_Facebook; /** * Google Hangouts. * * Value: "GOOGLE_HANGOUTS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_GoogleHangouts; /** * Kik. * * Value: "KIK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_Kik; /** * Line. * * Value: "LINE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_Line; /** * Not specified. * * Value: "PLATFORM_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_PlatformUnspecified; /** * Skype. * * Value: "SKYPE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_Skype; /** * Slack. * * Value: "SLACK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_Slack; /** * Telegram. * * Value: "TELEGRAM" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_Telegram; /** * Telephony Gateway. * * Value: "TELEPHONY" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_Telephony; /** * Viber. * * Value: "VIBER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_DefaultResponsePlatforms_Viber; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1Intent.webhookState /** * Webhook is enabled in the agent and in the intent. * * Value: "WEBHOOK_STATE_ENABLED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_WebhookState_WebhookStateEnabled; /** * Webhook is enabled in the agent and in the intent. Also, each slot filling * prompt is forwarded to the webhook. * * Value: "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_WebhookState_WebhookStateEnabledForSlotFilling; /** * Webhook is disabled in the agent and in the intent. * * Value: "WEBHOOK_STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_WebhookState_WebhookStateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage.platform /** * Google Assistant See [Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) * * Value: "ACTIONS_ON_GOOGLE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_ActionsOnGoogle; /** * Facebook. * * Value: "FACEBOOK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Facebook; /** * Google Hangouts. * * Value: "GOOGLE_HANGOUTS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_GoogleHangouts; /** * Kik. * * Value: "KIK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Kik; /** * Line. * * Value: "LINE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Line; /** * Not specified. * * Value: "PLATFORM_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_PlatformUnspecified; /** * Skype. * * Value: "SKYPE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Skype; /** * Slack. * * Value: "SLACK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Slack; /** * Telegram. * * Value: "TELEGRAM" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Telegram; /** * Telephony Gateway. * * Value: "TELEPHONY" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Telephony; /** * Viber. * * Value: "VIBER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Viber; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard.imageDisplayOptions /** * Pad the gaps between image and image frame with a blurred copy of the same * image. * * Value: "BLURRED_BACKGROUND" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_BlurredBackground; /** * Image is scaled such that the image width and height match or exceed the * container dimensions. This may crop the top and bottom of the image if the * scaled image height is greater than the container height, or crop the left * and right of the image if the scaled image width is greater than the * container width. This is similar to "Zoom Mode" on a widescreen TV when * playing a 4:3 video. * * Value: "CROPPED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_Cropped; /** * Fill the gaps between the image and the image container with gray bars. * * Value: "GRAY" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_Gray; /** * Fill the gaps between the image and the image container with gray bars. * * Value: "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_ImageDisplayOptionsUnspecified; /** * Fill the gaps between the image and the image container with white bars. * * Value: "WHITE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_White; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction.urlTypeHint /** * Url would be an amp action * * Value: "AMP_ACTION" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_AmpAction; /** * URL that points directly to AMP content, or to a canonical URL which refers * to AMP content via . * * Value: "AMP_CONTENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_AmpContent; /** * Unspecified * * Value: "URL_TYPE_HINT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_UrlTypeHintUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties.horizontalAlignment /** * Text is centered in the column. * * Value: "CENTER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties_HorizontalAlignment_Center; /** * Text is aligned to the leading edge of the column. * * Value: "HORIZONTAL_ALIGNMENT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties_HorizontalAlignment_HorizontalAlignmentUnspecified; /** * Text is aligned to the leading edge of the column. * * Value: "LEADING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties_HorizontalAlignment_Leading; /** * Text is aligned to the trailing edge of the column. * * Value: "TRAILING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties_HorizontalAlignment_Trailing; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContent.mediaType /** * Response media type is audio. * * Value: "AUDIO" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContent_MediaType_Audio; /** * Unspecified. * * Value: "RESPONSE_MEDIA_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContent_MediaType_ResponseMediaTypeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia.height /** * Not specified. * * Value: "HEIGHT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia_Height_HeightUnspecified; /** * 168 DP. * * Value: "MEDIUM" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia_Height_Medium; /** * 112 DP. * * Value: "SHORT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia_Height_Short; /** * 264 DP. Not available for rich card carousels when the card width is set to * small. * * Value: "TALL" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia_Height_Tall; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard.cardWidth /** * Not specified. * * Value: "CARD_WIDTH_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard_CardWidth_CardWidthUnspecified; /** * 232 DP. * * Value: "MEDIUM" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard_CardWidth_Medium; /** * 120 DP. Note that tall media cannot be used. * * Value: "SMALL" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard_CardWidth_Small; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard.cardOrientation /** * Not specified. * * Value: "CARD_ORIENTATION_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_CardOrientation_CardOrientationUnspecified; /** * Horizontal layout. * * Value: "HORIZONTAL" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_CardOrientation_Horizontal; /** * Vertical layout. * * Value: "VERTICAL" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_CardOrientation_Vertical; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard.thumbnailImageAlignment /** * Thumbnail preview is left-aligned. * * Value: "LEFT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_ThumbnailImageAlignment_Left; /** * Thumbnail preview is right-aligned. * * Value: "RIGHT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_ThumbnailImageAlignment_Right; /** * Not specified. * * Value: "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_ThumbnailImageAlignment_ThumbnailImageAlignmentUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase.type /** * Examples do not contain \@-prefixed entity type names, but example parts can * be annotated with entity types. * * Value: "EXAMPLE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase_Type_Example; /** * Templates are not annotated with entity types, but they can contain * \@-prefixed entity type names as substrings. Template mode has been * deprecated. Example mode is the only supported way to create new training * phrases. If you have existing training phrases that you've created in * template mode, those will continue to work. * * Value: "TEMPLATE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase_Type_Template; /** * Not specified. This value should never be used. * * Value: "TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase_Type_TypeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer.matchConfidenceLevel /** * Indicates our confidence is high. * * Value: "HIGH" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer_MatchConfidenceLevel_High; /** * Indicates that the confidence is low. * * Value: "LOW" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer_MatchConfidenceLevel_Low; /** * Not specified. * * Value: "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer_MatchConfidenceLevel_MatchConfidenceLevelUnspecified; /** * Indicates our confidence is medium. * * Value: "MEDIUM" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer_MatchConfidenceLevel_Medium; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata.state /** * The operation is done, either cancelled or completed. * * Value: "DONE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata_State_Done; /** * The operation has been created. * * Value: "PENDING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata_State_Pending; /** * The operation is currently running. * * Value: "RUNNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata_State_Running; /** * State unspecified. * * Value: "STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata_State_StateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1Message.participantRole /** * Participant is an automated agent, such as a Dialogflow agent. * * Value: "AUTOMATED_AGENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Message_ParticipantRole_AutomatedAgent; /** * Participant is an end user that has called or chatted with Dialogflow * services. * * Value: "END_USER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Message_ParticipantRole_EndUser; /** * Participant is a human agent. * * Value: "HUMAN_AGENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Message_ParticipantRole_HumanAgent; /** * Participant role not set. * * Value: "ROLE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1Message_ParticipantRole_RoleUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType.entityOverrideMode /** * The collection of session entities overrides the collection of entities in * the corresponding custom entity type. * * Value: "ENTITY_OVERRIDE_MODE_OVERRIDE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType_EntityOverrideMode_EntityOverrideModeOverride; /** * The collection of session entities extends the collection of entities in the * corresponding custom entity type. Note: Even in this override mode calls to * `ListSessionEntityTypes`, `GetSessionEntityType`, `CreateSessionEntityType` * and `UpdateSessionEntityType` only return the additional entities added in * this session entity type. If you want to get the supplemented list, please * call EntityTypes.GetEntityType on the custom entity type and merge. * * Value: "ENTITY_OVERRIDE_MODE_SUPPLEMENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType_EntityOverrideMode_EntityOverrideModeSupplement; /** * Not specified. This value should be never used. * * Value: "ENTITY_OVERRIDE_MODE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType_EntityOverrideMode_EntityOverrideModeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent.type /** * An existing conversation has closed. This is fired when a telephone call is * terminated, or a conversation is closed via the API. * * Value: "CONVERSATION_FINISHED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_ConversationFinished; /** * A new conversation has been opened. This is fired when a telephone call is * answered, or a conversation is created via the API. * * Value: "CONVERSATION_STARTED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_ConversationStarted; /** * An existing conversation has received notification from Dialogflow that * human intervention is required. * * Value: "HUMAN_INTERVENTION_NEEDED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_HumanInterventionNeeded; /** * An existing conversation has received a new message, either from API or * telephony. It is configured in * ConversationProfile.new_message_event_notification_config * * Value: "NEW_MESSAGE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_NewMessage; /** * Type not set. * * Value: "TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_TypeUnspecified; /** * Unrecoverable error during a telephone call. In general non-recoverable * errors only occur if something was misconfigured in the ConversationProfile * corresponding to the call. After a non-recoverable error, Dialogflow may * stop responding. We don't fire this event: * in an API call because we can * directly return the error, or, * when we can recover from an error. * * Value: "UNRECOVERABLE_ERROR" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_UnrecoverableError; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2EntityType.autoExpansionMode /** * Allows an agent to recognize values that have not been explicitly listed in * the entity. * * Value: "AUTO_EXPANSION_MODE_DEFAULT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_AutoExpansionMode_AutoExpansionModeDefault; /** * Auto expansion disabled for the entity. * * Value: "AUTO_EXPANSION_MODE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_AutoExpansionMode_AutoExpansionModeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2EntityType.kind /** * List entity types contain a set of entries that do not map to reference * values. However, list entity types can contain references to other entity * types (with or without aliases). * * Value: "KIND_LIST" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_Kind_KindList; /** * Map entity types allow mapping of a group of synonyms to a reference value. * * Value: "KIND_MAP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_Kind_KindMap; /** * Regexp entity types allow to specify regular expressions in entries values. * * Value: "KIND_REGEXP" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_Kind_KindRegexp; /** * Not specified. This value should be never used. * * Value: "KIND_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_Kind_KindUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2Intent.defaultResponsePlatforms /** * Google Assistant See [Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) * * Value: "ACTIONS_ON_GOOGLE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_ActionsOnGoogle; /** * Facebook. * * Value: "FACEBOOK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_Facebook; /** * Google Hangouts. * * Value: "GOOGLE_HANGOUTS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_GoogleHangouts; /** * Kik. * * Value: "KIK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_Kik; /** * Line. * * Value: "LINE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_Line; /** * Default platform. * * Value: "PLATFORM_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_PlatformUnspecified; /** * Skype. * * Value: "SKYPE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_Skype; /** * Slack. * * Value: "SLACK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_Slack; /** * Telegram. * * Value: "TELEGRAM" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_Telegram; /** * Viber. * * Value: "VIBER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_DefaultResponsePlatforms_Viber; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2Intent.webhookState /** * Webhook is enabled in the agent and in the intent. * * Value: "WEBHOOK_STATE_ENABLED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_WebhookState_WebhookStateEnabled; /** * Webhook is enabled in the agent and in the intent. Also, each slot filling * prompt is forwarded to the webhook. * * Value: "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_WebhookState_WebhookStateEnabledForSlotFilling; /** * Webhook is disabled in the agent and in the intent. * * Value: "WEBHOOK_STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Intent_WebhookState_WebhookStateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage.platform /** * Google Assistant See [Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) * * Value: "ACTIONS_ON_GOOGLE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_ActionsOnGoogle; /** * Facebook. * * Value: "FACEBOOK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Facebook; /** * Google Hangouts. * * Value: "GOOGLE_HANGOUTS" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_GoogleHangouts; /** * Kik. * * Value: "KIK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Kik; /** * Line. * * Value: "LINE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Line; /** * Default platform. * * Value: "PLATFORM_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_PlatformUnspecified; /** * Skype. * * Value: "SKYPE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Skype; /** * Slack. * * Value: "SLACK" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Slack; /** * Telegram. * * Value: "TELEGRAM" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Telegram; /** * Viber. * * Value: "VIBER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Viber; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard.imageDisplayOptions /** * Pad the gaps between image and image frame with a blurred copy of the same * image. * * Value: "BLURRED_BACKGROUND" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_BlurredBackground; /** * Image is scaled such that the image width and height match or exceed the * container dimensions. This may crop the top and bottom of the image if the * scaled image height is greater than the container height, or crop the left * and right of the image if the scaled image width is greater than the * container width. This is similar to "Zoom Mode" on a widescreen TV when * playing a 4:3 video. * * Value: "CROPPED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_Cropped; /** * Fill the gaps between the image and the image container with gray bars. * * Value: "GRAY" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_Gray; /** * Fill the gaps between the image and the image container with gray bars. * * Value: "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_ImageDisplayOptionsUnspecified; /** * Fill the gaps between the image and the image container with white bars. * * Value: "WHITE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_White; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction.urlTypeHint /** * Url would be an amp action * * Value: "AMP_ACTION" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_AmpAction; /** * URL that points directly to AMP content, or to a canonical URL which refers * to AMP content via . * * Value: "AMP_CONTENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_AmpContent; /** * Unspecified * * Value: "URL_TYPE_HINT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_UrlTypeHintUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties.horizontalAlignment /** * Text is centered in the column. * * Value: "CENTER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties_HorizontalAlignment_Center; /** * Text is aligned to the leading edge of the column. * * Value: "HORIZONTAL_ALIGNMENT_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties_HorizontalAlignment_HorizontalAlignmentUnspecified; /** * Text is aligned to the leading edge of the column. * * Value: "LEADING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties_HorizontalAlignment_Leading; /** * Text is aligned to the trailing edge of the column. * * Value: "TRAILING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties_HorizontalAlignment_Trailing; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContent.mediaType /** * Response media type is audio. * * Value: "AUDIO" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContent_MediaType_Audio; /** * Unspecified. * * Value: "RESPONSE_MEDIA_TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContent_MediaType_ResponseMediaTypeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase.type /** * Examples do not contain \@-prefixed entity type names, but example parts can * be annotated with entity types. * * Value: "EXAMPLE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase_Type_Example; /** * Templates are not annotated with entity types, but they can contain * \@-prefixed entity type names as substrings. Template mode has been * deprecated. Example mode is the only supported way to create new training * phrases. If you have existing training phrases that you've created in * template mode, those will continue to work. * * Value: "TEMPLATE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase_Type_Template; /** * Not specified. This value should never be used. * * Value: "TYPE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase_Type_TypeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata.state /** * The operation is done, either cancelled or completed. * * Value: "DONE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata_State_Done; /** * The operation has been created. * * Value: "PENDING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata_State_Pending; /** * The operation is currently running. * * Value: "RUNNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata_State_Running; /** * State unspecified. * * Value: "STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata_State_StateUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2Message.participantRole /** * Participant is an automated agent, such as a Dialogflow agent. * * Value: "AUTOMATED_AGENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Message_ParticipantRole_AutomatedAgent; /** * Participant is an end user that has called or chatted with Dialogflow * services. * * Value: "END_USER" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Message_ParticipantRole_EndUser; /** * Participant is a human agent. * * Value: "HUMAN_AGENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Message_ParticipantRole_HumanAgent; /** * Participant role not set. * * Value: "ROLE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2Message_ParticipantRole_RoleUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType.entityOverrideMode /** * The collection of session entities overrides the collection of entities in * the corresponding custom entity type. * * Value: "ENTITY_OVERRIDE_MODE_OVERRIDE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType_EntityOverrideMode_EntityOverrideModeOverride; /** * The collection of session entities extends the collection of entities in the * corresponding custom entity type. Note: Even in this override mode calls to * `ListSessionEntityTypes`, `GetSessionEntityType`, `CreateSessionEntityType` * and `UpdateSessionEntityType` only return the additional entities added in * this session entity type. If you want to get the supplemented list, please * call EntityTypes.GetEntityType on the custom entity type and merge. * * Value: "ENTITY_OVERRIDE_MODE_SUPPLEMENT" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType_EntityOverrideMode_EntityOverrideModeSupplement; /** * Not specified. This value should be never used. * * Value: "ENTITY_OVERRIDE_MODE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType_EntityOverrideMode_EntityOverrideModeUnspecified; // ---------------------------------------------------------------------------- // GTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata.state /** * The operation is done, either cancelled or completed. * * Value: "DONE" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata_State_Done; /** * The operation has been created. * * Value: "PENDING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata_State_Pending; /** * The operation is currently running. * * Value: "RUNNING" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata_State_Running; /** * State unspecified. * * Value: "STATE_UNSPECIFIED" */ FOUNDATION_EXTERN NSString * const kGTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata_State_StateUnspecified; /** * Hierarchical advanced settings for agent/flow/page/fulfillment/parameter. * Settings exposed at lower level overrides the settings exposed at higher * level. Hierarchy: Agent->Flow->Page->Fulfillment/Parameter. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3AdvancedSettings : GTLRObject /** * Settings for logging. Settings for Dialogflow History, Contact Center * messages, StackDriver logs, and speech logging. Exposed at the following * levels: - Agent level. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3AdvancedSettingsLoggingSettings *loggingSettings; @end /** * Define behaviors on logging. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3AdvancedSettingsLoggingSettings : GTLRObject /** * If true, DF Interaction logging is currently enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableInteractionLogging; /** * If true, StackDriver logging is currently enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableStackdriverLogging; @end /** * Agents are best described as Natural Language Understanding (NLU) modules * that transform user requests into actionable data. You can include agents in * your app, product, or service to determine user intent and respond to the * user in a natural way. After you create an agent, you can add Intents, * Entity Types, Flows, Fulfillments, Webhooks, and so on to manage the * conversation flows.. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Agent : GTLRObject /** * Hierarchical advanced settings for this agent. The settings exposed at the * lower level overrides the settings exposed at the higher level. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3AdvancedSettings *advancedSettings; /** * The URI of the agent's avatar. Avatars are used throughout the Dialogflow * console and in the self-hosted [Web * Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) * integration. */ @property(nonatomic, copy, nullable) NSString *avatarUri; /** * Required. Immutable. The default language of the agent as a language tag. * See [Language * Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) for * a list of the currently supported language codes. This field cannot be set * by the Agents.UpdateAgent method. */ @property(nonatomic, copy, nullable) NSString *defaultLanguageCode; /** * The description of the agent. The maximum length is 500 characters. If * exceeded, the request is rejected. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Required. The human-readable name of the agent, unique within the location. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Indicates if automatic spell correction is enabled in detect intent * requests. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableSpellCorrection; /** * Indicates if stackdriver logging is enabled for the agent. Please use * agent.advanced_settings instead. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableStackdriverLogging; /** * The unique identifier of the agent. Required for the Agents.UpdateAgent * method. Agents.CreateAgent populates the name automatically. Format: * `projects//locations//agents/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * Name of the SecuritySettings reference for the agent. Format: * `projects//locations//securitySettings/`. */ @property(nonatomic, copy, nullable) NSString *securitySettings; /** Speech recognition related settings. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3SpeechToTextSettings *speechToTextSettings; /** * Immutable. Name of the start flow in this agent. A start flow will be * automatically created when the agent is created, and can only be deleted by * deleting the agent. Format: `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *startFlow; /** * The list of all languages supported by the agent (except for the * `default_language_code`). */ @property(nonatomic, strong, nullable) NSArray<NSString *> *supportedLanguageCodes; /** * Required. The time zone of the agent from the [time zone * database](https://www.iana.org/time-zones), e.g., America/New_York, * Europe/Paris. */ @property(nonatomic, copy, nullable) NSString *timeZone; @end /** * The response message for Agents.GetAgentValidationResult. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3AgentValidationResult : GTLRObject /** Contains all flow validation results. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3FlowValidationResult *> *flowValidationResults; /** * The unique identifier of the agent validation result. Format: * `projects//locations//agents//validationResult`. */ @property(nonatomic, copy, nullable) NSString *name; @end /** * Represents the natural speech audio to be processed. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3AudioInput : GTLRObject /** * The natural language speech audio to be processed. A single request can * contain up to 1 minute of speech audio data. The transcribed text cannot * contain more than 256 bytes. For non-streaming audio detect intent, both * `config` and `audio` must be provided. For streaming audio detect intent, * `config` must be provided in the first request and `audio` must be provided * in all following requests. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *audio; /** * Required. Instructs the speech recognizer how to process the speech audio. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig *config; @end /** * The request message for TestCases.BatchDeleteTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3BatchDeleteTestCasesRequest : GTLRObject /** * Required. Format of test case names: `projects//locations/ * /agents//testCases/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *names; @end /** * Metadata returned for the TestCases.BatchRunTestCases long running * operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3BatchRunTestCasesMetadata : GTLRObject /** The test errors. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TestError *> *errors; @end /** * The request message for TestCases.BatchRunTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3BatchRunTestCasesRequest : GTLRObject /** * Optional. If not set, draft environment is assumed. Format: * `projects//locations//agents//environments/`. */ @property(nonatomic, copy, nullable) NSString *environment; /** Required. Format: `projects//locations//agents//testCases/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *testCases; @end /** * The response message for TestCases.BatchRunTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3BatchRunTestCasesResponse : GTLRObject /** * The test case results. The detailed conversation turns are empty in this * response. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult *> *results; @end /** * Represents the natural speech audio to be processed. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1AudioInput : GTLRObject /** * The natural language speech audio to be processed. A single request can * contain up to 1 minute of speech audio data. The transcribed text cannot * contain more than 256 bytes. For non-streaming audio detect intent, both * `config` and `audio` must be provided. For streaming audio detect intent, * `config` must be provided in the first request and `audio` must be provided * in all following requests. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *audio; /** * Required. Instructs the speech recognizer how to process the speech audio. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig *config; @end /** * Metadata returned for the TestCases.BatchRunTestCases long running * operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1BatchRunTestCasesMetadata : GTLRObject /** The test errors. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestError *> *errors; @end /** * The response message for TestCases.BatchRunTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1BatchRunTestCasesResponse : GTLRObject /** * The test case results. The detailed conversation turns are empty in this * response. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult *> *results; @end /** * Represents a result from running a test case in an agent environment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult : GTLRObject /** * The resource name for the continuous test result. Format: * `projects//locations//agents//environments//continuousTestResults/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * The result of this continuous test run, i.e. whether all the tests in this * continuous test run pass or not. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult_Result_AggregatedTestResultUnspecified * Not specified. Should never be used. (Value: * "AGGREGATED_TEST_RESULT_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult_Result_Failed * At least one test did not pass. (Value: "FAILED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult_Result_Passed * All the tests passed. (Value: "PASSED") */ @property(nonatomic, copy, nullable) NSString *result; /** Time when the continuous testing run starts. */ @property(nonatomic, strong, nullable) GTLRDateTime *runTime; /** * A list of individual test case results names in this continuous test run. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *testCaseResults; @end /** * One interaction between a human and virtual agent. The human provides some * input and the virtual agent provides a response. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurn : GTLRObject /** The user input. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput *userInput; /** The virtual agent output. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput *virtualAgentOutput; @end /** * The input from the human user. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput : GTLRObject /** * Whether sentiment analysis is enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableSentimentAnalysis; /** * Parameters that need to be injected into the conversation during intent * detection. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput_InjectedParameters *injectedParameters; /** Supports text input, event input, dtmf input in the test case. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1QueryInput *input; /** * If webhooks should be allowed to trigger in response to the user utterance. * Often if parameters are injected, webhooks should not be enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isWebhookEnabled; @end /** * Parameters that need to be injected into the conversation during intent * detection. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput_InjectedParameters : GTLRObject @end /** * The output from the virtual agent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput : GTLRObject /** * The Page on which the utterance was spoken. Only name and displayName will * be set. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Page *currentPage; /** * Required. Input only. The diagnostic info output for the turn. Required to * calculate the testing coverage. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput_DiagnosticInfo *diagnosticInfo; /** * Output only. If this is part of a result conversation turn, the list of * differences between the original run and the replay for this output, if any. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference *> *differences; /** The session parameters available to the bot at this point. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput_SessionParameters *sessionParameters; /** * Response error from the agent in the test result. If set, other output is * empty. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *status; /** The text responses from the agent for the turn. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageText *> *textResponses; /** * The Intent that triggered the response. Only name and displayName will be * set. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Intent *triggeredIntent; @end /** * Required. Input only. The diagnostic info output for the turn. Required to * calculate the testing coverage. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput_DiagnosticInfo : GTLRObject @end /** * The session parameters available to the bot at this point. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput_SessionParameters : GTLRObject @end /** * Metadata for CreateDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1CreateDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Metadata associated with the long running operation for * Versions.CreateVersion. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata : GTLRObject /** * Name of the created version. Format: * `projects//locations//agents//flows//versions/`. */ @property(nonatomic, copy, nullable) NSString *version; @end /** * Metadata for DeleteDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1DeleteDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Metadata returned for the Environments.DeployFlow long running operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1DeployFlowMetadata : GTLRObject /** Errors of running deployment tests. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestError *> *testErrors; @end /** * The response message for Environments.DeployFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1DeployFlowResponse : GTLRObject /** * The name of the flow version deployment. Format: * `projects//locations//agents// environments//deployments/`. */ @property(nonatomic, copy, nullable) NSString *deployment; /** The updated environment where the flow is deployed. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Environment *environment; @end /** * Represents the input for dtmf event. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1DtmfInput : GTLRObject /** The dtmf digits. */ @property(nonatomic, copy, nullable) NSString *digits; /** The finish digit (if any). */ @property(nonatomic, copy, nullable) NSString *finishDigit; @end /** * Represents an environment for an agent. You can create multiple versions of * your agent and publish them to separate environments. When you edit an * agent, you are editing the draft agent. At any point, you can save the draft * agent as an agent version, which is an immutable snapshot of your agent. * When you save the draft agent, it is published to the default environment. * When you create agent versions, you can publish them to custom environments. * You can create a variety of custom environments for testing, development, * production, etc. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Environment : GTLRObject /** * The human-readable description of the environment. The maximum length is 500 * characters. If exceeded, the request is rejected. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Required. The human-readable name of the environment (unique in an agent). * Limit of 64 characters. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * The name of the environment. Format: * `projects//locations//agents//environments/`. */ @property(nonatomic, copy, nullable) NSString *name; /** The test cases config for continuous tests of this environment. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EnvironmentTestCasesConfig *testCasesConfig; /** Output only. Update time of this environment. */ @property(nonatomic, strong, nullable) GTLRDateTime *updateTime; /** * Required. A list of configurations for flow versions. You should include * version configs for all flows that are reachable from `Start Flow` in the * agent. Otherwise, an error will be returned. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EnvironmentVersionConfig *> *versionConfigs; @end /** * The configuration for continuous tests. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EnvironmentTestCasesConfig : GTLRObject /** * Whether to run test cases in TestCasesConfig.test_cases periodically. * Default false. If set to true, run once a day. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableContinuousRun; /** * Whether to run test cases in TestCasesConfig.test_cases before deploying a * flow version to the environment. Default false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enablePredeploymentRun; /** * A list of test case names to run. They should be under the same agent. * Format of each test case name: `projects//locations/ /agents//testCases/` */ @property(nonatomic, strong, nullable) NSArray<NSString *> *testCases; @end /** * Configuration for the version. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EnvironmentVersionConfig : GTLRObject /** Required. Format: projects//locations//agents//flows//versions/. */ @property(nonatomic, copy, nullable) NSString *version; @end /** * An event handler specifies an event that can be handled during a session. * When the specified event happens, the following actions are taken in order: * * If there is a `trigger_fulfillment` associated with the event, it will be * called. * If there is a `target_page` associated with the event, the session * will transition into the specified page. * If there is a `target_flow` * associated with the event, the session will transition into the specified * flow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EventHandler : GTLRObject /** Required. The name of the event to handle. */ @property(nonatomic, copy, nullable) NSString *event; /** Output only. The unique identifier of this event handler. */ @property(nonatomic, copy, nullable) NSString *name; /** * The target flow to transition to. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *targetFlow; /** * The target page to transition to. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *targetPage; /** * The fulfillment to call when the event occurs. Handling webhook errors with * a fulfillment enabled with webhook could cause infinite loop. It is invalid * to specify such fulfillment for a handler handling webhooks. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Fulfillment *triggerFulfillment; @end /** * Represents the event to trigger. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EventInput : GTLRObject /** Name of the event. */ @property(nonatomic, copy, nullable) NSString *event; @end /** * The response message for Agents.ExportAgent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ExportAgentResponse : GTLRObject /** * Uncompressed raw byte content for agent. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *agentContent; /** * The URI to a file containing the exported agent. This field is populated * only if `agent_uri` is specified in ExportAgentRequest. */ @property(nonatomic, copy, nullable) NSString *agentUri; @end /** * The response message for Flows.ExportFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ExportFlowResponse : GTLRObject /** * Uncompressed raw byte content for flow. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *flowContent; /** * The URI to a file containing the exported flow. This field is populated only * if `flow_uri` is specified in ExportFlowRequest. */ @property(nonatomic, copy, nullable) NSString *flowUri; @end /** * Metadata returned for the TestCases.ExportTestCases long running operation. * This message currently has no fields. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ExportTestCasesMetadata : GTLRObject @end /** * The response message for TestCases.ExportTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ExportTestCasesResponse : GTLRObject /** * Uncompressed raw byte content for test cases. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *content; /** * The URI to a file containing the exported test cases. This field is * populated only if `gcs_uri` is specified in ExportTestCasesRequest. */ @property(nonatomic, copy, nullable) NSString *gcsUri; @end /** * A form is a data model that groups related parameters that can be collected * from the user. The process in which the agent prompts the user and collects * parameter values from the user is called form filling. A form can be added * to a page. When form filling is done, the filled parameters will be written * to the session. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Form : GTLRObject /** Parameters to collect from the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FormParameter *> *parameters; @end /** * Represents a form parameter. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FormParameter : GTLRObject /** * The default value of an optional parameter. If the parameter is required, * the default value will be ignored. * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id defaultValue; /** * Required. The human-readable name of the parameter, unique within the form. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Required. The entity type of the parameter. Format: * `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for * example, `projects/-/locations/-/agents/-/entityTypes/sys.date`), or * `projects//locations//agents//entityTypes/` for developer entity types. */ @property(nonatomic, copy, nullable) NSString *entityType; /** Required. Defines fill behavior for the parameter. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior *fillBehavior; /** * Indicates whether the parameter represents a list of values. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isList; /** * Indicates whether the parameter content should be redacted in log. If * redaction is enabled, the parameter content will be replaced by parameter * name during logging. Note: the parameter content is subject to redaction if * either parameter level redaction or entity type level redaction is enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *redact; /** * Indicates whether the parameter is required. Optional parameters will not * trigger prompts; however, they are filled if the user specifies them. * Required parameters must be filled before form filling concludes. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *required; @end /** * Configuration for how the filling of a parameter should be handled. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior : GTLRObject /** * Required. The fulfillment to provide the initial prompt that the agent can * present to the user in order to fill the parameter. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Fulfillment *initialPromptFulfillment; /** * The handlers for parameter-level events, used to provide reprompt for the * parameter or transition to a different page/flow. The supported events are: * * `sys.no-match-`, where N can be from 1 to 6 * `sys.no-match-default` * * `sys.no-input-`, where N can be from 1 to 6 * `sys.no-input-default` * * `sys.invalid-parameter` `initial_prompt_fulfillment` provides the first * prompt for the parameter. If the user's response does not fill the * parameter, a no-match/no-input event will be triggered, and the fulfillment * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if defined) * will be called to provide a prompt. The `sys.no-match-2`/`sys.no-input-2` * handler (if defined) will respond to the next no-match/no-input event, and * so on. A `sys.no-match-default` or `sys.no-input-default` handler will be * used to handle all following no-match/no-input events after all numbered * no-match/no-input handlers for the parameter are consumed. A * `sys.invalid-parameter` handler can be defined to handle the case where the * parameter values have been `invalidated` by webhook. For example, if the * user's response fill the parameter, however the parameter was invalidated by * webhook, the fulfillment associated with the `sys.invalid-parameter` handler * (if defined) will be called to provide a prompt. If the event handler for * the corresponding event can't be found on the parameter, * `initial_prompt_fulfillment` will be re-prompted. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EventHandler *> *repromptEventHandlers; @end /** * A fulfillment can do one or more of the following actions at the same time: * * Generate rich message responses. * Set parameter values. * Call the * webhook. Fulfillments can be called at various stages in the Page or Form * lifecycle. For example, when a DetectIntentRequest drives a session to enter * a new page, the page's entry fulfillment can add a static response to the * QueryResult in the returning DetectIntentResponse, call the webhook (for * example, to load user data from a database), or both. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Fulfillment : GTLRObject /** Conditional cases for this fulfillment. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases *> *conditionalCases; /** The list of rich message responses to present to the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage *> *messages; /** * Whether Dialogflow should return currently queued fulfillment response * messages in streaming APIs. If a webhook is specified, it happens before * Dialogflow invokes webhook. Warning: 1) This flag only affects streaming * API. Responses are still queued and returned once in non-streaming API. 2) * The flag can be enabled in any fulfillment but only the first 3 partial * responses will be returned. You may only want to apply it to fulfillments * that have slow webhooks. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *returnPartialResponses; /** Set parameter values before executing the webhook. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction *> *setParameterActions; /** * The tag used by the webhook to identify which fulfillment is being called. * This field is required if `webhook` is specified. */ @property(nonatomic, copy, nullable) NSString *tag; /** The webhook to call. Format: `projects//locations//agents//webhooks/`. */ @property(nonatomic, copy, nullable) NSString *webhook; @end /** * A list of cascading if-else conditions. Cases are mutually exclusive. The * first one with a matching condition is selected, all the rest ignored. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases : GTLRObject /** A list of cascading if-else conditions. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase *> *cases; @end /** * Each case has a Boolean condition. When it is evaluated to be True, the * corresponding messages will be selected and evaluated recursively. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase : GTLRObject /** A list of case content. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent *> *caseContent; /** * The condition to activate and select this case. Empty means the condition is * always true. The condition is evaluated against form parameters or session * parameters. See the [conditions * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). */ @property(nonatomic, copy, nullable) NSString *condition; @end /** * The list of messages or conditional cases to activate for this case. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent : GTLRObject /** Additional cases to be evaluated. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases *additionalCases; /** Returned message. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage *message; @end /** * Setting a parameter value. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction : GTLRObject /** Display name of the parameter. */ @property(nonatomic, copy, nullable) NSString *parameter; /** * The new value of the parameter. A null value clears the parameter. * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id value; @end /** * Metadata in google::longrunning::Operation for Knowledge operations. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata : GTLRObject /** * Required. Output only. The current state of this operation. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata_State_Done * The operation is done, either cancelled or completed. (Value: "DONE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata_State_Pending * The operation has been created. (Value: "PENDING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata_State_Running * The operation is currently running. (Value: "RUNNING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata_State_StateUnspecified * State unspecified. (Value: "STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *state; @end /** * Metadata for ImportDocuments operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ImportDocumentsOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Response message for Documents.ImportDocuments. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ImportDocumentsResponse : GTLRObject /** Includes details about skipped documents or any other warnings. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleRpcStatus *> *warnings; @end /** * The response message for Flows.ImportFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ImportFlowResponse : GTLRObject /** * The unique identifier of the new flow. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *flow; @end /** * Metadata returned for the TestCases.ImportTestCases long running operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ImportTestCasesMetadata : GTLRObject /** Errors for failed test cases. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseError *> *errors; @end /** * The response message for TestCases.ImportTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ImportTestCasesResponse : GTLRObject /** * The unique identifiers of the new test cases. Format: * `projects//locations//agents//testCases/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *names; @end /** * Instructs the speech recognizer on how to process the audio content. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig : GTLRObject /** * Required. Audio encoding of the audio content to process. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingAmr * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be * 8000. (Value: "AUDIO_ENCODING_AMR") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingAmrWb * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. * (Value: "AUDIO_ENCODING_AMR_WB") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingFlac * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless * Audio Codec) is the recommended encoding because it is lossless * (therefore recognition is not compromised) and requires only about * half the bandwidth of `LINEAR16`. `FLAC` stream encoding supports * 16-bit and 24-bit samples, however, not all fields in `STREAMINFO` are * supported. (Value: "AUDIO_ENCODING_FLAC") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingLinear16 * Uncompressed 16-bit signed little-endian samples (Linear PCM). (Value: * "AUDIO_ENCODING_LINEAR_16") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingMulaw * 8-bit samples that compand 14-bit audio samples using G.711 * PCMU/mu-law. (Value: "AUDIO_ENCODING_MULAW") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingOggOpus * Opus encoded audio frames in Ogg container * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must * be 16000. (Value: "AUDIO_ENCODING_OGG_OPUS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingSpeexWithHeaderByte * Although the use of lossy encodings is not recommended, if a very low * bitrate encoding is required, `OGG_OPUS` is highly preferred over * Speex encoding. The [Speex](https://speex.org/) encoding supported by * Dialogflow API has a header byte in each block, as in MIME type * `audio/x-speex-with-header-byte`. It is a variant of the RTP Speex * encoding defined in [RFC 5574](https://tools.ietf.org/html/rfc5574). * The stream is a sequence of blocks, one block per RTP packet. Each * block starts with a byte containing the length of the block, in bytes, * followed by one or more frames of Speex data, padded to an integral * number of bytes (octets) as specified in RFC 5574. In other words, * each RTP header is replaced with a single byte containing the block * length. Only Speex wideband is supported. `sample_rate_hertz` must be * 16000. (Value: "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_AudioEncoding_AudioEncodingUnspecified * Not specified. (Value: "AUDIO_ENCODING_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *audioEncoding; /** * Optional. If `true`, Dialogflow returns SpeechWordInfo in * StreamingRecognitionResult with information about the recognized speech * words, e.g. start and end time offsets. If false or unspecified, Speech * doesn't return any word-level information. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableWordInfo; /** * Optional. Which Speech model to select for the given request. Select the * model best suited to your domain to get best results. If a model is not * explicitly specified, then we auto-select a model based on the parameters in * the InputAudioConfig. If enhanced speech model is enabled for the agent and * an enhanced version of the specified model for the language does not exist, * then the speech is recognized using the standard version of the specified * model. Refer to [Cloud Speech API * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) * for more details. */ @property(nonatomic, copy, nullable) NSString *model; /** * Optional. Which variant of the Speech model to use. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_ModelVariant_SpeechModelVariantUnspecified * No model variant specified. In this case Dialogflow defaults to * USE_BEST_AVAILABLE. (Value: "SPEECH_MODEL_VARIANT_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_ModelVariant_UseBestAvailable * Use the best available variant of the Speech model that the caller is * eligible for. Please see the [Dialogflow * docs](https://cloud.google.com/dialogflow/docs/data-logging) for how * to make your project eligible for enhanced models. (Value: * "USE_BEST_AVAILABLE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_ModelVariant_UseEnhanced * Use an enhanced model variant: * If an enhanced variant does not exist * for the given model and request language, Dialogflow falls back to the * standard variant. The [Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) * describes which models have enhanced variants. * If the API caller * isn't eligible for enhanced models, Dialogflow returns an error. * Please see the [Dialogflow * docs](https://cloud.google.com/dialogflow/docs/data-logging) for how * to make your project eligible. (Value: "USE_ENHANCED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1InputAudioConfig_ModelVariant_UseStandard * Use standard model variant even if an enhanced model is available. See * the [Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) * for details about enhanced models. (Value: "USE_STANDARD") */ @property(nonatomic, copy, nullable) NSString *modelVariant; /** * Optional. A list of strings containing words and phrases that the speech * recognizer should recognize with higher likelihood. See [the Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) * for more details. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *phraseHints; /** * Sample rate (in Hertz) of the audio content sent in the query. Refer to * [Cloud Speech API * documentation](https://cloud.google.com/speech-to-text/docs/basics) for more * details. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *sampleRateHertz; /** * Optional. If `false` (default), recognition does not cease until the client * closes the stream. If `true`, the recognizer will detect a single spoken * utterance in input audio. Recognition ceases when it detects the audio's * voice has stopped or paused. In this case, once a detected intent is * received, the client should close the stream and start a new request with a * new stream as needed. Note: This setting is relevant only for streaming * methods. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *singleUtterance; @end /** * An intent represents a user's intent to interact with a conversational * agent. You can provide information for the Dialogflow API to use to match * user input to an intent by adding training phrases (i.e., examples of user * input) to your intent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Intent : GTLRObject /** * Human readable description for better understanding an intent like its * scope, content, result etc. Maximum character limit: 140 characters. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Required. The human-readable name of the intent, unique within the agent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Indicates whether this is a fallback intent. Currently only default fallback * intent is allowed in the agent, which is added upon agent creation. Adding * training phrases to fallback intent is useful in the case of requests that * are mistakenly matched, since training phrases assigned to fallback intents * act as negative examples that triggers no-match event. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isFallback; /** * The key/value metadata to label an intent. Labels can contain lowercase * letters, digits and the symbols '-' and '_'. International characters are * allowed, including letters from unicase alphabets. Keys must start with a * letter. Keys and values can be no longer than 63 characters and no more than * 128 bytes. Prefix "sys-" is reserved for Dialogflow defined labels. * Currently allowed Dialogflow defined labels include: * sys-head * * sys-contextual The above labels do not require value. "sys-head" means the * intent is a head intent. "sys-contextual" means the intent is a contextual * intent. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Intent_Labels *labels; /** * The unique identifier of the intent. Required for the Intents.UpdateIntent * method. Intents.CreateIntent populates the name automatically. Format: * `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *name; /** The collection of parameters associated with the intent. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentParameter *> *parameters; /** * The priority of this intent. Higher numbers represent higher priorities. - * If the supplied value is unspecified or 0, the service translates the value * to 500,000, which corresponds to the `Normal` priority in the console. - If * the supplied value is negative, the intent is ignored in runtime detect * intent requests. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *priority; /** * The collection of training phrases the agent is trained on to identify the * intent. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase *> *trainingPhrases; @end /** * The key/value metadata to label an intent. Labels can contain lowercase * letters, digits and the symbols '-' and '_'. International characters are * allowed, including letters from unicase alphabets. Keys must start with a * letter. Keys and values can be no longer than 63 characters and no more than * 128 bytes. Prefix "sys-" is reserved for Dialogflow defined labels. * Currently allowed Dialogflow defined labels include: * sys-head * * sys-contextual The above labels do not require value. "sys-head" means the * intent is a head intent. "sys-contextual" means the intent is a contextual * intent. * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Intent_Labels : GTLRObject @end /** * Represents the intent to trigger programmatically rather than as a result of * natural language processing. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentInput : GTLRObject /** * Required. The unique identifier of the intent. Format: * `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *intent; @end /** * Represents an intent parameter. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentParameter : GTLRObject /** * Required. The entity type of the parameter. Format: * `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for * example, `projects/-/locations/-/agents/-/entityTypes/sys.date`), or * `projects//locations//agents//entityTypes/` for developer entity types. */ @property(nonatomic, copy, nullable) NSString *entityType; /** * Required. The unique identifier of the parameter. This field is used by * training phrases to annotate their parts. * * identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). */ @property(nonatomic, copy, nullable) NSString *identifier; /** * Indicates whether the parameter represents a list of values. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isList; /** * Indicates whether the parameter content should be redacted in log. If * redaction is enabled, the parameter content will be replaced by parameter * name during logging. Note: the parameter content is subject to redaction if * either parameter level redaction or entity type level redaction is enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *redact; @end /** * Represents an example that the agent is trained on to identify the intent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase : GTLRObject /** * Output only. The unique identifier of the training phrase. * * identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). */ @property(nonatomic, copy, nullable) NSString *identifier; /** * Required. The ordered list of training phrase parts. The parts are * concatenated in order to form the training phrase. Note: The API does not * automatically annotate training phrases like the Dialogflow Console does. * Note: Do not forget to include whitespace at part boundaries, so the * training phrase is well formatted when the parts are concatenated. If the * training phrase does not need to be annotated with parameters, you just need * a single part with only the Part.text field set. If you want to annotate the * training phrase, you must create multiple parts, where the fields of each * part are populated in one of two ways: - `Part.text` is set to a part of the * phrase that has no parameters. - `Part.text` is set to a part of the phrase * that you want to annotate, and the `parameter_id` field is set. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart *> *parts; /** * Indicates how many times this example was added to the intent. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *repeatCount; @end /** * Represents a part of a training phrase. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart : GTLRObject /** * The parameter used to annotate this part of the training phrase. This field * is required for annotated parts of the training phrase. */ @property(nonatomic, copy, nullable) NSString *parameterId; /** Required. The text for this part. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * A Dialogflow CX conversation (session) can be described and visualized as a * state machine. The states of a CX session are represented by pages. For each * flow, you define many pages, where your combined pages can handle a complete * conversation on the topics the flow is designed for. At any given moment, * exactly one page is the current page, the current page is considered active, * and the flow associated with that page is considered active. Every flow has * a special start page. When a flow initially becomes active, the start page * page becomes the current page. For each conversational turn, the current * page will either stay the same or transition to another page. You configure * each page to collect information from the end-user that is relevant for the * conversational state represented by the page. For more information, see the * [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Page : GTLRObject /** Required. The human-readable name of the page, unique within the agent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** The fulfillment to call when the session is entering the page. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Fulfillment *entryFulfillment; /** * Handlers associated with the page to handle events such as webhook errors, * no match or no input. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EventHandler *> *eventHandlers; /** * The form associated with the page, used for collecting parameters relevant * to the page. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Form *form; /** * The unique identifier of the page. Required for the Pages.UpdatePage method. * Pages.CreatePage populates the name automatically. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * Ordered list of `TransitionRouteGroups` associated with the page. Transition * route groups must be unique within a page. * If multiple transition routes * within a page scope refer to the same intent, then the precedence order is: * page's transition route -> page's transition route group -> flow's * transition routes. * If multiple transition route groups within a page * contain the same intent, then the first group in the ordered list takes * precedence. * Format:`projects//locations//agents//flows//transitionRouteGroups/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *transitionRouteGroups; /** * A list of transitions for the transition rules of this page. They route the * conversation to another page in the same flow, or another flow. When we are * in a certain page, the TransitionRoutes are evalauted in the following * order: * TransitionRoutes defined in the page with intent specified. * * TransitionRoutes defined in the transition route groups with intent * specified. * TransitionRoutes defined in flow with intent specified. * * TransitionRoutes defined in the transition route groups with intent * specified. * TransitionRoutes defined in the page with only condition * specified. * TransitionRoutes defined in the transition route groups with * only condition specified. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TransitionRoute *> *transitionRoutes; @end /** * Represents page information communicated to and from the webhook. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfo : GTLRObject /** * Always present for WebhookRequest. Ignored for WebhookResponse. The unique * identifier of the current page. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *currentPage; /** * Always present for WebhookRequest. Ignored for WebhookResponse. The display * name of the current page. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional for both WebhookRequest and WebhookResponse. Information about the * form. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfo *formInfo; @end /** * Represents form information. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfo : GTLRObject /** * Optional for both WebhookRequest and WebhookResponse. The parameters * contained in the form. Note that the webhook cannot add or remove any form * parameter. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo *> *parameterInfo; @end /** * Represents parameter information. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo : GTLRObject /** * Always present for WebhookRequest. Required for WebhookResponse. The * human-readable name of the parameter, unique within the form. This field * cannot be modified by the webhook. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional for WebhookRequest. Ignored for WebhookResponse. Indicates if the * parameter value was just collected on the last conversation turn. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *justCollected; /** * Optional for both WebhookRequest and WebhookResponse. Indicates whether the * parameter is required. Optional parameters will not trigger prompts; * however, they are filled if the user specifies them. Required parameters * must be filled before form filling concludes. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *required; /** * Always present for WebhookRequest. Required for WebhookResponse. The state * of the parameter. This field can be set to INVALID by the webhook to * invalidate the parameter; other values set by the webhook will be ignored. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo_State_Empty * Indicates that the parameter does not have a value. (Value: "EMPTY") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo_State_Filled * Indicates that the parameter has a value. (Value: "FILLED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo_State_Invalid * Indicates that the parameter value is invalid. This field can be used * by the webhook to invalidate the parameter and ask the server to * collect it from the user again. (Value: "INVALID") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo_State_ParameterStateUnspecified * Not specified. This value should be never used. (Value: * "PARAMETER_STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *state; /** * Optional for both WebhookRequest and WebhookResponse. The value of the * parameter. This field can be set by the webhook to change the parameter * value. * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id value; @end /** * Represents the query input. It can contain one of: 1. A conversational query * in the form of text. 2. An intent query that specifies which intent to * trigger. 3. Natural language speech audio to be processed. 4. An event to be * triggered. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1QueryInput : GTLRObject /** The natural language speech audio to be processed. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1AudioInput *audio; /** The DTMF event to be handled. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1DtmfInput *dtmf; /** The event to be triggered. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1EventInput *event; /** The intent to be triggered. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1IntentInput *intent; /** * Required. The language of the input. See [Language * Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) for * a list of the currently supported language codes. Note that queries in the * same session do not necessarily need to specify the same language. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** The natural language text to be processed. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TextInput *text; @end /** * Metadata for ReloadDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ReloadDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Represents a response message that can be returned by a conversational * agent. Response messages are also used for output audio synthesis. The * approach is as follows: * If at least one OutputAudioText response is * present, then all OutputAudioText responses are linearly concatenated, and * the result is used for output audio synthesis. * If the OutputAudioText * responses are a mixture of text and SSML, then the concatenated result is * treated as SSML; otherwise, the result is treated as either text or SSML as * appropriate. The agent designer should ideally use either text or SSML * consistently throughout the bot design. * Otherwise, all Text responses are * linearly concatenated, and the result is used for output audio synthesis. * This approach allows for more sophisticated user experience scenarios, where * the text displayed to the user may differ from what is heard. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage : GTLRObject /** Indicates that the conversation succeeded. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess *conversationSuccess; /** * Output only. A signal that indicates the interaction with the Dialogflow * agent has ended. This message is generated by Dialogflow only when the * conversation reaches `END_SESSION` page. It is not supposed to be defined by * the user. It's guaranteed that there is at most one such message in each * response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction *endInteraction; /** Hands off conversation to a human agent. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff *liveAgentHandoff; /** * Output only. An audio response message composed of both the synthesized * Dialogflow agent responses and responses defined via play_audio. This * message is generated by Dialogflow only and not supposed to be defined by * the user. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio *mixedAudio; /** * A text or ssml response that is preferentially used for TTS output audio * synthesis, as described in the comment on the ResponseMessage message. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText *outputAudioText; /** Returns a response containing a custom, platform-specific payload. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage_Payload *payload; /** * Signal that the client should play an audio clip hosted at a client-specific * URI. Dialogflow uses this to construct mixed_audio. However, Dialogflow * itself does not try to read or process the URI in any way. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio *playAudio; /** * A signal that the client should transfer the phone call connected to this * agent to a third-party endpoint. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageTelephonyTransferCall *telephonyTransferCall; /** Returns a text response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageText *text; @end /** * Returns a response containing a custom, platform-specific payload. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage_Payload : GTLRObject @end /** * Indicates that the conversation succeeded, i.e., the bot handled the issue * that the customer talked to it about. Dialogflow only uses this to determine * which conversations should be counted as successful and doesn't process the * metadata in this message in any way. Note that Dialogflow also considers * conversations that get to the conversation end page as successful even if * they don't return ConversationSuccess. You may set this, for example: * In * the entry_fulfillment of a Page if entering the page indicates that the * conversation succeeded. * In a webhook response when you determine that you * handled the customer issue. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess : GTLRObject /** Custom metadata. Dialogflow doesn't impose any structure on this. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess_Metadata *metadata; @end /** * Custom metadata. Dialogflow doesn't impose any structure on this. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess_Metadata : GTLRObject @end /** * Indicates that interaction with the Dialogflow agent has ended. This message * is generated by Dialogflow only and not supposed to be defined by the user. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction : GTLRObject @end /** * Indicates that the conversation should be handed off to a live agent. * Dialogflow only uses this to determine which conversations were handed off * to a human agent for measurement purposes. What else to do with this signal * is up to you and your handoff procedures. You may set this, for example: * * In the entry_fulfillment of a Page if entering the page indicates something * went extremely wrong in the conversation. * In a webhook response when you * determine that the customer issue can only be handled by a human. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff : GTLRObject /** * Custom metadata for your handoff procedure. Dialogflow doesn't impose any * structure on this. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff_Metadata *metadata; @end /** * Custom metadata for your handoff procedure. Dialogflow doesn't impose any * structure on this. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff_Metadata : GTLRObject @end /** * Represents an audio message that is composed of both segments synthesized * from the Dialogflow agent prompts and ones hosted externally at the * specified URIs. The external URIs are specified via play_audio. This message * is generated by Dialogflow only and not supposed to be defined by the user. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio : GTLRObject /** Segments this audio response is composed of. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment *> *segments; @end /** * Represents one segment of audio. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment : GTLRObject /** * Output only. Whether the playback of this segment can be interrupted by the * end user's speech and the client should then start the next Dialogflow * request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowPlaybackInterruption; /** * Raw audio synthesized from the Dialogflow agent's response using the output * config specified in the request. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *audio; /** * Client-specific URI that points to an audio clip accessible to the client. * Dialogflow does not impose any validation on it. */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * A text or ssml response that is preferentially used for TTS output audio * synthesis, as described in the comment on the ResponseMessage message. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText : GTLRObject /** * Output only. Whether the playback of this message can be interrupted by the * end user's speech and the client can then starts the next Dialogflow * request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowPlaybackInterruption; /** * The SSML text to be synthesized. For more information, see * [SSML](/speech/text-to-speech/docs/ssml). */ @property(nonatomic, copy, nullable) NSString *ssml; /** The raw text to be synthesized. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Specifies an audio clip to be played by the client as part of the response. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio : GTLRObject /** * Output only. Whether the playback of this message can be interrupted by the * end user's speech and the client can then starts the next Dialogflow * request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowPlaybackInterruption; /** * Required. URI of the audio clip. Dialogflow does not impose any validation * on this value. It is specific to the client that reads it. */ @property(nonatomic, copy, nullable) NSString *audioUri; @end /** * Represents the signal that telles the client to transfer the phone call * connected to the agent to a third-party endpoint. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageTelephonyTransferCall : GTLRObject /** * Transfer the call to a phone number in [E.164 * format](https://en.wikipedia.org/wiki/E.164). */ @property(nonatomic, copy, nullable) NSString *phoneNumber; @end /** * The text response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessageText : GTLRObject /** * Output only. Whether the playback of this message can be interrupted by the * end user's speech and the client can then starts the next Dialogflow * request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowPlaybackInterruption; /** Required. A collection of text responses. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *text; @end /** * Metadata returned for the Environments.RunContinuousTest long running * operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1RunContinuousTestMetadata : GTLRObject /** The test errors. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestError *> *errors; @end /** * The response message for Environments.RunContinuousTest. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1RunContinuousTestResponse : GTLRObject /** The result for a continuous test run. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ContinuousTestResult *continuousTestResult; @end /** * Metadata returned for the TestCases.RunTestCase long running operation. This * message currently has no fields. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1RunTestCaseMetadata : GTLRObject @end /** * The response message for TestCases.RunTestCase. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1RunTestCaseResponse : GTLRObject /** The result. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult *result; @end /** * Represents session information communicated to and from the webhook. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1SessionInfo : GTLRObject /** * Optional for WebhookRequest. Optional for WebhookResponse. All parameters * collected from forms and intents during the session. Parameters can be * created, updated, or removed by the webhook. To remove a parameter from the * session, the webhook should explicitly set the parameter value to null in * WebhookResponse. The map is keyed by parameters' display names. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1SessionInfo_Parameters *parameters; /** * Always present for WebhookRequest. Ignored for WebhookResponse. The unique * identifier of the session. This field can be used by the webhook to identify * a session. Format: `projects//locations//agents//sessions/` or * `projects//locations//agents//environments//sessions/` if environment is * specified. */ @property(nonatomic, copy, nullable) NSString *session; @end /** * Optional for WebhookRequest. Optional for WebhookResponse. All parameters * collected from forms and intents during the session. Parameters can be * created, updated, or removed by the webhook. To remove a parameter from the * session, the webhook should explicitly set the parameter value to null in * WebhookResponse. The map is keyed by parameters' display names. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1SessionInfo_Parameters : GTLRObject @end /** * Represents a test case. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCase : GTLRObject /** Output only. When the test was created. */ @property(nonatomic, strong, nullable) GTLRDateTime *creationTime; /** * Required. The human-readable name of the test case, unique within the agent. * Limit of 200 characters. */ @property(nonatomic, copy, nullable) NSString *displayName; /** The latest test result. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult *lastTestResult; /** * The unique identifier of the test case. TestCases.CreateTestCase will * populate the name automatically. Otherwise use format: * `projects//locations//agents/ /testCases/`. */ @property(nonatomic, copy, nullable) NSString *name; /** Additional freeform notes about the test case. Limit of 400 characters. */ @property(nonatomic, copy, nullable) NSString *notes; /** * Tags are short descriptions that users may apply to test cases for * organizational and filtering purposes. Each tag should start with "#" and * has a limit of 30 characters. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *tags; /** * The conversation turns uttered when the test case was created, in * chronological order. These include the canonical set of agent utterances * that should occur when the agent is working properly. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurn *> *testCaseConversationTurns; /** Config for the test case. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestConfig *testConfig; @end /** * Error info for importing a test. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseError : GTLRObject /** The status associated with the test case. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *status; /** The test case. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCase *testCase; @end /** * Represents a result from running a test case in an agent environment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult : GTLRObject /** * The conversation turns uttered during the test case replay in chronological * order. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurn *> *conversationTurns; /** * Environment where the test was run. If not set, it indicates the draft * environment. */ @property(nonatomic, copy, nullable) NSString *environment; /** * The resource name for the test case result. Format: * `projects//locations//agents//testCases/ /results/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * Whether the test case passed in the agent environment. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult_TestResult_Failed * The test did not pass. (Value: "FAILED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult_TestResult_Passed * The test passed. (Value: "PASSED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult_TestResult_TestResultUnspecified * Not specified. Should never be used. (Value: * "TEST_RESULT_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *testResult; /** The time that the test was run. */ @property(nonatomic, strong, nullable) GTLRDateTime *testTime; @end /** * Represents configurations for a test case. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestConfig : GTLRObject /** * Flow name. If not set, default start flow is assumed. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *flow; /** Session parameters to be compared when calculating differences. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *trackingParameters; @end /** * Error info for running a test. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestError : GTLRObject /** The status associated with the test. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *status; /** The test case resource name. */ @property(nonatomic, copy, nullable) NSString *testCase; /** The timestamp when the test was completed. */ @property(nonatomic, strong, nullable) GTLRDateTime *testTime; @end /** * The description of differences between original and replayed agent output. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference : GTLRObject /** * A description of the diff, showing the actual output vs expected output. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * The type of diff. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_DiffTypeUnspecified * Should never be used. (Value: "DIFF_TYPE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_Intent * The intent. (Value: "INTENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_Page * The page. (Value: "PAGE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_Parameters * The parameters. (Value: "PARAMETERS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1TestRunDifference_Type_Utterance * The message utterance. (Value: "UTTERANCE") */ @property(nonatomic, copy, nullable) NSString *type; @end /** * Represents the natural language text to be processed. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TextInput : GTLRObject /** * Required. The UTF-8 encoded natural language text to be processed. Text * length must not exceed 256 characters. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * A transition route specifies a intent that can be matched and/or a data * condition that can be evaluated during a session. When a specified * transition is matched, the following actions are taken in order: * If there * is a `trigger_fulfillment` associated with the transition, it will be * called. * If there is a `target_page` associated with the transition, the * session will transition into the specified page. * If there is a * `target_flow` associated with the transition, the session will transition * into the specified flow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1TransitionRoute : GTLRObject /** * The condition to evaluate against form parameters or session parameters. See * the [conditions * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). * At least one of `intent` or `condition` must be specified. When both * `intent` and `condition` are specified, the transition can only happen when * both are fulfilled. */ @property(nonatomic, copy, nullable) NSString *condition; /** * The unique identifier of an Intent. Format: * `projects//locations//agents//intents/`. Indicates that the transition can * only happen when the given intent is matched. At least one of `intent` or * `condition` must be specified. When both `intent` and `condition` are * specified, the transition can only happen when both are fulfilled. */ @property(nonatomic, copy, nullable) NSString *intent; /** Output only. The unique identifier of this transition route. */ @property(nonatomic, copy, nullable) NSString *name; /** * The target flow to transition to. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *targetFlow; /** * The target page to transition to. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *targetPage; /** * The fulfillment to call when the condition is satisfied. At least one of * `trigger_fulfillment` and `target` must be specified. When both are defined, * `trigger_fulfillment` is executed first. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1Fulfillment *triggerFulfillment; @end /** * Metadata for UpdateDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1UpdateDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * The request message for a webhook call. The request is sent as a JSON object * and the field names will be presented in camel cases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequest : GTLRObject /** * Always present. The unique identifier of the DetectIntentResponse that will * be returned to the API caller. */ @property(nonatomic, copy, nullable) NSString *detectIntentResponseId; /** * Always present. Information about the fulfillment that triggered this * webhook call. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo *fulfillmentInfo; /** Information about the last matched intent. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo *intentInfo; /** The language code specified in the original request. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** * The list of rich message responses to present to the user. Webhook can * choose to append or replace this list in * WebhookResponse.fulfillment_response; */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage *> *messages; /** Information about page status. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfo *pageInfo; /** Custom data set in QueryParameters.payload. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequest_Payload *payload; /** * The sentiment analysis result of the current user request. The field is * filled when sentiment analysis is configured to be enabled for the request. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestSentimentAnalysisResult *sentimentAnalysisResult; /** Information about session status. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1SessionInfo *sessionInfo; /** * If natural language text was provided as input, this field will contain a * copy of the text. */ @property(nonatomic, copy, nullable) NSString *text; /** * If natural language speech audio was provided as input, this field will * contain the transcript for the audio. */ @property(nonatomic, copy, nullable) NSString *transcript; /** * If an event was provided as input, this field will contain the name of the * event. */ @property(nonatomic, copy, nullable) NSString *triggerEvent; /** * If an intent was provided as input, this field will contain a copy of the * intent identifier. Format: `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *triggerIntent; @end /** * Custom data set in QueryParameters.payload. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequest_Payload : GTLRObject @end /** * Represents fulfillment information communicated to the webhook. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestFulfillmentInfo : GTLRObject /** * Always present. The tag used to identify which fulfillment is being called. */ @property(nonatomic, copy, nullable) NSString *tag; @end /** * Represents intent information communicated to the webhook. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo : GTLRObject /** * The confidence of the matched intent. Values range from 0.0 (completely * uncertain) to 1.0 (completely certain). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *confidence; /** Always present. The display name of the last matched intent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Always present. The unique identifier of the last matched intent. Format: * `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *lastMatchedIntent; /** * Parameters identified as a result of intent matching. This is a map of the * name of the identified parameter to the value of the parameter identified * from the user's utterance. All parameters defined in the matched intent that * are identified will be surfaced here. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo_Parameters *parameters; @end /** * Parameters identified as a result of intent matching. This is a map of the * name of the identified parameter to the value of the parameter identified * from the user's utterance. All parameters defined in the matched intent that * are identified will be surfaced here. * * @note This class is documented as having more properties of * GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue. * Use @c -additionalJSONKeys and @c -additionalPropertyForName: to get * the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfo_Parameters : GTLRObject @end /** * Represents a value for an intent parameter. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestIntentInfoIntentParameterValue : GTLRObject /** Always present. Original text value extracted from user utterance. */ @property(nonatomic, copy, nullable) NSString *originalValue; /** * Always present. Structured value for the parameter extracted from user * utterance. * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id resolvedValue; @end /** * Represents the result of sentiment analysis. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookRequestSentimentAnalysisResult : GTLRObject /** * A non-negative number in the [0, +inf) range, which represents the absolute * magnitude of sentiment, regardless of score (positive or negative). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *magnitude; /** * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive * sentiment). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *score; @end /** * The response message for a webhook call. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponse : GTLRObject /** * The fulfillment response to send to the user. This field can be omitted by * the webhook if it does not intend to send any response to the user. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse *fulfillmentResponse; /** * Information about page status. This field can be omitted by the webhook if * it does not intend to modify page status. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1PageInfo *pageInfo; /** Value to append directly to QueryResult.webhook_payloads. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponse_Payload *payload; /** * Information about session status. This field can be omitted by the webhook * if it does not intend to modify session status. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3beta1SessionInfo *sessionInfo; /** * The target flow to transition to. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *targetFlow; /** * The target page to transition to. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *targetPage; @end /** * Value to append directly to QueryResult.webhook_payloads. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponse_Payload : GTLRObject @end /** * Represents a fulfillment response to the user. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse : GTLRObject /** * Merge behavior for `messages`. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse_MergeBehavior_Append * `messages` will be appended to the list of messages waiting to be sent * to the user. (Value: "APPEND") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse_MergeBehavior_MergeBehaviorUnspecified * Not specified. `APPEND` will be used. (Value: * "MERGE_BEHAVIOR_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3beta1WebhookResponseFulfillmentResponse_MergeBehavior_Replace * `messages` will replace the list of messages waiting to be sent to the * user. (Value: "REPLACE") */ @property(nonatomic, copy, nullable) NSString *mergeBehavior; /** The list of rich message responses to present to the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3beta1ResponseMessage *> *messages; @end /** * The response message for TestCases.CalculateCoverage. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3CalculateCoverageResponse : GTLRObject /** * The agent to calculate coverage for. Format: `projects//locations//agents/`. */ @property(nonatomic, copy, nullable) NSString *agent; /** Intent coverage. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3IntentCoverage *intentCoverage; /** Transition route group coverage. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverage *routeGroupCoverage; /** Transition (excluding transition route groups) coverage. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverage *transitionCoverage; @end /** * Changelogs represents a change made to a given agent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Changelog : GTLRObject /** The action of the change. */ @property(nonatomic, copy, nullable) NSString *action; /** The timestamp of the change. */ @property(nonatomic, strong, nullable) GTLRDateTime *createTime; /** The affected resource display name of the change. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * The unique identifier of the changelog. Format: * `projects//locations//agents//changelogs/`. */ @property(nonatomic, copy, nullable) NSString *name; /** The affected resource name of the change. */ @property(nonatomic, copy, nullable) NSString *resource; /** The affected resource type. */ @property(nonatomic, copy, nullable) NSString *type; /** Email address of the authenticated user. */ @property(nonatomic, copy, nullable) NSString *userEmail; @end /** * The request message for Versions.CompareVersions. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3CompareVersionsRequest : GTLRObject /** * The language to compare the flow versions for. If not specified, the agent's * default language is used. [Many * languages](https://cloud.google.com/dialogflow/docs/reference/language) are * supported. Note: languages must be enabled in the agent before they can be * used. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** * Required. Name of the target flow version to compare with the base version. * Use version ID `0` to indicate the draft version of the specified flow. * Format: `projects//locations//agents//flows//versions/`. */ @property(nonatomic, copy, nullable) NSString *targetVersion; @end /** * The response message for Versions.CompareVersions. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3CompareVersionsResponse : GTLRObject /** JSON representation of the base version content. */ @property(nonatomic, copy, nullable) NSString *baseVersionContentJson; /** The timestamp when the two version compares. */ @property(nonatomic, strong, nullable) GTLRDateTime *compareTime; /** JSON representation of the target version content. */ @property(nonatomic, copy, nullable) NSString *targetVersionContentJson; @end /** * Represents a result from running a test case in an agent environment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult : GTLRObject /** * The resource name for the continuous test result. Format: * `projects//locations//agents//environments//continuousTestResults/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * The result of this continuous test run, i.e. whether all the tests in this * continuous test run pass or not. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult_Result_AggregatedTestResultUnspecified * Not specified. Should never be used. (Value: * "AGGREGATED_TEST_RESULT_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult_Result_Failed * At least one test did not pass. (Value: "FAILED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult_Result_Passed * All the tests passed. (Value: "PASSED") */ @property(nonatomic, copy, nullable) NSString *result; /** Time when the continuous testing run starts. */ @property(nonatomic, strong, nullable) GTLRDateTime *runTime; /** * A list of individual test case results names in this continuous test run. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *testCaseResults; @end /** * One interaction between a human and virtual agent. The human provides some * input and the virtual agent provides a response. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurn : GTLRObject /** The user input. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnUserInput *userInput; /** The virtual agent output. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput *virtualAgentOutput; @end /** * The input from the human user. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnUserInput : GTLRObject /** * Whether sentiment analysis is enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableSentimentAnalysis; /** * Parameters that need to be injected into the conversation during intent * detection. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnUserInput_InjectedParameters *injectedParameters; /** Supports text input, event input, dtmf input in the test case. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryInput *input; /** * If webhooks should be allowed to trigger in response to the user utterance. * Often if parameters are injected, webhooks should not be enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isWebhookEnabled; @end /** * Parameters that need to be injected into the conversation during intent * detection. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnUserInput_InjectedParameters : GTLRObject @end /** * The output from the virtual agent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput : GTLRObject /** * The Page on which the utterance was spoken. Only name and displayName will * be set. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Page *currentPage; /** * Required. Input only. The diagnostic info output for the turn. Required to * calculate the testing coverage. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput_DiagnosticInfo *diagnosticInfo; /** * Output only. If this is part of a result conversation turn, the list of * differences between the original run and the replay for this output, if any. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference *> *differences; /** The session parameters available to the bot at this point. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput_SessionParameters *sessionParameters; /** * Response error from the agent in the test result. If set, other output is * empty. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *status; /** The text responses from the agent for the turn. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageText *> *textResponses; /** * The Intent that triggered the response. Only name and displayName will be * set. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Intent *triggeredIntent; @end /** * Required. Input only. The diagnostic info output for the turn. Required to * calculate the testing coverage. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput_DiagnosticInfo : GTLRObject @end /** * The session parameters available to the bot at this point. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurnVirtualAgentOutput_SessionParameters : GTLRObject @end /** * Metadata for CreateDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3CreateDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Metadata associated with the long running operation for * Versions.CreateVersion. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3CreateVersionOperationMetadata : GTLRObject /** * Name of the created version. Format: * `projects//locations//agents//flows//versions/`. */ @property(nonatomic, copy, nullable) NSString *version; @end /** * Metadata for DeleteDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3DeleteDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Metadata returned for the Environments.DeployFlow long running operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3DeployFlowMetadata : GTLRObject /** Errors of running deployment tests. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TestError *> *testErrors; @end /** * The request message for Environments.DeployFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3DeployFlowRequest : GTLRObject /** * Required. The flow version to deploy. Format: `projects//locations//agents// * flows//versions/`. */ @property(nonatomic, copy, nullable) NSString *flowVersion; @end /** * The response message for Environments.DeployFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3DeployFlowResponse : GTLRObject /** * The name of the flow version Deployment. Format: * `projects//locations//agents// environments//deployments/`. */ @property(nonatomic, copy, nullable) NSString *deployment; /** The updated environment where the flow is deployed. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Environment *environment; @end /** * Represents an deployment in an environment. A deployment happens when a flow * version configured to be active in the environment. You can configure * running pre-deployment steps, e.g. running validation test cases, experiment * auto-rollout, etc. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Deployment : GTLRObject /** End time of this deployment. */ @property(nonatomic, strong, nullable) GTLRDateTime *endTime; /** * The name of the flow version for this deployment. Format: * projects//locations//agents//flows//versions/. */ @property(nonatomic, copy, nullable) NSString *flowVersion; /** * The name of the deployment. Format: * projects//locations//agents//environments//deployments/. */ @property(nonatomic, copy, nullable) NSString *name; /** Result of the deployment. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3DeploymentResult *result; /** Start time of this deployment. */ @property(nonatomic, strong, nullable) GTLRDateTime *startTime; /** * The current state of the deployment. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Deployment_State_Failed * The deployment failed. (Value: "FAILED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Deployment_State_Running * The deployment is running. (Value: "RUNNING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Deployment_State_StateUnspecified * State unspecified. (Value: "STATE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Deployment_State_Succeeded * The deployment succeeded. (Value: "SUCCEEDED") */ @property(nonatomic, copy, nullable) NSString *state; @end /** * Result of the deployment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3DeploymentResult : GTLRObject /** * Results of test cases running before the deployment. Format: * `projects//locations//agents//testCases//results/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *deploymentTestResults; /** * The name of the experiment triggered by this deployment. Format: * projects//locations//agents//environments//experiments/. */ @property(nonatomic, copy, nullable) NSString *experiment; @end /** * The request to detect user's intent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentRequest : GTLRObject /** Instructs the speech synthesizer how to generate the output audio. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig *outputAudioConfig; /** Required. The input specification. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryInput *queryInput; /** The parameters of this query. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters *queryParams; @end /** * The message returned from the DetectIntent method. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentResponse : GTLRObject /** * Indicates whether the partial response can be cancelled when a later * response arrives. e.g. if the agent specified some music as partial * response, it can be cancelled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowCancellation; /** * The audio data bytes encoded as specified in the request. Note: The output * audio is generated based on the values of default platform text responses * found in the `query_result.response_messages` field. If multiple default * text responses exist, they will be concatenated when generating audio. If no * default platform text responses exist, the generated audio content will be * empty. In some scenarios, multiple output audio fields may be present in the * response structure. In these cases, only the top-most-level audio output has * content. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *outputAudio; /** The config used by the speech synthesizer to generate the output audio. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig *outputAudioConfig; /** The result of the conversational query. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult *queryResult; /** * Output only. The unique identifier of the response. It can be used to locate * a response in the training example set or for reporting issues. */ @property(nonatomic, copy, nullable) NSString *responseId; /** * Response type. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentResponse_ResponseType_Final * Final response. (Value: "FINAL") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentResponse_ResponseType_Partial * Partial response. e.g. Aggregated responses in a Fulfillment that * enables `return_partial_response` can be returned as partial response. * WARNING: partial response is not eligible for barge-in. (Value: * "PARTIAL") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3DetectIntentResponse_ResponseType_ResponseTypeUnspecified * Not specified. This should never happen. (Value: * "RESPONSE_TYPE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *responseType; @end /** * Represents the input for dtmf event. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3DtmfInput : GTLRObject /** The dtmf digits. */ @property(nonatomic, copy, nullable) NSString *digits; /** The finish digit (if any). */ @property(nonatomic, copy, nullable) NSString *finishDigit; @end /** * Entities are extracted from user input and represent parameters that are * meaningful to your application. For example, a date range, a proper name * such as a geographic location or landmark, and so on. Entities represent * actionable data for your application. When you define an entity, you can * also include synonyms that all map to that entity. For example, "soft * drink", "soda", "pop", and so on. There are three types of entities: * * **System** - entities that are defined by the Dialogflow API for common data * types such as date, time, currency, and so on. A system entity is * represented by the `EntityType` type. * **Custom** - entities that are * defined by you that represent actionable data that is meaningful to your * application. For example, you could define a `pizza.sauce` entity for red or * white pizza sauce, a `pizza.cheese` entity for the different types of cheese * on a pizza, a `pizza.topping` entity for different toppings, and so on. A * custom entity is represented by the `EntityType` type. * **User** - entities * that are built for an individual user such as favorites, preferences, * playlists, and so on. A user entity is represented by the SessionEntityType * type. For more information about entity types, see the [Dialogflow * documentation](https://cloud.google.com/dialogflow/docs/entities-overview). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3EntityType : GTLRObject /** * Indicates whether the entity type can be automatically expanded. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_AutoExpansionMode_AutoExpansionModeDefault * Allows an agent to recognize values that have not been explicitly * listed in the entity. (Value: "AUTO_EXPANSION_MODE_DEFAULT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_AutoExpansionMode_AutoExpansionModeUnspecified * Auto expansion disabled for the entity. (Value: * "AUTO_EXPANSION_MODE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *autoExpansionMode; /** * Required. The human-readable name of the entity type, unique within the * agent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Enables fuzzy entity extraction during classification. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableFuzzyExtraction; /** The collection of entity entries associated with the entity type. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3EntityTypeEntity *> *entities; /** * Collection of exceptional words and phrases that shouldn't be matched. For * example, if you have a size entity type with entry `giant`(an adjective), * you might consider adding `giants`(a noun) as an exclusion. If the kind of * entity type is `KIND_MAP`, then the phrases specified by entities and * excluded phrases should be mutually exclusive. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3EntityTypeExcludedPhrase *> *excludedPhrases; /** * Required. Indicates the kind of entity type. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_Kind_KindList * List entity types contain a set of entries that do not map to * canonical values. However, list entity types can contain references to * other entity types (with or without aliases). (Value: "KIND_LIST") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_Kind_KindMap * Map entity types allow mapping of a group of synonyms to a canonical * value. (Value: "KIND_MAP") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_Kind_KindRegexp * Regexp entity types allow to specify regular expressions in entries * values. (Value: "KIND_REGEXP") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3EntityType_Kind_KindUnspecified * Not specified. This value should be never used. (Value: * "KIND_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *kind; /** * The unique identifier of the entity type. Required for * EntityTypes.UpdateEntityType. Format: * `projects//locations//agents//entityTypes/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * Indicates whether parameters of the entity type should be redacted in log. * If redaction is enabled, page parameters and intent parameters referring to * the entity type will be replaced by parameter name when logging. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *redact; @end /** * An **entity entry** for an associated entity type. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3EntityTypeEntity : GTLRObject /** * Required. A collection of value synonyms. For example, if the entity type is * *vegetable*, and `value` is *scallions*, a synonym could be *green onions*. * For `KIND_LIST` entity types: * This collection must contain exactly one * synonym equal to `value`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *synonyms; /** * Required. The primary value associated with this entity entry. For example, * if the entity type is *vegetable*, the value could be *scallions*. For * `KIND_MAP` entity types: * A canonical value to be used in place of * synonyms. For `KIND_LIST` entity types: * A string that can contain * references to other entity types (with or without aliases). */ @property(nonatomic, copy, nullable) NSString *value; @end /** * An excluded entity phrase that should not be matched. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3EntityTypeExcludedPhrase : GTLRObject /** Required. The word or phrase to be excluded. */ @property(nonatomic, copy, nullable) NSString *value; @end /** * Represents an environment for an agent. You can create multiple versions of * your agent and publish them to separate environments. When you edit an * agent, you are editing the draft agent. At any point, you can save the draft * agent as an agent version, which is an immutable snapshot of your agent. * When you save the draft agent, it is published to the default environment. * When you create agent versions, you can publish them to custom environments. * You can create a variety of custom environments for testing, development, * production, etc. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Environment : GTLRObject /** * The human-readable description of the environment. The maximum length is 500 * characters. If exceeded, the request is rejected. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Required. The human-readable name of the environment (unique in an agent). * Limit of 64 characters. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * The name of the environment. Format: * `projects//locations//agents//environments/`. */ @property(nonatomic, copy, nullable) NSString *name; /** The test cases config for continuous tests of this environment. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3EnvironmentTestCasesConfig *testCasesConfig; /** Output only. Update time of this environment. */ @property(nonatomic, strong, nullable) GTLRDateTime *updateTime; /** * Required. A list of configurations for flow versions. You should include * version configs for all flows that are reachable from `Start Flow` in the * agent. Otherwise, an error will be returned. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3EnvironmentVersionConfig *> *versionConfigs; @end /** * The configuration for continuous tests. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3EnvironmentTestCasesConfig : GTLRObject /** * Whether to run test cases in TestCasesConfig.test_cases periodically. * Default false. If set to ture, run once a day. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableContinuousRun; /** * Whether to run test cases in TestCasesConfig.test_cases before deploying a * flow version to the environment. Default false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enablePredeploymentRun; /** * A list of test case names to run. They should be under the same agent. * Format of each test case name: `projects//locations/ /agents//testCases/` */ @property(nonatomic, strong, nullable) NSArray<NSString *> *testCases; @end /** * Configuration for the version. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3EnvironmentVersionConfig : GTLRObject /** Required. Format: projects//locations//agents//flows//versions/. */ @property(nonatomic, copy, nullable) NSString *version; @end /** * An event handler specifies an event that can be handled during a session. * When the specified event happens, the following actions are taken in order: * * If there is a `trigger_fulfillment` associated with the event, it will be * called. * If there is a `target_page` associated with the event, the session * will transition into the specified page. * If there is a `target_flow` * associated with the event, the session will transition into the specified * flow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3EventHandler : GTLRObject /** Required. The name of the event to handle. */ @property(nonatomic, copy, nullable) NSString *event; /** Output only. The unique identifier of this event handler. */ @property(nonatomic, copy, nullable) NSString *name; /** * The target flow to transition to. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *targetFlow; /** * The target page to transition to. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *targetPage; /** * The fulfillment to call when the event occurs. Handling webhook errors with * a fulfillment enabled with webhook could cause infinite loop. It is invalid * to specify such fulfillment for a handler handling webhooks. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Fulfillment *triggerFulfillment; @end /** * Represents the event to trigger. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3EventInput : GTLRObject /** Name of the event. */ @property(nonatomic, copy, nullable) NSString *event; @end /** * Represents an experiment in an environment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Experiment : GTLRObject /** Creation time of this experiment. */ @property(nonatomic, strong, nullable) GTLRDateTime *createTime; /** The definition of the experiment. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentDefinition *definition; /** * The human-readable description of the experiment. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Required. The human-readable name of the experiment (unique in an * environment). Limit of 64 characters. */ @property(nonatomic, copy, nullable) NSString *displayName; /** End time of this experiment. */ @property(nonatomic, strong, nullable) GTLRDateTime *endTime; /** * Maximum number of days to run the experiment/rollout. If auto-rollout is not * enabled, default value and maximum will be 30 days. If auto-rollout is * enabled, default value and maximum will be 6 days. */ @property(nonatomic, strong, nullable) GTLRDuration *experimentLength; /** Last update time of this experiment. */ @property(nonatomic, strong, nullable) GTLRDateTime *lastUpdateTime; /** * The name of the experiment. Format: * projects//locations//agents//environments//experiments/.. */ @property(nonatomic, copy, nullable) NSString *name; /** Inference result of the experiment. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResult *result; /** * The configuration for auto rollout. If set, there should be exactly two * variants in the experiment (control variant being the default version of the * flow), the traffic allocation for the non-control variant will gradually * increase to 100% when conditions are met, and eventually replace the control * variant to become the default version of the flow. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutConfig *rolloutConfig; /** * The reason why rollout has failed. Should only be set when state is * ROLLOUT_FAILED. */ @property(nonatomic, copy, nullable) NSString *rolloutFailureReason; /** State of the auto rollout process. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutState *rolloutState; /** Start time of this experiment. */ @property(nonatomic, strong, nullable) GTLRDateTime *startTime; /** * The current state of the experiment. Transition triggered by * Experiments.StartExperiment: DRAFT->RUNNING. Transition triggered by * Experiments.CancelExperiment: DRAFT->DONE or RUNNING->DONE. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_Done The * experiment is done. (Value: "DONE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_Draft * The experiment is created but not started yet. (Value: "DRAFT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_RolloutFailed * The experiment with auto-rollout enabled has failed. (Value: * "ROLLOUT_FAILED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_Running * The experiment is running. (Value: "RUNNING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Experiment_State_StateUnspecified * State unspecified. (Value: "STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *state; /** The history of updates to the experiment variants. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3VariantsHistory *> *variantsHistory; @end /** * Definition of the experiment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentDefinition : GTLRObject /** * The condition defines which subset of sessions are selected for this * experiment. If not specified, all sessions are eligible. E.g. * "query_input.language_code=en" See the [conditions * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). */ @property(nonatomic, copy, nullable) NSString *condition; /** The flow versions as the variants of this experiment. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3VersionVariants *versionVariants; @end /** * The inference result which includes an objective metric to optimize and the * confidence interval. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResult : GTLRObject /** * The last time the experiment's stats data was updated. Will have default * value if stats have never been computed for this experiment. */ @property(nonatomic, strong, nullable) GTLRDateTime *lastUpdateTime; /** Version variants and metrics. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultVersionMetrics *> *versionMetrics; @end /** * A confidence interval is a range of possible values for the experiment * objective you are trying to measure. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultConfidenceInterval : GTLRObject /** * The confidence level used to construct the interval, i.e. there is X% chance * that the true value is within this interval. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *confidenceLevel; /** * Lower bound of the interval. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *lowerBound; /** * The percent change between an experiment metric's value and the value for * its control. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *ratio; /** * Upper bound of the interval. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *upperBound; @end /** * Metric and corresponding confidence intervals. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric : GTLRObject /** * The probability that the treatment is better than all other treatments in * the experiment */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultConfidenceInterval *confidenceInterval; /** * Count value of a metric. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *count; /** * Count-based metric type. Only one of type or count_type is specified in each * Metric. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_CountType_AverageTurnCount * Average turn count in a session. (Value: "AVERAGE_TURN_COUNT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_CountType_CountTypeUnspecified * Count type unspecified. (Value: "COUNT_TYPE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_CountType_TotalNoMatchCount * Total number of occurrences of a 'NO_MATCH'. (Value: * "TOTAL_NO_MATCH_COUNT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_CountType_TotalTurnCount * Total number of turn counts. (Value: "TOTAL_TURN_COUNT") */ @property(nonatomic, copy, nullable) NSString *countType; /** * Ratio value of a metric. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *ratio; /** * Ratio-based metric type. Only one of type or count_type is specified in each * Metric. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_AbandonedSessionRate * Percentage of sessions where user hung up. (Value: * "ABANDONED_SESSION_RATE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_CallbackSessionRate * Percentage of sessions with the same user calling back. (Value: * "CALLBACK_SESSION_RATE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_ContainedSessionNoCallbackRate * Percentage of contained sessions without user calling back in 24 * hours. (Value: "CONTAINED_SESSION_NO_CALLBACK_RATE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_LiveAgentHandoffRate * Percentage of sessions that were handed to a human agent. (Value: * "LIVE_AGENT_HANDOFF_RATE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_MetricUnspecified * Metric unspecified. (Value: "METRIC_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric_Type_SessionEndRate * Percentage of sessions reached Dialogflow 'END_PAGE' or 'END_SESSION'. * (Value: "SESSION_END_RATE") */ @property(nonatomic, copy, nullable) NSString *type; @end /** * Version variant and associated metrics. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultVersionMetrics : GTLRObject /** * The metrics and corresponding confidence intervals in the inference result. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ExperimentResultMetric *> *metrics; /** * Number of sessions that were allocated to this version. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *sessionCount; /** * The name of the flow Version. Format: * `projects//locations//agents//flows//versions/`. */ @property(nonatomic, copy, nullable) NSString *version; @end /** * The request message for Agents.ExportAgent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExportAgentRequest : GTLRObject /** * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) * URI to export the agent to. The format of this URI must be `gs:///`. If left * unspecified, the serialized agent is returned inline. */ @property(nonatomic, copy, nullable) NSString *agentUri; /** * Optional. Environment name. If not set, draft environment is assumed. * Format: `projects//locations//agents//environments/`. */ @property(nonatomic, copy, nullable) NSString *environment; @end /** * The response message for Agents.ExportAgent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExportAgentResponse : GTLRObject /** * Uncompressed raw byte content for agent. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *agentContent; /** * The URI to a file containing the exported agent. This field is populated * only if `agent_uri` is specified in ExportAgentRequest. */ @property(nonatomic, copy, nullable) NSString *agentUri; @end /** * The request message for Flows.ExportFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExportFlowRequest : GTLRObject /** * Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) * URI to export the flow to. The format of this URI must be `gs:///`. If left * unspecified, the serialized flow is returned inline. */ @property(nonatomic, copy, nullable) NSString *flowUri; /** * Optional. Whether to export flows referenced by the specified flow. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *includeReferencedFlows; @end /** * The response message for Flows.ExportFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExportFlowResponse : GTLRObject /** * Uncompressed raw byte content for flow. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *flowContent; /** * The URI to a file containing the exported flow. This field is populated only * if `flow_uri` is specified in ExportFlowRequest. */ @property(nonatomic, copy, nullable) NSString *flowUri; @end /** * Metadata returned for the TestCases.ExportTestCases long running operation. * This message currently has no fields. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesMetadata : GTLRObject @end /** * The request message for TestCases.ExportTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesRequest : GTLRObject /** * The data format of the exported test cases. If not specified, `BLOB` is * assumed. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesRequest_DataFormat_Blob * Raw bytes. (Value: "BLOB") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesRequest_DataFormat_DataFormatUnspecified * Unspecified format. (Value: "DATA_FORMAT_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesRequest_DataFormat_Json * JSON format. (Value: "JSON") */ @property(nonatomic, copy, nullable) NSString *dataFormat; /** * The filter expression used to filter exported test cases, see [API * Filtering](https://aip.dev/160). The expression is case insensitive and * supports the following syntax: name = [OR name = ] ... For example: * "name * = t1 OR name = t2" matches the test case with the exact resource name "t1" * or "t2". */ @property(nonatomic, copy, nullable) NSString *filter; /** * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to * export the test cases to. The format of this URI must be `gs:///`. If * unspecified, the serialized test cases is returned inline. */ @property(nonatomic, copy, nullable) NSString *gcsUri; @end /** * The response message for TestCases.ExportTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ExportTestCasesResponse : GTLRObject /** * Uncompressed raw byte content for test cases. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *content; /** * The URI to a file containing the exported test cases. This field is * populated only if `gcs_uri` is specified in ExportTestCasesRequest. */ @property(nonatomic, copy, nullable) NSString *gcsUri; @end /** * Flows represents the conversation flows when you build your chatbot agent. A * flow consists of many pages connected by the transition routes. * Conversations always start with the built-in Start Flow (with an all-0 ID). * Transition routes can direct the conversation session from the current flow * (parent flow) to another flow (sub flow). When the sub flow is finished, * Dialogflow will bring the session back to the parent flow, where the sub * flow is started. Usually, when a transition route is followed by a matched * intent, the intent will be "consumed". This means the intent won't activate * more transition routes. However, when the followed transition route moves * the conversation session into a different flow, the matched intent can be * carried over and to be consumed in the target flow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Flow : GTLRObject /** * The description of the flow. The maximum length is 500 characters. If * exceeded, the request is rejected. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** Required. The human-readable name of the flow. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * A flow's event handlers serve two purposes: * They are responsible for * handling events (e.g. no match, webhook errors) in the flow. * They are * inherited by every page's event handlers, which can be used to handle common * events regardless of the current page. Event handlers defined in the page * have higher priority than those defined in the flow. Unlike * transition_routes, these handlers are evaluated on a first-match basis. The * first one that matches the event get executed, with the rest being ignored. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3EventHandler *> *eventHandlers; /** * The unique identifier of the flow. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *name; /** NLU related settings of the flow. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings *nluSettings; /** * A flow's transition route group serve two purposes: * They are responsible * for matching the user's first utterances in the flow. * They are inherited * by every page's transition route groups. Transition route groups defined in * the page have higher priority than those defined in the flow. * Format:`projects//locations//agents//flows//transitionRouteGroups/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *transitionRouteGroups; /** * A flow's transition routes serve two purposes: * They are responsible for * matching the user's first utterances in the flow. * They are inherited by * every page's transition routes and can support use cases such as the user * saying "help" or "can I talk to a human?", which can be handled in a common * way regardless of the current page. Transition routes defined in the page * have higher priority than those defined in the flow. TransitionRoutes are * evalauted in the following order: * TransitionRoutes with intent specified.. * * TransitionRoutes with only condition specified. TransitionRoutes with * intent specified are inherited by pages in the flow. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRoute *> *transitionRoutes; @end /** * The response message for Flows.GetFlowValidationResult. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FlowValidationResult : GTLRObject /** * The unique identifier of the flow validation result. Format: * `projects//locations//agents//flows//validationResult`. */ @property(nonatomic, copy, nullable) NSString *name; /** Last time the flow was validated. */ @property(nonatomic, strong, nullable) GTLRDateTime *updateTime; /** Contains all validation messages. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage *> *validationMessages; @end /** * A form is a data model that groups related parameters that can be collected * from the user. The process in which the agent prompts the user and collects * parameter values from the user is called form filling. A form can be added * to a page. When form filling is done, the filled parameters will be written * to the session. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Form : GTLRObject /** Parameters to collect from the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3FormParameter *> *parameters; @end /** * Represents a form parameter. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FormParameter : GTLRObject /** * The default value of an optional parameter. If the parameter is required, * the default value will be ignored. * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id defaultValue; /** * Required. The human-readable name of the parameter, unique within the form. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Required. The entity type of the parameter. Format: * `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for * example, `projects/-/locations/-/agents/-/entityTypes/sys.date`), or * `projects//locations//agents//entityTypes/` for developer entity types. */ @property(nonatomic, copy, nullable) NSString *entityType; /** Required. Defines fill behavior for the parameter. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3FormParameterFillBehavior *fillBehavior; /** * Indicates whether the parameter represents a list of values. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isList; /** * Indicates whether the parameter content should be redacted in log. If * redaction is enabled, the parameter content will be replaced by parameter * name during logging. Note: the parameter content is subject to redaction if * either parameter level redaction or entity type level redaction is enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *redact; /** * Indicates whether the parameter is required. Optional parameters will not * trigger prompts; however, they are filled if the user specifies them. * Required parameters must be filled before form filling concludes. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *required; @end /** * Configuration for how the filling of a parameter should be handled. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FormParameterFillBehavior : GTLRObject /** * Required. The fulfillment to provide the initial prompt that the agent can * present to the user in order to fill the parameter. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Fulfillment *initialPromptFulfillment; /** * The handlers for parameter-level events, used to provide reprompt for the * parameter or transition to a different page/flow. The supported events are: * * `sys.no-match-`, where N can be from 1 to 6 * `sys.no-match-default` * * `sys.no-input-`, where N can be from 1 to 6 * `sys.no-input-default` * * `sys.invalid-parameter` `initial_prompt_fulfillment` provides the first * prompt for the parameter. If the user's response does not fill the * parameter, a no-match/no-input event will be triggered, and the fulfillment * associated with the `sys.no-match-1`/`sys.no-input-1` handler (if defined) * will be called to provide a prompt. The `sys.no-match-2`/`sys.no-input-2` * handler (if defined) will respond to the next no-match/no-input event, and * so on. A `sys.no-match-default` or `sys.no-input-default` handler will be * used to handle all following no-match/no-input events after all numbered * no-match/no-input handlers for the parameter are consumed. A * `sys.invalid-parameter` handler can be defined to handle the case where the * parameter values have been `invalidated` by webhook. For example, if the * user's response fill the parameter, however the parameter was invalidated by * webhook, the fulfillment associated with the `sys.invalid-parameter` handler * (if defined) will be called to provide a prompt. If the event handler for * the corresponding event can't be found on the parameter, * `initial_prompt_fulfillment` will be re-prompted. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3EventHandler *> *repromptEventHandlers; @end /** * Request of FulfillIntent */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillIntentRequest : GTLRObject /** The matched intent/event to fulfill. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Match *match; /** * Must be same as the corresponding MatchIntent request, otherwise the * behavior is undefined. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3MatchIntentRequest *matchIntentRequest; /** Instructs the speech synthesizer how to generate output audio. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig *outputAudioConfig; @end /** * Response of FulfillIntent */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillIntentResponse : GTLRObject /** * The audio data bytes encoded as specified in the request. Note: The output * audio is generated based on the values of default platform text responses * found in the `query_result.response_messages` field. If multiple default * text responses exist, they will be concatenated when generating audio. If no * default platform text responses exist, the generated audio content will be * empty. In some scenarios, multiple output audio fields may be present in the * response structure. In these cases, only the top-most-level audio output has * content. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *outputAudio; /** The config used by the speech synthesizer to generate the output audio. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig *outputAudioConfig; /** The result of the conversational query. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult *queryResult; /** * Output only. The unique identifier of the response. It can be used to locate * a response in the training example set or for reporting issues. */ @property(nonatomic, copy, nullable) NSString *responseId; @end /** * A fulfillment can do one or more of the following actions at the same time: * * Generate rich message responses. * Set parameter values. * Call the * webhook. Fulfillments can be called at various stages in the Page or Form * lifecycle. For example, when a DetectIntentRequest drives a session to enter * a new page, the page's entry fulfillment can add a static response to the * QueryResult in the returning DetectIntentResponse, call the webhook (for * example, to load user data from a database), or both. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Fulfillment : GTLRObject /** Conditional cases for this fulfillment. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCases *> *conditionalCases; /** The list of rich message responses to present to the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage *> *messages; /** * Whether Dialogflow should return currently queued fulfillment response * messages in streaming APIs. If a webhook is specified, it happens before * Dialogflow invokes webhook. Warning: 1) This flag only affects streaming * API. Responses are still queued and returned once in non-streaming API. 2) * The flag can be enabled in any fulfillment but only the first 3 partial * responses will be returned. You may only want to apply it to fulfillments * that have slow webhooks. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *returnPartialResponses; /** Set parameter values before executing the webhook. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentSetParameterAction *> *setParameterActions; /** * The tag used by the webhook to identify which fulfillment is being called. * This field is required if `webhook` is specified. */ @property(nonatomic, copy, nullable) NSString *tag; /** The webhook to call. Format: `projects//locations//agents//webhooks/`. */ @property(nonatomic, copy, nullable) NSString *webhook; @end /** * A list of cascading if-else conditions. Cases are mutually exclusive. The * first one with a matching condition is selected, all the rest ignored. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCases : GTLRObject /** A list of cascading if-else conditions. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase *> *cases; @end /** * Each case has a Boolean condition. When it is evaluated to be True, the * corresponding messages will be selected and evaluated recursively. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCase : GTLRObject /** A list of case content. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent *> *caseContent; /** * The condition to activate and select this case. Empty means the condition is * always true. The condition is evaluated against form parameters or session * parameters. See the [conditions * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). */ @property(nonatomic, copy, nullable) NSString *condition; @end /** * The list of messages or conditional cases to activate for this case. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCasesCaseCaseContent : GTLRObject /** Additional cases to be evaluated. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentConditionalCases *additionalCases; /** Returned message. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage *message; @end /** * Setting a parameter value. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3FulfillmentSetParameterAction : GTLRObject /** Display name of the parameter. */ @property(nonatomic, copy, nullable) NSString *parameter; /** * The new value of the parameter. A null value clears the parameter. * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id value; @end /** * Metadata in google::longrunning::Operation for Knowledge operations. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata : GTLRObject /** * Required. Output only. The current state of this operation. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata_State_Done * The operation is done, either cancelled or completed. (Value: "DONE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata_State_Pending * The operation has been created. (Value: "PENDING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata_State_Running * The operation is currently running. (Value: "RUNNING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata_State_StateUnspecified * State unspecified. (Value: "STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *state; @end /** * Metadata for ImportDocuments operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ImportDocumentsOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Response message for Documents.ImportDocuments. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ImportDocumentsResponse : GTLRObject /** Includes details about skipped documents or any other warnings. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleRpcStatus *> *warnings; @end /** * The request message for Flows.ImportFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowRequest : GTLRObject /** * Uncompressed raw byte content for flow. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *flowContent; /** * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to * import flow from. The format of this URI must be `gs:///`. */ @property(nonatomic, copy, nullable) NSString *flowUri; /** * Flow import mode. If not specified, `KEEP` is assumed. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowRequest_ImportOption_Fallback * Fallback to default settings if some settings are not supported in the * agent to import into. E.g. Standard NLU will be used if custom NLU is * not available. (Value: "FALLBACK") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowRequest_ImportOption_ImportOptionUnspecified * Unspecified. Treated as `KEEP`. (Value: "IMPORT_OPTION_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowRequest_ImportOption_Keep * Always respect settings in exported flow content. It may cause a * import failure if some settings (e.g. custom NLU) are not supported in * the agent to import into. (Value: "KEEP") */ @property(nonatomic, copy, nullable) NSString *importOption; @end /** * The response message for Flows.ImportFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ImportFlowResponse : GTLRObject /** * The unique identifier of the new flow. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *flow; @end /** * Metadata returned for the TestCases.ImportTestCases long running operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ImportTestCasesMetadata : GTLRObject /** Errors for failed test cases. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseError *> *errors; @end /** * The request message for TestCases.ImportTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ImportTestCasesRequest : GTLRObject /** * Uncompressed raw byte content for test cases. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *content; /** * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to * import test cases from. The format of this URI must be `gs:///`. */ @property(nonatomic, copy, nullable) NSString *gcsUri; @end /** * The response message for TestCases.ImportTestCases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ImportTestCasesResponse : GTLRObject /** * The unique identifiers of the new test cases. Format: * `projects//locations//agents//testCases/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *names; @end /** * Instructs the speech recognizer on how to process the audio content. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig : GTLRObject /** * Required. Audio encoding of the audio content to process. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingAmr * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be * 8000. (Value: "AUDIO_ENCODING_AMR") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingAmrWb * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. * (Value: "AUDIO_ENCODING_AMR_WB") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingFlac * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless * Audio Codec) is the recommended encoding because it is lossless * (therefore recognition is not compromised) and requires only about * half the bandwidth of `LINEAR16`. `FLAC` stream encoding supports * 16-bit and 24-bit samples, however, not all fields in `STREAMINFO` are * supported. (Value: "AUDIO_ENCODING_FLAC") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingLinear16 * Uncompressed 16-bit signed little-endian samples (Linear PCM). (Value: * "AUDIO_ENCODING_LINEAR_16") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingMulaw * 8-bit samples that compand 14-bit audio samples using G.711 * PCMU/mu-law. (Value: "AUDIO_ENCODING_MULAW") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingOggOpus * Opus encoded audio frames in Ogg container * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must * be 16000. (Value: "AUDIO_ENCODING_OGG_OPUS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingSpeexWithHeaderByte * Although the use of lossy encodings is not recommended, if a very low * bitrate encoding is required, `OGG_OPUS` is highly preferred over * Speex encoding. The [Speex](https://speex.org/) encoding supported by * Dialogflow API has a header byte in each block, as in MIME type * `audio/x-speex-with-header-byte`. It is a variant of the RTP Speex * encoding defined in [RFC 5574](https://tools.ietf.org/html/rfc5574). * The stream is a sequence of blocks, one block per RTP packet. Each * block starts with a byte containing the length of the block, in bytes, * followed by one or more frames of Speex data, padded to an integral * number of bytes (octets) as specified in RFC 5574. In other words, * each RTP header is replaced with a single byte containing the block * length. Only Speex wideband is supported. `sample_rate_hertz` must be * 16000. (Value: "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_AudioEncoding_AudioEncodingUnspecified * Not specified. (Value: "AUDIO_ENCODING_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *audioEncoding; /** * Optional. If `true`, Dialogflow returns SpeechWordInfo in * StreamingRecognitionResult with information about the recognized speech * words, e.g. start and end time offsets. If false or unspecified, Speech * doesn't return any word-level information. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableWordInfo; /** * Optional. Which Speech model to select for the given request. Select the * model best suited to your domain to get best results. If a model is not * explicitly specified, then we auto-select a model based on the parameters in * the InputAudioConfig. If enhanced speech model is enabled for the agent and * an enhanced version of the specified model for the language does not exist, * then the speech is recognized using the standard version of the specified * model. Refer to [Cloud Speech API * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) * for more details. */ @property(nonatomic, copy, nullable) NSString *model; /** * Optional. Which variant of the Speech model to use. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_ModelVariant_SpeechModelVariantUnspecified * No model variant specified. In this case Dialogflow defaults to * USE_BEST_AVAILABLE. (Value: "SPEECH_MODEL_VARIANT_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_ModelVariant_UseBestAvailable * Use the best available variant of the Speech model that the caller is * eligible for. Please see the [Dialogflow * docs](https://cloud.google.com/dialogflow/docs/data-logging) for how * to make your project eligible for enhanced models. (Value: * "USE_BEST_AVAILABLE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_ModelVariant_UseEnhanced * Use an enhanced model variant: * If an enhanced variant does not exist * for the given model and request language, Dialogflow falls back to the * standard variant. The [Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) * describes which models have enhanced variants. * If the API caller * isn't eligible for enhanced models, Dialogflow returns an error. * Please see the [Dialogflow * docs](https://cloud.google.com/dialogflow/docs/data-logging) for how * to make your project eligible. (Value: "USE_ENHANCED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3InputAudioConfig_ModelVariant_UseStandard * Use standard model variant even if an enhanced model is available. See * the [Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) * for details about enhanced models. (Value: "USE_STANDARD") */ @property(nonatomic, copy, nullable) NSString *modelVariant; /** * Optional. A list of strings containing words and phrases that the speech * recognizer should recognize with higher likelihood. See [the Cloud Speech * documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) * for more details. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *phraseHints; /** * Sample rate (in Hertz) of the audio content sent in the query. Refer to * [Cloud Speech API * documentation](https://cloud.google.com/speech-to-text/docs/basics) for more * details. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *sampleRateHertz; /** * Optional. If `false` (default), recognition does not cease until the client * closes the stream. If `true`, the recognizer will detect a single spoken * utterance in input audio. Recognition ceases when it detects the audio's * voice has stopped or paused. In this case, once a detected intent is * received, the client should close the stream and start a new request with a * new stream as needed. Note: This setting is relevant only for streaming * methods. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *singleUtterance; @end /** * An intent represents a user's intent to interact with a conversational * agent. You can provide information for the Dialogflow API to use to match * user input to an intent by adding training phrases (i.e., examples of user * input) to your intent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Intent : GTLRObject /** * Human readable description for better understanding an intent like its * scope, content, result etc. Maximum character limit: 140 characters. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Required. The human-readable name of the intent, unique within the agent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Indicates whether this is a fallback intent. Currently only default fallback * intent is allowed in the agent, which is added upon agent creation. Adding * training phrases to fallback intent is useful in the case of requests that * are mistakenly matched, since training phrases assigned to fallback intents * act as negative examples that triggers no-match event. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isFallback; /** * The key/value metadata to label an intent. Labels can contain lowercase * letters, digits and the symbols '-' and '_'. International characters are * allowed, including letters from unicase alphabets. Keys must start with a * letter. Keys and values can be no longer than 63 characters and no more than * 128 bytes. Prefix "sys-" is reserved for Dialogflow defined labels. * Currently allowed Dialogflow defined labels include: * sys-head * * sys-contextual The above labels do not require value. "sys-head" means the * intent is a head intent. "sys.contextual" means the intent is a contextual * intent. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Intent_Labels *labels; /** * The unique identifier of the intent. Required for the Intents.UpdateIntent * method. Intents.CreateIntent populates the name automatically. Format: * `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *name; /** The collection of parameters associated with the intent. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3IntentParameter *> *parameters; /** * The priority of this intent. Higher numbers represent higher priorities. - * If the supplied value is unspecified or 0, the service translates the value * to 500,000, which corresponds to the `Normal` priority in the console. - If * the supplied value is negative, the intent is ignored in runtime detect * intent requests. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *priority; /** * The collection of training phrases the agent is trained on to identify the * intent. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3IntentTrainingPhrase *> *trainingPhrases; @end /** * The key/value metadata to label an intent. Labels can contain lowercase * letters, digits and the symbols '-' and '_'. International characters are * allowed, including letters from unicase alphabets. Keys must start with a * letter. Keys and values can be no longer than 63 characters and no more than * 128 bytes. Prefix "sys-" is reserved for Dialogflow defined labels. * Currently allowed Dialogflow defined labels include: * sys-head * * sys-contextual The above labels do not require value. "sys-head" means the * intent is a head intent. "sys.contextual" means the intent is a contextual * intent. * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Intent_Labels : GTLRObject @end /** * Intent coverage represents the percentage of all possible intents in the * agent that are triggered in any of a parent's test cases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3IntentCoverage : GTLRObject /** * The percent of intents in the agent that are covered. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *coverageScore; /** The list of Intents present in the agent */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3IntentCoverageIntent *> *intents; @end /** * The agent's intent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3IntentCoverageIntent : GTLRObject /** * Whether or not the intent is covered by at least one of the agent's test * cases. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *covered; /** The intent full resource name */ @property(nonatomic, copy, nullable) NSString *intent; @end /** * Represents the intent to trigger programmatically rather than as a result of * natural language processing. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3IntentInput : GTLRObject /** * Required. The unique identifier of the intent. Format: * `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *intent; @end /** * Represents an intent parameter. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3IntentParameter : GTLRObject /** * Required. The entity type of the parameter. Format: * `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for * example, `projects/-/locations/-/agents/-/entityTypes/sys.date`), or * `projects//locations//agents//entityTypes/` for developer entity types. */ @property(nonatomic, copy, nullable) NSString *entityType; /** * Required. The unique identifier of the parameter. This field is used by * training phrases to annotate their parts. * * identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). */ @property(nonatomic, copy, nullable) NSString *identifier; /** * Indicates whether the parameter represents a list of values. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isList; /** * Indicates whether the parameter content should be redacted in log. If * redaction is enabled, the parameter content will be replaced by parameter * name during logging. Note: the parameter content is subject to redaction if * either parameter level redaction or entity type level redaction is enabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *redact; @end /** * Represents an example that the agent is trained on to identify the intent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3IntentTrainingPhrase : GTLRObject /** * Output only. The unique identifier of the training phrase. * * identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). */ @property(nonatomic, copy, nullable) NSString *identifier; /** * Required. The ordered list of training phrase parts. The parts are * concatenated in order to form the training phrase. Note: The API does not * automatically annotate training phrases like the Dialogflow Console does. * Note: Do not forget to include whitespace at part boundaries, so the * training phrase is well formatted when the parts are concatenated. If the * training phrase does not need to be annotated with parameters, you just need * a single part with only the Part.text field set. If you want to annotate the * training phrase, you must create multiple parts, where the fields of each * part are populated in one of two ways: - `Part.text` is set to a part of the * phrase that has no parameters. - `Part.text` is set to a part of the phrase * that you want to annotate, and the `parameter_id` field is set. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3IntentTrainingPhrasePart *> *parts; /** * Indicates how many times this example was added to the intent. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *repeatCount; @end /** * Represents a part of a training phrase. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3IntentTrainingPhrasePart : GTLRObject /** * The parameter used to annotate this part of the training phrase. This field * is required for annotated parts of the training phrase. */ @property(nonatomic, copy, nullable) NSString *parameterId; /** Required. The text for this part. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * The response message for Agents.ListAgents. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "agents" property. If returned as the result of a query, it should * support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListAgentsResponse : GTLRCollectionObject /** * The list of agents. There will be a maximum number of items returned based * on the page_size field in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Agent *> *agents; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for Changelogs.ListChangelogs. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "changelogs" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListChangelogsResponse : GTLRCollectionObject /** * The list of changelogs. There will be a maximum number of items returned * based on the page_size field in the request. The changelogs will be ordered * by timestamp. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Changelog *> *changelogs; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for Environments.ListTestCaseResults. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "continuousTestResults" property. If returned as the result of a * query, it should support automatic pagination (when @c * shouldFetchNextPages is enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListContinuousTestResultsResponse : GTLRCollectionObject /** * The list of continuous test results. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult *> *continuousTestResults; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for Deployments.ListDeployments. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "deployments" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListDeploymentsResponse : GTLRCollectionObject /** * The list of deployments. There will be a maximum number of items returned * based on the page_size field in the request. The list may in some cases be * empty or contain fewer entries than page_size even if this isn't the last * page. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Deployment *> *deployments; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for EntityTypes.ListEntityTypes. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "entityTypes" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListEntityTypesResponse : GTLRCollectionObject /** * The list of entity types. There will be a maximum number of items returned * based on the page_size field in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3EntityType *> *entityTypes; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for Environments.ListEnvironments. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "environments" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListEnvironmentsResponse : GTLRCollectionObject /** * The list of environments. There will be a maximum number of items returned * based on the page_size field in the request. The list may in some cases be * empty or contain fewer entries than page_size even if this isn't the last * page. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Environment *> *environments; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for Experiments.ListExperiments. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "experiments" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListExperimentsResponse : GTLRCollectionObject /** * The list of experiments. There will be a maximum number of items returned * based on the page_size field in the request. The list may in some cases be * empty or contain fewer entries than page_size even if this isn't the last * page. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Experiment *> *experiments; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for Flows.ListFlows. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "flows" property. If returned as the result of a query, it should * support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListFlowsResponse : GTLRCollectionObject /** * The list of flows. There will be a maximum number of items returned based on * the page_size field in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Flow *> *flows; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for Intents.ListIntents. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "intents" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListIntentsResponse : GTLRCollectionObject /** * The list of intents. There will be a maximum number of items returned based * on the page_size field in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Intent *> *intents; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * The response message for Pages.ListPages. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "pages" property. If returned as the result of a query, it should * support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListPagesResponse : GTLRCollectionObject /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * The list of pages. There will be a maximum number of items returned based on * the page_size field in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Page *> *pages; @end /** * The response message for SecuritySettings.ListSecuritySettings. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "securitySettings" property. If returned as the result of a query, * it should support automatic pagination (when @c shouldFetchNextPages * is enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListSecuritySettingsResponse : GTLRCollectionObject /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * The list of security settings. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings *> *securitySettings; @end /** * The response message for SessionEntityTypes.ListSessionEntityTypes. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "sessionEntityTypes" property. If returned as the result of a * query, it should support automatic pagination (when @c * shouldFetchNextPages is enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListSessionEntityTypesResponse : GTLRCollectionObject /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * The list of session entity types. There will be a maximum number of items * returned based on the page_size field in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType *> *sessionEntityTypes; @end /** * The response message for TestCases.ListTestCaseResults. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "testCaseResults" property. If returned as the result of a query, * it should support automatic pagination (when @c shouldFetchNextPages * is enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListTestCaseResultsResponse : GTLRCollectionObject /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * The list of test case results. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult *> *testCaseResults; @end /** * The response message for TestCases.ListTestCases. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "testCases" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListTestCasesResponse : GTLRCollectionObject /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * The list of test cases. There will be a maximum number of items returned * based on the page_size field in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TestCase *> *testCases; @end /** * The response message for TransitionRouteGroups.ListTransitionRouteGroups. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "transitionRouteGroups" property. If returned as the result of a * query, it should support automatic pagination (when @c * shouldFetchNextPages is enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListTransitionRouteGroupsResponse : GTLRCollectionObject /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * The list of transition route groups. There will be a maximum number of items * returned based on the page_size field in the request. The list may in some * cases be empty or contain fewer entries than page_size even if this isn't * the last page. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroup *> *transitionRouteGroups; @end /** * The response message for Versions.ListVersions. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "versions" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListVersionsResponse : GTLRCollectionObject /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * A list of versions. There will be a maximum number of items returned based * on the page_size field in the request. The list may in some cases be empty * or contain fewer entries than page_size even if this isn't the last page. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Version *> *versions; @end /** * The response message for Webhooks.ListWebhooks. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "webhooks" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ListWebhooksResponse : GTLRCollectionObject /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * The list of webhooks. There will be a maximum number of items returned based * on the page_size field in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Webhook *> *webhooks; @end /** * The request message for Versions.LoadVersion. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3LoadVersionRequest : GTLRObject /** * This field is used to prevent accidental overwrite of other agent resources, * which can potentially impact other flow's behavior. If * `allow_override_agent_resources` is false, conflicted agent-level resources * will not be overridden (i.e. intents, entities, webhooks). * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowOverrideAgentResources; @end /** * The response message for Environments.LookupEnvironmentHistory. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "environments" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3LookupEnvironmentHistoryResponse : GTLRCollectionObject /** * Represents a list of snapshots for an environment. Time of the snapshots is * stored in `update_time`. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Environment *> *environments; /** * Token to retrieve the next page of results, or empty if there are no more * results in the list. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * Represents one match result of MatchIntent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Match : GTLRObject /** * The confidence of this match. Values range from 0.0 (completely uncertain) * to 1.0 (completely certain). This value is for informational purpose only * and is only used to help match the best intent within the classification * threshold. This value may change for the same end-user expression at any * time due to a model retraining or change in implementation. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *confidence; /** The event that matched the query. Only filled for `EVENT` match type. */ @property(nonatomic, copy, nullable) NSString *event; /** * The Intent that matched the query. Some, not all fields are filled in this * message, including but not limited to: `name` and `display_name`. Only * filled for `INTENT` match type. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Intent *intent; /** * Type of this Match. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_DirectIntent * The query directly triggered an intent. (Value: "DIRECT_INTENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_Event The * query directly triggered an event. (Value: "EVENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_Intent * The query was matched to an intent. (Value: "INTENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_MatchTypeUnspecified * Not specified. Should never be used. (Value: "MATCH_TYPE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_NoInput * Indicates an empty query. (Value: "NO_INPUT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_NoMatch * No match was found for the query. (Value: "NO_MATCH") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Match_MatchType_ParameterFilling * The query was used for parameter filling. (Value: "PARAMETER_FILLING") */ @property(nonatomic, copy, nullable) NSString *matchType; /** * The collection of parameters extracted from the query. Depending on your * protocol or client library language, this is a map, associative array, * symbol table, dictionary, or JSON object composed of a collection of * (MapKey, MapValue) pairs: - MapKey type: string - MapKey value: parameter * name - MapValue type: - If parameter's entity type is a composite entity: * map - Else: depending on parameter value type, could be one of string, * number, boolean, null, list or map - MapValue value: - If parameter's entity * type is a composite entity: map from composite entity property names to * property values - Else: parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Match_Parameters *parameters; /** * Final text input which was matched during MatchIntent. This value can be * different from original input sent in request because of spelling correction * or other processing. */ @property(nonatomic, copy, nullable) NSString *resolvedInput; @end /** * The collection of parameters extracted from the query. Depending on your * protocol or client library language, this is a map, associative array, * symbol table, dictionary, or JSON object composed of a collection of * (MapKey, MapValue) pairs: - MapKey type: string - MapKey value: parameter * name - MapValue type: - If parameter's entity type is a composite entity: * map - Else: depending on parameter value type, could be one of string, * number, boolean, null, list or map - MapValue value: - If parameter's entity * type is a composite entity: map from composite entity property names to * property values - Else: parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Match_Parameters : GTLRObject @end /** * Request of MatchIntent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3MatchIntentRequest : GTLRObject /** Required. The input specification. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryInput *queryInput; /** The parameters of this query. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters *queryParams; @end /** * Response of MatchIntent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3MatchIntentResponse : GTLRObject /** * The current Page. Some, not all fields are filled in this message, including * but not limited to `name` and `display_name`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Page *currentPage; /** * Match results, if more than one, ordered descendingly by the confidence we * have that the particular intent matches the query. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3Match *> *matches; /** * If natural language text was provided as input, this field will contain a * copy of the text. */ @property(nonatomic, copy, nullable) NSString *text; /** * If natural language speech audio was provided as input, this field will * contain the transcript for the audio. */ @property(nonatomic, copy, nullable) NSString *transcript; /** * If an event was provided as input, this field will contain a copy of the * event name. */ @property(nonatomic, copy, nullable) NSString *triggerEvent; /** * If an intent was provided as input, this field will contain a copy of the * intent identifier. Format: `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *triggerIntent; @end /** * Settings related to NLU. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings : GTLRObject /** * To filter out false positive results and still get variety in matched * natural language inputs for your agent, you can tune the machine learning * classification threshold. If the returned score value is less than the * threshold value, then a no-match event will be triggered. The score values * range from 0.0 (completely uncertain) to 1.0 (completely certain). If set to * 0.0, the default of 0.3 is used. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *classificationThreshold; /** * Indicates NLU model training mode. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelTrainingMode_ModelTrainingModeAutomatic * NLU model training is automatically triggered when a flow gets * modified. User can also manually trigger model training in this mode. * (Value: "MODEL_TRAINING_MODE_AUTOMATIC") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelTrainingMode_ModelTrainingModeManual * User needs to manually trigger NLU model training. Best for large * flows whose models take long time to train. (Value: * "MODEL_TRAINING_MODE_MANUAL") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelTrainingMode_ModelTrainingModeUnspecified * Not specified. `MODEL_TRAINING_MODE_AUTOMATIC` will be used. (Value: * "MODEL_TRAINING_MODE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *modelTrainingMode; /** * Indicates the type of NLU model. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelType_ModelTypeAdvanced * Use advanced NLU model. (Value: "MODEL_TYPE_ADVANCED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelType_ModelTypeStandard * Use standard NLU model. (Value: "MODEL_TYPE_STANDARD") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings_ModelType_ModelTypeUnspecified * Not specified. `MODEL_TYPE_STANDARD` will be used. (Value: * "MODEL_TYPE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *modelType; @end /** * Instructs the speech synthesizer how to generate the output audio content. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig : GTLRObject /** * Required. Audio encoding of the synthesized audio content. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingLinear16 * Uncompressed 16-bit signed little-endian samples (Linear PCM). Audio * content returned as LINEAR16 also contains a WAV header. (Value: * "OUTPUT_AUDIO_ENCODING_LINEAR_16") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingMp3 * MP3 audio at 32kbps. (Value: "OUTPUT_AUDIO_ENCODING_MP3") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingMp364Kbps * MP3 audio at 64kbps. (Value: "OUTPUT_AUDIO_ENCODING_MP3_64_KBPS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingMulaw * 8-bit samples that compand 14-bit audio samples using G.711 * PCMU/mu-law. (Value: "OUTPUT_AUDIO_ENCODING_MULAW") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingOggOpus * Opus encoded audio wrapped in an ogg container. The result will be a * file which can be played natively on Android, and in browsers (at * least Chrome and Firefox). The quality of the encoding is considerably * higher than MP3 while using approximately the same bitrate. (Value: * "OUTPUT_AUDIO_ENCODING_OGG_OPUS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3OutputAudioConfig_AudioEncoding_OutputAudioEncodingUnspecified * Not specified. (Value: "OUTPUT_AUDIO_ENCODING_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *audioEncoding; /** * Optional. The synthesis sample rate (in hertz) for this audio. If not * provided, then the synthesizer will use the default sample rate based on the * audio encoding. If this is different from the voice's natural sample rate, * then the synthesizer will honor this request by converting to the desired * sample rate (which might result in worse audio quality). * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *sampleRateHertz; /** Optional. Configuration of how speech should be synthesized. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3SynthesizeSpeechConfig *synthesizeSpeechConfig; @end /** * A Dialogflow CX conversation (session) can be described and visualized as a * state machine. The states of a CX session are represented by pages. For each * flow, you define many pages, where your combined pages can handle a complete * conversation on the topics the flow is designed for. At any given moment, * exactly one page is the current page, the current page is considered active, * and the flow associated with that page is considered active. Every flow has * a special start page. When a flow initially becomes active, the start page * page becomes the current page. For each conversational turn, the current * page will either stay the same or transition to another page. You configure * each page to collect information from the end-user that is relevant for the * conversational state represented by the page. For more information, see the * [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Page : GTLRObject /** Required. The human-readable name of the page, unique within the agent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** The fulfillment to call when the session is entering the page. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Fulfillment *entryFulfillment; /** * Handlers associated with the page to handle events such as webhook errors, * no match or no input. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3EventHandler *> *eventHandlers; /** * The form associated with the page, used for collecting parameters relevant * to the page. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Form *form; /** * The unique identifier of the page. Required for the Pages.UpdatePage method. * Pages.CreatePage populates the name automatically. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * Ordered list of `TransitionRouteGroups` associated with the page. Transition * route groups must be unique within a page. * If multiple transition routes * within a page scope refer to the same intent, then the precedence order is: * page's transition route -> page's transition route group -> flow's * transition routes. * If multiple transition route groups within a page * contain the same intent, then the first group in the ordered list takes * precedence. * Format:`projects//locations//agents//flows//transitionRouteGroups/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *transitionRouteGroups; /** * A list of transitions for the transition rules of this page. They route the * conversation to another page in the same flow, or another flow. When we are * in a certain page, the TransitionRoutes are evalauted in the following * order: * TransitionRoutes defined in the page with intent specified. * * TransitionRoutes defined in the transition route groups with intent * specified. * TransitionRoutes defined in flow with intent specified. * * TransitionRoutes defined in the transition route groups with intent * specified. * TransitionRoutes defined in the page with only condition * specified. * TransitionRoutes defined in the transition route groups with * only condition specified. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRoute *> *transitionRoutes; @end /** * Represents page information communicated to and from the webhook. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfo : GTLRObject /** * Always present for WebhookRequest. Ignored for WebhookResponse. The unique * identifier of the current page. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *currentPage; /** * Always present for WebhookRequest. Ignored for WebhookResponse. The display * name of the current page. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional for both WebhookRequest and WebhookResponse. Information about the * form. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfo *formInfo; @end /** * Represents form information. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfo : GTLRObject /** * Optional for both WebhookRequest and WebhookResponse. The parameters * contained in the form. Note that the webhook cannot add or remove any form * parameter. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo *> *parameterInfo; @end /** * Represents parameter information. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo : GTLRObject /** * Always present for WebhookRequest. Required for WebhookResponse. The * human-readable name of the parameter, unique within the form. This field * cannot be modified by the webhook. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional for WebhookRequest. Ignored for WebhookResponse. Indicates if the * parameter value was just collected on the last conversation turn. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *justCollected; /** * Optional for both WebhookRequest and WebhookResponse. Indicates whether the * parameter is required. Optional parameters will not trigger prompts; * however, they are filled if the user specifies them. Required parameters * must be filled before form filling concludes. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *required; /** * Always present for WebhookRequest. Required for WebhookResponse. The state * of the parameter. This field can be set to INVALID by the webhook to * invalidate the parameter; other values set by the webhook will be ignored. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo_State_Empty * Indicates that the parameter does not have a value. (Value: "EMPTY") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo_State_Filled * Indicates that the parameter has a value. (Value: "FILLED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo_State_Invalid * Indicates that the parameter value is invalid. This field can be used * by the webhook to invalidate the parameter and ask the server to * collect it from the user again. (Value: "INVALID") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3PageInfoFormInfoParameterInfo_State_ParameterStateUnspecified * Not specified. This value should be never used. (Value: * "PARAMETER_STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *state; /** * Optional for both WebhookRequest and WebhookResponse. The value of the * parameter. This field can be set by the webhook to change the parameter * value. * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id value; @end /** * Represents the query input. It can contain one of: 1. A conversational query * in the form of text. 2. An intent query that specifies which intent to * trigger. 3. Natural language speech audio to be processed. 4. An event to be * triggered. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryInput : GTLRObject /** The natural language speech audio to be processed. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3AudioInput *audio; /** The DTMF event to be handled. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3DtmfInput *dtmf; /** The event to be triggered. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3EventInput *event; /** The intent to be triggered. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3IntentInput *intent; /** * Required. The language of the input. See [Language * Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) for * a list of the currently supported language codes. Note that queries in the * same session do not necessarily need to specify the same language. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** The natural language text to be processed. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TextInput *text; @end /** * Represents the parameters of a conversational query. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters : GTLRObject /** * Configures whether sentiment analysis should be performed. If not provided, * sentiment analysis is not performed. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *analyzeQueryTextSentiment; /** * The unique identifier of the page to override the current page in the * session. Format: `projects//locations//agents//flows//pages/`. If * `current_page` is specified, the previous state of the session will be * ignored by Dialogflow, including the previous page and the previous session * parameters. In most cases, current_page and parameters should be configured * together to direct a session to a specific state. */ @property(nonatomic, copy, nullable) NSString *currentPage; /** * Whether to disable webhook calls for this request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *disableWebhook; /** * A list of flow versions to override for the request. Format: * `projects//locations//agents//flows//versions/`. If version 1 of flow X is * included in this list, the traffic of flow X will go through version 1 * regardless of the version configuration in the environment. Each flow can * have at most one version specified in this list. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *flowVersions; /** The geo location of this conversational query. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleTypeLatLng *geoLocation; /** * Additional parameters to be put into session parameters. To remove a * parameter from the session, clients should explicitly set the parameter * value to null. You can reference the session parameters in the agent with * the following format: $session.params.parameter-id. Depending on your * protocol or client library language, this is a map, associative array, * symbol table, dictionary, or JSON object composed of a collection of * (MapKey, MapValue) pairs: - MapKey type: string - MapKey value: parameter * name - MapValue type: - If parameter's entity type is a composite entity: * map - Else: depending on parameter value type, could be one of string, * number, boolean, null, list or map - MapValue value: - If parameter's entity * type is a composite entity: map from composite entity property names to * property values - Else: parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_Parameters *parameters; /** * This field can be used to pass custom data into the webhook associated with * the agent. Arbitrary JSON objects are supported. Some integrations that * query a Dialogflow agent may provide additional information in the payload. * In particular, for the Dialogflow Phone Gateway integration, this field has * the form: ``` { "telephony": { "caller_id": "+18558363987" } } ``` */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_Payload *payload; /** * Additional session entity types to replace or extend developer entity types * with. The entity synonyms apply to all languages and persist for the session * of this query. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType *> *sessionEntityTypes; /** * The time zone of this conversational query from the [time zone * database](https://www.iana.org/time-zones), e.g., America/New_York, * Europe/Paris. If not provided, the time zone specified in the agent is used. */ @property(nonatomic, copy, nullable) NSString *timeZone; /** * This field can be used to pass HTTP headers for a webhook call. These * headers will be sent to webhook along with the headers that have been * configured through Dialogflow web console. The headers defined within this * field will overwrite the headers configured through Dialogflow console if * there is a conflict. Header names are case-insensitive. Google's specified * headers are not allowed. Including: "Host", "Content-Length", "Connection", * "From", "User-Agent", "Accept-Encoding", "If-Modified-Since", * "If-None-Match", "X-Forwarded-For", etc. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_WebhookHeaders *webhookHeaders; @end /** * Additional parameters to be put into session parameters. To remove a * parameter from the session, clients should explicitly set the parameter * value to null. You can reference the session parameters in the agent with * the following format: $session.params.parameter-id. Depending on your * protocol or client library language, this is a map, associative array, * symbol table, dictionary, or JSON object composed of a collection of * (MapKey, MapValue) pairs: - MapKey type: string - MapKey value: parameter * name - MapValue type: - If parameter's entity type is a composite entity: * map - Else: depending on parameter value type, could be one of string, * number, boolean, null, list or map - MapValue value: - If parameter's entity * type is a composite entity: map from composite entity property names to * property values - Else: parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_Parameters : GTLRObject @end /** * This field can be used to pass custom data into the webhook associated with * the agent. Arbitrary JSON objects are supported. Some integrations that * query a Dialogflow agent may provide additional information in the payload. * In particular, for the Dialogflow Phone Gateway integration, this field has * the form: ``` { "telephony": { "caller_id": "+18558363987" } } ``` * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_Payload : GTLRObject @end /** * This field can be used to pass HTTP headers for a webhook call. These * headers will be sent to webhook along with the headers that have been * configured through Dialogflow web console. The headers defined within this * field will overwrite the headers configured through Dialogflow console if * there is a conflict. Header names are case-insensitive. Google's specified * headers are not allowed. Including: "Host", "Content-Length", "Connection", * "From", "User-Agent", "Accept-Encoding", "If-Modified-Since", * "If-None-Match", "X-Forwarded-For", etc. * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryParameters_WebhookHeaders : GTLRObject @end /** * Represents the result of a conversational query. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult : GTLRObject /** * The current Page. Some, not all fields are filled in this message, including * but not limited to `name` and `display_name`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Page *currentPage; /** * The free-form diagnostic info. For example, this field could contain webhook * call latency. The string keys of the Struct's fields map can change without * notice. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_DiagnosticInfo *diagnosticInfo; /** * If a DTMF was provided as input, this field will contain a copy of the * DTMFInput. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3DtmfInput *dtmf; /** * The Intent that matched the conversational query. Some, not all fields are * filled in this message, including but not limited to: `name` and * `display_name`. This field is deprecated, please use QueryResult.match * instead. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Intent *intent; /** * The intent detection confidence. Values range from 0.0 (completely * uncertain) to 1.0 (completely certain). This value is for informational * purpose only and is only used to help match the best intent within the * classification threshold. This value may change for the same end-user * expression at any time due to a model retraining or change in * implementation. This field is deprecated, please use QueryResult.match * instead. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *intentDetectionConfidence; /** * The language that was triggered during intent detection. See [Language * Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) for * a list of the currently supported language codes. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** Intent match result, could be an intent or an event. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Match *match; /** * The collected session parameters. Depending on your protocol or client * library language, this is a map, associative array, symbol table, * dictionary, or JSON object composed of a collection of (MapKey, MapValue) * pairs: - MapKey type: string - MapKey value: parameter name - MapValue type: * - If parameter's entity type is a composite entity: map - Else: depending on * parameter value type, could be one of string, number, boolean, null, list or * map - MapValue value: - If parameter's entity type is a composite entity: * map from composite entity property names to property values - Else: * parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_Parameters *parameters; /** * The list of rich messages returned to the client. Responses vary from simple * text messages to more sophisticated, structured payloads used to drive * complex logic. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage *> *responseMessages; /** * The sentiment analyss result, which depends on * `analyze_query_text_sentiment`, specified in the request. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3SentimentAnalysisResult *sentimentAnalysisResult; /** * If natural language text was provided as input, this field will contain a * copy of the text. */ @property(nonatomic, copy, nullable) NSString *text; /** * If natural language speech audio was provided as input, this field will * contain the transcript for the audio. */ @property(nonatomic, copy, nullable) NSString *transcript; /** * If an event was provided as input, this field will contain the name of the * event. */ @property(nonatomic, copy, nullable) NSString *triggerEvent; /** * If an intent was provided as input, this field will contain a copy of the * intent identifier. Format: `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *triggerIntent; /** * The list of webhook payload in WebhookResponse.payload, in the order of call * sequence. If some webhook call fails or doesn't return any payload, an empty * `Struct` would be used instead. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_WebhookPayloads_Item *> *webhookPayloads; /** The list of webhook call status in the order of call sequence. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleRpcStatus *> *webhookStatuses; @end /** * The free-form diagnostic info. For example, this field could contain webhook * call latency. The string keys of the Struct's fields map can change without * notice. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_DiagnosticInfo : GTLRObject @end /** * The collected session parameters. Depending on your protocol or client * library language, this is a map, associative array, symbol table, * dictionary, or JSON object composed of a collection of (MapKey, MapValue) * pairs: - MapKey type: string - MapKey value: parameter name - MapValue type: * - If parameter's entity type is a composite entity: map - Else: depending on * parameter value type, could be one of string, number, boolean, null, list or * map - MapValue value: - If parameter's entity type is a composite entity: * map from composite entity property names to property values - Else: * parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_Parameters : GTLRObject @end /** * GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_WebhookPayloads_Item * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3QueryResult_WebhookPayloads_Item : GTLRObject @end /** * Metadata for ReloadDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ReloadDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Resource name and display name. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResourceName : GTLRObject /** Display name. */ @property(nonatomic, copy, nullable) NSString *displayName; /** Name. */ @property(nonatomic, copy, nullable) NSString *name; @end /** * Represents a response message that can be returned by a conversational * agent. Response messages are also used for output audio synthesis. The * approach is as follows: * If at least one OutputAudioText response is * present, then all OutputAudioText responses are linearly concatenated, and * the result is used for output audio synthesis. * If the OutputAudioText * responses are a mixture of text and SSML, then the concatenated result is * treated as SSML; otherwise, the result is treated as either text or SSML as * appropriate. The agent designer should ideally use either text or SSML * consistently throughout the bot design. * Otherwise, all Text responses are * linearly concatenated, and the result is used for output audio synthesis. * This approach allows for more sophisticated user experience scenarios, where * the text displayed to the user may differ from what is heard. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage : GTLRObject /** Indicates that the conversation succeeded. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess *conversationSuccess; /** * Output only. A signal that indicates the interaction with the Dialogflow * agent has ended. This message is generated by Dialogflow only when the * conversation reaches `END_SESSION` page. It is not supposed to be defined by * the user. It's guaranteed that there is at most one such message in each * response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageEndInteraction *endInteraction; /** Hands off conversation to a human agent. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff *liveAgentHandoff; /** * Output only. An audio response message composed of both the synthesized * Dialogflow agent responses and responses defined via play_audio. This * message is generated by Dialogflow only and not supposed to be defined by * the user. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageMixedAudio *mixedAudio; /** * A text or ssml response that is preferentially used for TTS output audio * synthesis, as described in the comment on the ResponseMessage message. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText *outputAudioText; /** Returns a response containing a custom, platform-specific payload. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage_Payload *payload; /** * Signal that the client should play an audio clip hosted at a client-specific * URI. Dialogflow uses this to construct mixed_audio. However, Dialogflow * itself does not try to read or process the URI in any way. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessagePlayAudio *playAudio; /** * A signal that the client should transfer the phone call connected to this * agent to a third-party endpoint. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageTelephonyTransferCall *telephonyTransferCall; /** Returns a text response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageText *text; @end /** * Returns a response containing a custom, platform-specific payload. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage_Payload : GTLRObject @end /** * Indicates that the conversation succeeded, i.e., the bot handled the issue * that the customer talked to it about. Dialogflow only uses this to determine * which conversations should be counted as successful and doesn't process the * metadata in this message in any way. Note that Dialogflow also considers * conversations that get to the conversation end page as successful even if * they don't return ConversationSuccess. You may set this, for example: * In * the entry_fulfillment of a Page if entering the page indicates that the * conversation succeeded. * In a webhook response when you determine that you * handled the customer issue. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess : GTLRObject /** Custom metadata. Dialogflow doesn't impose any structure on this. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess_Metadata *metadata; @end /** * Custom metadata. Dialogflow doesn't impose any structure on this. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageConversationSuccess_Metadata : GTLRObject @end /** * Indicates that interaction with the Dialogflow agent has ended. This message * is generated by Dialogflow only and not supposed to be defined by the user. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageEndInteraction : GTLRObject @end /** * Indicates that the conversation should be handed off to a live agent. * Dialogflow only uses this to determine which conversations were handed off * to a human agent for measurement purposes. What else to do with this signal * is up to you and your handoff procedures. You may set this, for example: * * In the entry_fulfillment of a Page if entering the page indicates something * went extremely wrong in the conversation. * In a webhook response when you * determine that the customer issue can only be handled by a human. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff : GTLRObject /** * Custom metadata for your handoff procedure. Dialogflow doesn't impose any * structure on this. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff_Metadata *metadata; @end /** * Custom metadata for your handoff procedure. Dialogflow doesn't impose any * structure on this. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageLiveAgentHandoff_Metadata : GTLRObject @end /** * Represents an audio message that is composed of both segments synthesized * from the Dialogflow agent prompts and ones hosted externally at the * specified URIs. The external URIs are specified via play_audio. This message * is generated by Dialogflow only and not supposed to be defined by the user. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageMixedAudio : GTLRObject /** Segments this audio response is composed of. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment *> *segments; @end /** * Represents one segment of audio. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageMixedAudioSegment : GTLRObject /** * Output only. Whether the playback of this segment can be interrupted by the * end user's speech and the client should then start the next Dialogflow * request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowPlaybackInterruption; /** * Raw audio synthesized from the Dialogflow agent's response using the output * config specified in the request. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *audio; /** * Client-specific URI that points to an audio clip accessible to the client. * Dialogflow does not impose any validation on it. */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * A text or ssml response that is preferentially used for TTS output audio * synthesis, as described in the comment on the ResponseMessage message. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageOutputAudioText : GTLRObject /** * Output only. Whether the playback of this message can be interrupted by the * end user's speech and the client can then starts the next Dialogflow * request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowPlaybackInterruption; /** * The SSML text to be synthesized. For more information, see * [SSML](/speech/text-to-speech/docs/ssml). */ @property(nonatomic, copy, nullable) NSString *ssml; /** The raw text to be synthesized. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Specifies an audio clip to be played by the client as part of the response. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessagePlayAudio : GTLRObject /** * Output only. Whether the playback of this message can be interrupted by the * end user's speech and the client can then starts the next Dialogflow * request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowPlaybackInterruption; /** * Required. URI of the audio clip. Dialogflow does not impose any validation * on this value. It is specific to the client that reads it. */ @property(nonatomic, copy, nullable) NSString *audioUri; @end /** * Represents the signal that telles the client to transfer the phone call * connected to the agent to a third-party endpoint. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageTelephonyTransferCall : GTLRObject /** * Transfer the call to a phone number in [E.164 * format](https://en.wikipedia.org/wiki/E.164). */ @property(nonatomic, copy, nullable) NSString *phoneNumber; @end /** * The text response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessageText : GTLRObject /** * Output only. Whether the playback of this message can be interrupted by the * end user's speech and the client can then starts the next Dialogflow * request. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allowPlaybackInterruption; /** Required. A collection of text responses. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *text; @end /** * The request message for Agents.RestoreAgent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RestoreAgentRequest : GTLRObject /** * Uncompressed raw byte content for agent. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *agentContent; /** * The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to * restore agent from. The format of this URI must be `gs:///`. */ @property(nonatomic, copy, nullable) NSString *agentUri; /** * Agent restore mode. If not specified, `KEEP` is assumed. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3RestoreAgentRequest_RestoreOption_Fallback * Fallback to default settings if some settings are not supported in the * target agent. (Value: "FALLBACK") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3RestoreAgentRequest_RestoreOption_Keep * Always respect the settings from the exported agent file. It may cause * a restoration failure if some settings (e.g. model type) are not * supported in the target agent. (Value: "KEEP") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3RestoreAgentRequest_RestoreOption_RestoreOptionUnspecified * Unspecified. Treated as KEEP. (Value: "RESTORE_OPTION_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *restoreOption; @end /** * The configuration for auto rollout. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutConfig : GTLRObject /** * The conditions that are used to evaluate the failure of a rollout step. If * not specified, no rollout steps will fail. E.g. "containment_rate < 10% OR * average_turn_count < 3". See the [conditions * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). */ @property(nonatomic, copy, nullable) NSString *failureCondition; /** * The conditions that are used to evaluate the success of a rollout step. If * not specified, all rollout steps will proceed to the next one unless failure * conditions are met. E.g. "containment_rate > 60% AND callback_rate < 20%". * See the [conditions * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). */ @property(nonatomic, copy, nullable) NSString *rolloutCondition; /** * Steps to roll out a flow version. Steps should be sorted by percentage in * ascending order. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutConfigRolloutStep *> *rolloutSteps; @end /** * A single rollout step with specified traffic allocation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutConfigRolloutStep : GTLRObject /** The name of the rollout step; */ @property(nonatomic, copy, nullable) NSString *displayName; /** * The minimum time that this step should last. Should be longer than 1 hour. * If not set, the default minimum duration for each step will be 1 hour. */ @property(nonatomic, strong, nullable) GTLRDuration *minDuration; /** * The percentage of traffic allocated to the flow version of this rollout * step. (0%, 100%]. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *trafficPercent; @end /** * State of the auto-rollout process. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RolloutState : GTLRObject /** Start time of the current step. */ @property(nonatomic, strong, nullable) GTLRDateTime *startTime; /** Display name of the current auto rollout step. */ @property(nonatomic, copy, nullable) NSString *step; /** * Index of the current step in the auto rollout steps list. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *stepIndex; @end /** * Metadata returned for the Environments.RunContinuousTest long running * operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RunContinuousTestMetadata : GTLRObject /** The test errors. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TestError *> *errors; @end /** * The request message for Environments.RunContinuousTest. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RunContinuousTestRequest : GTLRObject @end /** * The response message for Environments.RunContinuousTest. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RunContinuousTestResponse : GTLRObject /** The result for a continuous test run. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3ContinuousTestResult *continuousTestResult; @end /** * Metadata returned for the TestCases.RunTestCase long running operation. This * message currently has no fields. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RunTestCaseMetadata : GTLRObject @end /** * The request message for TestCases.RunTestCase. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RunTestCaseRequest : GTLRObject /** * Optional. Environment name. If not set, draft environment is assumed. * Format: `projects//locations//agents//environments/`. */ @property(nonatomic, copy, nullable) NSString *environment; @end /** * The response message for TestCases.RunTestCase. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3RunTestCaseResponse : GTLRObject /** The result. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult *result; @end /** * Represents the settings related to security issues, such as data redaction * and data retention. It may take hours for updates on the settings to * propagate to all the related components and take effect. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings : GTLRObject /** * [DLP](https://cloud.google.com/dlp/docs) deidentify template name. Use this * template to define de-identification configuration for the content. The `DLP * De-identify Templates Reader` role is needed on the Dialogflow service * identity service account (has the form * `service-PROJECT_NUMBER\@gcp-sa-dialogflow.iam.gserviceaccount.com`) for * your agent's project. If empty, Dialogflow replaces sensitive info with * `[redacted]` text. The template name will have one of the following formats: * `projects//locations//deidentifyTemplates/` OR * `organizations//locations//deidentifyTemplates/` Note: `deidentify_template` * must be located in the same region as the `SecuritySettings`. */ @property(nonatomic, copy, nullable) NSString *deidentifyTemplate; /** * Required. The human-readable name of the security settings, unique within * the location. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Controls conversation exporting settings to Insights after conversation is * completed. If retention_strategy is set to REMOVE_AFTER_CONVERSATION, * Insights export is disabled no matter what you configure here. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettingsInsightsExportSettings *insightsExportSettings; /** * [DLP](https://cloud.google.com/dlp/docs) inspect template name. Use this * template to define inspect base settings. The `DLP Inspect Templates Reader` * role is needed on the Dialogflow service identity service account (has the * form `service-PROJECT_NUMBER\@gcp-sa-dialogflow.iam.gserviceaccount.com`) * for your agent's project. If empty, we use the default DLP inspect config. * The template name will have one of the following formats: * `projects//locations//inspectTemplates/` OR * `organizations//locations//inspectTemplates/` Note: `inspect_template` must * be located in the same region as the `SecuritySettings`. */ @property(nonatomic, copy, nullable) NSString *inspectTemplate; /** * Resource name of the settings. Required for the * SecuritySettingsService.UpdateSecuritySettings method. * SecuritySettingsService.CreateSecuritySettings populates the name * automatically. Format: `projects//locations//securitySettings/`. */ @property(nonatomic, copy, nullable) NSString *name; /** List of types of data to remove when retention settings triggers purge. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *purgeDataTypes; /** * Defines the data for which Dialogflow applies redaction. Dialogflow does not * redact data that it does not have access to – for example, Cloud logging. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_RedactionScope_RedactDiskStorage * On data to be written to disk or similar devices that are capable of * holding data even if power is disconnected. This includes data that * are temporarily saved on disk. (Value: "REDACT_DISK_STORAGE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_RedactionScope_RedactionScopeUnspecified * Don't redact any kind of data. (Value: "REDACTION_SCOPE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *redactionScope; /** * Strategy that defines how we do redaction. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_RedactionStrategy_RedactionStrategyUnspecified * Do not redact. (Value: "REDACTION_STRATEGY_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettings_RedactionStrategy_RedactWithService * Call redaction service to clean up the data to be persisted. (Value: * "REDACT_WITH_SERVICE") */ @property(nonatomic, copy, nullable) NSString *redactionStrategy; /** * Retains data in interaction logging for the specified number of days. This * does not apply to Cloud logging, which is owned by the user - not * Dialogflow. User must set a value lower than Dialogflow's default 365d TTL. * Setting a value higher than that has no effect. A missing value or setting * to 0 also means we use Dialogflow's default TTL. Note: Interaction logging * is a limited access feature. Talk to your Google representative to check * availability for you. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *retentionWindowDays; @end /** * Settings for exporting conversations to * [Insights](https://cloud.google.com/dialogflow/priv/docs/insights). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3SecuritySettingsInsightsExportSettings : GTLRObject /** * If enabled, we will automatically exports conversations to Insights and * Insights runs its analyzers. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableInsightsExport; @end /** * The result of sentiment analysis. Sentiment analysis inspects user input and * identifies the prevailing subjective opinion, especially to determine a * user's attitude as positive, negative, or neutral. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3SentimentAnalysisResult : GTLRObject /** * A non-negative number in the [0, +inf) range, which represents the absolute * magnitude of sentiment, regardless of score (positive or negative). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *magnitude; /** * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive * sentiment). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *score; @end /** * Session entity types are referred to as **User** entity types and are * entities that are built for an individual user such as favorites, * preferences, playlists, and so on. You can redefine a session entity type at * the session level to extend or replace a custom entity type at the user * session level (we refer to the entity types defined at the agent level as * "custom entity types"). Note: session entity types apply to all queries, * regardless of the language. For more information about entity types, see the * [Dialogflow * documentation](https://cloud.google.com/dialogflow/docs/entities-overview). */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType : GTLRObject /** * Required. The collection of entities to override or supplement the custom * entity type. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3EntityTypeEntity *> *entities; /** * Required. Indicates whether the additional data should override or * supplement the custom entity type definition. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType_EntityOverrideMode_EntityOverrideModeOverride * The collection of session entities overrides the collection of * entities in the corresponding custom entity type. (Value: * "ENTITY_OVERRIDE_MODE_OVERRIDE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType_EntityOverrideMode_EntityOverrideModeSupplement * The collection of session entities extends the collection of entities * in the corresponding custom entity type. Note: Even in this override * mode calls to `ListSessionEntityTypes`, `GetSessionEntityType`, * `CreateSessionEntityType` and `UpdateSessionEntityType` only return * the additional entities added in this session entity type. If you want * to get the supplemented list, please call EntityTypes.GetEntityType on * the custom entity type and merge. (Value: * "ENTITY_OVERRIDE_MODE_SUPPLEMENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3SessionEntityType_EntityOverrideMode_EntityOverrideModeUnspecified * Not specified. This value should be never used. (Value: * "ENTITY_OVERRIDE_MODE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *entityOverrideMode; /** * Required. The unique identifier of the session entity type. Format: * `projects//locations//agents//sessions//entityTypes/` or * `projects//locations//agents//environments//sessions//entityTypes/`. If * `Environment ID` is not specified, we assume default 'draft' environment. */ @property(nonatomic, copy, nullable) NSString *name; @end /** * Represents session information communicated to and from the webhook. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3SessionInfo : GTLRObject /** * Optional for WebhookRequest. Optional for WebhookResponse. All parameters * collected from forms and intents during the session. Parameters can be * created, updated, or removed by the webhook. To remove a parameter from the * session, the webhook should explicitly set the parameter value to null in * WebhookResponse. The map is keyed by parameters' display names. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3SessionInfo_Parameters *parameters; /** * Always present for WebhookRequest. Ignored for WebhookResponse. The unique * identifier of the session. This field can be used by the webhook to identify * a session. Format: `projects//locations//agents//sessions/` or * `projects//locations//agents//environments//sessions/` if environment is * specified. */ @property(nonatomic, copy, nullable) NSString *session; @end /** * Optional for WebhookRequest. Optional for WebhookResponse. All parameters * collected from forms and intents during the session. Parameters can be * created, updated, or removed by the webhook. To remove a parameter from the * session, the webhook should explicitly set the parameter value to null in * WebhookResponse. The map is keyed by parameters' display names. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3SessionInfo_Parameters : GTLRObject @end /** * Settings related to speech recognition. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3SpeechToTextSettings : GTLRObject /** * Whether to use speech adaptation for speech recognition. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableSpeechAdaptation; @end /** * The request message for Experiments.StartExperiment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3StartExperimentRequest : GTLRObject @end /** * The request message for Experiments.StopExperiment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3StopExperimentRequest : GTLRObject @end /** * Configuration of how speech should be synthesized. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3SynthesizeSpeechConfig : GTLRObject /** * Optional. An identifier which selects 'audio effects' profiles that are * applied on (post synthesized) text to speech. Effects are applied on top of * each other in the order they are given. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *effectsProfileId; /** * Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 * semitones from the original pitch. -20 means decrease 20 semitones from the * original pitch. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *pitch; /** * Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other * values < 0.25 or > 4.0 will return an error. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *speakingRate; /** Optional. The desired voice of the synthesized audio. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams *voice; /** * Optional. Volume gain (in dB) of the normal native volume supported by the * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) * will play at approximately half the amplitude of the normal native signal * amplitude. A value of +6.0 (dB) will play at approximately twice the * amplitude of the normal native signal amplitude. We strongly recommend not * to exceed +10 (dB) as there's usually no effective increase in loudness for * any value greater than that. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *volumeGainDb; @end /** * Represents a test case. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TestCase : GTLRObject /** Output only. When the test was created. */ @property(nonatomic, strong, nullable) GTLRDateTime *creationTime; /** * Required. The human-readable name of the test case, unique within the agent. * Limit of 200 characters. */ @property(nonatomic, copy, nullable) NSString *displayName; /** The latest test result. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult *lastTestResult; /** * The unique identifier of the test case. TestCases.CreateTestCase will * populate the name automatically. Otherwise use format: * `projects//locations//agents/ /testCases/`. */ @property(nonatomic, copy, nullable) NSString *name; /** Additional freeform notes about the test case. Limit of 400 characters. */ @property(nonatomic, copy, nullable) NSString *notes; /** * Tags are short descriptions that users may apply to test cases for * organizational and filtering purposes. Each tag should start with "#" and * has a limit of 30 characters. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *tags; /** * The conversation turns uttered when the test case was created, in * chronological order. These include the canonical set of agent utterances * that should occur when the agent is working properly. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurn *> *testCaseConversationTurns; /** Config for the test case. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TestConfig *testConfig; @end /** * Error info for importing a test. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseError : GTLRObject /** The status associated with the test case. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *status; /** The test case. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TestCase *testCase; @end /** * Represents a result from running a test case in an agent environment. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult : GTLRObject /** * The conversation turns uttered during the test case replay in chronological * order. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ConversationTurn *> *conversationTurns; /** * Environment where the test was run. If not set, it indicates the draft * environment. */ @property(nonatomic, copy, nullable) NSString *environment; /** * The resource name for the test case result. Format: * `projects//locations//agents//testCases/ /results/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * Whether the test case passed in the agent environment. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult_TestResult_Failed * The test did not pass. (Value: "FAILED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult_TestResult_Passed * The test passed. (Value: "PASSED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3TestCaseResult_TestResult_TestResultUnspecified * Not specified. Should never be used. (Value: * "TEST_RESULT_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *testResult; /** The time that the test was run. */ @property(nonatomic, strong, nullable) GTLRDateTime *testTime; @end /** * Represents configurations for a test case. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TestConfig : GTLRObject /** * Flow name. If not set, default start flow is assumed. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *flow; /** Session parameters to be compared when calculating differences. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *trackingParameters; @end /** * Error info for running a test. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TestError : GTLRObject /** The status associated with the test. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *status; /** The test case resource name. */ @property(nonatomic, copy, nullable) NSString *testCase; /** The timestamp when the test was completed. */ @property(nonatomic, strong, nullable) GTLRDateTime *testTime; @end /** * The description of differences between original and replayed agent output. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference : GTLRObject /** * A description of the diff, showing the actual output vs expected output. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * The type of diff. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_DiffTypeUnspecified * Should never be used. (Value: "DIFF_TYPE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_Intent * The intent. (Value: "INTENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_Page * The page. (Value: "PAGE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_Parameters * The parameters. (Value: "PARAMETERS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3TestRunDifference_Type_Utterance * The message utterance. (Value: "UTTERANCE") */ @property(nonatomic, copy, nullable) NSString *type; @end /** * Represents the natural language text to be processed. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TextInput : GTLRObject /** * Required. The UTF-8 encoded natural language text to be processed. Text * length must not exceed 256 characters. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * The request message for Flows.TrainFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TrainFlowRequest : GTLRObject @end /** * Transition coverage represents the percentage of all possible page * transitions (page-level transition routes and event handlers, excluding * transition route groups) present within any of a parent's test cases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverage : GTLRObject /** * The percent of transitions in the agent that are covered. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *coverageScore; /** The list of Transitions present in the agent. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverageTransition *> *transitions; @end /** * A transition in a page. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverageTransition : GTLRObject /** * Whether or not the transition is covered by at least one of the agent's test * cases. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *covered; /** Event handler. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3EventHandler *eventHandler; /** * The index of a transition in the transition list. Starting from 0. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *index; /** The start node of a transition. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverageTransitionNode *source; /** The end node of a transition. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverageTransitionNode *target; /** Intent route or condition route. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRoute *transitionRoute; @end /** * The source or target of a transition. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionCoverageTransitionNode : GTLRObject /** * Indicates a transition to a Flow. Only some fields such as name and * displayname will be set. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Flow *flow; /** * Indicates a transition to a Page. Only some fields such as name and * displayname will be set. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Page *page; @end /** * A transition route specifies a intent that can be matched and/or a data * condition that can be evaluated during a session. When a specified * transition is matched, the following actions are taken in order: * If there * is a `trigger_fulfillment` associated with the transition, it will be * called. * If there is a `target_page` associated with the transition, the * session will transition into the specified page. * If there is a * `target_flow` associated with the transition, the session will transition * into the specified flow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRoute : GTLRObject /** * The condition to evaluate against form parameters or session parameters. See * the [conditions * reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition). * At least one of `intent` or `condition` must be specified. When both * `intent` and `condition` are specified, the transition can only happen when * both are fulfilled. */ @property(nonatomic, copy, nullable) NSString *condition; /** * The unique identifier of an Intent. Format: * `projects//locations//agents//intents/`. Indicates that the transition can * only happen when the given intent is matched. At least one of `intent` or * `condition` must be specified. When both `intent` and `condition` are * specified, the transition can only happen when both are fulfilled. */ @property(nonatomic, copy, nullable) NSString *intent; /** Output only. The unique identifier of this transition route. */ @property(nonatomic, copy, nullable) NSString *name; /** * The target flow to transition to. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *targetFlow; /** * The target page to transition to. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *targetPage; /** * The fulfillment to call when the condition is satisfied. At least one of * `trigger_fulfillment` and `target` must be specified. When both are defined, * `trigger_fulfillment` is executed first. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3Fulfillment *triggerFulfillment; @end /** * An TransitionRouteGroup represents a group of `TransitionRoutes` to be used * by a Page. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroup : GTLRObject /** * Required. The human-readable name of the transition route group, unique * within the Agent. The display name can be no longer than 30 characters. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * The unique identifier of the transition route group. * TransitionRouteGroups.CreateTransitionRouteGroup populates the name * automatically. Format: * `projects//locations//agents//flows//transitionRouteGroups/`. */ @property(nonatomic, copy, nullable) NSString *name; /** Transition routes associated with the TransitionRouteGroup. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRoute *> *transitionRoutes; @end /** * Transition route group coverage represents the percentage of all possible * transition routes present within any of a parent's test cases. The results * are grouped by the transition route group. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverage : GTLRObject /** Transition route group coverages. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverageCoverage *> *coverages; /** * The percent of transition routes in all the transition route groups that are * covered. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *coverageScore; @end /** * Coverage result message for one transition route group. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverageCoverage : GTLRObject /** * The percent of transition routes in the transition route group that are * covered. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *coverageScore; /** Transition route group metadata. Only name and displayName will be set. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroup *routeGroup; /** * The list of transition routes and coverage in the transition route group. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverageCoverageTransition *> *transitions; @end /** * A transition coverage in a transition route group. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRouteGroupCoverageCoverageTransition : GTLRObject /** * Whether or not the transition route is covered by at least one of the * agent's test cases. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *covered; /** Intent route or condition route. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3TransitionRoute *transitionRoute; @end /** * Metadata for UpdateDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3UpdateDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3GenericKnowledgeOperationMetadata *genericMetadata; @end /** * The request message for Agents.ValidateAgent. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ValidateAgentRequest : GTLRObject /** If not specified, the agent's default language is used. */ @property(nonatomic, copy, nullable) NSString *languageCode; @end /** * The request message for Flows.ValidateFlow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ValidateFlowRequest : GTLRObject /** If not specified, the agent's default language is used. */ @property(nonatomic, copy, nullable) NSString *languageCode; @end /** * Agent/flow validation message. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage : GTLRObject /** The message detail. */ @property(nonatomic, copy, nullable) NSString *detail; /** The resource names of the resources where the message is found. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ResourceName *> *resourceNames; /** The names of the resources where the message is found. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *resources; /** * The type of the resources where the message is found. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Agent * Agent. (Value: "AGENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_EntityType * Entity type. (Value: "ENTITY_TYPE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_EntityTypes * Multiple entity types. (Value: "ENTITY_TYPES") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Flow * Flow. (Value: "FLOW") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Intent * Intent. (Value: "INTENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_IntentParameter * Intent parameter. (Value: "INTENT_PARAMETER") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Intents * Multiple intents. (Value: "INTENTS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_IntentTrainingPhrase * Intent training phrase. (Value: "INTENT_TRAINING_PHRASE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_IntentTrainingPhrases * Multiple training phrases. (Value: "INTENT_TRAINING_PHRASES") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Page * Page. (Value: "PAGE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Pages * Multiple pages. (Value: "PAGES") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_ResourceTypeUnspecified * Unspecified. (Value: "RESOURCE_TYPE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_TransitionRouteGroup * Transition route group. (Value: "TRANSITION_ROUTE_GROUP") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_ResourceType_Webhook * Webhook. (Value: "WEBHOOK") */ @property(nonatomic, copy, nullable) NSString *resourceType; /** * Indicates the severity of the message. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_Severity_Error * The agent may experience failures. (Value: "ERROR") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_Severity_Info * The agent doesn't follow Dialogflow best practices. (Value: "INFO") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_Severity_SeverityUnspecified * Unspecified. (Value: "SEVERITY_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3ValidationMessage_Severity_Warning * The agent may not behave as expected. (Value: "WARNING") */ @property(nonatomic, copy, nullable) NSString *severity; @end /** * The history of variants update. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3VariantsHistory : GTLRObject /** Update time of the variants. */ @property(nonatomic, strong, nullable) GTLRDateTime *updateTime; /** The flow versions as the variants. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3VersionVariants *versionVariants; @end /** * Represents a version of a flow. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Version : GTLRObject /** Output only. Create time of the version. */ @property(nonatomic, strong, nullable) GTLRDateTime *createTime; /** * The description of the version. The maximum length is 500 characters. If * exceeded, the request is rejected. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Required. The human-readable name of the version. Limit of 64 characters. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Format: projects//locations//agents//flows//versions/. Version ID is a * self-increasing number generated by Dialogflow upon version creation. */ @property(nonatomic, copy, nullable) NSString *name; /** Output only. The NLU settings of the flow at version creation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3NluSettings *nluSettings; /** * Output only. The state of this version. This field is read-only and cannot * be set by create and update methods. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Version_State_Failed * Version training failed. (Value: "FAILED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Version_State_Running * Version is not ready to serve (e.g. training is running). (Value: * "RUNNING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Version_State_StateUnspecified * Not specified. This value is not used. (Value: "STATE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3Version_State_Succeeded * Training has succeeded and this version is ready to serve. (Value: * "SUCCEEDED") */ @property(nonatomic, copy, nullable) NSString *state; @end /** * A list of flow version variants. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3VersionVariants : GTLRObject /** A list of flow version variants. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3VersionVariantsVariant *> *variants; @end /** * A single flow version with specified traffic allocation. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3VersionVariantsVariant : GTLRObject /** * Whether the variant is for the control group. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isControlGroup; /** * Percentage of the traffic which should be routed to this version of flow. * Traffic allocation for a single flow must sum up to 1.0. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *trafficAllocation; /** * The name of the flow version. Format: * `projects//locations//agents//flows//versions/`. */ @property(nonatomic, copy, nullable) NSString *version; @end /** * Description of which voice to use for speech synthesis. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams : GTLRObject /** * Optional. The name of the voice. If not set, the service will choose a voice * based on the other parameters such as language_code and ssml_gender. For the * list of available voices, please refer to [Supported voices and * languages](https://cloud.google.com/text-to-speech/docs/voices). */ @property(nonatomic, copy, nullable) NSString *name; /** * Optional. The preferred gender of the voice. If not set, the service will * choose a voice based on the other parameters such as language_code and name. * Note that this is only a preference, not requirement. If a voice of the * appropriate gender is not available, the synthesizer substitutes a voice * with a different gender rather than failing the request. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams_SsmlGender_SsmlVoiceGenderFemale * A female voice. (Value: "SSML_VOICE_GENDER_FEMALE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams_SsmlGender_SsmlVoiceGenderMale * A male voice. (Value: "SSML_VOICE_GENDER_MALE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams_SsmlGender_SsmlVoiceGenderNeutral * A gender-neutral voice. (Value: "SSML_VOICE_GENDER_NEUTRAL") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3VoiceSelectionParams_SsmlGender_SsmlVoiceGenderUnspecified * An unspecified gender, which means that the client doesn't care which * gender the selected voice will have. (Value: * "SSML_VOICE_GENDER_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *ssmlGender; @end /** * Webhooks host the developer's business logic. During a session, webhooks * allow the developer to use the data extracted by Dialogflow's natural * language processing to generate dynamic responses, validate collected data, * or trigger actions on the backend. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3Webhook : GTLRObject /** * Indicates whether the webhook is disabled. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *disabled; /** * Required. The human-readable name of the webhook, unique within the agent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** Configuration for a generic web service. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookGenericWebService *genericWebService; /** * The unique identifier of the webhook. Required for the * Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name * automatically. Format: `projects//locations//agents//webhooks/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * Configuration for a [Service * Directory](https://cloud.google.com/service-directory) service. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookServiceDirectoryConfig *serviceDirectory; /** * Webhook execution timeout. Execution is considered failed if Dialogflow * doesn't receive a response from webhook at the end of the timeout period. * Defaults to 5 seconds, maximum allowed timeout is 30 seconds. */ @property(nonatomic, strong, nullable) GTLRDuration *timeout; @end /** * Represents configuration for a generic web service. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookGenericWebService : GTLRObject /** * Optional. Specifies a list of allowed custom CA certificates (in DER format) * for HTTPS verification. This overrides the default SSL trust store. If this * is empty or unspecified, Dialogflow will use Google's default trust store to * verify certificates. N.B. Make sure the HTTPS server certificates are signed * with "subject alt name". For instance a certificate can be self-signed using * the following command, openssl x509 -req -days 200 -in example.com.csr \\ * -signkey example.com.key \\ -out example.com.crt \\ -extfile <(printf * "\\nsubjectAltName='DNS:www.example.com'") * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, strong, nullable) NSArray<NSString *> *allowedCaCerts; /** The password for HTTP Basic authentication. */ @property(nonatomic, copy, nullable) NSString *password; /** The HTTP request headers to send together with webhook requests. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookGenericWebService_RequestHeaders *requestHeaders; /** * Required. The webhook URI for receiving POST requests. It must use https * protocol. */ @property(nonatomic, copy, nullable) NSString *uri; /** The user name for HTTP Basic authentication. */ @property(nonatomic, copy, nullable) NSString *username; @end /** * The HTTP request headers to send together with webhook requests. * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookGenericWebService_RequestHeaders : GTLRObject @end /** * The request message for a webhook call. The request is sent as a JSON object * and the field names will be presented in camel cases. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequest : GTLRObject /** * Always present. The unique identifier of the DetectIntentResponse that will * be returned to the API caller. */ @property(nonatomic, copy, nullable) NSString *detectIntentResponseId; /** * Always present. Information about the fulfillment that triggered this * webhook call. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo *fulfillmentInfo; /** Information about the last matched intent. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfo *intentInfo; /** The language code specified in the original request. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** * The list of rich message responses to present to the user. Webhook can * choose to append or replace this list in * WebhookResponse.fulfillment_response; */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage *> *messages; /** Information about page status. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfo *pageInfo; /** Custom data set in QueryParameters.payload. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequest_Payload *payload; /** * The sentiment analysis result of the current user request. The field is * filled when sentiment analysis is configured to be enabled for the request. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestSentimentAnalysisResult *sentimentAnalysisResult; /** Information about session status. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3SessionInfo *sessionInfo; /** * If natural language text was provided as input, this field will contain a * copy of the text. */ @property(nonatomic, copy, nullable) NSString *text; /** * If natural language speech audio was provided as input, this field will * contain the transcript for the audio. */ @property(nonatomic, copy, nullable) NSString *transcript; /** * If an event was provided as input, this field will contain the name of the * event. */ @property(nonatomic, copy, nullable) NSString *triggerEvent; /** * If an intent was provided as input, this field will contain a copy of the * intent identifier. Format: `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *triggerIntent; @end /** * Custom data set in QueryParameters.payload. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequest_Payload : GTLRObject @end /** * Represents fulfillment information communicated to the webhook. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestFulfillmentInfo : GTLRObject /** * Always present. The tag used to identify which fulfillment is being called. */ @property(nonatomic, copy, nullable) NSString *tag; @end /** * Represents intent information communicated to the webhook. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfo : GTLRObject /** * The confidence of the matched intent. Values range from 0.0 (completely * uncertain) to 1.0 (completely certain). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *confidence; /** Always present. The display name of the last matched intent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Always present. The unique identifier of the last matched intent. Format: * `projects//locations//agents//intents/`. */ @property(nonatomic, copy, nullable) NSString *lastMatchedIntent; /** * Parameters identified as a result of intent matching. This is a map of the * name of the identified parameter to the value of the parameter identified * from the user's utterance. All parameters defined in the matched intent that * are identified will be surfaced here. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfo_Parameters *parameters; @end /** * Parameters identified as a result of intent matching. This is a map of the * name of the identified parameter to the value of the parameter identified * from the user's utterance. All parameters defined in the matched intent that * are identified will be surfaced here. * * @note This class is documented as having more properties of * GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue. * Use @c -additionalJSONKeys and @c -additionalPropertyForName: to get * the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfo_Parameters : GTLRObject @end /** * Represents a value for an intent parameter. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestIntentInfoIntentParameterValue : GTLRObject /** Always present. Original text value extracted from user utterance. */ @property(nonatomic, copy, nullable) NSString *originalValue; /** * Always present. Structured value for the parameter extracted from user * utterance. * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id resolvedValue; @end /** * Represents the result of sentiment analysis. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookRequestSentimentAnalysisResult : GTLRObject /** * A non-negative number in the [0, +inf) range, which represents the absolute * magnitude of sentiment, regardless of score (positive or negative). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *magnitude; /** * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive * sentiment). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *score; @end /** * The response message for a webhook call. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponse : GTLRObject /** * The fulfillment response to send to the user. This field can be omitted by * the webhook if it does not intend to send any response to the user. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse *fulfillmentResponse; /** * Information about page status. This field can be omitted by the webhook if * it does not intend to modify page status. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3PageInfo *pageInfo; /** Value to append directly to QueryResult.webhook_payloads. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponse_Payload *payload; /** * Information about session status. This field can be omitted by the webhook * if it does not intend to modify session status. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3SessionInfo *sessionInfo; /** * The target flow to transition to. Format: * `projects//locations//agents//flows/`. */ @property(nonatomic, copy, nullable) NSString *targetFlow; /** * The target page to transition to. Format: * `projects//locations//agents//flows//pages/`. */ @property(nonatomic, copy, nullable) NSString *targetPage; @end /** * Value to append directly to QueryResult.webhook_payloads. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponse_Payload : GTLRObject @end /** * Represents a fulfillment response to the user. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse : GTLRObject /** * Merge behavior for `messages`. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse_MergeBehavior_Append * `messages` will be appended to the list of messages waiting to be sent * to the user. (Value: "APPEND") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse_MergeBehavior_MergeBehaviorUnspecified * Not specified. `APPEND` will be used. (Value: * "MERGE_BEHAVIOR_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowCxV3WebhookResponseFulfillmentResponse_MergeBehavior_Replace * `messages` will replace the list of messages waiting to be sent to the * user. (Value: "REPLACE") */ @property(nonatomic, copy, nullable) NSString *mergeBehavior; /** The list of rich message responses to present to the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowCxV3ResponseMessage *> *messages; @end /** * Represents configuration for a [Service * Directory](https://cloud.google.com/service-directory) service. */ @interface GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookServiceDirectoryConfig : GTLRObject /** Generic Service configuration of this webhook. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowCxV3WebhookGenericWebService *genericWebService; /** * Required. The name of [Service * Directory](https://cloud.google.com/service-directory) service. Format: * `projects//locations//namespaces//services/`. `Location ID` of the service * directory must be the same as the location of the agent. */ @property(nonatomic, copy, nullable) NSString *service; @end /** * Represents a part of a message possibly annotated with an entity. The part * can be an entity or purely a part of the message between two entities or * message start/end. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2AnnotatedMessagePart : GTLRObject /** * The [Dialogflow system entity * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) of * this message part. If this is empty, Dialogflow could not annotate the * phrase part with a system entity. */ @property(nonatomic, copy, nullable) NSString *entityType; /** * The [Dialogflow system entity formatted value * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of * this message part. For example for a system entity of type * `\@sys.unit-currency`, this may contain: { "amount": 5, "currency": "USD" } * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id formattedValue; /** A part of a message possibly annotated with an entity. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Represents article answer. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2ArticleAnswer : GTLRObject /** * The name of answer record, in the format of * "projects//locations//answerRecords/" */ @property(nonatomic, copy, nullable) NSString *answerRecord; /** * Article match confidence. The system's confidence score that this article is * a good match for this conversation, as a value from 0.0 (completely * uncertain) to 1.0 (completely certain). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *confidence; /** * A map that contains metadata about the answer and the document from which it * originates. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2ArticleAnswer_Metadata *metadata; /** Article snippets. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *snippets; /** The article title. */ @property(nonatomic, copy, nullable) NSString *title; /** The article URI. */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * A map that contains metadata about the answer and the document from which it * originates. * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2ArticleAnswer_Metadata : GTLRObject @end /** * The response message for EntityTypes.BatchUpdateEntityTypes. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse : GTLRObject /** The collection of updated or created entity types. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2EntityType *> *entityTypes; @end /** * The response message for Intents.BatchUpdateIntents. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2BatchUpdateIntentsResponse : GTLRObject /** The collection of updated or created intents. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2Intent *> *intents; @end /** * Represents a part of a message possibly annotated with an entity. The part * can be an entity or purely a part of the message between two entities or * message start/end. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1AnnotatedMessagePart : GTLRObject /** * Optional. The [Dialogflow system entity * type](https://cloud.google.com/dialogflow/docs/reference/system-entities) of * this message part. If this is empty, Dialogflow could not annotate the * phrase part with a system entity. */ @property(nonatomic, copy, nullable) NSString *entityType; /** * Optional. The [Dialogflow system entity formatted value * ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of * this message part. For example for a system entity of type * `\@sys.unit-currency`, this may contain: { "amount": 5, "currency": "USD" } * * Can be any valid JSON type. */ @property(nonatomic, strong, nullable) id formattedValue; /** Required. A part of a message possibly annotated with an entity. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Represents article answer. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1ArticleAnswer : GTLRObject /** * The name of answer record, in the format of * "projects//locations//answerRecords/" */ @property(nonatomic, copy, nullable) NSString *answerRecord; /** * A map that contains metadata about the answer and the document from which it * originates. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1ArticleAnswer_Metadata *metadata; /** Output only. Article snippets. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *snippets; /** The article title. */ @property(nonatomic, copy, nullable) NSString *title; /** The article URI. */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * A map that contains metadata about the answer and the document from which it * originates. * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1ArticleAnswer_Metadata : GTLRObject @end /** * The response message for EntityTypes.BatchUpdateEntityTypes. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse : GTLRObject /** The collection of updated or created entity types. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType *> *entityTypes; @end /** * The response message for Intents.BatchUpdateIntents. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse : GTLRObject /** The collection of updated or created intents. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1Intent *> *intents; @end /** * Dialogflow contexts are similar to natural language context. If a person * says to you "they are orange", you need context in order to understand what * "they" is referring to. Similarly, for Dialogflow to handle an end-user * expression like that, it needs to be provided with context in order to * correctly match an intent. Using contexts, you can control the flow of a * conversation. You can configure contexts for an intent by setting input and * output contexts, which are identified by string names. When an intent is * matched, any configured output contexts for that intent become active. While * any contexts are active, Dialogflow is more likely to match intents that are * configured with input contexts that correspond to the currently active * contexts. For more information about context, see the [Contexts * guide](https://cloud.google.com/dialogflow/docs/contexts-overview). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1Context : GTLRObject /** * Optional. The number of conversational query requests after which the * context expires. The default is `0`. If set to `0`, the context expires * immediately. Contexts expire automatically after 20 minutes if there are no * matching queries. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *lifespanCount; /** * Required. The unique identifier of the context. Supported formats: - * `projects//agent/sessions//contexts/`, - * `projects//locations//agent/sessions//contexts/`, - * `projects//agent/environments//users//sessions//contexts/`, - * `projects//locations//agent/environments//users//sessions//contexts/`, The * `Context ID` is always converted to lowercase, may only contain characters * in a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is * not specified, we assume default 'draft' environment. If `User ID` is not * specified, we assume default '-' user. The following context names are * reserved for internal use by Dialogflow. You should not use these contexts * or create contexts with these names: * `__system_counters__` * * `*_id_dialog_context` * `*_dialog_params_size` */ @property(nonatomic, copy, nullable) NSString *name; /** * Optional. The collection of parameters associated with this context. * Depending on your protocol or client library language, this is a map, * associative array, symbol table, dictionary, or JSON object composed of a * collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey * value: parameter name - MapValue type: - If parameter's entity type is a * composite entity: map - Else: depending on parameter value type, could be * one of string, number, boolean, null, list or map - MapValue value: - If * parameter's entity type is a composite entity: map from composite entity * property names to property values - Else: parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1Context_Parameters *parameters; @end /** * Optional. The collection of parameters associated with this context. * Depending on your protocol or client library language, this is a map, * associative array, symbol table, dictionary, or JSON object composed of a * collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey * value: parameter name - MapValue type: - If parameter's entity type is a * composite entity: map - Else: depending on parameter value type, could be * one of string, number, boolean, null, list or map - MapValue value: - If * parameter's entity type is a composite entity: map from composite entity * property names to property values - Else: parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1Context_Parameters : GTLRObject @end /** * Represents a notification sent to Pub/Sub subscribers for conversation * lifecycle events. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent : GTLRObject /** * Required. The unique identifier of the conversation this notification refers * to. Format: `projects//conversations/`. */ @property(nonatomic, copy, nullable) NSString *conversation; /** * Optional. More detailed information about an error. Only set for type * UNRECOVERABLE_ERROR_IN_PHONE_CALL. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *errorStatus; /** Payload of NEW_MESSAGE event. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1Message *newMessagePayload NS_RETURNS_NOT_RETAINED; /** * Required. The type of the event that this notification refers to. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_ConversationFinished * An existing conversation has closed. This is fired when a telephone * call is terminated, or a conversation is closed via the API. (Value: * "CONVERSATION_FINISHED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_ConversationStarted * A new conversation has been opened. This is fired when a telephone * call is answered, or a conversation is created via the API. (Value: * "CONVERSATION_STARTED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_NewMessage * An existing conversation has received a new message, either from API * or telephony. It is configured in * ConversationProfile.new_message_event_notification_config (Value: * "NEW_MESSAGE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_TypeUnspecified * Type not set. (Value: "TYPE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1ConversationEvent_Type_UnrecoverableError * Unrecoverable error during a telephone call. In general * non-recoverable errors only occur if something was misconfigured in * the ConversationProfile corresponding to the call. After a * non-recoverable error, Dialogflow may stop responding. We don't fire * this event: * in an API call because we can directly return the error, * or, * when we can recover from an error. (Value: * "UNRECOVERABLE_ERROR") */ @property(nonatomic, copy, nullable) NSString *type; @end /** * Each intent parameter has a type, called the entity type, which dictates * exactly how data from an end-user expression is extracted. Dialogflow * provides predefined system entities that can match many common types of * data. For example, there are system entities for matching dates, times, * colors, email addresses, and so on. You can also create your own custom * entities for matching custom data. For example, you could define a vegetable * entity that can match the types of vegetables available for purchase with a * grocery store agent. For more information, see the [Entity * guide](https://cloud.google.com/dialogflow/docs/entities-overview). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType : GTLRObject /** * Optional. Indicates whether the entity type can be automatically expanded. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_AutoExpansionMode_AutoExpansionModeDefault * Allows an agent to recognize values that have not been explicitly * listed in the entity. (Value: "AUTO_EXPANSION_MODE_DEFAULT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_AutoExpansionMode_AutoExpansionModeUnspecified * Auto expansion disabled for the entity. (Value: * "AUTO_EXPANSION_MODE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *autoExpansionMode; /** Required. The name of the entity type. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional. Enables fuzzy entity extraction during classification. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableFuzzyExtraction; /** * Optional. The collection of entity entries associated with the entity type. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityTypeEntity *> *entities; /** * Required. Indicates the kind of entity type. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_Kind_KindList * List entity types contain a set of entries that do not map to * reference values. However, list entity types can contain references to * other entity types (with or without aliases). (Value: "KIND_LIST") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_Kind_KindMap * Map entity types allow mapping of a group of synonyms to a reference * value. (Value: "KIND_MAP") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_Kind_KindRegexp * Regexp entity types allow to specify regular expressions in entries * values. (Value: "KIND_REGEXP") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1EntityType_Kind_KindUnspecified * Not specified. This value should be never used. (Value: * "KIND_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *kind; /** * The unique identifier of the entity type. Required for * EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes methods. * Supported formats: - `projects//agent/entityTypes/` - * `projects//locations//agent/entityTypes/` */ @property(nonatomic, copy, nullable) NSString *name; @end /** * An **entity entry** for an associated entity type. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityTypeEntity : GTLRObject /** * Required. A collection of value synonyms. For example, if the entity type is * *vegetable*, and `value` is *scallions*, a synonym could be *green onions*. * For `KIND_LIST` entity types: * This collection must contain exactly one * synonym equal to `value`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *synonyms; /** * Required. The primary value associated with this entity entry. For example, * if the entity type is *vegetable*, the value could be *scallions*. For * `KIND_MAP` entity types: * A reference value to be used in place of * synonyms. For `KIND_LIST` entity types: * A string that can contain * references to other entity types (with or without aliases). */ @property(nonatomic, copy, nullable) NSString *value; @end /** * Events allow for matching intents by event name instead of the natural * language input. For instance, input `` can trigger a personalized welcome * response. The parameter `name` may be used by the agent in the response: * `"Hello #welcome_event.name! What can I do for you today?"`. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1EventInput : GTLRObject /** * Required. The language of this query. See [Language * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a * list of the currently supported language codes. Note that queries in the * same session do not necessarily need to specify the same language. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** Required. The unique identifier of the event. */ @property(nonatomic, copy, nullable) NSString *name; /** * The collection of parameters associated with the event. Depending on your * protocol or client library language, this is a map, associative array, * symbol table, dictionary, or JSON object composed of a collection of * (MapKey, MapValue) pairs: - MapKey type: string - MapKey value: parameter * name - MapValue type: - If parameter's entity type is a composite entity: * map - Else: depending on parameter value type, could be one of string, * number, boolean, null, list or map - MapValue value: - If parameter's entity * type is a composite entity: map from composite entity property names to * property values - Else: parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1EventInput_Parameters *parameters; @end /** * The collection of parameters associated with the event. Depending on your * protocol or client library language, this is a map, associative array, * symbol table, dictionary, or JSON object composed of a collection of * (MapKey, MapValue) pairs: - MapKey type: string - MapKey value: parameter * name - MapValue type: - If parameter's entity type is a composite entity: * map - Else: depending on parameter value type, could be one of string, * number, boolean, null, list or map - MapValue value: - If parameter's entity * type is a composite entity: map from composite entity property names to * property values - Else: parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1EventInput_Parameters : GTLRObject @end /** * The response message for Agents.ExportAgent. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1ExportAgentResponse : GTLRObject /** * Zip compressed raw byte content for agent. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *agentContent; /** * The URI to a file containing the exported agent. This field is populated * only if `agent_uri` is specified in `ExportAgentRequest`. */ @property(nonatomic, copy, nullable) NSString *agentUri; @end /** * Represents answer from "frequently asked questions". */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1FaqAnswer : GTLRObject /** The piece of text from the `source` knowledge base document. */ @property(nonatomic, copy, nullable) NSString *answer; /** * The name of answer record, in the format of * "projects//locations//answerRecords/" */ @property(nonatomic, copy, nullable) NSString *answerRecord; /** * The system's confidence score that this Knowledge answer is a good match for * this conversational query, range from 0.0 (completely uncertain) to 1.0 * (completely certain). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *confidence; /** * A map that contains metadata about the answer and the document from which it * originates. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1FaqAnswer_Metadata *metadata; /** The corresponding FAQ question. */ @property(nonatomic, copy, nullable) NSString *question; /** * Indicates which Knowledge Document this answer was extracted from. Format: * `projects//locations//agent/knowledgeBases//documents/`. */ @property(nonatomic, copy, nullable) NSString *source; @end /** * A map that contains metadata about the answer and the document from which it * originates. * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1FaqAnswer_Metadata : GTLRObject @end /** * Output only. Represents a notification sent to Pub/Sub subscribers for agent * assistant events in a specific conversation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1HumanAgentAssistantEvent : GTLRObject /** * The conversation this notification refers to. Format: * `projects//conversations/`. */ @property(nonatomic, copy, nullable) NSString *conversation; /** * The participant that the suggestion is compiled for. And This field is used * to call Participants.ListSuggestions API. Format: * `projects//conversations//participants/`. It will not be set in legacy * workflow. HumanAgentAssistantConfig.name for more information. */ @property(nonatomic, copy, nullable) NSString *participant; /** * The suggestion results payload that this notification refers to. It will * only be set when * HumanAgentAssistantConfig.SuggestionConfig.group_suggestion_responses sets * to true. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestionResult *> *suggestionResults; @end /** * Response message for Documents.ImportDocuments. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1ImportDocumentsResponse : GTLRObject /** Includes details about skipped documents or any other warnings. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleRpcStatus *> *warnings; @end /** * An intent categorizes an end-user's intention for one conversation turn. For * each agent, you define many intents, where your combined intents can handle * a complete conversation. When an end-user writes or says something, referred * to as an end-user expression or end-user input, Dialogflow matches the * end-user input to the best intent in your agent. Matching an intent is also * known as intent classification. For more information, see the [intent * guide](https://cloud.google.com/dialogflow/docs/intents-overview). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1Intent : GTLRObject /** * Optional. The name of the action associated with the intent. Note: The * action name must not contain whitespaces. */ @property(nonatomic, copy, nullable) NSString *action; /** * Optional. The list of platforms for which the first responses will be copied * from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). */ @property(nonatomic, strong, nullable) NSArray<NSString *> *defaultResponsePlatforms; /** Required. The name of this intent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional. Indicates that this intent ends an interaction. Some integrations * (e.g., Actions on Google or Dialogflow phone gateway) use this information * to close interaction with an end user. Default is false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *endInteraction; /** * Optional. The collection of event names that trigger the intent. If the * collection of input contexts is not empty, all of the contexts must be * present in the active user session for an event to trigger this intent. * Event names are limited to 150 characters. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *events; /** * Output only. Information about all followup intents that have this intent as * a direct or indirect parent. We populate this field only in the output. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo *> *followupIntentInfo; /** * Optional. The list of context names required for this intent to be * triggered. Formats: - `projects//agent/sessions/-/contexts/` - * `projects//locations//agent/sessions/-/contexts/` */ @property(nonatomic, strong, nullable) NSArray<NSString *> *inputContextNames; /** * Optional. Indicates whether this is a fallback intent. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isFallback; /** * Optional. Indicates that a live agent should be brought in to handle the * interaction with the user. In most cases, when you set this flag to true, * you would also want to set end_interaction to true as well. Default is * false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *liveAgentHandoff; /** * Optional. The collection of rich messages corresponding to the `Response` * field in the Dialogflow console. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage *> *messages; /** * Optional. Indicates whether Machine Learning is disabled for the intent. * Note: If `ml_disabled` setting is set to true, then this intent is not taken * into account during inference in `ML ONLY` match mode. Also, auto-markup in * the UI is turned off. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *mlDisabled; /** * Optional. Indicates whether Machine Learning is enabled for the intent. * Note: If `ml_enabled` setting is set to false, then this intent is not taken * into account during inference in `ML ONLY` match mode. Also, auto-markup in * the UI is turned off. DEPRECATED! Please use `ml_disabled` field instead. * NOTE: If both `ml_enabled` and `ml_disabled` are either not set or false, * then the default value is determined as follows: - Before April 15th, 2018 * the default is: ml_enabled = false / ml_disabled = true. - After April 15th, * 2018 the default is: ml_enabled = true / ml_disabled = false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *mlEnabled; /** * Optional. The unique identifier of this intent. Required for * Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Supported * formats: - `projects//agent/intents/` - * `projects//locations//agent/intents/` */ @property(nonatomic, copy, nullable) NSString *name; /** * Optional. The collection of contexts that are activated when the intent is * matched. Context messages in this collection should not set the parameters * field. Setting the `lifespan_count` to 0 will reset the context when the * intent is matched. Format: `projects//agent/sessions/-/contexts/`. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1Context *> *outputContexts; /** Optional. The collection of parameters associated with the intent. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentParameter *> *parameters; /** * Optional. The unique identifier of the parent intent in the chain of * followup intents. You can set this field when creating an intent, for * example with CreateIntent or BatchUpdateIntents, in order to make this * intent a followup intent. It identifies the parent followup intent. Format: * `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *parentFollowupIntentName; /** * Optional. The priority of this intent. Higher numbers represent higher * priorities. - If the supplied value is unspecified or 0, the service * translates the value to 500,000, which corresponds to the `Normal` priority * in the console. - If the supplied value is negative, the intent is ignored * in runtime detect intent requests. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *priority; /** * Optional. Indicates whether to delete all contexts in the current session * when this intent is matched. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *resetContexts; /** * Output only. The unique identifier of the root intent in the chain of * followup intents. It identifies the correct followup intents chain for this * intent. Format: `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *rootFollowupIntentName; /** Optional. The collection of examples that the agent is trained on. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase *> *trainingPhrases; /** * Optional. Indicates whether webhooks are enabled for the intent. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_WebhookState_WebhookStateEnabled * Webhook is enabled in the agent and in the intent. (Value: * "WEBHOOK_STATE_ENABLED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_WebhookState_WebhookStateEnabledForSlotFilling * Webhook is enabled in the agent and in the intent. Also, each slot * filling prompt is forwarded to the webhook. (Value: * "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1Intent_WebhookState_WebhookStateUnspecified * Webhook is disabled in the agent and in the intent. (Value: * "WEBHOOK_STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *webhookState; @end /** * Represents a single followup intent in the chain. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo : GTLRObject /** * The unique identifier of the followup intent. Format: * `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *followupIntentName; /** * The unique identifier of the followup intent's parent. Format: * `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *parentFollowupIntentName; @end /** * Corresponds to the `Response` field in the Dialogflow console. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage : GTLRObject /** Displays a basic card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCard *basicCard; /** Browse carousel card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard *browseCarouselCard; /** Displays a card. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCard *card; /** Displays a carousel card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect *carouselSelect; /** Displays an image. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage *image; /** Displays a link out suggestion chip for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion *linkOutSuggestion; /** Displays a list card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageListSelect *listSelect; /** The media content card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContent *mediaContent; /** A custom platform-specific response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Payload *payload; /** * Optional. The platform that this message is intended for. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_ActionsOnGoogle * Google Assistant See [Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) * (Value: "ACTIONS_ON_GOOGLE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Facebook * Facebook. (Value: "FACEBOOK") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_GoogleHangouts * Google Hangouts. (Value: "GOOGLE_HANGOUTS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Kik * Kik. (Value: "KIK") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Line * Line. (Value: "LINE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_PlatformUnspecified * Not specified. (Value: "PLATFORM_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Skype * Skype. (Value: "SKYPE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Slack * Slack. (Value: "SLACK") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Telegram * Telegram. (Value: "TELEGRAM") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Telephony * Telephony Gateway. (Value: "TELEPHONY") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Platform_Viber * Viber. (Value: "VIBER") */ @property(nonatomic, copy, nullable) NSString *platform; /** Displays quick replies. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageQuickReplies *quickReplies; /** Rich Business Messaging (RBM) carousel rich card response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard *rbmCarouselRichCard; /** Standalone Rich Business Messaging (RBM) rich card response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard *rbmStandaloneRichCard; /** * Rich Business Messaging (RBM) text response. RBM allows businesses to send * enriched and branded versions of SMS. See * https://jibe.google.com/business-messaging. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmText *rbmText; /** Returns a voice or text-only response for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses *simpleResponses; /** Displays suggestion chips for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSuggestions *suggestions; /** Table card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCard *tableCard; /** Plays audio from a file in Telephony Gateway. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio *telephonyPlayAudio; /** Synthesizes speech in Telephony Gateway. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech *telephonySynthesizeSpeech; /** Transfers the call in Telephony Gateway. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall *telephonyTransferCall; /** Returns a text response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageText *text; @end /** * A custom platform-specific response. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage_Payload : GTLRObject @end /** * The basic card message. Useful for displaying information. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCard : GTLRObject /** Optional. The collection of card buttons. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton *> *buttons; /** Required, unless image is present. The body text of the card. */ @property(nonatomic, copy, nullable) NSString *formattedText; /** Optional. The image for the card. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage *image; /** Optional. The subtitle of the card. */ @property(nonatomic, copy, nullable) NSString *subtitle; /** Optional. The title of the card. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * The button object that appears at the bottom of a card. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton : GTLRObject /** Required. Action to take when a user taps on the button. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction *openUriAction; /** Required. The title of the button. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Opens the given URI. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction : GTLRObject /** Required. The HTTP or HTTPS scheme URI. */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * Browse Carousel Card for Actions on Google. * https://developers.google.com/actions/assistant/responses#browsing_carousel * * @note This class supports NSFastEnumeration and indexed subscripting over * its "items" property. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard : GTLRCollectionObject /** * Optional. Settings for displaying the image. Applies to every image in * items. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_BlurredBackground * Pad the gaps between image and image frame with a blurred copy of the * same image. (Value: "BLURRED_BACKGROUND") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_Cropped * Image is scaled such that the image width and height match or exceed * the container dimensions. This may crop the top and bottom of the * image if the scaled image height is greater than the container height, * or crop the left and right of the image if the scaled image width is * greater than the container width. This is similar to "Zoom Mode" on a * widescreen TV when playing a 4:3 video. (Value: "CROPPED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_Gray * Fill the gaps between the image and the image container with gray * bars. (Value: "GRAY") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_ImageDisplayOptionsUnspecified * Fill the gaps between the image and the image container with gray * bars. (Value: "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCard_ImageDisplayOptions_White * Fill the gaps between the image and the image container with white * bars. (Value: "WHITE") */ @property(nonatomic, copy, nullable) NSString *imageDisplayOptions; /** * Required. List of items in the Browse Carousel Card. Minimum of two items, * maximum of ten. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem *> *items; @end /** * Browsing carousel tile */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItem : GTLRObject /** * Optional. Description of the carousel item. Maximum of four lines of text. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Optional. Text that appears at the bottom of the Browse Carousel Card. * Maximum of one line of text. */ @property(nonatomic, copy, nullable) NSString *footer; /** Optional. Hero image for the carousel item. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage *image; /** Required. Action to present to the user. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction *openUriAction; /** Required. Title of the carousel item. Maximum of two lines of text. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Actions on Google action to open a given url. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction : GTLRObject /** Required. URL */ @property(nonatomic, copy, nullable) NSString *url; /** * Optional. Specifies the type of viewer that is used when opening the URL. * Defaults to opening via web browser. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_AmpAction * Url would be an amp action (Value: "AMP_ACTION") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_AmpContent * URL that points directly to AMP content, or to a canonical URL which * refers to AMP content via . (Value: "AMP_CONTENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_UrlTypeHintUnspecified * Unspecified (Value: "URL_TYPE_HINT_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *urlTypeHint; @end /** * The card response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCard : GTLRObject /** Optional. The collection of card buttons. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCardButton *> *buttons; /** Optional. The public URI to an image file for the card. */ @property(nonatomic, copy, nullable) NSString *imageUri; /** Optional. The subtitle of the card. */ @property(nonatomic, copy, nullable) NSString *subtitle; /** Optional. The title of the card. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Optional. Contains information about a button. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCardButton : GTLRObject /** Optional. The text to send back to the Dialogflow API or a URI to open. */ @property(nonatomic, copy, nullable) NSString *postback; /** Optional. The text to show on the button. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * The card for presenting a carousel of options to select from. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "items" property. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect : GTLRCollectionObject /** * Required. Carousel items. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem *> *items; @end /** * An item in the carousel. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem : GTLRObject /** * Optional. The body text of the card. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** Optional. The image to display. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage *image; /** Required. Additional info about the option item. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo *info; /** Required. Title of the carousel item. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Column properties for TableCard. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties : GTLRObject /** Required. Column heading. */ @property(nonatomic, copy, nullable) NSString *header; /** * Optional. Defines text alignment for all cells in this column. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties_HorizontalAlignment_Center * Text is centered in the column. (Value: "CENTER") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties_HorizontalAlignment_HorizontalAlignmentUnspecified * Text is aligned to the leading edge of the column. (Value: * "HORIZONTAL_ALIGNMENT_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties_HorizontalAlignment_Leading * Text is aligned to the leading edge of the column. (Value: "LEADING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties_HorizontalAlignment_Trailing * Text is aligned to the trailing edge of the column. (Value: * "TRAILING") */ @property(nonatomic, copy, nullable) NSString *horizontalAlignment; @end /** * The image response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage : GTLRObject /** * A text description of the image to be used for accessibility, e.g., screen * readers. Required if image_uri is set for CarouselSelect. */ @property(nonatomic, copy, nullable) NSString *accessibilityText; /** Optional. The public URI to an image file. */ @property(nonatomic, copy, nullable) NSString *imageUri; @end /** * The suggestion chip message that allows the user to jump out to the app or * website associated with this agent. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion : GTLRObject /** Required. The name of the app or site this chip is linking to. */ @property(nonatomic, copy, nullable) NSString *destinationName; /** * Required. The URI of the app or site to open when the user taps the * suggestion chip. */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * The card for presenting a list of options to select from. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "items" property. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageListSelect : GTLRCollectionObject /** * Required. List items. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageListSelectItem *> *items; /** Optional. Subtitle of the list. */ @property(nonatomic, copy, nullable) NSString *subtitle; /** Optional. The overall title of the list. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * An item in the list. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageListSelectItem : GTLRObject /** * Optional. The main text describing the item. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** Optional. The image to display. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage *image; /** Required. Additional information about this option. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo *info; /** Required. The title of the list item. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * The media content card for Actions on Google. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContent : GTLRObject /** Required. List of media objects. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject *> *mediaObjects; /** * Optional. What type of media is the content (ie "audio"). * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContent_MediaType_Audio * Response media type is audio. (Value: "AUDIO") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContent_MediaType_ResponseMediaTypeUnspecified * Unspecified. (Value: "RESPONSE_MEDIA_TYPE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *mediaType; @end /** * Response media object for media content card. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageMediaContentResponseMediaObject : GTLRObject /** Required. Url where the media is stored. */ @property(nonatomic, copy, nullable) NSString *contentUrl; /** * Optional. Description of media card. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** Optional. Icon to display above media content. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage *icon; /** Optional. Image to display above media content. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage *largeImage; /** Required. Name of media card. */ @property(nonatomic, copy, nullable) NSString *name; @end /** * The quick replies response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageQuickReplies : GTLRObject /** Optional. The collection of quick replies. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *quickReplies; /** Optional. The title of the collection of quick replies. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Rich Business Messaging (RBM) Card content */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent : GTLRObject /** * Optional. Description of the card (at most 2000 bytes). At least one of the * title, description or media must be set. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Optional. However at least one of the title, description or media must be * set. Media (image, GIF or a video) to include in the card. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia *media; /** Optional. List of suggestions to include in the card. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion *> *suggestions; /** * Optional. Title of the card (at most 200 bytes). At least one of the title, * description or media must be set. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Rich Business Messaging (RBM) Media displayed in Cards The following * media-types are currently supported: Image Types * image/jpeg * image/jpg' * * image/gif * image/png Video Types * video/h263 * video/m4v * video/mp4 * * video/mpeg * video/mpeg4 * video/webm */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia : GTLRObject /** * Required. Publicly reachable URI of the file. The RBM platform determines * the MIME type of the file from the content-type field in the HTTP headers * when the platform fetches the file. The content-type field must be present * and accurate in the HTTP response from the URL. */ @property(nonatomic, copy, nullable) NSString *fileUri; /** * Required for cards with vertical orientation. The height of the media within * a rich card with a vertical layout. For a standalone card with horizontal * layout, height is not customizable, and this field is ignored. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia_Height_HeightUnspecified * Not specified. (Value: "HEIGHT_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia_Height_Medium * 168 DP. (Value: "MEDIUM") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia_Height_Short * 112 DP. (Value: "SHORT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContentRbmMedia_Height_Tall * 264 DP. Not available for rich card carousels when the card width is * set to small. (Value: "TALL") */ @property(nonatomic, copy, nullable) NSString *height; /** * Optional. Publicly reachable URI of the thumbnail.If you don't provide a * thumbnail URI, the RBM platform displays a blank placeholder thumbnail until * the user's device downloads the file. Depending on the user's setting, the * file may not download automatically and may require the user to tap a * download button. */ @property(nonatomic, copy, nullable) NSString *thumbnailUri; @end /** * Carousel Rich Business Messaging (RBM) rich card. Rich cards allow you to * respond to users with more vivid content, e.g. with media and suggestions. * If you want to show a single card with more control over the layout, please * use RbmStandaloneCard instead. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard : GTLRObject /** * Required. The cards in the carousel. A carousel must have at least 2 cards * and at most 10. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent *> *cardContents; /** * Required. The width of the cards in the carousel. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard_CardWidth_CardWidthUnspecified * Not specified. (Value: "CARD_WIDTH_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard_CardWidth_Medium * 232 DP. (Value: "MEDIUM") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCarouselCard_CardWidth_Small * 120 DP. Note that tall media cannot be used. (Value: "SMALL") */ @property(nonatomic, copy, nullable) NSString *cardWidth; @end /** * Standalone Rich Business Messaging (RBM) rich card. Rich cards allow you to * respond to users with more vivid content, e.g. with media and suggestions. * You can group multiple rich cards into one using RbmCarouselCard but * carousel cards will give you less control over the card layout. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard : GTLRObject /** Required. Card content. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmCardContent *cardContent; /** * Required. Orientation of the card. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_CardOrientation_CardOrientationUnspecified * Not specified. (Value: "CARD_ORIENTATION_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_CardOrientation_Horizontal * Horizontal layout. (Value: "HORIZONTAL") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_CardOrientation_Vertical * Vertical layout. (Value: "VERTICAL") */ @property(nonatomic, copy, nullable) NSString *cardOrientation; /** * Required if orientation is horizontal. Image preview alignment for * standalone cards with horizontal layout. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_ThumbnailImageAlignment_Left * Thumbnail preview is left-aligned. (Value: "LEFT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_ThumbnailImageAlignment_Right * Thumbnail preview is right-aligned. (Value: "RIGHT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmStandaloneCard_ThumbnailImageAlignment_ThumbnailImageAlignmentUnspecified * Not specified. (Value: "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *thumbnailImageAlignment; @end /** * Rich Business Messaging (RBM) suggested client-side action that the user can * choose from the card. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction : GTLRObject /** Suggested client side action: Dial a phone number */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial *dial; /** Suggested client side action: Open a URI on device */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri *openUrl; /** * Opaque payload that the Dialogflow receives in a user event when the user * taps the suggested action. This data will be also forwarded to webhook to * allow performing custom business logic. */ @property(nonatomic, copy, nullable) NSString *postbackData; /** Suggested client side action: Share user location */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation *shareLocation; /** Text to display alongside the action. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Opens the user's default dialer app with the specified phone number but does * not dial automatically. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionDial : GTLRObject /** * Required. The phone number to fill in the default dialer app. This field * should be in [E.164](https://en.wikipedia.org/wiki/E.164) format. An example * of a correctly formatted phone number: +15556767888. */ @property(nonatomic, copy, nullable) NSString *phoneNumber; @end /** * Opens the user's default web browser app to the specified uri If the user * has an app installed that is registered as the default handler for the URL, * then this app will be opened instead, and its icon will be used in the * suggested action UI. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionOpenUri : GTLRObject /** Required. The uri to open on the user device */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * Opens the device's location chooser so the user can pick a location to send * back to the agent. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedActionRbmSuggestedActionShareLocation : GTLRObject @end /** * Rich Business Messaging (RBM) suggested reply that the user can click * instead of typing in their own response. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply : GTLRObject /** * Opaque payload that the Dialogflow receives in a user event when the user * taps the suggested reply. This data will be also forwarded to webhook to * allow performing custom business logic. */ @property(nonatomic, copy, nullable) NSString *postbackData; /** Suggested reply text. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Rich Business Messaging (RBM) suggestion. Suggestions allow user to easily * select/click a predefined response or perform an action (like opening a web * uri). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion : GTLRObject /** Predefined client side actions that user can choose */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedAction *action; /** Predefined replies for user to select instead of typing */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestedReply *reply; @end /** * Rich Business Messaging (RBM) text response with suggestions. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmText : GTLRObject /** Optional. One or more suggestions to show to the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageRbmSuggestion *> *rbmSuggestion; /** Required. Text sent and displayed to the user. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Additional info about the select item for when it is triggered in a dialog. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo : GTLRObject /** * Required. A unique key that will be sent back to the agent if this response * is given. */ @property(nonatomic, copy, nullable) NSString *key; /** * Optional. A list of synonyms that can also be used to trigger this item in * dialog. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *synonyms; @end /** * The simple response message containing speech or text. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse : GTLRObject /** Optional. The text to display. */ @property(nonatomic, copy, nullable) NSString *displayText; /** * One of text_to_speech or ssml must be provided. Structured spoken response * to the user in the SSML format. Mutually exclusive with text_to_speech. */ @property(nonatomic, copy, nullable) NSString *ssml; /** * One of text_to_speech or ssml must be provided. The plain text of the speech * output. Mutually exclusive with ssml. */ @property(nonatomic, copy, nullable) NSString *textToSpeech; @end /** * The collection of simple response candidates. This message in * `QueryResult.fulfillment_messages` and * `WebhookResponse.fulfillment_messages` should contain only one * `SimpleResponse`. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses : GTLRObject /** Required. The list of simple responses. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse *> *simpleResponses; @end /** * The suggestion chip message that the user can tap to quickly post a reply to * the conversation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSuggestion : GTLRObject /** Required. The text shown the in the suggestion chip. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * The collection of suggestions. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSuggestions : GTLRObject /** Required. The list of suggested replies. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageSuggestion *> *suggestions; @end /** * Table card for Actions on Google. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCard : GTLRObject /** Optional. List of buttons for the card. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton *> *buttons; /** Optional. Display properties for the columns in this table. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageColumnProperties *> *columnProperties; /** Optional. Image which should be displayed on the card. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageImage *image; /** Optional. Rows in this table of data. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCardRow *> *rows; /** Optional. Subtitle to the title. */ @property(nonatomic, copy, nullable) NSString *subtitle; /** Required. Title of the card. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Cell of TableCardRow. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCardCell : GTLRObject /** Required. Text in this cell. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Row of TableCard. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCardRow : GTLRObject /** Optional. List of cells that make up this row. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTableCardCell *> *cells; /** * Optional. Whether to add a visual divider after this row. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *dividerAfter; @end /** * Plays audio from a file in Telephony Gateway. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio : GTLRObject /** * Required. URI to a Google Cloud Storage object containing the audio to play, * e.g., "gs://bucket/object". The object must contain a single channel (mono) * of linear PCM audio (2 bytes / sample) at 8kHz. This object must be readable * by the `service-\@gcp-sa-dialogflow.iam.gserviceaccount.com` service account * where is the number of the Telephony Gateway project (usually the same as * the Dialogflow agent project). If the Google Cloud Storage bucket is in the * Telephony Gateway project, this permission is added by default when enabling * the Dialogflow V2 API. For audio from other sources, consider using the * `TelephonySynthesizeSpeech` message with SSML. */ @property(nonatomic, copy, nullable) NSString *audioUri; @end /** * Synthesizes speech and plays back the synthesized audio to the caller in * Telephony Gateway. Telephony Gateway takes the synthesizer settings from * `DetectIntentResponse.output_audio_config` which can either be set at * request-level or can come from the agent-level synthesizer config. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech : GTLRObject /** * The SSML to be synthesized. For more information, see * [SSML](https://developers.google.com/actions/reference/ssml). */ @property(nonatomic, copy, nullable) NSString *ssml; /** The raw text to be synthesized. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Transfers the call in Telephony Gateway. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall : GTLRObject /** * Required. The phone number to transfer the call to in [E.164 * format](https://en.wikipedia.org/wiki/E.164). We currently only allow * transferring to US numbers (+1xxxyyyzzzz). */ @property(nonatomic, copy, nullable) NSString *phoneNumber; @end /** * The text response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessageText : GTLRObject /** Optional. The collection of the agent's responses. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *text; @end /** * Represents intent parameters. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentParameter : GTLRObject /** * Optional. The default value to use when the `value` yields an empty result. * Default values can be extracted from contexts by using the following syntax: * `#context_name.parameter_name`. */ @property(nonatomic, copy, nullable) NSString *defaultValue; /** Required. The name of the parameter. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional. The name of the entity type, prefixed with `\@`, that describes * values of the parameter. If the parameter is required, this must be * provided. */ @property(nonatomic, copy, nullable) NSString *entityTypeDisplayName; /** * Optional. Indicates whether the parameter represents a list of values. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isList; /** * Optional. Indicates whether the parameter is required. That is, whether the * intent cannot be completed without collecting the parameter value. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *mandatory; /** The unique identifier of this parameter. */ @property(nonatomic, copy, nullable) NSString *name; /** * Optional. The collection of prompts that the agent can present to the user * in order to collect a value for the parameter. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *prompts; /** * Optional. The definition of the parameter value. It can be: - a constant * string, - a parameter value defined as `$parameter_name`, - an original * parameter value defined as `$parameter_name.original`, - a parameter value * from some context defined as `#context_name.parameter_name`. */ @property(nonatomic, copy, nullable) NSString *value; @end /** * Represents an example that the agent is trained on. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase : GTLRObject /** Output only. The unique identifier of this training phrase. */ @property(nonatomic, copy, nullable) NSString *name; /** * Required. The ordered list of training phrase parts. The parts are * concatenated in order to form the training phrase. Note: The API does not * automatically annotate training phrases like the Dialogflow Console does. * Note: Do not forget to include whitespace at part boundaries, so the * training phrase is well formatted when the parts are concatenated. If the * training phrase does not need to be annotated with parameters, you just need * a single part with only the Part.text field set. If you want to annotate the * training phrase, you must create multiple parts, where the fields of each * part are populated in one of two ways: - `Part.text` is set to a part of the * phrase that has no parameters. - `Part.text` is set to a part of the phrase * that you want to annotate, and the `entity_type`, `alias`, and * `user_defined` fields are all set. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart *> *parts; /** * Optional. Indicates how many times this example was added to the intent. * Each time a developer adds an existing sample by editing an intent or * training, this counter is increased. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *timesAddedCount; /** * Required. The type of the training phrase. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase_Type_Example * Examples do not contain \@-prefixed entity type names, but example * parts can be annotated with entity types. (Value: "EXAMPLE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase_Type_Template * Templates are not annotated with entity types, but they can contain * \@-prefixed entity type names as substrings. Template mode has been * deprecated. Example mode is the only supported way to create new * training phrases. If you have existing training phrases that you've * created in template mode, those will continue to work. (Value: * "TEMPLATE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrase_Type_TypeUnspecified * Not specified. This value should never be used. (Value: * "TYPE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *type; @end /** * Represents a part of a training phrase. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart : GTLRObject /** * Optional. The parameter name for the value extracted from the annotated part * of the example. This field is required for annotated parts of the training * phrase. */ @property(nonatomic, copy, nullable) NSString *alias; /** * Optional. The entity type name prefixed with `\@`. This field is required * for annotated parts of the training phrase. */ @property(nonatomic, copy, nullable) NSString *entityType; /** Required. The text for this part. */ @property(nonatomic, copy, nullable) NSString *text; /** * Optional. Indicates whether the text was manually annotated. This field is * set to true when the Dialogflow Console is used to manually annotate the * part. When creating an annotated part with the API, you must set this to * true. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *userDefined; @end /** * Represents the result of querying a Knowledge base. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswers : GTLRObject /** A list of answers from Knowledge Connector. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer *> *answers; @end /** * An answer from Knowledge Connector. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer : GTLRObject /** * The piece of text from the `source` knowledge base document that answers * this conversational query. */ @property(nonatomic, copy, nullable) NSString *answer; /** * The corresponding FAQ question if the answer was extracted from a FAQ * Document, empty otherwise. */ @property(nonatomic, copy, nullable) NSString *faqQuestion; /** * The system's confidence score that this Knowledge answer is a good match for * this conversational query. The range is from 0.0 (completely uncertain) to * 1.0 (completely certain). Note: The confidence score is likely to vary * somewhat (possibly even for identical requests), as the underlying model is * under constant improvement. It may be deprecated in the future. We recommend * using `match_confidence_level` which should be generally more stable. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *matchConfidence; /** * The system's confidence level that this knowledge answer is a good match for * this conversational query. NOTE: The confidence level for a given `` pair * may change without notice, as it depends on models that are constantly being * improved. However, it will change less frequently than the confidence score * below, and should be preferred for referencing the quality of an answer. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer_MatchConfidenceLevel_High * Indicates our confidence is high. (Value: "HIGH") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer_MatchConfidenceLevel_Low * Indicates that the confidence is low. (Value: "LOW") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer_MatchConfidenceLevel_MatchConfidenceLevelUnspecified * Not specified. (Value: "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer_MatchConfidenceLevel_Medium * Indicates our confidence is medium. (Value: "MEDIUM") */ @property(nonatomic, copy, nullable) NSString *matchConfidenceLevel; /** * Indicates which Knowledge Document this answer was extracted from. Format: * `projects//knowledgeBases//documents/`. */ @property(nonatomic, copy, nullable) NSString *source; @end /** * Metadata in google::longrunning::Operation for Knowledge operations. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata : GTLRObject /** The name of the knowledge base interacted with during the operation. */ @property(nonatomic, copy, nullable) NSString *knowledgeBase; /** * Required. Output only. The current state of this operation. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata_State_Done * The operation is done, either cancelled or completed. (Value: "DONE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata_State_Pending * The operation has been created. (Value: "PENDING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata_State_Running * The operation is currently running. (Value: "RUNNING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata_State_StateUnspecified * State unspecified. (Value: "STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *state; @end /** * Represents a message posted into a conversation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1Message : GTLRObject /** Required. The message content. */ @property(nonatomic, copy, nullable) NSString *content; /** * Output only. The time when the message was created in Contact Center AI. */ @property(nonatomic, strong, nullable) GTLRDateTime *createTime; /** * Optional. The message language. This should be a * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. * Example: "en-US". */ @property(nonatomic, copy, nullable) NSString *languageCode; /** Output only. The annotation for the message. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1MessageAnnotation *messageAnnotation; /** * Optional. The unique identifier of the message. Format: * `projects//locations//conversations//messages/`. */ @property(nonatomic, copy, nullable) NSString *name; /** Output only. The participant that sends this message. */ @property(nonatomic, copy, nullable) NSString *participant; /** * Output only. The role of the participant. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1Message_ParticipantRole_AutomatedAgent * Participant is an automated agent, such as a Dialogflow agent. (Value: * "AUTOMATED_AGENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1Message_ParticipantRole_EndUser * Participant is an end user that has called or chatted with Dialogflow * services. (Value: "END_USER") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1Message_ParticipantRole_HumanAgent * Participant is a human agent. (Value: "HUMAN_AGENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1Message_ParticipantRole_RoleUnspecified * Participant role not set. (Value: "ROLE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *participantRole; /** Optional. The time when the message was sent. */ @property(nonatomic, strong, nullable) GTLRDateTime *sendTime; /** Output only. The sentiment analysis result for the message. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1SentimentAnalysisResult *sentimentAnalysis; @end /** * Represents the result of annotation for the message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1MessageAnnotation : GTLRObject /** * Required. Indicates whether the text message contains entities. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *containEntities; /** * Optional. The collection of annotated message parts ordered by their * position in the message. You can recover the annotated message by * concatenating [AnnotatedMessagePart.text]. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1AnnotatedMessagePart *> *parts; @end /** * Represents the contents of the original request that was passed to the * `[Streaming]DetectIntent` call. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest : GTLRObject /** * Optional. This field is set to the value of the `QueryParameters.payload` * field passed in the request. Some integrations that query a Dialogflow agent * may provide additional information in the payload. In particular, for the * Dialogflow Phone Gateway integration, this field has the form: { * "telephony": { "caller_id": "+18558363987" } } Note: The caller ID field * (`caller_id`) will be redacted for Trial Edition agents and populated with * the caller ID in [E.164 format](https://en.wikipedia.org/wiki/E.164) for * Essentials Edition agents. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest_Payload *payload; /** * The source of this request, e.g., `google`, `facebook`, `slack`. It is set * by Dialogflow-owned servers. */ @property(nonatomic, copy, nullable) NSString *source; /** * Optional. The version of the protocol used for this request. This field is * AoG-specific. */ @property(nonatomic, copy, nullable) NSString *version; @end /** * Optional. This field is set to the value of the `QueryParameters.payload` * field passed in the request. Some integrations that query a Dialogflow agent * may provide additional information in the payload. In particular, for the * Dialogflow Phone Gateway integration, this field has the form: { * "telephony": { "caller_id": "+18558363987" } } Note: The caller ID field * (`caller_id`) will be redacted for Trial Edition agents and populated with * the caller ID in [E.164 format](https://en.wikipedia.org/wiki/E.164) for * Essentials Edition agents. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest_Payload : GTLRObject @end /** * Represents the result of conversational query or event processing. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult : GTLRObject /** The action name from the matched intent. */ @property(nonatomic, copy, nullable) NSString *action; /** * This field is set to: - `false` if the matched intent has required * parameters and not all of the required parameter values have been collected. * - `true` if all required parameter values have been collected, or if the * matched intent doesn't contain any required parameters. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allRequiredParamsPresent; /** * Indicates whether the conversational query triggers a cancellation for slot * filling. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *cancelsSlotFilling; /** * Free-form diagnostic information for the associated detect intent request. * The fields of this data can change without notice, so you should not write * code that depends on its structure. The data may contain: - webhook call * latency - webhook errors */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_DiagnosticInfo *diagnosticInfo; /** The collection of rich messages to present to the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage *> *fulfillmentMessages; /** * The text to be pronounced to the user or shown on the screen. Note: This is * a legacy field, `fulfillment_messages` should be preferred. */ @property(nonatomic, copy, nullable) NSString *fulfillmentText; /** * The intent that matched the conversational query. Some, not all fields are * filled in this message, including but not limited to: `name`, * `display_name`, `end_interaction` and `is_fallback`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1Intent *intent; /** * The intent detection confidence. Values range from 0.0 (completely * uncertain) to 1.0 (completely certain). This value is for informational * purpose only and is only used to help match the best intent within the * classification threshold. This value may change for the same end-user * expression at any time due to a model retraining or change in * implementation. If there are `multiple knowledge_answers` messages, this * value is set to the greatest `knowledgeAnswers.match_confidence` value in * the list. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *intentDetectionConfidence; /** * The result from Knowledge Connector (if any), ordered by decreasing * `KnowledgeAnswers.match_confidence`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1KnowledgeAnswers *knowledgeAnswers; /** * The language that was triggered during intent detection. See [Language * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a * list of the currently supported language codes. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** * The collection of output contexts. If applicable, * `output_contexts.parameters` contains entries with name `.original` * containing the original parameter values before the query. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1Context *> *outputContexts; /** * The collection of extracted parameters. Depending on your protocol or client * library language, this is a map, associative array, symbol table, * dictionary, or JSON object composed of a collection of (MapKey, MapValue) * pairs: - MapKey type: string - MapKey value: parameter name - MapValue type: * - If parameter's entity type is a composite entity: map - Else: depending on * parameter value type, could be one of string, number, boolean, null, list or * map - MapValue value: - If parameter's entity type is a composite entity: * map from composite entity property names to property values - Else: * parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_Parameters *parameters; /** * The original conversational query text: - If natural language text was * provided as input, `query_text` contains a copy of the input. - If natural * language speech audio was provided as input, `query_text` contains the * speech recognition result. If speech recognizer produced multiple * alternatives, a particular one is picked. - If automatic spell correction is * enabled, `query_text` will contain the corrected user input. */ @property(nonatomic, copy, nullable) NSString *queryText; /** * The sentiment analysis result, which depends on the * `sentiment_analysis_request_config` specified in the request. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1SentimentAnalysisResult *sentimentAnalysisResult; /** * The Speech recognition confidence between 0.0 and 1.0. A higher number * indicates an estimated greater likelihood that the recognized words are * correct. The default of 0.0 is a sentinel value indicating that confidence * was not set. This field is not guaranteed to be accurate or set. In * particular this field isn't set for StreamingDetectIntent since the * streaming endpoint has separate confidence estimates per portion of the * audio in StreamingRecognitionResult. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *speechRecognitionConfidence; /** * If the query was fulfilled by a webhook call, this field is set to the value * of the `payload` field returned in the webhook response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_WebhookPayload *webhookPayload; /** * If the query was fulfilled by a webhook call, this field is set to the value * of the `source` field returned in the webhook response. */ @property(nonatomic, copy, nullable) NSString *webhookSource; @end /** * Free-form diagnostic information for the associated detect intent request. * The fields of this data can change without notice, so you should not write * code that depends on its structure. The data may contain: - webhook call * latency - webhook errors * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_DiagnosticInfo : GTLRObject @end /** * The collection of extracted parameters. Depending on your protocol or client * library language, this is a map, associative array, symbol table, * dictionary, or JSON object composed of a collection of (MapKey, MapValue) * pairs: - MapKey type: string - MapKey value: parameter name - MapValue type: * - If parameter's entity type is a composite entity: map - Else: depending on * parameter value type, could be one of string, number, boolean, null, list or * map - MapValue value: - If parameter's entity type is a composite entity: * map from composite entity property names to property values - Else: * parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_Parameters : GTLRObject @end /** * If the query was fulfilled by a webhook call, this field is set to the value * of the `payload` field returned in the webhook response. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult_WebhookPayload : GTLRObject @end /** * The sentiment, such as positive/negative feeling or association, for a unit * of analysis, such as the query text. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1Sentiment : GTLRObject /** * A non-negative number in the [0, +inf) range, which represents the absolute * magnitude of sentiment, regardless of score (positive or negative). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *magnitude; /** * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive * sentiment). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *score; @end /** * The result of sentiment analysis. Sentiment analysis inspects user input and * identifies the prevailing subjective opinion, especially to determine a * user's attitude as positive, negative, or neutral. For * Participants.DetectIntent, it needs to be configured in * DetectIntentRequest.query_params. For Participants.StreamingDetectIntent, it * needs to be configured in StreamingDetectIntentRequest.query_params. And for * Participants.AnalyzeContent and Participants.StreamingAnalyzeContent, it * needs to be configured in ConversationProfile.human_agent_assistant_config */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1SentimentAnalysisResult : GTLRObject /** The sentiment analysis result for `query_text`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1Sentiment *queryTextSentiment; @end /** * A session represents a conversation between a Dialogflow agent and an * end-user. You can create special entities, called session entities, during a * session. Session entities can extend or replace custom entity types and only * exist during the session that they were created for. All session data, * including session entities, is stored by Dialogflow for 20 minutes. For more * information, see the [session entity * guide](https://cloud.google.com/dialogflow/docs/entities-session). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType : GTLRObject /** * Required. The collection of entities associated with this session entity * type. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1EntityTypeEntity *> *entities; /** * Required. Indicates whether the additional data should override or * supplement the custom entity type definition. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType_EntityOverrideMode_EntityOverrideModeOverride * The collection of session entities overrides the collection of * entities in the corresponding custom entity type. (Value: * "ENTITY_OVERRIDE_MODE_OVERRIDE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType_EntityOverrideMode_EntityOverrideModeSupplement * The collection of session entities extends the collection of entities * in the corresponding custom entity type. Note: Even in this override * mode calls to `ListSessionEntityTypes`, `GetSessionEntityType`, * `CreateSessionEntityType` and `UpdateSessionEntityType` only return * the additional entities added in this session entity type. If you want * to get the supplemented list, please call EntityTypes.GetEntityType on * the custom entity type and merge. (Value: * "ENTITY_OVERRIDE_MODE_SUPPLEMENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType_EntityOverrideMode_EntityOverrideModeUnspecified * Not specified. This value should be never used. (Value: * "ENTITY_OVERRIDE_MODE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *entityOverrideMode; /** * Required. The unique identifier of this session entity type. Supported * formats: - `projects//agent/sessions//entityTypes/` - * `projects//locations//agent/sessions//entityTypes/` - * `projects//agent/environments//users//sessions//entityTypes/` - * `projects//locations//agent/environments/ /users//sessions//entityTypes/` If * `Location ID` is not specified we assume default 'us' location. If * `Environment ID` is not specified, we assume default 'draft' environment. If * `User ID` is not specified, we assume default '-' user. `` must be the * display name of an existing entity type in the same agent that will be * overridden or supplemented. */ @property(nonatomic, copy, nullable) NSString *name; @end /** * Represents a smart reply answer. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1SmartReplyAnswer : GTLRObject /** * The name of answer record, in the format of * "projects//locations//answerRecords/" */ @property(nonatomic, copy, nullable) NSString *answerRecord; /** * Smart reply confidence. The system's confidence score that this reply is a * good match for this conversation, as a value from 0.0 (completely uncertain) * to 1.0 (completely certain). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *confidence; /** The content of the reply. */ @property(nonatomic, copy, nullable) NSString *reply; @end /** * The response message for Participants.SuggestArticles. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestArticlesResponse : GTLRObject /** Output only. Articles ordered by score in descending order. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1ArticleAnswer *> *articleAnswers; /** * Number of messages prior to and including latest_message to compile the * suggestion. It may be smaller than the SuggestArticlesResponse.context_size * field in the request if there aren't that many messages in the conversation. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *contextSize; /** * The name of the latest conversation message used to compile suggestion for. * Format: `projects//locations//conversations//messages/`. */ @property(nonatomic, copy, nullable) NSString *latestMessage; @end /** * The request message for Participants.SuggestFaqAnswers. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestFaqAnswersResponse : GTLRObject /** * Number of messages prior to and including latest_message to compile the * suggestion. It may be smaller than the SuggestFaqAnswersRequest.context_size * field in the request if there aren't that many messages in the conversation. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *contextSize; /** Output only. Answers extracted from FAQ documents. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1FaqAnswer *> *faqAnswers; /** * The name of the latest conversation message used to compile suggestion for. * Format: `projects//locations//conversations//messages/`. */ @property(nonatomic, copy, nullable) NSString *latestMessage; @end /** * One response of different type of suggestion response which is used in the * response of Participants.AnalyzeContent and Participants.AnalyzeContent, as * well as HumanAgentAssistantEvent. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestionResult : GTLRObject /** Error status if the request failed. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *error; /** SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestArticlesResponse *suggestArticlesResponse; /** SuggestFaqAnswersResponse if request is for FAQ_ANSWER. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestFaqAnswersResponse *suggestFaqAnswersResponse; /** SuggestSmartRepliesResponse if request is for SMART_REPLY. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestSmartRepliesResponse *suggestSmartRepliesResponse; @end /** * The response message for Participants.SuggestSmartReplies. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1SuggestSmartRepliesResponse : GTLRObject /** * Number of messages prior to and including latest_message to compile the * suggestion. It may be smaller than the * SuggestSmartRepliesRequest.context_size field in the request if there aren't * that many messages in the conversation. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *contextSize; /** * The name of the latest conversation message used to compile suggestion for. * Format: `projects//locations//conversations//messages/`. */ @property(nonatomic, copy, nullable) NSString *latestMessage; /** * Output only. Multiple reply options provided by smart reply service. The * order is based on the rank of the model prediction. The maximum number of * the returned replies is set in SmartReplyConfig. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1SmartReplyAnswer *> *smartReplyAnswers; @end /** * The request message for a webhook call. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1WebhookRequest : GTLRObject /** Alternative query results from KnowledgeService. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult *> *alternativeQueryResults; /** * Optional. The contents of the original request that was passed to * `[Streaming]DetectIntent` call. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest *originalDetectIntentRequest; /** * The result of the conversational query or event processing. Contains the * same value as `[Streaming]DetectIntentResponse.query_result`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1QueryResult *queryResult; /** * The unique identifier of the response. Contains the same value as * `[Streaming]DetectIntentResponse.response_id`. */ @property(nonatomic, copy, nullable) NSString *responseId; /** * The unique identifier of detectIntent request session. Can be used to * identify end-user inside webhook implementation. Supported formats: - * `projects//agent/sessions/, - `projects//locations//agent/sessions/`, - * `projects//agent/environments//users//sessions/`, - * `projects//locations//agent/environments//users//sessions/`, */ @property(nonatomic, copy, nullable) NSString *session; @end /** * The response message for a webhook call. This response is validated by the * Dialogflow server. If validation fails, an error will be returned in the * QueryResult.diagnostic_info field. Setting JSON fields to an empty value * with the wrong type is a common error. To avoid this error: - Use `""` for * empty strings - Use `{}` or `null` for empty objects - Use `[]` or `null` * for empty arrays For more information, see the [Protocol Buffers Language * Guide](https://developers.google.com/protocol-buffers/docs/proto3#json). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1WebhookResponse : GTLRObject /** * Optional. Indicates that this intent ends an interaction. Some integrations * (e.g., Actions on Google or Dialogflow phone gateway) use this information * to close interaction with an end user. Default is false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *endInteraction; /** * Optional. Invokes the supplied events. When this field is set, Dialogflow * ignores the `fulfillment_text`, `fulfillment_messages`, and `payload` * fields. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1EventInput *followupEventInput; /** * Optional. The rich response messages intended for the end-user. When * provided, Dialogflow uses this field to populate * QueryResult.fulfillment_messages sent to the integration or API caller. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1IntentMessage *> *fulfillmentMessages; /** * Optional. The text response message intended for the end-user. It is * recommended to use `fulfillment_messages.text.text[0]` instead. When * provided, Dialogflow uses this field to populate * QueryResult.fulfillment_text sent to the integration or API caller. */ @property(nonatomic, copy, nullable) NSString *fulfillmentText; /** * Indicates that a live agent should be brought in to handle the interaction * with the user. In most cases, when you set this flag to true, you would also * want to set end_interaction to true as well. Default is false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *liveAgentHandoff; /** * Optional. The collection of output contexts that will overwrite currently * active contexts for the session and reset their lifespans. When provided, * Dialogflow uses this field to populate QueryResult.output_contexts sent to * the integration or API caller. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1Context *> *outputContexts; /** * Optional. This field can be used to pass custom data from your webhook to * the integration or API caller. Arbitrary JSON objects are supported. When * provided, Dialogflow uses this field to populate QueryResult.webhook_payload * sent to the integration or API caller. This field is also used by the * [Google Assistant * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) for * rich response messages. See the format definition at [Google Assistant * Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2beta1WebhookResponse_Payload *payload; /** * Optional. Additional session entity types to replace or extend developer * entity types with. The entity synonyms apply to all languages and persist * for the session. Setting this data from a webhook overwrites the session * entity types that have been set using `detectIntent`, * `streamingDetectIntent` or SessionEntityType management methods. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2beta1SessionEntityType *> *sessionEntityTypes; /** * Optional. A custom field used to identify the webhook source. Arbitrary * strings are supported. When provided, Dialogflow uses this field to populate * QueryResult.webhook_source sent to the integration or API caller. */ @property(nonatomic, copy, nullable) NSString *source; @end /** * Optional. This field can be used to pass custom data from your webhook to * the integration or API caller. Arbitrary JSON objects are supported. When * provided, Dialogflow uses this field to populate QueryResult.webhook_payload * sent to the integration or API caller. This field is also used by the * [Google Assistant * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) for * rich response messages. See the format definition at [Google Assistant * Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2beta1WebhookResponse_Payload : GTLRObject @end /** * Dialogflow contexts are similar to natural language context. If a person * says to you "they are orange", you need context in order to understand what * "they" is referring to. Similarly, for Dialogflow to handle an end-user * expression like that, it needs to be provided with context in order to * correctly match an intent. Using contexts, you can control the flow of a * conversation. You can configure contexts for an intent by setting input and * output contexts, which are identified by string names. When an intent is * matched, any configured output contexts for that intent become active. While * any contexts are active, Dialogflow is more likely to match intents that are * configured with input contexts that correspond to the currently active * contexts. For more information about context, see the [Contexts * guide](https://cloud.google.com/dialogflow/docs/contexts-overview). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2Context : GTLRObject /** * Optional. The number of conversational query requests after which the * context expires. The default is `0`. If set to `0`, the context expires * immediately. Contexts expire automatically after 20 minutes if there are no * matching queries. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *lifespanCount; /** * Required. The unique identifier of the context. Format: * `projects//agent/sessions//contexts/`, or * `projects//agent/environments//users//sessions//contexts/`. The `Context ID` * is always converted to lowercase, may only contain characters in * a-zA-Z0-9_-% and may be at most 250 bytes long. If `Environment ID` is not * specified, we assume default 'draft' environment. If `User ID` is not * specified, we assume default '-' user. The following context names are * reserved for internal use by Dialogflow. You should not use these contexts * or create contexts with these names: * `__system_counters__` * * `*_id_dialog_context` * `*_dialog_params_size` */ @property(nonatomic, copy, nullable) NSString *name; /** * Optional. The collection of parameters associated with this context. * Depending on your protocol or client library language, this is a map, * associative array, symbol table, dictionary, or JSON object composed of a * collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey * value: parameter name - MapValue type: - If parameter's entity type is a * composite entity: map - Else: depending on parameter value type, could be * one of string, number, boolean, null, list or map - MapValue value: - If * parameter's entity type is a composite entity: map from composite entity * property names to property values - Else: parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2Context_Parameters *parameters; @end /** * Optional. The collection of parameters associated with this context. * Depending on your protocol or client library language, this is a map, * associative array, symbol table, dictionary, or JSON object composed of a * collection of (MapKey, MapValue) pairs: - MapKey type: string - MapKey * value: parameter name - MapValue type: - If parameter's entity type is a * composite entity: map - Else: depending on parameter value type, could be * one of string, number, boolean, null, list or map - MapValue value: - If * parameter's entity type is a composite entity: map from composite entity * property names to property values - Else: parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2Context_Parameters : GTLRObject @end /** * Represents a notification sent to Pub/Sub subscribers for conversation * lifecycle events. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent : GTLRObject /** * The unique identifier of the conversation this notification refers to. * Format: `projects//conversations/`. */ @property(nonatomic, copy, nullable) NSString *conversation; /** * More detailed information about an error. Only set for type * UNRECOVERABLE_ERROR_IN_PHONE_CALL. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *errorStatus; /** Payload of NEW_MESSAGE event. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2Message *newMessagePayload NS_RETURNS_NOT_RETAINED; /** * The type of the event that this notification refers to. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_ConversationFinished * An existing conversation has closed. This is fired when a telephone * call is terminated, or a conversation is closed via the API. (Value: * "CONVERSATION_FINISHED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_ConversationStarted * A new conversation has been opened. This is fired when a telephone * call is answered, or a conversation is created via the API. (Value: * "CONVERSATION_STARTED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_HumanInterventionNeeded * An existing conversation has received notification from Dialogflow * that human intervention is required. (Value: * "HUMAN_INTERVENTION_NEEDED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_NewMessage * An existing conversation has received a new message, either from API * or telephony. It is configured in * ConversationProfile.new_message_event_notification_config (Value: * "NEW_MESSAGE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_TypeUnspecified * Type not set. (Value: "TYPE_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2ConversationEvent_Type_UnrecoverableError * Unrecoverable error during a telephone call. In general * non-recoverable errors only occur if something was misconfigured in * the ConversationProfile corresponding to the call. After a * non-recoverable error, Dialogflow may stop responding. We don't fire * this event: * in an API call because we can directly return the error, * or, * when we can recover from an error. (Value: * "UNRECOVERABLE_ERROR") */ @property(nonatomic, copy, nullable) NSString *type; @end /** * Each intent parameter has a type, called the entity type, which dictates * exactly how data from an end-user expression is extracted. Dialogflow * provides predefined system entities that can match many common types of * data. For example, there are system entities for matching dates, times, * colors, email addresses, and so on. You can also create your own custom * entities for matching custom data. For example, you could define a vegetable * entity that can match the types of vegetables available for purchase with a * grocery store agent. For more information, see the [Entity * guide](https://cloud.google.com/dialogflow/docs/entities-overview). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2EntityType : GTLRObject /** * Optional. Indicates whether the entity type can be automatically expanded. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_AutoExpansionMode_AutoExpansionModeDefault * Allows an agent to recognize values that have not been explicitly * listed in the entity. (Value: "AUTO_EXPANSION_MODE_DEFAULT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_AutoExpansionMode_AutoExpansionModeUnspecified * Auto expansion disabled for the entity. (Value: * "AUTO_EXPANSION_MODE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *autoExpansionMode; /** Required. The name of the entity type. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional. Enables fuzzy entity extraction during classification. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *enableFuzzyExtraction; /** * Optional. The collection of entity entries associated with the entity type. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2EntityTypeEntity *> *entities; /** * Required. Indicates the kind of entity type. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_Kind_KindList * List entity types contain a set of entries that do not map to * reference values. However, list entity types can contain references to * other entity types (with or without aliases). (Value: "KIND_LIST") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_Kind_KindMap Map * entity types allow mapping of a group of synonyms to a reference * value. (Value: "KIND_MAP") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_Kind_KindRegexp * Regexp entity types allow to specify regular expressions in entries * values. (Value: "KIND_REGEXP") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2EntityType_Kind_KindUnspecified * Not specified. This value should be never used. (Value: * "KIND_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *kind; /** * The unique identifier of the entity type. Required for * EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes methods. * Format: `projects//agent/entityTypes/`. */ @property(nonatomic, copy, nullable) NSString *name; @end /** * An **entity entry** for an associated entity type. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2EntityTypeEntity : GTLRObject /** * Required. A collection of value synonyms. For example, if the entity type is * *vegetable*, and `value` is *scallions*, a synonym could be *green onions*. * For `KIND_LIST` entity types: * This collection must contain exactly one * synonym equal to `value`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *synonyms; /** * Required. The primary value associated with this entity entry. For example, * if the entity type is *vegetable*, the value could be *scallions*. For * `KIND_MAP` entity types: * A reference value to be used in place of * synonyms. For `KIND_LIST` entity types: * A string that can contain * references to other entity types (with or without aliases). */ @property(nonatomic, copy, nullable) NSString *value; @end /** * Events allow for matching intents by event name instead of the natural * language input. For instance, input `` can trigger a personalized welcome * response. The parameter `name` may be used by the agent in the response: * `"Hello #welcome_event.name! What can I do for you today?"`. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2EventInput : GTLRObject /** * Required. The language of this query. See [Language * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a * list of the currently supported language codes. Note that queries in the * same session do not necessarily need to specify the same language. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** Required. The unique identifier of the event. */ @property(nonatomic, copy, nullable) NSString *name; /** * The collection of parameters associated with the event. Depending on your * protocol or client library language, this is a map, associative array, * symbol table, dictionary, or JSON object composed of a collection of * (MapKey, MapValue) pairs: - MapKey type: string - MapKey value: parameter * name - MapValue type: - If parameter's entity type is a composite entity: * map - Else: depending on parameter value type, could be one of string, * number, boolean, null, list or map - MapValue value: - If parameter's entity * type is a composite entity: map from composite entity property names to * property values - Else: parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2EventInput_Parameters *parameters; @end /** * The collection of parameters associated with the event. Depending on your * protocol or client library language, this is a map, associative array, * symbol table, dictionary, or JSON object composed of a collection of * (MapKey, MapValue) pairs: - MapKey type: string - MapKey value: parameter * name - MapValue type: - If parameter's entity type is a composite entity: * map - Else: depending on parameter value type, could be one of string, * number, boolean, null, list or map - MapValue value: - If parameter's entity * type is a composite entity: map from composite entity property names to * property values - Else: parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2EventInput_Parameters : GTLRObject @end /** * The response message for Agents.ExportAgent. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2ExportAgentResponse : GTLRObject /** * Zip compressed raw byte content for agent. * * Contains encoded binary data; GTLRBase64 can encode/decode (probably * web-safe format). */ @property(nonatomic, copy, nullable) NSString *agentContent; /** * The URI to a file containing the exported agent. This field is populated * only if `agent_uri` is specified in `ExportAgentRequest`. */ @property(nonatomic, copy, nullable) NSString *agentUri; @end /** * Represents answer from "frequently asked questions". */ @interface GTLRDialogflow_GoogleCloudDialogflowV2FaqAnswer : GTLRObject /** The piece of text from the `source` knowledge base document. */ @property(nonatomic, copy, nullable) NSString *answer; /** * The name of answer record, in the format of * "projects//locations//answerRecords/" */ @property(nonatomic, copy, nullable) NSString *answerRecord; /** * The system's confidence score that this Knowledge answer is a good match for * this conversational query, range from 0.0 (completely uncertain) to 1.0 * (completely certain). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *confidence; /** * A map that contains metadata about the answer and the document from which it * originates. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2FaqAnswer_Metadata *metadata; /** The corresponding FAQ question. */ @property(nonatomic, copy, nullable) NSString *question; /** * Indicates which Knowledge Document this answer was extracted from. Format: * `projects//locations//agent/knowledgeBases//documents/`. */ @property(nonatomic, copy, nullable) NSString *source; @end /** * A map that contains metadata about the answer and the document from which it * originates. * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2FaqAnswer_Metadata : GTLRObject @end /** * Represents a notification sent to Cloud Pub/Sub subscribers for human agent * assistant events in a specific conversation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2HumanAgentAssistantEvent : GTLRObject /** * The conversation this notification refers to. Format: * `projects//conversations/`. */ @property(nonatomic, copy, nullable) NSString *conversation; /** * The participant that the suggestion is compiled for. Format: * `projects//conversations//participants/`. It will not be set in legacy * workflow. */ @property(nonatomic, copy, nullable) NSString *participant; /** The suggestion results payload that this notification refers to. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2SuggestionResult *> *suggestionResults; @end /** * An intent categorizes an end-user's intention for one conversation turn. For * each agent, you define many intents, where your combined intents can handle * a complete conversation. When an end-user writes or says something, referred * to as an end-user expression or end-user input, Dialogflow matches the * end-user input to the best intent in your agent. Matching an intent is also * known as intent classification. For more information, see the [intent * guide](https://cloud.google.com/dialogflow/docs/intents-overview). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2Intent : GTLRObject /** * Optional. The name of the action associated with the intent. Note: The * action name must not contain whitespaces. */ @property(nonatomic, copy, nullable) NSString *action; /** * Optional. The list of platforms for which the first responses will be copied * from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). */ @property(nonatomic, strong, nullable) NSArray<NSString *> *defaultResponsePlatforms; /** Required. The name of this intent. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional. Indicates that this intent ends an interaction. Some integrations * (e.g., Actions on Google or Dialogflow phone gateway) use this information * to close interaction with an end user. Default is false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *endInteraction; /** * Optional. The collection of event names that trigger the intent. If the * collection of input contexts is not empty, all of the contexts must be * present in the active user session for an event to trigger this intent. * Event names are limited to 150 characters. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *events; /** * Output only. Read-only. Information about all followup intents that have * this intent as a direct or indirect parent. We populate this field only in * the output. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentFollowupIntentInfo *> *followupIntentInfo; /** * Optional. The list of context names required for this intent to be * triggered. Format: `projects//agent/sessions/-/contexts/`. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *inputContextNames; /** * Optional. Indicates whether this is a fallback intent. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isFallback; /** * Optional. Indicates that a live agent should be brought in to handle the * interaction with the user. In most cases, when you set this flag to true, * you would also want to set end_interaction to true as well. Default is * false. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *liveAgentHandoff; /** * Optional. The collection of rich messages corresponding to the `Response` * field in the Dialogflow console. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage *> *messages; /** * Optional. Indicates whether Machine Learning is disabled for the intent. * Note: If `ml_disabled` setting is set to true, then this intent is not taken * into account during inference in `ML ONLY` match mode. Also, auto-markup in * the UI is turned off. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *mlDisabled; /** * Optional. The unique identifier of this intent. Required for * Intents.UpdateIntent and Intents.BatchUpdateIntents methods. Format: * `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *name; /** * Optional. The collection of contexts that are activated when the intent is * matched. Context messages in this collection should not set the parameters * field. Setting the `lifespan_count` to 0 will reset the context when the * intent is matched. Format: `projects//agent/sessions/-/contexts/`. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2Context *> *outputContexts; /** Optional. The collection of parameters associated with the intent. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentParameter *> *parameters; /** * Read-only after creation. The unique identifier of the parent intent in the * chain of followup intents. You can set this field when creating an intent, * for example with CreateIntent or BatchUpdateIntents, in order to make this * intent a followup intent. It identifies the parent followup intent. Format: * `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *parentFollowupIntentName; /** * Optional. The priority of this intent. Higher numbers represent higher * priorities. - If the supplied value is unspecified or 0, the service * translates the value to 500,000, which corresponds to the `Normal` priority * in the console. - If the supplied value is negative, the intent is ignored * in runtime detect intent requests. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *priority; /** * Optional. Indicates whether to delete all contexts in the current session * when this intent is matched. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *resetContexts; /** * Output only. Read-only. The unique identifier of the root intent in the * chain of followup intents. It identifies the correct followup intents chain * for this intent. We populate this field only in the output. Format: * `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *rootFollowupIntentName; /** Optional. The collection of examples that the agent is trained on. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase *> *trainingPhrases; /** * Optional. Indicates whether webhooks are enabled for the intent. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2Intent_WebhookState_WebhookStateEnabled * Webhook is enabled in the agent and in the intent. (Value: * "WEBHOOK_STATE_ENABLED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2Intent_WebhookState_WebhookStateEnabledForSlotFilling * Webhook is enabled in the agent and in the intent. Also, each slot * filling prompt is forwarded to the webhook. (Value: * "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2Intent_WebhookState_WebhookStateUnspecified * Webhook is disabled in the agent and in the intent. (Value: * "WEBHOOK_STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *webhookState; @end /** * Represents a single followup intent in the chain. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentFollowupIntentInfo : GTLRObject /** * The unique identifier of the followup intent. Format: * `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *followupIntentName; /** * The unique identifier of the followup intent's parent. Format: * `projects//agent/intents/`. */ @property(nonatomic, copy, nullable) NSString *parentFollowupIntentName; @end /** * A rich response message. Corresponds to the intent `Response` field in the * Dialogflow console. For more information, see [Rich response * messages](https://cloud.google.com/dialogflow/docs/intents-rich-messages). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage : GTLRObject /** The basic card response for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCard *basicCard; /** Browse carousel card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard *browseCarouselCard; /** The card response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCard *card; /** The carousel card response for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCarouselSelect *carouselSelect; /** The image response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage *image; /** The link out suggestion chip for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion *linkOutSuggestion; /** The list card response for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageListSelect *listSelect; /** The media content card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContent *mediaContent; /** A custom platform-specific response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Payload *payload; /** * Optional. The platform that this message is intended for. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_ActionsOnGoogle * Google Assistant See [Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) * (Value: "ACTIONS_ON_GOOGLE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Facebook * Facebook. (Value: "FACEBOOK") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_GoogleHangouts * Google Hangouts. (Value: "GOOGLE_HANGOUTS") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Kik * Kik. (Value: "KIK") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Line * Line. (Value: "LINE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_PlatformUnspecified * Default platform. (Value: "PLATFORM_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Skype * Skype. (Value: "SKYPE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Slack * Slack. (Value: "SLACK") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Telegram * Telegram. (Value: "TELEGRAM") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Platform_Viber * Viber. (Value: "VIBER") */ @property(nonatomic, copy, nullable) NSString *platform; /** The quick replies response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageQuickReplies *quickReplies; /** The voice and text-only responses for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSimpleResponses *simpleResponses; /** The suggestion chips for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSuggestions *suggestions; /** Table card for Actions on Google. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCard *tableCard; /** The text response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageText *text; @end /** * A custom platform-specific response. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage_Payload : GTLRObject @end /** * The basic card message. Useful for displaying information. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCard : GTLRObject /** Optional. The collection of card buttons. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCardButton *> *buttons; /** Required, unless image is present. The body text of the card. */ @property(nonatomic, copy, nullable) NSString *formattedText; /** Optional. The image for the card. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage *image; /** Optional. The subtitle of the card. */ @property(nonatomic, copy, nullable) NSString *subtitle; /** Optional. The title of the card. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * The button object that appears at the bottom of a card. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCardButton : GTLRObject /** Required. Action to take when a user taps on the button. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction *openUriAction; /** Required. The title of the button. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Opens the given URI. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction : GTLRObject /** Required. The HTTP or HTTPS scheme URI. */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * Browse Carousel Card for Actions on Google. * https://developers.google.com/actions/assistant/responses#browsing_carousel * * @note This class supports NSFastEnumeration and indexed subscripting over * its "items" property. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard : GTLRCollectionObject /** * Optional. Settings for displaying the image. Applies to every image in * items. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_BlurredBackground * Pad the gaps between image and image frame with a blurred copy of the * same image. (Value: "BLURRED_BACKGROUND") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_Cropped * Image is scaled such that the image width and height match or exceed * the container dimensions. This may crop the top and bottom of the * image if the scaled image height is greater than the container height, * or crop the left and right of the image if the scaled image width is * greater than the container width. This is similar to "Zoom Mode" on a * widescreen TV when playing a 4:3 video. (Value: "CROPPED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_Gray * Fill the gaps between the image and the image container with gray * bars. (Value: "GRAY") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_ImageDisplayOptionsUnspecified * Fill the gaps between the image and the image container with gray * bars. (Value: "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCard_ImageDisplayOptions_White * Fill the gaps between the image and the image container with white * bars. (Value: "WHITE") */ @property(nonatomic, copy, nullable) NSString *imageDisplayOptions; /** * Required. List of items in the Browse Carousel Card. Minimum of two items, * maximum of ten. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem *> *items; @end /** * Browsing carousel tile */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItem : GTLRObject /** * Optional. Description of the carousel item. Maximum of four lines of text. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** * Optional. Text that appears at the bottom of the Browse Carousel Card. * Maximum of one line of text. */ @property(nonatomic, copy, nullable) NSString *footer; /** Optional. Hero image for the carousel item. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage *image; /** Required. Action to present to the user. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction *openUriAction; /** Required. Title of the carousel item. Maximum of two lines of text. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Actions on Google action to open a given url. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction : GTLRObject /** Required. URL */ @property(nonatomic, copy, nullable) NSString *url; /** * Optional. Specifies the type of viewer that is used when opening the URL. * Defaults to opening via web browser. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_AmpAction * Url would be an amp action (Value: "AMP_ACTION") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_AmpContent * URL that points directly to AMP content, or to a canonical URL which * refers to AMP content via . (Value: "AMP_CONTENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBrowseCarouselCardBrowseCarouselCardItemOpenUrlAction_UrlTypeHint_UrlTypeHintUnspecified * Unspecified (Value: "URL_TYPE_HINT_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *urlTypeHint; @end /** * The card response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCard : GTLRObject /** Optional. The collection of card buttons. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCardButton *> *buttons; /** Optional. The public URI to an image file for the card. */ @property(nonatomic, copy, nullable) NSString *imageUri; /** Optional. The subtitle of the card. */ @property(nonatomic, copy, nullable) NSString *subtitle; /** Optional. The title of the card. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Contains information about a button. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCardButton : GTLRObject /** Optional. The text to send back to the Dialogflow API or a URI to open. */ @property(nonatomic, copy, nullable) NSString *postback; /** Optional. The text to show on the button. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * The card for presenting a carousel of options to select from. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "items" property. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCarouselSelect : GTLRCollectionObject /** * Required. Carousel items. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCarouselSelectItem *> *items; @end /** * An item in the carousel. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageCarouselSelectItem : GTLRObject /** * Optional. The body text of the card. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** Optional. The image to display. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage *image; /** Required. Additional info about the option item. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSelectItemInfo *info; /** Required. Title of the carousel item. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Column properties for TableCard. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties : GTLRObject /** Required. Column heading. */ @property(nonatomic, copy, nullable) NSString *header; /** * Optional. Defines text alignment for all cells in this column. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties_HorizontalAlignment_Center * Text is centered in the column. (Value: "CENTER") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties_HorizontalAlignment_HorizontalAlignmentUnspecified * Text is aligned to the leading edge of the column. (Value: * "HORIZONTAL_ALIGNMENT_UNSPECIFIED") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties_HorizontalAlignment_Leading * Text is aligned to the leading edge of the column. (Value: "LEADING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties_HorizontalAlignment_Trailing * Text is aligned to the trailing edge of the column. (Value: * "TRAILING") */ @property(nonatomic, copy, nullable) NSString *horizontalAlignment; @end /** * The image response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage : GTLRObject /** * Optional. A text description of the image to be used for accessibility, * e.g., screen readers. */ @property(nonatomic, copy, nullable) NSString *accessibilityText; /** Optional. The public URI to an image file. */ @property(nonatomic, copy, nullable) NSString *imageUri; @end /** * The suggestion chip message that allows the user to jump out to the app or * website associated with this agent. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion : GTLRObject /** Required. The name of the app or site this chip is linking to. */ @property(nonatomic, copy, nullable) NSString *destinationName; /** * Required. The URI of the app or site to open when the user taps the * suggestion chip. */ @property(nonatomic, copy, nullable) NSString *uri; @end /** * The card for presenting a list of options to select from. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "items" property. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageListSelect : GTLRCollectionObject /** * Required. List items. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageListSelectItem *> *items; /** Optional. Subtitle of the list. */ @property(nonatomic, copy, nullable) NSString *subtitle; /** Optional. The overall title of the list. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * An item in the list. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageListSelectItem : GTLRObject /** * Optional. The main text describing the item. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** Optional. The image to display. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage *image; /** Required. Additional information about this option. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSelectItemInfo *info; /** Required. The title of the list item. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * The media content card for Actions on Google. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContent : GTLRObject /** Required. List of media objects. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject *> *mediaObjects; /** * Optional. What type of media is the content (ie "audio"). * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContent_MediaType_Audio * Response media type is audio. (Value: "AUDIO") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContent_MediaType_ResponseMediaTypeUnspecified * Unspecified. (Value: "RESPONSE_MEDIA_TYPE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *mediaType; @end /** * Response media object for media content card. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageMediaContentResponseMediaObject : GTLRObject /** Required. Url where the media is stored. */ @property(nonatomic, copy, nullable) NSString *contentUrl; /** * Optional. Description of media card. * * Remapped to 'descriptionProperty' to avoid NSObject's 'description'. */ @property(nonatomic, copy, nullable) NSString *descriptionProperty; /** Optional. Icon to display above media content. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage *icon; /** Optional. Image to display above media content. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage *largeImage; /** Required. Name of media card. */ @property(nonatomic, copy, nullable) NSString *name; @end /** * The quick replies response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageQuickReplies : GTLRObject /** Optional. The collection of quick replies. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *quickReplies; /** Optional. The title of the collection of quick replies. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Additional info about the select item for when it is triggered in a dialog. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSelectItemInfo : GTLRObject /** * Required. A unique key that will be sent back to the agent if this response * is given. */ @property(nonatomic, copy, nullable) NSString *key; /** * Optional. A list of synonyms that can also be used to trigger this item in * dialog. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *synonyms; @end /** * The simple response message containing speech or text. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSimpleResponse : GTLRObject /** Optional. The text to display. */ @property(nonatomic, copy, nullable) NSString *displayText; /** * One of text_to_speech or ssml must be provided. Structured spoken response * to the user in the SSML format. Mutually exclusive with text_to_speech. */ @property(nonatomic, copy, nullable) NSString *ssml; /** * One of text_to_speech or ssml must be provided. The plain text of the speech * output. Mutually exclusive with ssml. */ @property(nonatomic, copy, nullable) NSString *textToSpeech; @end /** * The collection of simple response candidates. This message in * `QueryResult.fulfillment_messages` and * `WebhookResponse.fulfillment_messages` should contain only one * `SimpleResponse`. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSimpleResponses : GTLRObject /** Required. The list of simple responses. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSimpleResponse *> *simpleResponses; @end /** * The suggestion chip message that the user can tap to quickly post a reply to * the conversation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSuggestion : GTLRObject /** Required. The text shown the in the suggestion chip. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * The collection of suggestions. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSuggestions : GTLRObject /** Required. The list of suggested replies. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageSuggestion *> *suggestions; @end /** * Table card for Actions on Google. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCard : GTLRObject /** Optional. List of buttons for the card. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageBasicCardButton *> *buttons; /** Optional. Display properties for the columns in this table. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageColumnProperties *> *columnProperties; /** Optional. Image which should be displayed on the card. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageImage *image; /** Optional. Rows in this table of data. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCardRow *> *rows; /** Optional. Subtitle to the title. */ @property(nonatomic, copy, nullable) NSString *subtitle; /** Required. Title of the card. */ @property(nonatomic, copy, nullable) NSString *title; @end /** * Cell of TableCardRow. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCardCell : GTLRObject /** Required. Text in this cell. */ @property(nonatomic, copy, nullable) NSString *text; @end /** * Row of TableCard. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCardRow : GTLRObject /** Optional. List of cells that make up this row. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageTableCardCell *> *cells; /** * Optional. Whether to add a visual divider after this row. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *dividerAfter; @end /** * The text response message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentMessageText : GTLRObject /** Optional. The collection of the agent's responses. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *text; @end /** * Represents intent parameters. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentParameter : GTLRObject /** * Optional. The default value to use when the `value` yields an empty result. * Default values can be extracted from contexts by using the following syntax: * `#context_name.parameter_name`. */ @property(nonatomic, copy, nullable) NSString *defaultValue; /** Required. The name of the parameter. */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Optional. The name of the entity type, prefixed with `\@`, that describes * values of the parameter. If the parameter is required, this must be * provided. */ @property(nonatomic, copy, nullable) NSString *entityTypeDisplayName; /** * Optional. Indicates whether the parameter represents a list of values. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *isList; /** * Optional. Indicates whether the parameter is required. That is, whether the * intent cannot be completed without collecting the parameter value. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *mandatory; /** The unique identifier of this parameter. */ @property(nonatomic, copy, nullable) NSString *name; /** * Optional. The collection of prompts that the agent can present to the user * in order to collect a value for the parameter. */ @property(nonatomic, strong, nullable) NSArray<NSString *> *prompts; /** * Optional. The definition of the parameter value. It can be: - a constant * string, - a parameter value defined as `$parameter_name`, - an original * parameter value defined as `$parameter_name.original`, - a parameter value * from some context defined as `#context_name.parameter_name`. */ @property(nonatomic, copy, nullable) NSString *value; @end /** * Represents an example that the agent is trained on. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase : GTLRObject /** Output only. The unique identifier of this training phrase. */ @property(nonatomic, copy, nullable) NSString *name; /** * Required. The ordered list of training phrase parts. The parts are * concatenated in order to form the training phrase. Note: The API does not * automatically annotate training phrases like the Dialogflow Console does. * Note: Do not forget to include whitespace at part boundaries, so the * training phrase is well formatted when the parts are concatenated. If the * training phrase does not need to be annotated with parameters, you just need * a single part with only the Part.text field set. If you want to annotate the * training phrase, you must create multiple parts, where the fields of each * part are populated in one of two ways: - `Part.text` is set to a part of the * phrase that has no parameters. - `Part.text` is set to a part of the phrase * that you want to annotate, and the `entity_type`, `alias`, and * `user_defined` fields are all set. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrasePart *> *parts; /** * Optional. Indicates how many times this example was added to the intent. * Each time a developer adds an existing sample by editing an intent or * training, this counter is increased. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *timesAddedCount; /** * Required. The type of the training phrase. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase_Type_Example * Examples do not contain \@-prefixed entity type names, but example * parts can be annotated with entity types. (Value: "EXAMPLE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase_Type_Template * Templates are not annotated with entity types, but they can contain * \@-prefixed entity type names as substrings. Template mode has been * deprecated. Example mode is the only supported way to create new * training phrases. If you have existing training phrases that you've * created in template mode, those will continue to work. (Value: * "TEMPLATE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrase_Type_TypeUnspecified * Not specified. This value should never be used. (Value: * "TYPE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *type; @end /** * Represents a part of a training phrase. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2IntentTrainingPhrasePart : GTLRObject /** * Optional. The parameter name for the value extracted from the annotated part * of the example. This field is required for annotated parts of the training * phrase. */ @property(nonatomic, copy, nullable) NSString *alias; /** * Optional. The entity type name prefixed with `\@`. This field is required * for annotated parts of the training phrase. */ @property(nonatomic, copy, nullable) NSString *entityType; /** Required. The text for this part. */ @property(nonatomic, copy, nullable) NSString *text; /** * Optional. Indicates whether the text was manually annotated. This field is * set to true when the Dialogflow Console is used to manually annotate the * part. When creating an annotated part with the API, you must set this to * true. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *userDefined; @end /** * Metadata in google::longrunning::Operation for Knowledge operations. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata : GTLRObject /** * Output only. The current state of this operation. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata_State_Done * The operation is done, either cancelled or completed. (Value: "DONE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata_State_Pending * The operation has been created. (Value: "PENDING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata_State_Running * The operation is currently running. (Value: "RUNNING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2KnowledgeOperationMetadata_State_StateUnspecified * State unspecified. (Value: "STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *state; @end /** * Represents a message posted into a conversation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2Message : GTLRObject /** Required. The message content. */ @property(nonatomic, copy, nullable) NSString *content; /** * Output only. The time when the message was created in Contact Center AI. */ @property(nonatomic, strong, nullable) GTLRDateTime *createTime; /** * Optional. The message language. This should be a * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. * Example: "en-US". */ @property(nonatomic, copy, nullable) NSString *languageCode; /** Output only. The annotation for the message. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2MessageAnnotation *messageAnnotation; /** * Optional. The unique identifier of the message. Format: * `projects//locations//conversations//messages/`. */ @property(nonatomic, copy, nullable) NSString *name; /** Output only. The participant that sends this message. */ @property(nonatomic, copy, nullable) NSString *participant; /** * Output only. The role of the participant. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2Message_ParticipantRole_AutomatedAgent * Participant is an automated agent, such as a Dialogflow agent. (Value: * "AUTOMATED_AGENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2Message_ParticipantRole_EndUser * Participant is an end user that has called or chatted with Dialogflow * services. (Value: "END_USER") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2Message_ParticipantRole_HumanAgent * Participant is a human agent. (Value: "HUMAN_AGENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2Message_ParticipantRole_RoleUnspecified * Participant role not set. (Value: "ROLE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *participantRole; /** Optional. The time when the message was sent. */ @property(nonatomic, strong, nullable) GTLRDateTime *sendTime; /** Output only. The sentiment analysis result for the message. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2SentimentAnalysisResult *sentimentAnalysis; @end /** * Represents the result of annotation for the message. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2MessageAnnotation : GTLRObject /** * Indicates whether the text message contains entities. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *containEntities; /** * The collection of annotated message parts ordered by their position in the * message. You can recover the annotated message by concatenating * [AnnotatedMessagePart.text]. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2AnnotatedMessagePart *> *parts; @end /** * Represents the contents of the original request that was passed to the * `[Streaming]DetectIntent` call. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2OriginalDetectIntentRequest : GTLRObject /** * Optional. This field is set to the value of the `QueryParameters.payload` * field passed in the request. Some integrations that query a Dialogflow agent * may provide additional information in the payload. In particular, for the * Dialogflow Phone Gateway integration, this field has the form: { * "telephony": { "caller_id": "+18558363987" } } Note: The caller ID field * (`caller_id`) will be redacted for Trial Edition agents and populated with * the caller ID in [E.164 format](https://en.wikipedia.org/wiki/E.164) for * Essentials Edition agents. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2OriginalDetectIntentRequest_Payload *payload; /** * The source of this request, e.g., `google`, `facebook`, `slack`. It is set * by Dialogflow-owned servers. */ @property(nonatomic, copy, nullable) NSString *source; /** * Optional. The version of the protocol used for this request. This field is * AoG-specific. */ @property(nonatomic, copy, nullable) NSString *version; @end /** * Optional. This field is set to the value of the `QueryParameters.payload` * field passed in the request. Some integrations that query a Dialogflow agent * may provide additional information in the payload. In particular, for the * Dialogflow Phone Gateway integration, this field has the form: { * "telephony": { "caller_id": "+18558363987" } } Note: The caller ID field * (`caller_id`) will be redacted for Trial Edition agents and populated with * the caller ID in [E.164 format](https://en.wikipedia.org/wiki/E.164) for * Essentials Edition agents. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2OriginalDetectIntentRequest_Payload : GTLRObject @end /** * Represents the result of conversational query or event processing. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2QueryResult : GTLRObject /** The action name from the matched intent. */ @property(nonatomic, copy, nullable) NSString *action; /** * This field is set to: - `false` if the matched intent has required * parameters and not all of the required parameter values have been collected. * - `true` if all required parameter values have been collected, or if the * matched intent doesn't contain any required parameters. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *allRequiredParamsPresent; /** * Indicates whether the conversational query triggers a cancellation for slot * filling. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *cancelsSlotFilling; /** * Free-form diagnostic information for the associated detect intent request. * The fields of this data can change without notice, so you should not write * code that depends on its structure. The data may contain: - webhook call * latency - webhook errors */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_DiagnosticInfo *diagnosticInfo; /** The collection of rich messages to present to the user. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage *> *fulfillmentMessages; /** * The text to be pronounced to the user or shown on the screen. Note: This is * a legacy field, `fulfillment_messages` should be preferred. */ @property(nonatomic, copy, nullable) NSString *fulfillmentText; /** * The intent that matched the conversational query. Some, not all fields are * filled in this message, including but not limited to: `name`, * `display_name`, `end_interaction` and `is_fallback`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2Intent *intent; /** * The intent detection confidence. Values range from 0.0 (completely * uncertain) to 1.0 (completely certain). This value is for informational * purpose only and is only used to help match the best intent within the * classification threshold. This value may change for the same end-user * expression at any time due to a model retraining or change in * implementation. If there are `multiple knowledge_answers` messages, this * value is set to the greatest `knowledgeAnswers.match_confidence` value in * the list. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *intentDetectionConfidence; /** * The language that was triggered during intent detection. See [Language * Support](https://cloud.google.com/dialogflow/docs/reference/language) for a * list of the currently supported language codes. */ @property(nonatomic, copy, nullable) NSString *languageCode; /** * The collection of output contexts. If applicable, * `output_contexts.parameters` contains entries with name `.original` * containing the original parameter values before the query. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2Context *> *outputContexts; /** * The collection of extracted parameters. Depending on your protocol or client * library language, this is a map, associative array, symbol table, * dictionary, or JSON object composed of a collection of (MapKey, MapValue) * pairs: - MapKey type: string - MapKey value: parameter name - MapValue type: * - If parameter's entity type is a composite entity: map - Else: depending on * parameter value type, could be one of string, number, boolean, null, list or * map - MapValue value: - If parameter's entity type is a composite entity: * map from composite entity property names to property values - Else: * parameter value */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_Parameters *parameters; /** * The original conversational query text: - If natural language text was * provided as input, `query_text` contains a copy of the input. - If natural * language speech audio was provided as input, `query_text` contains the * speech recognition result. If speech recognizer produced multiple * alternatives, a particular one is picked. - If automatic spell correction is * enabled, `query_text` will contain the corrected user input. */ @property(nonatomic, copy, nullable) NSString *queryText; /** * The sentiment analysis result, which depends on the * `sentiment_analysis_request_config` specified in the request. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2SentimentAnalysisResult *sentimentAnalysisResult; /** * The Speech recognition confidence between 0.0 and 1.0. A higher number * indicates an estimated greater likelihood that the recognized words are * correct. The default of 0.0 is a sentinel value indicating that confidence * was not set. This field is not guaranteed to be accurate or set. In * particular this field isn't set for StreamingDetectIntent since the * streaming endpoint has separate confidence estimates per portion of the * audio in StreamingRecognitionResult. * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *speechRecognitionConfidence; /** * If the query was fulfilled by a webhook call, this field is set to the value * of the `payload` field returned in the webhook response. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_WebhookPayload *webhookPayload; /** * If the query was fulfilled by a webhook call, this field is set to the value * of the `source` field returned in the webhook response. */ @property(nonatomic, copy, nullable) NSString *webhookSource; @end /** * Free-form diagnostic information for the associated detect intent request. * The fields of this data can change without notice, so you should not write * code that depends on its structure. The data may contain: - webhook call * latency - webhook errors * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_DiagnosticInfo : GTLRObject @end /** * The collection of extracted parameters. Depending on your protocol or client * library language, this is a map, associative array, symbol table, * dictionary, or JSON object composed of a collection of (MapKey, MapValue) * pairs: - MapKey type: string - MapKey value: parameter name - MapValue type: * - If parameter's entity type is a composite entity: map - Else: depending on * parameter value type, could be one of string, number, boolean, null, list or * map - MapValue value: - If parameter's entity type is a composite entity: * map from composite entity property names to property values - Else: * parameter value * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_Parameters : GTLRObject @end /** * If the query was fulfilled by a webhook call, this field is set to the value * of the `payload` field returned in the webhook response. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2QueryResult_WebhookPayload : GTLRObject @end /** * The sentiment, such as positive/negative feeling or association, for a unit * of analysis, such as the query text. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2Sentiment : GTLRObject /** * A non-negative number in the [0, +inf) range, which represents the absolute * magnitude of sentiment, regardless of score (positive or negative). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *magnitude; /** * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive * sentiment). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *score; @end /** * The result of sentiment analysis. Sentiment analysis inspects user input and * identifies the prevailing subjective opinion, especially to determine a * user's attitude as positive, negative, or neutral. For * Participants.DetectIntent, it needs to be configured in * DetectIntentRequest.query_params. For Participants.StreamingDetectIntent, it * needs to be configured in StreamingDetectIntentRequest.query_params. And for * Participants.AnalyzeContent and Participants.StreamingAnalyzeContent, it * needs to be configured in ConversationProfile.human_agent_assistant_config */ @interface GTLRDialogflow_GoogleCloudDialogflowV2SentimentAnalysisResult : GTLRObject /** The sentiment analysis result for `query_text`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2Sentiment *queryTextSentiment; @end /** * A session represents a conversation between a Dialogflow agent and an * end-user. You can create special entities, called session entities, during a * session. Session entities can extend or replace custom entity types and only * exist during the session that they were created for. All session data, * including session entities, is stored by Dialogflow for 20 minutes. For more * information, see the [session entity * guide](https://cloud.google.com/dialogflow/docs/entities-session). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType : GTLRObject /** * Required. The collection of entities associated with this session entity * type. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2EntityTypeEntity *> *entities; /** * Required. Indicates whether the additional data should override or * supplement the custom entity type definition. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType_EntityOverrideMode_EntityOverrideModeOverride * The collection of session entities overrides the collection of * entities in the corresponding custom entity type. (Value: * "ENTITY_OVERRIDE_MODE_OVERRIDE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType_EntityOverrideMode_EntityOverrideModeSupplement * The collection of session entities extends the collection of entities * in the corresponding custom entity type. Note: Even in this override * mode calls to `ListSessionEntityTypes`, `GetSessionEntityType`, * `CreateSessionEntityType` and `UpdateSessionEntityType` only return * the additional entities added in this session entity type. If you want * to get the supplemented list, please call EntityTypes.GetEntityType on * the custom entity type and merge. (Value: * "ENTITY_OVERRIDE_MODE_SUPPLEMENT") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType_EntityOverrideMode_EntityOverrideModeUnspecified * Not specified. This value should be never used. (Value: * "ENTITY_OVERRIDE_MODE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *entityOverrideMode; /** * Required. The unique identifier of this session entity type. Format: * `projects//agent/sessions//entityTypes/`, or * `projects//agent/environments//users//sessions//entityTypes/`. If * `Environment ID` is not specified, we assume default 'draft' environment. If * `User ID` is not specified, we assume default '-' user. `` must be the * display name of an existing entity type in the same agent that will be * overridden or supplemented. */ @property(nonatomic, copy, nullable) NSString *name; @end /** * Represents a smart reply answer. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2SmartReplyAnswer : GTLRObject /** * The name of answer record, in the format of * "projects//locations//answerRecords/" */ @property(nonatomic, copy, nullable) NSString *answerRecord; /** * Smart reply confidence. The system's confidence score that this reply is a * good match for this conversation, as a value from 0.0 (completely uncertain) * to 1.0 (completely certain). * * Uses NSNumber of floatValue. */ @property(nonatomic, strong, nullable) NSNumber *confidence; /** The content of the reply. */ @property(nonatomic, copy, nullable) NSString *reply; @end /** * The response message for Participants.SuggestArticles. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2SuggestArticlesResponse : GTLRObject /** Articles ordered by score in descending order. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2ArticleAnswer *> *articleAnswers; /** * Number of messages prior to and including latest_message to compile the * suggestion. It may be smaller than the SuggestArticlesRequest.context_size * field in the request if there aren't that many messages in the conversation. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *contextSize; /** * The name of the latest conversation message used to compile suggestion for. * Format: `projects//locations//conversations//messages/`. */ @property(nonatomic, copy, nullable) NSString *latestMessage; @end /** * The request message for Participants.SuggestFaqAnswers. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2SuggestFaqAnswersResponse : GTLRObject /** * Number of messages prior to and including latest_message to compile the * suggestion. It may be smaller than the SuggestFaqAnswersRequest.context_size * field in the request if there aren't that many messages in the conversation. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *contextSize; /** Answers extracted from FAQ documents. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2FaqAnswer *> *faqAnswers; /** * The name of the latest conversation message used to compile suggestion for. * Format: `projects//locations//conversations//messages/`. */ @property(nonatomic, copy, nullable) NSString *latestMessage; @end /** * One response of different type of suggestion response which is used in the * response of Participants.AnalyzeContent and Participants.AnalyzeContent, as * well as HumanAgentAssistantEvent. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2SuggestionResult : GTLRObject /** Error status if the request failed. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *error; /** SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2SuggestArticlesResponse *suggestArticlesResponse; /** SuggestFaqAnswersResponse if request is for FAQ_ANSWER. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2SuggestFaqAnswersResponse *suggestFaqAnswersResponse; /** SuggestSmartRepliesResponse if request is for SMART_REPLY. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2SuggestSmartRepliesResponse *suggestSmartRepliesResponse; @end /** * The response message for Participants.SuggestSmartReplies. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2SuggestSmartRepliesResponse : GTLRObject /** * Number of messages prior to and including latest_message to compile the * suggestion. It may be smaller than the * SuggestSmartRepliesRequest.context_size field in the request if there aren't * that many messages in the conversation. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *contextSize; /** * The name of the latest conversation message used to compile suggestion for. * Format: `projects//locations//conversations//messages/`. */ @property(nonatomic, copy, nullable) NSString *latestMessage; /** * Output only. Multiple reply options provided by smart reply service. The * order is based on the rank of the model prediction. The maximum number of * the returned replies is set in SmartReplyConfig. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2SmartReplyAnswer *> *smartReplyAnswers; @end /** * The request message for a webhook call. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2WebhookRequest : GTLRObject /** * Optional. The contents of the original request that was passed to * `[Streaming]DetectIntent` call. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2OriginalDetectIntentRequest *originalDetectIntentRequest; /** * The result of the conversational query or event processing. Contains the * same value as `[Streaming]DetectIntentResponse.query_result`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2QueryResult *queryResult; /** * The unique identifier of the response. Contains the same value as * `[Streaming]DetectIntentResponse.response_id`. */ @property(nonatomic, copy, nullable) NSString *responseId; /** * The unique identifier of detectIntent request session. Can be used to * identify end-user inside webhook implementation. Format: * `projects//agent/sessions/`, or * `projects//agent/environments//users//sessions/`. */ @property(nonatomic, copy, nullable) NSString *session; @end /** * The response message for a webhook call. This response is validated by the * Dialogflow server. If validation fails, an error will be returned in the * QueryResult.diagnostic_info field. Setting JSON fields to an empty value * with the wrong type is a common error. To avoid this error: - Use `""` for * empty strings - Use `{}` or `null` for empty objects - Use `[]` or `null` * for empty arrays For more information, see the [Protocol Buffers Language * Guide](https://developers.google.com/protocol-buffers/docs/proto3#json). */ @interface GTLRDialogflow_GoogleCloudDialogflowV2WebhookResponse : GTLRObject /** * Optional. Invokes the supplied events. When this field is set, Dialogflow * ignores the `fulfillment_text`, `fulfillment_messages`, and `payload` * fields. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2EventInput *followupEventInput; /** * Optional. The rich response messages intended for the end-user. When * provided, Dialogflow uses this field to populate * QueryResult.fulfillment_messages sent to the integration or API caller. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2IntentMessage *> *fulfillmentMessages; /** * Optional. The text response message intended for the end-user. It is * recommended to use `fulfillment_messages.text.text[0]` instead. When * provided, Dialogflow uses this field to populate * QueryResult.fulfillment_text sent to the integration or API caller. */ @property(nonatomic, copy, nullable) NSString *fulfillmentText; /** * Optional. The collection of output contexts that will overwrite currently * active contexts for the session and reset their lifespans. When provided, * Dialogflow uses this field to populate QueryResult.output_contexts sent to * the integration or API caller. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2Context *> *outputContexts; /** * Optional. This field can be used to pass custom data from your webhook to * the integration or API caller. Arbitrary JSON objects are supported. When * provided, Dialogflow uses this field to populate QueryResult.webhook_payload * sent to the integration or API caller. This field is also used by the * [Google Assistant * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) for * rich response messages. See the format definition at [Google Assistant * Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV2WebhookResponse_Payload *payload; /** * Optional. Additional session entity types to replace or extend developer * entity types with. The entity synonyms apply to all languages and persist * for the session. Setting this data from a webhook overwrites the session * entity types that have been set using `detectIntent`, * `streamingDetectIntent` or SessionEntityType management methods. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudDialogflowV2SessionEntityType *> *sessionEntityTypes; /** * Optional. A custom field used to identify the webhook source. Arbitrary * strings are supported. When provided, Dialogflow uses this field to populate * QueryResult.webhook_source sent to the integration or API caller. */ @property(nonatomic, copy, nullable) NSString *source; @end /** * Optional. This field can be used to pass custom data from your webhook to * the integration or API caller. Arbitrary JSON objects are supported. When * provided, Dialogflow uses this field to populate QueryResult.webhook_payload * sent to the integration or API caller. This field is also used by the * [Google Assistant * integration](https://cloud.google.com/dialogflow/docs/integrations/aog) for * rich response messages. See the format definition at [Google Assistant * Dialogflow webhook * format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudDialogflowV2WebhookResponse_Payload : GTLRObject @end /** * Metadata for CreateDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV3alpha1CreateDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Metadata for DeleteDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV3alpha1DeleteDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Metadata in google::longrunning::Operation for Knowledge operations. */ @interface GTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata : GTLRObject /** * Required. Output only. The current state of this operation. * * Likely values: * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata_State_Done * The operation is done, either cancelled or completed. (Value: "DONE") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata_State_Pending * The operation has been created. (Value: "PENDING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata_State_Running * The operation is currently running. (Value: "RUNNING") * @arg @c kGTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata_State_StateUnspecified * State unspecified. (Value: "STATE_UNSPECIFIED") */ @property(nonatomic, copy, nullable) NSString *state; @end /** * Metadata for ImportDocuments operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV3alpha1ImportDocumentsOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Response message for Documents.ImportDocuments. */ @interface GTLRDialogflow_GoogleCloudDialogflowV3alpha1ImportDocumentsResponse : GTLRObject /** Includes details about skipped documents or any other warnings. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleRpcStatus *> *warnings; @end /** * Metadata for ReloadDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV3alpha1ReloadDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * Metadata for UpdateDocument operation. */ @interface GTLRDialogflow_GoogleCloudDialogflowV3alpha1UpdateDocumentOperationMetadata : GTLRObject /** The generic information of the operation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudDialogflowV3alpha1GenericKnowledgeOperationMetadata *genericMetadata; @end /** * The response message for Locations.ListLocations. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "locations" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleCloudLocationListLocationsResponse : GTLRCollectionObject /** * A list of locations that matches the specified filter in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleCloudLocationLocation *> *locations; /** The standard List next-page token. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; @end /** * A resource that represents Google Cloud Platform location. */ @interface GTLRDialogflow_GoogleCloudLocationLocation : GTLRObject /** * The friendly name for this location, typically a nearby city name. For * example, "Tokyo". */ @property(nonatomic, copy, nullable) NSString *displayName; /** * Cross-service attributes for the location. For example * {"cloud.googleapis.com/region": "us-east1"} */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudLocationLocation_Labels *labels; /** The canonical id for this location. For example: `"us-east1"`. */ @property(nonatomic, copy, nullable) NSString *locationId; /** * Service-specific metadata. For example the available capacity at the given * location. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleCloudLocationLocation_Metadata *metadata; /** * Resource name for the location, which may vary between implementations. For * example: `"projects/example-project/locations/us-east1"` */ @property(nonatomic, copy, nullable) NSString *name; @end /** * Cross-service attributes for the location. For example * {"cloud.googleapis.com/region": "us-east1"} * * @note This class is documented as having more properties of NSString. Use @c * -additionalJSONKeys and @c -additionalPropertyForName: to get the list * of properties and then fetch them; or @c -additionalProperties to * fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudLocationLocation_Labels : GTLRObject @end /** * Service-specific metadata. For example the available capacity at the given * location. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleCloudLocationLocation_Metadata : GTLRObject @end /** * The response message for Operations.ListOperations. * * @note This class supports NSFastEnumeration and indexed subscripting over * its "operations" property. If returned as the result of a query, it * should support automatic pagination (when @c shouldFetchNextPages is * enabled). */ @interface GTLRDialogflow_GoogleLongrunningListOperationsResponse : GTLRCollectionObject /** The standard List next-page token. */ @property(nonatomic, copy, nullable) NSString *nextPageToken; /** * A list of operations that matches the specified filter in the request. * * @note This property is used to support NSFastEnumeration and indexed * subscripting on this class. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleLongrunningOperation *> *operations; @end /** * This resource represents a long-running operation that is the result of a * network API call. */ @interface GTLRDialogflow_GoogleLongrunningOperation : GTLRObject /** * If the value is `false`, it means the operation is still in progress. If * `true`, the operation is completed, and either `error` or `response` is * available. * * Uses NSNumber of boolValue. */ @property(nonatomic, strong, nullable) NSNumber *done; /** The error result of the operation in case of failure or cancellation. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleRpcStatus *error; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleLongrunningOperation_Metadata *metadata; /** * The server-assigned name, which is only unique within the same service that * originally returns it. If you use the default HTTP mapping, the `name` * should be a resource name ending with `operations/{unique_id}`. */ @property(nonatomic, copy, nullable) NSString *name; /** * The normal response of the operation in case of success. If the original * method returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is the * original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ @property(nonatomic, strong, nullable) GTLRDialogflow_GoogleLongrunningOperation_Response *response; @end /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleLongrunningOperation_Metadata : GTLRObject @end /** * The normal response of the operation in case of success. If the original * method returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is the * original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleLongrunningOperation_Response : GTLRObject @end /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request * or the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON * representation for `Empty` is empty JSON object `{}`. */ @interface GTLRDialogflow_GoogleProtobufEmpty : GTLRObject @end /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains * three pieces of data: error code, error message, and error details. You can * find out more about this error model and how to work with it in the [API * Design Guide](https://cloud.google.com/apis/design/errors). */ @interface GTLRDialogflow_GoogleRpcStatus : GTLRObject /** * The status code, which should be an enum value of google.rpc.Code. * * Uses NSNumber of intValue. */ @property(nonatomic, strong, nullable) NSNumber *code; /** * A list of messages that carry the error details. There is a common set of * message types for APIs to use. */ @property(nonatomic, strong, nullable) NSArray<GTLRDialogflow_GoogleRpcStatus_Details_Item *> *details; /** * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the * google.rpc.Status.details field, or localized by the client. */ @property(nonatomic, copy, nullable) NSString *message; @end /** * GTLRDialogflow_GoogleRpcStatus_Details_Item * * @note This class is documented as having more properties of any valid JSON * type. Use @c -additionalJSONKeys and @c -additionalPropertyForName: to * get the list of properties and then fetch them; or @c * -additionalProperties to fetch them all at once. */ @interface GTLRDialogflow_GoogleRpcStatus_Details_Item : GTLRObject @end /** * An object that represents a latitude/longitude pair. This is expressed as a * pair of doubles to represent degrees latitude and degrees longitude. Unless * specified otherwise, this object must conform to the WGS84 standard. Values * must be within normalized ranges. */ @interface GTLRDialogflow_GoogleTypeLatLng : GTLRObject /** * The latitude in degrees. It must be in the range [-90.0, +90.0]. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *latitude; /** * The longitude in degrees. It must be in the range [-180.0, +180.0]. * * Uses NSNumber of doubleValue. */ @property(nonatomic, strong, nullable) NSNumber *longitude; @end NS_ASSUME_NONNULL_END #pragma clang diagnostic pop
38.864262
181
0.769783
[ "object", "model", "transform" ]
17140b74b3676bac3880e2ebc991a901c1275e61
1,811
h
C
Aplicacion Movil/generated/bundles/login-transition/build/Android/Preview/app/src/main/include/Fuse.Drawing.LineMetricsImpl.h
marferfer/SpinOff-LoL
a9dba8ac9dd476ec1ef94712d9a8e76d3b45aca8
[ "Apache-2.0" ]
null
null
null
Aplicacion Movil/generated/bundles/login-transition/build/Android/Preview/app/src/main/include/Fuse.Drawing.LineMetricsImpl.h
marferfer/SpinOff-LoL
a9dba8ac9dd476ec1ef94712d9a8e76d3b45aca8
[ "Apache-2.0" ]
null
null
null
Aplicacion Movil/generated/bundles/login-transition/build/Android/Preview/app/src/main/include/Fuse.Drawing.LineMetricsImpl.h
marferfer/SpinOff-LoL
a9dba8ac9dd476ec1ef94712d9a8e76d3b45aca8
[ "Apache-2.0" ]
null
null
null
// This file was generated based on C:/Users/JuanJose/AppData/Local/Fusetools/Packages/Fuse.Drawing.Surface/1.9.0/LineMetrics.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Float2.h> #include <Uno.Object.h> #include <Uno.Rect.h> namespace g{namespace Fuse{namespace Drawing{struct LineMetricsImpl;}}} namespace g{namespace Fuse{namespace Drawing{struct LineSegment;}}} namespace g{ namespace Fuse{ namespace Drawing{ // internal sealed class LineMetricsImpl :16 // { uType* LineMetricsImpl_typeof(); void LineMetricsImpl__ctor__fn(LineMetricsImpl* __this); void LineMetricsImpl__AddPoint_fn(LineMetricsImpl* __this, ::g::Uno::Float2* pt); void LineMetricsImpl__BezierBounds_fn(LineMetricsImpl* __this, ::g::Uno::Float2* s, ::g::Uno::Float2* e, ::g::Uno::Float2* c1, ::g::Uno::Float2* c2); void LineMetricsImpl__BezierMinMax_fn(float* p0, float* p1, float* p2, float* p3, ::g::Uno::Float2* __retval); void LineMetricsImpl__EllipticBounds_fn(LineMetricsImpl* __this, ::g::Uno::Float2* from, ::g::Fuse::Drawing::LineSegment* seg); void LineMetricsImpl__GetBounds_fn(LineMetricsImpl* __this, uObject* segments, ::g::Uno::Rect* __retval); void LineMetricsImpl__New1_fn(LineMetricsImpl** __retval); struct LineMetricsImpl : uObject { ::g::Uno::Rect _bounds; bool _hasInit; ::g::Uno::Float2 _curPos; void ctor_(); void AddPoint(::g::Uno::Float2 pt); void BezierBounds(::g::Uno::Float2 s, ::g::Uno::Float2 e, ::g::Uno::Float2 c1, ::g::Uno::Float2 c2); void EllipticBounds(::g::Uno::Float2 from, ::g::Fuse::Drawing::LineSegment seg); ::g::Uno::Rect GetBounds(uObject* segments); static ::g::Uno::Float2 BezierMinMax(float p0, float p1, float p2, float p3); static LineMetricsImpl* New1(); }; // } }}} // ::g::Fuse::Drawing
42.116279
149
0.727223
[ "object" ]
17187055667e02a79f97038ab08784b093a0b1d7
1,024
h
C
engine/core/resources/fbx_loader.h
RikoOphorst/Tremble
650fa53402f9c6114642e0cc8515b2ed517d40d6
[ "MIT" ]
1
2021-10-17T06:41:46.000Z
2021-10-17T06:41:46.000Z
engine/core/resources/fbx_loader.h
RikoOphorst/Tremble
650fa53402f9c6114642e0cc8515b2ed517d40d6
[ "MIT" ]
null
null
null
engine/core/resources/fbx_loader.h
RikoOphorst/Tremble
650fa53402f9c6114642e0cc8515b2ed517d40d6
[ "MIT" ]
null
null
null
#pragma once #include "mesh.h" namespace fbxsdk { class FbxScene; class FbxMesh; class FbxNode; class FbxSurfaceMaterial; } namespace engine { class SGNode; struct Material; class FBXLoader { friend class ResourceManager; public: static bool LoadFBXScene(const std::string& file_path_to_fbx, SGNode* node_to_load_into, bool load_as_static = true); static bool LoadFBXMesh(const std::string& file_path_to_fbx, Mesh::MeshData* mesh_data); private: static bool Setup(fbxsdk::FbxScene** output_scene, std::string file_path_to_fbx); static void ImportFBXNodeIntoNode(fbxsdk::FbxNode* node, SGNode* node_to_load_into, const std::string& file_path, bool load_as_static = true); static void ImportFBXMesh(fbxsdk::FbxMesh* mesh, Mesh::MeshData* mesh_data); static bool ImportFBXNode(fbxsdk::FbxNode* node, Mesh::MeshData* mesh_data); static void ImportFBXMaterial(fbxsdk::FbxSurfaceMaterial* fbx_material, Material* out_material, ResourceManager* resource_manager, const std::string& file_path); }; }
31.030303
163
0.78125
[ "mesh" ]
1719802261890938a3006d55f192035b7746db45
284
h
C
src/myfonts/myft/msdfgen/import-svg.h
PaintLab/PixelFarm.External
0002aa90b504353abbb4adf9778f98c1983033b7
[ "MIT" ]
null
null
null
src/myfonts/myft/msdfgen/import-svg.h
PaintLab/PixelFarm.External
0002aa90b504353abbb4adf9778f98c1983033b7
[ "MIT" ]
null
null
null
src/myfonts/myft/msdfgen/import-svg.h
PaintLab/PixelFarm.External
0002aa90b504353abbb4adf9778f98c1983033b7
[ "MIT" ]
null
null
null
#pragma once #include <cstdlib> //#include "../core/Shape.h" #include "Shape.h" namespace msdfgen { /// Reads the first path found in the specified SVG file and stores it as a Shape in output. bool loadSvgShape(Shape &output, const char *filename, Vector2 *dimensions = NULL); }
20.285714
92
0.721831
[ "shape" ]
172552bec843ede3877370e729c2e79309f5a083
8,550
h
C
source/smarties/Network/ThreadContext.h
waitong94/smarties
e48fe6a8ba4695e20146cf5ca7c6720989217ed3
[ "MIT" ]
91
2018-07-16T07:54:06.000Z
2022-03-15T09:50:22.000Z
source/smarties/Network/ThreadContext.h
waitong94/smarties
e48fe6a8ba4695e20146cf5ca7c6720989217ed3
[ "MIT" ]
7
2019-04-03T03:14:59.000Z
2021-11-17T09:02:14.000Z
source/smarties/Network/ThreadContext.h
waitong94/smarties
e48fe6a8ba4695e20146cf5ca7c6720989217ed3
[ "MIT" ]
36
2018-07-16T08:08:35.000Z
2022-03-29T02:40:20.000Z
// // smarties // Copyright (c) 2018 CSE-Lab, ETH Zurich, Switzerland. All rights reserved. // Distributed under the terms of the MIT license. // // Created by Guido Novati (novatig@ethz.ch). // #ifndef smarties_ThreadContext_h #define smarties_ThreadContext_h #include "../ReplayMemory/MiniBatch.h" #include "Network.h" #include "../Core/Agent.h" namespace smarties { enum ADDED_INPUT {NONE, NETWORK, ACTION, VECTOR}; struct ThreadContext { const Uint threadID; const Uint nAddedSamples; const bool bHaveTargetW; const Sint targetWeightIndex; const Uint allSamplCnt = 1 + nAddedSamples + bHaveTargetW; //vector over evaluations (eg. target/current or many samples) and over time: std::vector<std::vector<std::unique_ptr<Activation>>> activations; std::vector<ADDED_INPUT> _addedInputType; std::vector<std::vector<NNvec>> _addedInputVec; std::shared_ptr<Parameters> partialGradient; std::vector<Sint> lastGradTstep = std::vector<Sint>(allSamplCnt, -1); std::vector<Sint> weightIndex = std::vector<Sint>(allSamplCnt, 0); const MiniBatch * batch; Uint batchIndex; ThreadContext(const Uint thrID, const std::shared_ptr<Parameters> grad, const Uint nAdded, const bool bHasTargetWeights, const Sint tgtWeightsID) : threadID(thrID), nAddedSamples(nAdded), bHaveTargetW(bHasTargetWeights), targetWeightIndex(tgtWeightsID), partialGradient(grad) { activations.resize(allSamplCnt); _addedInputVec.resize(allSamplCnt); for(Uint i=0; i < allSamplCnt; ++i) { activations[i].reserve(MAX_SEQ_LEN); _addedInputVec[i].reserve(MAX_SEQ_LEN); } _addedInputType.resize(allSamplCnt, NONE); } void setAddedInputType(const ADDED_INPUT type, const Sint sample = 0) { addedInputType(sample) = type; } template<typename T> void setAddedInput(const std::vector<T>& addedInput, const Uint t, Sint sample = 0) { addedInputType(sample) = VECTOR; addedInputVec(sample) = NNvec(addedInput.begin(), addedInput.end()); } void load(const std::shared_ptr<Network> NET, const MiniBatch & B, const Uint batchID, const Uint weightID) { batch = & B; batchIndex = batchID; lastGradTstep = std::vector<Sint>(allSamplCnt, -1); weightIndex = std::vector<Sint>(allSamplCnt, weightID); if(bHaveTargetW) weightIndex.back() = targetWeightIndex; for(Uint i=0; i < allSamplCnt; ++i) NET->allocTimeSeries(activations[i], batch->sampledNumSteps(batchIndex)); } void overwrite(const Sint t, const Sint sample) const { if(sample<0) target(t)->written = false; else activation(t, sample)->written = false; // what about backprop? } Sint& endBackPropStep(const Sint sample = 0) { assert(sample<0 || lastGradTstep.size() > (Uint) sample); if(sample<0) return lastGradTstep.back(); else return lastGradTstep[sample]; } Sint& usedWeightID(const Sint sample = 0) { assert(sample<0 || weightIndex.size() > (Uint) sample); if(sample<0) return weightIndex.back(); else return weightIndex[sample]; } ADDED_INPUT& addedInputType(const Sint sample = 0) { assert(sample<0 || _addedInputType.size() > (Uint) sample); if(sample<0) return _addedInputType.back(); else return _addedInputType[sample]; } NNvec& addedInputVec(const Sint t, const Sint sample = 0) { assert(sample<0 || _addedInputVec.size() > (Uint) sample); if(sample<0) return _addedInputVec.back()[ mapTime2Ind(t) ]; else return _addedInputVec[sample][ mapTime2Ind(t) ]; } const Sint& endBackPropStep(const Sint sample = 0) const { assert(sample<0 || lastGradTstep.size() > (Uint) sample); if(sample<0) return lastGradTstep.back(); else return lastGradTstep[sample]; } const Sint& usedWeightID(const Sint sample = 0) const { assert(sample<0 || weightIndex.size() > (Uint) sample); if(sample<0) return weightIndex.back(); else return weightIndex[sample]; } const ADDED_INPUT& addedInputType(const Sint sample = 0) const { assert(sample<0 || _addedInputType.size() > (Uint) sample); if(sample<0) return _addedInputType.back(); else return _addedInputType[sample]; } const NNvec& addedInputVec(const Sint t, const Sint sample = 0) const { assert(sample<0 || _addedInputVec.size() > (Uint) sample); if(sample<0) return _addedInputVec.back()[ mapTime2Ind(t) ]; else return _addedInputVec[sample][ mapTime2Ind(t) ]; } Activation* activation(const Sint t, const Sint sample) const { assert(sample<0 || activations.size() > (Uint) sample); const auto& timeSeries = sample<0? activations.back() : activations[sample]; assert( timeSeries.size() > (Uint) mapTime2Ind(t) ); return timeSeries[ mapTime2Ind(t) ].get(); } Activation* target(const Sint t) const { assert(bHaveTargetW); return activation(t, -1); } Sint mapTime2Ind(const Sint t) const { assert(batch not_eq nullptr); return batch->mapTime2Ind(batchIndex, t); } Sint mapInd2Time(const Sint k) const { assert(batch not_eq nullptr); return batch->mapInd2Time(batchIndex, k); } const NNvec& getState(const Sint t) const { assert(batch not_eq nullptr); return batch->state(batchIndex, t); } const Rvec& getAction(const Sint t) const { assert(batch not_eq nullptr); return batch->action(batchIndex, t); } }; struct AgentContext { static constexpr Uint nAddedSamples = 0; const Uint agentID; const MiniBatch* batch; const Agent* agent; //vector over time: std::vector<std::unique_ptr<Activation>> activations; //std::shared_ptr<Parameters>> partialGradient; ADDED_INPUT _addedInputType = NONE; NNvec _addedInputVec; Sint lastGradTstep; Sint weightIndex; AgentContext(const Uint aID) : agentID(aID) { activations.reserve(MAX_SEQ_LEN); } void setAddedInputType(const ADDED_INPUT type, const Sint sample = 0) { if(type == ACTION) { _addedInputType = VECTOR; _addedInputVec = NNvec(agent->action.begin(), agent->action.end()); } else _addedInputType = type; } template<typename T> void setAddedInput(const std::vector<T>& addedInput, const Uint t, Sint sample = 0) { assert(addedInput.size()); _addedInputType = VECTOR; _addedInputVec = NNvec(addedInput.begin(), addedInput.end()); } void load(const std::shared_ptr<Network> NET, const MiniBatch& B, const Agent& A, const Uint weightID) { batch = & B; agent = & A; assert(A.ID == agentID); lastGradTstep = -1; weightIndex = weightID; NET->allocTimeSeries(activations, batch->sampledNumSteps(0)); } void overwrite(const Sint t, const Sint sample = -1) const { activation(t)->written = false; // what about backprop? } Sint& endBackPropStep(const Sint sample =-1) { return lastGradTstep; } Sint& usedWeightID(const Sint sample =-1) { return weightIndex; } ADDED_INPUT& addedInputType(const Sint sample =-1) { return _addedInputType; } NNvec& addedInputVec(const Sint t, const Sint sample = -1) { assert(t+1 == (Sint) episode()->nsteps()); return _addedInputVec; } const Sint& endBackPropStep(const Sint sample =-1) const { return lastGradTstep; } const Sint& usedWeightID(const Sint sample =-1) const { return weightIndex; } const ADDED_INPUT& addedInputType(const Sint sample =-1) const { return _addedInputType; } const NNvec& addedInputVec(const Sint t, const Sint sample = -1) const { assert(t+1 == (Sint) episode()->nsteps()); return _addedInputVec; } Activation* activation(const Sint t, const Sint sample = -1) const { return activations[ mapTime2Ind(t) ].get(); } Sint mapTime2Ind(const Sint t) const { assert(batch not_eq nullptr); return batch->mapTime2Ind(0, t); } Sint mapInd2Time(const Sint k) const { assert(batch not_eq nullptr); return batch->mapInd2Time(0, k); } const NNvec& getState(const Sint t) const { assert(batch not_eq nullptr); return batch->state(0, t); } const Rvec& getAction(const Sint t) const { assert(batch not_eq nullptr); return batch->action(0, t); } const Episode* episode() const { assert(batch not_eq nullptr); assert(batch->episodes.size() == 1 && batch->episodes[0] not_eq nullptr); return batch->episodes[0]; } }; } // end namespace smarties #endif // smarties_Quadratic_term_h
30.105634
80
0.676608
[ "vector" ]
17452a3ac54bd56646e8ef7bc780017487756f7f
3,725
h
C
src/scan1coef_hk.h
gatarelib/qtl2
4aba67a3a43ca16888c18f913934098bb28895c0
[ "RSA-MD" ]
null
null
null
src/scan1coef_hk.h
gatarelib/qtl2
4aba67a3a43ca16888c18f913934098bb28895c0
[ "RSA-MD" ]
null
null
null
src/scan1coef_hk.h
gatarelib/qtl2
4aba67a3a43ca16888c18f913934098bb28895c0
[ "RSA-MD" ]
null
null
null
// scan chromosome by Haley-Knott regression just to get coefficients #ifndef SCAN1COEF_HK_H #define SCAN1COEF_HK_H #include <Rcpp.h> // Scan a single chromosome to calculate coefficients, with additive covariates // // genoprobs = 3d array of genotype probabilities (individuals x genotypes x positions) // pheno = vector of numeric phenotypes (individuals x 1) // (no missing data allowed) // addcovar = additive covariates // weights = vector of weights (really the SQUARE ROOT of the weights) // // output = matrix of coefficients (genotypes x positions) Rcpp::NumericMatrix scancoef_hk_addcovar(const Rcpp::NumericVector& genoprobs, const Rcpp::NumericVector& pheno, const Rcpp::NumericMatrix& addcovar, const Rcpp::NumericVector& weights, const double tol); // Scan a single chromosome to calculate coefficients, with interactive covariates // // genoprobs = 3d array of genotype probabilities (individuals x genotypes x positions) // pheno = vector of numeric phenotypes (individuals x 1) // (no missing data allowed) // addcovar = additive covariates // intcovar = interactive covariates (should also be included in addcovar) // weights = vector of weights (really the SQUARE ROOT of the weights) // // output = matrix of coefficients (genotypes x positions) Rcpp::NumericMatrix scancoef_hk_intcovar(const Rcpp::NumericVector& genoprobs, const Rcpp::NumericVector& pheno, const Rcpp::NumericMatrix& addcovar, const Rcpp::NumericMatrix& intcovar, const Rcpp::NumericVector& weights, const double tol); // Scan a single chromosome to calculate coefficients, with additive covariates // // genoprobs = 3d array of genotype probabilities (individuals x genotypes x positions) // pheno = vector of numeric phenotypes (individuals x 1) // (no missing data allowed) // addcovar = additive covariates // weights = vector of weights (really the SQUARE ROOT of the weights) // // output = list of two matrices, of coefficients and SEs (each genotypes x positions) Rcpp::List scancoefSE_hk_addcovar(const Rcpp::NumericVector& genoprobs, const Rcpp::NumericVector& pheno, const Rcpp::NumericMatrix& addcovar, const Rcpp::NumericVector& weights, const double tol); // Scan a single chromosome to calculate coefficients, with interactive covariates // // genoprobs = 3d array of genotype probabilities (individuals x genotypes x positions) // pheno = vector of numeric phenotypes (individuals x 1) // (no missing data allowed) // addcovar = additive covariates // intcovar = interactive covariates (should also be included in addcovar) // weights = vector of weights (really the SQUARE ROOT of the weights) // // output = list of two matrices, of coefficients and SEs (each genotypes x positions) Rcpp::List scancoefSE_hk_intcovar(const Rcpp::NumericVector& genoprobs, const Rcpp::NumericVector& pheno, const Rcpp::NumericMatrix& addcovar, const Rcpp::NumericMatrix& intcovar, const Rcpp::NumericVector& weights, const double tol); #endif // SCAN1COEF_HK_H
49.666667
89
0.618523
[ "vector", "3d" ]
174b5b7e46a7c95a935ef9df30f8e7b9f35a874c
1,882
h
C
extensions/test/internal_extension_browsertest.h
takethathe/crosswalk
77e1a886f1215b75da9bd13f97afd7959b4f419b
[ "BSD-3-Clause" ]
1
2019-01-16T06:49:51.000Z
2019-01-16T06:49:51.000Z
extensions/test/internal_extension_browsertest.h
hmin/crosswalk
489dcd0f4403a97dcf022c71956fe6ce6c7ae6a7
[ "BSD-3-Clause" ]
null
null
null
extensions/test/internal_extension_browsertest.h
hmin/crosswalk
489dcd0f4403a97dcf022c71956fe6ce6c7ae6a7
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef XWALK_EXTENSIONS_TEST_INTERNAL_EXTENSION_BROWSERTEST_H_ #define XWALK_EXTENSIONS_TEST_INTERNAL_EXTENSION_BROWSERTEST_H_ #include <utility> #include <string> #include <vector> #include "xwalk/extensions/browser/xwalk_extension_internal.h" class TestExtension : public xwalk::extensions::XWalkInternalExtension { public: TestExtension(); virtual const char* GetJavaScriptAPI() OVERRIDE; virtual xwalk::extensions::XWalkExtensionInstance* CreateInstance( const XWalkExtension::PostMessageCallback& post_message) OVERRIDE; }; class TestExtensionInstance : public xwalk::extensions::XWalkInternalExtensionInstance { public: typedef std::vector<std::pair<std::string, int> > Database; TestExtensionInstance( const xwalk::extensions::XWalkExtension::PostMessageCallback& post_message); Database* database() { return &database_; } private: void OnClearDatabase(const std::string& function_name, const std::string& callback_id, base::ListValue* args); void OnAddPerson(const std::string& function_name, const std::string& callback_id, base::ListValue* args); void OnAddPersonObject(const std::string& function_name, const std::string& callback_id, base::ListValue* args); void OnGetAllPersons(const std::string& function_name, const std::string& callback_id, base::ListValue* args); void OnGetPersonAge(const std::string& function_name, const std::string& callback_id, base::ListValue* args); std::vector<std::pair<std::string, int> > database_; }; #endif // XWALK_EXTENSIONS_TEST_INTERNAL_EXTENSION_BROWSERTEST_H_
36.901961
78
0.722635
[ "vector" ]