/* * stanza.h * * Copyright (C) 2012 - 2019 James Booth * Copyright (C) 2019 - 2021 Michael Vetter * * This file is part of Profanity. * * Profanity is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Profanity 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Profanity. If not, see . * * In addition, as a special exception, the copyright holders give permission to * link the code of portions of this program with the OpenSSL library under * certain conditions as described in each individual source file, and * distribute linked combinations including the two. * * You must obey the GNU General Public License in all respects for all of the * code used other than OpenSSL. If you modify file(s) with this exception, you * may extend this exception to your version of the file(s), but you are not * obligated to do so. If you do not wish to do so, delete this exception * statement from your version. If you delete this exception statement from all * source files in the program, then also delete it here. * */ #ifndef XMPP_STANZA_H #define XMPP_STANZA_H #include "config.h" #ifdef HAVE_LIBMESODE #include #endif #ifdef HAVE_LIBSTROPHE #include #endif #include #define STANZA_NAME_ACTIVE "active" #define STANZA_NAME_INACTIVE "inactive" #define STANZA_NAME_COMPOSING "composing" #define STANZA_NAME_PAUSED "paused" #define STANZA_NAME_GONE "gone" #define STANZA_NAME_MESSAGE "message" #define STANZA_NAME_BODY "body" #define STANZA_NAME_BLOCK "block" #define STANZA_NAME_UNBLOCK "unblock" #define STANZA_NAME_BLOCKLIST "blocklist" #define STANZA_NAME_PRESENCE "presence" #define STANZA_NAME_PRIORITY "priority" #define STANZA_NAME_X "x" // XEP-0373: OpenPGP for XMPP #define STANZA_NAME_OPENPGP "openpgp" #define STANZA_NAME_PUPKEY "pubkey" #define STANZA_NAME_PUBLIC_KEYS_LIST "public-keys-list" #define STANZA_NAME_PUBKEY_METADATA "pubkey-metadata" #define STANZA_NAME_DATA "data" #define STANZA_NAME_SHOW "show" #define STANZA_NAME_STATUS "status" #define STANZA_NAME_IQ "iq" #define STANZA_NAME_QUERY "query" #define STANZA_NAME_REQUEST "request" #define STANZA_NAME_DELAY "delay" #define STANZA_NAME_ERROR "error" #define STANZA_NAME_PING "ping" #define STANZA_NAME_TEXT "text" #define STANZA_NAME_SUBJECT "subject" #define STANZA_NAME_ITEM "item" #define STANZA_NAME_ITEMS "items" #define STANZA_NAME_C "c" #define STANZA_NAME_IDENTITY "identity" #define STANZA_NAME_FEATURE "feature" #define STANZA_NAME_INVITE "invite" #define STANZA_NAME_REASON "reason" #define STANZA_NAME_GROUP "group" #define STANZA_NAME_PUBSUB "pubsub" #define STANZA_NAME_PUBLISH "publish" #define STANZA_NAME_PUBLISH_OPTIONS "publish-options" #define STANZA_NAME_SUBSCRIBE "subscribe" #define STANZA_NAME_FIELD "field" #define STANZA_NAME_STORAGE "storage" #define STANZA_NAME_NICK "nick" #define STANZA_NAME_PASSWORD "password" #define STANZA_NAME_CONFERENCE "conference" #define STANZA_NAME_VALUE "value" #define STANZA_NAME_DESTROY "destroy" #define STANZA_NAME_ACTOR "actor" #define STANZA_NAME_ENABLE "enable" #define STANZA_NAME_DISABLE "disable" #define STANZA_NAME_FILENAME "filename" #define STANZA_NAME_SIZE "size" #define STANZA_NAME_CONTENT_TYPE "content-type" #define STANZA_NAME_SLOT "slot" #define STANZA_NAME_PUT "put" #define STANZA_NAME_GET "get" #define STANZA_NAME_HEADER "header" #define STANZA_HEADER_AUTHORIZATION "Authorization" #define STANZA_HEADER_COOKIE "Cookie" #define STANZA_HEADER_EXPIRES "Expires" #define STANZA_NAME_URL "url" #define STANZA_NAME_COMMAND "command" #define STANZA_NAME_CONFIGURE "configure" #define STANZA_NAME_ORIGIN_ID "origin-id" #define STANZA_NAME_STANZA_ID "stanza-id" #define STANZA_NAME_RESULT "result" #define STANZA_NAME_MINIMIZE "minimize" #define STANZA_NAME_FIN "fin" #define STANZA_NAME_LAST "last" #define STANZA_NAME_AFTER "after" #define STANZA_NAME_USERNAME "username" #define STANZA_NAME_PROPOSE "propose" #define STANZA_NAME_REPORT "report" // error conditions #define STANZA_NAME_BAD_REQUEST "bad-request" #define STANZA_NAME_CONFLICT "conflict" #define STANZA_NAME_FEATURE_NOT_IMPLEMENTED "feature-not-implemented" #define STANZA_NAME_FORBIDDEN "forbidden" #define STANZA_NAME_GONE "gone" #define STANZA_NAME_INTERNAL_SERVER_ERROR "internal-server-error" #define STANZA_NAME_ITEM_NOT_FOUND "item-not-found" #define STANZA_NAME_JID_MALFORMED "jid-malformed" #define STANZA_NAME_NOT_ACCEPTABLE "not-acceptable" #define STANZA_NAME_NOT_ALLOWED "not-allowed" #define STANZA_NAME_NOT_AUTHORISED "not-authorised" #define STANZA_NAME_POLICY_VIOLATION "policy-violation" #define STANZA_NAME_RECIPIENT_UNAVAILABLE "recipient-unavailable" #define STANZA_NAME_REDIRECT "redirect" #define STANZA_NAME_REGISTRATION_REQUIRED "registration-required" #define STANZA_NAME_REMOTE_SERVER_NOT_FOUND "remote-server-not-found" #define STANZA_NAME_REMOTE_SERVER_TIMEOUT "remote-server-timeout" #define STANZA_NAME_RESOURCE_CONSTRAINT "resource-constraint" #define STANZA_NAME_SERVICE_UNAVAILABLE "service-unavailable" #define STANZA_NAME_SUBSCRIPTION_REQUIRED "subscription-required" #define STANZA_NAME_UNDEFINED_CONDITION "undefined-condition" #define STANZA_NAME_UNEXPECTED_REQUEST "unexpected-request" #define STANZA_TYPE_CHAT "chat" #define STANZA_TYPE_GROUPCHAT "groupchat" #define STANZA_TYPE_HEADLINE "headline" #define STANZA_TYPE_NORMAL "normal" #define STANZA_TYPE_UNAVAILABLE "unavailable" #define STANZA_TYPE_SUBSCRIBE "subscribe" #define STANZA_TYPE_SUBSCRIBED "subscribed" #define STANZA_TYPE_UNSUBSCRIBED "unsubscribed" #define STANZA_TYPE_GET "get" #define STANZA_TYPE_SET "set" #define STANZA_TYPE_ERROR "error" #define STANZA_TYPE_RESULT "result" #define STANZA_TYPE_SUBMIT "submit" #define STANZA_TYPE_CANCEL "cancel" #define STANZA_TYPE_MODIFY "modify" #defi
#ifndef SYSCALLTABLE_H
#define SYSCALLTABLE_H

//This file will also be included by C library.
enum {
    SYS_open,  // 0
    SYS_close,  // 1
    SYS_read,  // 2
    SYS_write,  // 3
    SYS_lseek,  // 4
    SYS_stat,  // 5
    SYS_fstat,  // 6
    SYS_ioctl,  // 7
    SYS_exit,  // 8
    SYS_sbrk,  // 9
    SYS_fork,  // 10
    SYS_getpid,  // 11

    //non-posix
    SYS_execute,  // 12
    SYS_execve,  // 13
    SYS_wait,  // 14
    SYS_kill,  // 15
    SYS_mount,  // 16
    SYS_unmount,  // 17
    SYS_mkdir,  // 18
    SYS_rmdir,  // 19
    SYS_getdents,  // 20
    SYS_getWorkingDirectory,  // 21
    SYS_setWorkingDirectory,  // 22
    SYS_managePipe,  // 23
    SYS_readDir,  // 24
    SYS_getUptimeMilliseconds,  // 25
    SYS_sleepMilliseconds,  // 26
    SYS_executeOnTTY,  // 27
    SYS_manageMessage,  // 28
    SYS_UNUSED,  // 29

    SYS_mmap,  // 30
    SYS_munmap,  // 31
    SYS_shm_open,  // 32
    SYS_shm_unlink,  // 33
    SYS_ftruncate,  // 34
    SYS_posix_openpt,  // 35
    SYS_ptsname_r,  // 36

    SYSCALL_COUNT  // 37
};

#endif // SYSCALLTABLE_H
mpp_ctx_t* const ctx, xmpp_stanza_t* const presence, const int pri); void stanza_attach_last_activity(xmpp_ctx_t* const ctx, xmpp_stanza_t* const presence, const int idle); void stanza_attach_caps(xmpp_ctx_t* const ctx, xmpp_stanza_t* const presence); void stanza_attach_show(xmpp_ctx_t* const ctx, xmpp_stanza_t* const presence, const char* const show); void stanza_attach_status(xmpp_ctx_t* const ctx, xmpp_stanza_t* const presence, const char* const status); xmpp_stanza_t* stanza_create_caps_query_element(xmpp_ctx_t* ctx); char* stanza_create_caps_sha1_from_query(xmpp_stanza_t* const query); EntityCapabilities* stanza_create_caps_from_query_element(xmpp_stanza_t* query); const char* stanza_get_presence_string_from_type(resource_presence_t presence_type); xmpp_stanza_t* stanza_create_software_version_iq(xmpp_ctx_t* ctx, const char* const fulljid); xmpp_stanza_t* stanza_create_disco_items_iq(xmpp_ctx_t* ctx, const char* const id, const char* const jid, const char* const node); char* stanza_get_status(xmpp_stanza_t* stanza, char* def); char* stanza_get_show(xmpp_stanza_t* stanza, char* def); xmpp_stanza_t* stanza_create_roster_set(xmpp_ctx_t* ctx, const char* const id, const char* const jid, const char* const handle, GSList* groups); xmpp_stanza_t* stanza_create_roster_remove_set(xmpp_ctx_t* ctx, const char* const barejid); char* stanza_get_error_message(xmpp_stanza_t* const stanza); GSList* stanza_get_status_codes_by_ns(xmpp_stanza_t* const stanza, char* ns); gboolean stanza_room_destroyed(xmpp_stanza_t* stanza); const char* stanza_get_muc_destroy_alternative_room(xmpp_stanza_t* stanza); char* stanza_get_muc_destroy_alternative_password(xmpp_stanza_t* stanza); char* stanza_get_muc_destroy_reason(xmpp_stanza_t* stanza); const char* stanza_get_actor(xmpp_stanza_t* stanza); char* stanza_get_reason(xmpp_stanza_t* stanza); GHashTable* stanza_get_service_contact_addresses(xmpp_ctx_t* ctx, xmpp_stanza_t* stanza); Resource* stanza_resource_from_presence(XMPPPresence* presence); XMPPPresence* stanza_parse_presence(xmpp_stanza_t* stanza, int* err); void stanza_free_presence(XMPPPresence* presence); char* stanza_text_strdup(xmpp_stanza_t* stanza); XMPPCaps* stanza_parse_caps(xmpp_stanza_t* const stanza); void stanza_free_caps(XMPPCaps* caps); xmpp_stanza_t* stanza_create_avatar_retrieve_data_request(xmpp_ctx_t* ctx, const char* stanza_id, const char* const item_id, const char* const jid); xmpp_stanza_t* stanza_create_mam_iq(xmpp_ctx_t* ctx, const char* const jid, const char* const startdate, const char* const lastid); xmpp_stanza_t* stanza_change_password(xmpp_ctx_t* ctx, const char* const user, const char* const password); xmpp_stanza_t* stanza_request_voice(xmpp_ctx_t* ctx, const char* const room); xmpp_stanza_t* stanza_create_approve_voice(xmpp_ctx_t* ctx, const char* const id, const char* const jid, const char* const node, DataForm* form); xmpp_stanza_t* stanza_create_muc_register_nick(xmpp_ctx_t* ctx, const char* const id, const char* const jid, const char* const node, DataForm* form); #endif