From e109c0037d1eb1941b2d1988518937d61df05ac0 Mon Sep 17 00:00:00 2001 From: lotodore Date: Sat, 16 Jul 2011 14:52:45 +0000 Subject: [PATCH] Preparing network protocol for rejoin. --- docs/pokerth.asn1 | 32 +- pokerth_protocol.pro | 8 + src/net/common/clientstate.cpp | 10 +- src/net/common/servergamestate.cpp | 4 +- src/third_party/asn1/AfkWarningMessage.c | 10 +- src/third_party/asn1/AfkWarningMessage.h | 26 +- .../asn1/AfterHandShowCardsMessage.c | 10 +- .../asn1/AfterHandShowCardsMessage.h | 26 +- src/third_party/asn1/AllInShowCardsMessage.c | 40 +- src/third_party/asn1/AllInShowCardsMessage.h | 38 +- src/third_party/asn1/AnnounceMessage.c | 90 +-- src/third_party/asn1/AnnounceMessage.h | 49 +- src/third_party/asn1/AskKickDeniedMessage.c | 46 +- src/third_party/asn1/AskKickDeniedMessage.h | 49 +- src/third_party/asn1/AskKickPlayerMessage.c | 16 +- src/third_party/asn1/AskKickPlayerMessage.h | 28 +- src/third_party/asn1/AuthClientResponse.c | 26 +- src/third_party/asn1/AuthClientResponse.h | 26 +- src/third_party/asn1/AuthMessage.c | 22 +- src/third_party/asn1/AuthMessage.h | 55 +- src/third_party/asn1/AuthServerChallenge.c | 26 +- src/third_party/asn1/AuthServerChallenge.h | 26 +- src/third_party/asn1/AuthServerVerification.c | 26 +- src/third_party/asn1/AuthServerVerification.h | 26 +- src/third_party/asn1/AuthenticatedLogin.c | 32 +- src/third_party/asn1/AuthenticatedLogin.h | 28 +- src/third_party/asn1/AvatarData.c | 26 +- src/third_party/asn1/AvatarData.h | 26 +- src/third_party/asn1/AvatarEnd.c | 4 +- src/third_party/asn1/AvatarEnd.h | 24 +- src/third_party/asn1/AvatarHash.c | 36 +- src/third_party/asn1/AvatarHash.h | 22 +- src/third_party/asn1/AvatarHeader.c | 32 +- src/third_party/asn1/AvatarHeader.h | 28 +- src/third_party/asn1/AvatarReplyMessage.c | 46 +- src/third_party/asn1/AvatarReplyMessage.h | 75 +- src/third_party/asn1/AvatarRequestMessage.c | 16 +- src/third_party/asn1/AvatarRequestMessage.h | 28 +- src/third_party/asn1/BIT_STRING.c | 24 +- src/third_party/asn1/BIT_STRING.h | 20 +- src/third_party/asn1/BOOLEAN.c | 54 +- src/third_party/asn1/BOOLEAN.h | 30 +- src/third_party/asn1/Card.c | 36 +- src/third_party/asn1/Card.h | 22 +- src/third_party/asn1/ChatCleanerMessage.c | 24 +- src/third_party/asn1/ChatCleanerMessage.h | 59 +- src/third_party/asn1/ChatMessage.c | 74 +- src/third_party/asn1/ChatMessage.h | 79 +- src/third_party/asn1/ChatRejectMessage.c | 30 +- src/third_party/asn1/ChatRejectMessage.h | 26 +- src/third_party/asn1/ChatRequestMessage.c | 58 +- src/third_party/asn1/ChatRequestMessage.h | 71 +- src/third_party/asn1/ChatRequestTypeGame.c | 10 +- src/third_party/asn1/ChatRequestTypeGame.h | 26 +- src/third_party/asn1/ChatRequestTypeLobby.c | 4 +- src/third_party/asn1/ChatRequestTypeLobby.h | 24 +- src/third_party/asn1/ChatRequestTypePrivate.c | 10 +- src/third_party/asn1/ChatRequestTypePrivate.h | 26 +- src/third_party/asn1/ChatTypeBot.c | 4 +- src/third_party/asn1/ChatTypeBot.h | 24 +- src/third_party/asn1/ChatTypeBroadcast.c | 4 +- src/third_party/asn1/ChatTypeBroadcast.h | 24 +- src/third_party/asn1/ChatTypeGame.c | 16 +- src/third_party/asn1/ChatTypeGame.h | 28 +- src/third_party/asn1/ChatTypeLobby.c | 10 +- src/third_party/asn1/ChatTypeLobby.h | 26 +- src/third_party/asn1/ChatTypePrivate.c | 10 +- src/third_party/asn1/ChatTypePrivate.h | 26 +- .../asn1/CleanerChatReplyMessage.c | 188 ++--- .../asn1/CleanerChatReplyMessage.h | 55 +- .../asn1/CleanerChatRequestMessage.c | 184 ++--- .../asn1/CleanerChatRequestMessage.h | 38 +- src/third_party/asn1/CleanerChatType.c | 12 +- src/third_party/asn1/CleanerChatType.h | 51 +- src/third_party/asn1/CleanerChatTypeGame.c | 64 +- src/third_party/asn1/CleanerChatTypeGame.h | 28 +- src/third_party/asn1/CleanerChatTypeLobby.c | 4 +- src/third_party/asn1/CleanerChatTypeLobby.h | 24 +- src/third_party/asn1/CleanerInitAckMessage.c | 52 +- src/third_party/asn1/CleanerInitAckMessage.h | 28 +- src/third_party/asn1/CleanerInitMessage.c | 52 +- src/third_party/asn1/CleanerInitMessage.h | 28 +- src/third_party/asn1/DealFlopCardsMessage.c | 28 +- src/third_party/asn1/DealFlopCardsMessage.h | 32 +- src/third_party/asn1/DealRiverCardMessage.c | 16 +- src/third_party/asn1/DealRiverCardMessage.h | 28 +- src/third_party/asn1/DealTurnCardMessage.c | 16 +- src/third_party/asn1/DealTurnCardMessage.h | 28 +- src/third_party/asn1/DialogMessage.c | 30 +- src/third_party/asn1/DialogMessage.h | 26 +- src/third_party/asn1/EncryptedCards.c | 26 +- src/third_party/asn1/EncryptedCards.h | 26 +- src/third_party/asn1/EndKickPetitionMessage.c | 96 +-- src/third_party/asn1/EndKickPetitionMessage.h | 53 +- src/third_party/asn1/EndOfGameMessage.c | 16 +- src/third_party/asn1/EndOfGameMessage.h | 28 +- src/third_party/asn1/EndOfHandHideCards.c | 54 +- src/third_party/asn1/EndOfHandHideCards.h | 30 +- src/third_party/asn1/EndOfHandMessage.c | 30 +- src/third_party/asn1/EndOfHandMessage.h | 67 +- src/third_party/asn1/EndOfHandShowCards.c | 34 +- src/third_party/asn1/EndOfHandShowCards.h | 36 +- src/third_party/asn1/ErrorMessage.c | 34 +- src/third_party/asn1/ErrorMessage.h | 65 +- src/third_party/asn1/GameAdminChanged.c | 10 +- src/third_party/asn1/GameAdminChanged.h | 26 +- src/third_party/asn1/GameListAdminChanged.c | 10 +- src/third_party/asn1/GameListAdminChanged.h | 26 +- src/third_party/asn1/GameListMessage.c | 54 +- src/third_party/asn1/GameListMessage.h | 79 +- src/third_party/asn1/GameListNew.c | 58 +- src/third_party/asn1/GameListNew.h | 40 +- src/third_party/asn1/GameListPlayerJoined.c | 10 +- src/third_party/asn1/GameListPlayerJoined.h | 26 +- src/third_party/asn1/GameListPlayerLeft.c | 10 +- src/third_party/asn1/GameListPlayerLeft.h | 26 +- src/third_party/asn1/GameListUpdate.c | 10 +- src/third_party/asn1/GameListUpdate.h | 26 +- src/third_party/asn1/GamePlayerJoined.c | 16 +- src/third_party/asn1/GamePlayerJoined.h | 28 +- src/third_party/asn1/GamePlayerLeft.c | 40 +- src/third_party/asn1/GamePlayerLeft.h | 43 +- src/third_party/asn1/GamePlayerMessage.c | 46 +- src/third_party/asn1/GamePlayerMessage.h | 75 +- src/third_party/asn1/GameStartMessage.c | 138 ++-- src/third_party/asn1/GameStartMessage.h | 59 +- src/third_party/asn1/GameStartModeInitial.c | 129 +++ src/third_party/asn1/GameStartModeInitial.h | 49 ++ src/third_party/asn1/GameStartModeRejoin.c | 129 +++ src/third_party/asn1/GameStartModeRejoin.h | 54 ++ src/third_party/asn1/GuestLogin.c | 30 +- src/third_party/asn1/GuestLogin.h | 26 +- src/third_party/asn1/Guid.c | 36 +- src/third_party/asn1/Guid.h | 22 +- src/third_party/asn1/HandStartMessage.c | 52 +- src/third_party/asn1/HandStartMessage.h | 69 +- src/third_party/asn1/INTEGER.c | 199 +++-- src/third_party/asn1/INTEGER.h | 84 +- src/third_party/asn1/Id.c | 34 +- src/third_party/asn1/Id.h | 22 +- src/third_party/asn1/InitAckMessage.c | 40 +- src/third_party/asn1/InitAckMessage.h | 31 +- src/third_party/asn1/InitMessage.c | 78 +- src/third_party/asn1/InitMessage.h | 75 +- src/third_party/asn1/InviteNotifyMessage.c | 22 +- src/third_party/asn1/InviteNotifyMessage.h | 30 +- .../asn1/InvitePlayerToGameMessage.c | 16 +- .../asn1/InvitePlayerToGameMessage.h | 28 +- src/third_party/asn1/JoinExistingGame.c | 10 +- src/third_party/asn1/JoinExistingGame.h | 26 +- src/third_party/asn1/JoinGameAck.c | 16 +- src/third_party/asn1/JoinGameAck.h | 28 +- src/third_party/asn1/JoinGameFailed.c | 42 +- src/third_party/asn1/JoinGameFailed.h | 56 +- src/third_party/asn1/JoinGameReplyMessage.c | 30 +- src/third_party/asn1/JoinGameReplyMessage.h | 67 +- src/third_party/asn1/JoinGameRequestMessage.c | 75 +- src/third_party/asn1/JoinGameRequestMessage.h | 72 +- src/third_party/asn1/JoinNewGame.c | 10 +- src/third_party/asn1/JoinNewGame.h | 26 +- .../asn1/KickPetitionUpdateMessage.c | 82 +- .../asn1/KickPetitionUpdateMessage.h | 34 +- .../asn1/KickPlayerRequestMessage.c | 16 +- .../asn1/KickPlayerRequestMessage.h | 28 +- .../asn1/LeaveGameRequestMessage.c | 10 +- .../asn1/LeaveGameRequestMessage.h | 26 +- src/third_party/asn1/MyActionRequestMessage.c | 50 +- src/third_party/asn1/MyActionRequestMessage.h | 34 +- src/third_party/asn1/NativeEnumerated.c | 32 +- src/third_party/asn1/NativeEnumerated.h | 8 +- src/third_party/asn1/NativeInteger.c | 68 +- src/third_party/asn1/NativeInteger.h | 18 +- src/third_party/asn1/NetAvatarType.c | 24 +- src/third_party/asn1/NetAvatarType.h | 35 +- src/third_party/asn1/NetGameInfo.c | 342 ++++---- src/third_party/asn1/NetGameInfo.h | 123 +-- src/third_party/asn1/NetGameMode.c | 24 +- src/third_party/asn1/NetGameMode.h | 35 +- src/third_party/asn1/NetGameState.c | 24 +- src/third_party/asn1/NetGameState.h | 41 +- src/third_party/asn1/NetPlayerAction.c | 24 +- src/third_party/asn1/NetPlayerAction.h | 43 +- src/third_party/asn1/NonZeroId.c | 38 +- src/third_party/asn1/NonZeroId.h | 22 +- src/third_party/asn1/OCTET_STRING.c | 747 ++++++++++-------- src/third_party/asn1/OCTET_STRING.h | 112 +-- src/third_party/asn1/PlainCards.c | 16 +- src/third_party/asn1/PlainCards.h | 28 +- src/third_party/asn1/PlayerAllIn.c | 22 +- src/third_party/asn1/PlayerAllIn.h | 30 +- src/third_party/asn1/PlayerInfoData.c | 90 +-- src/third_party/asn1/PlayerInfoData.h | 42 +- src/third_party/asn1/PlayerInfoReplyMessage.c | 30 +- src/third_party/asn1/PlayerInfoReplyMessage.h | 67 +- .../asn1/PlayerInfoRequestMessage.c | 10 +- .../asn1/PlayerInfoRequestMessage.h | 26 +- src/third_party/asn1/PlayerInfoRights.c | 24 +- src/third_party/asn1/PlayerInfoRights.h | 35 +- src/third_party/asn1/PlayerListMessage.c | 40 +- src/third_party/asn1/PlayerListMessage.h | 41 +- src/third_party/asn1/PlayerResult.c | 102 +-- src/third_party/asn1/PlayerResult.h | 44 +- .../asn1/PlayersActionDoneMessage.c | 116 +-- .../asn1/PlayersActionDoneMessage.h | 40 +- src/third_party/asn1/PlayersTurnMessage.c | 22 +- src/third_party/asn1/PlayersTurnMessage.h | 30 +- src/third_party/asn1/PokerTHMessage.c | 324 ++++---- src/third_party/asn1/PokerTHMessage.h | 259 +++--- src/third_party/asn1/RejectGameInvReason.c | 24 +- src/third_party/asn1/RejectGameInvReason.h | 33 +- .../asn1/RejectGameInvitationMessage.c | 16 +- .../asn1/RejectGameInvitationMessage.h | 28 +- src/third_party/asn1/RejectInvNotifyMessage.c | 22 +- src/third_party/asn1/RejectInvNotifyMessage.h | 30 +- src/third_party/asn1/RejoinExistingGame.c | 59 ++ src/third_party/asn1/RejoinExistingGame.h | 42 + src/third_party/asn1/RejoinPlayerData.c | 94 +++ src/third_party/asn1/RejoinPlayerData.h | 44 ++ src/third_party/asn1/RemovedFromGame.c | 34 +- src/third_party/asn1/RemovedFromGame.h | 47 +- src/third_party/asn1/ReportAvatarAckMessage.c | 40 +- src/third_party/asn1/ReportAvatarAckMessage.h | 43 +- src/third_party/asn1/ReportAvatarMessage.c | 16 +- src/third_party/asn1/ReportAvatarMessage.h | 28 +- src/third_party/asn1/ResetTimeoutMessage.c | 4 +- src/third_party/asn1/ResetTimeoutMessage.h | 24 +- .../asn1/ShowMyCardsRequestMessage.c | 4 +- .../asn1/ShowMyCardsRequestMessage.h | 24 +- src/third_party/asn1/StartEventAckMessage.c | 10 +- src/third_party/asn1/StartEventAckMessage.h | 26 +- src/third_party/asn1/StartEventMessage.c | 16 +- src/third_party/asn1/StartEventMessage.h | 28 +- .../asn1/StartKickPetitionMessage.c | 72 +- .../asn1/StartKickPetitionMessage.h | 36 +- src/third_party/asn1/StatisticsData.c | 40 +- src/third_party/asn1/StatisticsData.h | 39 +- src/third_party/asn1/StatisticsMessage.c | 34 +- src/third_party/asn1/StatisticsMessage.h | 36 +- .../asn1/SubscriptionRequestMessage.c | 34 +- .../asn1/SubscriptionRequestMessage.h | 39 +- src/third_party/asn1/TimeoutWarningMessage.c | 40 +- src/third_party/asn1/TimeoutWarningMessage.h | 41 +- src/third_party/asn1/UTF8String.c | 58 +- src/third_party/asn1/UTF8String.h | 52 +- src/third_party/asn1/UnauthenticatedLogin.c | 36 +- src/third_party/asn1/UnauthenticatedLogin.h | 28 +- src/third_party/asn1/UnknownAvatar.c | 4 +- src/third_party/asn1/UnknownAvatar.h | 24 +- src/third_party/asn1/UnknownPlayerInfo.c | 4 +- src/third_party/asn1/UnknownPlayerInfo.h | 24 +- src/third_party/asn1/Version.c | 48 +- src/third_party/asn1/Version.h | 28 +- src/third_party/asn1/VoteKickAck.c | 4 +- src/third_party/asn1/VoteKickAck.h | 24 +- src/third_party/asn1/VoteKickDenied.c | 34 +- src/third_party/asn1/VoteKickDenied.h | 39 +- src/third_party/asn1/VoteKickReplyMessage.c | 36 +- src/third_party/asn1/VoteKickReplyMessage.h | 69 +- src/third_party/asn1/VoteKickRequestMessage.c | 22 +- src/third_party/asn1/VoteKickRequestMessage.h | 30 +- .../asn1/YourActionRejectedMessage.c | 74 +- .../asn1/YourActionRejectedMessage.h | 49 +- src/third_party/asn1/asn_SEQUENCE_OF.h | 42 +- src/third_party/asn1/asn_SET_OF.h | 56 +- src/third_party/asn1/asn_application.h | 42 +- src/third_party/asn1/asn_codecs.h | 118 +-- src/third_party/asn1/asn_codecs_prim.c | 52 +- src/third_party/asn1/asn_codecs_prim.h | 60 +- src/third_party/asn1/asn_internal.h | 58 +- src/third_party/asn1/ber_decoder.c | 102 +-- src/third_party/asn1/ber_decoder.h | 80 +- src/third_party/asn1/ber_tlv_length.c | 16 +- src/third_party/asn1/ber_tlv_length.h | 60 +- src/third_party/asn1/ber_tlv_tag.c | 20 +- src/third_party/asn1/ber_tlv_tag.h | 66 +- src/third_party/asn1/constr_CHOICE.c | 290 +++---- src/third_party/asn1/constr_CHOICE.h | 68 +- src/third_party/asn1/constr_SEQUENCE.c | 740 ++++++++--------- src/third_party/asn1/constr_SEQUENCE.h | 76 +- src/third_party/asn1/constr_SEQUENCE_OF.c | 42 +- src/third_party/asn1/constr_SEQUENCE_OF.h | 14 +- src/third_party/asn1/constr_SET_OF.c | 250 +++--- src/third_party/asn1/constr_SET_OF.h | 42 +- src/third_party/asn1/constr_TYPE.c | 6 +- src/third_party/asn1/constr_TYPE.h | 252 +++--- src/third_party/asn1/constraints.c | 8 +- src/third_party/asn1/constraints.h | 76 +- src/third_party/asn1/converter-sample.c | 655 +++++++-------- src/third_party/asn1/der_encoder.c | 52 +- src/third_party/asn1/der_encoder.h | 82 +- src/third_party/asn1/per_decoder.c | 8 +- src/third_party/asn1/per_decoder.h | 64 +- src/third_party/asn1/per_encoder.h | 90 +-- src/third_party/asn1/per_opentype.c | 67 +- src/third_party/asn1/per_opentype.h | 6 +- src/third_party/asn1/per_support.c | 80 +- src/third_party/asn1/per_support.h | 188 ++--- src/third_party/asn1/xer_decoder.c | 58 +- src/third_party/asn1/xer_decoder.h | 156 ++-- src/third_party/asn1/xer_encoder.c | 4 +- src/third_party/asn1/xer_encoder.h | 70 +- src/third_party/asn1/xer_support.c | 219 ++--- src/third_party/asn1/xer_support.h | 65 +- 303 files changed, 8477 insertions(+), 7528 deletions(-) create mode 100644 src/third_party/asn1/GameStartModeInitial.c create mode 100644 src/third_party/asn1/GameStartModeInitial.h create mode 100644 src/third_party/asn1/GameStartModeRejoin.c create mode 100644 src/third_party/asn1/GameStartModeRejoin.h create mode 100644 src/third_party/asn1/RejoinExistingGame.c create mode 100644 src/third_party/asn1/RejoinExistingGame.h create mode 100644 src/third_party/asn1/RejoinPlayerData.c create mode 100644 src/third_party/asn1/RejoinPlayerData.h diff --git a/docs/pokerth.asn1 b/docs/pokerth.asn1 index c9c7eb97..51554c39 100644 --- a/docs/pokerth.asn1 +++ b/docs/pokerth.asn1 @@ -96,6 +96,7 @@ AnnounceMessage ::= [APPLICATION 0] SEQUENCE { InitMessage ::= [APPLICATION 1] SEQUENCE { requestedVersion Version, buildId INTEGER, + myLastSessionId Guid, login CHOICE { guestLogin [0] GuestLogin, authenticatedLogin [1] AuthenticatedLogin, @@ -144,7 +145,8 @@ AuthServerVerification ::= SEQUENCE { InitAckMessage ::= [APPLICATION 3] SEQUENCE { yourSessionId Guid, yourPlayerId NonZeroId, - yourAvatar AvatarHash OPTIONAL + yourAvatar AvatarHash OPTIONAL, + rejoinGameId NonZeroId OPTIONAL } AvatarRequestMessage ::= [APPLICATION 4] SEQUENCE { @@ -279,7 +281,8 @@ SubscriptionRequestMessage ::= [APPLICATION 10] SEQUENCE { JoinGameRequestMessage ::= [APPLICATION 11] SEQUENCE { joinGameAction CHOICE { joinExistingGame [0] JoinExistingGame, - joinNewGame [1] JoinNewGame + joinNewGame [1] JoinNewGame, + rejoinExistingGame [2] RejoinExistingGame }, password UTF8String (SIZE(1..64)) OPTIONAL, autoLeave BOOLEAN @@ -293,6 +296,10 @@ JoinNewGame ::= SEQUENCE { gameInfo NetGameInfo } +RejoinExistingGame ::= SEQUENCE { + gameId NonZeroId +} + JoinGameReplyMessage ::= [APPLICATION 12] SEQUENCE { gameId NonZeroId, joinGameResult CHOICE { @@ -317,7 +324,8 @@ JoinGameFailed ::= SEQUENCE { gameNameInUse (7), badGameName (8), invalidSettings (9), - ipAddressBlocked (10) + ipAddressBlocked (10), + rejoinFailed (11) } } @@ -432,10 +440,26 @@ StartEventAckMessage ::= [APPLICATION 21] SEQUENCE { gameId NonZeroId } +RejoinPlayerData ::= SEQUENCE { + playerId NonZeroId, + playerMoney INTEGER(0..10000000) +} + +GameStartModeInitial ::= SEQUENCE { + playerSeats SEQUENCE SIZE(2..10) OF NonZeroId +} + +GameStartModeRejoin ::= SEQUENCE { + rejoinPlayerData SEQUENCE SIZE(2..10) OF RejoinPlayerData +} + GameStartMessage ::= [APPLICATION 22] SEQUENCE { gameId NonZeroId, startDealerPlayerId NonZeroId, - playerSeats SEQUENCE SIZE(2..10) OF NonZeroId + gameStartMode CHOICE { + gameStartModeInitial [0] GameStartModeInitial, + gameStartModeRejoin [1] GameStartModeRejoin + } } PlainCards ::= SEQUENCE { diff --git a/pokerth_protocol.pro b/pokerth_protocol.pro index 8b4b01e6..c3c4cdca 100644 --- a/pokerth_protocol.pro +++ b/pokerth_protocol.pro @@ -94,6 +94,8 @@ HEADERS += src/third_party/asn1/AllInShowCardsMessage.h \ src/third_party/asn1/GamePlayerLeft.h \ src/third_party/asn1/GamePlayerMessage.h \ src/third_party/asn1/GameStartMessage.h \ + src/third_party/asn1/GameStartModeInitial.h \ + src/third_party/asn1/GameStartModeRejoin.h \ src/third_party/asn1/Guid.h \ src/third_party/asn1/HandStartMessage.h \ src/third_party/asn1/Id.h \ @@ -138,6 +140,8 @@ HEADERS += src/third_party/asn1/AllInShowCardsMessage.h \ src/third_party/asn1/RejectGameInvitationMessage.h \ src/third_party/asn1/RejectGameInvReason.h \ src/third_party/asn1/RejectInvNotifyMessage.h \ + src/third_party/asn1/RejoinExistingGame.h \ + src/third_party/asn1/RejoinPlayerData.h \ src/third_party/asn1/RemovedFromGame.h \ src/third_party/asn1/ResetTimeoutMessage.h \ src/third_party/asn1/StartEventAckMessage.h \ @@ -245,6 +249,8 @@ SOURCES += src/third_party/asn1/ChatCleanerMessage.c \ src/third_party/asn1/HandStartMessage.c \ src/third_party/asn1/Guid.c \ src/third_party/asn1/GameStartMessage.c \ + src/third_party/asn1/GameStartModeInitial.c \ + src/third_party/asn1/GameStartModeRejoin.c \ src/third_party/asn1/GamePlayerMessage.c \ src/third_party/asn1/GamePlayerLeft.c \ src/third_party/asn1/GamePlayerJoined.c \ @@ -306,6 +312,8 @@ SOURCES += src/third_party/asn1/ChatCleanerMessage.c \ src/third_party/asn1/RejectGameInvitationMessage.c \ src/third_party/asn1/RejectInvNotifyMessage.c \ src/third_party/asn1/RejectGameInvReason.c \ + src/third_party/asn1/RejoinExistingGame.c \ + src/third_party/asn1/RejoinPlayerData.c \ src/third_party/asn1/AfterHandShowCardsMessage.c \ src/third_party/asn1/ShowMyCardsRequestMessage.c \ src/third_party/asn1/EncryptedCards.c \ diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 4578e1f8..1d8eb468 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -1485,13 +1485,17 @@ ClientStateWaitStart::InternalHandlePacket(boost::shared_ptr clien GameStartMessage_t *netGameStart = &tmpPacket->GetMsg()->choice.gameStartMessage; StartData startData; - startData.numberOfPlayers = netGameStart->playerSeats.list.count; startData.startDealerPlayerId = netGameStart->startDealerPlayerId; + if (netGameStart->gameStartMode.present != gameStartMode_PR_gameStartModeInitial) + throw ClientException(__FILE__, __LINE__, ERR_NET_INTERNAL_GAME_ERROR, 0); + + GameStartModeInitial_t *netStartModeInitial = &netGameStart->gameStartMode.choice.gameStartModeInitial; + startData.numberOfPlayers = netStartModeInitial->playerSeats.list.count; client->SetStartData(startData); // Set player numbers using the game start data slots. - NonZeroId_t **playerIds = netGameStart->playerSeats.list.array; - unsigned numPlayers = netGameStart->playerSeats.list.count; + NonZeroId_t **playerIds = netStartModeInitial->playerSeats.list.array; + unsigned numPlayers = netStartModeInitial->playerSeats.list.count; // Request player info for players if needed. if (numPlayers && playerIds && *playerIds) { for (unsigned i = 0; i < numPlayers; i++) { diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index 55eb36d2..af9565f1 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -721,6 +721,8 @@ ServerGameStateStartGame::DoStart(boost::shared_ptr server) GameStartMessage_t *netGameStart = &packet->GetMsg()->choice.gameStartMessage; netGameStart->gameId = server->GetId(); netGameStart->startDealerPlayerId = server->GetStartData().startDealerPlayerId; + netGameStart->gameStartMode.present = gameStartMode_PR_gameStartModeInitial; + GameStartModeInitial_t *netStartModeInitial = &netGameStart->gameStartMode.choice.gameStartModeInitial; // Send player order to clients. // Assume player list is sorted by number. @@ -729,7 +731,7 @@ ServerGameStateStartGame::DoStart(boost::shared_ptr server) while (player_i != player_end) { NonZeroId_t *playerSlot = (NonZeroId_t *)calloc(1, sizeof(NonZeroId_t)); *playerSlot = (*player_i)->GetUniqueId(); - ASN_SEQUENCE_ADD(&netGameStart->playerSeats.list, playerSlot); + ASN_SEQUENCE_ADD(&netStartModeInitial->playerSeats.list, playerSlot); ++player_i; } diff --git a/src/third_party/asn1/AfkWarningMessage.c b/src/third_party/asn1/AfkWarningMessage.c index c2377137..22648f6c 100644 --- a/src/third_party/asn1/AfkWarningMessage.c +++ b/src/third_party/asn1/AfkWarningMessage.c @@ -8,7 +8,7 @@ #include "AfkWarningMessage.h" static asn_TYPE_member_t asn_MBR_AfkWarningMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AfkWarningMessage, remainingTimeouts), + { ATF_NOFLAGS, 0, offsetof(struct AfkWarningMessage, remainingTimeouts), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -16,14 +16,14 @@ static asn_TYPE_member_t asn_MBR_AfkWarningMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "remainingTimeouts" - }, + }, }; static ber_tlv_tag_t asn_DEF_AfkWarningMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (135 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AfkWarningMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* remainingTimeouts at 719 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* remainingTimeouts at 742 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AfkWarningMessage_specs_1 = { sizeof(struct AfkWarningMessage), @@ -48,10 +48,10 @@ asn_TYPE_descriptor_t asn_DEF_AfkWarningMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AfkWarningMessage_tags_1, sizeof(asn_DEF_AfkWarningMessage_tags_1) - /sizeof(asn_DEF_AfkWarningMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_AfkWarningMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_AfkWarningMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AfkWarningMessage_tags_1) - /sizeof(asn_DEF_AfkWarningMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_AfkWarningMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_AfkWarningMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/AfkWarningMessage.h b/src/third_party/asn1/AfkWarningMessage.h index 90bcb266..ecc42d71 100644 --- a/src/third_party/asn1/AfkWarningMessage.h +++ b/src/third_party/asn1/AfkWarningMessage.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* AfkWarningMessage */ -typedef struct AfkWarningMessage { - long remainingTimeouts; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AfkWarningMessage_t; + /* AfkWarningMessage */ + typedef struct AfkWarningMessage { + long remainingTimeouts; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AfkWarningMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AfkWarningMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AfkWarningMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AfterHandShowCardsMessage.c b/src/third_party/asn1/AfterHandShowCardsMessage.c index cc7e8c15..c9b284ad 100644 --- a/src/third_party/asn1/AfterHandShowCardsMessage.c +++ b/src/third_party/asn1/AfterHandShowCardsMessage.c @@ -8,7 +8,7 @@ #include "AfterHandShowCardsMessage.h" static asn_TYPE_member_t asn_MBR_AfterHandShowCardsMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AfterHandShowCardsMessage, playerResult), + { ATF_NOFLAGS, 0, offsetof(struct AfterHandShowCardsMessage, playerResult), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_PlayerResult, @@ -16,14 +16,14 @@ static asn_TYPE_member_t asn_MBR_AfterHandShowCardsMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerResult" - }, + }, }; static ber_tlv_tag_t asn_DEF_AfterHandShowCardsMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (34 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AfterHandShowCardsMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerResult at 557 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerResult at 580 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AfterHandShowCardsMessage_specs_1 = { sizeof(struct AfterHandShowCardsMessage), @@ -48,10 +48,10 @@ asn_TYPE_descriptor_t asn_DEF_AfterHandShowCardsMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AfterHandShowCardsMessage_tags_1, sizeof(asn_DEF_AfterHandShowCardsMessage_tags_1) - /sizeof(asn_DEF_AfterHandShowCardsMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_AfterHandShowCardsMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_AfterHandShowCardsMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AfterHandShowCardsMessage_tags_1) - /sizeof(asn_DEF_AfterHandShowCardsMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_AfterHandShowCardsMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_AfterHandShowCardsMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/AfterHandShowCardsMessage.h b/src/third_party/asn1/AfterHandShowCardsMessage.h index c767afc1..d5dd3524 100644 --- a/src/third_party/asn1/AfterHandShowCardsMessage.h +++ b/src/third_party/asn1/AfterHandShowCardsMessage.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* AfterHandShowCardsMessage */ -typedef struct AfterHandShowCardsMessage { - PlayerResult_t playerResult; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AfterHandShowCardsMessage_t; + /* AfterHandShowCardsMessage */ + typedef struct AfterHandShowCardsMessage { + PlayerResult_t playerResult; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AfterHandShowCardsMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AfterHandShowCardsMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AfterHandShowCardsMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AllInShowCardsMessage.c b/src/third_party/asn1/AllInShowCardsMessage.c index 91de6695..8c1272cd 100644 --- a/src/third_party/asn1/AllInShowCardsMessage.c +++ b/src/third_party/asn1/AllInShowCardsMessage.c @@ -9,32 +9,32 @@ static int memb_playersAllIn_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + /* Determine the number of elements */ size = _A_CSEQUENCE_FROM_VOID(sptr)->count; - + if((size >= 1 && size <= 10)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_playersAllIn_3[] = { - { ATF_POINTER, 0, 0, + { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_PlayerAllIn, @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_playersAllIn_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "" - }, + }, }; static ber_tlv_tag_t asn_DEF_playersAllIn_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) @@ -67,10 +67,10 @@ asn_TYPE_descriptor_t asn_DEF_playersAllIn_3 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_playersAllIn_tags_3, sizeof(asn_DEF_playersAllIn_tags_3) - /sizeof(asn_DEF_playersAllIn_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_playersAllIn_tags_3[0]), /* 1 */ asn_DEF_playersAllIn_tags_3, /* Same as above */ sizeof(asn_DEF_playersAllIn_tags_3) - /sizeof(asn_DEF_playersAllIn_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_playersAllIn_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_playersAllIn_3, 1, /* Single element */ @@ -78,7 +78,7 @@ asn_TYPE_descriptor_t asn_DEF_playersAllIn_3 = { }; static asn_TYPE_member_t asn_MBR_AllInShowCardsMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AllInShowCardsMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct AllInShowCardsMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -86,8 +86,8 @@ static asn_TYPE_member_t asn_MBR_AllInShowCardsMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct AllInShowCardsMessage, playersAllIn), + }, + { ATF_NOFLAGS, 0, offsetof(struct AllInShowCardsMessage, playersAllIn), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_playersAllIn_3, @@ -95,15 +95,15 @@ static asn_TYPE_member_t asn_MBR_AllInShowCardsMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playersAllIn" - }, + }, }; static ber_tlv_tag_t asn_DEF_AllInShowCardsMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (31 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AllInShowCardsMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 514 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* playersAllIn at 516 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 537 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* playersAllIn at 539 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AllInShowCardsMessage_specs_1 = { sizeof(struct AllInShowCardsMessage), @@ -128,10 +128,10 @@ asn_TYPE_descriptor_t asn_DEF_AllInShowCardsMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AllInShowCardsMessage_tags_1, sizeof(asn_DEF_AllInShowCardsMessage_tags_1) - /sizeof(asn_DEF_AllInShowCardsMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_AllInShowCardsMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_AllInShowCardsMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AllInShowCardsMessage_tags_1) - /sizeof(asn_DEF_AllInShowCardsMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_AllInShowCardsMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_AllInShowCardsMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/AllInShowCardsMessage.h b/src/third_party/asn1/AllInShowCardsMessage.h index 7168007a..ecaf20b0 100644 --- a/src/third_party/asn1/AllInShowCardsMessage.h +++ b/src/third_party/asn1/AllInShowCardsMessage.h @@ -21,29 +21,29 @@ extern "C" { #endif -/* Forward declarations */ -struct PlayerAllIn; + /* Forward declarations */ + struct PlayerAllIn; + + /* AllInShowCardsMessage */ + typedef struct AllInShowCardsMessage { + NonZeroId_t gameId; + struct playersAllIn { + A_SEQUENCE_OF(struct PlayerAllIn) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } playersAllIn; + /* + * This type is extensible, + * possible extensions are below. + */ -/* AllInShowCardsMessage */ -typedef struct AllInShowCardsMessage { - NonZeroId_t gameId; - struct playersAllIn { - A_SEQUENCE_OF(struct PlayerAllIn) list; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } playersAllIn; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AllInShowCardsMessage_t; + } AllInShowCardsMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AllInShowCardsMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AllInShowCardsMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AnnounceMessage.c b/src/third_party/asn1/AnnounceMessage.c index 1b5e66d7..ce06bd2e 100644 --- a/src/third_party/asn1/AnnounceMessage.c +++ b/src/third_party/asn1/AnnounceMessage.c @@ -9,7 +9,7 @@ static int serverType_5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,99 +33,99 @@ serverType_5_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void serverType_5_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { serverType_5_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int serverType_5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { serverType_5_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t serverType_5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { serverType_5_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t serverType_5_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { serverType_5_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t serverType_5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { serverType_5_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t serverType_5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { serverType_5_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_latestBetaRevision_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 65535)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_numPlayersOnServer_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 65535)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -167,17 +167,17 @@ asn_TYPE_descriptor_t asn_DEF_serverType_5 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_serverType_tags_5, sizeof(asn_DEF_serverType_tags_5) - /sizeof(asn_DEF_serverType_tags_5[0]), /* 1 */ + /sizeof(asn_DEF_serverType_tags_5[0]), /* 1 */ asn_DEF_serverType_tags_5, /* Same as above */ sizeof(asn_DEF_serverType_tags_5) - /sizeof(asn_DEF_serverType_tags_5[0]), /* 1 */ + /sizeof(asn_DEF_serverType_tags_5[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_serverType_specs_5 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_AnnounceMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, protocolVersion), + { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, protocolVersion), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_Version, @@ -185,8 +185,8 @@ static asn_TYPE_member_t asn_MBR_AnnounceMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "protocolVersion" - }, - { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, latestGameVersion), + }, + { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, latestGameVersion), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_Version, @@ -194,8 +194,8 @@ static asn_TYPE_member_t asn_MBR_AnnounceMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "latestGameVersion" - }, - { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, latestBetaRevision), + }, + { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, latestBetaRevision), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -203,8 +203,8 @@ static asn_TYPE_member_t asn_MBR_AnnounceMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "latestBetaRevision" - }, - { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, serverType), + }, + { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, serverType), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_serverType_5, @@ -212,8 +212,8 @@ static asn_TYPE_member_t asn_MBR_AnnounceMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "serverType" - }, - { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, numPlayersOnServer), + }, + { ATF_NOFLAGS, 0, offsetof(struct AnnounceMessage, numPlayersOnServer), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -221,18 +221,18 @@ static asn_TYPE_member_t asn_MBR_AnnounceMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "numPlayersOnServer" - }, + }, }; static ber_tlv_tag_t asn_DEF_AnnounceMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (0 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AnnounceMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 1 }, /* latestBetaRevision at 86 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -1, 0 }, /* numPlayersOnServer at 92 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, 0, 0 }, /* serverType at 88 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* protocolVersion at 84 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* latestGameVersion at 85 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 1 }, /* latestBetaRevision at 86 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -1, 0 }, /* numPlayersOnServer at 92 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, 0, 0 }, /* serverType at 88 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* protocolVersion at 84 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* latestGameVersion at 85 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AnnounceMessage_specs_1 = { sizeof(struct AnnounceMessage), @@ -257,10 +257,10 @@ asn_TYPE_descriptor_t asn_DEF_AnnounceMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AnnounceMessage_tags_1, sizeof(asn_DEF_AnnounceMessage_tags_1) - /sizeof(asn_DEF_AnnounceMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_AnnounceMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_AnnounceMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AnnounceMessage_tags_1) - /sizeof(asn_DEF_AnnounceMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_AnnounceMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_AnnounceMessage_1, 5, /* Elements count */ diff --git a/src/third_party/asn1/AnnounceMessage.h b/src/third_party/asn1/AnnounceMessage.h index 85e1b7d1..c554723c 100644 --- a/src/third_party/asn1/AnnounceMessage.h +++ b/src/third_party/asn1/AnnounceMessage.h @@ -21,32 +21,33 @@ extern "C" { #endif -/* Dependencies */ -typedef enum serverType { - serverType_serverTypeLAN = 0, - serverType_serverTypeInternetNoAuth = 1, - serverType_serverTypeInternetAuth = 2 -} e_serverType; + /* Dependencies */ + typedef enum serverType { + serverType_serverTypeLAN = 0, + serverType_serverTypeInternetNoAuth = 1, + serverType_serverTypeInternetAuth = 2 + } + e_serverType; -/* AnnounceMessage */ -typedef struct AnnounceMessage { - Version_t protocolVersion; - Version_t latestGameVersion; - long latestBetaRevision; - long serverType; - long numPlayersOnServer; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AnnounceMessage_t; + /* AnnounceMessage */ + typedef struct AnnounceMessage { + Version_t protocolVersion; + Version_t latestGameVersion; + long latestBetaRevision; + long serverType; + long numPlayersOnServer; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_serverType_5; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_AnnounceMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AnnounceMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_serverType_5; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_AnnounceMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AskKickDeniedMessage.c b/src/third_party/asn1/AskKickDeniedMessage.c index dbf27293..c348586d 100644 --- a/src/third_party/asn1/AskKickDeniedMessage.c +++ b/src/third_party/asn1/AskKickDeniedMessage.c @@ -9,7 +9,7 @@ static int kickDeniedReason_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ kickDeniedReason_4_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void kickDeniedReason_4_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { kickDeniedReason_4_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int kickDeniedReason_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { kickDeniedReason_4_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t kickDeniedReason_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { kickDeniedReason_4_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t kickDeniedReason_4_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { kickDeniedReason_4_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t kickDeniedReason_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { kickDeniedReason_4_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t kickDeniedReason_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { kickDeniedReason_4_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -121,17 +121,17 @@ asn_TYPE_descriptor_t asn_DEF_kickDeniedReason_4 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_kickDeniedReason_tags_4, sizeof(asn_DEF_kickDeniedReason_tags_4) - /sizeof(asn_DEF_kickDeniedReason_tags_4[0]), /* 1 */ + /sizeof(asn_DEF_kickDeniedReason_tags_4[0]), /* 1 */ asn_DEF_kickDeniedReason_tags_4, /* Same as above */ sizeof(asn_DEF_kickDeniedReason_tags_4) - /sizeof(asn_DEF_kickDeniedReason_tags_4[0]), /* 1 */ + /sizeof(asn_DEF_kickDeniedReason_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_kickDeniedReason_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_AskKickDeniedMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AskKickDeniedMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct AskKickDeniedMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -139,8 +139,8 @@ static asn_TYPE_member_t asn_MBR_AskKickDeniedMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct AskKickDeniedMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct AskKickDeniedMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -148,8 +148,8 @@ static asn_TYPE_member_t asn_MBR_AskKickDeniedMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct AskKickDeniedMessage, kickDeniedReason), + }, + { ATF_NOFLAGS, 0, offsetof(struct AskKickDeniedMessage, kickDeniedReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_kickDeniedReason_4, @@ -157,16 +157,16 @@ static asn_TYPE_member_t asn_MBR_AskKickDeniedMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "kickDeniedReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_AskKickDeniedMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (65 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AskKickDeniedMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 570 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* playerId at 571 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 } /* kickDeniedReason at 573 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 593 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* playerId at 594 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 } /* kickDeniedReason at 596 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AskKickDeniedMessage_specs_1 = { sizeof(struct AskKickDeniedMessage), @@ -191,10 +191,10 @@ asn_TYPE_descriptor_t asn_DEF_AskKickDeniedMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AskKickDeniedMessage_tags_1, sizeof(asn_DEF_AskKickDeniedMessage_tags_1) - /sizeof(asn_DEF_AskKickDeniedMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_AskKickDeniedMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_AskKickDeniedMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AskKickDeniedMessage_tags_1) - /sizeof(asn_DEF_AskKickDeniedMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_AskKickDeniedMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_AskKickDeniedMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/AskKickDeniedMessage.h b/src/third_party/asn1/AskKickDeniedMessage.h index 3caec3c7..9fa920ad 100644 --- a/src/third_party/asn1/AskKickDeniedMessage.h +++ b/src/third_party/asn1/AskKickDeniedMessage.h @@ -20,32 +20,33 @@ extern "C" { #endif -/* Dependencies */ -typedef enum kickDeniedReason { - kickDeniedReason_kickDeniedInvalidGameState = 0, - kickDeniedReason_kickDeniedNotPossible = 1, - kickDeniedReason_kickDeniedTryAgainLater = 2, - kickDeniedReason_kickDeniedAlreadyInProgress = 3, - kickDeniedReason_kickDeniedInvalidPlayerId = 4 -} e_kickDeniedReason; + /* Dependencies */ + typedef enum kickDeniedReason { + kickDeniedReason_kickDeniedInvalidGameState = 0, + kickDeniedReason_kickDeniedNotPossible = 1, + kickDeniedReason_kickDeniedTryAgainLater = 2, + kickDeniedReason_kickDeniedAlreadyInProgress = 3, + kickDeniedReason_kickDeniedInvalidPlayerId = 4 + } + e_kickDeniedReason; -/* AskKickDeniedMessage */ -typedef struct AskKickDeniedMessage { - NonZeroId_t gameId; - NonZeroId_t playerId; - long kickDeniedReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AskKickDeniedMessage_t; + /* AskKickDeniedMessage */ + typedef struct AskKickDeniedMessage { + NonZeroId_t gameId; + NonZeroId_t playerId; + long kickDeniedReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_kickDeniedReason_4; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_AskKickDeniedMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AskKickDeniedMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_kickDeniedReason_4; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_AskKickDeniedMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AskKickPlayerMessage.c b/src/third_party/asn1/AskKickPlayerMessage.c index d76e2aa1..a8e2db3b 100644 --- a/src/third_party/asn1/AskKickPlayerMessage.c +++ b/src/third_party/asn1/AskKickPlayerMessage.c @@ -8,7 +8,7 @@ #include "AskKickPlayerMessage.h" static asn_TYPE_member_t asn_MBR_AskKickPlayerMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AskKickPlayerMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct AskKickPlayerMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_AskKickPlayerMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct AskKickPlayerMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct AskKickPlayerMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_AskKickPlayerMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_AskKickPlayerMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (64 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AskKickPlayerMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 565 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 567 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 588 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 590 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AskKickPlayerMessage_specs_1 = { sizeof(struct AskKickPlayerMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_AskKickPlayerMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AskKickPlayerMessage_tags_1, sizeof(asn_DEF_AskKickPlayerMessage_tags_1) - /sizeof(asn_DEF_AskKickPlayerMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_AskKickPlayerMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_AskKickPlayerMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AskKickPlayerMessage_tags_1) - /sizeof(asn_DEF_AskKickPlayerMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_AskKickPlayerMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_AskKickPlayerMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/AskKickPlayerMessage.h b/src/third_party/asn1/AskKickPlayerMessage.h index 2e54943b..23b4f3b7 100644 --- a/src/third_party/asn1/AskKickPlayerMessage.h +++ b/src/third_party/asn1/AskKickPlayerMessage.h @@ -19,21 +19,21 @@ extern "C" { #endif -/* AskKickPlayerMessage */ -typedef struct AskKickPlayerMessage { - NonZeroId_t gameId; - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AskKickPlayerMessage_t; + /* AskKickPlayerMessage */ + typedef struct AskKickPlayerMessage { + NonZeroId_t gameId; + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AskKickPlayerMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AskKickPlayerMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AskKickPlayerMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AuthClientResponse.c b/src/third_party/asn1/AuthClientResponse.c index 921b897a..5bc4acd2 100644 --- a/src/third_party/asn1/AuthClientResponse.c +++ b/src/third_party/asn1/AuthClientResponse.c @@ -9,32 +9,32 @@ static int memb_clientResponse_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = st->size; - + if((size >= 1 && size <= 256)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_AuthClientResponse_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AuthClientResponse, clientResponse), + { ATF_NOFLAGS, 0, offsetof(struct AuthClientResponse, clientResponse), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_OCTET_STRING, @@ -42,13 +42,13 @@ static asn_TYPE_member_t asn_MBR_AuthClientResponse_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "clientResponse" - }, + }, }; static ber_tlv_tag_t asn_DEF_AuthClientResponse_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AuthClientResponse_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* clientResponse at 137 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* clientResponse at 138 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AuthClientResponse_specs_1 = { sizeof(struct AuthClientResponse), @@ -73,10 +73,10 @@ asn_TYPE_descriptor_t asn_DEF_AuthClientResponse = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AuthClientResponse_tags_1, sizeof(asn_DEF_AuthClientResponse_tags_1) - /sizeof(asn_DEF_AuthClientResponse_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthClientResponse_tags_1[0]), /* 1 */ asn_DEF_AuthClientResponse_tags_1, /* Same as above */ sizeof(asn_DEF_AuthClientResponse_tags_1) - /sizeof(asn_DEF_AuthClientResponse_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthClientResponse_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AuthClientResponse_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/AuthClientResponse.h b/src/third_party/asn1/AuthClientResponse.h index dfc23c8e..180aae14 100644 --- a/src/third_party/asn1/AuthClientResponse.h +++ b/src/third_party/asn1/AuthClientResponse.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* AuthClientResponse */ -typedef struct AuthClientResponse { - OCTET_STRING_t clientResponse; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AuthClientResponse_t; + /* AuthClientResponse */ + typedef struct AuthClientResponse { + OCTET_STRING_t clientResponse; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AuthClientResponse; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AuthClientResponse_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AuthClientResponse; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AuthMessage.c b/src/third_party/asn1/AuthMessage.c index d61e8a60..4aec9f95 100644 --- a/src/third_party/asn1/AuthMessage.c +++ b/src/third_party/asn1/AuthMessage.c @@ -8,7 +8,7 @@ #include "AuthMessage.h" static asn_TYPE_member_t asn_MBR_AuthMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AuthMessage, choice.authServerChallenge), + { ATF_NOFLAGS, 0, offsetof(struct AuthMessage, choice.authServerChallenge), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_AuthServerChallenge, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_AuthMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "authServerChallenge" - }, - { ATF_NOFLAGS, 0, offsetof(struct AuthMessage, choice.authClientResponse), + }, + { ATF_NOFLAGS, 0, offsetof(struct AuthMessage, choice.authClientResponse), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_AuthClientResponse, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_AuthMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "authClientResponse" - }, - { ATF_NOFLAGS, 0, offsetof(struct AuthMessage, choice.authServerVerification), + }, + { ATF_NOFLAGS, 0, offsetof(struct AuthMessage, choice.authServerVerification), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_AuthServerVerification, @@ -34,15 +34,15 @@ static asn_TYPE_member_t asn_MBR_AuthMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "authServerVerification" - }, + }, }; static ber_tlv_tag_t asn_DEF_AuthMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (2 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AuthMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* authServerChallenge at 127 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* authClientResponse at 128 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* authServerVerification at 130 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* authServerChallenge at 128 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* authClientResponse at 129 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* authServerVerification at 131 */ }; static asn_CHOICE_specifics_t asn_SPC_AuthMessage_specs_1 = { sizeof(struct AuthMessage), @@ -68,10 +68,10 @@ asn_TYPE_descriptor_t asn_DEF_AuthMessage = { CHOICE_outmost_tag, asn_DEF_AuthMessage_tags_1, sizeof(asn_DEF_AuthMessage_tags_1) - /sizeof(asn_DEF_AuthMessage_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthMessage_tags_1[0]), /* 1 */ asn_DEF_AuthMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AuthMessage_tags_1) - /sizeof(asn_DEF_AuthMessage_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthMessage_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AuthMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/AuthMessage.h b/src/third_party/asn1/AuthMessage.h index 7a672d18..e141383b 100644 --- a/src/third_party/asn1/AuthMessage.h +++ b/src/third_party/asn1/AuthMessage.h @@ -21,35 +21,36 @@ extern "C" { #endif -/* Dependencies */ -typedef enum AuthMessage_PR { - AuthMessage_PR_NOTHING, /* No components present */ - AuthMessage_PR_authServerChallenge, - AuthMessage_PR_authClientResponse, - AuthMessage_PR_authServerVerification, - /* Extensions may appear below */ - -} AuthMessage_PR; + /* Dependencies */ + typedef enum AuthMessage_PR { + AuthMessage_PR_NOTHING, /* No components present */ + AuthMessage_PR_authServerChallenge, + AuthMessage_PR_authClientResponse, + AuthMessage_PR_authServerVerification, + /* Extensions may appear below */ -/* AuthMessage */ -typedef struct AuthMessage { - AuthMessage_PR present; - union AuthMessage_u { - AuthServerChallenge_t authServerChallenge; - AuthClientResponse_t authClientResponse; - AuthServerVerification_t authServerVerification; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AuthMessage_t; + } + AuthMessage_PR; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AuthMessage; + /* AuthMessage */ + typedef struct AuthMessage { + AuthMessage_PR present; + union AuthMessage_u { + AuthServerChallenge_t authServerChallenge; + AuthClientResponse_t authClientResponse; + AuthServerVerification_t authServerVerification; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AuthMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AuthMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AuthServerChallenge.c b/src/third_party/asn1/AuthServerChallenge.c index 7940913e..0568ee57 100644 --- a/src/third_party/asn1/AuthServerChallenge.c +++ b/src/third_party/asn1/AuthServerChallenge.c @@ -9,32 +9,32 @@ static int memb_serverChallenge_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = st->size; - + if((size >= 1 && size <= 256)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_AuthServerChallenge_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AuthServerChallenge, serverChallenge), + { ATF_NOFLAGS, 0, offsetof(struct AuthServerChallenge, serverChallenge), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_OCTET_STRING, @@ -42,13 +42,13 @@ static asn_TYPE_member_t asn_MBR_AuthServerChallenge_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "serverChallenge" - }, + }, }; static ber_tlv_tag_t asn_DEF_AuthServerChallenge_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AuthServerChallenge_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* serverChallenge at 133 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* serverChallenge at 134 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AuthServerChallenge_specs_1 = { sizeof(struct AuthServerChallenge), @@ -73,10 +73,10 @@ asn_TYPE_descriptor_t asn_DEF_AuthServerChallenge = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AuthServerChallenge_tags_1, sizeof(asn_DEF_AuthServerChallenge_tags_1) - /sizeof(asn_DEF_AuthServerChallenge_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthServerChallenge_tags_1[0]), /* 1 */ asn_DEF_AuthServerChallenge_tags_1, /* Same as above */ sizeof(asn_DEF_AuthServerChallenge_tags_1) - /sizeof(asn_DEF_AuthServerChallenge_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthServerChallenge_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AuthServerChallenge_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/AuthServerChallenge.h b/src/third_party/asn1/AuthServerChallenge.h index 74645b26..259e688c 100644 --- a/src/third_party/asn1/AuthServerChallenge.h +++ b/src/third_party/asn1/AuthServerChallenge.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* AuthServerChallenge */ -typedef struct AuthServerChallenge { - OCTET_STRING_t serverChallenge; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AuthServerChallenge_t; + /* AuthServerChallenge */ + typedef struct AuthServerChallenge { + OCTET_STRING_t serverChallenge; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AuthServerChallenge; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AuthServerChallenge_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AuthServerChallenge; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AuthServerVerification.c b/src/third_party/asn1/AuthServerVerification.c index 87e5cc40..f307ffe9 100644 --- a/src/third_party/asn1/AuthServerVerification.c +++ b/src/third_party/asn1/AuthServerVerification.c @@ -9,32 +9,32 @@ static int memb_serverVerification_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = st->size; - + if((size >= 1 && size <= 256)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_AuthServerVerification_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AuthServerVerification, serverVerification), + { ATF_NOFLAGS, 0, offsetof(struct AuthServerVerification, serverVerification), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_OCTET_STRING, @@ -42,13 +42,13 @@ static asn_TYPE_member_t asn_MBR_AuthServerVerification_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "serverVerification" - }, + }, }; static ber_tlv_tag_t asn_DEF_AuthServerVerification_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AuthServerVerification_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* serverVerification at 141 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* serverVerification at 142 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AuthServerVerification_specs_1 = { sizeof(struct AuthServerVerification), @@ -73,10 +73,10 @@ asn_TYPE_descriptor_t asn_DEF_AuthServerVerification = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AuthServerVerification_tags_1, sizeof(asn_DEF_AuthServerVerification_tags_1) - /sizeof(asn_DEF_AuthServerVerification_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthServerVerification_tags_1[0]), /* 1 */ asn_DEF_AuthServerVerification_tags_1, /* Same as above */ sizeof(asn_DEF_AuthServerVerification_tags_1) - /sizeof(asn_DEF_AuthServerVerification_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthServerVerification_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AuthServerVerification_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/AuthServerVerification.h b/src/third_party/asn1/AuthServerVerification.h index 49a085d1..6fe0282c 100644 --- a/src/third_party/asn1/AuthServerVerification.h +++ b/src/third_party/asn1/AuthServerVerification.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* AuthServerVerification */ -typedef struct AuthServerVerification { - OCTET_STRING_t serverVerification; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AuthServerVerification_t; + /* AuthServerVerification */ + typedef struct AuthServerVerification { + OCTET_STRING_t serverVerification; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AuthServerVerification; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AuthServerVerification_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AuthServerVerification; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AuthenticatedLogin.c b/src/third_party/asn1/AuthenticatedLogin.c index e59da991..c3d99244 100644 --- a/src/third_party/asn1/AuthenticatedLogin.c +++ b/src/third_party/asn1/AuthenticatedLogin.c @@ -9,32 +9,32 @@ static int memb_clientUserData_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = st->size; - + if((size >= 1 && size <= 256)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_AuthenticatedLogin_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AuthenticatedLogin, clientUserData), + { ATF_NOFLAGS, 0, offsetof(struct AuthenticatedLogin, clientUserData), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_OCTET_STRING, @@ -42,8 +42,8 @@ static asn_TYPE_member_t asn_MBR_AuthenticatedLogin_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "clientUserData" - }, - { ATF_POINTER, 1, offsetof(struct AuthenticatedLogin, avatar), + }, + { ATF_POINTER, 1, offsetof(struct AuthenticatedLogin, avatar), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_AvatarHash, @@ -51,14 +51,14 @@ static asn_TYPE_member_t asn_MBR_AuthenticatedLogin_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatar" - }, + }, }; static ber_tlv_tag_t asn_DEF_AuthenticatedLogin_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AuthenticatedLogin_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 1 }, /* clientUserData at 117 */ - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, -1, 0 } /* avatar at 118 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 1 }, /* clientUserData at 118 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, -1, 0 } /* avatar at 119 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AuthenticatedLogin_specs_1 = { sizeof(struct AuthenticatedLogin), @@ -83,10 +83,10 @@ asn_TYPE_descriptor_t asn_DEF_AuthenticatedLogin = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AuthenticatedLogin_tags_1, sizeof(asn_DEF_AuthenticatedLogin_tags_1) - /sizeof(asn_DEF_AuthenticatedLogin_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthenticatedLogin_tags_1[0]), /* 1 */ asn_DEF_AuthenticatedLogin_tags_1, /* Same as above */ sizeof(asn_DEF_AuthenticatedLogin_tags_1) - /sizeof(asn_DEF_AuthenticatedLogin_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AuthenticatedLogin_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AuthenticatedLogin_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/AuthenticatedLogin.h b/src/third_party/asn1/AuthenticatedLogin.h index c5f7c4ed..c6445b6d 100644 --- a/src/third_party/asn1/AuthenticatedLogin.h +++ b/src/third_party/asn1/AuthenticatedLogin.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* AuthenticatedLogin */ -typedef struct AuthenticatedLogin { - OCTET_STRING_t clientUserData; - AvatarHash_t *avatar /* OPTIONAL */; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AuthenticatedLogin_t; + /* AuthenticatedLogin */ + typedef struct AuthenticatedLogin { + OCTET_STRING_t clientUserData; + AvatarHash_t *avatar /* OPTIONAL */; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AuthenticatedLogin; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AuthenticatedLogin_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AuthenticatedLogin; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AvatarData.c b/src/third_party/asn1/AvatarData.c index 8c77356b..ad97270f 100644 --- a/src/third_party/asn1/AvatarData.c +++ b/src/third_party/asn1/AvatarData.c @@ -9,32 +9,32 @@ static int memb_avatarBlock_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = st->size; - + if((size >= 1 && size <= 256)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_AvatarData_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AvatarData, avatarBlock), + { ATF_NOFLAGS, 0, offsetof(struct AvatarData, avatarBlock), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_OCTET_STRING, @@ -42,13 +42,13 @@ static asn_TYPE_member_t asn_MBR_AvatarData_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarBlock" - }, + }, }; static ber_tlv_tag_t asn_DEF_AvatarData_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AvatarData_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* avatarBlock at 171 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* avatarBlock at 173 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AvatarData_specs_1 = { sizeof(struct AvatarData), @@ -73,10 +73,10 @@ asn_TYPE_descriptor_t asn_DEF_AvatarData = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AvatarData_tags_1, sizeof(asn_DEF_AvatarData_tags_1) - /sizeof(asn_DEF_AvatarData_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AvatarData_tags_1[0]), /* 1 */ asn_DEF_AvatarData_tags_1, /* Same as above */ sizeof(asn_DEF_AvatarData_tags_1) - /sizeof(asn_DEF_AvatarData_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AvatarData_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AvatarData_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/AvatarData.h b/src/third_party/asn1/AvatarData.h index 9f469508..0a7a11f8 100644 --- a/src/third_party/asn1/AvatarData.h +++ b/src/third_party/asn1/AvatarData.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* AvatarData */ -typedef struct AvatarData { - OCTET_STRING_t avatarBlock; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AvatarData_t; + /* AvatarData */ + typedef struct AvatarData { + OCTET_STRING_t avatarBlock; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AvatarData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AvatarData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AvatarData; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AvatarEnd.c b/src/third_party/asn1/AvatarEnd.c index 71c1117d..c0a75523 100644 --- a/src/third_party/asn1/AvatarEnd.c +++ b/src/third_party/asn1/AvatarEnd.c @@ -33,10 +33,10 @@ asn_TYPE_descriptor_t asn_DEF_AvatarEnd = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AvatarEnd_tags_1, sizeof(asn_DEF_AvatarEnd_tags_1) - /sizeof(asn_DEF_AvatarEnd_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AvatarEnd_tags_1[0]), /* 1 */ asn_DEF_AvatarEnd_tags_1, /* Same as above */ sizeof(asn_DEF_AvatarEnd_tags_1) - /sizeof(asn_DEF_AvatarEnd_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AvatarEnd_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_AvatarEnd_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/AvatarEnd.h b/src/third_party/asn1/AvatarEnd.h index a7e21f63..69b62379 100644 --- a/src/third_party/asn1/AvatarEnd.h +++ b/src/third_party/asn1/AvatarEnd.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* AvatarEnd */ -typedef struct AvatarEnd { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AvatarEnd_t; + /* AvatarEnd */ + typedef struct AvatarEnd { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AvatarEnd; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AvatarEnd_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AvatarEnd; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AvatarHash.c b/src/third_party/asn1/AvatarHash.c index 2c781692..6034cdc1 100644 --- a/src/third_party/asn1/AvatarHash.c +++ b/src/third_party/asn1/AvatarHash.c @@ -9,26 +9,26 @@ int AvatarHash_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = st->size; - + if((size == 16)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -56,44 +56,44 @@ AvatarHash_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { void AvatarHash_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { AvatarHash_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int AvatarHash_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { AvatarHash_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t AvatarHash_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { AvatarHash_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t AvatarHash_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { AvatarHash_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t AvatarHash_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { AvatarHash_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t AvatarHash_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { AvatarHash_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -115,10 +115,10 @@ asn_TYPE_descriptor_t asn_DEF_AvatarHash = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AvatarHash_tags_1, sizeof(asn_DEF_AvatarHash_tags_1) - /sizeof(asn_DEF_AvatarHash_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AvatarHash_tags_1[0]), /* 1 */ asn_DEF_AvatarHash_tags_1, /* Same as above */ sizeof(asn_DEF_AvatarHash_tags_1) - /sizeof(asn_DEF_AvatarHash_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AvatarHash_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ diff --git a/src/third_party/asn1/AvatarHash.h b/src/third_party/asn1/AvatarHash.h index bdfe1133..8507e6b9 100644 --- a/src/third_party/asn1/AvatarHash.h +++ b/src/third_party/asn1/AvatarHash.h @@ -18,18 +18,18 @@ extern "C" { #endif -/* AvatarHash */ -typedef OCTET_STRING_t AvatarHash_t; + /* AvatarHash */ + typedef OCTET_STRING_t AvatarHash_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AvatarHash; -asn_struct_free_f AvatarHash_free; -asn_struct_print_f AvatarHash_print; -asn_constr_check_f AvatarHash_constraint; -ber_type_decoder_f AvatarHash_decode_ber; -der_type_encoder_f AvatarHash_encode_der; -xer_type_decoder_f AvatarHash_decode_xer; -xer_type_encoder_f AvatarHash_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AvatarHash; + asn_struct_free_f AvatarHash_free; + asn_struct_print_f AvatarHash_print; + asn_constr_check_f AvatarHash_constraint; + ber_type_decoder_f AvatarHash_decode_ber; + der_type_encoder_f AvatarHash_encode_der; + xer_type_decoder_f AvatarHash_decode_xer; + xer_type_encoder_f AvatarHash_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AvatarHeader.c b/src/third_party/asn1/AvatarHeader.c index 3828e2e3..2d832ffa 100644 --- a/src/third_party/asn1/AvatarHeader.c +++ b/src/third_party/asn1/AvatarHeader.c @@ -9,31 +9,31 @@ static int memb_avatarSize_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 32 && value <= 30720)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_AvatarHeader_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AvatarHeader, avatarType), + { ATF_NOFLAGS, 0, offsetof(struct AvatarHeader, avatarType), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetAvatarType, @@ -41,8 +41,8 @@ static asn_TYPE_member_t asn_MBR_AvatarHeader_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarType" - }, - { ATF_NOFLAGS, 0, offsetof(struct AvatarHeader, avatarSize), + }, + { ATF_NOFLAGS, 0, offsetof(struct AvatarHeader, avatarSize), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -50,14 +50,14 @@ static asn_TYPE_member_t asn_MBR_AvatarHeader_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarSize" - }, + }, }; static ber_tlv_tag_t asn_DEF_AvatarHeader_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AvatarHeader_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* avatarSize at 167 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* avatarType at 166 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* avatarSize at 169 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* avatarType at 168 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AvatarHeader_specs_1 = { sizeof(struct AvatarHeader), @@ -82,10 +82,10 @@ asn_TYPE_descriptor_t asn_DEF_AvatarHeader = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AvatarHeader_tags_1, sizeof(asn_DEF_AvatarHeader_tags_1) - /sizeof(asn_DEF_AvatarHeader_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AvatarHeader_tags_1[0]), /* 1 */ asn_DEF_AvatarHeader_tags_1, /* Same as above */ sizeof(asn_DEF_AvatarHeader_tags_1) - /sizeof(asn_DEF_AvatarHeader_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_AvatarHeader_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_AvatarHeader_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/AvatarHeader.h b/src/third_party/asn1/AvatarHeader.h index 95f96a9a..19a132f9 100644 --- a/src/third_party/asn1/AvatarHeader.h +++ b/src/third_party/asn1/AvatarHeader.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* AvatarHeader */ -typedef struct AvatarHeader { - NetAvatarType_t avatarType; - long avatarSize; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AvatarHeader_t; + /* AvatarHeader */ + typedef struct AvatarHeader { + NetAvatarType_t avatarType; + long avatarSize; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AvatarHeader; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AvatarHeader_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AvatarHeader; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AvatarReplyMessage.c b/src/third_party/asn1/AvatarReplyMessage.c index 229bebbd..5e8649af 100644 --- a/src/third_party/asn1/AvatarReplyMessage.c +++ b/src/third_party/asn1/AvatarReplyMessage.c @@ -8,7 +8,7 @@ #include "AvatarReplyMessage.h" static asn_TYPE_member_t asn_MBR_avatarResult_3[] = { - { ATF_NOFLAGS, 0, offsetof(struct avatarResult, choice.avatarHeader), + { ATF_NOFLAGS, 0, offsetof(struct avatarResult, choice.avatarHeader), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_AvatarHeader, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_avatarResult_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarHeader" - }, - { ATF_NOFLAGS, 0, offsetof(struct avatarResult, choice.avatarData), + }, + { ATF_NOFLAGS, 0, offsetof(struct avatarResult, choice.avatarData), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_AvatarData, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_avatarResult_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarData" - }, - { ATF_NOFLAGS, 0, offsetof(struct avatarResult, choice.avatarEnd), + }, + { ATF_NOFLAGS, 0, offsetof(struct avatarResult, choice.avatarEnd), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_AvatarEnd, @@ -34,8 +34,8 @@ static asn_TYPE_member_t asn_MBR_avatarResult_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarEnd" - }, - { ATF_NOFLAGS, 0, offsetof(struct avatarResult, choice.unknownAvatar), + }, + { ATF_NOFLAGS, 0, offsetof(struct avatarResult, choice.unknownAvatar), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_UnknownAvatar, @@ -43,13 +43,13 @@ static asn_TYPE_member_t asn_MBR_avatarResult_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "unknownAvatar" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_avatarResult_tag2el_3[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* avatarHeader at 158 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* avatarData at 159 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* avatarEnd at 160 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* unknownAvatar at 162 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* avatarHeader at 160 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* avatarData at 161 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* avatarEnd at 162 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* unknownAvatar at 164 */ }; static asn_CHOICE_specifics_t asn_SPC_avatarResult_specs_3 = { sizeof(struct avatarResult), @@ -85,7 +85,7 @@ asn_TYPE_descriptor_t asn_DEF_avatarResult_3 = { }; static asn_TYPE_member_t asn_MBR_AvatarReplyMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AvatarReplyMessage, requestId), + { ATF_NOFLAGS, 0, offsetof(struct AvatarReplyMessage, requestId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -93,8 +93,8 @@ static asn_TYPE_member_t asn_MBR_AvatarReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "requestId" - }, - { ATF_NOFLAGS, 0, offsetof(struct AvatarReplyMessage, avatarResult), + }, + { ATF_NOFLAGS, 0, offsetof(struct AvatarReplyMessage, avatarResult), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_avatarResult_3, @@ -102,18 +102,18 @@ static asn_TYPE_member_t asn_MBR_AvatarReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarResult" - }, + }, }; static ber_tlv_tag_t asn_DEF_AvatarReplyMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (5 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AvatarReplyMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* requestId at 156 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* avatarHeader at 158 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* avatarData at 159 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* avatarEnd at 160 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* unknownAvatar at 162 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* requestId at 158 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* avatarHeader at 160 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* avatarData at 161 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* avatarEnd at 162 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* unknownAvatar at 164 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AvatarReplyMessage_specs_1 = { sizeof(struct AvatarReplyMessage), @@ -138,10 +138,10 @@ asn_TYPE_descriptor_t asn_DEF_AvatarReplyMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AvatarReplyMessage_tags_1, sizeof(asn_DEF_AvatarReplyMessage_tags_1) - /sizeof(asn_DEF_AvatarReplyMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_AvatarReplyMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_AvatarReplyMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AvatarReplyMessage_tags_1) - /sizeof(asn_DEF_AvatarReplyMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_AvatarReplyMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_AvatarReplyMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/AvatarReplyMessage.h b/src/third_party/asn1/AvatarReplyMessage.h index 202b5238..98d0554e 100644 --- a/src/third_party/asn1/AvatarReplyMessage.h +++ b/src/third_party/asn1/AvatarReplyMessage.h @@ -24,47 +24,48 @@ extern "C" { #endif -/* Dependencies */ -typedef enum avatarResult_PR { - avatarResult_PR_NOTHING, /* No components present */ - avatarResult_PR_avatarHeader, - avatarResult_PR_avatarData, - avatarResult_PR_avatarEnd, - avatarResult_PR_unknownAvatar, - /* Extensions may appear below */ - -} avatarResult_PR; + /* Dependencies */ + typedef enum avatarResult_PR { + avatarResult_PR_NOTHING, /* No components present */ + avatarResult_PR_avatarHeader, + avatarResult_PR_avatarData, + avatarResult_PR_avatarEnd, + avatarResult_PR_unknownAvatar, + /* Extensions may appear below */ + + } + avatarResult_PR; + + /* AvatarReplyMessage */ + typedef struct AvatarReplyMessage { + NonZeroId_t requestId; + struct avatarResult { + avatarResult_PR present; + union AvatarReplyMessage__avatarResult_u { + AvatarHeader_t avatarHeader; + AvatarData_t avatarData; + AvatarEnd_t avatarEnd; + UnknownAvatar_t unknownAvatar; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } avatarResult; + /* + * This type is extensible, + * possible extensions are below. + */ -/* AvatarReplyMessage */ -typedef struct AvatarReplyMessage { - NonZeroId_t requestId; - struct avatarResult { - avatarResult_PR present; - union AvatarReplyMessage__avatarResult_u { - AvatarHeader_t avatarHeader; - AvatarData_t avatarData; - AvatarEnd_t avatarEnd; - UnknownAvatar_t unknownAvatar; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } avatarResult; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AvatarReplyMessage_t; + } AvatarReplyMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AvatarReplyMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AvatarReplyMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/AvatarRequestMessage.c b/src/third_party/asn1/AvatarRequestMessage.c index f34e782a..ad891eff 100644 --- a/src/third_party/asn1/AvatarRequestMessage.c +++ b/src/third_party/asn1/AvatarRequestMessage.c @@ -8,7 +8,7 @@ #include "AvatarRequestMessage.h" static asn_TYPE_member_t asn_MBR_AvatarRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct AvatarRequestMessage, requestId), + { ATF_NOFLAGS, 0, offsetof(struct AvatarRequestMessage, requestId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_AvatarRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "requestId" - }, - { ATF_NOFLAGS, 0, offsetof(struct AvatarRequestMessage, avatar), + }, + { ATF_NOFLAGS, 0, offsetof(struct AvatarRequestMessage, avatar), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_AvatarHash, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_AvatarRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatar" - }, + }, }; static ber_tlv_tag_t asn_DEF_AvatarRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (4 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_AvatarRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* requestId at 151 */ - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* avatar at 153 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* requestId at 153 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* avatar at 155 */ }; static asn_SEQUENCE_specifics_t asn_SPC_AvatarRequestMessage_specs_1 = { sizeof(struct AvatarRequestMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_AvatarRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_AvatarRequestMessage_tags_1, sizeof(asn_DEF_AvatarRequestMessage_tags_1) - /sizeof(asn_DEF_AvatarRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_AvatarRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_AvatarRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_AvatarRequestMessage_tags_1) - /sizeof(asn_DEF_AvatarRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_AvatarRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_AvatarRequestMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/AvatarRequestMessage.h b/src/third_party/asn1/AvatarRequestMessage.h index fef0da94..325c04b4 100644 --- a/src/third_party/asn1/AvatarRequestMessage.h +++ b/src/third_party/asn1/AvatarRequestMessage.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* AvatarRequestMessage */ -typedef struct AvatarRequestMessage { - NonZeroId_t requestId; - AvatarHash_t avatar; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} AvatarRequestMessage_t; + /* AvatarRequestMessage */ + typedef struct AvatarRequestMessage { + NonZeroId_t requestId; + AvatarHash_t avatar; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_AvatarRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } AvatarRequestMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_AvatarRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/BIT_STRING.c b/src/third_party/asn1/BIT_STRING.c index 9b982712..605f5120 100644 --- a/src/third_party/asn1/BIT_STRING.c +++ b/src/third_party/asn1/BIT_STRING.c @@ -32,10 +32,10 @@ asn_TYPE_descriptor_t asn_DEF_BIT_STRING = { 0, /* Use generic outmost tag fetcher */ asn_DEF_BIT_STRING_tags, sizeof(asn_DEF_BIT_STRING_tags) - / sizeof(asn_DEF_BIT_STRING_tags[0]), + / sizeof(asn_DEF_BIT_STRING_tags[0]), asn_DEF_BIT_STRING_tags, /* Same as above */ sizeof(asn_DEF_BIT_STRING_tags) - / sizeof(asn_DEF_BIT_STRING_tags[0]), + / sizeof(asn_DEF_BIT_STRING_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_DEF_BIT_STRING_specs @@ -46,21 +46,21 @@ asn_TYPE_descriptor_t asn_DEF_BIT_STRING = { */ int BIT_STRING_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; if(st && st->buf) { if((st->size == 0 && st->bits_unused) - || st->bits_unused < 0 || st->bits_unused > 7) { + || st->bits_unused < 0 || st->bits_unused > 7) { _ASN_CTFAIL(app_key, td, sptr, - "%s: invalid padding byte (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: invalid padding byte (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } @@ -74,8 +74,8 @@ static char *_bit_pattern[16] = { asn_enc_rval_t BIT_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; char scratch[128]; char *p = scratch; @@ -139,7 +139,7 @@ cb_failed: */ int BIT_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { static const char *h2c = "0123456789ABCDEF"; char scratch[64]; const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; @@ -161,7 +161,7 @@ BIT_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, */ for(; buf < end; buf++) { if((buf - st->buf) % 16 == 0 && (st->size > 16) - && buf != st->buf) { + && buf != st->buf) { _i_INDENT(1); /* Dump the string */ if(cb(scratch, p - scratch, app_key) < 0) return -1; diff --git a/src/third_party/asn1/BIT_STRING.h b/src/third_party/asn1/BIT_STRING.h index 732e878b..d0f4e0bf 100644 --- a/src/third_party/asn1/BIT_STRING.h +++ b/src/third_party/asn1/BIT_STRING.h @@ -11,20 +11,20 @@ extern "C" { #endif -typedef struct BIT_STRING_s { - uint8_t *buf; /* BIT STRING body */ - int size; /* Size of the above buffer */ + typedef struct BIT_STRING_s { + uint8_t *buf; /* BIT STRING body */ + int size; /* Size of the above buffer */ - int bits_unused;/* Unused trailing bits in the last octet (0..7) */ + int bits_unused;/* Unused trailing bits in the last octet (0..7) */ - asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ -} BIT_STRING_t; + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ + } BIT_STRING_t; -extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; + extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; -asn_struct_print_f BIT_STRING_print; /* Human-readable output */ -asn_constr_check_f BIT_STRING_constraint; -xer_type_encoder_f BIT_STRING_encode_xer; + asn_struct_print_f BIT_STRING_print; /* Human-readable output */ + asn_constr_check_f BIT_STRING_constraint; + xer_type_encoder_f BIT_STRING_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/BOOLEAN.c b/src/third_party/asn1/BOOLEAN.c index 2c2bbcf2..70fad85a 100644 --- a/src/third_party/asn1/BOOLEAN.c +++ b/src/third_party/asn1/BOOLEAN.c @@ -39,9 +39,9 @@ asn_TYPE_descriptor_t asn_DEF_BOOLEAN = { */ asn_dec_rval_t BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - void **bool_value, const void *buf_ptr, size_t size, - int tag_mode) { + asn_TYPE_descriptor_t *td, + void **bool_value, const void *buf_ptr, size_t size, + int tag_mode) { BOOLEAN_t *st = (BOOLEAN_t *)*bool_value; asn_dec_rval_t rval; ber_tlv_len_t length; @@ -57,13 +57,13 @@ BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx, } ASN_DEBUG("Decoding %s as BOOLEAN (tm=%d)", - td->name, tag_mode); + td->name, tag_mode); /* * Check tags. */ rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, - tag_mode, 0, &length, 0); + tag_mode, 0, &length, 0); if(rval.code != RC_OK) return rval; @@ -81,7 +81,7 @@ BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx, * Compute boolean value. */ for(*st = 0, lidx = 0; - (lidx < length) && *st == 0; lidx++) { + (lidx < length) && *st == 0; lidx++) { /* * Very simple approach: read bytes until the end or * value is already TRUE. @@ -94,16 +94,16 @@ BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx, rval.consumed += length; ASN_DEBUG("Took %ld/%ld bytes to encode %s, value=%d", - (long)rval.consumed, (long)length, - td->name, *st); - + (long)rval.consumed, (long)length, + td->name, *st); + return rval; } asn_enc_rval_t BOOLEAN_encode_der(asn_TYPE_descriptor_t *td, void *sptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t erval; BOOLEAN_t *st = (BOOLEAN_t *)sptr; @@ -151,7 +151,7 @@ BOOLEAN__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun break; case XCT_UNKNOWN_BO: if(xer_check_tag(chunk_buf, chunk_size, "true") - != XCT_BOTH) + != XCT_BOTH) return XPBD_BROKEN_ENCODING; /* "" */ *st = 1; /* Or 0xff as in DER?.. */ @@ -171,18 +171,18 @@ BOOLEAN__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun asn_dec_rval_t BOOLEAN_decode_xer(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, - const void *buf_ptr, size_t size) { + asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, + const void *buf_ptr, size_t size) { return xer_decode_primitive(opt_codec_ctx, td, - sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size, - BOOLEAN__xer_body_decode); + sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size, + BOOLEAN__xer_body_decode); } asn_enc_rval_t BOOLEAN_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; asn_enc_rval_t er; @@ -206,7 +206,7 @@ cb_failed: int BOOLEAN_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; const char *buf; size_t buflen; @@ -239,7 +239,7 @@ BOOLEAN_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { asn_dec_rval_t BOOLEAN_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; BOOLEAN_t *st = (BOOLEAN_t *)*sptr; @@ -255,9 +255,15 @@ BOOLEAN_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * Extract a single bit */ switch(per_get_few_bits(pd, 1)) { - case 1: *st = 1; break; - case 0: *st = 0; break; - case -1: default: _ASN_DECODE_STARVED; + case 1: + *st = 1; + break; + case 0: + *st = 0; + break; + case -1: + default: + _ASN_DECODE_STARVED; } ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE"); @@ -270,7 +276,7 @@ BOOLEAN_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_enc_rval_t BOOLEAN_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { const BOOLEAN_t *st = (const BOOLEAN_t *)sptr; asn_enc_rval_t er; diff --git a/src/third_party/asn1/BOOLEAN.h b/src/third_party/asn1/BOOLEAN.h index 217d0f16..ee14896b 100644 --- a/src/third_party/asn1/BOOLEAN.h +++ b/src/third_party/asn1/BOOLEAN.h @@ -11,23 +11,23 @@ extern "C" { #endif -/* - * The underlying integer may contain various values, but everything - * non-zero is capped to 0xff by the DER encoder. The BER decoder may - * yield non-zero values different from 1, beware. - */ -typedef int BOOLEAN_t; + /* + * The underlying integer may contain various values, but everything + * non-zero is capped to 0xff by the DER encoder. The BER decoder may + * yield non-zero values different from 1, beware. + */ + typedef int BOOLEAN_t; -extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; + extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN; -asn_struct_free_f BOOLEAN_free; -asn_struct_print_f BOOLEAN_print; -ber_type_decoder_f BOOLEAN_decode_ber; -der_type_encoder_f BOOLEAN_encode_der; -xer_type_decoder_f BOOLEAN_decode_xer; -xer_type_encoder_f BOOLEAN_encode_xer; -per_type_decoder_f BOOLEAN_decode_uper; -per_type_encoder_f BOOLEAN_encode_uper; + asn_struct_free_f BOOLEAN_free; + asn_struct_print_f BOOLEAN_print; + ber_type_decoder_f BOOLEAN_decode_ber; + der_type_encoder_f BOOLEAN_encode_der; + xer_type_decoder_f BOOLEAN_decode_xer; + xer_type_encoder_f BOOLEAN_encode_xer; + per_type_decoder_f BOOLEAN_decode_uper; + per_type_encoder_f BOOLEAN_encode_uper; #ifdef __cplusplus } diff --git a/src/third_party/asn1/Card.c b/src/third_party/asn1/Card.c index 93d9b904..e7274955 100644 --- a/src/third_party/asn1/Card.c +++ b/src/third_party/asn1/Card.c @@ -9,25 +9,25 @@ int Card_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 51)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -55,44 +55,44 @@ Card_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { void Card_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { Card_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Card_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Card_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Card_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { Card_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Card_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { Card_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Card_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { Card_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Card_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { Card_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -114,10 +114,10 @@ asn_TYPE_descriptor_t asn_DEF_Card = { 0, /* Use generic outmost tag fetcher */ asn_DEF_Card_tags_1, sizeof(asn_DEF_Card_tags_1) - /sizeof(asn_DEF_Card_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_Card_tags_1[0]), /* 1 */ asn_DEF_Card_tags_1, /* Same as above */ sizeof(asn_DEF_Card_tags_1) - /sizeof(asn_DEF_Card_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_Card_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ diff --git a/src/third_party/asn1/Card.h b/src/third_party/asn1/Card.h index 9ece0b10..802864c2 100644 --- a/src/third_party/asn1/Card.h +++ b/src/third_party/asn1/Card.h @@ -18,18 +18,18 @@ extern "C" { #endif -/* Card */ -typedef long Card_t; + /* Card */ + typedef long Card_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Card; -asn_struct_free_f Card_free; -asn_struct_print_f Card_print; -asn_constr_check_f Card_constraint; -ber_type_decoder_f Card_decode_ber; -der_type_encoder_f Card_encode_der; -xer_type_decoder_f Card_decode_xer; -xer_type_encoder_f Card_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Card; + asn_struct_free_f Card_free; + asn_struct_print_f Card_print; + asn_constr_check_f Card_constraint; + ber_type_decoder_f Card_decode_ber; + der_type_encoder_f Card_encode_der; + xer_type_decoder_f Card_decode_xer; + xer_type_encoder_f Card_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatCleanerMessage.c b/src/third_party/asn1/ChatCleanerMessage.c index 69f0f249..f71c98d7 100644 --- a/src/third_party/asn1/ChatCleanerMessage.c +++ b/src/third_party/asn1/ChatCleanerMessage.c @@ -8,7 +8,7 @@ #include "ChatCleanerMessage.h" static asn_TYPE_member_t asn_MBR_ChatCleanerMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatCleanerMessage, choice.cleanerInitMessage), + { ATF_NOFLAGS, 0, offsetof(struct ChatCleanerMessage, choice.cleanerInitMessage), (ASN_TAG_CLASS_APPLICATION | (0 << 2)), 0, &asn_DEF_CleanerInitMessage, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_ChatCleanerMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerInitMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct ChatCleanerMessage, choice.cleanerInitAckMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct ChatCleanerMessage, choice.cleanerInitAckMessage), (ASN_TAG_CLASS_APPLICATION | (1 << 2)), 0, &asn_DEF_CleanerInitAckMessage, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_ChatCleanerMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerInitAckMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct ChatCleanerMessage, choice.cleanerChatRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct ChatCleanerMessage, choice.cleanerChatRequestMessage), (ASN_TAG_CLASS_APPLICATION | (2 << 2)), 0, &asn_DEF_CleanerChatRequestMessage, @@ -34,8 +34,8 @@ static asn_TYPE_member_t asn_MBR_ChatCleanerMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerChatRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct ChatCleanerMessage, choice.cleanerChatReplyMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct ChatCleanerMessage, choice.cleanerChatReplyMessage), (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, &asn_DEF_CleanerChatReplyMessage, @@ -43,13 +43,13 @@ static asn_TYPE_member_t asn_MBR_ChatCleanerMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerChatReplyMessage" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_ChatCleanerMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_APPLICATION | (0 << 2)), 0, 0, 0 }, /* cleanerInitMessage at 27 */ - { (ASN_TAG_CLASS_APPLICATION | (1 << 2)), 1, 0, 0 }, /* cleanerInitAckMessage at 28 */ - { (ASN_TAG_CLASS_APPLICATION | (2 << 2)), 2, 0, 0 }, /* cleanerChatRequestMessage at 29 */ - { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 3, 0, 0 } /* cleanerChatReplyMessage at 31 */ + { (ASN_TAG_CLASS_APPLICATION | (0 << 2)), 0, 0, 0 }, /* cleanerInitMessage at 27 */ + { (ASN_TAG_CLASS_APPLICATION | (1 << 2)), 1, 0, 0 }, /* cleanerInitAckMessage at 28 */ + { (ASN_TAG_CLASS_APPLICATION | (2 << 2)), 2, 0, 0 }, /* cleanerChatRequestMessage at 29 */ + { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 3, 0, 0 } /* cleanerChatReplyMessage at 31 */ }; static asn_CHOICE_specifics_t asn_SPC_ChatCleanerMessage_specs_1 = { sizeof(struct ChatCleanerMessage), diff --git a/src/third_party/asn1/ChatCleanerMessage.h b/src/third_party/asn1/ChatCleanerMessage.h index abef35a3..a1902461 100644 --- a/src/third_party/asn1/ChatCleanerMessage.h +++ b/src/third_party/asn1/ChatCleanerMessage.h @@ -22,37 +22,38 @@ extern "C" { #endif -/* Dependencies */ -typedef enum ChatCleanerMessage_PR { - ChatCleanerMessage_PR_NOTHING, /* No components present */ - ChatCleanerMessage_PR_cleanerInitMessage, - ChatCleanerMessage_PR_cleanerInitAckMessage, - ChatCleanerMessage_PR_cleanerChatRequestMessage, - ChatCleanerMessage_PR_cleanerChatReplyMessage, - /* Extensions may appear below */ - -} ChatCleanerMessage_PR; + /* Dependencies */ + typedef enum ChatCleanerMessage_PR { + ChatCleanerMessage_PR_NOTHING, /* No components present */ + ChatCleanerMessage_PR_cleanerInitMessage, + ChatCleanerMessage_PR_cleanerInitAckMessage, + ChatCleanerMessage_PR_cleanerChatRequestMessage, + ChatCleanerMessage_PR_cleanerChatReplyMessage, + /* Extensions may appear below */ -/* ChatCleanerMessage */ -typedef struct ChatCleanerMessage { - ChatCleanerMessage_PR present; - union ChatCleanerMessage_u { - CleanerInitMessage_t cleanerInitMessage; - CleanerInitAckMessage_t cleanerInitAckMessage; - CleanerChatRequestMessage_t cleanerChatRequestMessage; - CleanerChatReplyMessage_t cleanerChatReplyMessage; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatCleanerMessage_t; + } + ChatCleanerMessage_PR; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatCleanerMessage; + /* ChatCleanerMessage */ + typedef struct ChatCleanerMessage { + ChatCleanerMessage_PR present; + union ChatCleanerMessage_u { + CleanerInitMessage_t cleanerInitMessage; + CleanerInitAckMessage_t cleanerInitAckMessage; + CleanerChatRequestMessage_t cleanerChatRequestMessage; + CleanerChatReplyMessage_t cleanerChatReplyMessage; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatCleanerMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatCleanerMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatMessage.c b/src/third_party/asn1/ChatMessage.c index be6ae397..bc07ca0a 100644 --- a/src/third_party/asn1/ChatMessage.c +++ b/src/third_party/asn1/ChatMessage.c @@ -9,38 +9,38 @@ static int memb_chatText_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 128)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_chatType_2[] = { - { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeLobby), + { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeLobby), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ChatTypeLobby, @@ -48,8 +48,8 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatTypeLobby" - }, - { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeGame), + }, + { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeGame), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ChatTypeGame, @@ -57,8 +57,8 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatTypeGame" - }, - { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeBot), + }, + { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeBot), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ChatTypeBot, @@ -66,8 +66,8 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatTypeBot" - }, - { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeBroadcast), + }, + { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypeBroadcast), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ChatTypeBroadcast, @@ -75,8 +75,8 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatTypeBroadcast" - }, - { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypePrivate), + }, + { ATF_NOFLAGS, 0, offsetof(struct chatType, choice.chatTypePrivate), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ChatTypePrivate, @@ -84,14 +84,14 @@ static asn_TYPE_member_t asn_MBR_chatType_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatTypePrivate" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_chatType_tag2el_2[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 670 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 671 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* chatTypeBot at 672 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* chatTypeBroadcast at 673 */ - { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* chatTypePrivate at 675 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 693 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatTypeGame at 694 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* chatTypeBot at 695 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* chatTypeBroadcast at 696 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* chatTypePrivate at 698 */ }; static asn_CHOICE_specifics_t asn_SPC_chatType_specs_2 = { sizeof(struct chatType), @@ -127,7 +127,7 @@ asn_TYPE_descriptor_t asn_DEF_chatType_2 = { }; static asn_TYPE_member_t asn_MBR_ChatMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatMessage, chatType), + { ATF_NOFLAGS, 0, offsetof(struct ChatMessage, chatType), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_chatType_2, @@ -135,8 +135,8 @@ static asn_TYPE_member_t asn_MBR_ChatMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatType" - }, - { ATF_NOFLAGS, 0, offsetof(struct ChatMessage, chatText), + }, + { ATF_NOFLAGS, 0, offsetof(struct ChatMessage, chatText), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -144,19 +144,19 @@ static asn_TYPE_member_t asn_MBR_ChatMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatText" - }, + }, }; static ber_tlv_tag_t asn_DEF_ChatMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (130 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 676 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 670 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 671 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* chatTypeBot at 672 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* chatTypeBroadcast at 673 */ - { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* chatTypePrivate at 675 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 699 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatTypeLobby at 693 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatTypeGame at 694 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 }, /* chatTypeBot at 695 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* chatTypeBroadcast at 696 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 0, 0, 0 } /* chatTypePrivate at 698 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatMessage_specs_1 = { sizeof(struct ChatMessage), @@ -181,10 +181,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatMessage_tags_1, sizeof(asn_DEF_ChatMessage_tags_1) - /sizeof(asn_DEF_ChatMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_ChatMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_ChatMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ChatMessage_tags_1) - /sizeof(asn_DEF_ChatMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_ChatMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ChatMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/ChatMessage.h b/src/third_party/asn1/ChatMessage.h index 39d16155..eaad2e37 100644 --- a/src/third_party/asn1/ChatMessage.h +++ b/src/third_party/asn1/ChatMessage.h @@ -25,49 +25,50 @@ extern "C" { #endif -/* Dependencies */ -typedef enum chatType_PR { - chatType_PR_NOTHING, /* No components present */ - chatType_PR_chatTypeLobby, - chatType_PR_chatTypeGame, - chatType_PR_chatTypeBot, - chatType_PR_chatTypeBroadcast, - chatType_PR_chatTypePrivate, - /* Extensions may appear below */ - -} chatType_PR; + /* Dependencies */ + typedef enum chatType_PR { + chatType_PR_NOTHING, /* No components present */ + chatType_PR_chatTypeLobby, + chatType_PR_chatTypeGame, + chatType_PR_chatTypeBot, + chatType_PR_chatTypeBroadcast, + chatType_PR_chatTypePrivate, + /* Extensions may appear below */ + + } + chatType_PR; + + /* ChatMessage */ + typedef struct ChatMessage { + struct chatType { + chatType_PR present; + union ChatMessage__chatType_u { + ChatTypeLobby_t chatTypeLobby; + ChatTypeGame_t chatTypeGame; + ChatTypeBot_t chatTypeBot; + ChatTypeBroadcast_t chatTypeBroadcast; + ChatTypePrivate_t chatTypePrivate; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } chatType; + UTF8String_t chatText; + /* + * This type is extensible, + * possible extensions are below. + */ -/* ChatMessage */ -typedef struct ChatMessage { - struct chatType { - chatType_PR present; - union ChatMessage__chatType_u { - ChatTypeLobby_t chatTypeLobby; - ChatTypeGame_t chatTypeGame; - ChatTypeBot_t chatTypeBot; - ChatTypeBroadcast_t chatTypeBroadcast; - ChatTypePrivate_t chatTypePrivate; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } chatType; - UTF8String_t chatText; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatMessage_t; + } ChatMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatRejectMessage.c b/src/third_party/asn1/ChatRejectMessage.c index 13140962..387a90bf 100644 --- a/src/third_party/asn1/ChatRejectMessage.c +++ b/src/third_party/asn1/ChatRejectMessage.c @@ -9,38 +9,38 @@ static int memb_chatText_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 128)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_ChatRejectMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatRejectMessage, chatText), + { ATF_NOFLAGS, 0, offsetof(struct ChatRejectMessage, chatText), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -48,14 +48,14 @@ static asn_TYPE_member_t asn_MBR_ChatRejectMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatText" - }, + }, }; static ber_tlv_tag_t asn_DEF_ChatRejectMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (131 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatRejectMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* chatText at 699 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* chatText at 722 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatRejectMessage_specs_1 = { sizeof(struct ChatRejectMessage), @@ -80,10 +80,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatRejectMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatRejectMessage_tags_1, sizeof(asn_DEF_ChatRejectMessage_tags_1) - /sizeof(asn_DEF_ChatRejectMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_ChatRejectMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_ChatRejectMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ChatRejectMessage_tags_1) - /sizeof(asn_DEF_ChatRejectMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_ChatRejectMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ChatRejectMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/ChatRejectMessage.h b/src/third_party/asn1/ChatRejectMessage.h index 085aab0f..c8a2d28c 100644 --- a/src/third_party/asn1/ChatRejectMessage.h +++ b/src/third_party/asn1/ChatRejectMessage.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* ChatRejectMessage */ -typedef struct ChatRejectMessage { - UTF8String_t chatText; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatRejectMessage_t; + /* ChatRejectMessage */ + typedef struct ChatRejectMessage { + UTF8String_t chatText; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatRejectMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatRejectMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatRejectMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatRequestMessage.c b/src/third_party/asn1/ChatRequestMessage.c index ff7cc12d..172d3777 100644 --- a/src/third_party/asn1/ChatRequestMessage.c +++ b/src/third_party/asn1/ChatRequestMessage.c @@ -9,38 +9,38 @@ static int memb_chatText_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 128)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_chatRequestType_2[] = { - { ATF_NOFLAGS, 0, offsetof(struct chatRequestType, choice.chatRequestTypeLobby), + { ATF_NOFLAGS, 0, offsetof(struct chatRequestType, choice.chatRequestTypeLobby), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ChatRequestTypeLobby, @@ -48,8 +48,8 @@ static asn_TYPE_member_t asn_MBR_chatRequestType_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatRequestTypeLobby" - }, - { ATF_NOFLAGS, 0, offsetof(struct chatRequestType, choice.chatRequestTypeGame), + }, + { ATF_NOFLAGS, 0, offsetof(struct chatRequestType, choice.chatRequestTypeGame), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ChatRequestTypeGame, @@ -57,8 +57,8 @@ static asn_TYPE_member_t asn_MBR_chatRequestType_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatRequestTypeGame" - }, - { ATF_NOFLAGS, 0, offsetof(struct chatRequestType, choice.chatRequestTypePrivate), + }, + { ATF_NOFLAGS, 0, offsetof(struct chatRequestType, choice.chatRequestTypePrivate), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ChatRequestTypePrivate, @@ -66,12 +66,12 @@ static asn_TYPE_member_t asn_MBR_chatRequestType_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatRequestTypePrivate" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_chatRequestType_tag2el_2[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatRequestTypeLobby at 650 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatRequestTypeGame at 651 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* chatRequestTypePrivate at 653 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatRequestTypeLobby at 673 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* chatRequestTypeGame at 674 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* chatRequestTypePrivate at 676 */ }; static asn_CHOICE_specifics_t asn_SPC_chatRequestType_specs_2 = { sizeof(struct chatRequestType), @@ -107,7 +107,7 @@ asn_TYPE_descriptor_t asn_DEF_chatRequestType_2 = { }; static asn_TYPE_member_t asn_MBR_ChatRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatRequestMessage, chatRequestType), + { ATF_NOFLAGS, 0, offsetof(struct ChatRequestMessage, chatRequestType), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_chatRequestType_2, @@ -115,8 +115,8 @@ static asn_TYPE_member_t asn_MBR_ChatRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatRequestType" - }, - { ATF_NOFLAGS, 0, offsetof(struct ChatRequestMessage, chatText), + }, + { ATF_NOFLAGS, 0, offsetof(struct ChatRequestMessage, chatText), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -124,17 +124,17 @@ static asn_TYPE_member_t asn_MBR_ChatRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatText" - }, + }, }; static ber_tlv_tag_t asn_DEF_ChatRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (129 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 654 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatRequestTypeLobby at 650 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatRequestTypeGame at 651 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 } /* chatRequestTypePrivate at 653 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* chatText at 677 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* chatRequestTypeLobby at 673 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* chatRequestTypeGame at 674 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 } /* chatRequestTypePrivate at 676 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatRequestMessage_specs_1 = { sizeof(struct ChatRequestMessage), @@ -159,10 +159,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatRequestMessage_tags_1, sizeof(asn_DEF_ChatRequestMessage_tags_1) - /sizeof(asn_DEF_ChatRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_ChatRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_ChatRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ChatRequestMessage_tags_1) - /sizeof(asn_DEF_ChatRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_ChatRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ChatRequestMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/ChatRequestMessage.h b/src/third_party/asn1/ChatRequestMessage.h index c7bbf25d..ef2a8af5 100644 --- a/src/third_party/asn1/ChatRequestMessage.h +++ b/src/third_party/asn1/ChatRequestMessage.h @@ -23,45 +23,46 @@ extern "C" { #endif -/* Dependencies */ -typedef enum chatRequestType_PR { - chatRequestType_PR_NOTHING, /* No components present */ - chatRequestType_PR_chatRequestTypeLobby, - chatRequestType_PR_chatRequestTypeGame, - chatRequestType_PR_chatRequestTypePrivate, - /* Extensions may appear below */ - -} chatRequestType_PR; + /* Dependencies */ + typedef enum chatRequestType_PR { + chatRequestType_PR_NOTHING, /* No components present */ + chatRequestType_PR_chatRequestTypeLobby, + chatRequestType_PR_chatRequestTypeGame, + chatRequestType_PR_chatRequestTypePrivate, + /* Extensions may appear below */ + + } + chatRequestType_PR; + + /* ChatRequestMessage */ + typedef struct ChatRequestMessage { + struct chatRequestType { + chatRequestType_PR present; + union ChatRequestMessage__chatRequestType_u { + ChatRequestTypeLobby_t chatRequestTypeLobby; + ChatRequestTypeGame_t chatRequestTypeGame; + ChatRequestTypePrivate_t chatRequestTypePrivate; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } chatRequestType; + UTF8String_t chatText; + /* + * This type is extensible, + * possible extensions are below. + */ -/* ChatRequestMessage */ -typedef struct ChatRequestMessage { - struct chatRequestType { - chatRequestType_PR present; - union ChatRequestMessage__chatRequestType_u { - ChatRequestTypeLobby_t chatRequestTypeLobby; - ChatRequestTypeGame_t chatRequestTypeGame; - ChatRequestTypePrivate_t chatRequestTypePrivate; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } chatRequestType; - UTF8String_t chatText; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatRequestMessage_t; + } ChatRequestMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatRequestMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatRequestTypeGame.c b/src/third_party/asn1/ChatRequestTypeGame.c index 231daa70..d95dfd16 100644 --- a/src/third_party/asn1/ChatRequestTypeGame.c +++ b/src/third_party/asn1/ChatRequestTypeGame.c @@ -8,7 +8,7 @@ #include "ChatRequestTypeGame.h" static asn_TYPE_member_t asn_MBR_ChatRequestTypeGame_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatRequestTypeGame, gameId), + { ATF_NOFLAGS, 0, offsetof(struct ChatRequestTypeGame, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_ChatRequestTypeGame_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, + }, }; static ber_tlv_tag_t asn_DEF_ChatRequestTypeGame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatRequestTypeGame_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 662 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 685 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatRequestTypeGame_specs_1 = { sizeof(struct ChatRequestTypeGame), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatRequestTypeGame = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatRequestTypeGame_tags_1, sizeof(asn_DEF_ChatRequestTypeGame_tags_1) - /sizeof(asn_DEF_ChatRequestTypeGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatRequestTypeGame_tags_1[0]), /* 1 */ asn_DEF_ChatRequestTypeGame_tags_1, /* Same as above */ sizeof(asn_DEF_ChatRequestTypeGame_tags_1) - /sizeof(asn_DEF_ChatRequestTypeGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatRequestTypeGame_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ChatRequestTypeGame_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/ChatRequestTypeGame.h b/src/third_party/asn1/ChatRequestTypeGame.h index 7d7babe7..650d76fb 100644 --- a/src/third_party/asn1/ChatRequestTypeGame.h +++ b/src/third_party/asn1/ChatRequestTypeGame.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* ChatRequestTypeGame */ -typedef struct ChatRequestTypeGame { - NonZeroId_t gameId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatRequestTypeGame_t; + /* ChatRequestTypeGame */ + typedef struct ChatRequestTypeGame { + NonZeroId_t gameId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatRequestTypeGame; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatRequestTypeGame_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatRequestTypeGame; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatRequestTypeLobby.c b/src/third_party/asn1/ChatRequestTypeLobby.c index f4e3ead3..85ee5da9 100644 --- a/src/third_party/asn1/ChatRequestTypeLobby.c +++ b/src/third_party/asn1/ChatRequestTypeLobby.c @@ -33,10 +33,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatRequestTypeLobby = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatRequestTypeLobby_tags_1, sizeof(asn_DEF_ChatRequestTypeLobby_tags_1) - /sizeof(asn_DEF_ChatRequestTypeLobby_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatRequestTypeLobby_tags_1[0]), /* 1 */ asn_DEF_ChatRequestTypeLobby_tags_1, /* Same as above */ sizeof(asn_DEF_ChatRequestTypeLobby_tags_1) - /sizeof(asn_DEF_ChatRequestTypeLobby_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatRequestTypeLobby_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_ChatRequestTypeLobby_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/ChatRequestTypeLobby.h b/src/third_party/asn1/ChatRequestTypeLobby.h index 35c98da3..50801bb9 100644 --- a/src/third_party/asn1/ChatRequestTypeLobby.h +++ b/src/third_party/asn1/ChatRequestTypeLobby.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* ChatRequestTypeLobby */ -typedef struct ChatRequestTypeLobby { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatRequestTypeLobby_t; + /* ChatRequestTypeLobby */ + typedef struct ChatRequestTypeLobby { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatRequestTypeLobby; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatRequestTypeLobby_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatRequestTypeLobby; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatRequestTypePrivate.c b/src/third_party/asn1/ChatRequestTypePrivate.c index 8fbf01c4..98e142fe 100644 --- a/src/third_party/asn1/ChatRequestTypePrivate.c +++ b/src/third_party/asn1/ChatRequestTypePrivate.c @@ -8,7 +8,7 @@ #include "ChatRequestTypePrivate.h" static asn_TYPE_member_t asn_MBR_ChatRequestTypePrivate_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatRequestTypePrivate, targetPlayerId), + { ATF_NOFLAGS, 0, offsetof(struct ChatRequestTypePrivate, targetPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_ChatRequestTypePrivate_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "targetPlayerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_ChatRequestTypePrivate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatRequestTypePrivate_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* targetPlayerId at 666 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* targetPlayerId at 689 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatRequestTypePrivate_specs_1 = { sizeof(struct ChatRequestTypePrivate), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatRequestTypePrivate = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatRequestTypePrivate_tags_1, sizeof(asn_DEF_ChatRequestTypePrivate_tags_1) - /sizeof(asn_DEF_ChatRequestTypePrivate_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatRequestTypePrivate_tags_1[0]), /* 1 */ asn_DEF_ChatRequestTypePrivate_tags_1, /* Same as above */ sizeof(asn_DEF_ChatRequestTypePrivate_tags_1) - /sizeof(asn_DEF_ChatRequestTypePrivate_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatRequestTypePrivate_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ChatRequestTypePrivate_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/ChatRequestTypePrivate.h b/src/third_party/asn1/ChatRequestTypePrivate.h index bdccd49d..66012306 100644 --- a/src/third_party/asn1/ChatRequestTypePrivate.h +++ b/src/third_party/asn1/ChatRequestTypePrivate.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* ChatRequestTypePrivate */ -typedef struct ChatRequestTypePrivate { - NonZeroId_t targetPlayerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatRequestTypePrivate_t; + /* ChatRequestTypePrivate */ + typedef struct ChatRequestTypePrivate { + NonZeroId_t targetPlayerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatRequestTypePrivate; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatRequestTypePrivate_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatRequestTypePrivate; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatTypeBot.c b/src/third_party/asn1/ChatTypeBot.c index d9d8e43c..b2eee7a5 100644 --- a/src/third_party/asn1/ChatTypeBot.c +++ b/src/third_party/asn1/ChatTypeBot.c @@ -33,10 +33,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatTypeBot = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatTypeBot_tags_1, sizeof(asn_DEF_ChatTypeBot_tags_1) - /sizeof(asn_DEF_ChatTypeBot_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypeBot_tags_1[0]), /* 1 */ asn_DEF_ChatTypeBot_tags_1, /* Same as above */ sizeof(asn_DEF_ChatTypeBot_tags_1) - /sizeof(asn_DEF_ChatTypeBot_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypeBot_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_ChatTypeBot_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/ChatTypeBot.h b/src/third_party/asn1/ChatTypeBot.h index 4a03bf4b..06474d15 100644 --- a/src/third_party/asn1/ChatTypeBot.h +++ b/src/third_party/asn1/ChatTypeBot.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* ChatTypeBot */ -typedef struct ChatTypeBot { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatTypeBot_t; + /* ChatTypeBot */ + typedef struct ChatTypeBot { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatTypeBot; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatTypeBot_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatTypeBot; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatTypeBroadcast.c b/src/third_party/asn1/ChatTypeBroadcast.c index 77a6f28f..49913fbe 100644 --- a/src/third_party/asn1/ChatTypeBroadcast.c +++ b/src/third_party/asn1/ChatTypeBroadcast.c @@ -33,10 +33,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatTypeBroadcast = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatTypeBroadcast_tags_1, sizeof(asn_DEF_ChatTypeBroadcast_tags_1) - /sizeof(asn_DEF_ChatTypeBroadcast_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypeBroadcast_tags_1[0]), /* 1 */ asn_DEF_ChatTypeBroadcast_tags_1, /* Same as above */ sizeof(asn_DEF_ChatTypeBroadcast_tags_1) - /sizeof(asn_DEF_ChatTypeBroadcast_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypeBroadcast_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_ChatTypeBroadcast_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/ChatTypeBroadcast.h b/src/third_party/asn1/ChatTypeBroadcast.h index 53c4498a..b3939f20 100644 --- a/src/third_party/asn1/ChatTypeBroadcast.h +++ b/src/third_party/asn1/ChatTypeBroadcast.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* ChatTypeBroadcast */ -typedef struct ChatTypeBroadcast { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatTypeBroadcast_t; + /* ChatTypeBroadcast */ + typedef struct ChatTypeBroadcast { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatTypeBroadcast; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatTypeBroadcast_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatTypeBroadcast; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatTypeGame.c b/src/third_party/asn1/ChatTypeGame.c index fedcf926..cde01ba4 100644 --- a/src/third_party/asn1/ChatTypeGame.c +++ b/src/third_party/asn1/ChatTypeGame.c @@ -8,7 +8,7 @@ #include "ChatTypeGame.h" static asn_TYPE_member_t asn_MBR_ChatTypeGame_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatTypeGame, gameId), + { ATF_NOFLAGS, 0, offsetof(struct ChatTypeGame, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_ChatTypeGame_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct ChatTypeGame, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct ChatTypeGame, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,14 +25,14 @@ static asn_TYPE_member_t asn_MBR_ChatTypeGame_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_ChatTypeGame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatTypeGame_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 684 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 686 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 707 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 709 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeGame_specs_1 = { sizeof(struct ChatTypeGame), @@ -57,10 +57,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatTypeGame = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatTypeGame_tags_1, sizeof(asn_DEF_ChatTypeGame_tags_1) - /sizeof(asn_DEF_ChatTypeGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypeGame_tags_1[0]), /* 1 */ asn_DEF_ChatTypeGame_tags_1, /* Same as above */ sizeof(asn_DEF_ChatTypeGame_tags_1) - /sizeof(asn_DEF_ChatTypeGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypeGame_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ChatTypeGame_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/ChatTypeGame.h b/src/third_party/asn1/ChatTypeGame.h index 7381d2e5..fb545260 100644 --- a/src/third_party/asn1/ChatTypeGame.h +++ b/src/third_party/asn1/ChatTypeGame.h @@ -19,21 +19,21 @@ extern "C" { #endif -/* ChatTypeGame */ -typedef struct ChatTypeGame { - NonZeroId_t gameId; - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatTypeGame_t; + /* ChatTypeGame */ + typedef struct ChatTypeGame { + NonZeroId_t gameId; + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatTypeGame; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatTypeGame_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatTypeGame; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatTypeLobby.c b/src/third_party/asn1/ChatTypeLobby.c index c5927d30..6e87a43d 100644 --- a/src/third_party/asn1/ChatTypeLobby.c +++ b/src/third_party/asn1/ChatTypeLobby.c @@ -8,7 +8,7 @@ #include "ChatTypeLobby.h" static asn_TYPE_member_t asn_MBR_ChatTypeLobby_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatTypeLobby, playerId), + { ATF_NOFLAGS, 0, offsetof(struct ChatTypeLobby, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_ChatTypeLobby_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_ChatTypeLobby_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatTypeLobby_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 681 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 704 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatTypeLobby_specs_1 = { sizeof(struct ChatTypeLobby), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatTypeLobby = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatTypeLobby_tags_1, sizeof(asn_DEF_ChatTypeLobby_tags_1) - /sizeof(asn_DEF_ChatTypeLobby_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypeLobby_tags_1[0]), /* 1 */ asn_DEF_ChatTypeLobby_tags_1, /* Same as above */ sizeof(asn_DEF_ChatTypeLobby_tags_1) - /sizeof(asn_DEF_ChatTypeLobby_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypeLobby_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ChatTypeLobby_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/ChatTypeLobby.h b/src/third_party/asn1/ChatTypeLobby.h index 9ccb6e58..75fc452f 100644 --- a/src/third_party/asn1/ChatTypeLobby.h +++ b/src/third_party/asn1/ChatTypeLobby.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* ChatTypeLobby */ -typedef struct ChatTypeLobby { - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatTypeLobby_t; + /* ChatTypeLobby */ + typedef struct ChatTypeLobby { + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatTypeLobby; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatTypeLobby_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatTypeLobby; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ChatTypePrivate.c b/src/third_party/asn1/ChatTypePrivate.c index 85dd6c88..faefddde 100644 --- a/src/third_party/asn1/ChatTypePrivate.c +++ b/src/third_party/asn1/ChatTypePrivate.c @@ -8,7 +8,7 @@ #include "ChatTypePrivate.h" static asn_TYPE_member_t asn_MBR_ChatTypePrivate_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ChatTypePrivate, playerId), + { ATF_NOFLAGS, 0, offsetof(struct ChatTypePrivate, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_ChatTypePrivate_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_ChatTypePrivate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ChatTypePrivate_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 696 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 719 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ChatTypePrivate_specs_1 = { sizeof(struct ChatTypePrivate), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_ChatTypePrivate = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ChatTypePrivate_tags_1, sizeof(asn_DEF_ChatTypePrivate_tags_1) - /sizeof(asn_DEF_ChatTypePrivate_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypePrivate_tags_1[0]), /* 1 */ asn_DEF_ChatTypePrivate_tags_1, /* Same as above */ sizeof(asn_DEF_ChatTypePrivate_tags_1) - /sizeof(asn_DEF_ChatTypePrivate_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_ChatTypePrivate_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_ChatTypePrivate_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/ChatTypePrivate.h b/src/third_party/asn1/ChatTypePrivate.h index 29692dae..3d9d8bd5 100644 --- a/src/third_party/asn1/ChatTypePrivate.h +++ b/src/third_party/asn1/ChatTypePrivate.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* ChatTypePrivate */ -typedef struct ChatTypePrivate { - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ChatTypePrivate_t; + /* ChatTypePrivate */ + typedef struct ChatTypePrivate { + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ChatTypePrivate; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ChatTypePrivate_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ChatTypePrivate; #ifdef __cplusplus } diff --git a/src/third_party/asn1/CleanerChatReplyMessage.c b/src/third_party/asn1/CleanerChatReplyMessage.c index 328c14d3..35d47dce 100644 --- a/src/third_party/asn1/CleanerChatReplyMessage.c +++ b/src/third_party/asn1/CleanerChatReplyMessage.c @@ -9,25 +9,25 @@ static int requestId_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -50,74 +50,74 @@ requestId_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; - /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } static void requestId_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { requestId_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int requestId_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { requestId_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t requestId_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { requestId_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t requestId_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { requestId_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t requestId_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { requestId_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t requestId_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { requestId_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int playerId_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -140,56 +140,56 @@ playerId_4_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; - /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } static void playerId_4_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { playerId_4_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int playerId_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { playerId_4_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t playerId_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { playerId_4_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t playerId_4_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { playerId_4_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t playerId_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { playerId_4_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t playerId_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { playerId_4_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int cleanerActionType_5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -213,131 +213,131 @@ cleanerActionType_5_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void cleanerActionType_5_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { cleanerActionType_5_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int cleanerActionType_5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { cleanerActionType_5_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t cleanerActionType_5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { cleanerActionType_5_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t cleanerActionType_5_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { cleanerActionType_5_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t cleanerActionType_5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { cleanerActionType_5_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t cleanerActionType_5_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { cleanerActionType_5_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_requestId_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_playerId_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_cleanerText_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 128)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -365,10 +365,10 @@ asn_TYPE_descriptor_t asn_DEF_requestId_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_requestId_tags_2, sizeof(asn_DEF_requestId_tags_2) - /sizeof(asn_DEF_requestId_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_requestId_tags_2[0]), /* 1 */ asn_DEF_requestId_tags_2, /* Same as above */ sizeof(asn_DEF_requestId_tags_2) - /sizeof(asn_DEF_requestId_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_requestId_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_requestId_specs_2 /* Additional specs */ @@ -397,10 +397,10 @@ asn_TYPE_descriptor_t asn_DEF_playerId_4 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_playerId_tags_4, sizeof(asn_DEF_playerId_tags_4) - /sizeof(asn_DEF_playerId_tags_4[0]), /* 1 */ + /sizeof(asn_DEF_playerId_tags_4[0]), /* 1 */ asn_DEF_playerId_tags_4, /* Same as above */ sizeof(asn_DEF_playerId_tags_4) - /sizeof(asn_DEF_playerId_tags_4[0]), /* 1 */ + /sizeof(asn_DEF_playerId_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_playerId_specs_4 /* Additional specs */ @@ -445,17 +445,17 @@ asn_TYPE_descriptor_t asn_DEF_cleanerActionType_5 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_cleanerActionType_tags_5, sizeof(asn_DEF_cleanerActionType_tags_5) - /sizeof(asn_DEF_cleanerActionType_tags_5[0]), /* 1 */ + /sizeof(asn_DEF_cleanerActionType_tags_5[0]), /* 1 */ asn_DEF_cleanerActionType_tags_5, /* Same as above */ sizeof(asn_DEF_cleanerActionType_tags_5) - /sizeof(asn_DEF_cleanerActionType_tags_5[0]), /* 1 */ + /sizeof(asn_DEF_cleanerActionType_tags_5[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_cleanerActionType_specs_5 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_CleanerChatReplyMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatReplyMessage, requestId), + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatReplyMessage, requestId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_requestId_2, @@ -463,8 +463,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "requestId" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatReplyMessage, cleanerChatType), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatReplyMessage, cleanerChatType), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_CleanerChatType, @@ -472,8 +472,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerChatType" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatReplyMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatReplyMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_playerId_4, @@ -481,8 +481,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatReplyMessage, cleanerActionType), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatReplyMessage, cleanerActionType), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_cleanerActionType_5, @@ -490,8 +490,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerActionType" - }, - { ATF_POINTER, 1, offsetof(struct CleanerChatReplyMessage, cleanerText), + }, + { ATF_POINTER, 1, offsetof(struct CleanerChatReplyMessage, cleanerText), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -499,19 +499,19 @@ static asn_TYPE_member_t asn_MBR_CleanerChatReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerText" - }, + }, }; static ber_tlv_tag_t asn_DEF_CleanerChatReplyMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_CleanerChatReplyMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* requestId at 64 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 0 }, /* playerId at 66 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, 0, 0 }, /* cleanerActionType at 68 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 4, 0, 0 }, /* cleanerText at 73 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* cleanerChatTypeLobby at 44 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cleanerChatTypeGame at 46 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* requestId at 64 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 0 }, /* playerId at 66 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, 0, 0 }, /* cleanerActionType at 68 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 4, 0, 0 }, /* cleanerText at 73 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* cleanerChatTypeLobby at 44 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cleanerChatTypeGame at 46 */ }; static asn_SEQUENCE_specifics_t asn_SPC_CleanerChatReplyMessage_specs_1 = { sizeof(struct CleanerChatReplyMessage), @@ -536,10 +536,10 @@ asn_TYPE_descriptor_t asn_DEF_CleanerChatReplyMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_CleanerChatReplyMessage_tags_1, sizeof(asn_DEF_CleanerChatReplyMessage_tags_1) - /sizeof(asn_DEF_CleanerChatReplyMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_CleanerChatReplyMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_CleanerChatReplyMessage_tags_1, /* Same as above */ sizeof(asn_DEF_CleanerChatReplyMessage_tags_1) - /sizeof(asn_DEF_CleanerChatReplyMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_CleanerChatReplyMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CleanerChatReplyMessage_1, 5, /* Elements count */ diff --git a/src/third_party/asn1/CleanerChatReplyMessage.h b/src/third_party/asn1/CleanerChatReplyMessage.h index 7d30bfbb..503205bb 100644 --- a/src/third_party/asn1/CleanerChatReplyMessage.h +++ b/src/third_party/asn1/CleanerChatReplyMessage.h @@ -22,35 +22,36 @@ extern "C" { #endif -/* Dependencies */ -typedef enum cleanerActionType { - cleanerActionType_cleanerActionNone = 0, - cleanerActionType_cleanerActionWarning = 1, - cleanerActionType_cleanerActionKick = 2, - cleanerActionType_cleanerActionBan = 3 -} e_cleanerActionType; + /* Dependencies */ + typedef enum cleanerActionType { + cleanerActionType_cleanerActionNone = 0, + cleanerActionType_cleanerActionWarning = 1, + cleanerActionType_cleanerActionKick = 2, + cleanerActionType_cleanerActionBan = 3 + } + e_cleanerActionType; -/* CleanerChatReplyMessage */ -typedef struct CleanerChatReplyMessage { - unsigned long requestId; - CleanerChatType_t cleanerChatType; - unsigned long playerId; - long cleanerActionType; - UTF8String_t *cleanerText /* OPTIONAL */; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CleanerChatReplyMessage_t; + /* CleanerChatReplyMessage */ + typedef struct CleanerChatReplyMessage { + unsigned long requestId; + CleanerChatType_t cleanerChatType; + unsigned long playerId; + long cleanerActionType; + UTF8String_t *cleanerText /* OPTIONAL */; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_requestId_2; // (Use -fall-defs-global to expose) */ -/* extern asn_TYPE_descriptor_t asn_DEF_playerId_4; // (Use -fall-defs-global to expose) */ -/* extern asn_TYPE_descriptor_t asn_DEF_cleanerActionType_5; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_CleanerChatReplyMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CleanerChatReplyMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_requestId_2; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_playerId_4; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_cleanerActionType_5; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_CleanerChatReplyMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/CleanerChatRequestMessage.c b/src/third_party/asn1/CleanerChatRequestMessage.c index b91b5f31..7f22e27e 100644 --- a/src/third_party/asn1/CleanerChatRequestMessage.c +++ b/src/third_party/asn1/CleanerChatRequestMessage.c @@ -9,25 +9,25 @@ static int requestId_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -50,74 +50,74 @@ requestId_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; - /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } static void requestId_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { requestId_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int requestId_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { requestId_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t requestId_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { requestId_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t requestId_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { requestId_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t requestId_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { requestId_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t requestId_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { requestId_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int playerId_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -140,163 +140,163 @@ playerId_4_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; - /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } static void playerId_4_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { playerId_4_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int playerId_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { playerId_4_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t playerId_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { playerId_4_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t playerId_4_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { playerId_4_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t playerId_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { playerId_4_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t playerId_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { playerId_4_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_requestId_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_playerId_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_playerName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 32)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_chatMessage_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 128)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -324,10 +324,10 @@ asn_TYPE_descriptor_t asn_DEF_requestId_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_requestId_tags_2, sizeof(asn_DEF_requestId_tags_2) - /sizeof(asn_DEF_requestId_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_requestId_tags_2[0]), /* 1 */ asn_DEF_requestId_tags_2, /* Same as above */ sizeof(asn_DEF_requestId_tags_2) - /sizeof(asn_DEF_requestId_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_requestId_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_requestId_specs_2 /* Additional specs */ @@ -356,17 +356,17 @@ asn_TYPE_descriptor_t asn_DEF_playerId_4 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_playerId_tags_4, sizeof(asn_DEF_playerId_tags_4) - /sizeof(asn_DEF_playerId_tags_4[0]), /* 1 */ + /sizeof(asn_DEF_playerId_tags_4[0]), /* 1 */ asn_DEF_playerId_tags_4, /* Same as above */ sizeof(asn_DEF_playerId_tags_4) - /sizeof(asn_DEF_playerId_tags_4[0]), /* 1 */ + /sizeof(asn_DEF_playerId_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_playerId_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_CleanerChatRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, requestId), + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, requestId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_requestId_2, @@ -374,8 +374,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "requestId" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, cleanerChatType), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, cleanerChatType), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_CleanerChatType, @@ -383,8 +383,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerChatType" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_playerId_4, @@ -392,8 +392,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, playerName), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, playerName), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -401,8 +401,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerName" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, chatMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatRequestMessage, chatMessage), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -410,19 +410,19 @@ static asn_TYPE_member_t asn_MBR_CleanerChatRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatMessage" - }, + }, }; static ber_tlv_tag_t asn_DEF_CleanerChatRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (2 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_CleanerChatRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* requestId at 56 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 0 }, /* playerId at 58 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 3, 0, 1 }, /* playerName at 59 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 4, -1, 0 }, /* chatMessage at 60 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* cleanerChatTypeLobby at 44 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cleanerChatTypeGame at 46 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* requestId at 56 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 0 }, /* playerId at 58 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 3, 0, 1 }, /* playerName at 59 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 4, -1, 0 }, /* chatMessage at 60 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* cleanerChatTypeLobby at 44 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cleanerChatTypeGame at 46 */ }; static asn_SEQUENCE_specifics_t asn_SPC_CleanerChatRequestMessage_specs_1 = { sizeof(struct CleanerChatRequestMessage), @@ -447,10 +447,10 @@ asn_TYPE_descriptor_t asn_DEF_CleanerChatRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_CleanerChatRequestMessage_tags_1, sizeof(asn_DEF_CleanerChatRequestMessage_tags_1) - /sizeof(asn_DEF_CleanerChatRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_CleanerChatRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_CleanerChatRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_CleanerChatRequestMessage_tags_1) - /sizeof(asn_DEF_CleanerChatRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_CleanerChatRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CleanerChatRequestMessage_1, 5, /* Elements count */ diff --git a/src/third_party/asn1/CleanerChatRequestMessage.h b/src/third_party/asn1/CleanerChatRequestMessage.h index 891b4d7f..f3f38318 100644 --- a/src/third_party/asn1/CleanerChatRequestMessage.h +++ b/src/third_party/asn1/CleanerChatRequestMessage.h @@ -21,26 +21,26 @@ extern "C" { #endif -/* CleanerChatRequestMessage */ -typedef struct CleanerChatRequestMessage { - unsigned long requestId; - CleanerChatType_t cleanerChatType; - unsigned long playerId; - UTF8String_t playerName; - UTF8String_t chatMessage; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CleanerChatRequestMessage_t; + /* CleanerChatRequestMessage */ + typedef struct CleanerChatRequestMessage { + unsigned long requestId; + CleanerChatType_t cleanerChatType; + unsigned long playerId; + UTF8String_t playerName; + UTF8String_t chatMessage; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_requestId_2; // (Use -fall-defs-global to expose) */ -/* extern asn_TYPE_descriptor_t asn_DEF_playerId_4; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_CleanerChatRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CleanerChatRequestMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_requestId_2; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_playerId_4; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_CleanerChatRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/CleanerChatType.c b/src/third_party/asn1/CleanerChatType.c index f73d6be2..730d2d4e 100644 --- a/src/third_party/asn1/CleanerChatType.c +++ b/src/third_party/asn1/CleanerChatType.c @@ -8,7 +8,7 @@ #include "CleanerChatType.h" static asn_TYPE_member_t asn_MBR_CleanerChatType_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatType, choice.cleanerChatTypeLobby), + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatType, choice.cleanerChatTypeLobby), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_CleanerChatTypeLobby, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_CleanerChatType_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerChatTypeLobby" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatType, choice.cleanerChatTypeGame), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatType, choice.cleanerChatTypeGame), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_CleanerChatTypeGame, @@ -25,11 +25,11 @@ static asn_TYPE_member_t asn_MBR_CleanerChatType_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cleanerChatTypeGame" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_CleanerChatType_tag2el_1[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cleanerChatTypeLobby at 44 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cleanerChatTypeGame at 46 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cleanerChatTypeLobby at 44 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cleanerChatTypeGame at 46 */ }; static asn_CHOICE_specifics_t asn_SPC_CleanerChatType_specs_1 = { sizeof(struct CleanerChatType), diff --git a/src/third_party/asn1/CleanerChatType.h b/src/third_party/asn1/CleanerChatType.h index fdc24737..a37b2824 100644 --- a/src/third_party/asn1/CleanerChatType.h +++ b/src/third_party/asn1/CleanerChatType.h @@ -20,33 +20,34 @@ extern "C" { #endif -/* Dependencies */ -typedef enum CleanerChatType_PR { - CleanerChatType_PR_NOTHING, /* No components present */ - CleanerChatType_PR_cleanerChatTypeLobby, - CleanerChatType_PR_cleanerChatTypeGame, - /* Extensions may appear below */ - -} CleanerChatType_PR; + /* Dependencies */ + typedef enum CleanerChatType_PR { + CleanerChatType_PR_NOTHING, /* No components present */ + CleanerChatType_PR_cleanerChatTypeLobby, + CleanerChatType_PR_cleanerChatTypeGame, + /* Extensions may appear below */ -/* CleanerChatType */ -typedef struct CleanerChatType { - CleanerChatType_PR present; - union CleanerChatType_u { - CleanerChatTypeLobby_t cleanerChatTypeLobby; - CleanerChatTypeGame_t cleanerChatTypeGame; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CleanerChatType_t; + } + CleanerChatType_PR; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CleanerChatType; + /* CleanerChatType */ + typedef struct CleanerChatType { + CleanerChatType_PR present; + union CleanerChatType_u { + CleanerChatTypeLobby_t cleanerChatTypeLobby; + CleanerChatTypeGame_t cleanerChatTypeGame; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CleanerChatType_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CleanerChatType; #ifdef __cplusplus } diff --git a/src/third_party/asn1/CleanerChatTypeGame.c b/src/third_party/asn1/CleanerChatTypeGame.c index 8204c2ba..953614f3 100644 --- a/src/third_party/asn1/CleanerChatTypeGame.c +++ b/src/third_party/asn1/CleanerChatTypeGame.c @@ -9,25 +9,25 @@ static int gameId_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -50,74 +50,74 @@ gameId_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; - /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } static void gameId_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { gameId_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int gameId_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { gameId_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t gameId_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { gameId_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t gameId_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { gameId_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t gameId_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { gameId_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t gameId_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { gameId_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_gameId_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -145,17 +145,17 @@ asn_TYPE_descriptor_t asn_DEF_gameId_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_gameId_tags_2, sizeof(asn_DEF_gameId_tags_2) - /sizeof(asn_DEF_gameId_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_gameId_tags_2[0]), /* 1 */ asn_DEF_gameId_tags_2, /* Same as above */ sizeof(asn_DEF_gameId_tags_2) - /sizeof(asn_DEF_gameId_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_gameId_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_gameId_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_CleanerChatTypeGame_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct CleanerChatTypeGame, gameId), + { ATF_NOFLAGS, 0, offsetof(struct CleanerChatTypeGame, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_gameId_2, @@ -163,13 +163,13 @@ static asn_TYPE_member_t asn_MBR_CleanerChatTypeGame_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, + }, }; static ber_tlv_tag_t asn_DEF_CleanerChatTypeGame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_CleanerChatTypeGame_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 52 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 52 */ }; static asn_SEQUENCE_specifics_t asn_SPC_CleanerChatTypeGame_specs_1 = { sizeof(struct CleanerChatTypeGame), @@ -194,10 +194,10 @@ asn_TYPE_descriptor_t asn_DEF_CleanerChatTypeGame = { 0, /* Use generic outmost tag fetcher */ asn_DEF_CleanerChatTypeGame_tags_1, sizeof(asn_DEF_CleanerChatTypeGame_tags_1) - /sizeof(asn_DEF_CleanerChatTypeGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_CleanerChatTypeGame_tags_1[0]), /* 1 */ asn_DEF_CleanerChatTypeGame_tags_1, /* Same as above */ sizeof(asn_DEF_CleanerChatTypeGame_tags_1) - /sizeof(asn_DEF_CleanerChatTypeGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_CleanerChatTypeGame_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_CleanerChatTypeGame_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/CleanerChatTypeGame.h b/src/third_party/asn1/CleanerChatTypeGame.h index e5084060..acd8084d 100644 --- a/src/third_party/asn1/CleanerChatTypeGame.h +++ b/src/third_party/asn1/CleanerChatTypeGame.h @@ -19,21 +19,21 @@ extern "C" { #endif -/* CleanerChatTypeGame */ -typedef struct CleanerChatTypeGame { - unsigned long gameId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CleanerChatTypeGame_t; + /* CleanerChatTypeGame */ + typedef struct CleanerChatTypeGame { + unsigned long gameId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_gameId_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_CleanerChatTypeGame; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CleanerChatTypeGame_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_gameId_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_CleanerChatTypeGame; #ifdef __cplusplus } diff --git a/src/third_party/asn1/CleanerChatTypeLobby.c b/src/third_party/asn1/CleanerChatTypeLobby.c index cd99e4ec..c084df18 100644 --- a/src/third_party/asn1/CleanerChatTypeLobby.c +++ b/src/third_party/asn1/CleanerChatTypeLobby.c @@ -33,10 +33,10 @@ asn_TYPE_descriptor_t asn_DEF_CleanerChatTypeLobby = { 0, /* Use generic outmost tag fetcher */ asn_DEF_CleanerChatTypeLobby_tags_1, sizeof(asn_DEF_CleanerChatTypeLobby_tags_1) - /sizeof(asn_DEF_CleanerChatTypeLobby_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_CleanerChatTypeLobby_tags_1[0]), /* 1 */ asn_DEF_CleanerChatTypeLobby_tags_1, /* Same as above */ sizeof(asn_DEF_CleanerChatTypeLobby_tags_1) - /sizeof(asn_DEF_CleanerChatTypeLobby_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_CleanerChatTypeLobby_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_CleanerChatTypeLobby_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/CleanerChatTypeLobby.h b/src/third_party/asn1/CleanerChatTypeLobby.h index a689914e..0c0ff8d8 100644 --- a/src/third_party/asn1/CleanerChatTypeLobby.h +++ b/src/third_party/asn1/CleanerChatTypeLobby.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* CleanerChatTypeLobby */ -typedef struct CleanerChatTypeLobby { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CleanerChatTypeLobby_t; + /* CleanerChatTypeLobby */ + typedef struct CleanerChatTypeLobby { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CleanerChatTypeLobby; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CleanerChatTypeLobby_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CleanerChatTypeLobby; #ifdef __cplusplus } diff --git a/src/third_party/asn1/CleanerInitAckMessage.c b/src/third_party/asn1/CleanerInitAckMessage.c index 81d96f08..498c41e6 100644 --- a/src/third_party/asn1/CleanerInitAckMessage.c +++ b/src/third_party/asn1/CleanerInitAckMessage.c @@ -9,63 +9,63 @@ static int memb_serverVersion_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 65535)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_serverSecret_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 32)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_CleanerInitAckMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct CleanerInitAckMessage, serverVersion), + { ATF_NOFLAGS, 0, offsetof(struct CleanerInitAckMessage, serverVersion), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -73,8 +73,8 @@ static asn_TYPE_member_t asn_MBR_CleanerInitAckMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "serverVersion" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerInitAckMessage, serverSecret), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerInitAckMessage, serverSecret), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -82,15 +82,15 @@ static asn_TYPE_member_t asn_MBR_CleanerInitAckMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "serverSecret" - }, + }, }; static ber_tlv_tag_t asn_DEF_CleanerInitAckMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_CleanerInitAckMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* serverVersion at 39 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 } /* serverSecret at 40 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* serverVersion at 39 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 } /* serverSecret at 40 */ }; static asn_SEQUENCE_specifics_t asn_SPC_CleanerInitAckMessage_specs_1 = { sizeof(struct CleanerInitAckMessage), @@ -115,10 +115,10 @@ asn_TYPE_descriptor_t asn_DEF_CleanerInitAckMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_CleanerInitAckMessage_tags_1, sizeof(asn_DEF_CleanerInitAckMessage_tags_1) - /sizeof(asn_DEF_CleanerInitAckMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_CleanerInitAckMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_CleanerInitAckMessage_tags_1, /* Same as above */ sizeof(asn_DEF_CleanerInitAckMessage_tags_1) - /sizeof(asn_DEF_CleanerInitAckMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_CleanerInitAckMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CleanerInitAckMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/CleanerInitAckMessage.h b/src/third_party/asn1/CleanerInitAckMessage.h index db985285..a75efbc5 100644 --- a/src/third_party/asn1/CleanerInitAckMessage.h +++ b/src/third_party/asn1/CleanerInitAckMessage.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* CleanerInitAckMessage */ -typedef struct CleanerInitAckMessage { - long serverVersion; - UTF8String_t serverSecret; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CleanerInitAckMessage_t; + /* CleanerInitAckMessage */ + typedef struct CleanerInitAckMessage { + long serverVersion; + UTF8String_t serverSecret; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CleanerInitAckMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CleanerInitAckMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CleanerInitAckMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/CleanerInitMessage.c b/src/third_party/asn1/CleanerInitMessage.c index 2b657d80..2ed10aaa 100644 --- a/src/third_party/asn1/CleanerInitMessage.c +++ b/src/third_party/asn1/CleanerInitMessage.c @@ -9,63 +9,63 @@ static int memb_requestedVersion_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 65535)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_clientSecret_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 32)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_CleanerInitMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct CleanerInitMessage, requestedVersion), + { ATF_NOFLAGS, 0, offsetof(struct CleanerInitMessage, requestedVersion), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -73,8 +73,8 @@ static asn_TYPE_member_t asn_MBR_CleanerInitMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "requestedVersion" - }, - { ATF_NOFLAGS, 0, offsetof(struct CleanerInitMessage, clientSecret), + }, + { ATF_NOFLAGS, 0, offsetof(struct CleanerInitMessage, clientSecret), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -82,15 +82,15 @@ static asn_TYPE_member_t asn_MBR_CleanerInitMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "clientSecret" - }, + }, }; static ber_tlv_tag_t asn_DEF_CleanerInitMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (0 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_CleanerInitMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* requestedVersion at 34 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 } /* clientSecret at 35 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* requestedVersion at 34 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 } /* clientSecret at 35 */ }; static asn_SEQUENCE_specifics_t asn_SPC_CleanerInitMessage_specs_1 = { sizeof(struct CleanerInitMessage), @@ -115,10 +115,10 @@ asn_TYPE_descriptor_t asn_DEF_CleanerInitMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_CleanerInitMessage_tags_1, sizeof(asn_DEF_CleanerInitMessage_tags_1) - /sizeof(asn_DEF_CleanerInitMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_CleanerInitMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_CleanerInitMessage_tags_1, /* Same as above */ sizeof(asn_DEF_CleanerInitMessage_tags_1) - /sizeof(asn_DEF_CleanerInitMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_CleanerInitMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_CleanerInitMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/CleanerInitMessage.h b/src/third_party/asn1/CleanerInitMessage.h index 5251d9aa..154cea24 100644 --- a/src/third_party/asn1/CleanerInitMessage.h +++ b/src/third_party/asn1/CleanerInitMessage.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* CleanerInitMessage */ -typedef struct CleanerInitMessage { - long requestedVersion; - UTF8String_t clientSecret; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} CleanerInitMessage_t; + /* CleanerInitMessage */ + typedef struct CleanerInitMessage { + long requestedVersion; + UTF8String_t clientSecret; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_CleanerInitMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } CleanerInitMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_CleanerInitMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/DealFlopCardsMessage.c b/src/third_party/asn1/DealFlopCardsMessage.c index d6e5ee15..773a24af 100644 --- a/src/third_party/asn1/DealFlopCardsMessage.c +++ b/src/third_party/asn1/DealFlopCardsMessage.c @@ -8,7 +8,7 @@ #include "DealFlopCardsMessage.h" static asn_TYPE_member_t asn_MBR_DealFlopCardsMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct DealFlopCardsMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct DealFlopCardsMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_DealFlopCardsMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct DealFlopCardsMessage, flopCard1), + }, + { ATF_NOFLAGS, 0, offsetof(struct DealFlopCardsMessage, flopCard1), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_DealFlopCardsMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "flopCard1" - }, - { ATF_NOFLAGS, 0, offsetof(struct DealFlopCardsMessage, flopCard2), + }, + { ATF_NOFLAGS, 0, offsetof(struct DealFlopCardsMessage, flopCard2), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -34,8 +34,8 @@ static asn_TYPE_member_t asn_MBR_DealFlopCardsMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "flopCard2" - }, - { ATF_NOFLAGS, 0, offsetof(struct DealFlopCardsMessage, flopCard3), + }, + { ATF_NOFLAGS, 0, offsetof(struct DealFlopCardsMessage, flopCard3), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -43,17 +43,17 @@ static asn_TYPE_member_t asn_MBR_DealFlopCardsMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "flopCard3" - }, + }, }; static ber_tlv_tag_t asn_DEF_DealFlopCardsMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (28 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_DealFlopCardsMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 3 }, /* gameId at 497 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 2 }, /* flopCard1 at 498 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 1 }, /* flopCard2 at 499 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 0 } /* flopCard3 at 501 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 3 }, /* gameId at 520 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 2 }, /* flopCard1 at 521 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 1 }, /* flopCard2 at 522 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 0 } /* flopCard3 at 524 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DealFlopCardsMessage_specs_1 = { sizeof(struct DealFlopCardsMessage), @@ -78,10 +78,10 @@ asn_TYPE_descriptor_t asn_DEF_DealFlopCardsMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_DealFlopCardsMessage_tags_1, sizeof(asn_DEF_DealFlopCardsMessage_tags_1) - /sizeof(asn_DEF_DealFlopCardsMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_DealFlopCardsMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_DealFlopCardsMessage_tags_1, /* Same as above */ sizeof(asn_DEF_DealFlopCardsMessage_tags_1) - /sizeof(asn_DEF_DealFlopCardsMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_DealFlopCardsMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_DealFlopCardsMessage_1, 4, /* Elements count */ diff --git a/src/third_party/asn1/DealFlopCardsMessage.h b/src/third_party/asn1/DealFlopCardsMessage.h index fc83838f..99f5b808 100644 --- a/src/third_party/asn1/DealFlopCardsMessage.h +++ b/src/third_party/asn1/DealFlopCardsMessage.h @@ -20,23 +20,23 @@ extern "C" { #endif -/* DealFlopCardsMessage */ -typedef struct DealFlopCardsMessage { - NonZeroId_t gameId; - Card_t flopCard1; - Card_t flopCard2; - Card_t flopCard3; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} DealFlopCardsMessage_t; + /* DealFlopCardsMessage */ + typedef struct DealFlopCardsMessage { + NonZeroId_t gameId; + Card_t flopCard1; + Card_t flopCard2; + Card_t flopCard3; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_DealFlopCardsMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } DealFlopCardsMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_DealFlopCardsMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/DealRiverCardMessage.c b/src/third_party/asn1/DealRiverCardMessage.c index 7aef3b02..b874cdcb 100644 --- a/src/third_party/asn1/DealRiverCardMessage.c +++ b/src/third_party/asn1/DealRiverCardMessage.c @@ -8,7 +8,7 @@ #include "DealRiverCardMessage.h" static asn_TYPE_member_t asn_MBR_DealRiverCardMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct DealRiverCardMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct DealRiverCardMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_DealRiverCardMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct DealRiverCardMessage, riverCard), + }, + { ATF_NOFLAGS, 0, offsetof(struct DealRiverCardMessage, riverCard), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_DealRiverCardMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "riverCard" - }, + }, }; static ber_tlv_tag_t asn_DEF_DealRiverCardMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (30 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_DealRiverCardMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 509 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* riverCard at 511 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 532 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* riverCard at 534 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DealRiverCardMessage_specs_1 = { sizeof(struct DealRiverCardMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_DealRiverCardMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_DealRiverCardMessage_tags_1, sizeof(asn_DEF_DealRiverCardMessage_tags_1) - /sizeof(asn_DEF_DealRiverCardMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_DealRiverCardMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_DealRiverCardMessage_tags_1, /* Same as above */ sizeof(asn_DEF_DealRiverCardMessage_tags_1) - /sizeof(asn_DEF_DealRiverCardMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_DealRiverCardMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_DealRiverCardMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/DealRiverCardMessage.h b/src/third_party/asn1/DealRiverCardMessage.h index d9b17279..41d3ae4a 100644 --- a/src/third_party/asn1/DealRiverCardMessage.h +++ b/src/third_party/asn1/DealRiverCardMessage.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* DealRiverCardMessage */ -typedef struct DealRiverCardMessage { - NonZeroId_t gameId; - Card_t riverCard; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} DealRiverCardMessage_t; + /* DealRiverCardMessage */ + typedef struct DealRiverCardMessage { + NonZeroId_t gameId; + Card_t riverCard; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_DealRiverCardMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } DealRiverCardMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_DealRiverCardMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/DealTurnCardMessage.c b/src/third_party/asn1/DealTurnCardMessage.c index a1c4854e..3f4c2ae1 100644 --- a/src/third_party/asn1/DealTurnCardMessage.c +++ b/src/third_party/asn1/DealTurnCardMessage.c @@ -8,7 +8,7 @@ #include "DealTurnCardMessage.h" static asn_TYPE_member_t asn_MBR_DealTurnCardMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct DealTurnCardMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct DealTurnCardMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_DealTurnCardMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct DealTurnCardMessage, turnCard), + }, + { ATF_NOFLAGS, 0, offsetof(struct DealTurnCardMessage, turnCard), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_DealTurnCardMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "turnCard" - }, + }, }; static ber_tlv_tag_t asn_DEF_DealTurnCardMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (29 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_DealTurnCardMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 504 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* turnCard at 506 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 527 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* turnCard at 529 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DealTurnCardMessage_specs_1 = { sizeof(struct DealTurnCardMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_DealTurnCardMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_DealTurnCardMessage_tags_1, sizeof(asn_DEF_DealTurnCardMessage_tags_1) - /sizeof(asn_DEF_DealTurnCardMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_DealTurnCardMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_DealTurnCardMessage_tags_1, /* Same as above */ sizeof(asn_DEF_DealTurnCardMessage_tags_1) - /sizeof(asn_DEF_DealTurnCardMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_DealTurnCardMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_DealTurnCardMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/DealTurnCardMessage.h b/src/third_party/asn1/DealTurnCardMessage.h index f2f58b30..ffc7d92f 100644 --- a/src/third_party/asn1/DealTurnCardMessage.h +++ b/src/third_party/asn1/DealTurnCardMessage.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* DealTurnCardMessage */ -typedef struct DealTurnCardMessage { - NonZeroId_t gameId; - Card_t turnCard; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} DealTurnCardMessage_t; + /* DealTurnCardMessage */ + typedef struct DealTurnCardMessage { + NonZeroId_t gameId; + Card_t turnCard; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_DealTurnCardMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } DealTurnCardMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_DealTurnCardMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/DialogMessage.c b/src/third_party/asn1/DialogMessage.c index 68f09ca6..e1aa33eb 100644 --- a/src/third_party/asn1/DialogMessage.c +++ b/src/third_party/asn1/DialogMessage.c @@ -9,38 +9,38 @@ static int memb_notificationText_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 128)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_DialogMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct DialogMessage, notificationText), + { ATF_NOFLAGS, 0, offsetof(struct DialogMessage, notificationText), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -48,14 +48,14 @@ static asn_TYPE_member_t asn_MBR_DialogMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "notificationText" - }, + }, }; static ber_tlv_tag_t asn_DEF_DialogMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (132 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_DialogMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* notificationText at 703 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* notificationText at 726 */ }; static asn_SEQUENCE_specifics_t asn_SPC_DialogMessage_specs_1 = { sizeof(struct DialogMessage), @@ -80,10 +80,10 @@ asn_TYPE_descriptor_t asn_DEF_DialogMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_DialogMessage_tags_1, sizeof(asn_DEF_DialogMessage_tags_1) - /sizeof(asn_DEF_DialogMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_DialogMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_DialogMessage_tags_1, /* Same as above */ sizeof(asn_DEF_DialogMessage_tags_1) - /sizeof(asn_DEF_DialogMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_DialogMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_DialogMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/DialogMessage.h b/src/third_party/asn1/DialogMessage.h index 14e196b7..ff7e9796 100644 --- a/src/third_party/asn1/DialogMessage.h +++ b/src/third_party/asn1/DialogMessage.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* DialogMessage */ -typedef struct DialogMessage { - UTF8String_t notificationText; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} DialogMessage_t; + /* DialogMessage */ + typedef struct DialogMessage { + UTF8String_t notificationText; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_DialogMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } DialogMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_DialogMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/EncryptedCards.c b/src/third_party/asn1/EncryptedCards.c index 4690f7dd..294a0fe2 100644 --- a/src/third_party/asn1/EncryptedCards.c +++ b/src/third_party/asn1/EncryptedCards.c @@ -9,32 +9,32 @@ static int memb_cardData_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = st->size; - + if((size >= 16 && size <= 64)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_EncryptedCards_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct EncryptedCards, cardData), + { ATF_NOFLAGS, 0, offsetof(struct EncryptedCards, cardData), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_OCTET_STRING, @@ -42,13 +42,13 @@ static asn_TYPE_member_t asn_MBR_EncryptedCards_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cardData" - }, + }, }; static ber_tlv_tag_t asn_DEF_EncryptedCards_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EncryptedCards_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* cardData at 447 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 0 } /* cardData at 470 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EncryptedCards_specs_1 = { sizeof(struct EncryptedCards), @@ -73,10 +73,10 @@ asn_TYPE_descriptor_t asn_DEF_EncryptedCards = { 0, /* Use generic outmost tag fetcher */ asn_DEF_EncryptedCards_tags_1, sizeof(asn_DEF_EncryptedCards_tags_1) - /sizeof(asn_DEF_EncryptedCards_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_EncryptedCards_tags_1[0]), /* 1 */ asn_DEF_EncryptedCards_tags_1, /* Same as above */ sizeof(asn_DEF_EncryptedCards_tags_1) - /sizeof(asn_DEF_EncryptedCards_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_EncryptedCards_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_EncryptedCards_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/EncryptedCards.h b/src/third_party/asn1/EncryptedCards.h index 015f1242..52861a46 100644 --- a/src/third_party/asn1/EncryptedCards.h +++ b/src/third_party/asn1/EncryptedCards.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* EncryptedCards */ -typedef struct EncryptedCards { - OCTET_STRING_t cardData; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} EncryptedCards_t; + /* EncryptedCards */ + typedef struct EncryptedCards { + OCTET_STRING_t cardData; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EncryptedCards; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } EncryptedCards_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EncryptedCards; #ifdef __cplusplus } diff --git a/src/third_party/asn1/EndKickPetitionMessage.c b/src/third_party/asn1/EndKickPetitionMessage.c index 5674ec8c..b37a6b92 100644 --- a/src/third_party/asn1/EndKickPetitionMessage.c +++ b/src/third_party/asn1/EndKickPetitionMessage.c @@ -9,7 +9,7 @@ static int petitionEndReason_7_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,99 +33,99 @@ petitionEndReason_7_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void petitionEndReason_7_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { petitionEndReason_7_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int petitionEndReason_7_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { petitionEndReason_7_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t petitionEndReason_7_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { petitionEndReason_7_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t petitionEndReason_7_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { petitionEndReason_7_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t petitionEndReason_7_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { petitionEndReason_7_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t petitionEndReason_7_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { petitionEndReason_7_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_numVotesAgainstKicking_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 9)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_numVotesInFavourOfKicking_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 9)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -169,17 +169,17 @@ asn_TYPE_descriptor_t asn_DEF_petitionEndReason_7 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_petitionEndReason_tags_7, sizeof(asn_DEF_petitionEndReason_tags_7) - /sizeof(asn_DEF_petitionEndReason_tags_7[0]), /* 1 */ + /sizeof(asn_DEF_petitionEndReason_tags_7[0]), /* 1 */ asn_DEF_petitionEndReason_tags_7, /* Same as above */ sizeof(asn_DEF_petitionEndReason_tags_7) - /sizeof(asn_DEF_petitionEndReason_tags_7[0]), /* 1 */ + /sizeof(asn_DEF_petitionEndReason_tags_7[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_petitionEndReason_specs_7 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_EndKickPetitionMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -187,8 +187,8 @@ static asn_TYPE_member_t asn_MBR_EndKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, petitionId), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, petitionId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -196,8 +196,8 @@ static asn_TYPE_member_t asn_MBR_EndKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "petitionId" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, numVotesAgainstKicking), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, numVotesAgainstKicking), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -205,8 +205,8 @@ static asn_TYPE_member_t asn_MBR_EndKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "numVotesAgainstKicking" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, numVotesInFavourOfKicking), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, numVotesInFavourOfKicking), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -214,8 +214,8 @@ static asn_TYPE_member_t asn_MBR_EndKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "numVotesInFavourOfKicking" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, resultPlayerKicked), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, resultPlayerKicked), (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, &asn_DEF_BOOLEAN, @@ -223,8 +223,8 @@ static asn_TYPE_member_t asn_MBR_EndKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "resultPlayerKicked" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, petitionEndReason), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndKickPetitionMessage, petitionEndReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_petitionEndReason_7, @@ -232,19 +232,19 @@ static asn_TYPE_member_t asn_MBR_EndKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "petitionEndReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_EndKickPetitionMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (70 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndKickPetitionMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 4, 0, 0 }, /* resultPlayerKicked at 628 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 3 }, /* gameId at 624 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 2 }, /* petitionId at 625 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 1 }, /* numVotesAgainstKicking at 626 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 0 }, /* numVotesInFavourOfKicking at 627 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 5, 0, 0 } /* petitionEndReason at 630 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 4, 0, 0 }, /* resultPlayerKicked at 651 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 3 }, /* gameId at 647 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 2 }, /* petitionId at 648 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 1 }, /* numVotesAgainstKicking at 649 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 0 }, /* numVotesInFavourOfKicking at 650 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 5, 0, 0 } /* petitionEndReason at 653 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndKickPetitionMessage_specs_1 = { sizeof(struct EndKickPetitionMessage), @@ -269,10 +269,10 @@ asn_TYPE_descriptor_t asn_DEF_EndKickPetitionMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_EndKickPetitionMessage_tags_1, sizeof(asn_DEF_EndKickPetitionMessage_tags_1) - /sizeof(asn_DEF_EndKickPetitionMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_EndKickPetitionMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_EndKickPetitionMessage_tags_1, /* Same as above */ sizeof(asn_DEF_EndKickPetitionMessage_tags_1) - /sizeof(asn_DEF_EndKickPetitionMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_EndKickPetitionMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_EndKickPetitionMessage_1, 6, /* Elements count */ diff --git a/src/third_party/asn1/EndKickPetitionMessage.h b/src/third_party/asn1/EndKickPetitionMessage.h index e926c6ad..70d64c4a 100644 --- a/src/third_party/asn1/EndKickPetitionMessage.h +++ b/src/third_party/asn1/EndKickPetitionMessage.h @@ -22,34 +22,35 @@ extern "C" { #endif -/* Dependencies */ -typedef enum petitionEndReason { - petitionEndReason_petitionEndEnoughVotes = 0, - petitionEndReason_petitionEndTooFewPlayers = 1, - petitionEndReason_petitionEndPlayerLeft = 2, - petitionEndReason_petitionEndTimeout = 3 -} e_petitionEndReason; + /* Dependencies */ + typedef enum petitionEndReason { + petitionEndReason_petitionEndEnoughVotes = 0, + petitionEndReason_petitionEndTooFewPlayers = 1, + petitionEndReason_petitionEndPlayerLeft = 2, + petitionEndReason_petitionEndTimeout = 3 + } + e_petitionEndReason; -/* EndKickPetitionMessage */ -typedef struct EndKickPetitionMessage { - NonZeroId_t gameId; - NonZeroId_t petitionId; - long numVotesAgainstKicking; - long numVotesInFavourOfKicking; - BOOLEAN_t resultPlayerKicked; - long petitionEndReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} EndKickPetitionMessage_t; + /* EndKickPetitionMessage */ + typedef struct EndKickPetitionMessage { + NonZeroId_t gameId; + NonZeroId_t petitionId; + long numVotesAgainstKicking; + long numVotesInFavourOfKicking; + BOOLEAN_t resultPlayerKicked; + long petitionEndReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_petitionEndReason_7; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_EndKickPetitionMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } EndKickPetitionMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_petitionEndReason_7; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_EndKickPetitionMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/EndOfGameMessage.c b/src/third_party/asn1/EndOfGameMessage.c index 829a9a40..aa9c270a 100644 --- a/src/third_party/asn1/EndOfGameMessage.c +++ b/src/third_party/asn1/EndOfGameMessage.c @@ -8,7 +8,7 @@ #include "EndOfGameMessage.h" static asn_TYPE_member_t asn_MBR_EndOfGameMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct EndOfGameMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct EndOfGameMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_EndOfGameMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndOfGameMessage, winnerPlayerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndOfGameMessage, winnerPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_EndOfGameMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "winnerPlayerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_EndOfGameMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (35 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndOfGameMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 560 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* winnerPlayerId at 562 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 583 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* winnerPlayerId at 585 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndOfGameMessage_specs_1 = { sizeof(struct EndOfGameMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_EndOfGameMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_EndOfGameMessage_tags_1, sizeof(asn_DEF_EndOfGameMessage_tags_1) - /sizeof(asn_DEF_EndOfGameMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_EndOfGameMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_EndOfGameMessage_tags_1, /* Same as above */ sizeof(asn_DEF_EndOfGameMessage_tags_1) - /sizeof(asn_DEF_EndOfGameMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_EndOfGameMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_EndOfGameMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/EndOfGameMessage.h b/src/third_party/asn1/EndOfGameMessage.h index 1594a475..80601a06 100644 --- a/src/third_party/asn1/EndOfGameMessage.h +++ b/src/third_party/asn1/EndOfGameMessage.h @@ -19,21 +19,21 @@ extern "C" { #endif -/* EndOfGameMessage */ -typedef struct EndOfGameMessage { - NonZeroId_t gameId; - NonZeroId_t winnerPlayerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} EndOfGameMessage_t; + /* EndOfGameMessage */ + typedef struct EndOfGameMessage { + NonZeroId_t gameId; + NonZeroId_t winnerPlayerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EndOfGameMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } EndOfGameMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EndOfGameMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/EndOfHandHideCards.c b/src/third_party/asn1/EndOfHandHideCards.c index edf63d97..3827c327 100644 --- a/src/third_party/asn1/EndOfHandHideCards.c +++ b/src/third_party/asn1/EndOfHandHideCards.c @@ -9,56 +9,56 @@ static int memb_moneyWon_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_playerMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerId), + { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -66,8 +66,8 @@ static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, moneyWon), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, moneyWon), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -75,8 +75,8 @@ static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "moneyWon" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerMoney), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndOfHandHideCards, playerMoney), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -84,15 +84,15 @@ static asn_TYPE_member_t asn_MBR_EndOfHandHideCards_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerMoney" - }, + }, }; static ber_tlv_tag_t asn_DEF_EndOfHandHideCards_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndOfHandHideCards_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 547 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* moneyWon at 548 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* playerMoney at 549 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 570 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* moneyWon at 571 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* playerMoney at 572 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndOfHandHideCards_specs_1 = { sizeof(struct EndOfHandHideCards), @@ -117,10 +117,10 @@ asn_TYPE_descriptor_t asn_DEF_EndOfHandHideCards = { 0, /* Use generic outmost tag fetcher */ asn_DEF_EndOfHandHideCards_tags_1, sizeof(asn_DEF_EndOfHandHideCards_tags_1) - /sizeof(asn_DEF_EndOfHandHideCards_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_EndOfHandHideCards_tags_1[0]), /* 1 */ asn_DEF_EndOfHandHideCards_tags_1, /* Same as above */ sizeof(asn_DEF_EndOfHandHideCards_tags_1) - /sizeof(asn_DEF_EndOfHandHideCards_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_EndOfHandHideCards_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_EndOfHandHideCards_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/EndOfHandHideCards.h b/src/third_party/asn1/EndOfHandHideCards.h index 1a488638..9df2cb0e 100644 --- a/src/third_party/asn1/EndOfHandHideCards.h +++ b/src/third_party/asn1/EndOfHandHideCards.h @@ -20,22 +20,22 @@ extern "C" { #endif -/* EndOfHandHideCards */ -typedef struct EndOfHandHideCards { - NonZeroId_t playerId; - long moneyWon; - long playerMoney; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} EndOfHandHideCards_t; + /* EndOfHandHideCards */ + typedef struct EndOfHandHideCards { + NonZeroId_t playerId; + long moneyWon; + long playerMoney; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EndOfHandHideCards; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } EndOfHandHideCards_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EndOfHandHideCards; #ifdef __cplusplus } diff --git a/src/third_party/asn1/EndOfHandMessage.c b/src/third_party/asn1/EndOfHandMessage.c index 4f06f6a6..bb1bdf39 100644 --- a/src/third_party/asn1/EndOfHandMessage.c +++ b/src/third_party/asn1/EndOfHandMessage.c @@ -8,7 +8,7 @@ #include "EndOfHandMessage.h" static asn_TYPE_member_t asn_MBR_endOfHandType_3[] = { - { ATF_NOFLAGS, 0, offsetof(struct endOfHandType, choice.endOfHandShowCards), + { ATF_NOFLAGS, 0, offsetof(struct endOfHandType, choice.endOfHandShowCards), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EndOfHandShowCards, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_endOfHandType_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "endOfHandShowCards" - }, - { ATF_NOFLAGS, 0, offsetof(struct endOfHandType, choice.endOfHandHideCards), + }, + { ATF_NOFLAGS, 0, offsetof(struct endOfHandType, choice.endOfHandHideCards), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EndOfHandHideCards, @@ -25,11 +25,11 @@ static asn_TYPE_member_t asn_MBR_endOfHandType_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "endOfHandHideCards" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_endOfHandType_tag2el_3[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* endOfHandShowCards at 527 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endOfHandHideCards at 529 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* endOfHandShowCards at 550 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endOfHandHideCards at 552 */ }; static asn_CHOICE_specifics_t asn_SPC_endOfHandType_specs_3 = { sizeof(struct endOfHandType), @@ -65,7 +65,7 @@ asn_TYPE_descriptor_t asn_DEF_endOfHandType_3 = { }; static asn_TYPE_member_t asn_MBR_EndOfHandMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct EndOfHandMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct EndOfHandMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -73,8 +73,8 @@ static asn_TYPE_member_t asn_MBR_EndOfHandMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct EndOfHandMessage, endOfHandType), + }, + { ATF_NOFLAGS, 0, offsetof(struct EndOfHandMessage, endOfHandType), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_endOfHandType_3, @@ -82,16 +82,16 @@ static asn_TYPE_member_t asn_MBR_EndOfHandMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "endOfHandType" - }, + }, }; static ber_tlv_tag_t asn_DEF_EndOfHandMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (32 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndOfHandMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 525 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* endOfHandShowCards at 527 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endOfHandHideCards at 529 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 548 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* endOfHandShowCards at 550 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* endOfHandHideCards at 552 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndOfHandMessage_specs_1 = { sizeof(struct EndOfHandMessage), @@ -116,10 +116,10 @@ asn_TYPE_descriptor_t asn_DEF_EndOfHandMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_EndOfHandMessage_tags_1, sizeof(asn_DEF_EndOfHandMessage_tags_1) - /sizeof(asn_DEF_EndOfHandMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_EndOfHandMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_EndOfHandMessage_tags_1, /* Same as above */ sizeof(asn_DEF_EndOfHandMessage_tags_1) - /sizeof(asn_DEF_EndOfHandMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_EndOfHandMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_EndOfHandMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/EndOfHandMessage.h b/src/third_party/asn1/EndOfHandMessage.h index 3aa18497..804e58d6 100644 --- a/src/third_party/asn1/EndOfHandMessage.h +++ b/src/third_party/asn1/EndOfHandMessage.h @@ -22,43 +22,44 @@ extern "C" { #endif -/* Dependencies */ -typedef enum endOfHandType_PR { - endOfHandType_PR_NOTHING, /* No components present */ - endOfHandType_PR_endOfHandShowCards, - endOfHandType_PR_endOfHandHideCards, - /* Extensions may appear below */ - -} endOfHandType_PR; + /* Dependencies */ + typedef enum endOfHandType_PR { + endOfHandType_PR_NOTHING, /* No components present */ + endOfHandType_PR_endOfHandShowCards, + endOfHandType_PR_endOfHandHideCards, + /* Extensions may appear below */ + + } + endOfHandType_PR; + + /* EndOfHandMessage */ + typedef struct EndOfHandMessage { + NonZeroId_t gameId; + struct endOfHandType { + endOfHandType_PR present; + union EndOfHandMessage__endOfHandType_u { + EndOfHandShowCards_t endOfHandShowCards; + EndOfHandHideCards_t endOfHandHideCards; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } endOfHandType; + /* + * This type is extensible, + * possible extensions are below. + */ -/* EndOfHandMessage */ -typedef struct EndOfHandMessage { - NonZeroId_t gameId; - struct endOfHandType { - endOfHandType_PR present; - union EndOfHandMessage__endOfHandType_u { - EndOfHandShowCards_t endOfHandShowCards; - EndOfHandHideCards_t endOfHandHideCards; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } endOfHandType; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} EndOfHandMessage_t; + } EndOfHandMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EndOfHandMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EndOfHandMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/EndOfHandShowCards.c b/src/third_party/asn1/EndOfHandShowCards.c index e7896a0c..3cc8348c 100644 --- a/src/third_party/asn1/EndOfHandShowCards.c +++ b/src/third_party/asn1/EndOfHandShowCards.c @@ -9,32 +9,32 @@ static int memb_playerResults_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + /* Determine the number of elements */ size = _A_CSEQUENCE_FROM_VOID(sptr)->count; - + if((size >= 1 && size <= 10)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_playerResults_2[] = { - { ATF_POINTER, 0, 0, + { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_PlayerResult, @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_playerResults_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "" - }, + }, }; static ber_tlv_tag_t asn_DEF_playerResults_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) @@ -67,10 +67,10 @@ asn_TYPE_descriptor_t asn_DEF_playerResults_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_playerResults_tags_2, sizeof(asn_DEF_playerResults_tags_2) - /sizeof(asn_DEF_playerResults_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_playerResults_tags_2[0]), /* 1 */ asn_DEF_playerResults_tags_2, /* Same as above */ sizeof(asn_DEF_playerResults_tags_2) - /sizeof(asn_DEF_playerResults_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_playerResults_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_playerResults_2, 1, /* Single element */ @@ -78,7 +78,7 @@ asn_TYPE_descriptor_t asn_DEF_playerResults_2 = { }; static asn_TYPE_member_t asn_MBR_EndOfHandShowCards_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct EndOfHandShowCards, playerResults), + { ATF_NOFLAGS, 0, offsetof(struct EndOfHandShowCards, playerResults), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_playerResults_2, @@ -86,13 +86,13 @@ static asn_TYPE_member_t asn_MBR_EndOfHandShowCards_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerResults" - }, + }, }; static ber_tlv_tag_t asn_DEF_EndOfHandShowCards_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EndOfHandShowCards_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerResults at 534 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerResults at 557 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EndOfHandShowCards_specs_1 = { sizeof(struct EndOfHandShowCards), @@ -117,10 +117,10 @@ asn_TYPE_descriptor_t asn_DEF_EndOfHandShowCards = { 0, /* Use generic outmost tag fetcher */ asn_DEF_EndOfHandShowCards_tags_1, sizeof(asn_DEF_EndOfHandShowCards_tags_1) - /sizeof(asn_DEF_EndOfHandShowCards_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_EndOfHandShowCards_tags_1[0]), /* 1 */ asn_DEF_EndOfHandShowCards_tags_1, /* Same as above */ sizeof(asn_DEF_EndOfHandShowCards_tags_1) - /sizeof(asn_DEF_EndOfHandShowCards_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_EndOfHandShowCards_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_EndOfHandShowCards_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/EndOfHandShowCards.h b/src/third_party/asn1/EndOfHandShowCards.h index 60df3bda..af3947bd 100644 --- a/src/third_party/asn1/EndOfHandShowCards.h +++ b/src/third_party/asn1/EndOfHandShowCards.h @@ -20,28 +20,28 @@ extern "C" { #endif -/* Forward declarations */ -struct PlayerResult; + /* Forward declarations */ + struct PlayerResult; + + /* EndOfHandShowCards */ + typedef struct EndOfHandShowCards { + struct playerResults { + A_SEQUENCE_OF(struct PlayerResult) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } playerResults; + /* + * This type is extensible, + * possible extensions are below. + */ -/* EndOfHandShowCards */ -typedef struct EndOfHandShowCards { - struct playerResults { - A_SEQUENCE_OF(struct PlayerResult) list; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } playerResults; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} EndOfHandShowCards_t; + } EndOfHandShowCards_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_EndOfHandShowCards; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_EndOfHandShowCards; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ErrorMessage.c b/src/third_party/asn1/ErrorMessage.c index d1b2c1b9..b32c0be2 100644 --- a/src/third_party/asn1/ErrorMessage.c +++ b/src/third_party/asn1/ErrorMessage.c @@ -9,7 +9,7 @@ static int errorReason_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ errorReason_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void errorReason_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { errorReason_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int errorReason_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { errorReason_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t errorReason_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { errorReason_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t errorReason_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { errorReason_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t errorReason_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { errorReason_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t errorReason_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { errorReason_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -141,17 +141,17 @@ asn_TYPE_descriptor_t asn_DEF_errorReason_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_errorReason_tags_2, sizeof(asn_DEF_errorReason_tags_2) - /sizeof(asn_DEF_errorReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_errorReason_tags_2[0]), /* 1 */ asn_DEF_errorReason_tags_2, /* Same as above */ sizeof(asn_DEF_errorReason_tags_2) - /sizeof(asn_DEF_errorReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_errorReason_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_errorReason_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_ErrorMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ErrorMessage, errorReason), + { ATF_NOFLAGS, 0, offsetof(struct ErrorMessage, errorReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_errorReason_2, @@ -159,14 +159,14 @@ static asn_TYPE_member_t asn_MBR_ErrorMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "errorReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_ErrorMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (255 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ErrorMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* errorReason at 737 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* errorReason at 760 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ErrorMessage_specs_1 = { sizeof(struct ErrorMessage), @@ -191,10 +191,10 @@ asn_TYPE_descriptor_t asn_DEF_ErrorMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ErrorMessage_tags_1, sizeof(asn_DEF_ErrorMessage_tags_1) - /sizeof(asn_DEF_ErrorMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_ErrorMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_ErrorMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ErrorMessage_tags_1) - /sizeof(asn_DEF_ErrorMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_ErrorMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ErrorMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/ErrorMessage.h b/src/third_party/asn1/ErrorMessage.h index 85a731fb..9bde1055 100644 --- a/src/third_party/asn1/ErrorMessage.h +++ b/src/third_party/asn1/ErrorMessage.h @@ -19,40 +19,41 @@ extern "C" { #endif -/* Dependencies */ -typedef enum errorReason { - errorReason_errorReserved = 0, - errorReason_errorInitVersionNotSupported = 1, - errorReason_errorInitServerFull = 2, - errorReason_errorInitAuthFailure = 3, - errorReason_errorInitPlayerNameInUse = 4, - errorReason_errorInitInvalidPlayerName = 5, - errorReason_errorInitServerMaintenance = 6, - errorReason_errorInitBlocked = 7, - errorReason_errorAvatarTooLarge = 8, - errorReason_errorInvalidPacket = 256, - errorReason_errorInvalidState = 257, - errorReason_errorKickedFromServer = 258, - errorReason_errorBannedFromServer = 259, - errorReason_errorBlockedByServer = 260, - errorReason_errorSessionTimeout = 261 -} e_errorReason; + /* Dependencies */ + typedef enum errorReason { + errorReason_errorReserved = 0, + errorReason_errorInitVersionNotSupported = 1, + errorReason_errorInitServerFull = 2, + errorReason_errorInitAuthFailure = 3, + errorReason_errorInitPlayerNameInUse = 4, + errorReason_errorInitInvalidPlayerName = 5, + errorReason_errorInitServerMaintenance = 6, + errorReason_errorInitBlocked = 7, + errorReason_errorAvatarTooLarge = 8, + errorReason_errorInvalidPacket = 256, + errorReason_errorInvalidState = 257, + errorReason_errorKickedFromServer = 258, + errorReason_errorBannedFromServer = 259, + errorReason_errorBlockedByServer = 260, + errorReason_errorSessionTimeout = 261 + } + e_errorReason; -/* ErrorMessage */ -typedef struct ErrorMessage { - long errorReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ErrorMessage_t; + /* ErrorMessage */ + typedef struct ErrorMessage { + long errorReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_errorReason_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_ErrorMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ErrorMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_errorReason_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_ErrorMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameAdminChanged.c b/src/third_party/asn1/GameAdminChanged.c index f4c5acc5..74666482 100644 --- a/src/third_party/asn1/GameAdminChanged.c +++ b/src/third_party/asn1/GameAdminChanged.c @@ -8,7 +8,7 @@ #include "GameAdminChanged.h" static asn_TYPE_member_t asn_MBR_GameAdminChanged_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GameAdminChanged, newAdminPlayerId), + { ATF_NOFLAGS, 0, offsetof(struct GameAdminChanged, newAdminPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_GameAdminChanged_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "newAdminPlayerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_GameAdminChanged_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GameAdminChanged_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* newAdminPlayerId at 377 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* newAdminPlayerId at 384 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GameAdminChanged_specs_1 = { sizeof(struct GameAdminChanged), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_GameAdminChanged = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GameAdminChanged_tags_1, sizeof(asn_DEF_GameAdminChanged_tags_1) - /sizeof(asn_DEF_GameAdminChanged_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameAdminChanged_tags_1[0]), /* 1 */ asn_DEF_GameAdminChanged_tags_1, /* Same as above */ sizeof(asn_DEF_GameAdminChanged_tags_1) - /sizeof(asn_DEF_GameAdminChanged_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameAdminChanged_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GameAdminChanged_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/GameAdminChanged.h b/src/third_party/asn1/GameAdminChanged.h index 1e0bfebc..9365dd6f 100644 --- a/src/third_party/asn1/GameAdminChanged.h +++ b/src/third_party/asn1/GameAdminChanged.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* GameAdminChanged */ -typedef struct GameAdminChanged { - NonZeroId_t newAdminPlayerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GameAdminChanged_t; + /* GameAdminChanged */ + typedef struct GameAdminChanged { + NonZeroId_t newAdminPlayerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GameAdminChanged; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GameAdminChanged_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameAdminChanged; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameListAdminChanged.c b/src/third_party/asn1/GameListAdminChanged.c index 053de00a..cddfbccc 100644 --- a/src/third_party/asn1/GameListAdminChanged.c +++ b/src/third_party/asn1/GameListAdminChanged.c @@ -8,7 +8,7 @@ #include "GameListAdminChanged.h" static asn_TYPE_member_t asn_MBR_GameListAdminChanged_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GameListAdminChanged, newAdminPlayerId), + { ATF_NOFLAGS, 0, offsetof(struct GameListAdminChanged, newAdminPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_GameListAdminChanged_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "newAdminPlayerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_GameListAdminChanged_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GameListAdminChanged_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* newAdminPlayerId at 229 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* newAdminPlayerId at 231 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GameListAdminChanged_specs_1 = { sizeof(struct GameListAdminChanged), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_GameListAdminChanged = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GameListAdminChanged_tags_1, sizeof(asn_DEF_GameListAdminChanged_tags_1) - /sizeof(asn_DEF_GameListAdminChanged_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListAdminChanged_tags_1[0]), /* 1 */ asn_DEF_GameListAdminChanged_tags_1, /* Same as above */ sizeof(asn_DEF_GameListAdminChanged_tags_1) - /sizeof(asn_DEF_GameListAdminChanged_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListAdminChanged_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GameListAdminChanged_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/GameListAdminChanged.h b/src/third_party/asn1/GameListAdminChanged.h index 09b26382..164f9c3d 100644 --- a/src/third_party/asn1/GameListAdminChanged.h +++ b/src/third_party/asn1/GameListAdminChanged.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* GameListAdminChanged */ -typedef struct GameListAdminChanged { - NonZeroId_t newAdminPlayerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GameListAdminChanged_t; + /* GameListAdminChanged */ + typedef struct GameListAdminChanged { + NonZeroId_t newAdminPlayerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GameListAdminChanged; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GameListAdminChanged_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameListAdminChanged; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameListMessage.c b/src/third_party/asn1/GameListMessage.c index 54476e76..f79fbe0e 100644 --- a/src/third_party/asn1/GameListMessage.c +++ b/src/third_party/asn1/GameListMessage.c @@ -8,7 +8,7 @@ #include "GameListMessage.h" static asn_TYPE_member_t asn_MBR_gameListNotification_3[] = { - { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListNew), + { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListNew), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GameListNew, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_gameListNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameListNew" - }, - { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListUpdate), + }, + { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListUpdate), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GameListUpdate, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_gameListNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameListUpdate" - }, - { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListPlayerJoined), + }, + { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListPlayerJoined), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GameListPlayerJoined, @@ -34,8 +34,8 @@ static asn_TYPE_member_t asn_MBR_gameListNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameListPlayerJoined" - }, - { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListPlayerLeft), + }, + { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListPlayerLeft), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GameListPlayerLeft, @@ -43,8 +43,8 @@ static asn_TYPE_member_t asn_MBR_gameListNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameListPlayerLeft" - }, - { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListAdminChanged), + }, + { ATF_NOFLAGS, 0, offsetof(struct gameListNotification, choice.gameListAdminChanged), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GameListAdminChanged, @@ -52,14 +52,14 @@ static asn_TYPE_member_t asn_MBR_gameListNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameListAdminChanged" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_gameListNotification_tag2el_3[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gameListNew at 199 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gameListUpdate at 200 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* gameListPlayerJoined at 201 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* gameListPlayerLeft at 202 */ - { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* gameListAdminChanged at 204 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gameListNew at 201 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gameListUpdate at 202 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* gameListPlayerJoined at 203 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* gameListPlayerLeft at 204 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* gameListAdminChanged at 206 */ }; static asn_CHOICE_specifics_t asn_SPC_gameListNotification_specs_3 = { sizeof(struct gameListNotification), @@ -95,7 +95,7 @@ asn_TYPE_descriptor_t asn_DEF_gameListNotification_3 = { }; static asn_TYPE_member_t asn_MBR_GameListMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GameListMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct GameListMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -103,8 +103,8 @@ static asn_TYPE_member_t asn_MBR_GameListMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct GameListMessage, gameListNotification), + }, + { ATF_NOFLAGS, 0, offsetof(struct GameListMessage, gameListNotification), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_gameListNotification_3, @@ -112,19 +112,19 @@ static asn_TYPE_member_t asn_MBR_GameListMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameListNotification" - }, + }, }; static ber_tlv_tag_t asn_DEF_GameListMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (7 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GameListMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 197 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* gameListNew at 199 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gameListUpdate at 200 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* gameListPlayerJoined at 201 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 }, /* gameListPlayerLeft at 202 */ - { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 1, 0, 0 } /* gameListAdminChanged at 204 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 199 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* gameListNew at 201 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gameListUpdate at 202 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* gameListPlayerJoined at 203 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 }, /* gameListPlayerLeft at 204 */ + { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 1, 0, 0 } /* gameListAdminChanged at 206 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GameListMessage_specs_1 = { sizeof(struct GameListMessage), @@ -149,10 +149,10 @@ asn_TYPE_descriptor_t asn_DEF_GameListMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GameListMessage_tags_1, sizeof(asn_DEF_GameListMessage_tags_1) - /sizeof(asn_DEF_GameListMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_GameListMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_GameListMessage_tags_1, /* Same as above */ sizeof(asn_DEF_GameListMessage_tags_1) - /sizeof(asn_DEF_GameListMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_GameListMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_GameListMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/GameListMessage.h b/src/third_party/asn1/GameListMessage.h index ff709a04..c19d49fc 100644 --- a/src/third_party/asn1/GameListMessage.h +++ b/src/third_party/asn1/GameListMessage.h @@ -25,49 +25,50 @@ extern "C" { #endif -/* Dependencies */ -typedef enum gameListNotification_PR { - gameListNotification_PR_NOTHING, /* No components present */ - gameListNotification_PR_gameListNew, - gameListNotification_PR_gameListUpdate, - gameListNotification_PR_gameListPlayerJoined, - gameListNotification_PR_gameListPlayerLeft, - gameListNotification_PR_gameListAdminChanged, - /* Extensions may appear below */ - -} gameListNotification_PR; + /* Dependencies */ + typedef enum gameListNotification_PR { + gameListNotification_PR_NOTHING, /* No components present */ + gameListNotification_PR_gameListNew, + gameListNotification_PR_gameListUpdate, + gameListNotification_PR_gameListPlayerJoined, + gameListNotification_PR_gameListPlayerLeft, + gameListNotification_PR_gameListAdminChanged, + /* Extensions may appear below */ + + } + gameListNotification_PR; + + /* GameListMessage */ + typedef struct GameListMessage { + NonZeroId_t gameId; + struct gameListNotification { + gameListNotification_PR present; + union GameListMessage__gameListNotification_u { + GameListNew_t gameListNew; + GameListUpdate_t gameListUpdate; + GameListPlayerJoined_t gameListPlayerJoined; + GameListPlayerLeft_t gameListPlayerLeft; + GameListAdminChanged_t gameListAdminChanged; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } gameListNotification; + /* + * This type is extensible, + * possible extensions are below. + */ -/* GameListMessage */ -typedef struct GameListMessage { - NonZeroId_t gameId; - struct gameListNotification { - gameListNotification_PR present; - union GameListMessage__gameListNotification_u { - GameListNew_t gameListNew; - GameListUpdate_t gameListUpdate; - GameListPlayerJoined_t gameListPlayerJoined; - GameListPlayerLeft_t gameListPlayerLeft; - GameListAdminChanged_t gameListAdminChanged; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } gameListNotification; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GameListMessage_t; + } GameListMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GameListMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameListMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameListNew.c b/src/third_party/asn1/GameListNew.c index b8030d04..2a74b78e 100644 --- a/src/third_party/asn1/GameListNew.c +++ b/src/third_party/asn1/GameListNew.c @@ -9,32 +9,32 @@ static int memb_playerIds_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + /* Determine the number of elements */ size = _A_CSEQUENCE_FROM_VOID(sptr)->count; - + if((size <= 10)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_playerIds_4[] = { - { ATF_POINTER, 0, 0, + { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_playerIds_4[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "" - }, + }, }; static ber_tlv_tag_t asn_DEF_playerIds_tags_4[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) @@ -67,10 +67,10 @@ asn_TYPE_descriptor_t asn_DEF_playerIds_4 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_playerIds_tags_4, sizeof(asn_DEF_playerIds_tags_4) - /sizeof(asn_DEF_playerIds_tags_4[0]), /* 1 */ + /sizeof(asn_DEF_playerIds_tags_4[0]), /* 1 */ asn_DEF_playerIds_tags_4, /* Same as above */ sizeof(asn_DEF_playerIds_tags_4) - /sizeof(asn_DEF_playerIds_tags_4[0]), /* 1 */ + /sizeof(asn_DEF_playerIds_tags_4[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_playerIds_4, 1, /* Single element */ @@ -78,7 +78,7 @@ asn_TYPE_descriptor_t asn_DEF_playerIds_4 = { }; static asn_TYPE_member_t asn_MBR_GameListNew_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GameListNew, gameMode), + { ATF_NOFLAGS, 0, offsetof(struct GameListNew, gameMode), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetGameMode, @@ -86,8 +86,8 @@ static asn_TYPE_member_t asn_MBR_GameListNew_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameMode" - }, - { ATF_NOFLAGS, 0, offsetof(struct GameListNew, isPrivate), + }, + { ATF_NOFLAGS, 0, offsetof(struct GameListNew, isPrivate), (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, &asn_DEF_BOOLEAN, @@ -95,8 +95,8 @@ static asn_TYPE_member_t asn_MBR_GameListNew_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "isPrivate" - }, - { ATF_NOFLAGS, 0, offsetof(struct GameListNew, playerIds), + }, + { ATF_NOFLAGS, 0, offsetof(struct GameListNew, playerIds), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_playerIds_4, @@ -104,8 +104,8 @@ static asn_TYPE_member_t asn_MBR_GameListNew_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerIds" - }, - { ATF_NOFLAGS, 0, offsetof(struct GameListNew, adminPlayerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct GameListNew, adminPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -113,8 +113,8 @@ static asn_TYPE_member_t asn_MBR_GameListNew_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "adminPlayerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct GameListNew, gameInfo), + }, + { ATF_NOFLAGS, 0, offsetof(struct GameListNew, gameInfo), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_NetGameInfo, @@ -122,17 +122,17 @@ static asn_TYPE_member_t asn_MBR_GameListNew_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameInfo" - }, + }, }; static ber_tlv_tag_t asn_DEF_GameListNew_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GameListNew_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* isPrivate at 209 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, 0, 0 }, /* adminPlayerId at 211 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 }, /* gameMode at 208 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 1 }, /* playerIds at 210 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -1, 0 } /* gameInfo at 213 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* isPrivate at 211 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, 0, 0 }, /* adminPlayerId at 213 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 }, /* gameMode at 210 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 1 }, /* playerIds at 212 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, -1, 0 } /* gameInfo at 215 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GameListNew_specs_1 = { sizeof(struct GameListNew), @@ -157,10 +157,10 @@ asn_TYPE_descriptor_t asn_DEF_GameListNew = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GameListNew_tags_1, sizeof(asn_DEF_GameListNew_tags_1) - /sizeof(asn_DEF_GameListNew_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListNew_tags_1[0]), /* 1 */ asn_DEF_GameListNew_tags_1, /* Same as above */ sizeof(asn_DEF_GameListNew_tags_1) - /sizeof(asn_DEF_GameListNew_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListNew_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GameListNew_1, 5, /* Elements count */ diff --git a/src/third_party/asn1/GameListNew.h b/src/third_party/asn1/GameListNew.h index b547ead5..a3ccfae1 100644 --- a/src/third_party/asn1/GameListNew.h +++ b/src/third_party/asn1/GameListNew.h @@ -24,29 +24,29 @@ extern "C" { #endif -/* GameListNew */ -typedef struct GameListNew { - NetGameMode_t gameMode; - BOOLEAN_t isPrivate; - struct playerIds { - A_SEQUENCE_OF(NonZeroId_t) list; - + /* GameListNew */ + typedef struct GameListNew { + NetGameMode_t gameMode; + BOOLEAN_t isPrivate; + struct playerIds { + A_SEQUENCE_OF(NonZeroId_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } playerIds; + NonZeroId_t adminPlayerId; + NetGameInfo_t gameInfo; + /* + * This type is extensible, + * possible extensions are below. + */ + /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } playerIds; - NonZeroId_t adminPlayerId; - NetGameInfo_t gameInfo; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GameListNew_t; + } GameListNew_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GameListNew; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameListNew; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameListPlayerJoined.c b/src/third_party/asn1/GameListPlayerJoined.c index 218f9ae8..40461f2a 100644 --- a/src/third_party/asn1/GameListPlayerJoined.c +++ b/src/third_party/asn1/GameListPlayerJoined.c @@ -8,7 +8,7 @@ #include "GameListPlayerJoined.h" static asn_TYPE_member_t asn_MBR_GameListPlayerJoined_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GameListPlayerJoined, playerId), + { ATF_NOFLAGS, 0, offsetof(struct GameListPlayerJoined, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_GameListPlayerJoined_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_GameListPlayerJoined_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GameListPlayerJoined_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 221 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 223 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GameListPlayerJoined_specs_1 = { sizeof(struct GameListPlayerJoined), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_GameListPlayerJoined = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GameListPlayerJoined_tags_1, sizeof(asn_DEF_GameListPlayerJoined_tags_1) - /sizeof(asn_DEF_GameListPlayerJoined_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListPlayerJoined_tags_1[0]), /* 1 */ asn_DEF_GameListPlayerJoined_tags_1, /* Same as above */ sizeof(asn_DEF_GameListPlayerJoined_tags_1) - /sizeof(asn_DEF_GameListPlayerJoined_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListPlayerJoined_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GameListPlayerJoined_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/GameListPlayerJoined.h b/src/third_party/asn1/GameListPlayerJoined.h index 89c938ea..67bc0b22 100644 --- a/src/third_party/asn1/GameListPlayerJoined.h +++ b/src/third_party/asn1/GameListPlayerJoined.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* GameListPlayerJoined */ -typedef struct GameListPlayerJoined { - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GameListPlayerJoined_t; + /* GameListPlayerJoined */ + typedef struct GameListPlayerJoined { + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GameListPlayerJoined; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GameListPlayerJoined_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameListPlayerJoined; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameListPlayerLeft.c b/src/third_party/asn1/GameListPlayerLeft.c index f7694eeb..3fc31822 100644 --- a/src/third_party/asn1/GameListPlayerLeft.c +++ b/src/third_party/asn1/GameListPlayerLeft.c @@ -8,7 +8,7 @@ #include "GameListPlayerLeft.h" static asn_TYPE_member_t asn_MBR_GameListPlayerLeft_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GameListPlayerLeft, playerId), + { ATF_NOFLAGS, 0, offsetof(struct GameListPlayerLeft, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_GameListPlayerLeft_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_GameListPlayerLeft_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GameListPlayerLeft_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 225 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 227 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GameListPlayerLeft_specs_1 = { sizeof(struct GameListPlayerLeft), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_GameListPlayerLeft = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GameListPlayerLeft_tags_1, sizeof(asn_DEF_GameListPlayerLeft_tags_1) - /sizeof(asn_DEF_GameListPlayerLeft_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListPlayerLeft_tags_1[0]), /* 1 */ asn_DEF_GameListPlayerLeft_tags_1, /* Same as above */ sizeof(asn_DEF_GameListPlayerLeft_tags_1) - /sizeof(asn_DEF_GameListPlayerLeft_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListPlayerLeft_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GameListPlayerLeft_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/GameListPlayerLeft.h b/src/third_party/asn1/GameListPlayerLeft.h index 4377051a..36558466 100644 --- a/src/third_party/asn1/GameListPlayerLeft.h +++ b/src/third_party/asn1/GameListPlayerLeft.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* GameListPlayerLeft */ -typedef struct GameListPlayerLeft { - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GameListPlayerLeft_t; + /* GameListPlayerLeft */ + typedef struct GameListPlayerLeft { + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GameListPlayerLeft; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GameListPlayerLeft_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameListPlayerLeft; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameListUpdate.c b/src/third_party/asn1/GameListUpdate.c index 7695de8c..602f7d0b 100644 --- a/src/third_party/asn1/GameListUpdate.c +++ b/src/third_party/asn1/GameListUpdate.c @@ -8,7 +8,7 @@ #include "GameListUpdate.h" static asn_TYPE_member_t asn_MBR_GameListUpdate_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GameListUpdate, gameMode), + { ATF_NOFLAGS, 0, offsetof(struct GameListUpdate, gameMode), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetGameMode, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_GameListUpdate_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameMode" - }, + }, }; static ber_tlv_tag_t asn_DEF_GameListUpdate_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GameListUpdate_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* gameMode at 217 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* gameMode at 219 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GameListUpdate_specs_1 = { sizeof(struct GameListUpdate), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_GameListUpdate = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GameListUpdate_tags_1, sizeof(asn_DEF_GameListUpdate_tags_1) - /sizeof(asn_DEF_GameListUpdate_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListUpdate_tags_1[0]), /* 1 */ asn_DEF_GameListUpdate_tags_1, /* Same as above */ sizeof(asn_DEF_GameListUpdate_tags_1) - /sizeof(asn_DEF_GameListUpdate_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GameListUpdate_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GameListUpdate_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/GameListUpdate.h b/src/third_party/asn1/GameListUpdate.h index e5d9e2f7..ceed3011 100644 --- a/src/third_party/asn1/GameListUpdate.h +++ b/src/third_party/asn1/GameListUpdate.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* GameListUpdate */ -typedef struct GameListUpdate { - NetGameMode_t gameMode; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GameListUpdate_t; + /* GameListUpdate */ + typedef struct GameListUpdate { + NetGameMode_t gameMode; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GameListUpdate; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GameListUpdate_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameListUpdate; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GamePlayerJoined.c b/src/third_party/asn1/GamePlayerJoined.c index b9a0db16..307c0e87 100644 --- a/src/third_party/asn1/GamePlayerJoined.c +++ b/src/third_party/asn1/GamePlayerJoined.c @@ -8,7 +8,7 @@ #include "GamePlayerJoined.h" static asn_TYPE_member_t asn_MBR_GamePlayerJoined_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GamePlayerJoined, playerId), + { ATF_NOFLAGS, 0, offsetof(struct GamePlayerJoined, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_GamePlayerJoined_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct GamePlayerJoined, isGameAdmin), + }, + { ATF_NOFLAGS, 0, offsetof(struct GamePlayerJoined, isGameAdmin), (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, &asn_DEF_BOOLEAN, @@ -25,14 +25,14 @@ static asn_TYPE_member_t asn_MBR_GamePlayerJoined_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "isGameAdmin" - }, + }, }; static ber_tlv_tag_t asn_DEF_GamePlayerJoined_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GamePlayerJoined_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* isGameAdmin at 363 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 362 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* isGameAdmin at 370 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 369 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GamePlayerJoined_specs_1 = { sizeof(struct GamePlayerJoined), @@ -57,10 +57,10 @@ asn_TYPE_descriptor_t asn_DEF_GamePlayerJoined = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GamePlayerJoined_tags_1, sizeof(asn_DEF_GamePlayerJoined_tags_1) - /sizeof(asn_DEF_GamePlayerJoined_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GamePlayerJoined_tags_1[0]), /* 1 */ asn_DEF_GamePlayerJoined_tags_1, /* Same as above */ sizeof(asn_DEF_GamePlayerJoined_tags_1) - /sizeof(asn_DEF_GamePlayerJoined_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GamePlayerJoined_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GamePlayerJoined_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/GamePlayerJoined.h b/src/third_party/asn1/GamePlayerJoined.h index d6977db3..c8a137ff 100644 --- a/src/third_party/asn1/GamePlayerJoined.h +++ b/src/third_party/asn1/GamePlayerJoined.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* GamePlayerJoined */ -typedef struct GamePlayerJoined { - NonZeroId_t playerId; - BOOLEAN_t isGameAdmin; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GamePlayerJoined_t; + /* GamePlayerJoined */ + typedef struct GamePlayerJoined { + NonZeroId_t playerId; + BOOLEAN_t isGameAdmin; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GamePlayerJoined; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GamePlayerJoined_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GamePlayerJoined; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GamePlayerLeft.c b/src/third_party/asn1/GamePlayerLeft.c index e0f882a0..ffb0f371 100644 --- a/src/third_party/asn1/GamePlayerLeft.c +++ b/src/third_party/asn1/GamePlayerLeft.c @@ -9,7 +9,7 @@ static int gamePlayerLeftReason_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ gamePlayerLeftReason_3_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void gamePlayerLeftReason_3_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { gamePlayerLeftReason_3_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int gamePlayerLeftReason_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { gamePlayerLeftReason_3_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t gamePlayerLeftReason_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { gamePlayerLeftReason_3_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t gamePlayerLeftReason_3_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { gamePlayerLeftReason_3_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t gamePlayerLeftReason_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { gamePlayerLeftReason_3_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t gamePlayerLeftReason_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { gamePlayerLeftReason_3_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -117,17 +117,17 @@ asn_TYPE_descriptor_t asn_DEF_gamePlayerLeftReason_3 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_gamePlayerLeftReason_tags_3, sizeof(asn_DEF_gamePlayerLeftReason_tags_3) - /sizeof(asn_DEF_gamePlayerLeftReason_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_gamePlayerLeftReason_tags_3[0]), /* 1 */ asn_DEF_gamePlayerLeftReason_tags_3, /* Same as above */ sizeof(asn_DEF_gamePlayerLeftReason_tags_3) - /sizeof(asn_DEF_gamePlayerLeftReason_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_gamePlayerLeftReason_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_gamePlayerLeftReason_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_GamePlayerLeft_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GamePlayerLeft, playerId), + { ATF_NOFLAGS, 0, offsetof(struct GamePlayerLeft, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -135,8 +135,8 @@ static asn_TYPE_member_t asn_MBR_GamePlayerLeft_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct GamePlayerLeft, gamePlayerLeftReason), + }, + { ATF_NOFLAGS, 0, offsetof(struct GamePlayerLeft, gamePlayerLeftReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_gamePlayerLeftReason_3, @@ -144,14 +144,14 @@ static asn_TYPE_member_t asn_MBR_GamePlayerLeft_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gamePlayerLeftReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_GamePlayerLeft_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GamePlayerLeft_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* playerId at 367 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* gamePlayerLeftReason at 369 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* playerId at 374 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* gamePlayerLeftReason at 376 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GamePlayerLeft_specs_1 = { sizeof(struct GamePlayerLeft), @@ -176,10 +176,10 @@ asn_TYPE_descriptor_t asn_DEF_GamePlayerLeft = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GamePlayerLeft_tags_1, sizeof(asn_DEF_GamePlayerLeft_tags_1) - /sizeof(asn_DEF_GamePlayerLeft_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GamePlayerLeft_tags_1[0]), /* 1 */ asn_DEF_GamePlayerLeft_tags_1, /* Same as above */ sizeof(asn_DEF_GamePlayerLeft_tags_1) - /sizeof(asn_DEF_GamePlayerLeft_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GamePlayerLeft_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GamePlayerLeft_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/GamePlayerLeft.h b/src/third_party/asn1/GamePlayerLeft.h index dbb5e01d..b45401bd 100644 --- a/src/third_party/asn1/GamePlayerLeft.h +++ b/src/third_party/asn1/GamePlayerLeft.h @@ -20,29 +20,30 @@ extern "C" { #endif -/* Dependencies */ -typedef enum gamePlayerLeftReason { - gamePlayerLeftReason_leftOnRequest = 0, - gamePlayerLeftReason_leftKicked = 1, - gamePlayerLeftReason_leftError = 2 -} e_gamePlayerLeftReason; + /* Dependencies */ + typedef enum gamePlayerLeftReason { + gamePlayerLeftReason_leftOnRequest = 0, + gamePlayerLeftReason_leftKicked = 1, + gamePlayerLeftReason_leftError = 2 + } + e_gamePlayerLeftReason; -/* GamePlayerLeft */ -typedef struct GamePlayerLeft { - NonZeroId_t playerId; - long gamePlayerLeftReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GamePlayerLeft_t; + /* GamePlayerLeft */ + typedef struct GamePlayerLeft { + NonZeroId_t playerId; + long gamePlayerLeftReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_gamePlayerLeftReason_3; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_GamePlayerLeft; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GamePlayerLeft_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_gamePlayerLeftReason_3; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_GamePlayerLeft; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GamePlayerMessage.c b/src/third_party/asn1/GamePlayerMessage.c index bb932c0b..ba04c343 100644 --- a/src/third_party/asn1/GamePlayerMessage.c +++ b/src/third_party/asn1/GamePlayerMessage.c @@ -8,7 +8,7 @@ #include "GamePlayerMessage.h" static asn_TYPE_member_t asn_MBR_gamePlayerNotification_3[] = { - { ATF_NOFLAGS, 0, offsetof(struct gamePlayerNotification, choice.gamePlayerJoined), + { ATF_NOFLAGS, 0, offsetof(struct gamePlayerNotification, choice.gamePlayerJoined), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GamePlayerJoined, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_gamePlayerNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gamePlayerJoined" - }, - { ATF_NOFLAGS, 0, offsetof(struct gamePlayerNotification, choice.gamePlayerLeft), + }, + { ATF_NOFLAGS, 0, offsetof(struct gamePlayerNotification, choice.gamePlayerLeft), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GamePlayerLeft, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_gamePlayerNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gamePlayerLeft" - }, - { ATF_NOFLAGS, 0, offsetof(struct gamePlayerNotification, choice.gameAdminChanged), + }, + { ATF_NOFLAGS, 0, offsetof(struct gamePlayerNotification, choice.gameAdminChanged), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GameAdminChanged, @@ -34,8 +34,8 @@ static asn_TYPE_member_t asn_MBR_gamePlayerNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameAdminChanged" - }, - { ATF_NOFLAGS, 0, offsetof(struct gamePlayerNotification, choice.removedFromGame), + }, + { ATF_NOFLAGS, 0, offsetof(struct gamePlayerNotification, choice.removedFromGame), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_RemovedFromGame, @@ -43,13 +43,13 @@ static asn_TYPE_member_t asn_MBR_gamePlayerNotification_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "removedFromGame" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_gamePlayerNotification_tag2el_3[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gamePlayerJoined at 354 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gamePlayerLeft at 355 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* gameAdminChanged at 356 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* removedFromGame at 358 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gamePlayerJoined at 361 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gamePlayerLeft at 362 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* gameAdminChanged at 363 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* removedFromGame at 365 */ }; static asn_CHOICE_specifics_t asn_SPC_gamePlayerNotification_specs_3 = { sizeof(struct gamePlayerNotification), @@ -85,7 +85,7 @@ asn_TYPE_descriptor_t asn_DEF_gamePlayerNotification_3 = { }; static asn_TYPE_member_t asn_MBR_GamePlayerMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GamePlayerMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct GamePlayerMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -93,8 +93,8 @@ static asn_TYPE_member_t asn_MBR_GamePlayerMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct GamePlayerMessage, gamePlayerNotification), + }, + { ATF_NOFLAGS, 0, offsetof(struct GamePlayerMessage, gamePlayerNotification), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_gamePlayerNotification_3, @@ -102,18 +102,18 @@ static asn_TYPE_member_t asn_MBR_GamePlayerMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gamePlayerNotification" - }, + }, }; static ber_tlv_tag_t asn_DEF_GamePlayerMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (13 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GamePlayerMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 352 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* gamePlayerJoined at 354 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gamePlayerLeft at 355 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* gameAdminChanged at 356 */ - { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* removedFromGame at 358 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 359 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* gamePlayerJoined at 361 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* gamePlayerLeft at 362 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 }, /* gameAdminChanged at 363 */ + { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 1, 0, 0 } /* removedFromGame at 365 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GamePlayerMessage_specs_1 = { sizeof(struct GamePlayerMessage), @@ -138,10 +138,10 @@ asn_TYPE_descriptor_t asn_DEF_GamePlayerMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GamePlayerMessage_tags_1, sizeof(asn_DEF_GamePlayerMessage_tags_1) - /sizeof(asn_DEF_GamePlayerMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_GamePlayerMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_GamePlayerMessage_tags_1, /* Same as above */ sizeof(asn_DEF_GamePlayerMessage_tags_1) - /sizeof(asn_DEF_GamePlayerMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_GamePlayerMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_GamePlayerMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/GamePlayerMessage.h b/src/third_party/asn1/GamePlayerMessage.h index 25e54544..c0646279 100644 --- a/src/third_party/asn1/GamePlayerMessage.h +++ b/src/third_party/asn1/GamePlayerMessage.h @@ -24,47 +24,48 @@ extern "C" { #endif -/* Dependencies */ -typedef enum gamePlayerNotification_PR { - gamePlayerNotification_PR_NOTHING, /* No components present */ - gamePlayerNotification_PR_gamePlayerJoined, - gamePlayerNotification_PR_gamePlayerLeft, - gamePlayerNotification_PR_gameAdminChanged, - gamePlayerNotification_PR_removedFromGame, - /* Extensions may appear below */ - -} gamePlayerNotification_PR; + /* Dependencies */ + typedef enum gamePlayerNotification_PR { + gamePlayerNotification_PR_NOTHING, /* No components present */ + gamePlayerNotification_PR_gamePlayerJoined, + gamePlayerNotification_PR_gamePlayerLeft, + gamePlayerNotification_PR_gameAdminChanged, + gamePlayerNotification_PR_removedFromGame, + /* Extensions may appear below */ + + } + gamePlayerNotification_PR; + + /* GamePlayerMessage */ + typedef struct GamePlayerMessage { + NonZeroId_t gameId; + struct gamePlayerNotification { + gamePlayerNotification_PR present; + union GamePlayerMessage__gamePlayerNotification_u { + GamePlayerJoined_t gamePlayerJoined; + GamePlayerLeft_t gamePlayerLeft; + GameAdminChanged_t gameAdminChanged; + RemovedFromGame_t removedFromGame; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } gamePlayerNotification; + /* + * This type is extensible, + * possible extensions are below. + */ -/* GamePlayerMessage */ -typedef struct GamePlayerMessage { - NonZeroId_t gameId; - struct gamePlayerNotification { - gamePlayerNotification_PR present; - union GamePlayerMessage__gamePlayerNotification_u { - GamePlayerJoined_t gamePlayerJoined; - GamePlayerLeft_t gamePlayerLeft; - GameAdminChanged_t gameAdminChanged; - RemovedFromGame_t removedFromGame; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } gamePlayerNotification; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GamePlayerMessage_t; + } GamePlayerMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GamePlayerMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GamePlayerMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameStartMessage.c b/src/third_party/asn1/GameStartMessage.c index 443f05e1..0e7d7698 100644 --- a/src/third_party/asn1/GameStartMessage.c +++ b/src/third_party/asn1/GameStartMessage.c @@ -7,78 +7,65 @@ #include "GameStartMessage.h" -static int -memb_playerSeats_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { - size_t size; - - if(!sptr) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } - - /* Determine the number of elements */ - size = _A_CSEQUENCE_FROM_VOID(sptr)->count; - - if((size >= 2 && size <= 10)) { - /* Perform validation of the inner elements */ - return td->check_constraints(td, sptr, ctfailcb, app_key); - } else { - _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } -} - -static asn_TYPE_member_t asn_MBR_playerSeats_4[] = { - { ATF_POINTER, 0, 0, - (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), - 0, - &asn_DEF_NonZeroId, +static asn_TYPE_member_t asn_MBR_gameStartMode_4[] = { + { ATF_NOFLAGS, 0, offsetof(struct gameStartMode, choice.gameStartModeInitial), + (ASN_TAG_CLASS_CONTEXT | (0 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_GameStartModeInitial, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, - "" - }, + "gameStartModeInitial" + }, + { ATF_NOFLAGS, 0, offsetof(struct gameStartMode, choice.gameStartModeRejoin), + (ASN_TAG_CLASS_CONTEXT | (1 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_GameStartModeRejoin, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "gameStartModeRejoin" + }, }; -static ber_tlv_tag_t asn_DEF_playerSeats_tags_4[] = { - (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +static asn_TYPE_tag2member_t asn_MAP_gameStartMode_tag2el_4[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* gameStartModeInitial at 459 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* gameStartModeRejoin at 461 */ }; -static asn_SET_OF_specifics_t asn_SPC_playerSeats_specs_4 = { - sizeof(struct playerSeats), - offsetof(struct playerSeats, _asn_ctx), - 0, /* XER encoding is XMLDelimitedItemList */ +static asn_CHOICE_specifics_t asn_SPC_gameStartMode_specs_4 = { + sizeof(struct gameStartMode), + offsetof(struct gameStartMode, _asn_ctx), + offsetof(struct gameStartMode, present), + sizeof(((struct gameStartMode *)0)->present), + asn_MAP_gameStartMode_tag2el_4, + 2, /* Count of tags in the map */ + 0, + 2 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ -asn_TYPE_descriptor_t asn_DEF_playerSeats_4 = { - "playerSeats", - "playerSeats", - SEQUENCE_OF_free, - SEQUENCE_OF_print, - SEQUENCE_OF_constraint, - SEQUENCE_OF_decode_ber, - SEQUENCE_OF_encode_der, - SEQUENCE_OF_decode_xer, - SEQUENCE_OF_encode_xer, +asn_TYPE_descriptor_t asn_DEF_gameStartMode_4 = { + "gameStartMode", + "gameStartMode", + CHOICE_free, + CHOICE_print, + CHOICE_constraint, + CHOICE_decode_ber, + CHOICE_encode_der, + CHOICE_decode_xer, + CHOICE_encode_xer, 0, 0, /* No PER support, use "-gen-PER" to enable */ - 0, /* Use generic outmost tag fetcher */ - asn_DEF_playerSeats_tags_4, - sizeof(asn_DEF_playerSeats_tags_4) - /sizeof(asn_DEF_playerSeats_tags_4[0]), /* 1 */ - asn_DEF_playerSeats_tags_4, /* Same as above */ - sizeof(asn_DEF_playerSeats_tags_4) - /sizeof(asn_DEF_playerSeats_tags_4[0]), /* 1 */ + CHOICE_outmost_tag, + 0, /* No effective tags (pointer) */ + 0, /* No effective tags (count) */ + 0, /* No tags (pointer) */ + 0, /* No tags (count) */ 0, /* No PER visible constraints */ - asn_MBR_playerSeats_4, - 1, /* Single element */ - &asn_SPC_playerSeats_specs_4 /* Additional specs */ + asn_MBR_gameStartMode_4, + 2, /* Elements count */ + &asn_SPC_gameStartMode_specs_4 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_GameStartMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GameStartMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct GameStartMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -86,8 +73,8 @@ static asn_TYPE_member_t asn_MBR_GameStartMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct GameStartMessage, startDealerPlayerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct GameStartMessage, startDealerPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -95,31 +82,32 @@ static asn_TYPE_member_t asn_MBR_GameStartMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "startDealerPlayerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct GameStartMessage, playerSeats), - (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + }, + { ATF_NOFLAGS, 0, offsetof(struct GameStartMessage, gameStartMode), + -1 /* Ambiguous tag (CHOICE?) */, 0, - &asn_DEF_playerSeats_4, - memb_playerSeats_constraint_1, + &asn_DEF_gameStartMode_4, + 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, - "playerSeats" - }, + "gameStartMode" + }, }; static ber_tlv_tag_t asn_DEF_GameStartMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (22 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GameStartMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 436 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* startDealerPlayerId at 437 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 2, 0, 0 } /* playerSeats at 439 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 456 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* startDealerPlayerId at 457 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* gameStartModeInitial at 459 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* gameStartModeRejoin at 461 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GameStartMessage_specs_1 = { sizeof(struct GameStartMessage), offsetof(struct GameStartMessage, _asn_ctx), asn_MAP_GameStartMessage_tag2el_1, - 3, /* Count of tags in the map */ + 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 2, /* Start extensions */ 4 /* Stop extensions */ @@ -138,10 +126,10 @@ asn_TYPE_descriptor_t asn_DEF_GameStartMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GameStartMessage_tags_1, sizeof(asn_DEF_GameStartMessage_tags_1) - /sizeof(asn_DEF_GameStartMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_GameStartMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_GameStartMessage_tags_1, /* Same as above */ sizeof(asn_DEF_GameStartMessage_tags_1) - /sizeof(asn_DEF_GameStartMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_GameStartMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_GameStartMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/GameStartMessage.h b/src/third_party/asn1/GameStartMessage.h index 14ac5347..f3ac340f 100644 --- a/src/third_party/asn1/GameStartMessage.h +++ b/src/third_party/asn1/GameStartMessage.h @@ -13,35 +13,54 @@ /* Including external dependencies */ #include "NonZeroId.h" -#include -#include +#include "GameStartModeInitial.h" +#include "GameStartModeRejoin.h" +#include #include #ifdef __cplusplus extern "C" { #endif -/* GameStartMessage */ -typedef struct GameStartMessage { - NonZeroId_t gameId; - NonZeroId_t startDealerPlayerId; - struct playerSeats { - A_SEQUENCE_OF(NonZeroId_t) list; - + /* Dependencies */ + typedef enum gameStartMode_PR { + gameStartMode_PR_NOTHING, /* No components present */ + gameStartMode_PR_gameStartModeInitial, + gameStartMode_PR_gameStartModeRejoin, + /* Extensions may appear below */ + + } + gameStartMode_PR; + + /* GameStartMessage */ + typedef struct GameStartMessage { + NonZeroId_t gameId; + NonZeroId_t startDealerPlayerId; + struct gameStartMode { + gameStartMode_PR present; + union GameStartMessage__gameStartMode_u { + GameStartModeInitial_t gameStartModeInitial; + GameStartModeRejoin_t gameStartModeRejoin; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } gameStartMode; + /* + * This type is extensible, + * possible extensions are below. + */ + /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } playerSeats; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GameStartMessage_t; + } GameStartMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GameStartMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameStartMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/GameStartModeInitial.c b/src/third_party/asn1/GameStartModeInitial.c new file mode 100644 index 00000000..a0a86024 --- /dev/null +++ b/src/third_party/asn1/GameStartModeInitial.c @@ -0,0 +1,129 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#include "GameStartModeInitial.h" + +static int +memb_playerSeats_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + size_t size; + + if(!sptr) { + _ASN_CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + /* Determine the number of elements */ + size = _A_CSEQUENCE_FROM_VOID(sptr)->count; + + if((size >= 2 && size <= 10)) { + /* Perform validation of the inner elements */ + return td->check_constraints(td, sptr, ctfailcb, app_key); + } else { + _ASN_CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static asn_TYPE_member_t asn_MBR_playerSeats_2[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NonZeroId, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "" + }, +}; +static ber_tlv_tag_t asn_DEF_playerSeats_tags_2[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_playerSeats_specs_2 = { + sizeof(struct playerSeats), + offsetof(struct playerSeats, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_playerSeats_2 = { + "playerSeats", + "playerSeats", + SEQUENCE_OF_free, + SEQUENCE_OF_print, + SEQUENCE_OF_constraint, + SEQUENCE_OF_decode_ber, + SEQUENCE_OF_encode_der, + SEQUENCE_OF_decode_xer, + SEQUENCE_OF_encode_xer, + 0, 0, /* No PER support, use "-gen-PER" to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_playerSeats_tags_2, + sizeof(asn_DEF_playerSeats_tags_2) + /sizeof(asn_DEF_playerSeats_tags_2[0]), /* 1 */ + asn_DEF_playerSeats_tags_2, /* Same as above */ + sizeof(asn_DEF_playerSeats_tags_2) + /sizeof(asn_DEF_playerSeats_tags_2[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_playerSeats_2, + 1, /* Single element */ + &asn_SPC_playerSeats_specs_2 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_GameStartModeInitial_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct GameStartModeInitial, playerSeats), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_playerSeats_2, + memb_playerSeats_constraint_1, + 0, /* PER is not compiled, use -gen-PER */ + 0, + "playerSeats" + }, +}; +static ber_tlv_tag_t asn_DEF_GameStartModeInitial_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_TYPE_tag2member_t asn_MAP_GameStartModeInitial_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* playerSeats at 449 */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_GameStartModeInitial_specs_1 = { + sizeof(struct GameStartModeInitial), + offsetof(struct GameStartModeInitial, _asn_ctx), + asn_MAP_GameStartModeInitial_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 0, /* Start extensions */ + 2 /* Stop extensions */ +}; +asn_TYPE_descriptor_t asn_DEF_GameStartModeInitial = { + "GameStartModeInitial", + "GameStartModeInitial", + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_constraint, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, + 0, 0, /* No PER support, use "-gen-PER" to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_GameStartModeInitial_tags_1, + sizeof(asn_DEF_GameStartModeInitial_tags_1) + /sizeof(asn_DEF_GameStartModeInitial_tags_1[0]), /* 1 */ + asn_DEF_GameStartModeInitial_tags_1, /* Same as above */ + sizeof(asn_DEF_GameStartModeInitial_tags_1) + /sizeof(asn_DEF_GameStartModeInitial_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_GameStartModeInitial_1, + 1, /* Elements count */ + &asn_SPC_GameStartModeInitial_specs_1 /* Additional specs */ +}; + diff --git a/src/third_party/asn1/GameStartModeInitial.h b/src/third_party/asn1/GameStartModeInitial.h new file mode 100644 index 00000000..c00f44f6 --- /dev/null +++ b/src/third_party/asn1/GameStartModeInitial.h @@ -0,0 +1,49 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#ifndef _GameStartModeInitial_H_ +#define _GameStartModeInitial_H_ + + +#include + +/* Including external dependencies */ +#include "NonZeroId.h" +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + /* GameStartModeInitial */ + typedef struct GameStartModeInitial { + struct playerSeats { + A_SEQUENCE_OF(NonZeroId_t) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } playerSeats; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GameStartModeInitial_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameStartModeInitial; + +#ifdef __cplusplus +} +#endif + +#endif /* _GameStartModeInitial_H_ */ +#include diff --git a/src/third_party/asn1/GameStartModeRejoin.c b/src/third_party/asn1/GameStartModeRejoin.c new file mode 100644 index 00000000..a8cf979d --- /dev/null +++ b/src/third_party/asn1/GameStartModeRejoin.c @@ -0,0 +1,129 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#include "GameStartModeRejoin.h" + +static int +memb_rejoinPlayerData_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + size_t size; + + if(!sptr) { + _ASN_CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + /* Determine the number of elements */ + size = _A_CSEQUENCE_FROM_VOID(sptr)->count; + + if((size >= 2 && size <= 10)) { + /* Perform validation of the inner elements */ + return td->check_constraints(td, sptr, ctfailcb, app_key); + } else { + _ASN_CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static asn_TYPE_member_t asn_MBR_rejoinPlayerData_2[] = { + { ATF_POINTER, 0, 0, + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_RejoinPlayerData, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "" + }, +}; +static ber_tlv_tag_t asn_DEF_rejoinPlayerData_tags_2[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_SET_OF_specifics_t asn_SPC_rejoinPlayerData_specs_2 = { + sizeof(struct rejoinPlayerData), + offsetof(struct rejoinPlayerData, _asn_ctx), + 0, /* XER encoding is XMLDelimitedItemList */ +}; +static /* Use -fall-defs-global to expose */ +asn_TYPE_descriptor_t asn_DEF_rejoinPlayerData_2 = { + "rejoinPlayerData", + "rejoinPlayerData", + SEQUENCE_OF_free, + SEQUENCE_OF_print, + SEQUENCE_OF_constraint, + SEQUENCE_OF_decode_ber, + SEQUENCE_OF_encode_der, + SEQUENCE_OF_decode_xer, + SEQUENCE_OF_encode_xer, + 0, 0, /* No PER support, use "-gen-PER" to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_rejoinPlayerData_tags_2, + sizeof(asn_DEF_rejoinPlayerData_tags_2) + /sizeof(asn_DEF_rejoinPlayerData_tags_2[0]), /* 1 */ + asn_DEF_rejoinPlayerData_tags_2, /* Same as above */ + sizeof(asn_DEF_rejoinPlayerData_tags_2) + /sizeof(asn_DEF_rejoinPlayerData_tags_2[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_rejoinPlayerData_2, + 1, /* Single element */ + &asn_SPC_rejoinPlayerData_specs_2 /* Additional specs */ +}; + +static asn_TYPE_member_t asn_MBR_GameStartModeRejoin_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct GameStartModeRejoin, rejoinPlayerData), + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), + 0, + &asn_DEF_rejoinPlayerData_2, + memb_rejoinPlayerData_constraint_1, + 0, /* PER is not compiled, use -gen-PER */ + 0, + "rejoinPlayerData" + }, +}; +static ber_tlv_tag_t asn_DEF_GameStartModeRejoin_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_TYPE_tag2member_t asn_MAP_GameStartModeRejoin_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* rejoinPlayerData at 453 */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_GameStartModeRejoin_specs_1 = { + sizeof(struct GameStartModeRejoin), + offsetof(struct GameStartModeRejoin, _asn_ctx), + asn_MAP_GameStartModeRejoin_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 0, /* Start extensions */ + 2 /* Stop extensions */ +}; +asn_TYPE_descriptor_t asn_DEF_GameStartModeRejoin = { + "GameStartModeRejoin", + "GameStartModeRejoin", + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_constraint, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, + 0, 0, /* No PER support, use "-gen-PER" to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_GameStartModeRejoin_tags_1, + sizeof(asn_DEF_GameStartModeRejoin_tags_1) + /sizeof(asn_DEF_GameStartModeRejoin_tags_1[0]), /* 1 */ + asn_DEF_GameStartModeRejoin_tags_1, /* Same as above */ + sizeof(asn_DEF_GameStartModeRejoin_tags_1) + /sizeof(asn_DEF_GameStartModeRejoin_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_GameStartModeRejoin_1, + 1, /* Elements count */ + &asn_SPC_GameStartModeRejoin_specs_1 /* Additional specs */ +}; + diff --git a/src/third_party/asn1/GameStartModeRejoin.h b/src/third_party/asn1/GameStartModeRejoin.h new file mode 100644 index 00000000..c9eb4cd2 --- /dev/null +++ b/src/third_party/asn1/GameStartModeRejoin.h @@ -0,0 +1,54 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#ifndef _GameStartModeRejoin_H_ +#define _GameStartModeRejoin_H_ + + +#include + +/* Including external dependencies */ +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + /* Forward declarations */ + struct RejoinPlayerData; + + /* GameStartModeRejoin */ + typedef struct GameStartModeRejoin { + struct rejoinPlayerData { + A_SEQUENCE_OF(struct RejoinPlayerData) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } rejoinPlayerData; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GameStartModeRejoin_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GameStartModeRejoin; + +#ifdef __cplusplus +} +#endif + +/* Referred external types */ +#include "RejoinPlayerData.h" + +#endif /* _GameStartModeRejoin_H_ */ +#include diff --git a/src/third_party/asn1/GuestLogin.c b/src/third_party/asn1/GuestLogin.c index dcfb324a..6c3b8d98 100644 --- a/src/third_party/asn1/GuestLogin.c +++ b/src/third_party/asn1/GuestLogin.c @@ -9,38 +9,38 @@ static int memb_nickName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 64)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_GuestLogin_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct GuestLogin, nickName), + { ATF_NOFLAGS, 0, offsetof(struct GuestLogin, nickName), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -48,13 +48,13 @@ static asn_TYPE_member_t asn_MBR_GuestLogin_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "nickName" - }, + }, }; static ber_tlv_tag_t asn_DEF_GuestLogin_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_GuestLogin_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* nickName at 112 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* nickName at 113 */ }; static asn_SEQUENCE_specifics_t asn_SPC_GuestLogin_specs_1 = { sizeof(struct GuestLogin), @@ -79,10 +79,10 @@ asn_TYPE_descriptor_t asn_DEF_GuestLogin = { 0, /* Use generic outmost tag fetcher */ asn_DEF_GuestLogin_tags_1, sizeof(asn_DEF_GuestLogin_tags_1) - /sizeof(asn_DEF_GuestLogin_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GuestLogin_tags_1[0]), /* 1 */ asn_DEF_GuestLogin_tags_1, /* Same as above */ sizeof(asn_DEF_GuestLogin_tags_1) - /sizeof(asn_DEF_GuestLogin_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_GuestLogin_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_GuestLogin_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/GuestLogin.h b/src/third_party/asn1/GuestLogin.h index b4e7160e..a3b93194 100644 --- a/src/third_party/asn1/GuestLogin.h +++ b/src/third_party/asn1/GuestLogin.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* GuestLogin */ -typedef struct GuestLogin { - UTF8String_t nickName; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} GuestLogin_t; + /* GuestLogin */ + typedef struct GuestLogin { + UTF8String_t nickName; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_GuestLogin; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } GuestLogin_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_GuestLogin; #ifdef __cplusplus } diff --git a/src/third_party/asn1/Guid.c b/src/third_party/asn1/Guid.c index 65960954..c70aa159 100644 --- a/src/third_party/asn1/Guid.c +++ b/src/third_party/asn1/Guid.c @@ -9,26 +9,26 @@ int Guid_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = st->size; - + if((size == 16)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -56,44 +56,44 @@ Guid_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { void Guid_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { Guid_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Guid_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Guid_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Guid_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { Guid_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Guid_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { Guid_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Guid_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { Guid_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Guid_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { Guid_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -115,10 +115,10 @@ asn_TYPE_descriptor_t asn_DEF_Guid = { 0, /* Use generic outmost tag fetcher */ asn_DEF_Guid_tags_1, sizeof(asn_DEF_Guid_tags_1) - /sizeof(asn_DEF_Guid_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_Guid_tags_1[0]), /* 1 */ asn_DEF_Guid_tags_1, /* Same as above */ sizeof(asn_DEF_Guid_tags_1) - /sizeof(asn_DEF_Guid_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_Guid_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ diff --git a/src/third_party/asn1/Guid.h b/src/third_party/asn1/Guid.h index f3ad4422..b2d8ddf2 100644 --- a/src/third_party/asn1/Guid.h +++ b/src/third_party/asn1/Guid.h @@ -18,18 +18,18 @@ extern "C" { #endif -/* Guid */ -typedef OCTET_STRING_t Guid_t; + /* Guid */ + typedef OCTET_STRING_t Guid_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Guid; -asn_struct_free_f Guid_free; -asn_struct_print_f Guid_print; -asn_constr_check_f Guid_constraint; -ber_type_decoder_f Guid_decode_ber; -der_type_encoder_f Guid_encode_der; -xer_type_decoder_f Guid_decode_xer; -xer_type_encoder_f Guid_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Guid; + asn_struct_free_f Guid_free; + asn_struct_print_f Guid_print; + asn_constr_check_f Guid_constraint; + ber_type_decoder_f Guid_decode_ber; + der_type_encoder_f Guid_encode_der; + xer_type_decoder_f Guid_decode_xer; + xer_type_encoder_f Guid_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/HandStartMessage.c b/src/third_party/asn1/HandStartMessage.c index 3423221d..7761efaa 100644 --- a/src/third_party/asn1/HandStartMessage.c +++ b/src/third_party/asn1/HandStartMessage.c @@ -9,31 +9,31 @@ static int memb_smallBlind_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 100000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_yourCards_3[] = { - { ATF_NOFLAGS, 0, offsetof(struct yourCards, choice.plainCards), + { ATF_NOFLAGS, 0, offsetof(struct yourCards, choice.plainCards), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_PlainCards, @@ -41,8 +41,8 @@ static asn_TYPE_member_t asn_MBR_yourCards_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "plainCards" - }, - { ATF_NOFLAGS, 0, offsetof(struct yourCards, choice.encryptedCards), + }, + { ATF_NOFLAGS, 0, offsetof(struct yourCards, choice.encryptedCards), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EncryptedCards, @@ -50,11 +50,11 @@ static asn_TYPE_member_t asn_MBR_yourCards_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "encryptedCards" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_yourCards_tag2el_3[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plainCards at 453 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* encryptedCards at 455 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plainCards at 476 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* encryptedCards at 478 */ }; static asn_CHOICE_specifics_t asn_SPC_yourCards_specs_3 = { sizeof(struct yourCards), @@ -90,7 +90,7 @@ asn_TYPE_descriptor_t asn_DEF_yourCards_3 = { }; static asn_TYPE_member_t asn_MBR_HandStartMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct HandStartMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct HandStartMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -98,8 +98,8 @@ static asn_TYPE_member_t asn_MBR_HandStartMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct HandStartMessage, yourCards), + }, + { ATF_NOFLAGS, 0, offsetof(struct HandStartMessage, yourCards), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_yourCards_3, @@ -107,8 +107,8 @@ static asn_TYPE_member_t asn_MBR_HandStartMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "yourCards" - }, - { ATF_NOFLAGS, 0, offsetof(struct HandStartMessage, smallBlind), + }, + { ATF_NOFLAGS, 0, offsetof(struct HandStartMessage, smallBlind), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -116,17 +116,17 @@ static asn_TYPE_member_t asn_MBR_HandStartMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "smallBlind" - }, + }, }; static ber_tlv_tag_t asn_DEF_HandStartMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (23 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_HandStartMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 451 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 0 }, /* smallBlind at 456 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* plainCards at 453 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* encryptedCards at 455 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 474 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 0 }, /* smallBlind at 479 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* plainCards at 476 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* encryptedCards at 478 */ }; static asn_SEQUENCE_specifics_t asn_SPC_HandStartMessage_specs_1 = { sizeof(struct HandStartMessage), @@ -151,10 +151,10 @@ asn_TYPE_descriptor_t asn_DEF_HandStartMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_HandStartMessage_tags_1, sizeof(asn_DEF_HandStartMessage_tags_1) - /sizeof(asn_DEF_HandStartMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_HandStartMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_HandStartMessage_tags_1, /* Same as above */ sizeof(asn_DEF_HandStartMessage_tags_1) - /sizeof(asn_DEF_HandStartMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_HandStartMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_HandStartMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/HandStartMessage.h b/src/third_party/asn1/HandStartMessage.h index 50ee33e6..119e6d24 100644 --- a/src/third_party/asn1/HandStartMessage.h +++ b/src/third_party/asn1/HandStartMessage.h @@ -23,44 +23,45 @@ extern "C" { #endif -/* Dependencies */ -typedef enum yourCards_PR { - yourCards_PR_NOTHING, /* No components present */ - yourCards_PR_plainCards, - yourCards_PR_encryptedCards, - /* Extensions may appear below */ - -} yourCards_PR; + /* Dependencies */ + typedef enum yourCards_PR { + yourCards_PR_NOTHING, /* No components present */ + yourCards_PR_plainCards, + yourCards_PR_encryptedCards, + /* Extensions may appear below */ + + } + yourCards_PR; + + /* HandStartMessage */ + typedef struct HandStartMessage { + NonZeroId_t gameId; + struct yourCards { + yourCards_PR present; + union HandStartMessage__yourCards_u { + PlainCards_t plainCards; + EncryptedCards_t encryptedCards; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } yourCards; + long smallBlind; + /* + * This type is extensible, + * possible extensions are below. + */ -/* HandStartMessage */ -typedef struct HandStartMessage { - NonZeroId_t gameId; - struct yourCards { - yourCards_PR present; - union HandStartMessage__yourCards_u { - PlainCards_t plainCards; - EncryptedCards_t encryptedCards; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } yourCards; - long smallBlind; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} HandStartMessage_t; + } HandStartMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_HandStartMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_HandStartMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/INTEGER.c b/src/third_party/asn1/INTEGER.c index f016131a..dce8f422 100644 --- a/src/third_party/asn1/INTEGER.c +++ b/src/third_party/asn1/INTEGER.c @@ -41,12 +41,12 @@ asn_TYPE_descriptor_t asn_DEF_INTEGER = { */ asn_enc_rval_t INTEGER_encode_der(asn_TYPE_descriptor_t *td, void *sptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { INTEGER_t *st = (INTEGER_t *)sptr; ASN_DEBUG("%s %s as INTEGER (tm=%d)", - cb?"Encoding":"Estimating", td->name, tag_mode); + cb?"Encoding":"Estimating", td->name, tag_mode); /* * Canonicalize integer in the buffer. @@ -67,10 +67,12 @@ INTEGER_encode_der(asn_TYPE_descriptor_t *td, void *sptr, * b) shall not all be zero. */ switch(*buf) { - case 0x00: if((buf[1] & 0x80) == 0) + case 0x00: + if((buf[1] & 0x80) == 0) continue; break; - case 0xff: if((buf[1] & 0x80)) + case 0xff: + if((buf[1] & 0x80)) continue; break; } @@ -120,8 +122,12 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by /* Skip the insignificant leading bytes */ for(; buf < buf_end-1; buf++) { switch(*buf) { - case 0x00: if((buf[1] & 0x80) == 0) continue; break; - case 0xff: if((buf[1] & 0x80) != 0) continue; break; + case 0x00: + if((buf[1] & 0x80) == 0) continue; + break; + case 0xff: + if((buf[1] & 0x80) != 0) continue; + break; } break; } @@ -146,21 +152,21 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by scr = (char *)alloca(scrsize); if(plainOrXER == 0) ret = snprintf(scr, scrsize, - "%ld (%s)", accum, el->enum_name); + "%ld (%s)", accum, el->enum_name); else ret = snprintf(scr, scrsize, - "<%s/>", el->enum_name); + "<%s/>", el->enum_name); } else if(plainOrXER && specs && specs->strict_enumeration) { ASN_DEBUG("ASN.1 forbids dealing with " - "unknown value of ENUMERATED type"); + "unknown value of ENUMERATED type"); errno = EPERM; return -1; } else { scrsize = sizeof(scratch); scr = scratch; ret = snprintf(scr, scrsize, - (specs && specs->field_unsigned) - ?"%lu":"%ld", accum); + (specs && specs->field_unsigned) + ?"%lu":"%ld", accum); } assert(ret > 0 && (size_t)ret < scrsize); return (cb(scr, ret, app_key) < 0) ? -1 : ret; @@ -170,7 +176,7 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by * if there is no corresponding identifier. */ ASN_DEBUG("ASN.1 forbids dealing with " - "unknown value of ENUMERATED type"); + "unknown value of ENUMERATED type"); errno = EPERM; return -1; } @@ -202,7 +208,7 @@ INTEGER__dump(asn_TYPE_descriptor_t *td, const INTEGER_t *st, asn_app_consume_by */ int INTEGER_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; ssize_t ret; @@ -234,10 +240,10 @@ INTEGER__compar_enum2value(const void *kp, const void *am) { /* Compare strings */ for(ptr = key->start, end = key->stop, name = el->enum_name; - ptr < end; ptr++, name++) { + ptr < end; ptr++, name++) { if(*ptr != *name) return *(const unsigned char *)ptr - - *(const unsigned char *)name; + - *(const unsigned char *)name; } return name[0] ? -1 : 0; } @@ -255,8 +261,14 @@ INTEGER_map_enum2value(asn_INTEGER_specifics_t *specs, const char *lstart, const /* Figure out the tag name */ for(lstart++, lp = lstart; lp < lstop; lp++) { switch(*lp) { - case 9: case 10: case 11: case 12: case 13: case 32: /* WSP */ - case 0x2f: /* '/' */ case 0x3e: /* '>' */ + case 9: + case 10: + case 11: + case 12: + case 13: + case 32: /* WSP */ + case 0x2f: /* '/' */ + case 0x3e: /* '>' */ break; default: continue; @@ -271,8 +283,8 @@ INTEGER_map_enum2value(asn_INTEGER_specifics_t *specs, const char *lstart, const key.vemap = specs->value2enum; key.evmap = specs->enum2value; el_found = (asn_INTEGER_enum_map_t *)bsearch(&key, - specs->value2enum, count, sizeof(specs->value2enum[0]), - INTEGER__compar_enum2value); + specs->value2enum, count, sizeof(specs->value2enum[0]), + INTEGER__compar_enum2value); if(el_found) { /* Remap enum2value into value2enum */ el_found = key.vemap + key.evmap[el_found - key.vemap]; @@ -295,8 +307,8 @@ INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value) { int count = specs ? specs->map_count : 0; if(!count) return 0; return (asn_INTEGER_enum_map_t *)bsearch(&value, specs->value2enum, - count, sizeof(specs->value2enum[0]), - INTEGER__compar_value2enum); + count, sizeof(specs->value2enum[0]), + INTEGER__compar_value2enum); } static int @@ -337,7 +349,7 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun if(chunk_size) ASN_DEBUG("INTEGER body %ld 0x%2x..0x%2x", - (long)chunk_size, *lstart, lstop[-1]); + (long)chunk_size, *lstart, lstop[-1]); /* * We may have received a tag here. It will be processed inline. @@ -346,7 +358,10 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun for(value = 0, lp = lstart; lp < lstop; lp++) { int lv = *lp; switch(lv) { - case 0x09: case 0x0a: case 0x0d: case 0x20: + case 0x09: + case 0x0a: + case 0x0d: + case 0x20: switch(state) { case ST_SKIPSPACE: case ST_SKIPSPHEX: @@ -374,10 +389,19 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun continue; } break; - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: switch(state) { - case ST_DIGITS: break; + case ST_DIGITS: + break; case ST_SKIPSPHEX: /* Fall through */ case ST_HEXDIGIT1: value = (lv - 0x30) << 4; @@ -395,37 +419,37 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun break; } - { - long new_value = value * 10; + { + long new_value = value * 10; - if(new_value / 10 != value) - /* Overflow */ - return XPBD_DECODER_LIMIT; - - value = new_value + (lv - 0x30); - /* Check for two's complement overflow */ - if(value < 0) { - /* Check whether it is a LONG_MIN */ - if(sign == -1 - && (unsigned long)value - == ~((unsigned long)-1 >> 1)) { - sign = 1; - } else { + if(new_value / 10 != value) /* Overflow */ return XPBD_DECODER_LIMIT; + + value = new_value + (lv - 0x30); + /* Check for two's complement overflow */ + if(value < 0) { + /* Check whether it is a LONG_MIN */ + if(sign == -1 + && (unsigned long)value + == ~((unsigned long)-1 >> 1)) { + sign = 1; + } else { + /* Overflow */ + return XPBD_DECODER_LIMIT; + } } } - } continue; case 0x3c: /* '<' */ if(state == ST_SKIPSPACE) { const asn_INTEGER_enum_map_t *el; el = INTEGER_map_enum2value( - (asn_INTEGER_specifics_t *) - td->specifics, lstart, lstop); + (asn_INTEGER_specifics_t *) + td->specifics, lstart, lstop); if(el) { ASN_DEBUG("Found \"%s\" => %ld", - el->enum_name, el->nat_value); + el->enum_name, el->nat_value); state = ST_DIGITS; value = el->nat_value; lp = lstop - 1; @@ -454,9 +478,19 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun ASN_DEBUG("state %d at %d", state, lp - lstart); break; } - /* [A-Fa-f] */ - case 0x41:case 0x42:case 0x43:case 0x44:case 0x45:case 0x46: - case 0x61:case 0x62:case 0x63:case 0x64:case 0x65:case 0x66: + /* [A-Fa-f] */ + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x46: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: switch(state) { case ST_SKIPSPHEX: case ST_SKIPSPACE: /* Fall through */ @@ -487,7 +521,7 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun /* Found extra non-numeric stuff */ ASN_DEBUG("Found non-numeric 0x%2x at %d", - lv, lp - lstart); + lv, lp - lstart); state = ST_EXTRASTUFF; break; } @@ -510,7 +544,7 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun break; } else { ASN_DEBUG("INTEGER: No useful digits (state %d)", - state); + state); return XPBD_BROKEN_ENCODING; /* No digits */ } break; @@ -526,24 +560,24 @@ INTEGER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chun asn_dec_rval_t INTEGER_decode_xer(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, - const void *buf_ptr, size_t size) { + asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, + const void *buf_ptr, size_t size) { return xer_decode_primitive(opt_codec_ctx, td, - sptr, sizeof(INTEGER_t), opt_mname, - buf_ptr, size, INTEGER__xer_body_decode); + sptr, sizeof(INTEGER_t), opt_mname, + buf_ptr, size, INTEGER__xer_body_decode); } asn_enc_rval_t INTEGER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; asn_enc_rval_t er; (void)ilevel; (void)flags; - + if(!st || !st->buf) _ASN_ENCODE_FAILED; @@ -555,7 +589,7 @@ INTEGER_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, asn_dec_rval_t INTEGER_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval = { RC_OK, 0 }; INTEGER_t *st = (INTEGER_t *)*sptr; @@ -612,11 +646,11 @@ INTEGER_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(value < 0) _ASN_DECODE_STARVED; } ASN_DEBUG("Got value %ld + low %ld", - value, ct->lower_bound); + value, ct->lower_bound); value += ct->lower_bound; if((specs && specs->field_unsigned) - ? asn_ulong2INTEGER(st, value) - : asn_long2INTEGER(st, value)) + ? asn_ulong2INTEGER(st, value) + : asn_long2INTEGER(st, value)) _ASN_DECODE_FAILED; return rval; } @@ -661,7 +695,7 @@ INTEGER_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_enc_rval_t INTEGER_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_enc_rval_t er; INTEGER_t *st = (INTEGER_t *)sptr; @@ -689,13 +723,13 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td, inext = 1; } else if(ct->range_bits >= 0) { if(uval < (unsigned long)ct->lower_bound - || uval > (unsigned long)ct->upper_bound) + || uval > (unsigned long)ct->upper_bound) inext = 1; } ASN_DEBUG("Value %lu (%02x/%d) lb %lu ub %lu %s", - uval, st->buf[0], st->size, - ct->lower_bound, ct->upper_bound, - inext ? "ext" : "fix"); + uval, st->buf[0], st->size, + ct->lower_bound, ct->upper_bound, + inext ? "ext" : "fix"); value = uval; } else { if(asn_INTEGER2long(st, &value)) @@ -706,13 +740,13 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td, inext = 1; } else if(ct->range_bits >= 0) { if(value < ct->lower_bound - || value > ct->upper_bound) + || value > ct->upper_bound) inext = 1; } ASN_DEBUG("Value %ld (%02x/%d) lb %ld ub %ld %s", - value, st->buf[0], st->size, - ct->lower_bound, ct->upper_bound, - inext ? "ext" : "fix"); + value, st->buf[0], st->size, + ct->lower_bound, ct->upper_bound, + inext ? "ext" : "fix"); } if(ct->flags & APC_EXTENSIBLE) { if(per_put_few_bits(po, inext, 1)) @@ -728,16 +762,16 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td, if(ct && ct->range_bits >= 0) { /* #10.5.6 */ ASN_DEBUG("Encoding integer with range %d bits", - ct->range_bits); + ct->range_bits); if(ct->range_bits == 32) { /* TODO: extend to >32 bits */ long v = value - ct->lower_bound; if(per_put_few_bits(po, v >> 1, 31) - || per_put_few_bits(po, v, 1)) + || per_put_few_bits(po, v, 1)) _ASN_ENCODE_FAILED; } else { if(per_put_few_bits(po, value - ct->lower_bound, - ct->range_bits)) + ct->range_bits)) _ASN_ENCODE_FAILED; } _ASN_ENCODED_OK(er); @@ -789,8 +823,12 @@ asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) { /* Skip out the insignificant leading bytes */ for(; b < end1; b++) { switch(*b) { - case 0x00: if((b[1] & 0x80) == 0) continue; break; - case 0xff: if((b[1] & 0x80) != 0) continue; break; + case 0x00: + if((b[1] & 0x80) == 0) continue; + break; + case 0xff: + if((b[1] & 0x80) != 0) continue; + break; } break; } @@ -811,7 +849,8 @@ asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) { /* Perform the sign initialization */ /* Actually l = -(*b >> 7); gains nothing, yet unreadable! */ - if((*b >> 7)) l = -1; else l = 0; + if((*b >> 7)) l = -1; + else l = 0; /* Conversion engine */ for(; b < end; b++) @@ -913,10 +952,12 @@ asn_long2INTEGER(INTEGER_t *st, long value) { */ for(p = pstart; p != pend1; p += add) { switch(*p) { - case 0x00: if((*(p+add) & 0x80) == 0) + case 0x00: + if((*(p+add) & 0x80) == 0) continue; break; - case 0xff: if((*(p+add) & 0x80)) + case 0xff: + if((*(p+add) & 0x80)) continue; break; } diff --git a/src/third_party/asn1/INTEGER.h b/src/third_party/asn1/INTEGER.h index 8411bfcd..8da5b18d 100644 --- a/src/third_party/asn1/INTEGER.h +++ b/src/third_party/asn1/INTEGER.h @@ -12,55 +12,55 @@ extern "C" { #endif -typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; + typedef ASN__PRIMITIVE_TYPE_t INTEGER_t; -extern asn_TYPE_descriptor_t asn_DEF_INTEGER; + extern asn_TYPE_descriptor_t asn_DEF_INTEGER; -/* Map with to integer value association */ -typedef struct asn_INTEGER_enum_map_s { - long nat_value; /* associated native integer value */ - size_t enum_len; /* strlen("tag") */ - const char *enum_name; /* "tag" */ -} asn_INTEGER_enum_map_t; + /* Map with to integer value association */ + typedef struct asn_INTEGER_enum_map_s { + long nat_value; /* associated native integer value */ + size_t enum_len; /* strlen("tag") */ + const char *enum_name; /* "tag" */ + } asn_INTEGER_enum_map_t; -/* This type describes an enumeration for INTEGER and ENUMERATED types */ -typedef struct asn_INTEGER_specifics_s { - asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ - unsigned int *enum2value; /* "tag" => N; sorted by tag */ - int map_count; /* Elements in either map */ - int extension; /* This map is extensible */ - int strict_enumeration; /* Enumeration set is fixed */ - int field_width; /* Size of native integer */ - int field_unsigned; /* Signed=0, unsigned=1 */ -} asn_INTEGER_specifics_t; + /* This type describes an enumeration for INTEGER and ENUMERATED types */ + typedef struct asn_INTEGER_specifics_s { + asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ + unsigned int *enum2value; /* "tag" => N; sorted by tag */ + int map_count; /* Elements in either map */ + int extension; /* This map is extensible */ + int strict_enumeration; /* Enumeration set is fixed */ + int field_width; /* Size of native integer */ + int field_unsigned; /* Signed=0, unsigned=1 */ + } asn_INTEGER_specifics_t; -asn_struct_print_f INTEGER_print; -ber_type_decoder_f INTEGER_decode_ber; -der_type_encoder_f INTEGER_encode_der; -xer_type_decoder_f INTEGER_decode_xer; -xer_type_encoder_f INTEGER_encode_xer; -per_type_decoder_f INTEGER_decode_uper; -per_type_encoder_f INTEGER_encode_uper; + asn_struct_print_f INTEGER_print; + ber_type_decoder_f INTEGER_decode_ber; + der_type_encoder_f INTEGER_encode_der; + xer_type_decoder_f INTEGER_decode_xer; + xer_type_encoder_f INTEGER_encode_xer; + per_type_decoder_f INTEGER_decode_uper; + per_type_encoder_f INTEGER_encode_uper; -/*********************************** - * Some handy conversion routines. * - ***********************************/ + /*********************************** + * Some handy conversion routines. * + ***********************************/ -/* - * Returns 0 if it was possible to convert, -1 otherwise. - * -1/EINVAL: Mandatory argument missing - * -1/ERANGE: Value encoded is out of range for long representation - * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()). - */ -int asn_INTEGER2long(const INTEGER_t *i, long *l); -int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); -int asn_long2INTEGER(INTEGER_t *i, long l); -int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); + /* + * Returns 0 if it was possible to convert, -1 otherwise. + * -1/EINVAL: Mandatory argument missing + * -1/ERANGE: Value encoded is out of range for long representation + * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()). + */ + int asn_INTEGER2long(const INTEGER_t *i, long *l); + int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); + int asn_long2INTEGER(INTEGER_t *i, long l); + int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); -/* - * Convert the integer value into the corresponding enumeration map entry. - */ -const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value); + /* + * Convert the integer value into the corresponding enumeration map entry. + */ + const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(asn_INTEGER_specifics_t *specs, long value); #ifdef __cplusplus } diff --git a/src/third_party/asn1/Id.c b/src/third_party/asn1/Id.c index 04ffca7e..6989585d 100644 --- a/src/third_party/asn1/Id.c +++ b/src/third_party/asn1/Id.c @@ -9,18 +9,18 @@ int Id_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + /* Constraint check succeeded */ return 0; } @@ -43,49 +43,49 @@ Id_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; - /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void Id_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { Id_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int Id_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { Id_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t Id_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { Id_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t Id_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { Id_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t Id_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { Id_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t Id_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { Id_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -112,10 +112,10 @@ asn_TYPE_descriptor_t asn_DEF_Id = { 0, /* Use generic outmost tag fetcher */ asn_DEF_Id_tags_1, sizeof(asn_DEF_Id_tags_1) - /sizeof(asn_DEF_Id_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_Id_tags_1[0]), /* 1 */ asn_DEF_Id_tags_1, /* Same as above */ sizeof(asn_DEF_Id_tags_1) - /sizeof(asn_DEF_Id_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_Id_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_Id_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/Id.h b/src/third_party/asn1/Id.h index 1eb95827..66d5ef97 100644 --- a/src/third_party/asn1/Id.h +++ b/src/third_party/asn1/Id.h @@ -18,18 +18,18 @@ extern "C" { #endif -/* Id */ -typedef unsigned long Id_t; + /* Id */ + typedef unsigned long Id_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Id; -asn_struct_free_f Id_free; -asn_struct_print_f Id_print; -asn_constr_check_f Id_constraint; -ber_type_decoder_f Id_decode_ber; -der_type_encoder_f Id_encode_der; -xer_type_decoder_f Id_decode_xer; -xer_type_encoder_f Id_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Id; + asn_struct_free_f Id_free; + asn_struct_print_f Id_print; + asn_constr_check_f Id_constraint; + ber_type_decoder_f Id_decode_ber; + der_type_encoder_f Id_encode_der; + xer_type_decoder_f Id_decode_xer; + xer_type_encoder_f Id_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/InitAckMessage.c b/src/third_party/asn1/InitAckMessage.c index 300c0cf6..3ae7fc1f 100644 --- a/src/third_party/asn1/InitAckMessage.c +++ b/src/third_party/asn1/InitAckMessage.c @@ -8,7 +8,7 @@ #include "InitAckMessage.h" static asn_TYPE_member_t asn_MBR_InitAckMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct InitAckMessage, yourSessionId), + { ATF_NOFLAGS, 0, offsetof(struct InitAckMessage, yourSessionId), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_Guid, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_InitAckMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "yourSessionId" - }, - { ATF_NOFLAGS, 0, offsetof(struct InitAckMessage, yourPlayerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct InitAckMessage, yourPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_InitAckMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "yourPlayerId" - }, - { ATF_POINTER, 1, offsetof(struct InitAckMessage, yourAvatar), + }, + { ATF_POINTER, 2, offsetof(struct InitAckMessage, yourAvatar), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_AvatarHash, @@ -34,25 +34,35 @@ static asn_TYPE_member_t asn_MBR_InitAckMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "yourAvatar" - }, + }, + { ATF_POINTER, 1, offsetof(struct InitAckMessage, rejoinGameId), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NonZeroId, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "rejoinGameId" + }, }; static ber_tlv_tag_t asn_DEF_InitAckMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_InitAckMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* yourPlayerId at 146 */ - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 1 }, /* yourSessionId at 145 */ - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, -1, 0 } /* yourAvatar at 147 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 1 }, /* yourPlayerId at 147 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -1, 0 }, /* rejoinGameId at 149 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, 0, 1 }, /* yourSessionId at 146 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, -1, 0 } /* yourAvatar at 148 */ }; static asn_SEQUENCE_specifics_t asn_SPC_InitAckMessage_specs_1 = { sizeof(struct InitAckMessage), offsetof(struct InitAckMessage, _asn_ctx), asn_MAP_InitAckMessage_tag2el_1, - 3, /* Count of tags in the map */ + 4, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ - 2, /* Start extensions */ - 4 /* Stop extensions */ + 3, /* Start extensions */ + 5 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_InitAckMessage = { "InitAckMessage", @@ -68,13 +78,13 @@ asn_TYPE_descriptor_t asn_DEF_InitAckMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_InitAckMessage_tags_1, sizeof(asn_DEF_InitAckMessage_tags_1) - /sizeof(asn_DEF_InitAckMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_InitAckMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_InitAckMessage_tags_1, /* Same as above */ sizeof(asn_DEF_InitAckMessage_tags_1) - /sizeof(asn_DEF_InitAckMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_InitAckMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_InitAckMessage_1, - 3, /* Elements count */ + 4, /* Elements count */ &asn_SPC_InitAckMessage_specs_1 /* Additional specs */ }; diff --git a/src/third_party/asn1/InitAckMessage.h b/src/third_party/asn1/InitAckMessage.h index 4d0bb6ce..bba6adbd 100644 --- a/src/third_party/asn1/InitAckMessage.h +++ b/src/third_party/asn1/InitAckMessage.h @@ -21,22 +21,23 @@ extern "C" { #endif -/* InitAckMessage */ -typedef struct InitAckMessage { - Guid_t yourSessionId; - NonZeroId_t yourPlayerId; - AvatarHash_t *yourAvatar /* OPTIONAL */; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} InitAckMessage_t; + /* InitAckMessage */ + typedef struct InitAckMessage { + Guid_t yourSessionId; + NonZeroId_t yourPlayerId; + AvatarHash_t *yourAvatar /* OPTIONAL */; + NonZeroId_t *rejoinGameId /* OPTIONAL */; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_InitAckMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } InitAckMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_InitAckMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/InitMessage.c b/src/third_party/asn1/InitMessage.c index b975598a..91f1a3c0 100644 --- a/src/third_party/asn1/InitMessage.c +++ b/src/third_party/asn1/InitMessage.c @@ -7,8 +7,8 @@ #include "InitMessage.h" -static asn_TYPE_member_t asn_MBR_login_4[] = { - { ATF_NOFLAGS, 0, offsetof(struct login, choice.guestLogin), +static asn_TYPE_member_t asn_MBR_login_5[] = { + { ATF_NOFLAGS, 0, offsetof(struct login, choice.guestLogin), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_GuestLogin, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_login_4[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "guestLogin" - }, - { ATF_NOFLAGS, 0, offsetof(struct login, choice.authenticatedLogin), + }, + { ATF_NOFLAGS, 0, offsetof(struct login, choice.authenticatedLogin), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_AuthenticatedLogin, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_login_4[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "authenticatedLogin" - }, - { ATF_NOFLAGS, 0, offsetof(struct login, choice.unauthenticatedLogin), + }, + { ATF_NOFLAGS, 0, offsetof(struct login, choice.unauthenticatedLogin), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_UnauthenticatedLogin, @@ -34,25 +34,25 @@ static asn_TYPE_member_t asn_MBR_login_4[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "unauthenticatedLogin" - }, + }, }; -static asn_TYPE_tag2member_t asn_MAP_login_tag2el_4[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* guestLogin at 100 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* authenticatedLogin at 101 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* unauthenticatedLogin at 103 */ +static asn_TYPE_tag2member_t asn_MAP_login_tag2el_5[] = { + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* guestLogin at 101 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* authenticatedLogin at 102 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* unauthenticatedLogin at 104 */ }; -static asn_CHOICE_specifics_t asn_SPC_login_specs_4 = { +static asn_CHOICE_specifics_t asn_SPC_login_specs_5 = { sizeof(struct login), offsetof(struct login, _asn_ctx), offsetof(struct login, present), sizeof(((struct login *)0)->present), - asn_MAP_login_tag2el_4, + asn_MAP_login_tag2el_5, 3, /* Count of tags in the map */ 0, 3 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ -asn_TYPE_descriptor_t asn_DEF_login_4 = { +asn_TYPE_descriptor_t asn_DEF_login_5 = { "login", "login", CHOICE_free, @@ -69,13 +69,13 @@ asn_TYPE_descriptor_t asn_DEF_login_4 = { 0, /* No tags (pointer) */ 0, /* No tags (count) */ 0, /* No PER visible constraints */ - asn_MBR_login_4, + asn_MBR_login_5, 3, /* Elements count */ - &asn_SPC_login_specs_4 /* Additional specs */ + &asn_SPC_login_specs_5 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_InitMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct InitMessage, requestedVersion), + { ATF_NOFLAGS, 0, offsetof(struct InitMessage, requestedVersion), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_Version, @@ -83,8 +83,8 @@ static asn_TYPE_member_t asn_MBR_InitMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "requestedVersion" - }, - { ATF_NOFLAGS, 0, offsetof(struct InitMessage, buildId), + }, + { ATF_NOFLAGS, 0, offsetof(struct InitMessage, buildId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -92,36 +92,46 @@ static asn_TYPE_member_t asn_MBR_InitMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "buildId" - }, - { ATF_NOFLAGS, 0, offsetof(struct InitMessage, login), + }, + { ATF_NOFLAGS, 0, offsetof(struct InitMessage, myLastSessionId), + (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), + 0, + &asn_DEF_Guid, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "myLastSessionId" + }, + { ATF_NOFLAGS, 0, offsetof(struct InitMessage, login), -1 /* Ambiguous tag (CHOICE?) */, 0, - &asn_DEF_login_4, + &asn_DEF_login_5, 0, /* Defer constraints checking to the member type */ 0, /* PER is not compiled, use -gen-PER */ 0, "login" - }, + }, }; static ber_tlv_tag_t asn_DEF_InitMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_InitMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* buildId at 98 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* requestedVersion at 97 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* guestLogin at 100 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 }, /* authenticatedLogin at 101 */ - { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* unauthenticatedLogin at 103 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* buildId at 98 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 2, 0, 0 }, /* myLastSessionId at 99 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* requestedVersion at 97 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* guestLogin at 101 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* authenticatedLogin at 102 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 3, 0, 0 } /* unauthenticatedLogin at 104 */ }; static asn_SEQUENCE_specifics_t asn_SPC_InitMessage_specs_1 = { sizeof(struct InitMessage), offsetof(struct InitMessage, _asn_ctx), asn_MAP_InitMessage_tag2el_1, - 5, /* Count of tags in the map */ + 6, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ - 2, /* Start extensions */ - 4 /* Stop extensions */ + 3, /* Start extensions */ + 5 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_InitMessage = { "InitMessage", @@ -137,13 +147,13 @@ asn_TYPE_descriptor_t asn_DEF_InitMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_InitMessage_tags_1, sizeof(asn_DEF_InitMessage_tags_1) - /sizeof(asn_DEF_InitMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_InitMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_InitMessage_tags_1, /* Same as above */ sizeof(asn_DEF_InitMessage_tags_1) - /sizeof(asn_DEF_InitMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_InitMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_InitMessage_1, - 3, /* Elements count */ + 4, /* Elements count */ &asn_SPC_InitMessage_specs_1 /* Additional specs */ }; diff --git a/src/third_party/asn1/InitMessage.h b/src/third_party/asn1/InitMessage.h index 77a9c295..d268ba56 100644 --- a/src/third_party/asn1/InitMessage.h +++ b/src/third_party/asn1/InitMessage.h @@ -14,6 +14,7 @@ /* Including external dependencies */ #include "Version.h" #include +#include "Guid.h" #include "GuestLogin.h" #include "AuthenticatedLogin.h" #include "UnauthenticatedLogin.h" @@ -24,46 +25,48 @@ extern "C" { #endif -/* Dependencies */ -typedef enum login_PR { - login_PR_NOTHING, /* No components present */ - login_PR_guestLogin, - login_PR_authenticatedLogin, - login_PR_unauthenticatedLogin, - /* Extensions may appear below */ - -} login_PR; + /* Dependencies */ + typedef enum login_PR { + login_PR_NOTHING, /* No components present */ + login_PR_guestLogin, + login_PR_authenticatedLogin, + login_PR_unauthenticatedLogin, + /* Extensions may appear below */ + + } + login_PR; + + /* InitMessage */ + typedef struct InitMessage { + Version_t requestedVersion; + long buildId; + Guid_t myLastSessionId; + struct login { + login_PR present; + union InitMessage__login_u { + GuestLogin_t guestLogin; + AuthenticatedLogin_t authenticatedLogin; + UnauthenticatedLogin_t unauthenticatedLogin; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } login; + /* + * This type is extensible, + * possible extensions are below. + */ -/* InitMessage */ -typedef struct InitMessage { - Version_t requestedVersion; - long buildId; - struct login { - login_PR present; - union InitMessage__login_u { - GuestLogin_t guestLogin; - AuthenticatedLogin_t authenticatedLogin; - UnauthenticatedLogin_t unauthenticatedLogin; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } login; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} InitMessage_t; + } InitMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_InitMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_InitMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/InviteNotifyMessage.c b/src/third_party/asn1/InviteNotifyMessage.c index 1560bb00..26e981b8 100644 --- a/src/third_party/asn1/InviteNotifyMessage.c +++ b/src/third_party/asn1/InviteNotifyMessage.c @@ -8,7 +8,7 @@ #include "InviteNotifyMessage.h" static asn_TYPE_member_t asn_MBR_InviteNotifyMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct InviteNotifyMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct InviteNotifyMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_InviteNotifyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct InviteNotifyMessage, playerIdWho), + }, + { ATF_NOFLAGS, 0, offsetof(struct InviteNotifyMessage, playerIdWho), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_InviteNotifyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerIdWho" - }, - { ATF_NOFLAGS, 0, offsetof(struct InviteNotifyMessage, playerIdByWhom), + }, + { ATF_NOFLAGS, 0, offsetof(struct InviteNotifyMessage, playerIdByWhom), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -34,16 +34,16 @@ static asn_TYPE_member_t asn_MBR_InviteNotifyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerIdByWhom" - }, + }, }; static ber_tlv_tag_t asn_DEF_InviteNotifyMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (17 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_InviteNotifyMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* gameId at 405 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* playerIdWho at 406 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* playerIdByWhom at 408 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* gameId at 412 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* playerIdWho at 413 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* playerIdByWhom at 415 */ }; static asn_SEQUENCE_specifics_t asn_SPC_InviteNotifyMessage_specs_1 = { sizeof(struct InviteNotifyMessage), @@ -68,10 +68,10 @@ asn_TYPE_descriptor_t asn_DEF_InviteNotifyMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_InviteNotifyMessage_tags_1, sizeof(asn_DEF_InviteNotifyMessage_tags_1) - /sizeof(asn_DEF_InviteNotifyMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_InviteNotifyMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_InviteNotifyMessage_tags_1, /* Same as above */ sizeof(asn_DEF_InviteNotifyMessage_tags_1) - /sizeof(asn_DEF_InviteNotifyMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_InviteNotifyMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_InviteNotifyMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/InviteNotifyMessage.h b/src/third_party/asn1/InviteNotifyMessage.h index cccf1c79..6520d84c 100644 --- a/src/third_party/asn1/InviteNotifyMessage.h +++ b/src/third_party/asn1/InviteNotifyMessage.h @@ -19,22 +19,22 @@ extern "C" { #endif -/* InviteNotifyMessage */ -typedef struct InviteNotifyMessage { - NonZeroId_t gameId; - NonZeroId_t playerIdWho; - NonZeroId_t playerIdByWhom; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} InviteNotifyMessage_t; + /* InviteNotifyMessage */ + typedef struct InviteNotifyMessage { + NonZeroId_t gameId; + NonZeroId_t playerIdWho; + NonZeroId_t playerIdByWhom; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_InviteNotifyMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } InviteNotifyMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_InviteNotifyMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/InvitePlayerToGameMessage.c b/src/third_party/asn1/InvitePlayerToGameMessage.c index c79f95d2..23d2fbdb 100644 --- a/src/third_party/asn1/InvitePlayerToGameMessage.c +++ b/src/third_party/asn1/InvitePlayerToGameMessage.c @@ -8,7 +8,7 @@ #include "InvitePlayerToGameMessage.h" static asn_TYPE_member_t asn_MBR_InvitePlayerToGameMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct InvitePlayerToGameMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct InvitePlayerToGameMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_InvitePlayerToGameMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct InvitePlayerToGameMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct InvitePlayerToGameMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_InvitePlayerToGameMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_InvitePlayerToGameMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (16 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_InvitePlayerToGameMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 400 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 402 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 407 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 409 */ }; static asn_SEQUENCE_specifics_t asn_SPC_InvitePlayerToGameMessage_specs_1 = { sizeof(struct InvitePlayerToGameMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_InvitePlayerToGameMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_InvitePlayerToGameMessage_tags_1, sizeof(asn_DEF_InvitePlayerToGameMessage_tags_1) - /sizeof(asn_DEF_InvitePlayerToGameMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_InvitePlayerToGameMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_InvitePlayerToGameMessage_tags_1, /* Same as above */ sizeof(asn_DEF_InvitePlayerToGameMessage_tags_1) - /sizeof(asn_DEF_InvitePlayerToGameMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_InvitePlayerToGameMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_InvitePlayerToGameMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/InvitePlayerToGameMessage.h b/src/third_party/asn1/InvitePlayerToGameMessage.h index bdfe01cf..f9fa5339 100644 --- a/src/third_party/asn1/InvitePlayerToGameMessage.h +++ b/src/third_party/asn1/InvitePlayerToGameMessage.h @@ -19,21 +19,21 @@ extern "C" { #endif -/* InvitePlayerToGameMessage */ -typedef struct InvitePlayerToGameMessage { - NonZeroId_t gameId; - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} InvitePlayerToGameMessage_t; + /* InvitePlayerToGameMessage */ + typedef struct InvitePlayerToGameMessage { + NonZeroId_t gameId; + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_InvitePlayerToGameMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } InvitePlayerToGameMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_InvitePlayerToGameMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/JoinExistingGame.c b/src/third_party/asn1/JoinExistingGame.c index aeee1ada..13aa5df2 100644 --- a/src/third_party/asn1/JoinExistingGame.c +++ b/src/third_party/asn1/JoinExistingGame.c @@ -8,7 +8,7 @@ #include "JoinExistingGame.h" static asn_TYPE_member_t asn_MBR_JoinExistingGame_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct JoinExistingGame, gameId), + { ATF_NOFLAGS, 0, offsetof(struct JoinExistingGame, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_JoinExistingGame_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, + }, }; static ber_tlv_tag_t asn_DEF_JoinExistingGame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_JoinExistingGame_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 290 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 292 */ }; static asn_SEQUENCE_specifics_t asn_SPC_JoinExistingGame_specs_1 = { sizeof(struct JoinExistingGame), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_JoinExistingGame = { 0, /* Use generic outmost tag fetcher */ asn_DEF_JoinExistingGame_tags_1, sizeof(asn_DEF_JoinExistingGame_tags_1) - /sizeof(asn_DEF_JoinExistingGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_JoinExistingGame_tags_1[0]), /* 1 */ asn_DEF_JoinExistingGame_tags_1, /* Same as above */ sizeof(asn_DEF_JoinExistingGame_tags_1) - /sizeof(asn_DEF_JoinExistingGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_JoinExistingGame_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_JoinExistingGame_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/JoinExistingGame.h b/src/third_party/asn1/JoinExistingGame.h index 3c3aacd8..cd16ffa4 100644 --- a/src/third_party/asn1/JoinExistingGame.h +++ b/src/third_party/asn1/JoinExistingGame.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* JoinExistingGame */ -typedef struct JoinExistingGame { - NonZeroId_t gameId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} JoinExistingGame_t; + /* JoinExistingGame */ + typedef struct JoinExistingGame { + NonZeroId_t gameId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_JoinExistingGame; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } JoinExistingGame_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_JoinExistingGame; #ifdef __cplusplus } diff --git a/src/third_party/asn1/JoinGameAck.c b/src/third_party/asn1/JoinGameAck.c index 4e233d32..3c8f0be7 100644 --- a/src/third_party/asn1/JoinGameAck.c +++ b/src/third_party/asn1/JoinGameAck.c @@ -8,7 +8,7 @@ #include "JoinGameAck.h" static asn_TYPE_member_t asn_MBR_JoinGameAck_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct JoinGameAck, areYouGameAdmin), + { ATF_NOFLAGS, 0, offsetof(struct JoinGameAck, areYouGameAdmin), (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, &asn_DEF_BOOLEAN, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_JoinGameAck_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "areYouGameAdmin" - }, - { ATF_NOFLAGS, 0, offsetof(struct JoinGameAck, gameInfo), + }, + { ATF_NOFLAGS, 0, offsetof(struct JoinGameAck, gameInfo), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_NetGameInfo, @@ -25,14 +25,14 @@ static asn_TYPE_member_t asn_MBR_JoinGameAck_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameInfo" - }, + }, }; static ber_tlv_tag_t asn_DEF_JoinGameAck_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_JoinGameAck_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* areYouGameAdmin at 305 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* gameInfo at 307 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* areYouGameAdmin at 311 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 } /* gameInfo at 313 */ }; static asn_SEQUENCE_specifics_t asn_SPC_JoinGameAck_specs_1 = { sizeof(struct JoinGameAck), @@ -57,10 +57,10 @@ asn_TYPE_descriptor_t asn_DEF_JoinGameAck = { 0, /* Use generic outmost tag fetcher */ asn_DEF_JoinGameAck_tags_1, sizeof(asn_DEF_JoinGameAck_tags_1) - /sizeof(asn_DEF_JoinGameAck_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_JoinGameAck_tags_1[0]), /* 1 */ asn_DEF_JoinGameAck_tags_1, /* Same as above */ sizeof(asn_DEF_JoinGameAck_tags_1) - /sizeof(asn_DEF_JoinGameAck_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_JoinGameAck_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_JoinGameAck_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/JoinGameAck.h b/src/third_party/asn1/JoinGameAck.h index 9c1f4fc3..b7574ed0 100644 --- a/src/third_party/asn1/JoinGameAck.h +++ b/src/third_party/asn1/JoinGameAck.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* JoinGameAck */ -typedef struct JoinGameAck { - BOOLEAN_t areYouGameAdmin; - NetGameInfo_t gameInfo; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} JoinGameAck_t; + /* JoinGameAck */ + typedef struct JoinGameAck { + BOOLEAN_t areYouGameAdmin; + NetGameInfo_t gameInfo; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_JoinGameAck; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } JoinGameAck_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_JoinGameAck; #ifdef __cplusplus } diff --git a/src/third_party/asn1/JoinGameFailed.c b/src/third_party/asn1/JoinGameFailed.c index 7f027e30..75c3f799 100644 --- a/src/third_party/asn1/JoinGameFailed.c +++ b/src/third_party/asn1/JoinGameFailed.c @@ -9,7 +9,7 @@ static int joinGameFailureReason_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ joinGameFailureReason_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void joinGameFailureReason_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { joinGameFailureReason_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int joinGameFailureReason_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { joinGameFailureReason_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t joinGameFailureReason_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { joinGameFailureReason_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t joinGameFailureReason_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { joinGameFailureReason_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t joinGameFailureReason_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { joinGameFailureReason_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t joinGameFailureReason_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { joinGameFailureReason_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -90,7 +90,8 @@ static asn_INTEGER_enum_map_t asn_MAP_joinGameFailureReason_value2enum_2[] = { { 7, 13, "gameNameInUse" }, { 8, 11, "badGameName" }, { 9, 15, "invalidSettings" }, - { 10, 16, "ipAddressBlocked" } + { 10, 16, "ipAddressBlocked" }, + { 11, 12, "rejoinFailed" } }; static unsigned int asn_MAP_joinGameFailureReason_enum2value_2[] = { 7, /* badGameName(8) */ @@ -102,12 +103,13 @@ static unsigned int asn_MAP_joinGameFailureReason_enum2value_2[] = { 8, /* invalidSettings(9) */ 9, /* ipAddressBlocked(10) */ 4, /* notAllowedAsGuest(5) */ - 5 /* notInvited(6) */ + 5, /* notInvited(6) */ + 10 /* rejoinFailed(11) */ }; static asn_INTEGER_specifics_t asn_SPC_joinGameFailureReason_specs_2 = { asn_MAP_joinGameFailureReason_value2enum_2, /* "tag" => N; sorted by tag */ asn_MAP_joinGameFailureReason_enum2value_2, /* N => "tag"; sorted by N */ - 10, /* Number of elements in the maps */ + 11, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ @@ -131,17 +133,17 @@ asn_TYPE_descriptor_t asn_DEF_joinGameFailureReason_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_joinGameFailureReason_tags_2, sizeof(asn_DEF_joinGameFailureReason_tags_2) - /sizeof(asn_DEF_joinGameFailureReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_joinGameFailureReason_tags_2[0]), /* 1 */ asn_DEF_joinGameFailureReason_tags_2, /* Same as above */ sizeof(asn_DEF_joinGameFailureReason_tags_2) - /sizeof(asn_DEF_joinGameFailureReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_joinGameFailureReason_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_joinGameFailureReason_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_JoinGameFailed_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct JoinGameFailed, joinGameFailureReason), + { ATF_NOFLAGS, 0, offsetof(struct JoinGameFailed, joinGameFailureReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_joinGameFailureReason_2, @@ -149,13 +151,13 @@ static asn_TYPE_member_t asn_MBR_JoinGameFailed_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinGameFailureReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_JoinGameFailed_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_JoinGameFailed_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* joinGameFailureReason at 311 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* joinGameFailureReason at 317 */ }; static asn_SEQUENCE_specifics_t asn_SPC_JoinGameFailed_specs_1 = { sizeof(struct JoinGameFailed), @@ -180,10 +182,10 @@ asn_TYPE_descriptor_t asn_DEF_JoinGameFailed = { 0, /* Use generic outmost tag fetcher */ asn_DEF_JoinGameFailed_tags_1, sizeof(asn_DEF_JoinGameFailed_tags_1) - /sizeof(asn_DEF_JoinGameFailed_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_JoinGameFailed_tags_1[0]), /* 1 */ asn_DEF_JoinGameFailed_tags_1, /* Same as above */ sizeof(asn_DEF_JoinGameFailed_tags_1) - /sizeof(asn_DEF_JoinGameFailed_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_JoinGameFailed_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_JoinGameFailed_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/JoinGameFailed.h b/src/third_party/asn1/JoinGameFailed.h index ae6a9825..78021f7e 100644 --- a/src/third_party/asn1/JoinGameFailed.h +++ b/src/third_party/asn1/JoinGameFailed.h @@ -19,35 +19,37 @@ extern "C" { #endif -/* Dependencies */ -typedef enum joinGameFailureReason { - joinGameFailureReason_invalidGame = 1, - joinGameFailureReason_gameIsFull = 2, - joinGameFailureReason_gameIsRunning = 3, - joinGameFailureReason_invalidPassword = 4, - joinGameFailureReason_notAllowedAsGuest = 5, - joinGameFailureReason_notInvited = 6, - joinGameFailureReason_gameNameInUse = 7, - joinGameFailureReason_badGameName = 8, - joinGameFailureReason_invalidSettings = 9, - joinGameFailureReason_ipAddressBlocked = 10 -} e_joinGameFailureReason; + /* Dependencies */ + typedef enum joinGameFailureReason { + joinGameFailureReason_invalidGame = 1, + joinGameFailureReason_gameIsFull = 2, + joinGameFailureReason_gameIsRunning = 3, + joinGameFailureReason_invalidPassword = 4, + joinGameFailureReason_notAllowedAsGuest = 5, + joinGameFailureReason_notInvited = 6, + joinGameFailureReason_gameNameInUse = 7, + joinGameFailureReason_badGameName = 8, + joinGameFailureReason_invalidSettings = 9, + joinGameFailureReason_ipAddressBlocked = 10, + joinGameFailureReason_rejoinFailed = 11 + } + e_joinGameFailureReason; -/* JoinGameFailed */ -typedef struct JoinGameFailed { - long joinGameFailureReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} JoinGameFailed_t; + /* JoinGameFailed */ + typedef struct JoinGameFailed { + long joinGameFailureReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_joinGameFailureReason_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_JoinGameFailed; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } JoinGameFailed_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_joinGameFailureReason_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_JoinGameFailed; #ifdef __cplusplus } diff --git a/src/third_party/asn1/JoinGameReplyMessage.c b/src/third_party/asn1/JoinGameReplyMessage.c index 45186617..671f4ea8 100644 --- a/src/third_party/asn1/JoinGameReplyMessage.c +++ b/src/third_party/asn1/JoinGameReplyMessage.c @@ -8,7 +8,7 @@ #include "JoinGameReplyMessage.h" static asn_TYPE_member_t asn_MBR_joinGameResult_3[] = { - { ATF_NOFLAGS, 0, offsetof(struct joinGameResult, choice.joinGameAck), + { ATF_NOFLAGS, 0, offsetof(struct joinGameResult, choice.joinGameAck), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_JoinGameAck, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_joinGameResult_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinGameAck" - }, - { ATF_NOFLAGS, 0, offsetof(struct joinGameResult, choice.joinGameFailed), + }, + { ATF_NOFLAGS, 0, offsetof(struct joinGameResult, choice.joinGameFailed), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_JoinGameFailed, @@ -25,11 +25,11 @@ static asn_TYPE_member_t asn_MBR_joinGameResult_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinGameFailed" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_joinGameResult_tag2el_3[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* joinGameAck at 299 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* joinGameFailed at 301 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* joinGameAck at 305 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* joinGameFailed at 307 */ }; static asn_CHOICE_specifics_t asn_SPC_joinGameResult_specs_3 = { sizeof(struct joinGameResult), @@ -65,7 +65,7 @@ asn_TYPE_descriptor_t asn_DEF_joinGameResult_3 = { }; static asn_TYPE_member_t asn_MBR_JoinGameReplyMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct JoinGameReplyMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct JoinGameReplyMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -73,8 +73,8 @@ static asn_TYPE_member_t asn_MBR_JoinGameReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct JoinGameReplyMessage, joinGameResult), + }, + { ATF_NOFLAGS, 0, offsetof(struct JoinGameReplyMessage, joinGameResult), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_joinGameResult_3, @@ -82,16 +82,16 @@ static asn_TYPE_member_t asn_MBR_JoinGameReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinGameResult" - }, + }, }; static ber_tlv_tag_t asn_DEF_JoinGameReplyMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (12 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_JoinGameReplyMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 297 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* joinGameAck at 299 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* joinGameFailed at 301 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 303 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* joinGameAck at 305 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* joinGameFailed at 307 */ }; static asn_SEQUENCE_specifics_t asn_SPC_JoinGameReplyMessage_specs_1 = { sizeof(struct JoinGameReplyMessage), @@ -116,10 +116,10 @@ asn_TYPE_descriptor_t asn_DEF_JoinGameReplyMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_JoinGameReplyMessage_tags_1, sizeof(asn_DEF_JoinGameReplyMessage_tags_1) - /sizeof(asn_DEF_JoinGameReplyMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_JoinGameReplyMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_JoinGameReplyMessage_tags_1, /* Same as above */ sizeof(asn_DEF_JoinGameReplyMessage_tags_1) - /sizeof(asn_DEF_JoinGameReplyMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_JoinGameReplyMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_JoinGameReplyMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/JoinGameReplyMessage.h b/src/third_party/asn1/JoinGameReplyMessage.h index 16d864be..071d026f 100644 --- a/src/third_party/asn1/JoinGameReplyMessage.h +++ b/src/third_party/asn1/JoinGameReplyMessage.h @@ -22,43 +22,44 @@ extern "C" { #endif -/* Dependencies */ -typedef enum joinGameResult_PR { - joinGameResult_PR_NOTHING, /* No components present */ - joinGameResult_PR_joinGameAck, - joinGameResult_PR_joinGameFailed, - /* Extensions may appear below */ - -} joinGameResult_PR; + /* Dependencies */ + typedef enum joinGameResult_PR { + joinGameResult_PR_NOTHING, /* No components present */ + joinGameResult_PR_joinGameAck, + joinGameResult_PR_joinGameFailed, + /* Extensions may appear below */ + + } + joinGameResult_PR; + + /* JoinGameReplyMessage */ + typedef struct JoinGameReplyMessage { + NonZeroId_t gameId; + struct joinGameResult { + joinGameResult_PR present; + union JoinGameReplyMessage__joinGameResult_u { + JoinGameAck_t joinGameAck; + JoinGameFailed_t joinGameFailed; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } joinGameResult; + /* + * This type is extensible, + * possible extensions are below. + */ -/* JoinGameReplyMessage */ -typedef struct JoinGameReplyMessage { - NonZeroId_t gameId; - struct joinGameResult { - joinGameResult_PR present; - union JoinGameReplyMessage__joinGameResult_u { - JoinGameAck_t joinGameAck; - JoinGameFailed_t joinGameFailed; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } joinGameResult; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} JoinGameReplyMessage_t; + } JoinGameReplyMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_JoinGameReplyMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_JoinGameReplyMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/JoinGameRequestMessage.c b/src/third_party/asn1/JoinGameRequestMessage.c index 107c32b4..bb23795e 100644 --- a/src/third_party/asn1/JoinGameRequestMessage.c +++ b/src/third_party/asn1/JoinGameRequestMessage.c @@ -9,38 +9,38 @@ static int memb_password_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 64)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_joinGameAction_2[] = { - { ATF_NOFLAGS, 0, offsetof(struct joinGameAction, choice.joinExistingGame), + { ATF_NOFLAGS, 0, offsetof(struct joinGameAction, choice.joinExistingGame), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_JoinExistingGame, @@ -48,8 +48,8 @@ static asn_TYPE_member_t asn_MBR_joinGameAction_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinExistingGame" - }, - { ATF_NOFLAGS, 0, offsetof(struct joinGameAction, choice.joinNewGame), + }, + { ATF_NOFLAGS, 0, offsetof(struct joinGameAction, choice.joinNewGame), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_JoinNewGame, @@ -57,11 +57,21 @@ static asn_TYPE_member_t asn_MBR_joinGameAction_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinNewGame" - }, + }, + { ATF_NOFLAGS, 0, offsetof(struct joinGameAction, choice.rejoinExistingGame), + (ASN_TAG_CLASS_CONTEXT | (2 << 2)), + -1, /* IMPLICIT tag at current level */ + &asn_DEF_RejoinExistingGame, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "rejoinExistingGame" + }, }; static asn_TYPE_tag2member_t asn_MAP_joinGameAction_tag2el_2[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* joinExistingGame at 281 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* joinNewGame at 283 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* joinExistingGame at 282 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* joinNewGame at 283 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* rejoinExistingGame at 285 */ }; static asn_CHOICE_specifics_t asn_SPC_joinGameAction_specs_2 = { sizeof(struct joinGameAction), @@ -69,9 +79,9 @@ static asn_CHOICE_specifics_t asn_SPC_joinGameAction_specs_2 = { offsetof(struct joinGameAction, present), sizeof(((struct joinGameAction *)0)->present), asn_MAP_joinGameAction_tag2el_2, - 2, /* Count of tags in the map */ + 3, /* Count of tags in the map */ 0, - 2 /* Extensions start */ + 3 /* Extensions start */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_joinGameAction_2 = { @@ -92,12 +102,12 @@ asn_TYPE_descriptor_t asn_DEF_joinGameAction_2 = { 0, /* No tags (count) */ 0, /* No PER visible constraints */ asn_MBR_joinGameAction_2, - 2, /* Elements count */ + 3, /* Elements count */ &asn_SPC_joinGameAction_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_JoinGameRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct JoinGameRequestMessage, joinGameAction), + { ATF_NOFLAGS, 0, offsetof(struct JoinGameRequestMessage, joinGameAction), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_joinGameAction_2, @@ -105,8 +115,8 @@ static asn_TYPE_member_t asn_MBR_JoinGameRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinGameAction" - }, - { ATF_POINTER, 1, offsetof(struct JoinGameRequestMessage, password), + }, + { ATF_POINTER, 1, offsetof(struct JoinGameRequestMessage, password), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -114,8 +124,8 @@ static asn_TYPE_member_t asn_MBR_JoinGameRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "password" - }, - { ATF_NOFLAGS, 0, offsetof(struct JoinGameRequestMessage, autoLeave), + }, + { ATF_NOFLAGS, 0, offsetof(struct JoinGameRequestMessage, autoLeave), (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, &asn_DEF_BOOLEAN, @@ -123,23 +133,24 @@ static asn_TYPE_member_t asn_MBR_JoinGameRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "autoLeave" - }, + }, }; static ber_tlv_tag_t asn_DEF_JoinGameRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (11 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_JoinGameRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 2, 0, 0 }, /* autoLeave at 285 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* password at 284 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* joinExistingGame at 281 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 } /* joinNewGame at 283 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 2, 0, 0 }, /* autoLeave at 287 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* password at 286 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* joinExistingGame at 282 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* joinNewGame at 283 */ + { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 0, 0, 0 } /* rejoinExistingGame at 285 */ }; static asn_SEQUENCE_specifics_t asn_SPC_JoinGameRequestMessage_specs_1 = { sizeof(struct JoinGameRequestMessage), offsetof(struct JoinGameRequestMessage, _asn_ctx), asn_MAP_JoinGameRequestMessage_tag2el_1, - 4, /* Count of tags in the map */ + 5, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ 2, /* Start extensions */ 4 /* Stop extensions */ @@ -158,10 +169,10 @@ asn_TYPE_descriptor_t asn_DEF_JoinGameRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_JoinGameRequestMessage_tags_1, sizeof(asn_DEF_JoinGameRequestMessage_tags_1) - /sizeof(asn_DEF_JoinGameRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_JoinGameRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_JoinGameRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_JoinGameRequestMessage_tags_1) - /sizeof(asn_DEF_JoinGameRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_JoinGameRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_JoinGameRequestMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/JoinGameRequestMessage.h b/src/third_party/asn1/JoinGameRequestMessage.h index 82dfd777..388a8a2d 100644 --- a/src/third_party/asn1/JoinGameRequestMessage.h +++ b/src/third_party/asn1/JoinGameRequestMessage.h @@ -16,6 +16,7 @@ #include #include "JoinExistingGame.h" #include "JoinNewGame.h" +#include "RejoinExistingGame.h" #include #include @@ -23,44 +24,47 @@ extern "C" { #endif -/* Dependencies */ -typedef enum joinGameAction_PR { - joinGameAction_PR_NOTHING, /* No components present */ - joinGameAction_PR_joinExistingGame, - joinGameAction_PR_joinNewGame, - /* Extensions may appear below */ - -} joinGameAction_PR; + /* Dependencies */ + typedef enum joinGameAction_PR { + joinGameAction_PR_NOTHING, /* No components present */ + joinGameAction_PR_joinExistingGame, + joinGameAction_PR_joinNewGame, + joinGameAction_PR_rejoinExistingGame, + /* Extensions may appear below */ + + } + joinGameAction_PR; + + /* JoinGameRequestMessage */ + typedef struct JoinGameRequestMessage { + struct joinGameAction { + joinGameAction_PR present; + union JoinGameRequestMessage__joinGameAction_u { + JoinExistingGame_t joinExistingGame; + JoinNewGame_t joinNewGame; + RejoinExistingGame_t rejoinExistingGame; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } joinGameAction; + UTF8String_t *password /* OPTIONAL */; + BOOLEAN_t autoLeave; + /* + * This type is extensible, + * possible extensions are below. + */ -/* JoinGameRequestMessage */ -typedef struct JoinGameRequestMessage { - struct joinGameAction { - joinGameAction_PR present; - union JoinGameRequestMessage__joinGameAction_u { - JoinExistingGame_t joinExistingGame; - JoinNewGame_t joinNewGame; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } joinGameAction; - UTF8String_t *password /* OPTIONAL */; - BOOLEAN_t autoLeave; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} JoinGameRequestMessage_t; + } JoinGameRequestMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_JoinGameRequestMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_JoinGameRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/JoinNewGame.c b/src/third_party/asn1/JoinNewGame.c index d99a5b47..8fb10fdb 100644 --- a/src/third_party/asn1/JoinNewGame.c +++ b/src/third_party/asn1/JoinNewGame.c @@ -8,7 +8,7 @@ #include "JoinNewGame.h" static asn_TYPE_member_t asn_MBR_JoinNewGame_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct JoinNewGame, gameInfo), + { ATF_NOFLAGS, 0, offsetof(struct JoinNewGame, gameInfo), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_NetGameInfo, @@ -16,13 +16,13 @@ static asn_TYPE_member_t asn_MBR_JoinNewGame_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameInfo" - }, + }, }; static ber_tlv_tag_t asn_DEF_JoinNewGame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_JoinNewGame_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* gameInfo at 294 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* gameInfo at 296 */ }; static asn_SEQUENCE_specifics_t asn_SPC_JoinNewGame_specs_1 = { sizeof(struct JoinNewGame), @@ -47,10 +47,10 @@ asn_TYPE_descriptor_t asn_DEF_JoinNewGame = { 0, /* Use generic outmost tag fetcher */ asn_DEF_JoinNewGame_tags_1, sizeof(asn_DEF_JoinNewGame_tags_1) - /sizeof(asn_DEF_JoinNewGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_JoinNewGame_tags_1[0]), /* 1 */ asn_DEF_JoinNewGame_tags_1, /* Same as above */ sizeof(asn_DEF_JoinNewGame_tags_1) - /sizeof(asn_DEF_JoinNewGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_JoinNewGame_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_JoinNewGame_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/JoinNewGame.h b/src/third_party/asn1/JoinNewGame.h index 04d8b281..09015753 100644 --- a/src/third_party/asn1/JoinNewGame.h +++ b/src/third_party/asn1/JoinNewGame.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* JoinNewGame */ -typedef struct JoinNewGame { - NetGameInfo_t gameInfo; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} JoinNewGame_t; + /* JoinNewGame */ + typedef struct JoinNewGame { + NetGameInfo_t gameInfo; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_JoinNewGame; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } JoinNewGame_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_JoinNewGame; #ifdef __cplusplus } diff --git a/src/third_party/asn1/KickPetitionUpdateMessage.c b/src/third_party/asn1/KickPetitionUpdateMessage.c index 820b5e5d..dd51e1db 100644 --- a/src/third_party/asn1/KickPetitionUpdateMessage.c +++ b/src/third_party/asn1/KickPetitionUpdateMessage.c @@ -9,81 +9,81 @@ static int memb_numVotesAgainstKicking_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 9)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_numVotesInFavourOfKicking_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 9)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_numVotesNeededToKick_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 9)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_KickPetitionUpdateMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -91,8 +91,8 @@ static asn_TYPE_member_t asn_MBR_KickPetitionUpdateMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, petitionId), + }, + { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, petitionId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -100,8 +100,8 @@ static asn_TYPE_member_t asn_MBR_KickPetitionUpdateMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "petitionId" - }, - { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, numVotesAgainstKicking), + }, + { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, numVotesAgainstKicking), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -109,8 +109,8 @@ static asn_TYPE_member_t asn_MBR_KickPetitionUpdateMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "numVotesAgainstKicking" - }, - { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, numVotesInFavourOfKicking), + }, + { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, numVotesInFavourOfKicking), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -118,8 +118,8 @@ static asn_TYPE_member_t asn_MBR_KickPetitionUpdateMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "numVotesInFavourOfKicking" - }, - { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, numVotesNeededToKick), + }, + { ATF_NOFLAGS, 0, offsetof(struct KickPetitionUpdateMessage, numVotesNeededToKick), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -127,18 +127,18 @@ static asn_TYPE_member_t asn_MBR_KickPetitionUpdateMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "numVotesNeededToKick" - }, + }, }; static ber_tlv_tag_t asn_DEF_KickPetitionUpdateMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (69 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_KickPetitionUpdateMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 4 }, /* gameId at 616 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 3 }, /* petitionId at 617 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 2 }, /* numVotesAgainstKicking at 618 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 1 }, /* numVotesInFavourOfKicking at 619 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -4, 0 } /* numVotesNeededToKick at 620 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 4 }, /* gameId at 639 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 3 }, /* petitionId at 640 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 2 }, /* numVotesAgainstKicking at 641 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 1 }, /* numVotesInFavourOfKicking at 642 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -4, 0 } /* numVotesNeededToKick at 643 */ }; static asn_SEQUENCE_specifics_t asn_SPC_KickPetitionUpdateMessage_specs_1 = { sizeof(struct KickPetitionUpdateMessage), @@ -163,10 +163,10 @@ asn_TYPE_descriptor_t asn_DEF_KickPetitionUpdateMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_KickPetitionUpdateMessage_tags_1, sizeof(asn_DEF_KickPetitionUpdateMessage_tags_1) - /sizeof(asn_DEF_KickPetitionUpdateMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_KickPetitionUpdateMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_KickPetitionUpdateMessage_tags_1, /* Same as above */ sizeof(asn_DEF_KickPetitionUpdateMessage_tags_1) - /sizeof(asn_DEF_KickPetitionUpdateMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_KickPetitionUpdateMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_KickPetitionUpdateMessage_1, 5, /* Elements count */ diff --git a/src/third_party/asn1/KickPetitionUpdateMessage.h b/src/third_party/asn1/KickPetitionUpdateMessage.h index 1c914f78..e16da6bb 100644 --- a/src/third_party/asn1/KickPetitionUpdateMessage.h +++ b/src/third_party/asn1/KickPetitionUpdateMessage.h @@ -20,24 +20,24 @@ extern "C" { #endif -/* KickPetitionUpdateMessage */ -typedef struct KickPetitionUpdateMessage { - NonZeroId_t gameId; - NonZeroId_t petitionId; - long numVotesAgainstKicking; - long numVotesInFavourOfKicking; - long numVotesNeededToKick; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} KickPetitionUpdateMessage_t; + /* KickPetitionUpdateMessage */ + typedef struct KickPetitionUpdateMessage { + NonZeroId_t gameId; + NonZeroId_t petitionId; + long numVotesAgainstKicking; + long numVotesInFavourOfKicking; + long numVotesNeededToKick; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_KickPetitionUpdateMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } KickPetitionUpdateMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_KickPetitionUpdateMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/KickPlayerRequestMessage.c b/src/third_party/asn1/KickPlayerRequestMessage.c index 3eabc3a0..edec60f1 100644 --- a/src/third_party/asn1/KickPlayerRequestMessage.c +++ b/src/third_party/asn1/KickPlayerRequestMessage.c @@ -8,7 +8,7 @@ #include "KickPlayerRequestMessage.h" static asn_TYPE_member_t asn_MBR_KickPlayerRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct KickPlayerRequestMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct KickPlayerRequestMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_KickPlayerRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct KickPlayerRequestMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct KickPlayerRequestMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_KickPlayerRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_KickPlayerRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (14 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_KickPlayerRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 391 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 393 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 398 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerId at 400 */ }; static asn_SEQUENCE_specifics_t asn_SPC_KickPlayerRequestMessage_specs_1 = { sizeof(struct KickPlayerRequestMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_KickPlayerRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_KickPlayerRequestMessage_tags_1, sizeof(asn_DEF_KickPlayerRequestMessage_tags_1) - /sizeof(asn_DEF_KickPlayerRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_KickPlayerRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_KickPlayerRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_KickPlayerRequestMessage_tags_1) - /sizeof(asn_DEF_KickPlayerRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_KickPlayerRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_KickPlayerRequestMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/KickPlayerRequestMessage.h b/src/third_party/asn1/KickPlayerRequestMessage.h index 911da916..710b0c05 100644 --- a/src/third_party/asn1/KickPlayerRequestMessage.h +++ b/src/third_party/asn1/KickPlayerRequestMessage.h @@ -19,21 +19,21 @@ extern "C" { #endif -/* KickPlayerRequestMessage */ -typedef struct KickPlayerRequestMessage { - NonZeroId_t gameId; - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} KickPlayerRequestMessage_t; + /* KickPlayerRequestMessage */ + typedef struct KickPlayerRequestMessage { + NonZeroId_t gameId; + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_KickPlayerRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } KickPlayerRequestMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_KickPlayerRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/LeaveGameRequestMessage.c b/src/third_party/asn1/LeaveGameRequestMessage.c index 9a8b5536..606f756a 100644 --- a/src/third_party/asn1/LeaveGameRequestMessage.c +++ b/src/third_party/asn1/LeaveGameRequestMessage.c @@ -8,7 +8,7 @@ #include "LeaveGameRequestMessage.h" static asn_TYPE_member_t asn_MBR_LeaveGameRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct LeaveGameRequestMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct LeaveGameRequestMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,14 +16,14 @@ static asn_TYPE_member_t asn_MBR_LeaveGameRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, + }, }; static ber_tlv_tag_t asn_DEF_LeaveGameRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (15 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_LeaveGameRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 397 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 404 */ }; static asn_SEQUENCE_specifics_t asn_SPC_LeaveGameRequestMessage_specs_1 = { sizeof(struct LeaveGameRequestMessage), @@ -48,10 +48,10 @@ asn_TYPE_descriptor_t asn_DEF_LeaveGameRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_LeaveGameRequestMessage_tags_1, sizeof(asn_DEF_LeaveGameRequestMessage_tags_1) - /sizeof(asn_DEF_LeaveGameRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_LeaveGameRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_LeaveGameRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_LeaveGameRequestMessage_tags_1) - /sizeof(asn_DEF_LeaveGameRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_LeaveGameRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_LeaveGameRequestMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/LeaveGameRequestMessage.h b/src/third_party/asn1/LeaveGameRequestMessage.h index d3c8c183..df6b941d 100644 --- a/src/third_party/asn1/LeaveGameRequestMessage.h +++ b/src/third_party/asn1/LeaveGameRequestMessage.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* LeaveGameRequestMessage */ -typedef struct LeaveGameRequestMessage { - NonZeroId_t gameId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} LeaveGameRequestMessage_t; + /* LeaveGameRequestMessage */ + typedef struct LeaveGameRequestMessage { + NonZeroId_t gameId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_LeaveGameRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } LeaveGameRequestMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_LeaveGameRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/MyActionRequestMessage.c b/src/third_party/asn1/MyActionRequestMessage.c index cb0e78df..3a69ba92 100644 --- a/src/third_party/asn1/MyActionRequestMessage.c +++ b/src/third_party/asn1/MyActionRequestMessage.c @@ -9,31 +9,31 @@ static int memb_myRelativeBet_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -41,8 +41,8 @@ static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, handNum), + }, + { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, handNum), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -50,8 +50,8 @@ static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "handNum" - }, - { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, gameState), + }, + { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, gameState), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetGameState, @@ -59,8 +59,8 @@ static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameState" - }, - { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, myAction), + }, + { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, myAction), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetPlayerAction, @@ -68,8 +68,8 @@ static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "myAction" - }, - { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, myRelativeBet), + }, + { ATF_NOFLAGS, 0, offsetof(struct MyActionRequestMessage, myRelativeBet), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -77,18 +77,18 @@ static asn_TYPE_member_t asn_MBR_MyActionRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "myRelativeBet" - }, + }, }; static ber_tlv_tag_t asn_DEF_MyActionRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (25 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_MyActionRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* gameId at 466 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* handNum at 467 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 0 }, /* myRelativeBet at 470 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 468 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* myAction at 469 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* gameId at 489 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* handNum at 490 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 0 }, /* myRelativeBet at 493 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 491 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* myAction at 492 */ }; static asn_SEQUENCE_specifics_t asn_SPC_MyActionRequestMessage_specs_1 = { sizeof(struct MyActionRequestMessage), @@ -113,10 +113,10 @@ asn_TYPE_descriptor_t asn_DEF_MyActionRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_MyActionRequestMessage_tags_1, sizeof(asn_DEF_MyActionRequestMessage_tags_1) - /sizeof(asn_DEF_MyActionRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_MyActionRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_MyActionRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_MyActionRequestMessage_tags_1) - /sizeof(asn_DEF_MyActionRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_MyActionRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_MyActionRequestMessage_1, 5, /* Elements count */ diff --git a/src/third_party/asn1/MyActionRequestMessage.h b/src/third_party/asn1/MyActionRequestMessage.h index 21de822a..18f36201 100644 --- a/src/third_party/asn1/MyActionRequestMessage.h +++ b/src/third_party/asn1/MyActionRequestMessage.h @@ -22,24 +22,24 @@ extern "C" { #endif -/* MyActionRequestMessage */ -typedef struct MyActionRequestMessage { - NonZeroId_t gameId; - NonZeroId_t handNum; - NetGameState_t gameState; - NetPlayerAction_t myAction; - long myRelativeBet; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} MyActionRequestMessage_t; + /* MyActionRequestMessage */ + typedef struct MyActionRequestMessage { + NonZeroId_t gameId; + NonZeroId_t handNum; + NetGameState_t gameState; + NetPlayerAction_t myAction; + long myRelativeBet; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_MyActionRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } MyActionRequestMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_MyActionRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/NativeEnumerated.c b/src/third_party/asn1/NativeEnumerated.c index 1554220f..fc33a639 100644 --- a/src/third_party/asn1/NativeEnumerated.c +++ b/src/third_party/asn1/NativeEnumerated.c @@ -42,17 +42,17 @@ asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = { asn_enc_rval_t NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; - asn_enc_rval_t er; - const long *native = (const long *)sptr; + asn_enc_rval_t er; + const long *native = (const long *)sptr; const asn_INTEGER_enum_map_t *el; - (void)ilevel; - (void)flags; + (void)ilevel; + (void)flags; - if(!native) _ASN_ENCODE_FAILED; + if(!native) _ASN_ENCODE_FAILED; el = INTEGER_map_value2enum(specs, *native); if(el) { @@ -65,15 +65,15 @@ NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, _ASN_ENCODED_OK(er); } else { ASN_DEBUG("ASN.1 forbids dealing with " - "unknown value of ENUMERATED type"); + "unknown value of ENUMERATED type"); _ASN_ENCODE_FAILED; } } asn_dec_rval_t NativeEnumerated_decode_uper(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, - void **sptr, asn_per_data_t *pd) { + asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, + void **sptr, asn_per_data_t *pd) { asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval = { RC_OK, 0 }; long *native = (long *)*sptr; @@ -104,7 +104,7 @@ NativeEnumerated_decode_uper(asn_codec_ctx_t *opt_codec_ctx, value = per_get_few_bits(pd, ct->range_bits); if(value < 0) _ASN_DECODE_STARVED; if(value >= (specs->extension - ? specs->extension - 1 : specs->map_count)) + ? specs->extension - 1 : specs->map_count)) _ASN_DECODE_FAILED; } else { if(!specs->extension) @@ -138,7 +138,7 @@ NativeEnumerated__compar_value2enum(const void *ap, const void *bp) { asn_enc_rval_t NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics; asn_enc_rval_t er; long native, value; @@ -163,7 +163,7 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td, key.nat_value = native; kf = bsearch(&key, specs->value2enum, specs->map_count, - sizeof(key), NativeEnumerated__compar_value2enum); + sizeof(key), NativeEnumerated__compar_value2enum); if(!kf) { ASN_DEBUG("No element corresponds to %ld", native); _ASN_ENCODE_FAILED; @@ -172,7 +172,7 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td, if(ct->range_bits >= 0) { int cmpWith = specs->extension - ? specs->extension - 1 : specs->map_count; + ? specs->extension - 1 : specs->map_count; if(value >= cmpWith) inext = 1; } @@ -197,8 +197,8 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td, * X.691, #10.6: normally small non-negative whole number; */ ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld", - value, specs->extension, inext, - value - (inext ? (specs->extension - 1) : 0)); + value, specs->extension, inext, + value - (inext ? (specs->extension - 1) : 0)); if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0))) _ASN_ENCODE_FAILED; diff --git a/src/third_party/asn1/NativeEnumerated.h b/src/third_party/asn1/NativeEnumerated.h index c59bb1ba..404d31d0 100644 --- a/src/third_party/asn1/NativeEnumerated.h +++ b/src/third_party/asn1/NativeEnumerated.h @@ -19,11 +19,11 @@ extern "C" { #endif -extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; + extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated; -xer_type_encoder_f NativeEnumerated_encode_xer; -per_type_decoder_f NativeEnumerated_decode_uper; -per_type_encoder_f NativeEnumerated_encode_uper; + xer_type_encoder_f NativeEnumerated_encode_xer; + per_type_decoder_f NativeEnumerated_decode_uper; + per_type_encoder_f NativeEnumerated_encode_uper; #ifdef __cplusplus } diff --git a/src/third_party/asn1/NativeInteger.c b/src/third_party/asn1/NativeInteger.c index cffd0be8..5b66332f 100644 --- a/src/third_party/asn1/NativeInteger.c +++ b/src/third_party/asn1/NativeInteger.c @@ -46,8 +46,8 @@ asn_TYPE_descriptor_t asn_DEF_NativeInteger = { */ asn_dec_rval_t NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) { + asn_TYPE_descriptor_t *td, + void **nint_ptr, const void *buf_ptr, size_t size, int tag_mode) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; long *native = (long *)*nint_ptr; asn_dec_rval_t rval; @@ -66,13 +66,13 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, } ASN_DEBUG("Decoding %s as INTEGER (tm=%d)", - td->name, tag_mode); + td->name, tag_mode); /* * Check tags. */ rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, - tag_mode, 0, &length, 0); + tag_mode, 0, &length, 0); if(rval.code != RC_OK) return rval; @@ -107,8 +107,8 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, tmp.size = length; if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */ - : asn_INTEGER2long(&tmp, &l)) { + ? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */ + : asn_INTEGER2long(&tmp, &l)) { rval.code = RC_FAIL; rval.consumed = 0; return rval; @@ -121,7 +121,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, rval.consumed += length; ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)", - (long)rval.consumed, (long)length, td->name, (long)*native); + (long)rval.consumed, (long)length, td->name, (long)*native); return rval; } @@ -131,8 +131,8 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, */ asn_enc_rval_t NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { unsigned long native = *(unsigned long *)ptr; /* Disable sign ext. */ asn_enc_rval_t erval; INTEGER_t tmp; @@ -153,7 +153,7 @@ NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, tmp.buf = buf; tmp.size = sizeof(buf); #endif /* WORDS_BIGENDIAN */ - + /* Encode fake INTEGER */ erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key); if(erval.encoded == -1) { @@ -168,8 +168,8 @@ NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, */ asn_dec_rval_t NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, - const void *buf_ptr, size_t size) { + asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname, + const void *buf_ptr, size_t size) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval; INTEGER_t st; @@ -182,13 +182,13 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, } memset(&st, 0, sizeof(st)); - rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, - opt_mname, buf_ptr, size); + rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr, + opt_mname, buf_ptr, size); if(rval.code == RC_OK) { long l; if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ - : asn_INTEGER2long(&st, &l)) { + ? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */ + : asn_INTEGER2long(&st, &l)) { rval.code = RC_FAIL; rval.consumed = 0; } else { @@ -209,8 +209,8 @@ NativeInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_enc_rval_t NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; char scratch[32]; /* Enough for 64-bit int */ asn_enc_rval_t er; @@ -222,10 +222,10 @@ NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, if(!native) _ASN_ENCODE_FAILED; er.encoded = snprintf(scratch, sizeof(scratch), - (specs && specs->field_unsigned) - ? "%lu" : "%ld", *native); + (specs && specs->field_unsigned) + ? "%lu" : "%ld", *native); if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch) - || cb(scratch, er.encoded, app_key) < 0) + || cb(scratch, er.encoded, app_key) < 0) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); @@ -233,8 +233,8 @@ NativeInteger_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, asn_dec_rval_t NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_TYPE_descriptor_t *td, + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval; @@ -252,15 +252,15 @@ NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, memset(&tmpint, 0, sizeof tmpint); rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints, - &tmpintptr, pd); + &tmpintptr, pd); if(rval.code == RC_OK) { if((specs&&specs->field_unsigned) - ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) - : asn_INTEGER2long(&tmpint, native)) + ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native) + : asn_INTEGER2long(&tmpint, native)) rval.code = RC_FAIL; else ASN_DEBUG("NativeInteger %s got value %ld", - td->name, *native); + td->name, *native); } ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); @@ -269,7 +269,7 @@ NativeInteger_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_enc_rval_t NativeInteger_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; asn_enc_rval_t er; long native; @@ -283,8 +283,8 @@ NativeInteger_encode_uper(asn_TYPE_descriptor_t *td, memset(&tmpint, 0, sizeof(tmpint)); if((specs&&specs->field_unsigned) - ? asn_ulong2INTEGER(&tmpint, native) - : asn_long2INTEGER(&tmpint, native)) + ? asn_ulong2INTEGER(&tmpint, native) + : asn_long2INTEGER(&tmpint, native)) _ASN_ENCODE_FAILED; er = INTEGER_encode_uper(td, constraints, &tmpint, po); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint); @@ -296,7 +296,7 @@ NativeInteger_encode_uper(asn_TYPE_descriptor_t *td, */ int NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics; const long *native = (const long *)sptr; char scratch[32]; /* Enough for 64-bit int */ @@ -307,8 +307,8 @@ NativeInteger_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, if(native) { ret = snprintf(scratch, sizeof(scratch), - (specs && specs->field_unsigned) - ? "%lu" : "%ld", *native); + (specs && specs->field_unsigned) + ? "%lu" : "%ld", *native); assert(ret > 0 && (size_t)ret < sizeof(scratch)); return (cb(scratch, ret, app_key) < 0) ? -1 : 0; } else { @@ -323,7 +323,7 @@ NativeInteger_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { return; ASN_DEBUG("Freeing %s as INTEGER (%d, %p, Native)", - td->name, contents_only, ptr); + td->name, contents_only, ptr); if(!contents_only) { FREEMEM(ptr); diff --git a/src/third_party/asn1/NativeInteger.h b/src/third_party/asn1/NativeInteger.h index 4e63a835..a559b9b9 100644 --- a/src/third_party/asn1/NativeInteger.h +++ b/src/third_party/asn1/NativeInteger.h @@ -19,16 +19,16 @@ extern "C" { #endif -extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; + extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; -asn_struct_free_f NativeInteger_free; -asn_struct_print_f NativeInteger_print; -ber_type_decoder_f NativeInteger_decode_ber; -der_type_encoder_f NativeInteger_encode_der; -xer_type_decoder_f NativeInteger_decode_xer; -xer_type_encoder_f NativeInteger_encode_xer; -per_type_decoder_f NativeInteger_decode_uper; -per_type_encoder_f NativeInteger_encode_uper; + asn_struct_free_f NativeInteger_free; + asn_struct_print_f NativeInteger_print; + ber_type_decoder_f NativeInteger_decode_ber; + der_type_encoder_f NativeInteger_encode_der; + xer_type_decoder_f NativeInteger_decode_xer; + xer_type_encoder_f NativeInteger_encode_xer; + per_type_decoder_f NativeInteger_decode_uper; + per_type_encoder_f NativeInteger_encode_uper; #ifdef __cplusplus } diff --git a/src/third_party/asn1/NetAvatarType.c b/src/third_party/asn1/NetAvatarType.c index e13aab94..5535bc66 100644 --- a/src/third_party/asn1/NetAvatarType.c +++ b/src/third_party/asn1/NetAvatarType.c @@ -9,7 +9,7 @@ int NetAvatarType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ NetAvatarType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void NetAvatarType_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { NetAvatarType_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NetAvatarType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NetAvatarType_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NetAvatarType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { NetAvatarType_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NetAvatarType_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { NetAvatarType_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NetAvatarType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { NetAvatarType_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NetAvatarType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { NetAvatarType_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -116,10 +116,10 @@ asn_TYPE_descriptor_t asn_DEF_NetAvatarType = { 0, /* Use generic outmost tag fetcher */ asn_DEF_NetAvatarType_tags_1, sizeof(asn_DEF_NetAvatarType_tags_1) - /sizeof(asn_DEF_NetAvatarType_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetAvatarType_tags_1[0]), /* 1 */ asn_DEF_NetAvatarType_tags_1, /* Same as above */ sizeof(asn_DEF_NetAvatarType_tags_1) - /sizeof(asn_DEF_NetAvatarType_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetAvatarType_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_NetAvatarType_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/NetAvatarType.h b/src/third_party/asn1/NetAvatarType.h index 121d3b42..7a7b0102 100644 --- a/src/third_party/asn1/NetAvatarType.h +++ b/src/third_party/asn1/NetAvatarType.h @@ -18,25 +18,26 @@ extern "C" { #endif -/* Dependencies */ -typedef enum NetAvatarType { - NetAvatarType_avatarImagePng = 1, - NetAvatarType_avatarImageJpg = 2, - NetAvatarType_avatarImageGif = 3 -} e_NetAvatarType; + /* Dependencies */ + typedef enum NetAvatarType { + NetAvatarType_avatarImagePng = 1, + NetAvatarType_avatarImageJpg = 2, + NetAvatarType_avatarImageGif = 3 + } + e_NetAvatarType; -/* NetAvatarType */ -typedef long NetAvatarType_t; + /* NetAvatarType */ + typedef long NetAvatarType_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NetAvatarType; -asn_struct_free_f NetAvatarType_free; -asn_struct_print_f NetAvatarType_print; -asn_constr_check_f NetAvatarType_constraint; -ber_type_decoder_f NetAvatarType_decode_ber; -der_type_encoder_f NetAvatarType_encode_der; -xer_type_decoder_f NetAvatarType_decode_xer; -xer_type_encoder_f NetAvatarType_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NetAvatarType; + asn_struct_free_f NetAvatarType_free; + asn_struct_print_f NetAvatarType_print; + asn_constr_check_f NetAvatarType_constraint; + ber_type_decoder_f NetAvatarType_decode_ber; + der_type_encoder_f NetAvatarType_encode_der; + xer_type_decoder_f NetAvatarType_decode_xer; + xer_type_encoder_f NetAvatarType_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/NetGameInfo.c b/src/third_party/asn1/NetGameInfo.c index d49d1a09..98208a7f 100644 --- a/src/third_party/asn1/NetGameInfo.c +++ b/src/third_party/asn1/NetGameInfo.c @@ -9,7 +9,7 @@ static int netGameType_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,106 +33,106 @@ netGameType_3_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void netGameType_3_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { netGameType_3_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int netGameType_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { netGameType_3_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t netGameType_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { netGameType_3_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t netGameType_3_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { netGameType_3_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t netGameType_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { netGameType_3_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t netGameType_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { netGameType_3_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_raiseEveryHands_constraint_9(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 1000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_raiseEveryMinutes_constraint_9(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 1000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int endRaiseMode_13_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -156,307 +156,307 @@ endRaiseMode_13_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void endRaiseMode_13_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { endRaiseMode_13_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int endRaiseMode_13_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { endRaiseMode_13_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t endRaiseMode_13_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { endRaiseMode_13_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t endRaiseMode_13_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { endRaiseMode_13_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t endRaiseMode_13_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { endRaiseMode_13_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t endRaiseMode_13_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { endRaiseMode_13_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_NativeInteger_constraint_23(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 1000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_gameName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 64)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_maxNumPlayers_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 2 && value <= 10)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_proposedGuiSpeed_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 11)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_delayBetweenHands_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 5 && value <= 20)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_playerActionTimeout_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 60)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_firstSmallBlind_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 20000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_endRaiseSmallBlindValue_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 1000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_startMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 1000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_manualBlinds_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + /* Determine the number of elements */ size = _A_CSEQUENCE_FROM_VOID(sptr)->count; - + if((size <= 30)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -500,17 +500,17 @@ asn_TYPE_descriptor_t asn_DEF_netGameType_3 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_netGameType_tags_3, sizeof(asn_DEF_netGameType_tags_3) - /sizeof(asn_DEF_netGameType_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_netGameType_tags_3[0]), /* 1 */ asn_DEF_netGameType_tags_3, /* Same as above */ sizeof(asn_DEF_netGameType_tags_3) - /sizeof(asn_DEF_netGameType_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_netGameType_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_netGameType_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_raiseIntervalMode_9[] = { - { ATF_NOFLAGS, 0, offsetof(struct raiseIntervalMode, choice.raiseEveryHands), + { ATF_NOFLAGS, 0, offsetof(struct raiseIntervalMode, choice.raiseEveryHands), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, @@ -518,8 +518,8 @@ static asn_TYPE_member_t asn_MBR_raiseIntervalMode_9[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "raiseEveryHands" - }, - { ATF_NOFLAGS, 0, offsetof(struct raiseIntervalMode, choice.raiseEveryMinutes), + }, + { ATF_NOFLAGS, 0, offsetof(struct raiseIntervalMode, choice.raiseEveryMinutes), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, @@ -527,11 +527,11 @@ static asn_TYPE_member_t asn_MBR_raiseIntervalMode_9[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "raiseEveryMinutes" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_raiseIntervalMode_tag2el_9[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* raiseEveryHands at 334 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* raiseEveryMinutes at 335 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* raiseEveryHands at 341 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* raiseEveryMinutes at 342 */ }; static asn_CHOICE_specifics_t asn_SPC_raiseIntervalMode_specs_9 = { sizeof(struct raiseIntervalMode), @@ -603,17 +603,17 @@ asn_TYPE_descriptor_t asn_DEF_endRaiseMode_13 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_endRaiseMode_tags_13, sizeof(asn_DEF_endRaiseMode_tags_13) - /sizeof(asn_DEF_endRaiseMode_tags_13[0]), /* 1 */ + /sizeof(asn_DEF_endRaiseMode_tags_13[0]), /* 1 */ asn_DEF_endRaiseMode_tags_13, /* Same as above */ sizeof(asn_DEF_endRaiseMode_tags_13) - /sizeof(asn_DEF_endRaiseMode_tags_13[0]), /* 1 */ + /sizeof(asn_DEF_endRaiseMode_tags_13[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_endRaiseMode_specs_13 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_manualBlinds_23[] = { - { ATF_POINTER, 0, 0, + { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -621,7 +621,7 @@ static asn_TYPE_member_t asn_MBR_manualBlinds_23[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "" - }, + }, }; static ber_tlv_tag_t asn_DEF_manualBlinds_tags_23[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) @@ -646,10 +646,10 @@ asn_TYPE_descriptor_t asn_DEF_manualBlinds_23 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_manualBlinds_tags_23, sizeof(asn_DEF_manualBlinds_tags_23) - /sizeof(asn_DEF_manualBlinds_tags_23[0]), /* 1 */ + /sizeof(asn_DEF_manualBlinds_tags_23[0]), /* 1 */ asn_DEF_manualBlinds_tags_23, /* Same as above */ sizeof(asn_DEF_manualBlinds_tags_23) - /sizeof(asn_DEF_manualBlinds_tags_23[0]), /* 1 */ + /sizeof(asn_DEF_manualBlinds_tags_23[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_manualBlinds_23, 1, /* Single element */ @@ -657,7 +657,7 @@ asn_TYPE_descriptor_t asn_DEF_manualBlinds_23 = { }; static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, gameName), + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, gameName), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -665,8 +665,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameName" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, netGameType), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, netGameType), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_netGameType_3, @@ -674,8 +674,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "netGameType" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, maxNumPlayers), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, maxNumPlayers), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -683,8 +683,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "maxNumPlayers" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, raiseIntervalMode), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, raiseIntervalMode), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_raiseIntervalMode_9, @@ -692,8 +692,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "raiseIntervalMode" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, endRaiseMode), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, endRaiseMode), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_endRaiseMode_13, @@ -701,8 +701,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "endRaiseMode" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, proposedGuiSpeed), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, proposedGuiSpeed), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -710,8 +710,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "proposedGuiSpeed" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, delayBetweenHands), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, delayBetweenHands), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -719,8 +719,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "delayBetweenHands" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, playerActionTimeout), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, playerActionTimeout), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -728,8 +728,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerActionTimeout" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, firstSmallBlind), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, firstSmallBlind), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -737,8 +737,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "firstSmallBlind" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, endRaiseSmallBlindValue), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, endRaiseSmallBlindValue), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -746,8 +746,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "endRaiseSmallBlindValue" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, startMoney), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, startMoney), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -755,8 +755,8 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "startMoney" - }, - { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, manualBlinds), + }, + { ATF_NOFLAGS, 0, offsetof(struct NetGameInfo, manualBlinds), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_manualBlinds_23, @@ -764,25 +764,25 @@ static asn_TYPE_member_t asn_MBR_NetGameInfo_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "manualBlinds" - }, + }, }; static ber_tlv_tag_t asn_DEF_NetGameInfo_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_NetGameInfo_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 6 }, /* maxNumPlayers at 332 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -1, 5 }, /* proposedGuiSpeed at 342 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 4 }, /* delayBetweenHands at 343 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 7, -3, 3 }, /* playerActionTimeout at 344 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 8, -4, 2 }, /* firstSmallBlind at 345 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 9, -5, 1 }, /* endRaiseSmallBlindValue at 346 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 10, -6, 0 }, /* startMoney at 347 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 1 }, /* netGameType at 327 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, -1, 0 }, /* endRaiseMode at 338 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 }, /* gameName at 325 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 11, 0, 0 }, /* manualBlinds at 348 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* raiseEveryHands at 334 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 } /* raiseEveryMinutes at 335 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 6 }, /* maxNumPlayers at 339 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -1, 5 }, /* proposedGuiSpeed at 349 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 4 }, /* delayBetweenHands at 350 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 7, -3, 3 }, /* playerActionTimeout at 351 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 8, -4, 2 }, /* firstSmallBlind at 352 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 9, -5, 1 }, /* endRaiseSmallBlindValue at 353 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 10, -6, 0 }, /* startMoney at 354 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 1 }, /* netGameType at 334 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, -1, 0 }, /* endRaiseMode at 345 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 }, /* gameName at 332 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 11, 0, 0 }, /* manualBlinds at 355 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 3, 0, 0 }, /* raiseEveryHands at 341 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 } /* raiseEveryMinutes at 342 */ }; static asn_SEQUENCE_specifics_t asn_SPC_NetGameInfo_specs_1 = { sizeof(struct NetGameInfo), @@ -807,10 +807,10 @@ asn_TYPE_descriptor_t asn_DEF_NetGameInfo = { 0, /* Use generic outmost tag fetcher */ asn_DEF_NetGameInfo_tags_1, sizeof(asn_DEF_NetGameInfo_tags_1) - /sizeof(asn_DEF_NetGameInfo_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetGameInfo_tags_1[0]), /* 1 */ asn_DEF_NetGameInfo_tags_1, /* Same as above */ sizeof(asn_DEF_NetGameInfo_tags_1) - /sizeof(asn_DEF_NetGameInfo_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetGameInfo_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_NetGameInfo_1, 12, /* Elements count */ diff --git a/src/third_party/asn1/NetGameInfo.h b/src/third_party/asn1/NetGameInfo.h index 4e1cdc0b..e3c24687 100644 --- a/src/third_party/asn1/NetGameInfo.h +++ b/src/third_party/asn1/NetGameInfo.h @@ -24,71 +24,72 @@ extern "C" { #endif -/* Dependencies */ -typedef enum netGameType { - netGameType_normalGame = 1, - netGameType_registeredOnlyGame = 2, - netGameType_inviteOnlyGame = 3, - netGameType_rankingGame = 4 -} e_netGameType; -typedef enum raiseIntervalMode_PR { - raiseIntervalMode_PR_NOTHING, /* No components present */ - raiseIntervalMode_PR_raiseEveryHands, - raiseIntervalMode_PR_raiseEveryMinutes, - /* Extensions may appear below */ - -} raiseIntervalMode_PR; -typedef enum endRaiseMode { - endRaiseMode_doubleBlinds = 1, - endRaiseMode_raiseByEndValue = 2, - endRaiseMode_keepLastBlind = 3 -} e_endRaiseMode; + /* Dependencies */ + typedef enum netGameType { + netGameType_normalGame = 1, + netGameType_registeredOnlyGame = 2, + netGameType_inviteOnlyGame = 3, + netGameType_rankingGame = 4 + } + e_netGameType; + typedef enum raiseIntervalMode_PR { + raiseIntervalMode_PR_NOTHING, /* No components present */ + raiseIntervalMode_PR_raiseEveryHands, + raiseIntervalMode_PR_raiseEveryMinutes, + /* Extensions may appear below */ + + } raiseIntervalMode_PR; + typedef enum endRaiseMode { + endRaiseMode_doubleBlinds = 1, + endRaiseMode_raiseByEndValue = 2, + endRaiseMode_keepLastBlind = 3 + } e_endRaiseMode; + + /* NetGameInfo */ + typedef struct NetGameInfo { + UTF8String_t gameName; + long netGameType; + long maxNumPlayers; + struct raiseIntervalMode { + raiseIntervalMode_PR present; + union NetGameInfo__raiseIntervalMode_u { + long raiseEveryHands; + long raiseEveryMinutes; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } raiseIntervalMode; + long endRaiseMode; + long proposedGuiSpeed; + long delayBetweenHands; + long playerActionTimeout; + long firstSmallBlind; + long endRaiseSmallBlindValue; + long startMoney; + struct manualBlinds { + A_SEQUENCE_OF(long) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } manualBlinds; + /* + * This type is extensible, + * possible extensions are below. + */ -/* NetGameInfo */ -typedef struct NetGameInfo { - UTF8String_t gameName; - long netGameType; - long maxNumPlayers; - struct raiseIntervalMode { - raiseIntervalMode_PR present; - union NetGameInfo__raiseIntervalMode_u { - long raiseEveryHands; - long raiseEveryMinutes; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } raiseIntervalMode; - long endRaiseMode; - long proposedGuiSpeed; - long delayBetweenHands; - long playerActionTimeout; - long firstSmallBlind; - long endRaiseSmallBlindValue; - long startMoney; - struct manualBlinds { - A_SEQUENCE_OF(long) list; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; - } manualBlinds; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} NetGameInfo_t; + } NetGameInfo_t; -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_netGameType_3; // (Use -fall-defs-global to expose) */ -/* extern asn_TYPE_descriptor_t asn_DEF_endRaiseMode_13; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_NetGameInfo; + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_netGameType_3; // (Use -fall-defs-global to expose) */ + /* extern asn_TYPE_descriptor_t asn_DEF_endRaiseMode_13; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_NetGameInfo; #ifdef __cplusplus } diff --git a/src/third_party/asn1/NetGameMode.c b/src/third_party/asn1/NetGameMode.c index d513bbe1..d76f0400 100644 --- a/src/third_party/asn1/NetGameMode.c +++ b/src/third_party/asn1/NetGameMode.c @@ -9,7 +9,7 @@ int NetGameMode_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ NetGameMode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void NetGameMode_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { NetGameMode_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NetGameMode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NetGameMode_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NetGameMode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { NetGameMode_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NetGameMode_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { NetGameMode_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NetGameMode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { NetGameMode_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NetGameMode_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { NetGameMode_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -116,10 +116,10 @@ asn_TYPE_descriptor_t asn_DEF_NetGameMode = { 0, /* Use generic outmost tag fetcher */ asn_DEF_NetGameMode_tags_1, sizeof(asn_DEF_NetGameMode_tags_1) - /sizeof(asn_DEF_NetGameMode_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetGameMode_tags_1[0]), /* 1 */ asn_DEF_NetGameMode_tags_1, /* Same as above */ sizeof(asn_DEF_NetGameMode_tags_1) - /sizeof(asn_DEF_NetGameMode_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetGameMode_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_NetGameMode_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/NetGameMode.h b/src/third_party/asn1/NetGameMode.h index e795be00..4693e2bf 100644 --- a/src/third_party/asn1/NetGameMode.h +++ b/src/third_party/asn1/NetGameMode.h @@ -18,25 +18,26 @@ extern "C" { #endif -/* Dependencies */ -typedef enum NetGameMode { - NetGameMode_gameCreated = 1, - NetGameMode_gameStarted = 2, - NetGameMode_gameClosed = 3 -} e_NetGameMode; + /* Dependencies */ + typedef enum NetGameMode { + NetGameMode_gameCreated = 1, + NetGameMode_gameStarted = 2, + NetGameMode_gameClosed = 3 + } + e_NetGameMode; -/* NetGameMode */ -typedef long NetGameMode_t; + /* NetGameMode */ + typedef long NetGameMode_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NetGameMode; -asn_struct_free_f NetGameMode_free; -asn_struct_print_f NetGameMode_print; -asn_constr_check_f NetGameMode_constraint; -ber_type_decoder_f NetGameMode_decode_ber; -der_type_encoder_f NetGameMode_encode_der; -xer_type_decoder_f NetGameMode_decode_xer; -xer_type_encoder_f NetGameMode_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NetGameMode; + asn_struct_free_f NetGameMode_free; + asn_struct_print_f NetGameMode_print; + asn_constr_check_f NetGameMode_constraint; + ber_type_decoder_f NetGameMode_decode_ber; + der_type_encoder_f NetGameMode_encode_der; + xer_type_decoder_f NetGameMode_decode_xer; + xer_type_encoder_f NetGameMode_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/NetGameState.c b/src/third_party/asn1/NetGameState.c index 18e80d0a..c07ec3e3 100644 --- a/src/third_party/asn1/NetGameState.c +++ b/src/third_party/asn1/NetGameState.c @@ -9,7 +9,7 @@ int NetGameState_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ NetGameState_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void NetGameState_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { NetGameState_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NetGameState_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NetGameState_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NetGameState_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { NetGameState_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NetGameState_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { NetGameState_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NetGameState_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { NetGameState_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NetGameState_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { NetGameState_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -122,10 +122,10 @@ asn_TYPE_descriptor_t asn_DEF_NetGameState = { 0, /* Use generic outmost tag fetcher */ asn_DEF_NetGameState_tags_1, sizeof(asn_DEF_NetGameState_tags_1) - /sizeof(asn_DEF_NetGameState_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetGameState_tags_1[0]), /* 1 */ asn_DEF_NetGameState_tags_1, /* Same as above */ sizeof(asn_DEF_NetGameState_tags_1) - /sizeof(asn_DEF_NetGameState_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetGameState_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_NetGameState_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/NetGameState.h b/src/third_party/asn1/NetGameState.h index e55418da..f2f5c974 100644 --- a/src/third_party/asn1/NetGameState.h +++ b/src/third_party/asn1/NetGameState.h @@ -18,28 +18,29 @@ extern "C" { #endif -/* Dependencies */ -typedef enum NetGameState { - NetGameState_statePreflop = 0, - NetGameState_stateFlop = 1, - NetGameState_stateTurn = 2, - NetGameState_stateRiver = 3, - NetGameState_statePreflopSmallBlind = 4, - NetGameState_statePreflopBigBlind = 5 -} e_NetGameState; + /* Dependencies */ + typedef enum NetGameState { + NetGameState_statePreflop = 0, + NetGameState_stateFlop = 1, + NetGameState_stateTurn = 2, + NetGameState_stateRiver = 3, + NetGameState_statePreflopSmallBlind = 4, + NetGameState_statePreflopBigBlind = 5 + } + e_NetGameState; -/* NetGameState */ -typedef long NetGameState_t; + /* NetGameState */ + typedef long NetGameState_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NetGameState; -asn_struct_free_f NetGameState_free; -asn_struct_print_f NetGameState_print; -asn_constr_check_f NetGameState_constraint; -ber_type_decoder_f NetGameState_decode_ber; -der_type_encoder_f NetGameState_encode_der; -xer_type_decoder_f NetGameState_decode_xer; -xer_type_encoder_f NetGameState_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NetGameState; + asn_struct_free_f NetGameState_free; + asn_struct_print_f NetGameState_print; + asn_constr_check_f NetGameState_constraint; + ber_type_decoder_f NetGameState_decode_ber; + der_type_encoder_f NetGameState_encode_der; + xer_type_decoder_f NetGameState_decode_xer; + xer_type_encoder_f NetGameState_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/NetPlayerAction.c b/src/third_party/asn1/NetPlayerAction.c index c60d3f66..79bab4c2 100644 --- a/src/third_party/asn1/NetPlayerAction.c +++ b/src/third_party/asn1/NetPlayerAction.c @@ -9,7 +9,7 @@ int NetPlayerAction_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ NetPlayerAction_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void NetPlayerAction_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { NetPlayerAction_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NetPlayerAction_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NetPlayerAction_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NetPlayerAction_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { NetPlayerAction_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NetPlayerAction_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { NetPlayerAction_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NetPlayerAction_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { NetPlayerAction_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NetPlayerAction_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { NetPlayerAction_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -124,10 +124,10 @@ asn_TYPE_descriptor_t asn_DEF_NetPlayerAction = { 0, /* Use generic outmost tag fetcher */ asn_DEF_NetPlayerAction_tags_1, sizeof(asn_DEF_NetPlayerAction_tags_1) - /sizeof(asn_DEF_NetPlayerAction_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetPlayerAction_tags_1[0]), /* 1 */ asn_DEF_NetPlayerAction_tags_1, /* Same as above */ sizeof(asn_DEF_NetPlayerAction_tags_1) - /sizeof(asn_DEF_NetPlayerAction_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NetPlayerAction_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_NetPlayerAction_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/NetPlayerAction.h b/src/third_party/asn1/NetPlayerAction.h index 6abf3ee3..c0284542 100644 --- a/src/third_party/asn1/NetPlayerAction.h +++ b/src/third_party/asn1/NetPlayerAction.h @@ -18,29 +18,30 @@ extern "C" { #endif -/* Dependencies */ -typedef enum NetPlayerAction { - NetPlayerAction_actionNone = 0, - NetPlayerAction_actionFold = 1, - NetPlayerAction_actionCheck = 2, - NetPlayerAction_actionCall = 3, - NetPlayerAction_actionBet = 4, - NetPlayerAction_actionRaise = 5, - NetPlayerAction_actionAllIn = 6 -} e_NetPlayerAction; + /* Dependencies */ + typedef enum NetPlayerAction { + NetPlayerAction_actionNone = 0, + NetPlayerAction_actionFold = 1, + NetPlayerAction_actionCheck = 2, + NetPlayerAction_actionCall = 3, + NetPlayerAction_actionBet = 4, + NetPlayerAction_actionRaise = 5, + NetPlayerAction_actionAllIn = 6 + } + e_NetPlayerAction; -/* NetPlayerAction */ -typedef long NetPlayerAction_t; + /* NetPlayerAction */ + typedef long NetPlayerAction_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NetPlayerAction; -asn_struct_free_f NetPlayerAction_free; -asn_struct_print_f NetPlayerAction_print; -asn_constr_check_f NetPlayerAction_constraint; -ber_type_decoder_f NetPlayerAction_decode_ber; -der_type_encoder_f NetPlayerAction_encode_der; -xer_type_decoder_f NetPlayerAction_decode_xer; -xer_type_encoder_f NetPlayerAction_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NetPlayerAction; + asn_struct_free_f NetPlayerAction_free; + asn_struct_print_f NetPlayerAction_print; + asn_constr_check_f NetPlayerAction_constraint; + ber_type_decoder_f NetPlayerAction_decode_ber; + der_type_encoder_f NetPlayerAction_encode_der; + xer_type_decoder_f NetPlayerAction_decode_xer; + xer_type_encoder_f NetPlayerAction_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/NonZeroId.c b/src/third_party/asn1/NonZeroId.c index e5610235..061608ef 100644 --- a/src/third_party/asn1/NonZeroId.c +++ b/src/third_party/asn1/NonZeroId.c @@ -9,25 +9,25 @@ int NonZeroId_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { unsigned long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const unsigned long *)sptr; - + if((value >= 1 && value <= 4294967295)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -50,49 +50,49 @@ NonZeroId_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; - /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */ } void NonZeroId_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { NonZeroId_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int NonZeroId_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { NonZeroId_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t NonZeroId_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { NonZeroId_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t NonZeroId_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { NonZeroId_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t NonZeroId_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { NonZeroId_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t NonZeroId_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { NonZeroId_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -119,10 +119,10 @@ asn_TYPE_descriptor_t asn_DEF_NonZeroId = { 0, /* Use generic outmost tag fetcher */ asn_DEF_NonZeroId_tags_1, sizeof(asn_DEF_NonZeroId_tags_1) - /sizeof(asn_DEF_NonZeroId_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NonZeroId_tags_1[0]), /* 1 */ asn_DEF_NonZeroId_tags_1, /* Same as above */ sizeof(asn_DEF_NonZeroId_tags_1) - /sizeof(asn_DEF_NonZeroId_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_NonZeroId_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_NonZeroId_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/NonZeroId.h b/src/third_party/asn1/NonZeroId.h index b4296f05..59eaa5db 100644 --- a/src/third_party/asn1/NonZeroId.h +++ b/src/third_party/asn1/NonZeroId.h @@ -18,18 +18,18 @@ extern "C" { #endif -/* NonZeroId */ -typedef unsigned long NonZeroId_t; + /* NonZeroId */ + typedef unsigned long NonZeroId_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_NonZeroId; -asn_struct_free_f NonZeroId_free; -asn_struct_print_f NonZeroId_print; -asn_constr_check_f NonZeroId_constraint; -ber_type_decoder_f NonZeroId_decode_ber; -der_type_encoder_f NonZeroId_encode_der; -xer_type_decoder_f NonZeroId_decode_xer; -xer_type_encoder_f NonZeroId_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_NonZeroId; + asn_struct_free_f NonZeroId_free; + asn_struct_print_f NonZeroId_print; + asn_constr_check_f NonZeroId_constraint; + ber_type_decoder_f NonZeroId_decode_ber; + der_type_encoder_f NonZeroId_encode_der; + xer_type_decoder_f NonZeroId_decode_xer; + xer_type_encoder_f NonZeroId_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/OCTET_STRING.c b/src/third_party/asn1/OCTET_STRING.c index 584def8b..89b0aeba 100644 --- a/src/third_party/asn1/OCTET_STRING.c +++ b/src/third_party/asn1/OCTET_STRING.c @@ -39,10 +39,10 @@ asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { 0, /* Use generic outmost tag fetcher */ asn_DEF_OCTET_STRING_tags, sizeof(asn_DEF_OCTET_STRING_tags) - / sizeof(asn_DEF_OCTET_STRING_tags[0]), + / sizeof(asn_DEF_OCTET_STRING_tags[0]), asn_DEF_OCTET_STRING_tags, /* Same as above */ sizeof(asn_DEF_OCTET_STRING_tags) - / sizeof(asn_DEF_OCTET_STRING_tags[0]), + / sizeof(asn_DEF_OCTET_STRING_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_DEF_OCTET_STRING_specs @@ -141,7 +141,7 @@ OS__add_stack_el(struct _stack *st) { nel = (struct _stack_el *)CALLOC(1, sizeof(struct _stack_el)); if(nel == NULL) return NULL; - + if(st->tail) { /* Increase a subcontainment depth */ nel->cont_level = st->tail->cont_level + 1; @@ -166,11 +166,11 @@ _new_stack() { */ asn_dec_rval_t OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - void **sptr, const void *buf_ptr, size_t size, int tag_mode) { + asn_TYPE_descriptor_t *td, + void **sptr, const void *buf_ptr, size_t size, int tag_mode) { asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_DEF_OCTET_STRING_specs; + ? (asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_DEF_OCTET_STRING_specs; BIT_STRING_t *st = (BIT_STRING_t *)*sptr; asn_dec_rval_t rval; asn_struct_ctx_t *ctx; @@ -181,10 +181,10 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, enum asn_OS_Subvariant type_variant = specs->subvariant; ASN_DEBUG("Decoding %s as %s (frame %ld)", - td->name, - (type_variant == ASN_OSUBV_STR) ? - "OCTET STRING" : "OS-SpecialCase", - (long)size); + td->name, + (type_variant == ASN_OSUBV_STR) ? + "OCTET STRING" : "OS-SpecialCase", + (long)size); /* * Create the string if does not exist. @@ -203,8 +203,8 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, * Check tags. */ rval = ber_check_tags(opt_codec_ctx, td, ctx, - buf_ptr, size, tag_mode, -1, - &ctx->left, &tlv_constr); + buf_ptr, size, tag_mode, -1, + &ctx->left, &tlv_constr); if(rval.code != RC_OK) return rval; @@ -232,175 +232,179 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, NEXT_PHASE(ctx); /* Fall through */ case 1: - phase1: +phase1: /* * Fill the stack with expectations. */ stck = (struct _stack *)ctx->ptr; sel = stck->cur_ptr; - do { - ber_tlv_tag_t tlv_tag; - ber_tlv_len_t tlv_len; - ber_tlv_tag_t expected_tag; - ssize_t tl, ll, tlvl; - /* This one works even if (sel->left == -1) */ - ssize_t Left = ((!sel||(size_t)sel->left >= size) - ?(ssize_t)size:sel->left); + do { + ber_tlv_tag_t tlv_tag; + ber_tlv_len_t tlv_len; + ber_tlv_tag_t expected_tag; + ssize_t tl, ll, tlvl; + /* This one works even if (sel->left == -1) */ + ssize_t Left = ((!sel||(size_t)sel->left >= size) + ?(ssize_t)size:sel->left); - ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel, - (long)(sel?sel->left:0), - (long)(sel?sel->want_nulls:0), - (long)(sel?sel->got:0) - ); - if(sel && sel->left <= 0 && sel->want_nulls == 0) { - if(sel->prev) { - struct _stack_el *prev = sel->prev; - if(prev->left != -1) { - if(prev->left < sel->got) - RETURN(RC_FAIL); - prev->left -= sel->got; + ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel, + (long)(sel?sel->left:0), + (long)(sel?sel->want_nulls:0), + (long)(sel?sel->got:0) + ); + if(sel && sel->left <= 0 && sel->want_nulls == 0) { + if(sel->prev) { + struct _stack_el *prev = sel->prev; + if(prev->left != -1) { + if(prev->left < sel->got) + RETURN(RC_FAIL); + prev->left -= sel->got; + } + prev->got += sel->got; + sel = stck->cur_ptr = prev; + if(!sel) break; + tlv_constr = 1; + continue; + } else { + sel = stck->cur_ptr = 0; + break; /* Nothing to wait */ } - prev->got += sel->got; - sel = stck->cur_ptr = prev; - if(!sel) break; - tlv_constr = 1; - continue; - } else { - sel = stck->cur_ptr = 0; - break; /* Nothing to wait */ - } - } - - tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag); - ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld", - (long)size, (long)Left, sel?"":"!", - (long)(sel?sel->left:0), - (long)(sel?sel->want_nulls:0), - (long)tl); - switch(tl) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - } - - tlv_constr = BER_TLV_CONSTRUCTED(buf_ptr); - - ll = ber_fetch_length(tlv_constr, - (const char *)buf_ptr + tl,Left - tl,&tlv_len); - ASN_DEBUG("Got tag=%s, tc=%d, left=%ld, tl=%ld, len=%ld, ll=%ld", - ber_tlv_tag_string(tlv_tag), tlv_constr, - (long)Left, (long)tl, (long)tlv_len, (long)ll); - switch(ll) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); - } - - if(sel && sel->want_nulls - && ((const uint8_t *)buf_ptr)[0] == 0 - && ((const uint8_t *)buf_ptr)[1] == 0) - { - - ASN_DEBUG("Eat EOC; wn=%d--", sel->want_nulls); - - if(type_variant == ASN_OSUBV_ANY - && (tag_mode != 1 || sel->cont_level)) - APPEND("\0\0", 2); - - ADVANCE(2); - sel->got += 2; - if(sel->left != -1) { - sel->left -= 2; /* assert(sel->left >= 2) */ } - sel->want_nulls--; - if(sel->want_nulls == 0) { - /* Move to the next expectation */ - sel->left = 0; - tlv_constr = 1; - } - - continue; - } - - /* - * Set up expected tags, - * depending on ASN.1 type being decoded. - */ - switch(type_variant) { - case ASN_OSUBV_BIT: - /* X.690: 8.6.4.1, NOTE 2 */ - /* Fall through */ - case ASN_OSUBV_STR: - default: - if(sel) { - int level = sel->cont_level; - if(level < td->all_tags_count) { - expected_tag = td->all_tags[level]; - break; - } else if(td->all_tags_count) { - expected_tag = td->all_tags - [td->all_tags_count - 1]; - break; - } - /* else, Fall through */ - } - /* Fall through */ - case ASN_OSUBV_ANY: - expected_tag = tlv_tag; - break; - } - - - if(tlv_tag != expected_tag) { - char buf[2][32]; - ber_tlv_tag_snprint(tlv_tag, - buf[0], sizeof(buf[0])); - ber_tlv_tag_snprint(td->tags[td->tags_count-1], - buf[1], sizeof(buf[1])); - ASN_DEBUG("Tag does not match expectation: %s != %s", - buf[0], buf[1]); - RETURN(RC_FAIL); - } - - tlvl = tl + ll; /* Combined length of T and L encoding */ - if((tlv_len + tlvl) < 0) { - /* tlv_len value is too big */ - ASN_DEBUG("TLV encoding + length (%ld) is too big", - (long)tlv_len); - RETURN(RC_FAIL); - } - - /* - * Append a new expectation. - */ - sel = OS__add_stack_el(stck); - if(!sel) RETURN(RC_FAIL); - - sel->tag = tlv_tag; - - sel->want_nulls = (tlv_len==-1); - if(sel->prev && sel->prev->left != -1) { - /* Check that the parent frame is big enough */ - if(sel->prev->left < tlvl + (tlv_len==-1?0:tlv_len)) + tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag); + ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld", + (long)size, (long)Left, sel?"":"!", + (long)(sel?sel->left:0), + (long)(sel?sel->want_nulls:0), + (long)tl); + switch(tl) { + case -1: RETURN(RC_FAIL); - if(tlv_len == -1) - sel->left = sel->prev->left - tlvl; - else + case 0: + RETURN(RC_WMORE); + } + + tlv_constr = BER_TLV_CONSTRUCTED(buf_ptr); + + ll = ber_fetch_length(tlv_constr, + (const char *)buf_ptr + tl,Left - tl,&tlv_len); + ASN_DEBUG("Got tag=%s, tc=%d, left=%ld, tl=%ld, len=%ld, ll=%ld", + ber_tlv_tag_string(tlv_tag), tlv_constr, + (long)Left, (long)tl, (long)tlv_len, (long)ll); + switch(ll) { + case -1: + RETURN(RC_FAIL); + case 0: + RETURN(RC_WMORE); + } + + if(sel && sel->want_nulls + && ((const uint8_t *)buf_ptr)[0] == 0 + && ((const uint8_t *)buf_ptr)[1] == 0) + { + + ASN_DEBUG("Eat EOC; wn=%d--", sel->want_nulls); + + if(type_variant == ASN_OSUBV_ANY + && (tag_mode != 1 || sel->cont_level)) + APPEND("\0\0", 2); + + ADVANCE(2); + sel->got += 2; + if(sel->left != -1) { + sel->left -= 2; /* assert(sel->left >= 2) */ + } + + sel->want_nulls--; + if(sel->want_nulls == 0) { + /* Move to the next expectation */ + sel->left = 0; + tlv_constr = 1; + } + + continue; + } + + /* + * Set up expected tags, + * depending on ASN.1 type being decoded. + */ + switch(type_variant) { + case ASN_OSUBV_BIT: + /* X.690: 8.6.4.1, NOTE 2 */ + /* Fall through */ + case ASN_OSUBV_STR: + default: + if(sel) { + int level = sel->cont_level; + if(level < td->all_tags_count) { + expected_tag = td->all_tags[level]; + break; + } else if(td->all_tags_count) { + expected_tag = td->all_tags + [td->all_tags_count - 1]; + break; + } + /* else, Fall through */ + } + /* Fall through */ + case ASN_OSUBV_ANY: + expected_tag = tlv_tag; + break; + } + + + if(tlv_tag != expected_tag) { + char buf[2][32]; + ber_tlv_tag_snprint(tlv_tag, + buf[0], sizeof(buf[0])); + ber_tlv_tag_snprint(td->tags[td->tags_count-1], + buf[1], sizeof(buf[1])); + ASN_DEBUG("Tag does not match expectation: %s != %s", + buf[0], buf[1]); + RETURN(RC_FAIL); + } + + tlvl = tl + ll; /* Combined length of T and L encoding */ + if((tlv_len + tlvl) < 0) { + /* tlv_len value is too big */ + ASN_DEBUG("TLV encoding + length (%ld) is too big", + (long)tlv_len); + RETURN(RC_FAIL); + } + + /* + * Append a new expectation. + */ + sel = OS__add_stack_el(stck); + if(!sel) RETURN(RC_FAIL); + + sel->tag = tlv_tag; + + sel->want_nulls = (tlv_len==-1); + if(sel->prev && sel->prev->left != -1) { + /* Check that the parent frame is big enough */ + if(sel->prev->left < tlvl + (tlv_len==-1?0:tlv_len)) + RETURN(RC_FAIL); + if(tlv_len == -1) + sel->left = sel->prev->left - tlvl; + else + sel->left = tlv_len; + } else { sel->left = tlv_len; - } else { - sel->left = tlv_len; - } - if(type_variant == ASN_OSUBV_ANY - && (tag_mode != 1 || sel->cont_level)) - APPEND(buf_ptr, tlvl); - sel->got += tlvl; - ADVANCE(tlvl); + } + if(type_variant == ASN_OSUBV_ANY + && (tag_mode != 1 || sel->cont_level)) + APPEND(buf_ptr, tlvl); + sel->got += tlvl; + ADVANCE(tlvl); - ASN_DEBUG("+EXPECT2 got=%ld left=%ld, wn=%d, clvl=%d", - (long)sel->got, (long)sel->left, - sel->want_nulls, sel->cont_level); + ASN_DEBUG("+EXPECT2 got=%ld left=%ld, wn=%d, clvl=%d", + (long)sel->got, (long)sel->left, + sel->want_nulls, sel->cont_level); - } while(tlv_constr); + } while(tlv_constr); if(sel == NULL) { /* Finished operation, "phase out" */ ASN_DEBUG("Phase out"); @@ -414,42 +418,42 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, stck = (struct _stack *)ctx->ptr; sel = stck->cur_ptr; ASN_DEBUG("Phase 2: Need %ld bytes, size=%ld, alrg=%ld, wn=%d", - (long)sel->left, (long)size, (long)sel->got, - sel->want_nulls); - { - ber_tlv_len_t len; + (long)sel->left, (long)size, (long)sel->got, + sel->want_nulls); + { + ber_tlv_len_t len; - assert(sel->left >= 0); + assert(sel->left >= 0); - len = ((ber_tlv_len_t)size < sel->left) - ? (ber_tlv_len_t)size : sel->left; - if(len > 0) { - if(type_variant == ASN_OSUBV_BIT - && sel->bits_chopped == 0) { - /* Put the unused-bits-octet away */ - st->bits_unused = *(const uint8_t *)buf_ptr; - APPEND(((const char *)buf_ptr+1), (len - 1)); - sel->bits_chopped = 1; - } else { - APPEND(buf_ptr, len); + len = ((ber_tlv_len_t)size < sel->left) + ? (ber_tlv_len_t)size : sel->left; + if(len > 0) { + if(type_variant == ASN_OSUBV_BIT + && sel->bits_chopped == 0) { + /* Put the unused-bits-octet away */ + st->bits_unused = *(const uint8_t *)buf_ptr; + APPEND(((const char *)buf_ptr+1), (len - 1)); + sel->bits_chopped = 1; + } else { + APPEND(buf_ptr, len); + } + ADVANCE(len); + sel->left -= len; + sel->got += len; } - ADVANCE(len); - sel->left -= len; - sel->got += len; - } - if(sel->left) { - ASN_DEBUG("OS left %ld, size = %ld, wn=%d\n", - (long)sel->left, (long)size, sel->want_nulls); - RETURN(RC_WMORE); - } + if(sel->left) { + ASN_DEBUG("OS left %ld, size = %ld, wn=%d\n", + (long)sel->left, (long)size, sel->want_nulls); + RETURN(RC_WMORE); + } - PREV_PHASE(ctx); - goto phase1; - } + PREV_PHASE(ctx); + goto phase1; + } break; case 3: - phase3: +phase3: /* * Primitive form, no stack required. */ @@ -469,7 +473,7 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, RETURN(RC_WMORE); } else { if(type_variant == ASN_OSUBV_BIT - && !ctx->context && ctx->left) { + && !ctx->context && ctx->left) { st->bits_unused = *(const uint8_t *)buf_ptr; ctx->left--; ADVANCE(1); @@ -485,8 +489,8 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, if(sel) { ASN_DEBUG("3sel p=%p, wn=%d, l=%ld, g=%ld, size=%ld", - sel->prev, sel->want_nulls, - (long)sel->left, (long)sel->got, (long)size); + sel->prev, sel->want_nulls, + (long)sel->left, (long)sel->got, (long)size); if(sel->prev || sel->want_nulls > 1 || sel->left > 0) { RETURN(RC_WMORE); } @@ -501,9 +505,9 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, } ASN_DEBUG("Took %ld bytes to encode %s: [%s]:%ld", - (long)consumed_myself, td->name, - (type_variant == ASN_OSUBV_STR) ? (char *)st->buf : "", - (long)st->size); + (long)consumed_myself, td->name, + (type_variant == ASN_OSUBV_STR) ? (char *)st->buf : "", + (long)st->size); RETURN(RC_OK); @@ -514,27 +518,27 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx, */ asn_enc_rval_t OCTET_STRING_encode_der(asn_TYPE_descriptor_t *td, void *sptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_DEF_OCTET_STRING_specs; + ? (asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_DEF_OCTET_STRING_specs; BIT_STRING_t *st = (BIT_STRING_t *)sptr; enum asn_OS_Subvariant type_variant = specs->subvariant; int fix_last_byte = 0; ASN_DEBUG("%s %s as OCTET STRING", - cb?"Estimating":"Encoding", td->name); + cb?"Estimating":"Encoding", td->name); /* * Write tags. */ if(type_variant != ASN_OSUBV_ANY || tag_mode == 1) { er.encoded = der_write_tags(td, - (type_variant == ASN_OSUBV_BIT) + st->size, - tag_mode, type_variant == ASN_OSUBV_ANY, tag, - cb, app_key); + (type_variant == ASN_OSUBV_BIT) + st->size, + tag_mode, type_variant == ASN_OSUBV_ANY, tag, + cb, app_key); if(er.encoded == -1) { er.failed_type = td; er.structure_ptr = sptr; @@ -578,8 +582,8 @@ cb_failed: asn_enc_rval_t OCTET_STRING_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { static const char *h2c = "0123456789ABCDEF"; const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; asn_enc_rval_t er; @@ -728,14 +732,14 @@ OCTET_STRING__handle_control_chars(void *struct_ptr, const void *chunk_buf, size return 0; } } - + return -1; /* No, it's not */ } asn_enc_rval_t OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; asn_enc_rval_t er; uint8_t *buf, *end; @@ -758,11 +762,11 @@ OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr, * Escape certain characters: X.680/11.15 */ if(ch < sizeof(OCTET_STRING__xer_escape_table) - /sizeof(OCTET_STRING__xer_escape_table[0]) - && (s_len = OCTET_STRING__xer_escape_table[ch].size)) { + /sizeof(OCTET_STRING__xer_escape_table[0]) + && (s_len = OCTET_STRING__xer_escape_table[ch].size)) { if(((buf - ss) && cb(ss, buf - ss, app_key) < 0) - || cb(OCTET_STRING__xer_escape_table[ch].string, s_len, - app_key) < 0) + || cb(OCTET_STRING__xer_escape_table[ch].string, s_len, + app_key) < 0) _ASN_ENCODE_FAILED; encoded_len += (buf - ss) + s_len; ss = buf + 1; @@ -804,20 +808,39 @@ static ssize_t OCTET_STRING__convert_hexadecimal(void *sptr, const void *chunk_b for(; p < pend; p++) { int ch = *(const unsigned char *)p; switch(ch) { - case 0x09: case 0x0a: case 0x0c: case 0x0d: + case 0x09: + case 0x0a: + case 0x0c: + case 0x0d: case 0x20: /* Ignore whitespace */ continue; - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: /*01234*/ + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: /*56789*/ clv = (clv << 4) + (ch - 0x30); break; - case 0x41: case 0x42: case 0x43: /* ABC */ - case 0x44: case 0x45: case 0x46: /* DEF */ + case 0x41: + case 0x42: + case 0x43: /* ABC */ + case 0x44: + case 0x45: + case 0x46: /* DEF */ clv = (clv << 4) + (ch - 0x41 + 10); break; - case 0x61: case 0x62: case 0x63: /* abc */ - case 0x64: case 0x65: case 0x66: /* def */ + case 0x61: + case 0x62: + case 0x63: /* abc */ + case 0x64: + case 0x65: + case 0x66: /* def */ clv = (clv << 4) + (ch - 0x61 + 10); break; default: @@ -884,7 +907,10 @@ static ssize_t OCTET_STRING__convert_binary(void *sptr, const void *chunk_buf, s for(; p < pend; p++) { int ch = *(const unsigned char *)p; switch(ch) { - case 0x09: case 0x0a: case 0x0c: case 0x0d: + case 0x09: + case 0x0a: + case 0x0c: + case 0x0d: case 0x20: /* Ignore whitespace */ break; @@ -932,16 +958,32 @@ OS__strtoent(int base, const char *buf, const char *end, int32_t *ret_value) { return -1; switch(ch) { - case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: /*01234*/ - case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: /*56789*/ + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: /*01234*/ + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: /*56789*/ val = val * base + (ch - 0x30); break; - case 0x41: case 0x42: case 0x43: /* ABC */ - case 0x44: case 0x45: case 0x46: /* DEF */ + case 0x41: + case 0x42: + case 0x43: /* ABC */ + case 0x44: + case 0x45: + case 0x46: /* DEF */ val = val * base + (ch - 0x41 + 10); break; - case 0x61: case 0x62: case 0x63: /* abc */ - case 0x64: case 0x65: case 0x66: /* def */ + case 0x61: + case 0x62: + case 0x63: /* abc */ + case 0x64: + case 0x65: + case 0x66: /* def */ val = val * base + (ch - 0x61 + 10); break; case 0x3b: /* ';' */ @@ -1044,9 +1086,9 @@ static ssize_t OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf, char *sc = (char *)memchr(p, 0x3b, len > 5 ? 5 : len); if(!sc) goto want_more; if((sc - p) == 4 - && p[1] == 0x61 /* 'a' */ - && p[2] == 0x6d /* 'm' */ - && p[3] == 0x70 /* 'p' */) { + && p[1] == 0x61 /* 'a' */ + && p[2] == 0x6d /* 'm' */ + && p[3] == 0x70 /* 'p' */) { *buf++ = 0x26; p = sc; continue; @@ -1075,7 +1117,7 @@ static ssize_t OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf, } continue; - want_more: +want_more: if(have_more) { /* * We know that no more data (of the same type) @@ -1101,18 +1143,18 @@ static ssize_t OCTET_STRING__convert_entrefs(void *sptr, const void *chunk_buf, */ static asn_dec_rval_t OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, size_t size, - int (*opt_unexpected_tag_decoder) - (void *struct_ptr, const void *chunk_buf, size_t chunk_size), - ssize_t (*body_receiver) - (void *struct_ptr, const void *chunk_buf, size_t chunk_size, - int have_more) -) { + asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, size_t size, + int (*opt_unexpected_tag_decoder) + (void *struct_ptr, const void *chunk_buf, size_t chunk_size), + ssize_t (*body_receiver) + (void *struct_ptr, const void *chunk_buf, size_t chunk_size, + int have_more) + ) { OCTET_STRING_t *st = (OCTET_STRING_t *)*sptr; asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_DEF_OCTET_STRING_specs; + ? (asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_DEF_OCTET_STRING_specs; const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; asn_struct_ctx_t *ctx; /* Per-structure parser context */ asn_dec_rval_t rval; /* Return value from the decoder */ @@ -1146,7 +1188,7 @@ OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx, ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset); return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag, - buf_ptr, size, opt_unexpected_tag_decoder, body_receiver); + buf_ptr, size, opt_unexpected_tag_decoder, body_receiver); stb_failed: FREEMEM(st); @@ -1161,10 +1203,10 @@ sta_failed: */ asn_dec_rval_t OCTET_STRING_decode_xer_hex(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, size_t size) { + asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, size_t size) { return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, - buf_ptr, size, 0, OCTET_STRING__convert_hexadecimal); + buf_ptr, size, 0, OCTET_STRING__convert_hexadecimal); } /* @@ -1172,10 +1214,10 @@ OCTET_STRING_decode_xer_hex(asn_codec_ctx_t *opt_codec_ctx, */ asn_dec_rval_t OCTET_STRING_decode_xer_binary(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, size_t size) { + asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, size_t size) { return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, - buf_ptr, size, 0, OCTET_STRING__convert_binary); + buf_ptr, size, 0, OCTET_STRING__convert_binary); } /* @@ -1183,22 +1225,22 @@ OCTET_STRING_decode_xer_binary(asn_codec_ctx_t *opt_codec_ctx, */ asn_dec_rval_t OCTET_STRING_decode_xer_utf8(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, void **sptr, - const char *opt_mname, const void *buf_ptr, size_t size) { + asn_TYPE_descriptor_t *td, void **sptr, + const char *opt_mname, const void *buf_ptr, size_t size) { return OCTET_STRING__decode_xer(opt_codec_ctx, td, sptr, opt_mname, - buf_ptr, size, - OCTET_STRING__handle_control_chars, - OCTET_STRING__convert_entrefs); + buf_ptr, size, + OCTET_STRING__handle_control_chars, + OCTET_STRING__convert_entrefs); } static int OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf, - size_t units, unsigned int bpc, unsigned int unit_bits, - long lb, long ub, asn_per_constraints_t *pc) { + size_t units, unsigned int bpc, unsigned int unit_bits, + long lb, long ub, asn_per_constraints_t *pc) { uint8_t *end = buf + units * bpc; ASN_DEBUG("Expanding %d characters into (%ld..%ld):%d", - (int)units, lb, ub, unit_bits); + (int)units, lb, ub, unit_bits); /* X.691: 27.5.4 */ if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) { @@ -1216,15 +1258,24 @@ OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf, value = pc->code2value(code); if(value < 0) { ASN_DEBUG("Code %d (0x%02x) is" - " not in map (%ld..%ld)", - code, code, lb, ub); + " not in map (%ld..%ld)", + code, code, lb, ub); return 1; /* FATAL */ } switch(bpc) { - case 1: *buf = value; break; - case 2: buf[0] = value >> 8; buf[1] = value; break; - case 4: buf[0] = value >> 24; buf[1] = value >> 16; - buf[2] = value >> 8; buf[3] = value; break; + case 1: + *buf = value; + break; + case 2: + buf[0] = value >> 8; + buf[1] = value; + break; + case 4: + buf[0] = value >> 24; + buf[1] = value >> 16; + buf[2] = value >> 8; + buf[3] = value; + break; } } return 0; @@ -1241,14 +1292,23 @@ OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf, if(code < 0) return -1; /* WMORE */ if(ch > ub) { ASN_DEBUG("Code %d is out of range (%ld..%ld)", - ch, lb, ub); + ch, lb, ub); return 1; /* FATAL */ } switch(bpc) { - case 1: *buf = ch; break; - case 2: buf[0] = ch >> 8; buf[1] = ch; break; - case 4: buf[0] = ch >> 24; buf[1] = ch >> 16; - buf[2] = ch >> 8; buf[3] = ch; break; + case 1: + *buf = ch; + break; + case 2: + buf[0] = ch >> 8; + buf[1] = ch; + break; + case 4: + buf[0] = ch >> 24; + buf[1] = ch >> 16; + buf[2] = ch >> 8; + buf[3] = ch; + break; } } @@ -1257,12 +1317,12 @@ OCTET_STRING_per_get_characters(asn_per_data_t *po, uint8_t *buf, static int OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf, - size_t units, unsigned int bpc, unsigned int unit_bits, - long lb, long ub, asn_per_constraints_t *pc) { + size_t units, unsigned int bpc, unsigned int unit_bits, + long lb, long ub, asn_per_constraints_t *pc) { const uint8_t *end = buf + units * bpc; ASN_DEBUG("Squeezing %d characters into (%ld..%ld):%d (%d bpc)", - (int)units, lb, ub, unit_bits, bpc); + (int)units, lb, ub, unit_bits, bpc); /* X.691: 27.5.4 */ if((unsigned long)ub <= ((unsigned long)2 << (unit_bits - 1))) { @@ -1273,17 +1333,24 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf, int code; uint32_t value; switch(bpc) { - case 1: value = *(const uint8_t *)buf; break; - case 2: value = (buf[0] << 8) | buf[1]; break; - case 4: value = (buf[0] << 24) | (buf[1] << 16) - | (buf[2] << 8) | buf[3]; break; - default: return -1; + case 1: + value = *(const uint8_t *)buf; + break; + case 2: + value = (buf[0] << 8) | buf[1]; + break; + case 4: + value = (buf[0] << 24) | (buf[1] << 16) + | (buf[2] << 8) | buf[3]; + break; + default: + return -1; } code = pc->value2code(value); if(code < 0) { ASN_DEBUG("Character %d (0x%02x) is" - " not in map (%ld..%ld)", - *buf, *buf, lb, ub); + " not in map (%ld..%ld)", + *buf, *buf, lb, ub); return -1; } if(per_put_few_bits(po, code, unit_bits)) @@ -1300,17 +1367,24 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf, int ch; uint32_t value; switch(bpc) { - case 1: value = *(const uint8_t *)buf; break; - case 2: value = (buf[0] << 8) | buf[1]; break; - case 4: value = (buf[0] << 24) | (buf[1] << 16) - | (buf[2] << 8) | buf[3]; break; - default: return -1; + case 1: + value = *(const uint8_t *)buf; + break; + case 2: + value = (buf[0] << 8) | buf[1]; + break; + case 4: + value = (buf[0] << 24) | (buf[1] << 16) + | (buf[2] << 8) | buf[3]; + break; + default: + return -1; } ch = value - lb; if(ch < 0 || ch > ub) { ASN_DEBUG("Character %d (0x%02x)" - " is out of range (%ld..%ld)", - *buf, *buf, lb, ub + lb); + " is out of range (%ld..%ld)", + *buf, *buf, lb, ub + lb); return -1; } if(per_put_few_bits(po, ch, unit_bits)) @@ -1322,14 +1396,14 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf, asn_dec_rval_t OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, - void **sptr, asn_per_data_t *pd) { + asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, + void **sptr, asn_per_data_t *pd) { asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_DEF_OCTET_STRING_specs; + ? (asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_DEF_OCTET_STRING_specs; asn_per_constraints_t *pc = constraints ? constraints - : td->per_constraints; + : td->per_constraints; asn_per_constraint_t *cval; asn_per_constraint_t *csiz; asn_dec_rval_t rval = { RC_OK, 0 }; @@ -1393,8 +1467,8 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, } ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d", - csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible", - csiz->lower_bound, csiz->upper_bound, csiz->effective_bits); + csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible", + csiz->lower_bound, csiz->upper_bound, csiz->effective_bits); if(csiz->flags & APC_EXTENSIBLE) { int inext = per_get_few_bits(pd, 1); @@ -1414,7 +1488,10 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, st->size = (csiz->upper_bound + 7) >> 3; } st->buf = (uint8_t *)MALLOC(st->size + 1); - if(!st->buf) { st->size = 0; RETURN(RC_FAIL); } + if(!st->buf) { + st->size = 0; + RETURN(RC_FAIL); + } } /* X.691, #16.5: zero-length encoding */ @@ -1424,16 +1501,16 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, int ret; if(bpc) { ASN_DEBUG("Encoding OCTET STRING size %ld", - csiz->upper_bound); + csiz->upper_bound); ret = OCTET_STRING_per_get_characters(pd, st->buf, - csiz->upper_bound, bpc, unit_bits, - cval->lower_bound, cval->upper_bound, pc); + csiz->upper_bound, bpc, unit_bits, + cval->lower_bound, cval->upper_bound, pc); if(ret > 0) RETURN(RC_FAIL); } else { ASN_DEBUG("Encoding BIT STRING size %ld", - csiz->upper_bound); + csiz->upper_bound); ret = per_get_many_bits(pd, st->buf, 0, - unit_bits * csiz->upper_bound); + unit_bits * csiz->upper_bound); } if(ret < 0) RETURN(RC_WMORE); consumed_myself += unit_bits * csiz->upper_bound; @@ -1459,8 +1536,8 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, raw_len += csiz->lower_bound; ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)", - (long)csiz->effective_bits, (long)raw_len, - repeat ? "repeat" : "once", td->name); + (long)csiz->effective_bits, (long)raw_len, + repeat ? "repeat" : "once", td->name); if(bpc) { len_bytes = raw_len * bpc; len_bits = len_bytes * unit_bits; @@ -1477,12 +1554,12 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, if(bpc) { ret = OCTET_STRING_per_get_characters(pd, - &st->buf[st->size], raw_len, bpc, unit_bits, - cval->lower_bound, cval->upper_bound, pc); + &st->buf[st->size], raw_len, bpc, unit_bits, + cval->lower_bound, cval->upper_bound, pc); if(ret > 0) RETURN(RC_FAIL); } else { ret = per_get_many_bits(pd, &st->buf[st->size], - 0, len_bits); + 0, len_bits); } if(ret < 0) RETURN(RC_WMORE); st->size += len_bytes; @@ -1494,13 +1571,13 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_enc_rval_t OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_DEF_OCTET_STRING_specs; + ? (asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_DEF_OCTET_STRING_specs; asn_per_constraints_t *pc = constraints ? constraints - : td->per_constraints; + : td->per_constraints; asn_per_constraint_t *cval; asn_per_constraint_t *csiz; const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; @@ -1540,7 +1617,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, bpc = OS__BPC_BIT; sizeinunits = st->size * 8 - (st->bits_unused & 0x07); ASN_DEBUG("BIT STRING of %d bytes, %d bits unused", - sizeinunits, st->bits_unused); + sizeinunits, st->bits_unused); break; case ASN_OSUBV_STR: canonical_unit_bits = unit_bits = 8; @@ -1566,16 +1643,16 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, } ASN_DEBUG("Encoding %s into %d units of %d bits" - " (%ld..%ld, effective %d)%s", - td->name, sizeinunits, unit_bits, - csiz->lower_bound, csiz->upper_bound, - csiz->effective_bits, ct_extensible ? " EXT" : ""); + " (%ld..%ld, effective %d)%s", + td->name, sizeinunits, unit_bits, + csiz->lower_bound, csiz->upper_bound, + csiz->effective_bits, ct_extensible ? " EXT" : ""); /* Figure out wheter size lies within PER visible constraint */ if(csiz->effective_bits >= 0) { if((int)sizeinunits < csiz->lower_bound - || (int)sizeinunits > csiz->upper_bound) { + || (int)sizeinunits > csiz->upper_bound) { if(ct_extensible) { cval = &asn_DEF_OCTET_STRING_constraints.value; csiz = &asn_DEF_OCTET_STRING_constraints.size; @@ -1599,18 +1676,18 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, /* X.691, #16.7: long fixed length encoding (up to 64K octets) */ if(csiz->effective_bits >= 0) { ASN_DEBUG("Encoding %d bytes (%ld), length in %d bits", - st->size, sizeinunits - csiz->lower_bound, - csiz->effective_bits); + st->size, sizeinunits - csiz->lower_bound, + csiz->effective_bits); ret = per_put_few_bits(po, sizeinunits - csiz->lower_bound, - csiz->effective_bits); + csiz->effective_bits); if(ret) _ASN_ENCODE_FAILED; if(bpc) { ret = OCTET_STRING_per_put_characters(po, st->buf, - sizeinunits, bpc, unit_bits, - cval->lower_bound, cval->upper_bound, pc); + sizeinunits, bpc, unit_bits, + cval->lower_bound, cval->upper_bound, pc); } else { ret = per_put_many_bits(po, st->buf, - sizeinunits * unit_bits); + sizeinunits * unit_bits); } if(ret) _ASN_ENCODE_FAILED; _ASN_ENCODED_OK(er); @@ -1630,12 +1707,12 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, if(maySave < 0) _ASN_ENCODE_FAILED; ASN_DEBUG("Encoding %ld of %ld", - (long)maySave, (long)sizeinunits); + (long)maySave, (long)sizeinunits); if(bpc) { ret = OCTET_STRING_per_put_characters(po, buf, - maySave, bpc, unit_bits, - cval->lower_bound, cval->upper_bound, pc); + maySave, bpc, unit_bits, + cval->lower_bound, cval->upper_bound, pc); } else { ret = per_put_many_bits(po, buf, maySave * unit_bits); } @@ -1654,7 +1731,7 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, int OCTET_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { static const char *h2c = "0123456789ABCDEF"; const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; char scratch[16 * 3 + 4]; @@ -1696,7 +1773,7 @@ OCTET_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, int OCTET_STRING_print_utf8(asn_TYPE_descriptor_t *td, const void *sptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; (void)td; /* Unused argument */ @@ -1713,10 +1790,10 @@ void OCTET_STRING_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) { OCTET_STRING_t *st = (OCTET_STRING_t *)sptr; asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_DEF_OCTET_STRING_specs; + ? (asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_DEF_OCTET_STRING_specs; asn_struct_ctx_t *ctx = (asn_struct_ctx_t *) - ((char *)st + specs->ctx_offset); + ((char *)st + specs->ctx_offset); struct _stack *stck; if(!td || !st) @@ -1790,8 +1867,8 @@ OCTET_STRING_fromBuf(OCTET_STRING_t *st, const char *str, int len) { OCTET_STRING_t * OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, const char *str, int len) { asn_OCTET_STRING_specifics_t *specs = td->specifics - ? (asn_OCTET_STRING_specifics_t *)td->specifics - : &asn_DEF_OCTET_STRING_specs; + ? (asn_OCTET_STRING_specifics_t *)td->specifics + : &asn_DEF_OCTET_STRING_specs; OCTET_STRING_t *st; st = (OCTET_STRING_t *)CALLOC(1, specs->struct_size); diff --git a/src/third_party/asn1/OCTET_STRING.h b/src/third_party/asn1/OCTET_STRING.h index 8df9a182..bdb0640e 100644 --- a/src/third_party/asn1/OCTET_STRING.h +++ b/src/third_party/asn1/OCTET_STRING.h @@ -11,73 +11,73 @@ extern "C" { #endif -typedef struct OCTET_STRING { - uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ - int size; /* Size of the buffer */ + typedef struct OCTET_STRING { + uint8_t *buf; /* Buffer with consecutive OCTET_STRING bits */ + int size; /* Size of the buffer */ - asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ -} OCTET_STRING_t; + asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ + } OCTET_STRING_t; -extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; + extern asn_TYPE_descriptor_t asn_DEF_OCTET_STRING; -asn_struct_free_f OCTET_STRING_free; -asn_struct_print_f OCTET_STRING_print; -asn_struct_print_f OCTET_STRING_print_utf8; -ber_type_decoder_f OCTET_STRING_decode_ber; -der_type_encoder_f OCTET_STRING_encode_der; -xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ -xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ -xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ -xer_type_encoder_f OCTET_STRING_encode_xer; -xer_type_encoder_f OCTET_STRING_encode_xer_utf8; -per_type_decoder_f OCTET_STRING_decode_uper; -per_type_encoder_f OCTET_STRING_encode_uper; + asn_struct_free_f OCTET_STRING_free; + asn_struct_print_f OCTET_STRING_print; + asn_struct_print_f OCTET_STRING_print_utf8; + ber_type_decoder_f OCTET_STRING_decode_ber; + der_type_encoder_f OCTET_STRING_encode_der; + xer_type_decoder_f OCTET_STRING_decode_xer_hex; /* Hexadecimal */ + xer_type_decoder_f OCTET_STRING_decode_xer_binary; /* 01010111010 */ + xer_type_decoder_f OCTET_STRING_decode_xer_utf8; /* ASCII/UTF-8 */ + xer_type_encoder_f OCTET_STRING_encode_xer; + xer_type_encoder_f OCTET_STRING_encode_xer_utf8; + per_type_decoder_f OCTET_STRING_decode_uper; + per_type_encoder_f OCTET_STRING_encode_uper; -/****************************** - * Handy conversion routines. * - ******************************/ + /****************************** + * Handy conversion routines. * + ******************************/ -/* - * This function clears the previous value of the OCTET STRING (if any) - * and then allocates a new memory with the specified content (str/size). - * If size = -1, the size of the original string will be determined - * using strlen(str). - * If str equals to NULL, the function will silently clear the - * current contents of the OCTET STRING. - * Returns 0 if it was possible to perform operation, -1 otherwise. - */ -int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); + /* + * This function clears the previous value of the OCTET STRING (if any) + * and then allocates a new memory with the specified content (str/size). + * If size = -1, the size of the original string will be determined + * using strlen(str). + * If str equals to NULL, the function will silently clear the + * current contents of the OCTET STRING. + * Returns 0 if it was possible to perform operation, -1 otherwise. + */ + int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); -/* Handy conversion from the C string into the OCTET STRING. */ + /* Handy conversion from the C string into the OCTET STRING. */ #define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) -/* - * Allocate and fill the new OCTET STRING and return a pointer to the newly - * allocated object. NULL is permitted in str: the function will just allocate - * empty OCTET STRING. - */ -OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, - const char *str, int size); - -/**************************** - * Internally useful stuff. * - ****************************/ - -typedef struct asn_OCTET_STRING_specifics_s { /* - * Target structure description. + * Allocate and fill the new OCTET STRING and return a pointer to the newly + * allocated object. NULL is permitted in str: the function will just allocate + * empty OCTET STRING. */ - int struct_size; /* Size of the structure */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, + const char *str, int size); - enum asn_OS_Subvariant { - ASN_OSUBV_ANY, /* The open type (ANY) */ - ASN_OSUBV_BIT, /* BIT STRING */ - ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ - ASN_OSUBV_U16, /* 16-bit character (BMPString) */ - ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ - } subvariant; -} asn_OCTET_STRING_specifics_t; + /**************************** + * Internally useful stuff. * + ****************************/ + + typedef struct asn_OCTET_STRING_specifics_s { + /* + * Target structure description. + */ + int struct_size; /* Size of the structure */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + + enum asn_OS_Subvariant { + ASN_OSUBV_ANY, /* The open type (ANY) */ + ASN_OSUBV_BIT, /* BIT STRING */ + ASN_OSUBV_STR, /* String types, not {BMP,Universal}String */ + ASN_OSUBV_U16, /* 16-bit character (BMPString) */ + ASN_OSUBV_U32 /* 32-bit character (UniversalString) */ + } subvariant; + } asn_OCTET_STRING_specifics_t; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlainCards.c b/src/third_party/asn1/PlainCards.c index bf45bf0a..51ab5c2a 100644 --- a/src/third_party/asn1/PlainCards.c +++ b/src/third_party/asn1/PlainCards.c @@ -8,7 +8,7 @@ #include "PlainCards.h" static asn_TYPE_member_t asn_MBR_PlainCards_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlainCards, plainCard1), + { ATF_NOFLAGS, 0, offsetof(struct PlainCards, plainCard1), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_PlainCards_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "plainCard1" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlainCards, plainCard2), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlainCards, plainCard2), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -25,14 +25,14 @@ static asn_TYPE_member_t asn_MBR_PlainCards_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "plainCard2" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlainCards_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlainCards_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* plainCard1 at 442 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* plainCard2 at 444 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* plainCard1 at 465 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* plainCard2 at 467 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlainCards_specs_1 = { sizeof(struct PlainCards), @@ -57,10 +57,10 @@ asn_TYPE_descriptor_t asn_DEF_PlainCards = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlainCards_tags_1, sizeof(asn_DEF_PlainCards_tags_1) - /sizeof(asn_DEF_PlainCards_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlainCards_tags_1[0]), /* 1 */ asn_DEF_PlainCards_tags_1, /* Same as above */ sizeof(asn_DEF_PlainCards_tags_1) - /sizeof(asn_DEF_PlainCards_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlainCards_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_PlainCards_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/PlainCards.h b/src/third_party/asn1/PlainCards.h index fe0962ba..00290714 100644 --- a/src/third_party/asn1/PlainCards.h +++ b/src/third_party/asn1/PlainCards.h @@ -19,21 +19,21 @@ extern "C" { #endif -/* PlainCards */ -typedef struct PlainCards { - Card_t plainCard1; - Card_t plainCard2; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlainCards_t; + /* PlainCards */ + typedef struct PlainCards { + Card_t plainCard1; + Card_t plainCard2; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlainCards; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PlainCards_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlainCards; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayerAllIn.c b/src/third_party/asn1/PlayerAllIn.c index adacc014..b9b6879a 100644 --- a/src/third_party/asn1/PlayerAllIn.c +++ b/src/third_party/asn1/PlayerAllIn.c @@ -8,7 +8,7 @@ #include "PlayerAllIn.h" static asn_TYPE_member_t asn_MBR_PlayerAllIn_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlayerAllIn, playerId), + { ATF_NOFLAGS, 0, offsetof(struct PlayerAllIn, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_PlayerAllIn_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerAllIn, allInCard1), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerAllIn, allInCard1), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_PlayerAllIn_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "allInCard1" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerAllIn, allInCard2), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerAllIn, allInCard2), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -34,15 +34,15 @@ static asn_TYPE_member_t asn_MBR_PlayerAllIn_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "allInCard2" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlayerAllIn_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerAllIn_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 519 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* allInCard1 at 520 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* allInCard2 at 522 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* playerId at 542 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 1 }, /* allInCard1 at 543 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 0 } /* allInCard2 at 545 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerAllIn_specs_1 = { sizeof(struct PlayerAllIn), @@ -67,10 +67,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayerAllIn = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayerAllIn_tags_1, sizeof(asn_DEF_PlayerAllIn_tags_1) - /sizeof(asn_DEF_PlayerAllIn_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlayerAllIn_tags_1[0]), /* 1 */ asn_DEF_PlayerAllIn_tags_1, /* Same as above */ sizeof(asn_DEF_PlayerAllIn_tags_1) - /sizeof(asn_DEF_PlayerAllIn_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlayerAllIn_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_PlayerAllIn_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/PlayerAllIn.h b/src/third_party/asn1/PlayerAllIn.h index 6ea153ae..2a073ae1 100644 --- a/src/third_party/asn1/PlayerAllIn.h +++ b/src/third_party/asn1/PlayerAllIn.h @@ -20,22 +20,22 @@ extern "C" { #endif -/* PlayerAllIn */ -typedef struct PlayerAllIn { - NonZeroId_t playerId; - Card_t allInCard1; - Card_t allInCard2; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlayerAllIn_t; + /* PlayerAllIn */ + typedef struct PlayerAllIn { + NonZeroId_t playerId; + Card_t allInCard1; + Card_t allInCard2; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlayerAllIn; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PlayerAllIn_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlayerAllIn; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayerInfoData.c b/src/third_party/asn1/PlayerInfoData.c index c95393a5..ddd93ccc 100644 --- a/src/third_party/asn1/PlayerInfoData.c +++ b/src/third_party/asn1/PlayerInfoData.c @@ -9,70 +9,70 @@ static int memb_playerName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 32)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_countryCode_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size == 2)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_avatarData_6[] = { - { ATF_NOFLAGS, 0, offsetof(struct avatarData, avatarType), + { ATF_NOFLAGS, 0, offsetof(struct avatarData, avatarType), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetAvatarType, @@ -80,8 +80,8 @@ static asn_TYPE_member_t asn_MBR_avatarData_6[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarType" - }, - { ATF_NOFLAGS, 0, offsetof(struct avatarData, avatar), + }, + { ATF_NOFLAGS, 0, offsetof(struct avatarData, avatar), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_AvatarHash, @@ -89,14 +89,14 @@ static asn_TYPE_member_t asn_MBR_avatarData_6[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatar" - }, + }, }; static ber_tlv_tag_t asn_DEF_avatarData_tags_6[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_avatarData_tag2el_6[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* avatar at 263 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* avatarType at 261 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* avatar at 265 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* avatarType at 263 */ }; static asn_SEQUENCE_specifics_t asn_SPC_avatarData_specs_6 = { sizeof(struct avatarData), @@ -122,10 +122,10 @@ asn_TYPE_descriptor_t asn_DEF_avatarData_6 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_avatarData_tags_6, sizeof(asn_DEF_avatarData_tags_6) - /sizeof(asn_DEF_avatarData_tags_6[0]), /* 1 */ + /sizeof(asn_DEF_avatarData_tags_6[0]), /* 1 */ asn_DEF_avatarData_tags_6, /* Same as above */ sizeof(asn_DEF_avatarData_tags_6) - /sizeof(asn_DEF_avatarData_tags_6[0]), /* 1 */ + /sizeof(asn_DEF_avatarData_tags_6[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_avatarData_6, 2, /* Elements count */ @@ -133,7 +133,7 @@ asn_TYPE_descriptor_t asn_DEF_avatarData_6 = { }; static asn_TYPE_member_t asn_MBR_PlayerInfoData_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoData, playerName), + { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoData, playerName), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -141,8 +141,8 @@ static asn_TYPE_member_t asn_MBR_PlayerInfoData_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerName" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoData, isHuman), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoData, isHuman), (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, &asn_DEF_BOOLEAN, @@ -150,8 +150,8 @@ static asn_TYPE_member_t asn_MBR_PlayerInfoData_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "isHuman" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoData, playerRights), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoData, playerRights), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_PlayerInfoRights, @@ -159,8 +159,8 @@ static asn_TYPE_member_t asn_MBR_PlayerInfoData_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerRights" - }, - { ATF_POINTER, 2, offsetof(struct PlayerInfoData, countryCode), + }, + { ATF_POINTER, 2, offsetof(struct PlayerInfoData, countryCode), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -168,8 +168,8 @@ static asn_TYPE_member_t asn_MBR_PlayerInfoData_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "countryCode" - }, - { ATF_POINTER, 1, offsetof(struct PlayerInfoData, avatarData), + }, + { ATF_POINTER, 1, offsetof(struct PlayerInfoData, avatarData), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_avatarData_6, @@ -177,17 +177,17 @@ static asn_TYPE_member_t asn_MBR_PlayerInfoData_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarData" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlayerInfoData_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerInfoData_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* isHuman at 257 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 }, /* playerRights at 258 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 1 }, /* playerName at 256 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 3, -1, 0 }, /* countryCode at 259 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, 0, 0 } /* avatarData at 261 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* isHuman at 259 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 }, /* playerRights at 260 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 1 }, /* playerName at 258 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 3, -1, 0 }, /* countryCode at 261 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 4, 0, 0 } /* avatarData at 263 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerInfoData_specs_1 = { sizeof(struct PlayerInfoData), @@ -212,10 +212,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayerInfoData = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayerInfoData_tags_1, sizeof(asn_DEF_PlayerInfoData_tags_1) - /sizeof(asn_DEF_PlayerInfoData_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlayerInfoData_tags_1[0]), /* 1 */ asn_DEF_PlayerInfoData_tags_1, /* Same as above */ sizeof(asn_DEF_PlayerInfoData_tags_1) - /sizeof(asn_DEF_PlayerInfoData_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlayerInfoData_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_PlayerInfoData_1, 5, /* Elements count */ diff --git a/src/third_party/asn1/PlayerInfoData.h b/src/third_party/asn1/PlayerInfoData.h index 19eaf461..cff0d161 100644 --- a/src/third_party/asn1/PlayerInfoData.h +++ b/src/third_party/asn1/PlayerInfoData.h @@ -23,34 +23,34 @@ extern "C" { #endif -/* PlayerInfoData */ -typedef struct PlayerInfoData { - UTF8String_t playerName; - BOOLEAN_t isHuman; - PlayerInfoRights_t playerRights; - UTF8String_t *countryCode /* OPTIONAL */; - struct avatarData { - NetAvatarType_t avatarType; - AvatarHash_t avatar; + /* PlayerInfoData */ + typedef struct PlayerInfoData { + UTF8String_t playerName; + BOOLEAN_t isHuman; + PlayerInfoRights_t playerRights; + UTF8String_t *countryCode /* OPTIONAL */; + struct avatarData { + NetAvatarType_t avatarType; + AvatarHash_t avatar; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } *avatarData; /* * This type is extensible, * possible extensions are below. */ - + /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } *avatarData; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlayerInfoData_t; + } PlayerInfoData_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlayerInfoData; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlayerInfoData; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayerInfoReplyMessage.c b/src/third_party/asn1/PlayerInfoReplyMessage.c index 1e3942f8..6635f25d 100644 --- a/src/third_party/asn1/PlayerInfoReplyMessage.c +++ b/src/third_party/asn1/PlayerInfoReplyMessage.c @@ -8,7 +8,7 @@ #include "PlayerInfoReplyMessage.h" static asn_TYPE_member_t asn_MBR_playerInfoResult_3[] = { - { ATF_NOFLAGS, 0, offsetof(struct playerInfoResult, choice.playerInfoData), + { ATF_NOFLAGS, 0, offsetof(struct playerInfoResult, choice.playerInfoData), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_PlayerInfoData, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_playerInfoResult_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerInfoData" - }, - { ATF_NOFLAGS, 0, offsetof(struct playerInfoResult, choice.unknownPlayerInfo), + }, + { ATF_NOFLAGS, 0, offsetof(struct playerInfoResult, choice.unknownPlayerInfo), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_UnknownPlayerInfo, @@ -25,11 +25,11 @@ static asn_TYPE_member_t asn_MBR_playerInfoResult_3[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "unknownPlayerInfo" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_playerInfoResult_tag2el_3[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* playerInfoData at 244 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* unknownPlayerInfo at 246 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* playerInfoData at 246 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* unknownPlayerInfo at 248 */ }; static asn_CHOICE_specifics_t asn_SPC_playerInfoResult_specs_3 = { sizeof(struct playerInfoResult), @@ -65,7 +65,7 @@ asn_TYPE_descriptor_t asn_DEF_playerInfoResult_3 = { }; static asn_TYPE_member_t asn_MBR_PlayerInfoReplyMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoReplyMessage, playerId), + { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoReplyMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -73,8 +73,8 @@ static asn_TYPE_member_t asn_MBR_PlayerInfoReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoReplyMessage, playerInfoResult), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoReplyMessage, playerInfoResult), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_playerInfoResult_3, @@ -82,16 +82,16 @@ static asn_TYPE_member_t asn_MBR_PlayerInfoReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerInfoResult" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlayerInfoReplyMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (9 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerInfoReplyMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* playerId at 242 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* playerInfoData at 244 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* unknownPlayerInfo at 246 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* playerId at 244 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* playerInfoData at 246 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* unknownPlayerInfo at 248 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerInfoReplyMessage_specs_1 = { sizeof(struct PlayerInfoReplyMessage), @@ -116,10 +116,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayerInfoReplyMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayerInfoReplyMessage_tags_1, sizeof(asn_DEF_PlayerInfoReplyMessage_tags_1) - /sizeof(asn_DEF_PlayerInfoReplyMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_PlayerInfoReplyMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_PlayerInfoReplyMessage_tags_1, /* Same as above */ sizeof(asn_DEF_PlayerInfoReplyMessage_tags_1) - /sizeof(asn_DEF_PlayerInfoReplyMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_PlayerInfoReplyMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_PlayerInfoReplyMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/PlayerInfoReplyMessage.h b/src/third_party/asn1/PlayerInfoReplyMessage.h index 2105c21f..ec4be446 100644 --- a/src/third_party/asn1/PlayerInfoReplyMessage.h +++ b/src/third_party/asn1/PlayerInfoReplyMessage.h @@ -22,43 +22,44 @@ extern "C" { #endif -/* Dependencies */ -typedef enum playerInfoResult_PR { - playerInfoResult_PR_NOTHING, /* No components present */ - playerInfoResult_PR_playerInfoData, - playerInfoResult_PR_unknownPlayerInfo, - /* Extensions may appear below */ - -} playerInfoResult_PR; + /* Dependencies */ + typedef enum playerInfoResult_PR { + playerInfoResult_PR_NOTHING, /* No components present */ + playerInfoResult_PR_playerInfoData, + playerInfoResult_PR_unknownPlayerInfo, + /* Extensions may appear below */ + + } + playerInfoResult_PR; + + /* PlayerInfoReplyMessage */ + typedef struct PlayerInfoReplyMessage { + NonZeroId_t playerId; + struct playerInfoResult { + playerInfoResult_PR present; + union PlayerInfoReplyMessage__playerInfoResult_u { + PlayerInfoData_t playerInfoData; + UnknownPlayerInfo_t unknownPlayerInfo; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } playerInfoResult; + /* + * This type is extensible, + * possible extensions are below. + */ -/* PlayerInfoReplyMessage */ -typedef struct PlayerInfoReplyMessage { - NonZeroId_t playerId; - struct playerInfoResult { - playerInfoResult_PR present; - union PlayerInfoReplyMessage__playerInfoResult_u { - PlayerInfoData_t playerInfoData; - UnknownPlayerInfo_t unknownPlayerInfo; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } playerInfoResult; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlayerInfoReplyMessage_t; + } PlayerInfoReplyMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlayerInfoReplyMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlayerInfoReplyMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayerInfoRequestMessage.c b/src/third_party/asn1/PlayerInfoRequestMessage.c index a14fe8e9..2500a8d3 100644 --- a/src/third_party/asn1/PlayerInfoRequestMessage.c +++ b/src/third_party/asn1/PlayerInfoRequestMessage.c @@ -8,7 +8,7 @@ #include "PlayerInfoRequestMessage.h" static asn_TYPE_member_t asn_MBR_PlayerInfoRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoRequestMessage, playerId), + { ATF_NOFLAGS, 0, offsetof(struct PlayerInfoRequestMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,14 +16,14 @@ static asn_TYPE_member_t asn_MBR_PlayerInfoRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlayerInfoRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (8 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerInfoRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 239 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* playerId at 241 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerInfoRequestMessage_specs_1 = { sizeof(struct PlayerInfoRequestMessage), @@ -48,10 +48,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayerInfoRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayerInfoRequestMessage_tags_1, sizeof(asn_DEF_PlayerInfoRequestMessage_tags_1) - /sizeof(asn_DEF_PlayerInfoRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_PlayerInfoRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_PlayerInfoRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_PlayerInfoRequestMessage_tags_1) - /sizeof(asn_DEF_PlayerInfoRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_PlayerInfoRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_PlayerInfoRequestMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/PlayerInfoRequestMessage.h b/src/third_party/asn1/PlayerInfoRequestMessage.h index d1455db7..74001740 100644 --- a/src/third_party/asn1/PlayerInfoRequestMessage.h +++ b/src/third_party/asn1/PlayerInfoRequestMessage.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* PlayerInfoRequestMessage */ -typedef struct PlayerInfoRequestMessage { - NonZeroId_t playerId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlayerInfoRequestMessage_t; + /* PlayerInfoRequestMessage */ + typedef struct PlayerInfoRequestMessage { + NonZeroId_t playerId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlayerInfoRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PlayerInfoRequestMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlayerInfoRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayerInfoRights.c b/src/third_party/asn1/PlayerInfoRights.c index cac29dbc..2da0bc1d 100644 --- a/src/third_party/asn1/PlayerInfoRights.c +++ b/src/third_party/asn1/PlayerInfoRights.c @@ -9,7 +9,7 @@ int PlayerInfoRights_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ PlayerInfoRights_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void PlayerInfoRights_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { PlayerInfoRights_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int PlayerInfoRights_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { PlayerInfoRights_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t PlayerInfoRights_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { PlayerInfoRights_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t PlayerInfoRights_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { PlayerInfoRights_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t PlayerInfoRights_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { PlayerInfoRights_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t PlayerInfoRights_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { PlayerInfoRights_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -116,10 +116,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayerInfoRights = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayerInfoRights_tags_1, sizeof(asn_DEF_PlayerInfoRights_tags_1) - /sizeof(asn_DEF_PlayerInfoRights_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlayerInfoRights_tags_1[0]), /* 1 */ asn_DEF_PlayerInfoRights_tags_1, /* Same as above */ sizeof(asn_DEF_PlayerInfoRights_tags_1) - /sizeof(asn_DEF_PlayerInfoRights_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlayerInfoRights_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_PlayerInfoRights_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/PlayerInfoRights.h b/src/third_party/asn1/PlayerInfoRights.h index 4ca16898..d36b6d91 100644 --- a/src/third_party/asn1/PlayerInfoRights.h +++ b/src/third_party/asn1/PlayerInfoRights.h @@ -18,25 +18,26 @@ extern "C" { #endif -/* Dependencies */ -typedef enum PlayerInfoRights { - PlayerInfoRights_playerRightsGuest = 1, - PlayerInfoRights_playerRightsNormal = 2, - PlayerInfoRights_playerRightsAdmin = 3 -} e_PlayerInfoRights; + /* Dependencies */ + typedef enum PlayerInfoRights { + PlayerInfoRights_playerRightsGuest = 1, + PlayerInfoRights_playerRightsNormal = 2, + PlayerInfoRights_playerRightsAdmin = 3 + } + e_PlayerInfoRights; -/* PlayerInfoRights */ -typedef long PlayerInfoRights_t; + /* PlayerInfoRights */ + typedef long PlayerInfoRights_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlayerInfoRights; -asn_struct_free_f PlayerInfoRights_free; -asn_struct_print_f PlayerInfoRights_print; -asn_constr_check_f PlayerInfoRights_constraint; -ber_type_decoder_f PlayerInfoRights_decode_ber; -der_type_encoder_f PlayerInfoRights_encode_der; -xer_type_decoder_f PlayerInfoRights_decode_xer; -xer_type_encoder_f PlayerInfoRights_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlayerInfoRights; + asn_struct_free_f PlayerInfoRights_free; + asn_struct_print_f PlayerInfoRights_print; + asn_constr_check_f PlayerInfoRights_constraint; + ber_type_decoder_f PlayerInfoRights_decode_ber; + der_type_encoder_f PlayerInfoRights_encode_der; + xer_type_decoder_f PlayerInfoRights_decode_xer; + xer_type_encoder_f PlayerInfoRights_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayerListMessage.c b/src/third_party/asn1/PlayerListMessage.c index 84924285..afe9ae0a 100644 --- a/src/third_party/asn1/PlayerListMessage.c +++ b/src/third_party/asn1/PlayerListMessage.c @@ -9,7 +9,7 @@ static int playerListNotification_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ playerListNotification_3_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void playerListNotification_3_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { playerListNotification_3_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int playerListNotification_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { playerListNotification_3_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t playerListNotification_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { playerListNotification_3_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t playerListNotification_3_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { playerListNotification_3_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t playerListNotification_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { playerListNotification_3_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t playerListNotification_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { playerListNotification_3_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -115,17 +115,17 @@ asn_TYPE_descriptor_t asn_DEF_playerListNotification_3 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_playerListNotification_tags_3, sizeof(asn_DEF_playerListNotification_tags_3) - /sizeof(asn_DEF_playerListNotification_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_playerListNotification_tags_3[0]), /* 1 */ asn_DEF_playerListNotification_tags_3, /* Same as above */ sizeof(asn_DEF_playerListNotification_tags_3) - /sizeof(asn_DEF_playerListNotification_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_playerListNotification_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_playerListNotification_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_PlayerListMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlayerListMessage, playerId), + { ATF_NOFLAGS, 0, offsetof(struct PlayerListMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -133,8 +133,8 @@ static asn_TYPE_member_t asn_MBR_PlayerListMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerListMessage, playerListNotification), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerListMessage, playerListNotification), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_playerListNotification_3, @@ -142,15 +142,15 @@ static asn_TYPE_member_t asn_MBR_PlayerListMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerListNotification" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlayerListMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (6 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerListMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* playerId at 189 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* playerListNotification at 191 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* playerId at 191 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* playerListNotification at 193 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerListMessage_specs_1 = { sizeof(struct PlayerListMessage), @@ -175,10 +175,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayerListMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayerListMessage_tags_1, sizeof(asn_DEF_PlayerListMessage_tags_1) - /sizeof(asn_DEF_PlayerListMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_PlayerListMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_PlayerListMessage_tags_1, /* Same as above */ sizeof(asn_DEF_PlayerListMessage_tags_1) - /sizeof(asn_DEF_PlayerListMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_PlayerListMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_PlayerListMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/PlayerListMessage.h b/src/third_party/asn1/PlayerListMessage.h index 2489b137..0f6d2558 100644 --- a/src/third_party/asn1/PlayerListMessage.h +++ b/src/third_party/asn1/PlayerListMessage.h @@ -20,28 +20,29 @@ extern "C" { #endif -/* Dependencies */ -typedef enum playerListNotification { - playerListNotification_playerListNew = 0, - playerListNotification_playerListLeft = 1 -} e_playerListNotification; + /* Dependencies */ + typedef enum playerListNotification { + playerListNotification_playerListNew = 0, + playerListNotification_playerListLeft = 1 + } + e_playerListNotification; -/* PlayerListMessage */ -typedef struct PlayerListMessage { - NonZeroId_t playerId; - long playerListNotification; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlayerListMessage_t; + /* PlayerListMessage */ + typedef struct PlayerListMessage { + NonZeroId_t playerId; + long playerListNotification; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_playerListNotification_3; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_PlayerListMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PlayerListMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_playerListNotification_3; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_PlayerListMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayerResult.c b/src/third_party/asn1/PlayerResult.c index d3bd17a2..9c6046cc 100644 --- a/src/third_party/asn1/PlayerResult.c +++ b/src/third_party/asn1/PlayerResult.c @@ -9,82 +9,82 @@ static int memb_bestHandPosition_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + /* Determine the number of elements */ size = _A_CSEQUENCE_FROM_VOID(sptr)->count; - + if((size == 5)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_moneyWon_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_playerMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_bestHandPosition_5[] = { - { ATF_POINTER, 0, 0, + { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -92,7 +92,7 @@ static asn_TYPE_member_t asn_MBR_bestHandPosition_5[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "" - }, + }, }; static ber_tlv_tag_t asn_DEF_bestHandPosition_tags_5[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) @@ -117,10 +117,10 @@ asn_TYPE_descriptor_t asn_DEF_bestHandPosition_5 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_bestHandPosition_tags_5, sizeof(asn_DEF_bestHandPosition_tags_5) - /sizeof(asn_DEF_bestHandPosition_tags_5[0]), /* 1 */ + /sizeof(asn_DEF_bestHandPosition_tags_5[0]), /* 1 */ asn_DEF_bestHandPosition_tags_5, /* Same as above */ sizeof(asn_DEF_bestHandPosition_tags_5) - /sizeof(asn_DEF_bestHandPosition_tags_5[0]), /* 1 */ + /sizeof(asn_DEF_bestHandPosition_tags_5[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_bestHandPosition_5, 1, /* Single element */ @@ -128,7 +128,7 @@ asn_TYPE_descriptor_t asn_DEF_bestHandPosition_5 = { }; static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, playerId), + { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -136,8 +136,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, resultCard1), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, resultCard1), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -145,8 +145,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "resultCard1" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, resultCard2), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, resultCard2), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_Card, @@ -154,8 +154,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "resultCard2" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, bestHandPosition), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, bestHandPosition), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_bestHandPosition_5, @@ -163,8 +163,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "bestHandPosition" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, cardsValue), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, cardsValue), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -172,8 +172,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "cardsValue" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, moneyWon), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, moneyWon), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -181,8 +181,8 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "moneyWon" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, playerMoney), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayerResult, playerMoney), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -190,19 +190,19 @@ static asn_TYPE_member_t asn_MBR_PlayerResult_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerMoney" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlayerResult_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayerResult_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* playerId at 537 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* resultCard1 at 538 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* resultCard2 at 539 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -3, 2 }, /* cardsValue at 541 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -4, 1 }, /* moneyWon at 542 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -5, 0 }, /* playerMoney at 543 */ - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, 0, 0 } /* bestHandPosition at 540 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* playerId at 560 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* resultCard1 at 561 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* resultCard2 at 562 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -3, 2 }, /* cardsValue at 564 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -4, 1 }, /* moneyWon at 565 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -5, 0 }, /* playerMoney at 566 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 3, 0, 0 } /* bestHandPosition at 563 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayerResult_specs_1 = { sizeof(struct PlayerResult), @@ -227,10 +227,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayerResult = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayerResult_tags_1, sizeof(asn_DEF_PlayerResult_tags_1) - /sizeof(asn_DEF_PlayerResult_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlayerResult_tags_1[0]), /* 1 */ asn_DEF_PlayerResult_tags_1, /* Same as above */ sizeof(asn_DEF_PlayerResult_tags_1) - /sizeof(asn_DEF_PlayerResult_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_PlayerResult_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_PlayerResult_1, 7, /* Elements count */ diff --git a/src/third_party/asn1/PlayerResult.h b/src/third_party/asn1/PlayerResult.h index bf97f15c..62fcc0dc 100644 --- a/src/third_party/asn1/PlayerResult.h +++ b/src/third_party/asn1/PlayerResult.h @@ -23,31 +23,31 @@ extern "C" { #endif -/* PlayerResult */ -typedef struct PlayerResult { - NonZeroId_t playerId; - Card_t resultCard1; - Card_t resultCard2; - struct bestHandPosition { - A_SEQUENCE_OF(long) list; - + /* PlayerResult */ + typedef struct PlayerResult { + NonZeroId_t playerId; + Card_t resultCard1; + Card_t resultCard2; + struct bestHandPosition { + A_SEQUENCE_OF(long) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } bestHandPosition; + long cardsValue; + long moneyWon; + long playerMoney; + /* + * This type is extensible, + * possible extensions are below. + */ + /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } bestHandPosition; - long cardsValue; - long moneyWon; - long playerMoney; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlayerResult_t; + } PlayerResult_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlayerResult; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlayerResult; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayersActionDoneMessage.c b/src/third_party/asn1/PlayersActionDoneMessage.c index c833cc18..02f069d5 100644 --- a/src/third_party/asn1/PlayersActionDoneMessage.c +++ b/src/third_party/asn1/PlayersActionDoneMessage.c @@ -9,106 +9,106 @@ static int memb_totalPlayerBet_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_playerMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_highestSet_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_minimumRaise_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -116,8 +116,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -125,8 +125,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, gameState), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, gameState), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetGameState, @@ -134,8 +134,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameState" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerAction), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerAction), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetPlayerAction, @@ -143,8 +143,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerAction" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, totalPlayerBet), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, totalPlayerBet), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -152,8 +152,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "totalPlayerBet" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerMoney), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, playerMoney), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -161,8 +161,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerMoney" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, highestSet), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, highestSet), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -170,8 +170,8 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "highestSet" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, minimumRaise), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersActionDoneMessage, minimumRaise), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -179,21 +179,21 @@ static asn_TYPE_member_t asn_MBR_PlayersActionDoneMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "minimumRaise" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlayersActionDoneMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (27 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayersActionDoneMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* gameId at 486 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* playerId at 487 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 3 }, /* totalPlayerBet at 490 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -3, 2 }, /* playerMoney at 491 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -4, 1 }, /* highestSet at 492 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 7, -5, 0 }, /* minimumRaise at 493 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 488 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* playerAction at 489 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* gameId at 509 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* playerId at 510 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -2, 3 }, /* totalPlayerBet at 513 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -3, 2 }, /* playerMoney at 514 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -4, 1 }, /* highestSet at 515 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 7, -5, 0 }, /* minimumRaise at 516 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 1 }, /* gameState at 511 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 3, -1, 0 } /* playerAction at 512 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayersActionDoneMessage_specs_1 = { sizeof(struct PlayersActionDoneMessage), @@ -218,10 +218,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayersActionDoneMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayersActionDoneMessage_tags_1, sizeof(asn_DEF_PlayersActionDoneMessage_tags_1) - /sizeof(asn_DEF_PlayersActionDoneMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_PlayersActionDoneMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_PlayersActionDoneMessage_tags_1, /* Same as above */ sizeof(asn_DEF_PlayersActionDoneMessage_tags_1) - /sizeof(asn_DEF_PlayersActionDoneMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_PlayersActionDoneMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_PlayersActionDoneMessage_1, 8, /* Elements count */ diff --git a/src/third_party/asn1/PlayersActionDoneMessage.h b/src/third_party/asn1/PlayersActionDoneMessage.h index 5f0731dd..af736187 100644 --- a/src/third_party/asn1/PlayersActionDoneMessage.h +++ b/src/third_party/asn1/PlayersActionDoneMessage.h @@ -22,27 +22,27 @@ extern "C" { #endif -/* PlayersActionDoneMessage */ -typedef struct PlayersActionDoneMessage { - NonZeroId_t gameId; - NonZeroId_t playerId; - NetGameState_t gameState; - NetPlayerAction_t playerAction; - long totalPlayerBet; - long playerMoney; - long highestSet; - long minimumRaise; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlayersActionDoneMessage_t; + /* PlayersActionDoneMessage */ + typedef struct PlayersActionDoneMessage { + NonZeroId_t gameId; + NonZeroId_t playerId; + NetGameState_t gameState; + NetPlayerAction_t playerAction; + long totalPlayerBet; + long playerMoney; + long highestSet; + long minimumRaise; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlayersActionDoneMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PlayersActionDoneMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlayersActionDoneMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PlayersTurnMessage.c b/src/third_party/asn1/PlayersTurnMessage.c index d3ed26b9..98ebf6c2 100644 --- a/src/third_party/asn1/PlayersTurnMessage.c +++ b/src/third_party/asn1/PlayersTurnMessage.c @@ -8,7 +8,7 @@ #include "PlayersTurnMessage.h" static asn_TYPE_member_t asn_MBR_PlayersTurnMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PlayersTurnMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct PlayersTurnMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_PlayersTurnMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersTurnMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersTurnMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_PlayersTurnMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct PlayersTurnMessage, gameState), + }, + { ATF_NOFLAGS, 0, offsetof(struct PlayersTurnMessage, gameState), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetGameState, @@ -34,16 +34,16 @@ static asn_TYPE_member_t asn_MBR_PlayersTurnMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameState" - }, + }, }; static ber_tlv_tag_t asn_DEF_PlayersTurnMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (24 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_PlayersTurnMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 460 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* playerId at 461 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 } /* gameState at 463 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 483 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* playerId at 484 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 } /* gameState at 486 */ }; static asn_SEQUENCE_specifics_t asn_SPC_PlayersTurnMessage_specs_1 = { sizeof(struct PlayersTurnMessage), @@ -68,10 +68,10 @@ asn_TYPE_descriptor_t asn_DEF_PlayersTurnMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_PlayersTurnMessage_tags_1, sizeof(asn_DEF_PlayersTurnMessage_tags_1) - /sizeof(asn_DEF_PlayersTurnMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_PlayersTurnMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_PlayersTurnMessage_tags_1, /* Same as above */ sizeof(asn_DEF_PlayersTurnMessage_tags_1) - /sizeof(asn_DEF_PlayersTurnMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_PlayersTurnMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_PlayersTurnMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/PlayersTurnMessage.h b/src/third_party/asn1/PlayersTurnMessage.h index 748fe22a..95b6eeff 100644 --- a/src/third_party/asn1/PlayersTurnMessage.h +++ b/src/third_party/asn1/PlayersTurnMessage.h @@ -20,22 +20,22 @@ extern "C" { #endif -/* PlayersTurnMessage */ -typedef struct PlayersTurnMessage { - NonZeroId_t gameId; - NonZeroId_t playerId; - NetGameState_t gameState; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PlayersTurnMessage_t; + /* PlayersTurnMessage */ + typedef struct PlayersTurnMessage { + NonZeroId_t gameId; + NonZeroId_t playerId; + NetGameState_t gameState; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PlayersTurnMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PlayersTurnMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PlayersTurnMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/PokerTHMessage.c b/src/third_party/asn1/PokerTHMessage.c index 8e4231da..ed13e28c 100644 --- a/src/third_party/asn1/PokerTHMessage.c +++ b/src/third_party/asn1/PokerTHMessage.c @@ -8,7 +8,7 @@ #include "PokerTHMessage.h" static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.announceMessage), + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.announceMessage), (ASN_TAG_CLASS_APPLICATION | (0 << 2)), 0, &asn_DEF_AnnounceMessage, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "announceMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.initMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.initMessage), (ASN_TAG_CLASS_APPLICATION | (1 << 2)), 0, &asn_DEF_InitMessage, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "initMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.authMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.authMessage), (ASN_TAG_CLASS_APPLICATION | (2 << 2)), 0, &asn_DEF_AuthMessage, @@ -34,8 +34,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "authMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.initAckMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.initAckMessage), (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, &asn_DEF_InitAckMessage, @@ -43,8 +43,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "initAckMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.avatarRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.avatarRequestMessage), (ASN_TAG_CLASS_APPLICATION | (4 << 2)), 0, &asn_DEF_AvatarRequestMessage, @@ -52,8 +52,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.avatarReplyMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.avatarReplyMessage), (ASN_TAG_CLASS_APPLICATION | (5 << 2)), 0, &asn_DEF_AvatarReplyMessage, @@ -61,8 +61,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatarReplyMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playerListMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playerListMessage), (ASN_TAG_CLASS_APPLICATION | (6 << 2)), 0, &asn_DEF_PlayerListMessage, @@ -70,8 +70,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerListMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.gameListMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.gameListMessage), (ASN_TAG_CLASS_APPLICATION | (7 << 2)), 0, &asn_DEF_GameListMessage, @@ -79,8 +79,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameListMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playerInfoRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playerInfoRequestMessage), (ASN_TAG_CLASS_APPLICATION | (8 << 2)), 0, &asn_DEF_PlayerInfoRequestMessage, @@ -88,8 +88,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerInfoRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playerInfoReplyMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playerInfoReplyMessage), (ASN_TAG_CLASS_APPLICATION | (9 << 2)), 0, &asn_DEF_PlayerInfoReplyMessage, @@ -97,8 +97,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerInfoReplyMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.subscriptionRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.subscriptionRequestMessage), (ASN_TAG_CLASS_APPLICATION | (10 << 2)), 0, &asn_DEF_SubscriptionRequestMessage, @@ -106,8 +106,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "subscriptionRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.joinGameRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.joinGameRequestMessage), (ASN_TAG_CLASS_APPLICATION | (11 << 2)), 0, &asn_DEF_JoinGameRequestMessage, @@ -115,8 +115,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinGameRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.joinGameReplyMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.joinGameReplyMessage), (ASN_TAG_CLASS_APPLICATION | (12 << 2)), 0, &asn_DEF_JoinGameReplyMessage, @@ -124,8 +124,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "joinGameReplyMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.gamePlayerMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.gamePlayerMessage), (ASN_TAG_CLASS_APPLICATION | (13 << 2)), 0, &asn_DEF_GamePlayerMessage, @@ -133,8 +133,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gamePlayerMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.kickPlayerRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.kickPlayerRequestMessage), (ASN_TAG_CLASS_APPLICATION | (14 << 2)), 0, &asn_DEF_KickPlayerRequestMessage, @@ -142,8 +142,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "kickPlayerRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.leaveGameRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.leaveGameRequestMessage), (ASN_TAG_CLASS_APPLICATION | (15 << 2)), 0, &asn_DEF_LeaveGameRequestMessage, @@ -151,8 +151,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "leaveGameRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.invitePlayerToGameMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.invitePlayerToGameMessage), (ASN_TAG_CLASS_APPLICATION | (16 << 2)), 0, &asn_DEF_InvitePlayerToGameMessage, @@ -160,8 +160,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "invitePlayerToGameMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.inviteNotifyMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.inviteNotifyMessage), (ASN_TAG_CLASS_APPLICATION | (17 << 2)), 0, &asn_DEF_InviteNotifyMessage, @@ -169,8 +169,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "inviteNotifyMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.rejectGameInvitationMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.rejectGameInvitationMessage), (ASN_TAG_CLASS_APPLICATION | (18 << 2)), 0, &asn_DEF_RejectGameInvitationMessage, @@ -178,8 +178,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "rejectGameInvitationMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.rejectInvNotifyMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.rejectInvNotifyMessage), (ASN_TAG_CLASS_APPLICATION | (19 << 2)), 0, &asn_DEF_RejectInvNotifyMessage, @@ -187,8 +187,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "rejectInvNotifyMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.startEventMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.startEventMessage), (ASN_TAG_CLASS_APPLICATION | (20 << 2)), 0, &asn_DEF_StartEventMessage, @@ -196,8 +196,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "startEventMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.startEventAckMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.startEventAckMessage), (ASN_TAG_CLASS_APPLICATION | (21 << 2)), 0, &asn_DEF_StartEventAckMessage, @@ -205,8 +205,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "startEventAckMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.gameStartMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.gameStartMessage), (ASN_TAG_CLASS_APPLICATION | (22 << 2)), 0, &asn_DEF_GameStartMessage, @@ -214,8 +214,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameStartMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.handStartMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.handStartMessage), (ASN_TAG_CLASS_APPLICATION | (23 << 2)), 0, &asn_DEF_HandStartMessage, @@ -223,8 +223,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "handStartMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playersTurnMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playersTurnMessage), (ASN_TAG_CLASS_APPLICATION | (24 << 2)), 0, &asn_DEF_PlayersTurnMessage, @@ -232,8 +232,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playersTurnMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.myActionRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.myActionRequestMessage), (ASN_TAG_CLASS_APPLICATION | (25 << 2)), 0, &asn_DEF_MyActionRequestMessage, @@ -241,8 +241,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "myActionRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.yourActionRejectedMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.yourActionRejectedMessage), (ASN_TAG_CLASS_APPLICATION | (26 << 2)), 0, &asn_DEF_YourActionRejectedMessage, @@ -250,8 +250,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "yourActionRejectedMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playersActionDoneMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.playersActionDoneMessage), (ASN_TAG_CLASS_APPLICATION | (27 << 2)), 0, &asn_DEF_PlayersActionDoneMessage, @@ -259,8 +259,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playersActionDoneMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.dealFlopCardsMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.dealFlopCardsMessage), (ASN_TAG_CLASS_APPLICATION | (28 << 2)), 0, &asn_DEF_DealFlopCardsMessage, @@ -268,8 +268,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "dealFlopCardsMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.dealTurnCardMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.dealTurnCardMessage), (ASN_TAG_CLASS_APPLICATION | (29 << 2)), 0, &asn_DEF_DealTurnCardMessage, @@ -277,8 +277,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "dealTurnCardMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.dealRiverCardMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.dealRiverCardMessage), (ASN_TAG_CLASS_APPLICATION | (30 << 2)), 0, &asn_DEF_DealRiverCardMessage, @@ -286,8 +286,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "dealRiverCardMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.allInShowCardsMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.allInShowCardsMessage), (ASN_TAG_CLASS_APPLICATION | (31 << 2)), 0, &asn_DEF_AllInShowCardsMessage, @@ -295,8 +295,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "allInShowCardsMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.endOfHandMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.endOfHandMessage), (ASN_TAG_CLASS_APPLICATION | (32 << 2)), 0, &asn_DEF_EndOfHandMessage, @@ -304,8 +304,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "endOfHandMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.showMyCardsRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.showMyCardsRequestMessage), (ASN_TAG_CLASS_APPLICATION | (33 << 2)), 0, &asn_DEF_ShowMyCardsRequestMessage, @@ -313,8 +313,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "showMyCardsRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.afterHandShowCardsMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.afterHandShowCardsMessage), (ASN_TAG_CLASS_APPLICATION | (34 << 2)), 0, &asn_DEF_AfterHandShowCardsMessage, @@ -322,8 +322,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "afterHandShowCardsMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.endOfGameMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.endOfGameMessage), (ASN_TAG_CLASS_APPLICATION | (35 << 2)), 0, &asn_DEF_EndOfGameMessage, @@ -331,8 +331,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "endOfGameMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.askKickPlayerMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.askKickPlayerMessage), (ASN_TAG_CLASS_APPLICATION | (64 << 2)), 0, &asn_DEF_AskKickPlayerMessage, @@ -340,8 +340,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "askKickPlayerMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.askKickDeniedMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.askKickDeniedMessage), (ASN_TAG_CLASS_APPLICATION | (65 << 2)), 0, &asn_DEF_AskKickDeniedMessage, @@ -349,8 +349,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "askKickDeniedMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.startKickPetitionMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.startKickPetitionMessage), (ASN_TAG_CLASS_APPLICATION | (66 << 2)), 0, &asn_DEF_StartKickPetitionMessage, @@ -358,8 +358,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "startKickPetitionMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.voteKickRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.voteKickRequestMessage), (ASN_TAG_CLASS_APPLICATION | (67 << 2)), 0, &asn_DEF_VoteKickRequestMessage, @@ -367,8 +367,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "voteKickRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.voteKickReplyMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.voteKickReplyMessage), (ASN_TAG_CLASS_APPLICATION | (68 << 2)), 0, &asn_DEF_VoteKickReplyMessage, @@ -376,8 +376,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "voteKickReplyMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.kickPetitionUpdateMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.kickPetitionUpdateMessage), (ASN_TAG_CLASS_APPLICATION | (69 << 2)), 0, &asn_DEF_KickPetitionUpdateMessage, @@ -385,8 +385,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "kickPetitionUpdateMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.endKickPetitionMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.endKickPetitionMessage), (ASN_TAG_CLASS_APPLICATION | (70 << 2)), 0, &asn_DEF_EndKickPetitionMessage, @@ -394,8 +394,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "endKickPetitionMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.statisticsMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.statisticsMessage), (ASN_TAG_CLASS_APPLICATION | (128 << 2)), 0, &asn_DEF_StatisticsMessage, @@ -403,8 +403,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "statisticsMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.chatRequestMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.chatRequestMessage), (ASN_TAG_CLASS_APPLICATION | (129 << 2)), 0, &asn_DEF_ChatRequestMessage, @@ -412,8 +412,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatRequestMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.chatMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.chatMessage), (ASN_TAG_CLASS_APPLICATION | (130 << 2)), 0, &asn_DEF_ChatMessage, @@ -421,8 +421,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.chatRejectMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.chatRejectMessage), (ASN_TAG_CLASS_APPLICATION | (131 << 2)), 0, &asn_DEF_ChatRejectMessage, @@ -430,8 +430,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "chatRejectMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.dialogMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.dialogMessage), (ASN_TAG_CLASS_APPLICATION | (132 << 2)), 0, &asn_DEF_DialogMessage, @@ -439,8 +439,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "dialogMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.timeoutWarningMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.timeoutWarningMessage), (ASN_TAG_CLASS_APPLICATION | (133 << 2)), 0, &asn_DEF_TimeoutWarningMessage, @@ -448,8 +448,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "timeoutWarningMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.resetTimeoutMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.resetTimeoutMessage), (ASN_TAG_CLASS_APPLICATION | (134 << 2)), 0, &asn_DEF_ResetTimeoutMessage, @@ -457,8 +457,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "resetTimeoutMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.afkWarningMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.afkWarningMessage), (ASN_TAG_CLASS_APPLICATION | (135 << 2)), 0, &asn_DEF_AfkWarningMessage, @@ -466,8 +466,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "afkWarningMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.reportAvatarMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.reportAvatarMessage), (ASN_TAG_CLASS_APPLICATION | (136 << 2)), 0, &asn_DEF_ReportAvatarMessage, @@ -475,8 +475,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "reportAvatarMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.reportAvatarAckMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.reportAvatarAckMessage), (ASN_TAG_CLASS_APPLICATION | (137 << 2)), 0, &asn_DEF_ReportAvatarAckMessage, @@ -484,8 +484,8 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "reportAvatarAckMessage" - }, - { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.errorMessage), + }, + { ATF_NOFLAGS, 0, offsetof(struct PokerTHMessage, choice.errorMessage), (ASN_TAG_CLASS_APPLICATION | (255 << 2)), 0, &asn_DEF_ErrorMessage, @@ -493,63 +493,63 @@ static asn_TYPE_member_t asn_MBR_PokerTHMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "errorMessage" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_PokerTHMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_APPLICATION | (0 << 2)), 0, 0, 0 }, /* announceMessage at 27 */ - { (ASN_TAG_CLASS_APPLICATION | (1 << 2)), 1, 0, 0 }, /* initMessage at 28 */ - { (ASN_TAG_CLASS_APPLICATION | (2 << 2)), 2, 0, 0 }, /* authMessage at 29 */ - { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 3, 0, 0 }, /* initAckMessage at 30 */ - { (ASN_TAG_CLASS_APPLICATION | (4 << 2)), 4, 0, 0 }, /* avatarRequestMessage at 31 */ - { (ASN_TAG_CLASS_APPLICATION | (5 << 2)), 5, 0, 0 }, /* avatarReplyMessage at 32 */ - { (ASN_TAG_CLASS_APPLICATION | (6 << 2)), 6, 0, 0 }, /* playerListMessage at 33 */ - { (ASN_TAG_CLASS_APPLICATION | (7 << 2)), 7, 0, 0 }, /* gameListMessage at 34 */ - { (ASN_TAG_CLASS_APPLICATION | (8 << 2)), 8, 0, 0 }, /* playerInfoRequestMessage at 35 */ - { (ASN_TAG_CLASS_APPLICATION | (9 << 2)), 9, 0, 0 }, /* playerInfoReplyMessage at 36 */ - { (ASN_TAG_CLASS_APPLICATION | (10 << 2)), 10, 0, 0 }, /* subscriptionRequestMessage at 37 */ - { (ASN_TAG_CLASS_APPLICATION | (11 << 2)), 11, 0, 0 }, /* joinGameRequestMessage at 38 */ - { (ASN_TAG_CLASS_APPLICATION | (12 << 2)), 12, 0, 0 }, /* joinGameReplyMessage at 39 */ - { (ASN_TAG_CLASS_APPLICATION | (13 << 2)), 13, 0, 0 }, /* gamePlayerMessage at 40 */ - { (ASN_TAG_CLASS_APPLICATION | (14 << 2)), 14, 0, 0 }, /* kickPlayerRequestMessage at 41 */ - { (ASN_TAG_CLASS_APPLICATION | (15 << 2)), 15, 0, 0 }, /* leaveGameRequestMessage at 42 */ - { (ASN_TAG_CLASS_APPLICATION | (16 << 2)), 16, 0, 0 }, /* invitePlayerToGameMessage at 43 */ - { (ASN_TAG_CLASS_APPLICATION | (17 << 2)), 17, 0, 0 }, /* inviteNotifyMessage at 44 */ - { (ASN_TAG_CLASS_APPLICATION | (18 << 2)), 18, 0, 0 }, /* rejectGameInvitationMessage at 45 */ - { (ASN_TAG_CLASS_APPLICATION | (19 << 2)), 19, 0, 0 }, /* rejectInvNotifyMessage at 46 */ - { (ASN_TAG_CLASS_APPLICATION | (20 << 2)), 20, 0, 0 }, /* startEventMessage at 47 */ - { (ASN_TAG_CLASS_APPLICATION | (21 << 2)), 21, 0, 0 }, /* startEventAckMessage at 48 */ - { (ASN_TAG_CLASS_APPLICATION | (22 << 2)), 22, 0, 0 }, /* gameStartMessage at 49 */ - { (ASN_TAG_CLASS_APPLICATION | (23 << 2)), 23, 0, 0 }, /* handStartMessage at 50 */ - { (ASN_TAG_CLASS_APPLICATION | (24 << 2)), 24, 0, 0 }, /* playersTurnMessage at 51 */ - { (ASN_TAG_CLASS_APPLICATION | (25 << 2)), 25, 0, 0 }, /* myActionRequestMessage at 52 */ - { (ASN_TAG_CLASS_APPLICATION | (26 << 2)), 26, 0, 0 }, /* yourActionRejectedMessage at 53 */ - { (ASN_TAG_CLASS_APPLICATION | (27 << 2)), 27, 0, 0 }, /* playersActionDoneMessage at 54 */ - { (ASN_TAG_CLASS_APPLICATION | (28 << 2)), 28, 0, 0 }, /* dealFlopCardsMessage at 55 */ - { (ASN_TAG_CLASS_APPLICATION | (29 << 2)), 29, 0, 0 }, /* dealTurnCardMessage at 56 */ - { (ASN_TAG_CLASS_APPLICATION | (30 << 2)), 30, 0, 0 }, /* dealRiverCardMessage at 57 */ - { (ASN_TAG_CLASS_APPLICATION | (31 << 2)), 31, 0, 0 }, /* allInShowCardsMessage at 58 */ - { (ASN_TAG_CLASS_APPLICATION | (32 << 2)), 32, 0, 0 }, /* endOfHandMessage at 59 */ - { (ASN_TAG_CLASS_APPLICATION | (33 << 2)), 33, 0, 0 }, /* showMyCardsRequestMessage at 60 */ - { (ASN_TAG_CLASS_APPLICATION | (34 << 2)), 34, 0, 0 }, /* afterHandShowCardsMessage at 61 */ - { (ASN_TAG_CLASS_APPLICATION | (35 << 2)), 35, 0, 0 }, /* endOfGameMessage at 62 */ - { (ASN_TAG_CLASS_APPLICATION | (64 << 2)), 36, 0, 0 }, /* askKickPlayerMessage at 63 */ - { (ASN_TAG_CLASS_APPLICATION | (65 << 2)), 37, 0, 0 }, /* askKickDeniedMessage at 64 */ - { (ASN_TAG_CLASS_APPLICATION | (66 << 2)), 38, 0, 0 }, /* startKickPetitionMessage at 65 */ - { (ASN_TAG_CLASS_APPLICATION | (67 << 2)), 39, 0, 0 }, /* voteKickRequestMessage at 66 */ - { (ASN_TAG_CLASS_APPLICATION | (68 << 2)), 40, 0, 0 }, /* voteKickReplyMessage at 67 */ - { (ASN_TAG_CLASS_APPLICATION | (69 << 2)), 41, 0, 0 }, /* kickPetitionUpdateMessage at 68 */ - { (ASN_TAG_CLASS_APPLICATION | (70 << 2)), 42, 0, 0 }, /* endKickPetitionMessage at 69 */ - { (ASN_TAG_CLASS_APPLICATION | (128 << 2)), 43, 0, 0 }, /* statisticsMessage at 70 */ - { (ASN_TAG_CLASS_APPLICATION | (129 << 2)), 44, 0, 0 }, /* chatRequestMessage at 71 */ - { (ASN_TAG_CLASS_APPLICATION | (130 << 2)), 45, 0, 0 }, /* chatMessage at 72 */ - { (ASN_TAG_CLASS_APPLICATION | (131 << 2)), 46, 0, 0 }, /* chatRejectMessage at 73 */ - { (ASN_TAG_CLASS_APPLICATION | (132 << 2)), 47, 0, 0 }, /* dialogMessage at 74 */ - { (ASN_TAG_CLASS_APPLICATION | (133 << 2)), 48, 0, 0 }, /* timeoutWarningMessage at 75 */ - { (ASN_TAG_CLASS_APPLICATION | (134 << 2)), 49, 0, 0 }, /* resetTimeoutMessage at 76 */ - { (ASN_TAG_CLASS_APPLICATION | (135 << 2)), 50, 0, 0 }, /* afkWarningMessage at 77 */ - { (ASN_TAG_CLASS_APPLICATION | (136 << 2)), 51, 0, 0 }, /* reportAvatarMessage at 78 */ - { (ASN_TAG_CLASS_APPLICATION | (137 << 2)), 52, 0, 0 }, /* reportAvatarAckMessage at 79 */ - { (ASN_TAG_CLASS_APPLICATION | (255 << 2)), 53, 0, 0 } /* errorMessage at 81 */ + { (ASN_TAG_CLASS_APPLICATION | (0 << 2)), 0, 0, 0 }, /* announceMessage at 27 */ + { (ASN_TAG_CLASS_APPLICATION | (1 << 2)), 1, 0, 0 }, /* initMessage at 28 */ + { (ASN_TAG_CLASS_APPLICATION | (2 << 2)), 2, 0, 0 }, /* authMessage at 29 */ + { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 3, 0, 0 }, /* initAckMessage at 30 */ + { (ASN_TAG_CLASS_APPLICATION | (4 << 2)), 4, 0, 0 }, /* avatarRequestMessage at 31 */ + { (ASN_TAG_CLASS_APPLICATION | (5 << 2)), 5, 0, 0 }, /* avatarReplyMessage at 32 */ + { (ASN_TAG_CLASS_APPLICATION | (6 << 2)), 6, 0, 0 }, /* playerListMessage at 33 */ + { (ASN_TAG_CLASS_APPLICATION | (7 << 2)), 7, 0, 0 }, /* gameListMessage at 34 */ + { (ASN_TAG_CLASS_APPLICATION | (8 << 2)), 8, 0, 0 }, /* playerInfoRequestMessage at 35 */ + { (ASN_TAG_CLASS_APPLICATION | (9 << 2)), 9, 0, 0 }, /* playerInfoReplyMessage at 36 */ + { (ASN_TAG_CLASS_APPLICATION | (10 << 2)), 10, 0, 0 }, /* subscriptionRequestMessage at 37 */ + { (ASN_TAG_CLASS_APPLICATION | (11 << 2)), 11, 0, 0 }, /* joinGameRequestMessage at 38 */ + { (ASN_TAG_CLASS_APPLICATION | (12 << 2)), 12, 0, 0 }, /* joinGameReplyMessage at 39 */ + { (ASN_TAG_CLASS_APPLICATION | (13 << 2)), 13, 0, 0 }, /* gamePlayerMessage at 40 */ + { (ASN_TAG_CLASS_APPLICATION | (14 << 2)), 14, 0, 0 }, /* kickPlayerRequestMessage at 41 */ + { (ASN_TAG_CLASS_APPLICATION | (15 << 2)), 15, 0, 0 }, /* leaveGameRequestMessage at 42 */ + { (ASN_TAG_CLASS_APPLICATION | (16 << 2)), 16, 0, 0 }, /* invitePlayerToGameMessage at 43 */ + { (ASN_TAG_CLASS_APPLICATION | (17 << 2)), 17, 0, 0 }, /* inviteNotifyMessage at 44 */ + { (ASN_TAG_CLASS_APPLICATION | (18 << 2)), 18, 0, 0 }, /* rejectGameInvitationMessage at 45 */ + { (ASN_TAG_CLASS_APPLICATION | (19 << 2)), 19, 0, 0 }, /* rejectInvNotifyMessage at 46 */ + { (ASN_TAG_CLASS_APPLICATION | (20 << 2)), 20, 0, 0 }, /* startEventMessage at 47 */ + { (ASN_TAG_CLASS_APPLICATION | (21 << 2)), 21, 0, 0 }, /* startEventAckMessage at 48 */ + { (ASN_TAG_CLASS_APPLICATION | (22 << 2)), 22, 0, 0 }, /* gameStartMessage at 49 */ + { (ASN_TAG_CLASS_APPLICATION | (23 << 2)), 23, 0, 0 }, /* handStartMessage at 50 */ + { (ASN_TAG_CLASS_APPLICATION | (24 << 2)), 24, 0, 0 }, /* playersTurnMessage at 51 */ + { (ASN_TAG_CLASS_APPLICATION | (25 << 2)), 25, 0, 0 }, /* myActionRequestMessage at 52 */ + { (ASN_TAG_CLASS_APPLICATION | (26 << 2)), 26, 0, 0 }, /* yourActionRejectedMessage at 53 */ + { (ASN_TAG_CLASS_APPLICATION | (27 << 2)), 27, 0, 0 }, /* playersActionDoneMessage at 54 */ + { (ASN_TAG_CLASS_APPLICATION | (28 << 2)), 28, 0, 0 }, /* dealFlopCardsMessage at 55 */ + { (ASN_TAG_CLASS_APPLICATION | (29 << 2)), 29, 0, 0 }, /* dealTurnCardMessage at 56 */ + { (ASN_TAG_CLASS_APPLICATION | (30 << 2)), 30, 0, 0 }, /* dealRiverCardMessage at 57 */ + { (ASN_TAG_CLASS_APPLICATION | (31 << 2)), 31, 0, 0 }, /* allInShowCardsMessage at 58 */ + { (ASN_TAG_CLASS_APPLICATION | (32 << 2)), 32, 0, 0 }, /* endOfHandMessage at 59 */ + { (ASN_TAG_CLASS_APPLICATION | (33 << 2)), 33, 0, 0 }, /* showMyCardsRequestMessage at 60 */ + { (ASN_TAG_CLASS_APPLICATION | (34 << 2)), 34, 0, 0 }, /* afterHandShowCardsMessage at 61 */ + { (ASN_TAG_CLASS_APPLICATION | (35 << 2)), 35, 0, 0 }, /* endOfGameMessage at 62 */ + { (ASN_TAG_CLASS_APPLICATION | (64 << 2)), 36, 0, 0 }, /* askKickPlayerMessage at 63 */ + { (ASN_TAG_CLASS_APPLICATION | (65 << 2)), 37, 0, 0 }, /* askKickDeniedMessage at 64 */ + { (ASN_TAG_CLASS_APPLICATION | (66 << 2)), 38, 0, 0 }, /* startKickPetitionMessage at 65 */ + { (ASN_TAG_CLASS_APPLICATION | (67 << 2)), 39, 0, 0 }, /* voteKickRequestMessage at 66 */ + { (ASN_TAG_CLASS_APPLICATION | (68 << 2)), 40, 0, 0 }, /* voteKickReplyMessage at 67 */ + { (ASN_TAG_CLASS_APPLICATION | (69 << 2)), 41, 0, 0 }, /* kickPetitionUpdateMessage at 68 */ + { (ASN_TAG_CLASS_APPLICATION | (70 << 2)), 42, 0, 0 }, /* endKickPetitionMessage at 69 */ + { (ASN_TAG_CLASS_APPLICATION | (128 << 2)), 43, 0, 0 }, /* statisticsMessage at 70 */ + { (ASN_TAG_CLASS_APPLICATION | (129 << 2)), 44, 0, 0 }, /* chatRequestMessage at 71 */ + { (ASN_TAG_CLASS_APPLICATION | (130 << 2)), 45, 0, 0 }, /* chatMessage at 72 */ + { (ASN_TAG_CLASS_APPLICATION | (131 << 2)), 46, 0, 0 }, /* chatRejectMessage at 73 */ + { (ASN_TAG_CLASS_APPLICATION | (132 << 2)), 47, 0, 0 }, /* dialogMessage at 74 */ + { (ASN_TAG_CLASS_APPLICATION | (133 << 2)), 48, 0, 0 }, /* timeoutWarningMessage at 75 */ + { (ASN_TAG_CLASS_APPLICATION | (134 << 2)), 49, 0, 0 }, /* resetTimeoutMessage at 76 */ + { (ASN_TAG_CLASS_APPLICATION | (135 << 2)), 50, 0, 0 }, /* afkWarningMessage at 77 */ + { (ASN_TAG_CLASS_APPLICATION | (136 << 2)), 51, 0, 0 }, /* reportAvatarMessage at 78 */ + { (ASN_TAG_CLASS_APPLICATION | (137 << 2)), 52, 0, 0 }, /* reportAvatarAckMessage at 79 */ + { (ASN_TAG_CLASS_APPLICATION | (255 << 2)), 53, 0, 0 } /* errorMessage at 81 */ }; static asn_CHOICE_specifics_t asn_SPC_PokerTHMessage_specs_1 = { sizeof(struct PokerTHMessage), diff --git a/src/third_party/asn1/PokerTHMessage.h b/src/third_party/asn1/PokerTHMessage.h index ef0cb55e..f9d42a88 100644 --- a/src/third_party/asn1/PokerTHMessage.h +++ b/src/third_party/asn1/PokerTHMessage.h @@ -72,137 +72,138 @@ extern "C" { #endif -/* Dependencies */ -typedef enum PokerTHMessage_PR { - PokerTHMessage_PR_NOTHING, /* No components present */ - PokerTHMessage_PR_announceMessage, - PokerTHMessage_PR_initMessage, - PokerTHMessage_PR_authMessage, - PokerTHMessage_PR_initAckMessage, - PokerTHMessage_PR_avatarRequestMessage, - PokerTHMessage_PR_avatarReplyMessage, - PokerTHMessage_PR_playerListMessage, - PokerTHMessage_PR_gameListMessage, - PokerTHMessage_PR_playerInfoRequestMessage, - PokerTHMessage_PR_playerInfoReplyMessage, - PokerTHMessage_PR_subscriptionRequestMessage, - PokerTHMessage_PR_joinGameRequestMessage, - PokerTHMessage_PR_joinGameReplyMessage, - PokerTHMessage_PR_gamePlayerMessage, - PokerTHMessage_PR_kickPlayerRequestMessage, - PokerTHMessage_PR_leaveGameRequestMessage, - PokerTHMessage_PR_invitePlayerToGameMessage, - PokerTHMessage_PR_inviteNotifyMessage, - PokerTHMessage_PR_rejectGameInvitationMessage, - PokerTHMessage_PR_rejectInvNotifyMessage, - PokerTHMessage_PR_startEventMessage, - PokerTHMessage_PR_startEventAckMessage, - PokerTHMessage_PR_gameStartMessage, - PokerTHMessage_PR_handStartMessage, - PokerTHMessage_PR_playersTurnMessage, - PokerTHMessage_PR_myActionRequestMessage, - PokerTHMessage_PR_yourActionRejectedMessage, - PokerTHMessage_PR_playersActionDoneMessage, - PokerTHMessage_PR_dealFlopCardsMessage, - PokerTHMessage_PR_dealTurnCardMessage, - PokerTHMessage_PR_dealRiverCardMessage, - PokerTHMessage_PR_allInShowCardsMessage, - PokerTHMessage_PR_endOfHandMessage, - PokerTHMessage_PR_showMyCardsRequestMessage, - PokerTHMessage_PR_afterHandShowCardsMessage, - PokerTHMessage_PR_endOfGameMessage, - PokerTHMessage_PR_askKickPlayerMessage, - PokerTHMessage_PR_askKickDeniedMessage, - PokerTHMessage_PR_startKickPetitionMessage, - PokerTHMessage_PR_voteKickRequestMessage, - PokerTHMessage_PR_voteKickReplyMessage, - PokerTHMessage_PR_kickPetitionUpdateMessage, - PokerTHMessage_PR_endKickPetitionMessage, - PokerTHMessage_PR_statisticsMessage, - PokerTHMessage_PR_chatRequestMessage, - PokerTHMessage_PR_chatMessage, - PokerTHMessage_PR_chatRejectMessage, - PokerTHMessage_PR_dialogMessage, - PokerTHMessage_PR_timeoutWarningMessage, - PokerTHMessage_PR_resetTimeoutMessage, - PokerTHMessage_PR_afkWarningMessage, - PokerTHMessage_PR_reportAvatarMessage, - PokerTHMessage_PR_reportAvatarAckMessage, - PokerTHMessage_PR_errorMessage, - /* Extensions may appear below */ - -} PokerTHMessage_PR; + /* Dependencies */ + typedef enum PokerTHMessage_PR { + PokerTHMessage_PR_NOTHING, /* No components present */ + PokerTHMessage_PR_announceMessage, + PokerTHMessage_PR_initMessage, + PokerTHMessage_PR_authMessage, + PokerTHMessage_PR_initAckMessage, + PokerTHMessage_PR_avatarRequestMessage, + PokerTHMessage_PR_avatarReplyMessage, + PokerTHMessage_PR_playerListMessage, + PokerTHMessage_PR_gameListMessage, + PokerTHMessage_PR_playerInfoRequestMessage, + PokerTHMessage_PR_playerInfoReplyMessage, + PokerTHMessage_PR_subscriptionRequestMessage, + PokerTHMessage_PR_joinGameRequestMessage, + PokerTHMessage_PR_joinGameReplyMessage, + PokerTHMessage_PR_gamePlayerMessage, + PokerTHMessage_PR_kickPlayerRequestMessage, + PokerTHMessage_PR_leaveGameRequestMessage, + PokerTHMessage_PR_invitePlayerToGameMessage, + PokerTHMessage_PR_inviteNotifyMessage, + PokerTHMessage_PR_rejectGameInvitationMessage, + PokerTHMessage_PR_rejectInvNotifyMessage, + PokerTHMessage_PR_startEventMessage, + PokerTHMessage_PR_startEventAckMessage, + PokerTHMessage_PR_gameStartMessage, + PokerTHMessage_PR_handStartMessage, + PokerTHMessage_PR_playersTurnMessage, + PokerTHMessage_PR_myActionRequestMessage, + PokerTHMessage_PR_yourActionRejectedMessage, + PokerTHMessage_PR_playersActionDoneMessage, + PokerTHMessage_PR_dealFlopCardsMessage, + PokerTHMessage_PR_dealTurnCardMessage, + PokerTHMessage_PR_dealRiverCardMessage, + PokerTHMessage_PR_allInShowCardsMessage, + PokerTHMessage_PR_endOfHandMessage, + PokerTHMessage_PR_showMyCardsRequestMessage, + PokerTHMessage_PR_afterHandShowCardsMessage, + PokerTHMessage_PR_endOfGameMessage, + PokerTHMessage_PR_askKickPlayerMessage, + PokerTHMessage_PR_askKickDeniedMessage, + PokerTHMessage_PR_startKickPetitionMessage, + PokerTHMessage_PR_voteKickRequestMessage, + PokerTHMessage_PR_voteKickReplyMessage, + PokerTHMessage_PR_kickPetitionUpdateMessage, + PokerTHMessage_PR_endKickPetitionMessage, + PokerTHMessage_PR_statisticsMessage, + PokerTHMessage_PR_chatRequestMessage, + PokerTHMessage_PR_chatMessage, + PokerTHMessage_PR_chatRejectMessage, + PokerTHMessage_PR_dialogMessage, + PokerTHMessage_PR_timeoutWarningMessage, + PokerTHMessage_PR_resetTimeoutMessage, + PokerTHMessage_PR_afkWarningMessage, + PokerTHMessage_PR_reportAvatarMessage, + PokerTHMessage_PR_reportAvatarAckMessage, + PokerTHMessage_PR_errorMessage, + /* Extensions may appear below */ -/* PokerTHMessage */ -typedef struct PokerTHMessage { - PokerTHMessage_PR present; - union PokerTHMessage_u { - AnnounceMessage_t announceMessage; - InitMessage_t initMessage; - AuthMessage_t authMessage; - InitAckMessage_t initAckMessage; - AvatarRequestMessage_t avatarRequestMessage; - AvatarReplyMessage_t avatarReplyMessage; - PlayerListMessage_t playerListMessage; - GameListMessage_t gameListMessage; - PlayerInfoRequestMessage_t playerInfoRequestMessage; - PlayerInfoReplyMessage_t playerInfoReplyMessage; - SubscriptionRequestMessage_t subscriptionRequestMessage; - JoinGameRequestMessage_t joinGameRequestMessage; - JoinGameReplyMessage_t joinGameReplyMessage; - GamePlayerMessage_t gamePlayerMessage; - KickPlayerRequestMessage_t kickPlayerRequestMessage; - LeaveGameRequestMessage_t leaveGameRequestMessage; - InvitePlayerToGameMessage_t invitePlayerToGameMessage; - InviteNotifyMessage_t inviteNotifyMessage; - RejectGameInvitationMessage_t rejectGameInvitationMessage; - RejectInvNotifyMessage_t rejectInvNotifyMessage; - StartEventMessage_t startEventMessage; - StartEventAckMessage_t startEventAckMessage; - GameStartMessage_t gameStartMessage; - HandStartMessage_t handStartMessage; - PlayersTurnMessage_t playersTurnMessage; - MyActionRequestMessage_t myActionRequestMessage; - YourActionRejectedMessage_t yourActionRejectedMessage; - PlayersActionDoneMessage_t playersActionDoneMessage; - DealFlopCardsMessage_t dealFlopCardsMessage; - DealTurnCardMessage_t dealTurnCardMessage; - DealRiverCardMessage_t dealRiverCardMessage; - AllInShowCardsMessage_t allInShowCardsMessage; - EndOfHandMessage_t endOfHandMessage; - ShowMyCardsRequestMessage_t showMyCardsRequestMessage; - AfterHandShowCardsMessage_t afterHandShowCardsMessage; - EndOfGameMessage_t endOfGameMessage; - AskKickPlayerMessage_t askKickPlayerMessage; - AskKickDeniedMessage_t askKickDeniedMessage; - StartKickPetitionMessage_t startKickPetitionMessage; - VoteKickRequestMessage_t voteKickRequestMessage; - VoteKickReplyMessage_t voteKickReplyMessage; - KickPetitionUpdateMessage_t kickPetitionUpdateMessage; - EndKickPetitionMessage_t endKickPetitionMessage; - StatisticsMessage_t statisticsMessage; - ChatRequestMessage_t chatRequestMessage; - ChatMessage_t chatMessage; - ChatRejectMessage_t chatRejectMessage; - DialogMessage_t dialogMessage; - TimeoutWarningMessage_t timeoutWarningMessage; - ResetTimeoutMessage_t resetTimeoutMessage; - AfkWarningMessage_t afkWarningMessage; - ReportAvatarMessage_t reportAvatarMessage; - ReportAvatarAckMessage_t reportAvatarAckMessage; - ErrorMessage_t errorMessage; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} PokerTHMessage_t; + } + PokerTHMessage_PR; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_PokerTHMessage; + /* PokerTHMessage */ + typedef struct PokerTHMessage { + PokerTHMessage_PR present; + union PokerTHMessage_u { + AnnounceMessage_t announceMessage; + InitMessage_t initMessage; + AuthMessage_t authMessage; + InitAckMessage_t initAckMessage; + AvatarRequestMessage_t avatarRequestMessage; + AvatarReplyMessage_t avatarReplyMessage; + PlayerListMessage_t playerListMessage; + GameListMessage_t gameListMessage; + PlayerInfoRequestMessage_t playerInfoRequestMessage; + PlayerInfoReplyMessage_t playerInfoReplyMessage; + SubscriptionRequestMessage_t subscriptionRequestMessage; + JoinGameRequestMessage_t joinGameRequestMessage; + JoinGameReplyMessage_t joinGameReplyMessage; + GamePlayerMessage_t gamePlayerMessage; + KickPlayerRequestMessage_t kickPlayerRequestMessage; + LeaveGameRequestMessage_t leaveGameRequestMessage; + InvitePlayerToGameMessage_t invitePlayerToGameMessage; + InviteNotifyMessage_t inviteNotifyMessage; + RejectGameInvitationMessage_t rejectGameInvitationMessage; + RejectInvNotifyMessage_t rejectInvNotifyMessage; + StartEventMessage_t startEventMessage; + StartEventAckMessage_t startEventAckMessage; + GameStartMessage_t gameStartMessage; + HandStartMessage_t handStartMessage; + PlayersTurnMessage_t playersTurnMessage; + MyActionRequestMessage_t myActionRequestMessage; + YourActionRejectedMessage_t yourActionRejectedMessage; + PlayersActionDoneMessage_t playersActionDoneMessage; + DealFlopCardsMessage_t dealFlopCardsMessage; + DealTurnCardMessage_t dealTurnCardMessage; + DealRiverCardMessage_t dealRiverCardMessage; + AllInShowCardsMessage_t allInShowCardsMessage; + EndOfHandMessage_t endOfHandMessage; + ShowMyCardsRequestMessage_t showMyCardsRequestMessage; + AfterHandShowCardsMessage_t afterHandShowCardsMessage; + EndOfGameMessage_t endOfGameMessage; + AskKickPlayerMessage_t askKickPlayerMessage; + AskKickDeniedMessage_t askKickDeniedMessage; + StartKickPetitionMessage_t startKickPetitionMessage; + VoteKickRequestMessage_t voteKickRequestMessage; + VoteKickReplyMessage_t voteKickReplyMessage; + KickPetitionUpdateMessage_t kickPetitionUpdateMessage; + EndKickPetitionMessage_t endKickPetitionMessage; + StatisticsMessage_t statisticsMessage; + ChatRequestMessage_t chatRequestMessage; + ChatMessage_t chatMessage; + ChatRejectMessage_t chatRejectMessage; + DialogMessage_t dialogMessage; + TimeoutWarningMessage_t timeoutWarningMessage; + ResetTimeoutMessage_t resetTimeoutMessage; + AfkWarningMessage_t afkWarningMessage; + ReportAvatarMessage_t reportAvatarMessage; + ReportAvatarAckMessage_t reportAvatarAckMessage; + ErrorMessage_t errorMessage; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } PokerTHMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_PokerTHMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/RejectGameInvReason.c b/src/third_party/asn1/RejectGameInvReason.c index a448ce6d..b746b652 100644 --- a/src/third_party/asn1/RejectGameInvReason.c +++ b/src/third_party/asn1/RejectGameInvReason.c @@ -9,7 +9,7 @@ int RejectGameInvReason_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ RejectGameInvReason_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void RejectGameInvReason_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { RejectGameInvReason_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int RejectGameInvReason_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { RejectGameInvReason_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t RejectGameInvReason_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { RejectGameInvReason_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t RejectGameInvReason_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { RejectGameInvReason_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t RejectGameInvReason_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { RejectGameInvReason_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t RejectGameInvReason_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { RejectGameInvReason_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -114,10 +114,10 @@ asn_TYPE_descriptor_t asn_DEF_RejectGameInvReason = { 0, /* Use generic outmost tag fetcher */ asn_DEF_RejectGameInvReason_tags_1, sizeof(asn_DEF_RejectGameInvReason_tags_1) - /sizeof(asn_DEF_RejectGameInvReason_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_RejectGameInvReason_tags_1[0]), /* 1 */ asn_DEF_RejectGameInvReason_tags_1, /* Same as above */ sizeof(asn_DEF_RejectGameInvReason_tags_1) - /sizeof(asn_DEF_RejectGameInvReason_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_RejectGameInvReason_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_RejectGameInvReason_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/RejectGameInvReason.h b/src/third_party/asn1/RejectGameInvReason.h index 400e82cc..73626c32 100644 --- a/src/third_party/asn1/RejectGameInvReason.h +++ b/src/third_party/asn1/RejectGameInvReason.h @@ -18,24 +18,25 @@ extern "C" { #endif -/* Dependencies */ -typedef enum RejectGameInvReason { - RejectGameInvReason_no = 0, - RejectGameInvReason_busy = 1 -} e_RejectGameInvReason; + /* Dependencies */ + typedef enum RejectGameInvReason { + RejectGameInvReason_no = 0, + RejectGameInvReason_busy = 1 + } + e_RejectGameInvReason; -/* RejectGameInvReason */ -typedef long RejectGameInvReason_t; + /* RejectGameInvReason */ + typedef long RejectGameInvReason_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RejectGameInvReason; -asn_struct_free_f RejectGameInvReason_free; -asn_struct_print_f RejectGameInvReason_print; -asn_constr_check_f RejectGameInvReason_constraint; -ber_type_decoder_f RejectGameInvReason_decode_ber; -der_type_encoder_f RejectGameInvReason_encode_der; -xer_type_decoder_f RejectGameInvReason_decode_xer; -xer_type_encoder_f RejectGameInvReason_encode_xer; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RejectGameInvReason; + asn_struct_free_f RejectGameInvReason_free; + asn_struct_print_f RejectGameInvReason_print; + asn_constr_check_f RejectGameInvReason_constraint; + ber_type_decoder_f RejectGameInvReason_decode_ber; + der_type_encoder_f RejectGameInvReason_encode_der; + xer_type_decoder_f RejectGameInvReason_decode_xer; + xer_type_encoder_f RejectGameInvReason_encode_xer; #ifdef __cplusplus } diff --git a/src/third_party/asn1/RejectGameInvitationMessage.c b/src/third_party/asn1/RejectGameInvitationMessage.c index d34e88e4..0f17edd2 100644 --- a/src/third_party/asn1/RejectGameInvitationMessage.c +++ b/src/third_party/asn1/RejectGameInvitationMessage.c @@ -8,7 +8,7 @@ #include "RejectGameInvitationMessage.h" static asn_TYPE_member_t asn_MBR_RejectGameInvitationMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct RejectGameInvitationMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct RejectGameInvitationMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_RejectGameInvitationMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct RejectGameInvitationMessage, myRejectReason), + }, + { ATF_NOFLAGS, 0, offsetof(struct RejectGameInvitationMessage, myRejectReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_RejectGameInvReason, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_RejectGameInvitationMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "myRejectReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_RejectGameInvitationMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (18 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_RejectGameInvitationMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 416 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* myRejectReason at 418 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* gameId at 423 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* myRejectReason at 425 */ }; static asn_SEQUENCE_specifics_t asn_SPC_RejectGameInvitationMessage_specs_1 = { sizeof(struct RejectGameInvitationMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_RejectGameInvitationMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_RejectGameInvitationMessage_tags_1, sizeof(asn_DEF_RejectGameInvitationMessage_tags_1) - /sizeof(asn_DEF_RejectGameInvitationMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_RejectGameInvitationMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_RejectGameInvitationMessage_tags_1, /* Same as above */ sizeof(asn_DEF_RejectGameInvitationMessage_tags_1) - /sizeof(asn_DEF_RejectGameInvitationMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_RejectGameInvitationMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_RejectGameInvitationMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/RejectGameInvitationMessage.h b/src/third_party/asn1/RejectGameInvitationMessage.h index f3ccfd35..b44419e0 100644 --- a/src/third_party/asn1/RejectGameInvitationMessage.h +++ b/src/third_party/asn1/RejectGameInvitationMessage.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* RejectGameInvitationMessage */ -typedef struct RejectGameInvitationMessage { - NonZeroId_t gameId; - RejectGameInvReason_t myRejectReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} RejectGameInvitationMessage_t; + /* RejectGameInvitationMessage */ + typedef struct RejectGameInvitationMessage { + NonZeroId_t gameId; + RejectGameInvReason_t myRejectReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RejectGameInvitationMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } RejectGameInvitationMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RejectGameInvitationMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/RejectInvNotifyMessage.c b/src/third_party/asn1/RejectInvNotifyMessage.c index ce0e0d05..a36d35c8 100644 --- a/src/third_party/asn1/RejectInvNotifyMessage.c +++ b/src/third_party/asn1/RejectInvNotifyMessage.c @@ -8,7 +8,7 @@ #include "RejectInvNotifyMessage.h" static asn_TYPE_member_t asn_MBR_RejectInvNotifyMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct RejectInvNotifyMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct RejectInvNotifyMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_RejectInvNotifyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct RejectInvNotifyMessage, playerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct RejectInvNotifyMessage, playerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_RejectInvNotifyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct RejectInvNotifyMessage, playerRejectReason), + }, + { ATF_NOFLAGS, 0, offsetof(struct RejectInvNotifyMessage, playerRejectReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_RejectGameInvReason, @@ -34,16 +34,16 @@ static asn_TYPE_member_t asn_MBR_RejectInvNotifyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "playerRejectReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_RejectInvNotifyMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (19 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_RejectInvNotifyMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 421 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* playerId at 422 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 } /* playerRejectReason at 424 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 428 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* playerId at 429 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, 0, 0 } /* playerRejectReason at 431 */ }; static asn_SEQUENCE_specifics_t asn_SPC_RejectInvNotifyMessage_specs_1 = { sizeof(struct RejectInvNotifyMessage), @@ -68,10 +68,10 @@ asn_TYPE_descriptor_t asn_DEF_RejectInvNotifyMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_RejectInvNotifyMessage_tags_1, sizeof(asn_DEF_RejectInvNotifyMessage_tags_1) - /sizeof(asn_DEF_RejectInvNotifyMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_RejectInvNotifyMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_RejectInvNotifyMessage_tags_1, /* Same as above */ sizeof(asn_DEF_RejectInvNotifyMessage_tags_1) - /sizeof(asn_DEF_RejectInvNotifyMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_RejectInvNotifyMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_RejectInvNotifyMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/RejectInvNotifyMessage.h b/src/third_party/asn1/RejectInvNotifyMessage.h index cdad4637..b9967fd0 100644 --- a/src/third_party/asn1/RejectInvNotifyMessage.h +++ b/src/third_party/asn1/RejectInvNotifyMessage.h @@ -20,22 +20,22 @@ extern "C" { #endif -/* RejectInvNotifyMessage */ -typedef struct RejectInvNotifyMessage { - NonZeroId_t gameId; - NonZeroId_t playerId; - RejectGameInvReason_t playerRejectReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} RejectInvNotifyMessage_t; + /* RejectInvNotifyMessage */ + typedef struct RejectInvNotifyMessage { + NonZeroId_t gameId; + NonZeroId_t playerId; + RejectGameInvReason_t playerRejectReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_RejectInvNotifyMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } RejectInvNotifyMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RejectInvNotifyMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/RejoinExistingGame.c b/src/third_party/asn1/RejoinExistingGame.c new file mode 100644 index 00000000..1a6916ad --- /dev/null +++ b/src/third_party/asn1/RejoinExistingGame.c @@ -0,0 +1,59 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#include "RejoinExistingGame.h" + +static asn_TYPE_member_t asn_MBR_RejoinExistingGame_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct RejoinExistingGame, gameId), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NonZeroId, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "gameId" + }, +}; +static ber_tlv_tag_t asn_DEF_RejoinExistingGame_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_TYPE_tag2member_t asn_MAP_RejoinExistingGame_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 300 */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_RejoinExistingGame_specs_1 = { + sizeof(struct RejoinExistingGame), + offsetof(struct RejoinExistingGame, _asn_ctx), + asn_MAP_RejoinExistingGame_tag2el_1, + 1, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 0, /* Start extensions */ + 2 /* Stop extensions */ +}; +asn_TYPE_descriptor_t asn_DEF_RejoinExistingGame = { + "RejoinExistingGame", + "RejoinExistingGame", + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_constraint, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, + 0, 0, /* No PER support, use "-gen-PER" to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_RejoinExistingGame_tags_1, + sizeof(asn_DEF_RejoinExistingGame_tags_1) + /sizeof(asn_DEF_RejoinExistingGame_tags_1[0]), /* 1 */ + asn_DEF_RejoinExistingGame_tags_1, /* Same as above */ + sizeof(asn_DEF_RejoinExistingGame_tags_1) + /sizeof(asn_DEF_RejoinExistingGame_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_RejoinExistingGame_1, + 1, /* Elements count */ + &asn_SPC_RejoinExistingGame_specs_1 /* Additional specs */ +}; + diff --git a/src/third_party/asn1/RejoinExistingGame.h b/src/third_party/asn1/RejoinExistingGame.h new file mode 100644 index 00000000..796a7188 --- /dev/null +++ b/src/third_party/asn1/RejoinExistingGame.h @@ -0,0 +1,42 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#ifndef _RejoinExistingGame_H_ +#define _RejoinExistingGame_H_ + + +#include + +/* Including external dependencies */ +#include "NonZeroId.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + + /* RejoinExistingGame */ + typedef struct RejoinExistingGame { + NonZeroId_t gameId; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } RejoinExistingGame_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RejoinExistingGame; + +#ifdef __cplusplus +} +#endif + +#endif /* _RejoinExistingGame_H_ */ +#include diff --git a/src/third_party/asn1/RejoinPlayerData.c b/src/third_party/asn1/RejoinPlayerData.c new file mode 100644 index 00000000..a7dcd1b6 --- /dev/null +++ b/src/third_party/asn1/RejoinPlayerData.c @@ -0,0 +1,94 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#include "RejoinPlayerData.h" + +static int +memb_playerMoney_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, + asn_app_constraint_failed_f *ctfailcb, void *app_key) { + long value; + + if(!sptr) { + _ASN_CTFAIL(app_key, td, sptr, + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } + + value = *(const long *)sptr; + + if((value >= 0 && value <= 10000000)) { + /* Constraint check succeeded */ + return 0; + } else { + _ASN_CTFAIL(app_key, td, sptr, + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } +} + +static asn_TYPE_member_t asn_MBR_RejoinPlayerData_1[] = { + { ATF_NOFLAGS, 0, offsetof(struct RejoinPlayerData, playerId), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NonZeroId, + 0, /* Defer constraints checking to the member type */ + 0, /* PER is not compiled, use -gen-PER */ + 0, + "playerId" + }, + { ATF_NOFLAGS, 0, offsetof(struct RejoinPlayerData, playerMoney), + (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), + 0, + &asn_DEF_NativeInteger, + memb_playerMoney_constraint_1, + 0, /* PER is not compiled, use -gen-PER */ + 0, + "playerMoney" + }, +}; +static ber_tlv_tag_t asn_DEF_RejoinPlayerData_tags_1[] = { + (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) +}; +static asn_TYPE_tag2member_t asn_MAP_RejoinPlayerData_tag2el_1[] = { + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* playerId at 443 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* playerMoney at 444 */ +}; +static asn_SEQUENCE_specifics_t asn_SPC_RejoinPlayerData_specs_1 = { + sizeof(struct RejoinPlayerData), + offsetof(struct RejoinPlayerData, _asn_ctx), + asn_MAP_RejoinPlayerData_tag2el_1, + 2, /* Count of tags in the map */ + 0, 0, 0, /* Optional elements (not needed) */ + 1, /* Start extensions */ + 3 /* Stop extensions */ +}; +asn_TYPE_descriptor_t asn_DEF_RejoinPlayerData = { + "RejoinPlayerData", + "RejoinPlayerData", + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_constraint, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, + 0, 0, /* No PER support, use "-gen-PER" to enable */ + 0, /* Use generic outmost tag fetcher */ + asn_DEF_RejoinPlayerData_tags_1, + sizeof(asn_DEF_RejoinPlayerData_tags_1) + /sizeof(asn_DEF_RejoinPlayerData_tags_1[0]), /* 1 */ + asn_DEF_RejoinPlayerData_tags_1, /* Same as above */ + sizeof(asn_DEF_RejoinPlayerData_tags_1) + /sizeof(asn_DEF_RejoinPlayerData_tags_1[0]), /* 1 */ + 0, /* No PER visible constraints */ + asn_MBR_RejoinPlayerData_1, + 2, /* Elements count */ + &asn_SPC_RejoinPlayerData_specs_1 /* Additional specs */ +}; + diff --git a/src/third_party/asn1/RejoinPlayerData.h b/src/third_party/asn1/RejoinPlayerData.h new file mode 100644 index 00000000..2ada0ae9 --- /dev/null +++ b/src/third_party/asn1/RejoinPlayerData.h @@ -0,0 +1,44 @@ +/* + * Generated by asn1c-0.9.23 (http://lionet.info/asn1c) + * From ASN.1 module "POKERTH-PROTOCOL" + * found in "../../../docs/pokerth.asn1" + * `asn1c -fskeletons-copy` + */ + +#ifndef _RejoinPlayerData_H_ +#define _RejoinPlayerData_H_ + + +#include + +/* Including external dependencies */ +#include "NonZeroId.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + /* RejoinPlayerData */ + typedef struct RejoinPlayerData { + NonZeroId_t playerId; + long playerMoney; + /* + * This type is extensible, + * possible extensions are below. + */ + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } RejoinPlayerData_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_RejoinPlayerData; + +#ifdef __cplusplus +} +#endif + +#endif /* _RejoinPlayerData_H_ */ +#include diff --git a/src/third_party/asn1/RemovedFromGame.c b/src/third_party/asn1/RemovedFromGame.c index a299e36e..078f2d4a 100644 --- a/src/third_party/asn1/RemovedFromGame.c +++ b/src/third_party/asn1/RemovedFromGame.c @@ -9,7 +9,7 @@ static int removedFromGameReason_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ removedFromGameReason_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void removedFromGameReason_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { removedFromGameReason_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int removedFromGameReason_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { removedFromGameReason_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t removedFromGameReason_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { removedFromGameReason_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t removedFromGameReason_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { removedFromGameReason_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t removedFromGameReason_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { removedFromGameReason_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t removedFromGameReason_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { removedFromGameReason_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -123,17 +123,17 @@ asn_TYPE_descriptor_t asn_DEF_removedFromGameReason_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_removedFromGameReason_tags_2, sizeof(asn_DEF_removedFromGameReason_tags_2) - /sizeof(asn_DEF_removedFromGameReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_removedFromGameReason_tags_2[0]), /* 1 */ asn_DEF_removedFromGameReason_tags_2, /* Same as above */ sizeof(asn_DEF_removedFromGameReason_tags_2) - /sizeof(asn_DEF_removedFromGameReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_removedFromGameReason_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_removedFromGameReason_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_RemovedFromGame_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct RemovedFromGame, removedFromGameReason), + { ATF_NOFLAGS, 0, offsetof(struct RemovedFromGame, removedFromGameReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_removedFromGameReason_2, @@ -141,13 +141,13 @@ static asn_TYPE_member_t asn_MBR_RemovedFromGame_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "removedFromGameReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_RemovedFromGame_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_RemovedFromGame_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* removedFromGameReason at 381 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* removedFromGameReason at 388 */ }; static asn_SEQUENCE_specifics_t asn_SPC_RemovedFromGame_specs_1 = { sizeof(struct RemovedFromGame), @@ -172,10 +172,10 @@ asn_TYPE_descriptor_t asn_DEF_RemovedFromGame = { 0, /* Use generic outmost tag fetcher */ asn_DEF_RemovedFromGame_tags_1, sizeof(asn_DEF_RemovedFromGame_tags_1) - /sizeof(asn_DEF_RemovedFromGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_RemovedFromGame_tags_1[0]), /* 1 */ asn_DEF_RemovedFromGame_tags_1, /* Same as above */ sizeof(asn_DEF_RemovedFromGame_tags_1) - /sizeof(asn_DEF_RemovedFromGame_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_RemovedFromGame_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_RemovedFromGame_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/RemovedFromGame.h b/src/third_party/asn1/RemovedFromGame.h index 1eb0130b..c53e19bc 100644 --- a/src/third_party/asn1/RemovedFromGame.h +++ b/src/third_party/asn1/RemovedFromGame.h @@ -19,31 +19,32 @@ extern "C" { #endif -/* Dependencies */ -typedef enum removedFromGameReason { - removedFromGameReason_removedOnRequest = 0, - removedFromGameReason_kickedFromGame = 1, - removedFromGameReason_gameIsFull = 2, - removedFromGameReason_gameIsRunning = 3, - removedFromGameReason_gameTimeout = 4, - removedFromGameReason_removedStartFailed = 5 -} e_removedFromGameReason; + /* Dependencies */ + typedef enum removedFromGameReason { + removedFromGameReason_removedOnRequest = 0, + removedFromGameReason_kickedFromGame = 1, + removedFromGameReason_gameIsFull = 2, + removedFromGameReason_gameIsRunning = 3, + removedFromGameReason_gameTimeout = 4, + removedFromGameReason_removedStartFailed = 5 + } + e_removedFromGameReason; -/* RemovedFromGame */ -typedef struct RemovedFromGame { - long removedFromGameReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} RemovedFromGame_t; + /* RemovedFromGame */ + typedef struct RemovedFromGame { + long removedFromGameReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_removedFromGameReason_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_RemovedFromGame; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } RemovedFromGame_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_removedFromGameReason_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_RemovedFromGame; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ReportAvatarAckMessage.c b/src/third_party/asn1/ReportAvatarAckMessage.c index 6714a68b..75b8c2e5 100644 --- a/src/third_party/asn1/ReportAvatarAckMessage.c +++ b/src/third_party/asn1/ReportAvatarAckMessage.c @@ -9,7 +9,7 @@ static int reportResult_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ reportResult_3_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void reportResult_3_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { reportResult_3_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int reportResult_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { reportResult_3_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t reportResult_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { reportResult_3_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t reportResult_3_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { reportResult_3_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t reportResult_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { reportResult_3_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t reportResult_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { reportResult_3_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -117,17 +117,17 @@ asn_TYPE_descriptor_t asn_DEF_reportResult_3 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_reportResult_tags_3, sizeof(asn_DEF_reportResult_tags_3) - /sizeof(asn_DEF_reportResult_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_reportResult_tags_3[0]), /* 1 */ asn_DEF_reportResult_tags_3, /* Same as above */ sizeof(asn_DEF_reportResult_tags_3) - /sizeof(asn_DEF_reportResult_tags_3[0]), /* 1 */ + /sizeof(asn_DEF_reportResult_tags_3[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_reportResult_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_ReportAvatarAckMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ReportAvatarAckMessage, reportedPlayerId), + { ATF_NOFLAGS, 0, offsetof(struct ReportAvatarAckMessage, reportedPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -135,8 +135,8 @@ static asn_TYPE_member_t asn_MBR_ReportAvatarAckMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "reportedPlayerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct ReportAvatarAckMessage, reportResult), + }, + { ATF_NOFLAGS, 0, offsetof(struct ReportAvatarAckMessage, reportResult), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_reportResult_3, @@ -144,15 +144,15 @@ static asn_TYPE_member_t asn_MBR_ReportAvatarAckMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "reportResult" - }, + }, }; static ber_tlv_tag_t asn_DEF_ReportAvatarAckMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (137 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ReportAvatarAckMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 727 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 729 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 750 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* reportResult at 752 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarAckMessage_specs_1 = { sizeof(struct ReportAvatarAckMessage), @@ -177,10 +177,10 @@ asn_TYPE_descriptor_t asn_DEF_ReportAvatarAckMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ReportAvatarAckMessage_tags_1, sizeof(asn_DEF_ReportAvatarAckMessage_tags_1) - /sizeof(asn_DEF_ReportAvatarAckMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_ReportAvatarAckMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_ReportAvatarAckMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ReportAvatarAckMessage_tags_1) - /sizeof(asn_DEF_ReportAvatarAckMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_ReportAvatarAckMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ReportAvatarAckMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/ReportAvatarAckMessage.h b/src/third_party/asn1/ReportAvatarAckMessage.h index a4699ef5..56c3fc0f 100644 --- a/src/third_party/asn1/ReportAvatarAckMessage.h +++ b/src/third_party/asn1/ReportAvatarAckMessage.h @@ -20,29 +20,30 @@ extern "C" { #endif -/* Dependencies */ -typedef enum reportResult { - reportResult_avatarReportAccepted = 0, - reportResult_avatarReportDuplicate = 1, - reportResult_avatarReportInvalid = 2 -} e_reportResult; + /* Dependencies */ + typedef enum reportResult { + reportResult_avatarReportAccepted = 0, + reportResult_avatarReportDuplicate = 1, + reportResult_avatarReportInvalid = 2 + } + e_reportResult; -/* ReportAvatarAckMessage */ -typedef struct ReportAvatarAckMessage { - NonZeroId_t reportedPlayerId; - long reportResult; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ReportAvatarAckMessage_t; + /* ReportAvatarAckMessage */ + typedef struct ReportAvatarAckMessage { + NonZeroId_t reportedPlayerId; + long reportResult; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_reportResult_3; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_ReportAvatarAckMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ReportAvatarAckMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_reportResult_3; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_ReportAvatarAckMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ReportAvatarMessage.c b/src/third_party/asn1/ReportAvatarMessage.c index 2ddf1c36..b68eaf66 100644 --- a/src/third_party/asn1/ReportAvatarMessage.c +++ b/src/third_party/asn1/ReportAvatarMessage.c @@ -8,7 +8,7 @@ #include "ReportAvatarMessage.h" static asn_TYPE_member_t asn_MBR_ReportAvatarMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct ReportAvatarMessage, reportedPlayerId), + { ATF_NOFLAGS, 0, offsetof(struct ReportAvatarMessage, reportedPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_ReportAvatarMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "reportedPlayerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct ReportAvatarMessage, reportedAvatar), + }, + { ATF_NOFLAGS, 0, offsetof(struct ReportAvatarMessage, reportedAvatar), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_AvatarHash, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_ReportAvatarMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "reportedAvatar" - }, + }, }; static ber_tlv_tag_t asn_DEF_ReportAvatarMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (136 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_ReportAvatarMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 722 */ - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 724 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* reportedPlayerId at 745 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 } /* reportedAvatar at 747 */ }; static asn_SEQUENCE_specifics_t asn_SPC_ReportAvatarMessage_specs_1 = { sizeof(struct ReportAvatarMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_ReportAvatarMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ReportAvatarMessage_tags_1, sizeof(asn_DEF_ReportAvatarMessage_tags_1) - /sizeof(asn_DEF_ReportAvatarMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_ReportAvatarMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_ReportAvatarMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ReportAvatarMessage_tags_1) - /sizeof(asn_DEF_ReportAvatarMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_ReportAvatarMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_ReportAvatarMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/ReportAvatarMessage.h b/src/third_party/asn1/ReportAvatarMessage.h index dfd9487c..28793941 100644 --- a/src/third_party/asn1/ReportAvatarMessage.h +++ b/src/third_party/asn1/ReportAvatarMessage.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* ReportAvatarMessage */ -typedef struct ReportAvatarMessage { - NonZeroId_t reportedPlayerId; - AvatarHash_t reportedAvatar; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ReportAvatarMessage_t; + /* ReportAvatarMessage */ + typedef struct ReportAvatarMessage { + NonZeroId_t reportedPlayerId; + AvatarHash_t reportedAvatar; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ReportAvatarMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ReportAvatarMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ReportAvatarMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ResetTimeoutMessage.c b/src/third_party/asn1/ResetTimeoutMessage.c index 021376a7..6026c62c 100644 --- a/src/third_party/asn1/ResetTimeoutMessage.c +++ b/src/third_party/asn1/ResetTimeoutMessage.c @@ -34,10 +34,10 @@ asn_TYPE_descriptor_t asn_DEF_ResetTimeoutMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ResetTimeoutMessage_tags_1, sizeof(asn_DEF_ResetTimeoutMessage_tags_1) - /sizeof(asn_DEF_ResetTimeoutMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_ResetTimeoutMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_ResetTimeoutMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ResetTimeoutMessage_tags_1) - /sizeof(asn_DEF_ResetTimeoutMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_ResetTimeoutMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_ResetTimeoutMessage_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/ResetTimeoutMessage.h b/src/third_party/asn1/ResetTimeoutMessage.h index a95fc324..cb253c25 100644 --- a/src/third_party/asn1/ResetTimeoutMessage.h +++ b/src/third_party/asn1/ResetTimeoutMessage.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* ResetTimeoutMessage */ -typedef struct ResetTimeoutMessage { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ResetTimeoutMessage_t; + /* ResetTimeoutMessage */ + typedef struct ResetTimeoutMessage { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ResetTimeoutMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ResetTimeoutMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ResetTimeoutMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/ShowMyCardsRequestMessage.c b/src/third_party/asn1/ShowMyCardsRequestMessage.c index 27402be3..bf4ef645 100644 --- a/src/third_party/asn1/ShowMyCardsRequestMessage.c +++ b/src/third_party/asn1/ShowMyCardsRequestMessage.c @@ -34,10 +34,10 @@ asn_TYPE_descriptor_t asn_DEF_ShowMyCardsRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_ShowMyCardsRequestMessage_tags_1, sizeof(asn_DEF_ShowMyCardsRequestMessage_tags_1) - /sizeof(asn_DEF_ShowMyCardsRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_ShowMyCardsRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_ShowMyCardsRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_ShowMyCardsRequestMessage_tags_1) - /sizeof(asn_DEF_ShowMyCardsRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_ShowMyCardsRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_ShowMyCardsRequestMessage_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/ShowMyCardsRequestMessage.h b/src/third_party/asn1/ShowMyCardsRequestMessage.h index d4476266..6bf7980f 100644 --- a/src/third_party/asn1/ShowMyCardsRequestMessage.h +++ b/src/third_party/asn1/ShowMyCardsRequestMessage.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* ShowMyCardsRequestMessage */ -typedef struct ShowMyCardsRequestMessage { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} ShowMyCardsRequestMessage_t; + /* ShowMyCardsRequestMessage */ + typedef struct ShowMyCardsRequestMessage { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_ShowMyCardsRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } ShowMyCardsRequestMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_ShowMyCardsRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/StartEventAckMessage.c b/src/third_party/asn1/StartEventAckMessage.c index 4448bdcc..dd95c6fc 100644 --- a/src/third_party/asn1/StartEventAckMessage.c +++ b/src/third_party/asn1/StartEventAckMessage.c @@ -8,7 +8,7 @@ #include "StartEventAckMessage.h" static asn_TYPE_member_t asn_MBR_StartEventAckMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct StartEventAckMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct StartEventAckMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,14 +16,14 @@ static asn_TYPE_member_t asn_MBR_StartEventAckMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, + }, }; static ber_tlv_tag_t asn_DEF_StartEventAckMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (21 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_StartEventAckMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 433 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 440 */ }; static asn_SEQUENCE_specifics_t asn_SPC_StartEventAckMessage_specs_1 = { sizeof(struct StartEventAckMessage), @@ -48,10 +48,10 @@ asn_TYPE_descriptor_t asn_DEF_StartEventAckMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_StartEventAckMessage_tags_1, sizeof(asn_DEF_StartEventAckMessage_tags_1) - /sizeof(asn_DEF_StartEventAckMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_StartEventAckMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_StartEventAckMessage_tags_1, /* Same as above */ sizeof(asn_DEF_StartEventAckMessage_tags_1) - /sizeof(asn_DEF_StartEventAckMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_StartEventAckMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_StartEventAckMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/StartEventAckMessage.h b/src/third_party/asn1/StartEventAckMessage.h index 79af3ddc..e98d074a 100644 --- a/src/third_party/asn1/StartEventAckMessage.h +++ b/src/third_party/asn1/StartEventAckMessage.h @@ -19,20 +19,20 @@ extern "C" { #endif -/* StartEventAckMessage */ -typedef struct StartEventAckMessage { - NonZeroId_t gameId; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} StartEventAckMessage_t; + /* StartEventAckMessage */ + typedef struct StartEventAckMessage { + NonZeroId_t gameId; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_StartEventAckMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } StartEventAckMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_StartEventAckMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/StartEventMessage.c b/src/third_party/asn1/StartEventMessage.c index 80ed4d72..212a5664 100644 --- a/src/third_party/asn1/StartEventMessage.c +++ b/src/third_party/asn1/StartEventMessage.c @@ -8,7 +8,7 @@ #include "StartEventMessage.h" static asn_TYPE_member_t asn_MBR_StartEventMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct StartEventMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct StartEventMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_StartEventMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct StartEventMessage, fillWithComputerPlayers), + }, + { ATF_NOFLAGS, 0, offsetof(struct StartEventMessage, fillWithComputerPlayers), (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, &asn_DEF_BOOLEAN, @@ -25,15 +25,15 @@ static asn_TYPE_member_t asn_MBR_StartEventMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "fillWithComputerPlayers" - }, + }, }; static ber_tlv_tag_t asn_DEF_StartEventMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (20 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_StartEventMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* fillWithComputerPlayers at 428 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 427 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 1, 0, 0 }, /* fillWithComputerPlayers at 435 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* gameId at 434 */ }; static asn_SEQUENCE_specifics_t asn_SPC_StartEventMessage_specs_1 = { sizeof(struct StartEventMessage), @@ -58,10 +58,10 @@ asn_TYPE_descriptor_t asn_DEF_StartEventMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_StartEventMessage_tags_1, sizeof(asn_DEF_StartEventMessage_tags_1) - /sizeof(asn_DEF_StartEventMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_StartEventMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_StartEventMessage_tags_1, /* Same as above */ sizeof(asn_DEF_StartEventMessage_tags_1) - /sizeof(asn_DEF_StartEventMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_StartEventMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_StartEventMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/StartEventMessage.h b/src/third_party/asn1/StartEventMessage.h index 3162cb1a..32a2b222 100644 --- a/src/third_party/asn1/StartEventMessage.h +++ b/src/third_party/asn1/StartEventMessage.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* StartEventMessage */ -typedef struct StartEventMessage { - NonZeroId_t gameId; - BOOLEAN_t fillWithComputerPlayers; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} StartEventMessage_t; + /* StartEventMessage */ + typedef struct StartEventMessage { + NonZeroId_t gameId; + BOOLEAN_t fillWithComputerPlayers; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_StartEventMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } StartEventMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_StartEventMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/StartKickPetitionMessage.c b/src/third_party/asn1/StartKickPetitionMessage.c index 0969fc62..744cb31f 100644 --- a/src/third_party/asn1/StartKickPetitionMessage.c +++ b/src/third_party/asn1/StartKickPetitionMessage.c @@ -9,56 +9,56 @@ static int memb_kickTimeoutSec_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 120)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_numVotesNeededToKick_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 1 && value <= 9)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_StartKickPetitionMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -66,8 +66,8 @@ static asn_TYPE_member_t asn_MBR_StartKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, petitionId), + }, + { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, petitionId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -75,8 +75,8 @@ static asn_TYPE_member_t asn_MBR_StartKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "petitionId" - }, - { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, proposingPlayerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, proposingPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -84,8 +84,8 @@ static asn_TYPE_member_t asn_MBR_StartKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "proposingPlayerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, kickPlayerId), + }, + { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, kickPlayerId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -93,8 +93,8 @@ static asn_TYPE_member_t asn_MBR_StartKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "kickPlayerId" - }, - { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, kickTimeoutSec), + }, + { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, kickTimeoutSec), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -102,8 +102,8 @@ static asn_TYPE_member_t asn_MBR_StartKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "kickTimeoutSec" - }, - { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, numVotesNeededToKick), + }, + { ATF_NOFLAGS, 0, offsetof(struct StartKickPetitionMessage, numVotesNeededToKick), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -111,19 +111,19 @@ static asn_TYPE_member_t asn_MBR_StartKickPetitionMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "numVotesNeededToKick" - }, + }, }; static ber_tlv_tag_t asn_DEF_StartKickPetitionMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (66 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_StartKickPetitionMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* gameId at 582 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* petitionId at 583 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* proposingPlayerId at 584 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 2 }, /* kickPlayerId at 585 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -4, 1 }, /* kickTimeoutSec at 586 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -5, 0 } /* numVotesNeededToKick at 587 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 5 }, /* gameId at 605 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 4 }, /* petitionId at 606 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -2, 3 }, /* proposingPlayerId at 607 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -3, 2 }, /* kickPlayerId at 608 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 4, -4, 1 }, /* kickTimeoutSec at 609 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 5, -5, 0 } /* numVotesNeededToKick at 610 */ }; static asn_SEQUENCE_specifics_t asn_SPC_StartKickPetitionMessage_specs_1 = { sizeof(struct StartKickPetitionMessage), @@ -148,10 +148,10 @@ asn_TYPE_descriptor_t asn_DEF_StartKickPetitionMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_StartKickPetitionMessage_tags_1, sizeof(asn_DEF_StartKickPetitionMessage_tags_1) - /sizeof(asn_DEF_StartKickPetitionMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_StartKickPetitionMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_StartKickPetitionMessage_tags_1, /* Same as above */ sizeof(asn_DEF_StartKickPetitionMessage_tags_1) - /sizeof(asn_DEF_StartKickPetitionMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_StartKickPetitionMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_StartKickPetitionMessage_1, 6, /* Elements count */ diff --git a/src/third_party/asn1/StartKickPetitionMessage.h b/src/third_party/asn1/StartKickPetitionMessage.h index ffe94afb..da220727 100644 --- a/src/third_party/asn1/StartKickPetitionMessage.h +++ b/src/third_party/asn1/StartKickPetitionMessage.h @@ -20,25 +20,25 @@ extern "C" { #endif -/* StartKickPetitionMessage */ -typedef struct StartKickPetitionMessage { - NonZeroId_t gameId; - NonZeroId_t petitionId; - NonZeroId_t proposingPlayerId; - NonZeroId_t kickPlayerId; - long kickTimeoutSec; - long numVotesNeededToKick; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} StartKickPetitionMessage_t; + /* StartKickPetitionMessage */ + typedef struct StartKickPetitionMessage { + NonZeroId_t gameId; + NonZeroId_t petitionId; + NonZeroId_t proposingPlayerId; + NonZeroId_t kickPlayerId; + long kickTimeoutSec; + long numVotesNeededToKick; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_StartKickPetitionMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } StartKickPetitionMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_StartKickPetitionMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/StatisticsData.c b/src/third_party/asn1/StatisticsData.c index 2eb09436..8f23535c 100644 --- a/src/third_party/asn1/StatisticsData.c +++ b/src/third_party/asn1/StatisticsData.c @@ -9,7 +9,7 @@ static int statisticsType_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ statisticsType_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void statisticsType_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { statisticsType_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int statisticsType_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { statisticsType_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t statisticsType_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { statisticsType_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t statisticsType_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { statisticsType_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t statisticsType_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { statisticsType_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t statisticsType_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { statisticsType_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -113,17 +113,17 @@ asn_TYPE_descriptor_t asn_DEF_statisticsType_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_statisticsType_tags_2, sizeof(asn_DEF_statisticsType_tags_2) - /sizeof(asn_DEF_statisticsType_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_statisticsType_tags_2[0]), /* 1 */ asn_DEF_statisticsType_tags_2, /* Same as above */ sizeof(asn_DEF_statisticsType_tags_2) - /sizeof(asn_DEF_statisticsType_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_statisticsType_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_statisticsType_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_StatisticsData_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct StatisticsData, statisticsType), + { ATF_NOFLAGS, 0, offsetof(struct StatisticsData, statisticsType), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_statisticsType_2, @@ -131,8 +131,8 @@ static asn_TYPE_member_t asn_MBR_StatisticsData_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "statisticsType" - }, - { ATF_NOFLAGS, 0, offsetof(struct StatisticsData, statisticsValue), + }, + { ATF_NOFLAGS, 0, offsetof(struct StatisticsData, statisticsValue), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -140,14 +140,14 @@ static asn_TYPE_member_t asn_MBR_StatisticsData_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "statisticsValue" - }, + }, }; static ber_tlv_tag_t asn_DEF_StatisticsData_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_StatisticsData_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* statisticsValue at 646 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* statisticsType at 643 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* statisticsValue at 669 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* statisticsType at 666 */ }; static asn_SEQUENCE_specifics_t asn_SPC_StatisticsData_specs_1 = { sizeof(struct StatisticsData), @@ -172,10 +172,10 @@ asn_TYPE_descriptor_t asn_DEF_StatisticsData = { 0, /* Use generic outmost tag fetcher */ asn_DEF_StatisticsData_tags_1, sizeof(asn_DEF_StatisticsData_tags_1) - /sizeof(asn_DEF_StatisticsData_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_StatisticsData_tags_1[0]), /* 1 */ asn_DEF_StatisticsData_tags_1, /* Same as above */ sizeof(asn_DEF_StatisticsData_tags_1) - /sizeof(asn_DEF_StatisticsData_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_StatisticsData_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_StatisticsData_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/StatisticsData.h b/src/third_party/asn1/StatisticsData.h index 435d675b..0accee42 100644 --- a/src/third_party/asn1/StatisticsData.h +++ b/src/third_party/asn1/StatisticsData.h @@ -20,27 +20,28 @@ extern "C" { #endif -/* Dependencies */ -typedef enum statisticsType { - statisticsType_statNumberOfPlayers = 1 -} e_statisticsType; + /* Dependencies */ + typedef enum statisticsType { + statisticsType_statNumberOfPlayers = 1 + } + e_statisticsType; -/* StatisticsData */ -typedef struct StatisticsData { - long statisticsType; - long statisticsValue; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} StatisticsData_t; + /* StatisticsData */ + typedef struct StatisticsData { + long statisticsType; + long statisticsValue; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_statisticsType_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_StatisticsData; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } StatisticsData_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_statisticsType_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_StatisticsData; #ifdef __cplusplus } diff --git a/src/third_party/asn1/StatisticsMessage.c b/src/third_party/asn1/StatisticsMessage.c index a63e884b..2c86314d 100644 --- a/src/third_party/asn1/StatisticsMessage.c +++ b/src/third_party/asn1/StatisticsMessage.c @@ -9,32 +9,32 @@ static int memb_statisticsData_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + /* Determine the number of elements */ size = _A_CSEQUENCE_FROM_VOID(sptr)->count; - + if((size >= 1 && size <= 32)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_statisticsData_2[] = { - { ATF_POINTER, 0, 0, + { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_StatisticsData, @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_statisticsData_2[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "" - }, + }, }; static ber_tlv_tag_t asn_DEF_statisticsData_tags_2[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) @@ -67,10 +67,10 @@ asn_TYPE_descriptor_t asn_DEF_statisticsData_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_statisticsData_tags_2, sizeof(asn_DEF_statisticsData_tags_2) - /sizeof(asn_DEF_statisticsData_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_statisticsData_tags_2[0]), /* 1 */ asn_DEF_statisticsData_tags_2, /* Same as above */ sizeof(asn_DEF_statisticsData_tags_2) - /sizeof(asn_DEF_statisticsData_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_statisticsData_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_statisticsData_2, 1, /* Single element */ @@ -78,7 +78,7 @@ asn_TYPE_descriptor_t asn_DEF_statisticsData_2 = { }; static asn_TYPE_member_t asn_MBR_StatisticsMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct StatisticsMessage, statisticsData), + { ATF_NOFLAGS, 0, offsetof(struct StatisticsMessage, statisticsData), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_statisticsData_2, @@ -86,14 +86,14 @@ static asn_TYPE_member_t asn_MBR_StatisticsMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "statisticsData" - }, + }, }; static ber_tlv_tag_t asn_DEF_StatisticsMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (128 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_StatisticsMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* statisticsData at 639 */ + { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* statisticsData at 662 */ }; static asn_SEQUENCE_specifics_t asn_SPC_StatisticsMessage_specs_1 = { sizeof(struct StatisticsMessage), @@ -118,10 +118,10 @@ asn_TYPE_descriptor_t asn_DEF_StatisticsMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_StatisticsMessage_tags_1, sizeof(asn_DEF_StatisticsMessage_tags_1) - /sizeof(asn_DEF_StatisticsMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_StatisticsMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_StatisticsMessage_tags_1, /* Same as above */ sizeof(asn_DEF_StatisticsMessage_tags_1) - /sizeof(asn_DEF_StatisticsMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_StatisticsMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_StatisticsMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/StatisticsMessage.h b/src/third_party/asn1/StatisticsMessage.h index 1a299c7a..3850b6bf 100644 --- a/src/third_party/asn1/StatisticsMessage.h +++ b/src/third_party/asn1/StatisticsMessage.h @@ -20,28 +20,28 @@ extern "C" { #endif -/* Forward declarations */ -struct StatisticsData; + /* Forward declarations */ + struct StatisticsData; + + /* StatisticsMessage */ + typedef struct StatisticsMessage { + struct statisticsData { + A_SEQUENCE_OF(struct StatisticsData) list; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } statisticsData; + /* + * This type is extensible, + * possible extensions are below. + */ -/* StatisticsMessage */ -typedef struct StatisticsMessage { - struct statisticsData { - A_SEQUENCE_OF(struct StatisticsData) list; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } statisticsData; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} StatisticsMessage_t; + } StatisticsMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_StatisticsMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_StatisticsMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/SubscriptionRequestMessage.c b/src/third_party/asn1/SubscriptionRequestMessage.c index f6f7bf8d..b13de146 100644 --- a/src/third_party/asn1/SubscriptionRequestMessage.c +++ b/src/third_party/asn1/SubscriptionRequestMessage.c @@ -9,7 +9,7 @@ static int subscriptionAction_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ subscriptionAction_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void subscriptionAction_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { subscriptionAction_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int subscriptionAction_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { subscriptionAction_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t subscriptionAction_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { subscriptionAction_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t subscriptionAction_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { subscriptionAction_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t subscriptionAction_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { subscriptionAction_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t subscriptionAction_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { subscriptionAction_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -115,17 +115,17 @@ asn_TYPE_descriptor_t asn_DEF_subscriptionAction_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_subscriptionAction_tags_2, sizeof(asn_DEF_subscriptionAction_tags_2) - /sizeof(asn_DEF_subscriptionAction_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_subscriptionAction_tags_2[0]), /* 1 */ asn_DEF_subscriptionAction_tags_2, /* Same as above */ sizeof(asn_DEF_subscriptionAction_tags_2) - /sizeof(asn_DEF_subscriptionAction_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_subscriptionAction_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_subscriptionAction_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_SubscriptionRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct SubscriptionRequestMessage, subscriptionAction), + { ATF_NOFLAGS, 0, offsetof(struct SubscriptionRequestMessage, subscriptionAction), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_subscriptionAction_2, @@ -133,14 +133,14 @@ static asn_TYPE_member_t asn_MBR_SubscriptionRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "subscriptionAction" - }, + }, }; static ber_tlv_tag_t asn_DEF_SubscriptionRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (10 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_SubscriptionRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* subscriptionAction at 274 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* subscriptionAction at 275 */ }; static asn_SEQUENCE_specifics_t asn_SPC_SubscriptionRequestMessage_specs_1 = { sizeof(struct SubscriptionRequestMessage), @@ -165,10 +165,10 @@ asn_TYPE_descriptor_t asn_DEF_SubscriptionRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_SubscriptionRequestMessage_tags_1, sizeof(asn_DEF_SubscriptionRequestMessage_tags_1) - /sizeof(asn_DEF_SubscriptionRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_SubscriptionRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_SubscriptionRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_SubscriptionRequestMessage_tags_1) - /sizeof(asn_DEF_SubscriptionRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_SubscriptionRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_SubscriptionRequestMessage_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/SubscriptionRequestMessage.h b/src/third_party/asn1/SubscriptionRequestMessage.h index 3f55aa38..913bcc32 100644 --- a/src/third_party/asn1/SubscriptionRequestMessage.h +++ b/src/third_party/asn1/SubscriptionRequestMessage.h @@ -19,27 +19,28 @@ extern "C" { #endif -/* Dependencies */ -typedef enum subscriptionAction { - subscriptionAction_unsubscribeGameList = 1, - subscriptionAction_resubscribeGameList = 2 -} e_subscriptionAction; + /* Dependencies */ + typedef enum subscriptionAction { + subscriptionAction_unsubscribeGameList = 1, + subscriptionAction_resubscribeGameList = 2 + } + e_subscriptionAction; -/* SubscriptionRequestMessage */ -typedef struct SubscriptionRequestMessage { - long subscriptionAction; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} SubscriptionRequestMessage_t; + /* SubscriptionRequestMessage */ + typedef struct SubscriptionRequestMessage { + long subscriptionAction; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_subscriptionAction_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_SubscriptionRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } SubscriptionRequestMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_subscriptionAction_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_SubscriptionRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/TimeoutWarningMessage.c b/src/third_party/asn1/TimeoutWarningMessage.c index 40a74e10..8df901a9 100644 --- a/src/third_party/asn1/TimeoutWarningMessage.c +++ b/src/third_party/asn1/TimeoutWarningMessage.c @@ -9,7 +9,7 @@ static int timeoutReason_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ timeoutReason_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void timeoutReason_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { timeoutReason_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int timeoutReason_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { timeoutReason_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t timeoutReason_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { timeoutReason_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t timeoutReason_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { timeoutReason_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t timeoutReason_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { timeoutReason_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t timeoutReason_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { timeoutReason_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -115,17 +115,17 @@ asn_TYPE_descriptor_t asn_DEF_timeoutReason_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_timeoutReason_tags_2, sizeof(asn_DEF_timeoutReason_tags_2) - /sizeof(asn_DEF_timeoutReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_timeoutReason_tags_2[0]), /* 1 */ asn_DEF_timeoutReason_tags_2, /* Same as above */ sizeof(asn_DEF_timeoutReason_tags_2) - /sizeof(asn_DEF_timeoutReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_timeoutReason_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_timeoutReason_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_TimeoutWarningMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct TimeoutWarningMessage, timeoutReason), + { ATF_NOFLAGS, 0, offsetof(struct TimeoutWarningMessage, timeoutReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_timeoutReason_2, @@ -133,8 +133,8 @@ static asn_TYPE_member_t asn_MBR_TimeoutWarningMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "timeoutReason" - }, - { ATF_NOFLAGS, 0, offsetof(struct TimeoutWarningMessage, remainingSeconds), + }, + { ATF_NOFLAGS, 0, offsetof(struct TimeoutWarningMessage, remainingSeconds), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -142,15 +142,15 @@ static asn_TYPE_member_t asn_MBR_TimeoutWarningMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "remainingSeconds" - }, + }, }; static ber_tlv_tag_t asn_DEF_TimeoutWarningMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (133 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_TimeoutWarningMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 712 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 708 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* remainingSeconds at 735 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* timeoutReason at 731 */ }; static asn_SEQUENCE_specifics_t asn_SPC_TimeoutWarningMessage_specs_1 = { sizeof(struct TimeoutWarningMessage), @@ -175,10 +175,10 @@ asn_TYPE_descriptor_t asn_DEF_TimeoutWarningMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_TimeoutWarningMessage_tags_1, sizeof(asn_DEF_TimeoutWarningMessage_tags_1) - /sizeof(asn_DEF_TimeoutWarningMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_TimeoutWarningMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_TimeoutWarningMessage_tags_1, /* Same as above */ sizeof(asn_DEF_TimeoutWarningMessage_tags_1) - /sizeof(asn_DEF_TimeoutWarningMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_TimeoutWarningMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_TimeoutWarningMessage_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/TimeoutWarningMessage.h b/src/third_party/asn1/TimeoutWarningMessage.h index c92f011f..bee21676 100644 --- a/src/third_party/asn1/TimeoutWarningMessage.h +++ b/src/third_party/asn1/TimeoutWarningMessage.h @@ -20,28 +20,29 @@ extern "C" { #endif -/* Dependencies */ -typedef enum timeoutReason { - timeoutReason_timeoutNoDataReceived = 0, - timeoutReason_timeoutInactiveGame = 1 -} e_timeoutReason; + /* Dependencies */ + typedef enum timeoutReason { + timeoutReason_timeoutNoDataReceived = 0, + timeoutReason_timeoutInactiveGame = 1 + } + e_timeoutReason; -/* TimeoutWarningMessage */ -typedef struct TimeoutWarningMessage { - long timeoutReason; - long remainingSeconds; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} TimeoutWarningMessage_t; + /* TimeoutWarningMessage */ + typedef struct TimeoutWarningMessage { + long timeoutReason; + long remainingSeconds; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_timeoutReason_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_TimeoutWarningMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } TimeoutWarningMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_timeoutReason_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_TimeoutWarningMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/UTF8String.c b/src/third_party/asn1/UTF8String.c index 7e73d775..b4b908bb 100644 --- a/src/third_party/asn1/UTF8String.c +++ b/src/third_party/asn1/UTF8String.c @@ -28,10 +28,10 @@ asn_TYPE_descriptor_t asn_DEF_UTF8String = { 0, /* Use generic outmost tag fetcher */ asn_DEF_UTF8String_tags, sizeof(asn_DEF_UTF8String_tags) - / sizeof(asn_DEF_UTF8String_tags[0]) - 1, + / sizeof(asn_DEF_UTF8String_tags[0]) - 1, asn_DEF_UTF8String_tags, sizeof(asn_DEF_UTF8String_tags) - / sizeof(asn_DEF_UTF8String_tags[0]), + / sizeof(asn_DEF_UTF8String_tags[0]), 0, /* No PER visible constraints */ 0, 0, /* No members */ 0 /* No specifics */ @@ -42,23 +42,25 @@ asn_TYPE_descriptor_t asn_DEF_UTF8String = { * The second half of this table is only applicable to the long sequences. */ static int UTF8String_ht[2][16] = { - { /* 0x0 ... 0x7 */ - /* 0000..0111 */ - 1, 1, 1, 1, 1, 1, 1, 1, - /* 1000..1011(0), 1100..1101(2), 1110(3), 1111(-1) */ - 0, 0, 0, 0, 2, 2, 3, -1 }, - { /* 0xF0 .. 0xF7 */ - /* 11110000..11110111 */ - 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 6, 6, -1, -1 } + { /* 0x0 ... 0x7 */ + /* 0000..0111 */ + 1, 1, 1, 1, 1, 1, 1, 1, + /* 1000..1011(0), 1100..1101(2), 1110(3), 1111(-1) */ + 0, 0, 0, 0, 2, 2, 3, -1 + }, + { /* 0xF0 .. 0xF7 */ + /* 11110000..11110111 */ + 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 6, 6, -1, -1 + } }; static int32_t UTF8String_mv[7] = { 0, 0, - 0x00000080, - 0x00000800, - 0x00010000, - 0x00200000, - 0x04000000 -}; + 0x00000080, + 0x00000800, + 0x00010000, + 0x00200000, + 0x04000000 + }; /* Internal aliases for return codes */ #define U8E_TRUNC -1 /* UTF-8 sequence truncated */ @@ -69,32 +71,32 @@ static int32_t UTF8String_mv[7] = { 0, 0, int UTF8String_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { ssize_t len = UTF8String_length((const UTF8String_t *)sptr); switch(len) { case U8E_EINVAL: _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given", td->name); + "%s: value not given", td->name); break; case U8E_TRUNC: _ASN_CTFAIL(app_key, td, sptr, - "%s: truncated UTF-8 sequence (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: truncated UTF-8 sequence (%s:%d)", + td->name, __FILE__, __LINE__); break; case U8E_ILLSTART: _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8 illegal start of encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8 illegal start of encoding (%s:%d)", + td->name, __FILE__, __LINE__); break; case U8E_NOTCONT: _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8 not continuation (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8 not continuation (%s:%d)", + td->name, __FILE__, __LINE__); break; case U8E_NOTMIN: _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8 not minimal sequence (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8 not minimal sequence (%s:%d)", + td->name, __FILE__, __LINE__); break; } return (len < 0) ? -1 : 0; @@ -170,7 +172,7 @@ UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen) { int UTF8String_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; (void)td; /* Unused argument */ diff --git a/src/third_party/asn1/UTF8String.h b/src/third_party/asn1/UTF8String.h index 3bc8ea69..475347ff 100644 --- a/src/third_party/asn1/UTF8String.h +++ b/src/third_party/asn1/UTF8String.h @@ -11,36 +11,36 @@ extern "C" { #endif -typedef OCTET_STRING_t UTF8String_t; /* Implemented via OCTET STRING */ + typedef OCTET_STRING_t UTF8String_t; /* Implemented via OCTET STRING */ -extern asn_TYPE_descriptor_t asn_DEF_UTF8String; + extern asn_TYPE_descriptor_t asn_DEF_UTF8String; -asn_struct_print_f UTF8String_print; -asn_constr_check_f UTF8String_constraint; + asn_struct_print_f UTF8String_print; + asn_constr_check_f UTF8String_constraint; -/* - * Returns length of the given UTF-8 string in characters, - * or a negative error code: - * -1: UTF-8 sequence truncated - * -2: Illegal UTF-8 sequence start - * -3: Continuation expectation failed - * -4: Not minimal length encoding - * -5: Invalid arguments - */ -ssize_t UTF8String_length(const UTF8String_t *st); + /* + * Returns length of the given UTF-8 string in characters, + * or a negative error code: + * -1: UTF-8 sequence truncated + * -2: Illegal UTF-8 sequence start + * -3: Continuation expectation failed + * -4: Not minimal length encoding + * -5: Invalid arguments + */ + ssize_t UTF8String_length(const UTF8String_t *st); -/* - * Convert the UTF-8 string into a sequence of wide characters. - * Returns the number of characters necessary. - * Returned value might be greater than dstlen. - * In case of conversion error, 0 is returned. - * - * If st points to a valid UTF-8 string, calling - * UTF8String_to_wcs(st, 0, 0); - * is equivalent to - * UTF8String_length(const UTF8String_t *st); - */ -size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen); + /* + * Convert the UTF-8 string into a sequence of wide characters. + * Returns the number of characters necessary. + * Returned value might be greater than dstlen. + * In case of conversion error, 0 is returned. + * + * If st points to a valid UTF-8 string, calling + * UTF8String_to_wcs(st, 0, 0); + * is equivalent to + * UTF8String_length(const UTF8String_t *st); + */ + size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen); #ifdef __cplusplus } diff --git a/src/third_party/asn1/UnauthenticatedLogin.c b/src/third_party/asn1/UnauthenticatedLogin.c index bdc11f93..419ebd4d 100644 --- a/src/third_party/asn1/UnauthenticatedLogin.c +++ b/src/third_party/asn1/UnauthenticatedLogin.c @@ -9,38 +9,38 @@ static int memb_nickName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { const UTF8String_t *st = (const UTF8String_t *)sptr; size_t size; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + size = UTF8String_length(st); if((ssize_t)size < 0) { _ASN_CTFAIL(app_key, td, sptr, - "%s: UTF-8: broken encoding (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: UTF-8: broken encoding (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + if((size >= 1 && size <= 64)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_UnauthenticatedLogin_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct UnauthenticatedLogin, nickName), + { ATF_NOFLAGS, 0, offsetof(struct UnauthenticatedLogin, nickName), (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, &asn_DEF_UTF8String, @@ -48,8 +48,8 @@ static asn_TYPE_member_t asn_MBR_UnauthenticatedLogin_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "nickName" - }, - { ATF_POINTER, 1, offsetof(struct UnauthenticatedLogin, avatar), + }, + { ATF_POINTER, 1, offsetof(struct UnauthenticatedLogin, avatar), (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 0, &asn_DEF_AvatarHash, @@ -57,14 +57,14 @@ static asn_TYPE_member_t asn_MBR_UnauthenticatedLogin_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "avatar" - }, + }, }; static ber_tlv_tag_t asn_DEF_UnauthenticatedLogin_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_UnauthenticatedLogin_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* avatar at 123 */ - { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* nickName at 122 */ + { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* avatar at 124 */ + { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 0, 0, 0 } /* nickName at 123 */ }; static asn_SEQUENCE_specifics_t asn_SPC_UnauthenticatedLogin_specs_1 = { sizeof(struct UnauthenticatedLogin), @@ -89,10 +89,10 @@ asn_TYPE_descriptor_t asn_DEF_UnauthenticatedLogin = { 0, /* Use generic outmost tag fetcher */ asn_DEF_UnauthenticatedLogin_tags_1, sizeof(asn_DEF_UnauthenticatedLogin_tags_1) - /sizeof(asn_DEF_UnauthenticatedLogin_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_UnauthenticatedLogin_tags_1[0]), /* 1 */ asn_DEF_UnauthenticatedLogin_tags_1, /* Same as above */ sizeof(asn_DEF_UnauthenticatedLogin_tags_1) - /sizeof(asn_DEF_UnauthenticatedLogin_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_UnauthenticatedLogin_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_UnauthenticatedLogin_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/UnauthenticatedLogin.h b/src/third_party/asn1/UnauthenticatedLogin.h index 5b54d691..fe4ac648 100644 --- a/src/third_party/asn1/UnauthenticatedLogin.h +++ b/src/third_party/asn1/UnauthenticatedLogin.h @@ -20,21 +20,21 @@ extern "C" { #endif -/* UnauthenticatedLogin */ -typedef struct UnauthenticatedLogin { - UTF8String_t nickName; - AvatarHash_t *avatar /* OPTIONAL */; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} UnauthenticatedLogin_t; + /* UnauthenticatedLogin */ + typedef struct UnauthenticatedLogin { + UTF8String_t nickName; + AvatarHash_t *avatar /* OPTIONAL */; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UnauthenticatedLogin; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } UnauthenticatedLogin_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UnauthenticatedLogin; #ifdef __cplusplus } diff --git a/src/third_party/asn1/UnknownAvatar.c b/src/third_party/asn1/UnknownAvatar.c index 94eb1d96..da73c517 100644 --- a/src/third_party/asn1/UnknownAvatar.c +++ b/src/third_party/asn1/UnknownAvatar.c @@ -33,10 +33,10 @@ asn_TYPE_descriptor_t asn_DEF_UnknownAvatar = { 0, /* Use generic outmost tag fetcher */ asn_DEF_UnknownAvatar_tags_1, sizeof(asn_DEF_UnknownAvatar_tags_1) - /sizeof(asn_DEF_UnknownAvatar_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_UnknownAvatar_tags_1[0]), /* 1 */ asn_DEF_UnknownAvatar_tags_1, /* Same as above */ sizeof(asn_DEF_UnknownAvatar_tags_1) - /sizeof(asn_DEF_UnknownAvatar_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_UnknownAvatar_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_UnknownAvatar_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/UnknownAvatar.h b/src/third_party/asn1/UnknownAvatar.h index 116c5008..16089cb7 100644 --- a/src/third_party/asn1/UnknownAvatar.h +++ b/src/third_party/asn1/UnknownAvatar.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* UnknownAvatar */ -typedef struct UnknownAvatar { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} UnknownAvatar_t; + /* UnknownAvatar */ + typedef struct UnknownAvatar { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UnknownAvatar; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } UnknownAvatar_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UnknownAvatar; #ifdef __cplusplus } diff --git a/src/third_party/asn1/UnknownPlayerInfo.c b/src/third_party/asn1/UnknownPlayerInfo.c index 1dbec7d9..2aee5848 100644 --- a/src/third_party/asn1/UnknownPlayerInfo.c +++ b/src/third_party/asn1/UnknownPlayerInfo.c @@ -33,10 +33,10 @@ asn_TYPE_descriptor_t asn_DEF_UnknownPlayerInfo = { 0, /* Use generic outmost tag fetcher */ asn_DEF_UnknownPlayerInfo_tags_1, sizeof(asn_DEF_UnknownPlayerInfo_tags_1) - /sizeof(asn_DEF_UnknownPlayerInfo_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_UnknownPlayerInfo_tags_1[0]), /* 1 */ asn_DEF_UnknownPlayerInfo_tags_1, /* Same as above */ sizeof(asn_DEF_UnknownPlayerInfo_tags_1) - /sizeof(asn_DEF_UnknownPlayerInfo_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_UnknownPlayerInfo_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_UnknownPlayerInfo_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/UnknownPlayerInfo.h b/src/third_party/asn1/UnknownPlayerInfo.h index 8bd79576..08be94be 100644 --- a/src/third_party/asn1/UnknownPlayerInfo.h +++ b/src/third_party/asn1/UnknownPlayerInfo.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* UnknownPlayerInfo */ -typedef struct UnknownPlayerInfo { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} UnknownPlayerInfo_t; + /* UnknownPlayerInfo */ + typedef struct UnknownPlayerInfo { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_UnknownPlayerInfo; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } UnknownPlayerInfo_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_UnknownPlayerInfo; #ifdef __cplusplus } diff --git a/src/third_party/asn1/Version.c b/src/third_party/asn1/Version.c index 4104d18f..0f7d29f4 100644 --- a/src/third_party/asn1/Version.c +++ b/src/third_party/asn1/Version.c @@ -9,56 +9,56 @@ static int memb_major_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 65535)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static int memb_minor_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 65535)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } static asn_TYPE_member_t asn_MBR_Version_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct Version, major), + { ATF_NOFLAGS, 0, offsetof(struct Version, major), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -66,8 +66,8 @@ static asn_TYPE_member_t asn_MBR_Version_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "major" - }, - { ATF_NOFLAGS, 0, offsetof(struct Version, minor), + }, + { ATF_NOFLAGS, 0, offsetof(struct Version, minor), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -75,14 +75,14 @@ static asn_TYPE_member_t asn_MBR_Version_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "minor" - }, + }, }; static ber_tlv_tag_t asn_DEF_Version_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_Version_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* major at 107 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* minor at 108 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* major at 108 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* minor at 109 */ }; static asn_SEQUENCE_specifics_t asn_SPC_Version_specs_1 = { sizeof(struct Version), @@ -107,10 +107,10 @@ asn_TYPE_descriptor_t asn_DEF_Version = { 0, /* Use generic outmost tag fetcher */ asn_DEF_Version_tags_1, sizeof(asn_DEF_Version_tags_1) - /sizeof(asn_DEF_Version_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_Version_tags_1[0]), /* 1 */ asn_DEF_Version_tags_1, /* Same as above */ sizeof(asn_DEF_Version_tags_1) - /sizeof(asn_DEF_Version_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_Version_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_Version_1, 2, /* Elements count */ diff --git a/src/third_party/asn1/Version.h b/src/third_party/asn1/Version.h index 7cccad74..3bfa4723 100644 --- a/src/third_party/asn1/Version.h +++ b/src/third_party/asn1/Version.h @@ -19,21 +19,21 @@ extern "C" { #endif -/* Version */ -typedef struct Version { - long major; - long minor; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} Version_t; + /* Version */ + typedef struct Version { + long major; + long minor; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_Version; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } Version_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_Version; #ifdef __cplusplus } diff --git a/src/third_party/asn1/VoteKickAck.c b/src/third_party/asn1/VoteKickAck.c index a6218967..1e361266 100644 --- a/src/third_party/asn1/VoteKickAck.c +++ b/src/third_party/asn1/VoteKickAck.c @@ -33,10 +33,10 @@ asn_TYPE_descriptor_t asn_DEF_VoteKickAck = { 0, /* Use generic outmost tag fetcher */ asn_DEF_VoteKickAck_tags_1, sizeof(asn_DEF_VoteKickAck_tags_1) - /sizeof(asn_DEF_VoteKickAck_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_VoteKickAck_tags_1[0]), /* 1 */ asn_DEF_VoteKickAck_tags_1, /* Same as above */ sizeof(asn_DEF_VoteKickAck_tags_1) - /sizeof(asn_DEF_VoteKickAck_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_VoteKickAck_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* No members */ &asn_SPC_VoteKickAck_specs_1 /* Additional specs */ diff --git a/src/third_party/asn1/VoteKickAck.h b/src/third_party/asn1/VoteKickAck.h index 5bcb3179..2696b4d4 100644 --- a/src/third_party/asn1/VoteKickAck.h +++ b/src/third_party/asn1/VoteKickAck.h @@ -18,19 +18,19 @@ extern "C" { #endif -/* VoteKickAck */ -typedef struct VoteKickAck { - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} VoteKickAck_t; + /* VoteKickAck */ + typedef struct VoteKickAck { + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_VoteKickAck; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } VoteKickAck_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_VoteKickAck; #ifdef __cplusplus } diff --git a/src/third_party/asn1/VoteKickDenied.c b/src/third_party/asn1/VoteKickDenied.c index 9ab32014..609152b6 100644 --- a/src/third_party/asn1/VoteKickDenied.c +++ b/src/third_party/asn1/VoteKickDenied.c @@ -9,7 +9,7 @@ static int voteKickDeniedReason_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,49 +33,49 @@ voteKickDeniedReason_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void voteKickDeniedReason_2_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { voteKickDeniedReason_2_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int voteKickDeniedReason_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { voteKickDeniedReason_2_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t voteKickDeniedReason_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { voteKickDeniedReason_2_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t voteKickDeniedReason_2_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { voteKickDeniedReason_2_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t voteKickDeniedReason_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { voteKickDeniedReason_2_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t voteKickDeniedReason_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { voteKickDeniedReason_2_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } @@ -115,17 +115,17 @@ asn_TYPE_descriptor_t asn_DEF_voteKickDeniedReason_2 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_voteKickDeniedReason_tags_2, sizeof(asn_DEF_voteKickDeniedReason_tags_2) - /sizeof(asn_DEF_voteKickDeniedReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_voteKickDeniedReason_tags_2[0]), /* 1 */ asn_DEF_voteKickDeniedReason_tags_2, /* Same as above */ sizeof(asn_DEF_voteKickDeniedReason_tags_2) - /sizeof(asn_DEF_voteKickDeniedReason_tags_2[0]), /* 1 */ + /sizeof(asn_DEF_voteKickDeniedReason_tags_2[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_voteKickDeniedReason_specs_2 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_VoteKickDenied_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct VoteKickDenied, voteKickDeniedReason), + { ATF_NOFLAGS, 0, offsetof(struct VoteKickDenied, voteKickDeniedReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_voteKickDeniedReason_2, @@ -133,13 +133,13 @@ static asn_TYPE_member_t asn_MBR_VoteKickDenied_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "voteKickDeniedReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_VoteKickDenied_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VoteKickDenied_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* voteKickDeniedReason at 610 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* voteKickDeniedReason at 633 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VoteKickDenied_specs_1 = { sizeof(struct VoteKickDenied), @@ -164,10 +164,10 @@ asn_TYPE_descriptor_t asn_DEF_VoteKickDenied = { 0, /* Use generic outmost tag fetcher */ asn_DEF_VoteKickDenied_tags_1, sizeof(asn_DEF_VoteKickDenied_tags_1) - /sizeof(asn_DEF_VoteKickDenied_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_VoteKickDenied_tags_1[0]), /* 1 */ asn_DEF_VoteKickDenied_tags_1, /* Same as above */ sizeof(asn_DEF_VoteKickDenied_tags_1) - /sizeof(asn_DEF_VoteKickDenied_tags_1[0]), /* 1 */ + /sizeof(asn_DEF_VoteKickDenied_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_VoteKickDenied_1, 1, /* Elements count */ diff --git a/src/third_party/asn1/VoteKickDenied.h b/src/third_party/asn1/VoteKickDenied.h index 9f29219f..9c1df434 100644 --- a/src/third_party/asn1/VoteKickDenied.h +++ b/src/third_party/asn1/VoteKickDenied.h @@ -19,27 +19,28 @@ extern "C" { #endif -/* Dependencies */ -typedef enum voteKickDeniedReason { - voteKickDeniedReason_voteKickDeniedInvalid = 0, - voteKickDeniedReason_voteKickDeniedAlreadyVoted = 1 -} e_voteKickDeniedReason; + /* Dependencies */ + typedef enum voteKickDeniedReason { + voteKickDeniedReason_voteKickDeniedInvalid = 0, + voteKickDeniedReason_voteKickDeniedAlreadyVoted = 1 + } + e_voteKickDeniedReason; -/* VoteKickDenied */ -typedef struct VoteKickDenied { - long voteKickDeniedReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} VoteKickDenied_t; + /* VoteKickDenied */ + typedef struct VoteKickDenied { + long voteKickDeniedReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_voteKickDeniedReason_2; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_VoteKickDenied; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } VoteKickDenied_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_voteKickDeniedReason_2; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_VoteKickDenied; #ifdef __cplusplus } diff --git a/src/third_party/asn1/VoteKickReplyMessage.c b/src/third_party/asn1/VoteKickReplyMessage.c index ad97b4db..85d2c79b 100644 --- a/src/third_party/asn1/VoteKickReplyMessage.c +++ b/src/third_party/asn1/VoteKickReplyMessage.c @@ -8,7 +8,7 @@ #include "VoteKickReplyMessage.h" static asn_TYPE_member_t asn_MBR_voteKickReplyType_4[] = { - { ATF_NOFLAGS, 0, offsetof(struct voteKickReplyType, choice.voteKickAck), + { ATF_NOFLAGS, 0, offsetof(struct voteKickReplyType, choice.voteKickAck), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_VoteKickAck, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_voteKickReplyType_4[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "voteKickAck" - }, - { ATF_NOFLAGS, 0, offsetof(struct voteKickReplyType, choice.voteKickDenied), + }, + { ATF_NOFLAGS, 0, offsetof(struct voteKickReplyType, choice.voteKickDenied), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_VoteKickDenied, @@ -25,11 +25,11 @@ static asn_TYPE_member_t asn_MBR_voteKickReplyType_4[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "voteKickDenied" - }, + }, }; static asn_TYPE_tag2member_t asn_MAP_voteKickReplyType_tag2el_4[] = { - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* voteKickAck at 600 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* voteKickDenied at 602 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* voteKickAck at 623 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* voteKickDenied at 625 */ }; static asn_CHOICE_specifics_t asn_SPC_voteKickReplyType_specs_4 = { sizeof(struct voteKickReplyType), @@ -65,7 +65,7 @@ asn_TYPE_descriptor_t asn_DEF_voteKickReplyType_4 = { }; static asn_TYPE_member_t asn_MBR_VoteKickReplyMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct VoteKickReplyMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct VoteKickReplyMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -73,8 +73,8 @@ static asn_TYPE_member_t asn_MBR_VoteKickReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct VoteKickReplyMessage, petitionId), + }, + { ATF_NOFLAGS, 0, offsetof(struct VoteKickReplyMessage, petitionId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -82,8 +82,8 @@ static asn_TYPE_member_t asn_MBR_VoteKickReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "petitionId" - }, - { ATF_NOFLAGS, 0, offsetof(struct VoteKickReplyMessage, voteKickReplyType), + }, + { ATF_NOFLAGS, 0, offsetof(struct VoteKickReplyMessage, voteKickReplyType), -1 /* Ambiguous tag (CHOICE?) */, 0, &asn_DEF_voteKickReplyType_4, @@ -91,17 +91,17 @@ static asn_TYPE_member_t asn_MBR_VoteKickReplyMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "voteKickReplyType" - }, + }, }; static ber_tlv_tag_t asn_DEF_VoteKickReplyMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (68 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VoteKickReplyMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 597 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* petitionId at 598 */ - { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* voteKickAck at 600 */ - { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* voteKickDenied at 602 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 620 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* petitionId at 621 */ + { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 2, 0, 0 }, /* voteKickAck at 623 */ + { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 2, 0, 0 } /* voteKickDenied at 625 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VoteKickReplyMessage_specs_1 = { sizeof(struct VoteKickReplyMessage), @@ -126,10 +126,10 @@ asn_TYPE_descriptor_t asn_DEF_VoteKickReplyMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_VoteKickReplyMessage_tags_1, sizeof(asn_DEF_VoteKickReplyMessage_tags_1) - /sizeof(asn_DEF_VoteKickReplyMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_VoteKickReplyMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_VoteKickReplyMessage_tags_1, /* Same as above */ sizeof(asn_DEF_VoteKickReplyMessage_tags_1) - /sizeof(asn_DEF_VoteKickReplyMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_VoteKickReplyMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_VoteKickReplyMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/VoteKickReplyMessage.h b/src/third_party/asn1/VoteKickReplyMessage.h index c6f06f9c..f01c5630 100644 --- a/src/third_party/asn1/VoteKickReplyMessage.h +++ b/src/third_party/asn1/VoteKickReplyMessage.h @@ -22,44 +22,45 @@ extern "C" { #endif -/* Dependencies */ -typedef enum voteKickReplyType_PR { - voteKickReplyType_PR_NOTHING, /* No components present */ - voteKickReplyType_PR_voteKickAck, - voteKickReplyType_PR_voteKickDenied, - /* Extensions may appear below */ - -} voteKickReplyType_PR; + /* Dependencies */ + typedef enum voteKickReplyType_PR { + voteKickReplyType_PR_NOTHING, /* No components present */ + voteKickReplyType_PR_voteKickAck, + voteKickReplyType_PR_voteKickDenied, + /* Extensions may appear below */ + + } + voteKickReplyType_PR; + + /* VoteKickReplyMessage */ + typedef struct VoteKickReplyMessage { + NonZeroId_t gameId; + NonZeroId_t petitionId; + struct voteKickReplyType { + voteKickReplyType_PR present; + union VoteKickReplyMessage__voteKickReplyType_u { + VoteKickAck_t voteKickAck; + VoteKickDenied_t voteKickDenied; + /* + * This type is extensible, + * possible extensions are below. + */ + } choice; + + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } voteKickReplyType; + /* + * This type is extensible, + * possible extensions are below. + */ -/* VoteKickReplyMessage */ -typedef struct VoteKickReplyMessage { - NonZeroId_t gameId; - NonZeroId_t petitionId; - struct voteKickReplyType { - voteKickReplyType_PR present; - union VoteKickReplyMessage__voteKickReplyType_u { - VoteKickAck_t voteKickAck; - VoteKickDenied_t voteKickDenied; - /* - * This type is extensible, - * possible extensions are below. - */ - } choice; - /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } voteKickReplyType; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} VoteKickReplyMessage_t; + } VoteKickReplyMessage_t; -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_VoteKickReplyMessage; + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_VoteKickReplyMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/VoteKickRequestMessage.c b/src/third_party/asn1/VoteKickRequestMessage.c index f43d1a47..b16040c7 100644 --- a/src/third_party/asn1/VoteKickRequestMessage.c +++ b/src/third_party/asn1/VoteKickRequestMessage.c @@ -8,7 +8,7 @@ #include "VoteKickRequestMessage.h" static asn_TYPE_member_t asn_MBR_VoteKickRequestMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct VoteKickRequestMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct VoteKickRequestMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -16,8 +16,8 @@ static asn_TYPE_member_t asn_MBR_VoteKickRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct VoteKickRequestMessage, petitionId), + }, + { ATF_NOFLAGS, 0, offsetof(struct VoteKickRequestMessage, petitionId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -25,8 +25,8 @@ static asn_TYPE_member_t asn_MBR_VoteKickRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "petitionId" - }, - { ATF_NOFLAGS, 0, offsetof(struct VoteKickRequestMessage, voteKick), + }, + { ATF_NOFLAGS, 0, offsetof(struct VoteKickRequestMessage, voteKick), (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, &asn_DEF_BOOLEAN, @@ -34,16 +34,16 @@ static asn_TYPE_member_t asn_MBR_VoteKickRequestMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "voteKick" - }, + }, }; static ber_tlv_tag_t asn_DEF_VoteKickRequestMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (67 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_VoteKickRequestMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 2, 0, 0 }, /* voteKick at 593 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 591 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* petitionId at 592 */ + { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 2, 0, 0 }, /* voteKick at 616 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 614 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* petitionId at 615 */ }; static asn_SEQUENCE_specifics_t asn_SPC_VoteKickRequestMessage_specs_1 = { sizeof(struct VoteKickRequestMessage), @@ -68,10 +68,10 @@ asn_TYPE_descriptor_t asn_DEF_VoteKickRequestMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_VoteKickRequestMessage_tags_1, sizeof(asn_DEF_VoteKickRequestMessage_tags_1) - /sizeof(asn_DEF_VoteKickRequestMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_VoteKickRequestMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_VoteKickRequestMessage_tags_1, /* Same as above */ sizeof(asn_DEF_VoteKickRequestMessage_tags_1) - /sizeof(asn_DEF_VoteKickRequestMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_VoteKickRequestMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_VoteKickRequestMessage_1, 3, /* Elements count */ diff --git a/src/third_party/asn1/VoteKickRequestMessage.h b/src/third_party/asn1/VoteKickRequestMessage.h index e886de03..cf1f0740 100644 --- a/src/third_party/asn1/VoteKickRequestMessage.h +++ b/src/third_party/asn1/VoteKickRequestMessage.h @@ -20,22 +20,22 @@ extern "C" { #endif -/* VoteKickRequestMessage */ -typedef struct VoteKickRequestMessage { - NonZeroId_t gameId; - NonZeroId_t petitionId; - BOOLEAN_t voteKick; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} VoteKickRequestMessage_t; + /* VoteKickRequestMessage */ + typedef struct VoteKickRequestMessage { + NonZeroId_t gameId; + NonZeroId_t petitionId; + BOOLEAN_t voteKick; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -extern asn_TYPE_descriptor_t asn_DEF_VoteKickRequestMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } VoteKickRequestMessage_t; + + /* Implementation */ + extern asn_TYPE_descriptor_t asn_DEF_VoteKickRequestMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/YourActionRejectedMessage.c b/src/third_party/asn1/YourActionRejectedMessage.c index 29516c21..99fe63f5 100644 --- a/src/third_party/asn1/YourActionRejectedMessage.c +++ b/src/third_party/asn1/YourActionRejectedMessage.c @@ -9,7 +9,7 @@ static int rejectionReason_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); @@ -33,74 +33,74 @@ rejectionReason_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; td->elements = asn_DEF_NativeEnumerated.elements; td->elements_count = asn_DEF_NativeEnumerated.elements_count; - /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void rejectionReason_6_free(asn_TYPE_descriptor_t *td, - void *struct_ptr, int contents_only) { + void *struct_ptr, int contents_only) { rejectionReason_6_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } static int rejectionReason_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, - int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { rejectionReason_6_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } static asn_dec_rval_t rejectionReason_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const void *bufptr, size_t size, int tag_mode) { + void **structure, const void *bufptr, size_t size, int tag_mode) { rejectionReason_6_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } static asn_enc_rval_t rejectionReason_6_encode_der(asn_TYPE_descriptor_t *td, - void *structure, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *structure, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { rejectionReason_6_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } static asn_dec_rval_t rejectionReason_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **structure, const char *opt_mname, const void *bufptr, size_t size) { + void **structure, const char *opt_mname, const void *bufptr, size_t size) { rejectionReason_6_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } static asn_enc_rval_t rejectionReason_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { rejectionReason_6_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } static int memb_yourRelativeBet_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; - + if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } - + value = *(const long *)sptr; - + if((value >= 0 && value <= 10000000)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: constraint failed (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: constraint failed (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -142,17 +142,17 @@ asn_TYPE_descriptor_t asn_DEF_rejectionReason_6 = { 0, /* Use generic outmost tag fetcher */ asn_DEF_rejectionReason_tags_6, sizeof(asn_DEF_rejectionReason_tags_6) - /sizeof(asn_DEF_rejectionReason_tags_6[0]), /* 1 */ + /sizeof(asn_DEF_rejectionReason_tags_6[0]), /* 1 */ asn_DEF_rejectionReason_tags_6, /* Same as above */ sizeof(asn_DEF_rejectionReason_tags_6) - /sizeof(asn_DEF_rejectionReason_tags_6[0]), /* 1 */ + /sizeof(asn_DEF_rejectionReason_tags_6[0]), /* 1 */ 0, /* No PER visible constraints */ 0, 0, /* Defined elsewhere */ &asn_SPC_rejectionReason_specs_6 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_YourActionRejectedMessage_1[] = { - { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, gameId), + { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, gameId), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NonZeroId, @@ -160,8 +160,8 @@ static asn_TYPE_member_t asn_MBR_YourActionRejectedMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameId" - }, - { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, gameState), + }, + { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, gameState), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetGameState, @@ -169,8 +169,8 @@ static asn_TYPE_member_t asn_MBR_YourActionRejectedMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "gameState" - }, - { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, yourAction), + }, + { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, yourAction), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_NetPlayerAction, @@ -178,8 +178,8 @@ static asn_TYPE_member_t asn_MBR_YourActionRejectedMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "yourAction" - }, - { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, yourRelativeBet), + }, + { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, yourRelativeBet), (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, &asn_DEF_NativeInteger, @@ -187,8 +187,8 @@ static asn_TYPE_member_t asn_MBR_YourActionRejectedMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "yourRelativeBet" - }, - { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, rejectionReason), + }, + { ATF_NOFLAGS, 0, offsetof(struct YourActionRejectedMessage, rejectionReason), (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_rejectionReason_6, @@ -196,18 +196,18 @@ static asn_TYPE_member_t asn_MBR_YourActionRejectedMessage_1[] = { 0, /* PER is not compiled, use -gen-PER */ 0, "rejectionReason" - }, + }, }; static ber_tlv_tag_t asn_DEF_YourActionRejectedMessage_tags_1[] = { (ASN_TAG_CLASS_APPLICATION | (26 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_YourActionRejectedMessage_tag2el_1[] = { - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 474 */ - { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -1, 0 }, /* yourRelativeBet at 477 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 2 }, /* gameState at 475 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, -1, 1 }, /* yourAction at 476 */ - { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, -2, 0 } /* rejectionReason at 479 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* gameId at 497 */ + { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 3, -1, 0 }, /* yourRelativeBet at 500 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 2 }, /* gameState at 498 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 2, -1, 1 }, /* yourAction at 499 */ + { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, -2, 0 } /* rejectionReason at 502 */ }; static asn_SEQUENCE_specifics_t asn_SPC_YourActionRejectedMessage_specs_1 = { sizeof(struct YourActionRejectedMessage), @@ -232,10 +232,10 @@ asn_TYPE_descriptor_t asn_DEF_YourActionRejectedMessage = { 0, /* Use generic outmost tag fetcher */ asn_DEF_YourActionRejectedMessage_tags_1, sizeof(asn_DEF_YourActionRejectedMessage_tags_1) - /sizeof(asn_DEF_YourActionRejectedMessage_tags_1[0]) - 1, /* 1 */ + /sizeof(asn_DEF_YourActionRejectedMessage_tags_1[0]) - 1, /* 1 */ asn_DEF_YourActionRejectedMessage_tags_1, /* Same as above */ sizeof(asn_DEF_YourActionRejectedMessage_tags_1) - /sizeof(asn_DEF_YourActionRejectedMessage_tags_1[0]), /* 2 */ + /sizeof(asn_DEF_YourActionRejectedMessage_tags_1[0]), /* 2 */ 0, /* No PER visible constraints */ asn_MBR_YourActionRejectedMessage_1, 5, /* Elements count */ diff --git a/src/third_party/asn1/YourActionRejectedMessage.h b/src/third_party/asn1/YourActionRejectedMessage.h index cac59d02..7c1f39e9 100644 --- a/src/third_party/asn1/YourActionRejectedMessage.h +++ b/src/third_party/asn1/YourActionRejectedMessage.h @@ -23,32 +23,33 @@ extern "C" { #endif -/* Dependencies */ -typedef enum rejectionReason { - rejectionReason_rejectedInvalidGameState = 1, - rejectionReason_rejectedNotYourTurn = 2, - rejectionReason_rejectedActionNotAllowed = 3 -} e_rejectionReason; + /* Dependencies */ + typedef enum rejectionReason { + rejectionReason_rejectedInvalidGameState = 1, + rejectionReason_rejectedNotYourTurn = 2, + rejectionReason_rejectedActionNotAllowed = 3 + } + e_rejectionReason; -/* YourActionRejectedMessage */ -typedef struct YourActionRejectedMessage { - NonZeroId_t gameId; - NetGameState_t gameState; - NetPlayerAction_t yourAction; - long yourRelativeBet; - long rejectionReason; - /* - * This type is extensible, - * possible extensions are below. - */ - - /* Context for parsing across buffer boundaries */ - asn_struct_ctx_t _asn_ctx; -} YourActionRejectedMessage_t; + /* YourActionRejectedMessage */ + typedef struct YourActionRejectedMessage { + NonZeroId_t gameId; + NetGameState_t gameState; + NetPlayerAction_t yourAction; + long yourRelativeBet; + long rejectionReason; + /* + * This type is extensible, + * possible extensions are below. + */ -/* Implementation */ -/* extern asn_TYPE_descriptor_t asn_DEF_rejectionReason_6; // (Use -fall-defs-global to expose) */ -extern asn_TYPE_descriptor_t asn_DEF_YourActionRejectedMessage; + /* Context for parsing across buffer boundaries */ + asn_struct_ctx_t _asn_ctx; + } YourActionRejectedMessage_t; + + /* Implementation */ + /* extern asn_TYPE_descriptor_t asn_DEF_rejectionReason_6; // (Use -fall-defs-global to expose) */ + extern asn_TYPE_descriptor_t asn_DEF_YourActionRejectedMessage; #ifdef __cplusplus } diff --git a/src/third_party/asn1/asn_SEQUENCE_OF.h b/src/third_party/asn1/asn_SEQUENCE_OF.h index e678f034..33eeb284 100644 --- a/src/third_party/asn1/asn_SEQUENCE_OF.h +++ b/src/third_party/asn1/asn_SEQUENCE_OF.h @@ -11,37 +11,37 @@ extern "C" { #endif -/* - * SEQUENCE OF is the same as SET OF with a tiny difference: - * the delete operation preserves the initial order of elements - * and thus MAY operate in non-constant time. - */ + /* + * SEQUENCE OF is the same as SET OF with a tiny difference: + * the delete operation preserves the initial order of elements + * and thus MAY operate in non-constant time. + */ #define A_SEQUENCE_OF(type) A_SET_OF(type) #define ASN_SEQUENCE_ADD(headptr, ptr) \ asn_sequence_add((headptr), (ptr)) -/*********************************************** - * Implementation of the SEQUENCE OF structure. - */ + /*********************************************** + * Implementation of the SEQUENCE OF structure. + */ #define asn_sequence_add asn_set_add #define asn_sequence_empty asn_set_empty -/* - * Delete the element from the set by its number (base 0). - * This is NOT a constant-time operation. - * The order of elements is preserved. - * If _do_free is given AND the (*free) is initialized, the element - * will be freed using the custom (*free) function as well. - */ -void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); + /* + * Delete the element from the set by its number (base 0). + * This is NOT a constant-time operation. + * The order of elements is preserved. + * If _do_free is given AND the (*free) is initialized, the element + * will be freed using the custom (*free) function as well. + */ + void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free); -/* - * Cope with different conversions requirements to/from void in C and C++. - * This is mostly useful for support library. - */ -typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; + /* + * Cope with different conversions requirements to/from void in C and C++. + * This is mostly useful for support library. + */ + typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_; #define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr)) #define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr)) diff --git a/src/third_party/asn1/asn_SET_OF.h b/src/third_party/asn1/asn_SET_OF.h index 7edf14b5..973b452f 100644 --- a/src/third_party/asn1/asn_SET_OF.h +++ b/src/third_party/asn1/asn_SET_OF.h @@ -20,38 +20,38 @@ extern "C" { #define ASN_SET_ADD(headptr, ptr) \ asn_set_add((headptr), (ptr)) -/******************************************* - * Implementation of the SET OF structure. - */ + /******************************************* + * Implementation of the SET OF structure. + */ -/* - * Add another structure into the set by its pointer. - * RETURN VALUES: - * 0 for success and -1/errno for failure. - */ -int asn_set_add(void *asn_set_of_x, void *ptr); + /* + * Add another structure into the set by its pointer. + * RETURN VALUES: + * 0 for success and -1/errno for failure. + */ + int asn_set_add(void *asn_set_of_x, void *ptr); -/* - * Delete the element from the set by its number (base 0). - * This is a constant-time operation. The order of elements before the - * deleted ones is guaranteed, the order of elements after the deleted - * one is NOT guaranteed. - * If _do_free is given AND the (*free) is initialized, the element - * will be freed using the custom (*free) function as well. - */ -void asn_set_del(void *asn_set_of_x, int number, int _do_free); + /* + * Delete the element from the set by its number (base 0). + * This is a constant-time operation. The order of elements before the + * deleted ones is guaranteed, the order of elements after the deleted + * one is NOT guaranteed. + * If _do_free is given AND the (*free) is initialized, the element + * will be freed using the custom (*free) function as well. + */ + void asn_set_del(void *asn_set_of_x, int number, int _do_free); -/* - * Empty the contents of the set. Will free the elements, if (*free) is given. - * Will NOT free the set itself. - */ -void asn_set_empty(void *asn_set_of_x); + /* + * Empty the contents of the set. Will free the elements, if (*free) is given. + * Will NOT free the set itself. + */ + void asn_set_empty(void *asn_set_of_x); -/* - * Cope with different conversions requirements to/from void in C and C++. - * This is mostly useful for support library. - */ -typedef A_SET_OF(void) asn_anonymous_set_; + /* + * Cope with different conversions requirements to/from void in C and C++. + * This is mostly useful for support library. + */ + typedef A_SET_OF(void) asn_anonymous_set_; #define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr)) #define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr)) diff --git a/src/third_party/asn1/asn_application.h b/src/third_party/asn1/asn_application.h index f40cd86a..c762dd92 100644 --- a/src/third_party/asn1/asn_application.h +++ b/src/third_party/asn1/asn_application.h @@ -15,28 +15,28 @@ extern "C" { #endif -/* - * Generic type of an application-defined callback to return various - * types of data to the application. - * EXPECTED RETURN VALUES: - * -1: Failed to consume bytes. Abort the mission. - * Non-negative return values indicate success, and ignored. - */ -typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, - void *application_specific_key); + /* + * Generic type of an application-defined callback to return various + * types of data to the application. + * EXPECTED RETURN VALUES: + * -1: Failed to consume bytes. Abort the mission. + * Non-negative return values indicate success, and ignored. + */ + typedef int (asn_app_consume_bytes_f)(const void *buffer, size_t size, + void *application_specific_key); -/* - * A callback of this type is called whenever constraint validation fails - * on some ASN.1 type. See "constraints.h" for more details on constraint - * validation. - * This callback specifies a descriptor of the ASN.1 type which failed - * the constraint check, as well as human readable message on what - * particular constraint has failed. - */ -typedef void (asn_app_constraint_failed_f)(void *application_specific_key, - struct asn_TYPE_descriptor_s *type_descriptor_which_failed, - const void *structure_which_failed_ptr, - const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); + /* + * A callback of this type is called whenever constraint validation fails + * on some ASN.1 type. See "constraints.h" for more details on constraint + * validation. + * This callback specifies a descriptor of the ASN.1 type which failed + * the constraint check, as well as human readable message on what + * particular constraint has failed. + */ + typedef void (asn_app_constraint_failed_f)(void *application_specific_key, + struct asn_TYPE_descriptor_s *type_descriptor_which_failed, + const void *structure_which_failed_ptr, + const char *error_message_format, ...) GCC_PRINTFLIKE(4, 5); #ifdef __cplusplus } diff --git a/src/third_party/asn1/asn_codecs.h b/src/third_party/asn1/asn_codecs.h index 4a251d94..fa4fac54 100644 --- a/src/third_party/asn1/asn_codecs.h +++ b/src/third_party/asn1/asn_codecs.h @@ -10,53 +10,53 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* - * This structure defines a set of parameters that may be passed - * to every ASN.1 encoder or decoder function. - * WARNING: if max_stack_size member is set, and you are calling the - * function pointers of the asn_TYPE_descriptor_t directly, - * this structure must be ALLOCATED ON THE STACK! - * If you can't always satisfy this requirement, use ber_decode(), - * xer_decode() and uper_decode() functions instead. - */ -typedef struct asn_codec_ctx_s { - /* - * Limit the decoder routines to use no (much) more stack than a given - * number of bytes. Most of decoders are stack-based, and this - * would protect against stack overflows if the number of nested - * encodings is high. - * The OCTET STRING, BIT STRING and ANY BER decoders are heap-based, - * and are safe from this kind of overflow. - * A value from getrlimit(RLIMIT_STACK) may be used to initialize - * this variable. Be careful in multithreaded environments, as the - * stack size is rather limited. - */ - size_t max_stack_size; /* 0 disables stack bounds checking */ -} asn_codec_ctx_t; - -/* - * Type of the return value of the encoding functions (der_encode, xer_encode). - */ -typedef struct asn_enc_rval_s { - /* - * Number of bytes encoded. - * -1 indicates failure to encode the structure. - * In this case, the members below this one are meaningful. - */ - ssize_t encoded; + struct asn_TYPE_descriptor_s; /* Forward declaration */ /* - * Members meaningful when (encoded == -1), for post mortem analysis. + * This structure defines a set of parameters that may be passed + * to every ASN.1 encoder or decoder function. + * WARNING: if max_stack_size member is set, and you are calling the + * function pointers of the asn_TYPE_descriptor_t directly, + * this structure must be ALLOCATED ON THE STACK! + * If you can't always satisfy this requirement, use ber_decode(), + * xer_decode() and uper_decode() functions instead. */ + typedef struct asn_codec_ctx_s { + /* + * Limit the decoder routines to use no (much) more stack than a given + * number of bytes. Most of decoders are stack-based, and this + * would protect against stack overflows if the number of nested + * encodings is high. + * The OCTET STRING, BIT STRING and ANY BER decoders are heap-based, + * and are safe from this kind of overflow. + * A value from getrlimit(RLIMIT_STACK) may be used to initialize + * this variable. Be careful in multithreaded environments, as the + * stack size is rather limited. + */ + size_t max_stack_size; /* 0 disables stack bounds checking */ + } asn_codec_ctx_t; - /* Type which cannot be encoded */ - struct asn_TYPE_descriptor_s *failed_type; + /* + * Type of the return value of the encoding functions (der_encode, xer_encode). + */ + typedef struct asn_enc_rval_s { + /* + * Number of bytes encoded. + * -1 indicates failure to encode the structure. + * In this case, the members below this one are meaningful. + */ + ssize_t encoded; - /* Pointer to the structure of that type */ - void *structure_ptr; -} asn_enc_rval_t; + /* + * Members meaningful when (encoded == -1), for post mortem analysis. + */ + + /* Type which cannot be encoded */ + struct asn_TYPE_descriptor_s *failed_type; + + /* Pointer to the structure of that type */ + void *structure_ptr; + } asn_enc_rval_t; #define _ASN_ENCODE_FAILED do { \ asn_enc_rval_t tmp_error; \ tmp_error.encoded = -1; \ @@ -71,23 +71,23 @@ typedef struct asn_enc_rval_s { return rval; \ } while(0) -/* - * Type of the return value of the decoding functions (ber_decode, xer_decode) - * - * Please note that the number of consumed bytes is ALWAYS meaningful, - * even if code==RC_FAIL. This is to indicate the number of successfully - * decoded bytes, hence providing a possibility to fail with more diagnostics - * (i.e., print the offending remainder of the buffer). - */ -enum asn_dec_rval_code_e { - RC_OK, /* Decoded successfully */ - RC_WMORE, /* More data expected, call again */ - RC_FAIL /* Failure to decode data */ -}; -typedef struct asn_dec_rval_s { - enum asn_dec_rval_code_e code; /* Result code */ - size_t consumed; /* Number of bytes consumed */ -} asn_dec_rval_t; + /* + * Type of the return value of the decoding functions (ber_decode, xer_decode) + * + * Please note that the number of consumed bytes is ALWAYS meaningful, + * even if code==RC_FAIL. This is to indicate the number of successfully + * decoded bytes, hence providing a possibility to fail with more diagnostics + * (i.e., print the offending remainder of the buffer). + */ + enum asn_dec_rval_code_e { + RC_OK, /* Decoded successfully */ + RC_WMORE, /* More data expected, call again */ + RC_FAIL /* Failure to decode data */ + }; + typedef struct asn_dec_rval_s { + enum asn_dec_rval_code_e code; /* Result code */ + size_t consumed; /* Number of bytes consumed */ + } asn_dec_rval_t; #define _ASN_DECODE_FAILED do { \ asn_dec_rval_t tmp_error; \ tmp_error.code = RC_FAIL; \ diff --git a/src/third_party/asn1/asn_codecs_prim.c b/src/third_party/asn1/asn_codecs_prim.c index 4e5c6393..3d1aa1d8 100644 --- a/src/third_party/asn1/asn_codecs_prim.c +++ b/src/third_party/asn1/asn_codecs_prim.c @@ -11,8 +11,8 @@ */ asn_dec_rval_t ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - void **sptr, const void *buf_ptr, size_t size, int tag_mode) { + asn_TYPE_descriptor_t *td, + void **sptr, const void *buf_ptr, size_t size, int tag_mode) { ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)*sptr; asn_dec_rval_t rval; ber_tlv_len_t length; @@ -27,13 +27,13 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, } ASN_DEBUG("Decoding %s as plain primitive (tm=%d)", - td->name, tag_mode); + td->name, tag_mode); /* * Check tags and extract value length. */ rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, - tag_mode, 0, &length, 0); + tag_mode, 0, &length, 0); if(rval.code != RC_OK) return rval; @@ -53,7 +53,7 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, st->size = (int)length; /* The following better be optimized away. */ if(sizeof(st->size) != sizeof(length) - && (ber_tlv_len_t)st->size != length) { + && (ber_tlv_len_t)st->size != length) { st->size = 0; _ASN_DECODE_FAILED; } @@ -71,8 +71,8 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, rval.consumed += length; ASN_DEBUG("Took %ld/%ld bytes to encode %s", - (long)rval.consumed, - (long)length, td->name); + (long)rval.consumed, + (long)length, td->name); return rval; } @@ -82,16 +82,16 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, */ asn_enc_rval_t der_encode_primitive(asn_TYPE_descriptor_t *td, void *sptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t erval; ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr; ASN_DEBUG("%s %s as a primitive type (tm=%d)", - cb?"Encoding":"Estimating", td->name, tag_mode); + cb?"Encoding":"Estimating", td->name, tag_mode); erval.encoded = der_write_tags(td, st->size, tag_mode, 0, tag, - cb, app_key); + cb, app_key); ASN_DEBUG("%s wrote tags %d", td->name, (int)erval.encoded); if(erval.encoded == -1) { erval.failed_type = td; @@ -116,7 +116,7 @@ der_encode_primitive(asn_TYPE_descriptor_t *td, void *sptr, void ASN__PRIMITIVE_TYPE_free(asn_TYPE_descriptor_t *td, void *sptr, - int contents_only) { + int contents_only) { ASN__PRIMITIVE_TYPE_t *st = (ASN__PRIMITIVE_TYPE_t *)sptr; if(!td || !sptr) @@ -159,7 +159,7 @@ xer_decode__unexpected_tag(void *key, const void *chunk_buf, size_t chunk_size) } bret = arg->prim_body_decoder(arg->type_descriptor, - arg->struct_key, chunk_buf, chunk_size); + arg->struct_key, chunk_buf, chunk_size); switch(bret) { case XPBD_SYSTEM_FAILURE: case XPBD_DECODER_LIMIT: @@ -204,7 +204,7 @@ xer_decode__body(void *key, const void *chunk_buf, size_t chunk_size, int have_m } bret = arg->prim_body_decoder(arg->type_descriptor, - arg->struct_key, chunk_buf, chunk_size); + arg->struct_key, chunk_buf, chunk_size); switch(bret) { case XPBD_SYSTEM_FAILURE: case XPBD_DECODER_LIMIT: @@ -224,13 +224,13 @@ xer_decode__body(void *key, const void *chunk_buf, size_t chunk_size, int have_m asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, - void **sptr, - size_t struct_size, - const char *opt_mname, - const void *buf_ptr, size_t size, - xer_primitive_body_decoder_f *prim_body_decoder -) { + asn_TYPE_descriptor_t *td, + void **sptr, + size_t struct_size, + const char *opt_mname, + const void *buf_ptr, size_t size, + xer_primitive_body_decoder_f *prim_body_decoder + ) { const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; asn_struct_ctx_t s_ctx; struct xdp_arg_s s_arg; @@ -252,22 +252,22 @@ xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, s_arg.want_more = 0; rc = xer_decode_general(opt_codec_ctx, &s_ctx, &s_arg, - xml_tag, buf_ptr, size, - xer_decode__unexpected_tag, xer_decode__body); + xml_tag, buf_ptr, size, + xer_decode__unexpected_tag, xer_decode__body); switch(rc.code) { case RC_OK: if(!s_arg.decoded_something) { char ch; ASN_DEBUG("Primitive body is not recognized, " - "supplying empty one"); + "supplying empty one"); /* * Decoding opportunity has come and gone. * Where's the result? * Try to feed with empty body, see if it eats it. */ if(prim_body_decoder(s_arg.type_descriptor, - s_arg.struct_key, &ch, 0) - != XPBD_BODY_CONSUMED) { + s_arg.struct_key, &ch, 0) + != XPBD_BODY_CONSUMED) { /* * This decoder does not like empty stuff. */ diff --git a/src/third_party/asn1/asn_codecs_prim.h b/src/third_party/asn1/asn_codecs_prim.h index 0f683fdd..f694ce12 100644 --- a/src/third_party/asn1/asn_codecs_prim.h +++ b/src/third_party/asn1/asn_codecs_prim.h @@ -11,40 +11,40 @@ extern "C" { #endif -typedef struct ASN__PRIMITIVE_TYPE_s { - uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ - int size; /* Size of the buffer */ -} ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ + typedef struct ASN__PRIMITIVE_TYPE_s { + uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */ + int size; /* Size of the buffer */ + } ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */ -asn_struct_free_f ASN__PRIMITIVE_TYPE_free; -ber_type_decoder_f ber_decode_primitive; -der_type_encoder_f der_encode_primitive; + asn_struct_free_f ASN__PRIMITIVE_TYPE_free; + ber_type_decoder_f ber_decode_primitive; + der_type_encoder_f der_encode_primitive; -/* - * A callback specification for the xer_decode_primitive() function below. - */ -enum xer_pbd_rval { - XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ - XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ - XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ - XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ - XPBD_BODY_CONSUMED /* Body is recognized and consumed */ -}; -typedef enum xer_pbd_rval (xer_primitive_body_decoder_f) + /* + * A callback specification for the xer_decode_primitive() function below. + */ + enum xer_pbd_rval { + XPBD_SYSTEM_FAILURE, /* System failure (memory shortage, etc) */ + XPBD_DECODER_LIMIT, /* Hit some decoder limitation or deficiency */ + XPBD_BROKEN_ENCODING, /* Encoding of a primitive body is broken */ + XPBD_NOT_BODY_IGNORE, /* Not a body format, but safe to ignore */ + XPBD_BODY_CONSUMED /* Body is recognized and consumed */ + }; + typedef enum xer_pbd_rval (xer_primitive_body_decoder_f) (asn_TYPE_descriptor_t *td, void *struct_ptr, - const void *chunk_buf, size_t chunk_size); + const void *chunk_buf, size_t chunk_size); -/* - * Specific function to decode simple primitive types. - * Also see xer_decode_general() in xer_decoder.h - */ -asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *type_descriptor, - void **struct_ptr, size_t struct_size, - const char *opt_mname, - const void *buf_ptr, size_t size, - xer_primitive_body_decoder_f *prim_body_decoder -); + /* + * Specific function to decode simple primitive types. + * Also see xer_decode_general() in xer_decoder.h + */ + asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, + asn_TYPE_descriptor_t *type_descriptor, + void **struct_ptr, size_t struct_size, + const char *opt_mname, + const void *buf_ptr, size_t size, + xer_primitive_body_decoder_f *prim_body_decoder + ); #ifdef __cplusplus } diff --git a/src/third_party/asn1/asn_internal.h b/src/third_party/asn1/asn_internal.h index 98669622..df58ba2f 100644 --- a/src/third_party/asn1/asn_internal.h +++ b/src/third_party/asn1/asn_internal.h @@ -19,26 +19,26 @@ extern "C" { #endif -/* Environment version might be used to avoid running with the old library */ + /* Environment version might be used to avoid running with the old library */ #define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */ -int get_asn1c_environment_version(void); /* Run-time version */ + int get_asn1c_environment_version(void); /* Run-time version */ #define CALLOC(nmemb, size) calloc(nmemb, size) #define MALLOC(size) malloc(size) #define REALLOC(oldptr, size) realloc(oldptr, size) #define FREEMEM(ptr) free(ptr) -/* - * A macro for debugging the ASN.1 internals. - * You may enable or override it. - */ + /* + * A macro for debugging the ASN.1 internals. + * You may enable or override it. + */ #ifndef ASN_DEBUG /* If debugging code is not defined elsewhere... */ #if EMIT_ASN_DEBUG == 1 /* And it was asked to emit this code... */ #ifdef __GNUC__ #ifdef ASN_THREAD_SAFE #define asn_debug_indent 0 #else /* !ASN_THREAD_SAFE */ -int asn_debug_indent; + int asn_debug_indent; #endif /* ASN_THREAD_SAFE */ #define ASN_DEBUG(fmt, args...) do { \ int adi = asn_debug_indent; \ @@ -48,17 +48,19 @@ int asn_debug_indent; __FILE__, __LINE__); \ } while(0) #else /* !__GNUC__ */ -void ASN_DEBUG_f(const char *fmt, ...); + void ASN_DEBUG_f(const char *fmt, ...); #define ASN_DEBUG ASN_DEBUG_f #endif /* __GNUC__ */ #else /* EMIT_ASN_DEBUG != 1 */ -static inline void ASN_DEBUG(const char *fmt, ...) { (void)fmt; } + static inline void ASN_DEBUG(const char *fmt, ...) { + (void)fmt; + } #endif /* EMIT_ASN_DEBUG */ #endif /* ASN_DEBUG */ -/* - * Invoke the application-supplied callback and fail, if something is wrong. - */ + /* + * Invoke the application-supplied callback and fail, if something is wrong. + */ #define __ASN_E_cbc(buf, size) (cb((buf), (size), app_key) < 0) #define _ASN_E_CALLBACK(foo) do { \ if(foo) goto cb_failed; \ @@ -90,27 +92,27 @@ static inline void ASN_DEBUG(const char *fmt, ...) { (void)fmt; } if(cb(" ", 4, app_key) < 0) return -1; \ } while(0) -/* - * Check stack against overflow, if limit is set. - */ + /* + * Check stack against overflow, if limit is set. + */ #define _ASN_DEFAULT_STACK_MAX (30000) -static inline int -_ASN_STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) { - if(ctx && ctx->max_stack_size) { + static inline int + _ASN_STACK_OVERFLOW_CHECK(asn_codec_ctx_t *ctx) { + if(ctx && ctx->max_stack_size) { - /* ctx MUST be allocated on the stack */ - ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); - if(usedstack > 0) usedstack = -usedstack; /* grows up! */ + /* ctx MUST be allocated on the stack */ + ptrdiff_t usedstack = ((char *)ctx - (char *)&ctx); + if(usedstack > 0) usedstack = -usedstack; /* grows up! */ - /* double negative required to avoid int wrap-around */ - if(usedstack < -(ptrdiff_t)ctx->max_stack_size) { - ASN_DEBUG("Stack limit %ld reached", - (long)ctx->max_stack_size); - return -1; + /* double negative required to avoid int wrap-around */ + if(usedstack < -(ptrdiff_t)ctx->max_stack_size) { + ASN_DEBUG("Stack limit %ld reached", + (long)ctx->max_stack_size); + return -1; + } } + return 0; } - return 0; -} #ifdef __cplusplus } diff --git a/src/third_party/asn1/ber_decoder.c b/src/third_party/asn1/ber_decoder.c index 601f66c0..2eabc6af 100644 --- a/src/third_party/asn1/ber_decoder.c +++ b/src/third_party/asn1/ber_decoder.c @@ -28,8 +28,8 @@ */ asn_dec_rval_t ber_decode(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *type_descriptor, - void **struct_ptr, const void *ptr, size_t size) { + asn_TYPE_descriptor_t *type_descriptor, + void **struct_ptr, const void *ptr, size_t size) { asn_codec_ctx_t s_codec_ctx; /* @@ -52,10 +52,10 @@ ber_decode(asn_codec_ctx_t *opt_codec_ctx, * Invoke type-specific decoder. */ return type_descriptor->ber_decoder(opt_codec_ctx, type_descriptor, - struct_ptr, /* Pointer to the destination structure */ - ptr, size, /* Buffer and its size */ - 0 /* Default tag mode is 0 */ - ); + struct_ptr, /* Pointer to the destination structure */ + ptr, size, /* Buffer and its size */ + 0 /* Default tag mode is 0 */ + ); } /* @@ -63,9 +63,9 @@ ber_decode(asn_codec_ctx_t *opt_codec_ctx, */ asn_dec_rval_t ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx, - const void *ptr, size_t size, int tag_mode, int last_tag_form, - ber_tlv_len_t *last_length, int *opt_tlv_form) { + asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx, + const void *ptr, size_t size, int tag_mode, int last_tag_form, + ber_tlv_len_t *last_length, int *opt_tlv_form) { ssize_t consumed_myself = 0; ssize_t tag_len; ssize_t len_len; @@ -90,7 +90,7 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, * B ::= [2] EXPLICIT T * Where T is defined as * T ::= [4] IMPLICIT SEQUENCE { ... } - * + * * Let's say, we are starting to decode type A, given the * following TLV stream: <5> <0>. What does this mean? * It means that the type A contains type T which is, @@ -106,10 +106,10 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, */ tagno = step /* Continuing where left previously */ - + (tag_mode==1?-1:0) - ; + + (tag_mode==1?-1:0) + ; ASN_DEBUG("ber_check_tags(%s, size=%ld, tm=%d, step=%d, tagno=%d)", - td->name, (long)size, tag_mode, step, tagno); + td->name, (long)size, tag_mode, step, tagno); /* assert(td->tags_count >= 1) May not be the case for CHOICE or ANY */ if(tag_mode == 0 && tagno == td->tags_count) { @@ -120,18 +120,22 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, */ tag_len = ber_fetch_tag(ptr, size, &tlv_tag); switch(tag_len) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); + case -1: + RETURN(RC_FAIL); + case 0: + RETURN(RC_WMORE); } tlv_constr = BER_TLV_CONSTRUCTED(ptr); len_len = ber_fetch_length(tlv_constr, - (const char *)ptr + tag_len, size - tag_len, &tlv_len); + (const char *)ptr + tag_len, size - tag_len, &tlv_len); switch(len_len) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); + case -1: + RETURN(RC_FAIL); + case 0: + RETURN(RC_WMORE); } ASN_DEBUG("Advancing %ld in ANY case", - (long)(tag_len + len_len)); + (long)(tag_len + len_len)); ADVANCE(tag_len + len_len); } else { assert(tagno < td->tags_count); /* At least one loop */ @@ -142,14 +146,16 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, * Fetch and process T from TLV. */ tag_len = ber_fetch_tag(ptr, size, &tlv_tag); - ASN_DEBUG("Fetching tag from {%p,%ld}: " - "len %ld, step %d, tagno %d got %s", - ptr, (long)size, - (long)tag_len, step, tagno, - ber_tlv_tag_string(tlv_tag)); + ASN_DEBUG("Fetching tag from {%p,%ld}: " + "len %ld, step %d, tagno %d got %s", + ptr, (long)size, + (long)tag_len, step, tagno, + ber_tlv_tag_string(tlv_tag)); switch(tag_len) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); + case -1: + RETURN(RC_FAIL); + case 0: + RETURN(RC_WMORE); } tlv_constr = BER_TLV_CONSTRUCTED(ptr); @@ -165,18 +171,18 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, * is supposed to look like. */ } else { - assert(tagno >= 0); /* Guaranteed by the code above */ - if(tlv_tag != td->tags[tagno]) { - /* - * Unexpected tag. Too bad. - */ - ASN_DEBUG("Expected: %s, " - "expectation failed (tn=%d, tm=%d)", - ber_tlv_tag_string(td->tags[tagno]), - tagno, tag_mode - ); - RETURN(RC_FAIL); - } + assert(tagno >= 0); /* Guaranteed by the code above */ + if(tlv_tag != td->tags[tagno]) { + /* + * Unexpected tag. Too bad. + */ + ASN_DEBUG("Expected: %s, " + "expectation failed (tn=%d, tm=%d)", + ber_tlv_tag_string(td->tags[tagno]), + tagno, tag_mode + ); + RETURN(RC_FAIL); + } } /* @@ -189,14 +195,14 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, if(tagno < (td->tags_count - 1)) { if(tlv_constr == 0) { ASN_DEBUG("tlv_constr = %d, expfail", - tlv_constr); + tlv_constr); RETURN(RC_FAIL); } } else { if(last_tag_form != tlv_constr - && last_tag_form != -1) { + && last_tag_form != -1) { ASN_DEBUG("last_tag_form %d != %d", - last_tag_form, tlv_constr); + last_tag_form, tlv_constr); RETURN(RC_FAIL); } } @@ -205,11 +211,13 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, * Fetch and process L from TLV. */ len_len = ber_fetch_length(tlv_constr, - (const char *)ptr + tag_len, size - tag_len, &tlv_len); + (const char *)ptr + tag_len, size - tag_len, &tlv_len); ASN_DEBUG("Fetchinig len = %ld", (long)len_len); switch(len_len) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); + case -1: + RETURN(RC_FAIL); + case 0: + RETURN(RC_WMORE); } /* @@ -227,7 +235,7 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, expect_00_terminators++; } else { ASN_DEBUG("Unexpected indefinite length " - "in a chain of definite lengths"); + "in a chain of definite lengths"); RETURN(RC_FAIL); } ADVANCE(tag_len + len_len); @@ -235,7 +243,7 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, } else { if(expect_00_terminators) { ASN_DEBUG("Unexpected definite length " - "in a chain of indefinite lengths"); + "in a chain of indefinite lengths"); RETURN(RC_FAIL); } } @@ -256,7 +264,7 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, * with the outer TLV's length value. */ ASN_DEBUG("Outer TLV is %ld and inner is %ld", - (long)limit_len, (long)tlv_len); + (long)limit_len, (long)tlv_len); RETURN(RC_FAIL); } diff --git a/src/third_party/asn1/ber_decoder.h b/src/third_party/asn1/ber_decoder.h index 9fe2e895..8012c41e 100644 --- a/src/third_party/asn1/ber_decoder.h +++ b/src/third_party/asn1/ber_decoder.h @@ -11,50 +11,50 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_codec_ctx_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_codec_ctx_s; /* Forward declaration */ -/* - * The BER decoder of any type. - * This function may be invoked directly from the application. - * The der_encode() function (der_encoder.h) is an opposite to ber_decode(). - */ -asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of that buffer */ - ); + /* + * The BER decoder of any type. + * This function may be invoked directly from the application. + * The der_encode() function (der_encoder.h) is an opposite to ber_decode(). + */ + asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of that buffer */ + ); -/* - * Type of generic function which decodes the byte stream into the structure. - */ -typedef asn_dec_rval_t (ber_type_decoder_f)( - struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, const void *buf_ptr, size_t size, - int tag_mode); + /* + * Type of generic function which decodes the byte stream into the structure. + */ + typedef asn_dec_rval_t (ber_type_decoder_f)( + struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, const void *buf_ptr, size_t size, + int tag_mode); -/******************************* - * INTERNALLY USEFUL FUNCTIONS * - *******************************/ + /******************************* + * INTERNALLY USEFUL FUNCTIONS * + *******************************/ -/* - * Check that all tags correspond to the type definition (as given in head). - * On return, last_length would contain either a non-negative length of the - * value part of the last TLV, or the negative number of expected - * "end of content" sequences. The number may only be negative if the - * head->last_tag_form is non-zero. - */ -asn_dec_rval_t ber_check_tags( - struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ - struct asn_TYPE_descriptor_s *type_descriptor, - asn_struct_ctx_t *opt_ctx, /* saved decoding context */ - const void *ptr, size_t size, - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - int last_tag_form, /* {-1,0:1}: any, primitive, constr */ - ber_tlv_len_t *last_length, - int *opt_tlv_form /* optional tag form */ + /* + * Check that all tags correspond to the type definition (as given in head). + * On return, last_length would contain either a non-negative length of the + * value part of the last TLV, or the negative number of expected + * "end of content" sequences. The number may only be negative if the + * head->last_tag_form is non-zero. + */ + asn_dec_rval_t ber_check_tags( + struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ + struct asn_TYPE_descriptor_s *type_descriptor, + asn_struct_ctx_t *opt_ctx, /* saved decoding context */ + const void *ptr, size_t size, + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + int last_tag_form, /* {-1,0:1}: any, primitive, constr */ + ber_tlv_len_t *last_length, + int *opt_tlv_form /* optional tag form */ ); #ifdef __cplusplus diff --git a/src/third_party/asn1/ber_tlv_length.c b/src/third_party/asn1/ber_tlv_length.c index b87e75e0..b49e5dbc 100644 --- a/src/third_party/asn1/ber_tlv_length.c +++ b/src/third_party/asn1/ber_tlv_length.c @@ -8,7 +8,7 @@ ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, - ber_tlv_len_t *len_r) { + ber_tlv_len_t *len_r) { const uint8_t *buf = (const uint8_t *)bufptr; unsigned oct; @@ -38,11 +38,11 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, oct &= 0x7F; /* Leave only the 7 LS bits */ for(len = 0, buf++, skipped = 1; - oct && (++skipped <= size); buf++, oct--) { + oct && (++skipped <= size); buf++, oct--) { len = (len << 8) | *buf; if(len < 0 - || (len >> ((8 * sizeof(len)) - 8) && oct > 1)) { + || (len >> ((8 * sizeof(len)) - 8) && oct > 1)) { /* * Too large length value. */ @@ -76,7 +76,7 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, ssize_t ber_skip_length(asn_codec_ctx_t *opt_codec_ctx, - int _is_constructed, const void *ptr, size_t size) { + int _is_constructed, const void *ptr, size_t size) { ber_tlv_len_t vlen; /* Length of V in TLV */ ssize_t tl; /* Length of L in TLV */ ssize_t ll; /* Length of L in TLV */ @@ -116,8 +116,8 @@ ber_skip_length(asn_codec_ctx_t *opt_codec_ctx, if(tl <= 0) return tl; ll = ber_skip_length(opt_codec_ctx, - BER_TLV_CONSTRUCTED(ptr), - ((const char *)ptr) + tl, size - tl); + BER_TLV_CONSTRUCTED(ptr), + ((const char *)ptr) + tl, size - tl); if(ll <= 0) return ll; skip += tl + ll; @@ -128,12 +128,12 @@ ber_skip_length(asn_codec_ctx_t *opt_codec_ctx, * Check if it is true. */ if(((const uint8_t *)ptr)[0] == 0 - && ((const uint8_t *)ptr)[1] == 0) + && ((const uint8_t *)ptr)[1] == 0) return skip; ptr = ((const char *)ptr) + tl + ll; size -= tl + ll; - } + } /* UNREACHABLE */ } diff --git a/src/third_party/asn1/ber_tlv_length.h b/src/third_party/asn1/ber_tlv_length.h index 34968022..2d1648e8 100644 --- a/src/third_party/asn1/ber_tlv_length.h +++ b/src/third_party/asn1/ber_tlv_length.h @@ -9,39 +9,39 @@ extern "C" { #endif -typedef ssize_t ber_tlv_len_t; + typedef ssize_t ber_tlv_len_t; -/* - * This function tries to fetch the length of the BER TLV value and place it - * in *len_r. - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering length. - * >0: Number of bytes used from bufptr. - * On return with >0, len_r is constrained as -1..MAX, where -1 mean - * that the value is of indefinite length. - */ -ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, - ber_tlv_len_t *len_r); + /* + * This function tries to fetch the length of the BER TLV value and place it + * in *len_r. + * RETURN VALUES: + * 0: More data expected than bufptr contains. + * -1: Fatal error deciphering length. + * >0: Number of bytes used from bufptr. + * On return with >0, len_r is constrained as -1..MAX, where -1 mean + * that the value is of indefinite length. + */ + ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size, + ber_tlv_len_t *len_r); -/* - * This function expects bufptr to be positioned over L in TLV. - * It returns number of bytes occupied by L and V together, suitable - * for skipping. The function properly handles indefinite length. - * RETURN VALUES: - * Standard {-1,0,>0} convention. - */ -ssize_t ber_skip_length( - struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ - int _is_constructed, const void *bufptr, size_t size); + /* + * This function expects bufptr to be positioned over L in TLV. + * It returns number of bytes occupied by L and V together, suitable + * for skipping. The function properly handles indefinite length. + * RETURN VALUES: + * Standard {-1,0,>0} convention. + */ + ssize_t ber_skip_length( + struct asn_codec_ctx_s *opt_codec_ctx, /* optional context */ + int _is_constructed, const void *bufptr, size_t size); -/* - * This function serializes the length (L from TLV) in DER format. - * It always returns number of bytes necessary to represent the length, - * it is a caller's responsibility to check the return value - * against the supplied buffer's size. - */ -size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); + /* + * This function serializes the length (L from TLV) in DER format. + * It always returns number of bytes necessary to represent the length, + * it is a caller's responsibility to check the return value + * against the supplied buffer's size. + */ + size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size); #ifdef __cplusplus } diff --git a/src/third_party/asn1/ber_tlv_tag.c b/src/third_party/asn1/ber_tlv_tag.c index 42708760..2ddcb161 100644 --- a/src/third_party/asn1/ber_tlv_tag.c +++ b/src/third_party/asn1/ber_tlv_tag.c @@ -31,8 +31,8 @@ ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) { * The MSB is 0 if it is the last octet of the tag. */ for(val = 0, ptr = ((const char *)ptr) + 1, skipped = 2; - skipped <= size; - ptr = ((const char *)ptr) + 1, skipped++) { + skipped <= size; + ptr = ((const char *)ptr) + 1, skipped++) { unsigned int oct = *(const uint8_t *)ptr; if(oct & 0x80) { val = (val << 7) | (oct & 0x7F); @@ -78,10 +78,18 @@ ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size) { int ret; switch(tag & 0x3) { - case ASN_TAG_CLASS_UNIVERSAL: type = "UNIVERSAL "; break; - case ASN_TAG_CLASS_APPLICATION: type = "APPLICATION "; break; - case ASN_TAG_CLASS_CONTEXT: type = ""; break; - case ASN_TAG_CLASS_PRIVATE: type = "PRIVATE "; break; + case ASN_TAG_CLASS_UNIVERSAL: + type = "UNIVERSAL "; + break; + case ASN_TAG_CLASS_APPLICATION: + type = "APPLICATION "; + break; + case ASN_TAG_CLASS_CONTEXT: + type = ""; + break; + case ASN_TAG_CLASS_PRIVATE: + type = "PRIVATE "; + break; } ret = snprintf(buf, size, "[%s%u]", type, ((unsigned)tag) >> 2); diff --git a/src/third_party/asn1/ber_tlv_tag.h b/src/third_party/asn1/ber_tlv_tag.h index 60e86686..443dde52 100644 --- a/src/third_party/asn1/ber_tlv_tag.h +++ b/src/third_party/asn1/ber_tlv_tag.h @@ -9,49 +9,49 @@ extern "C" { #endif -enum asn_tag_class { - ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ - ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ - ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ - ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ -}; -typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ + enum asn_tag_class { + ASN_TAG_CLASS_UNIVERSAL = 0, /* 0b00 */ + ASN_TAG_CLASS_APPLICATION = 1, /* 0b01 */ + ASN_TAG_CLASS_CONTEXT = 2, /* 0b10 */ + ASN_TAG_CLASS_PRIVATE = 3 /* 0b11 */ + }; + typedef unsigned ber_tlv_tag_t; /* BER TAG from Tag-Length-Value */ -/* - * Tag class is encoded together with tag value for optimization purposes. - */ + /* + * Tag class is encoded together with tag value for optimization purposes. + */ #define BER_TAG_CLASS(tag) ((tag) & 0x3) #define BER_TAG_VALUE(tag) ((tag) >> 2) #define BER_TLV_CONSTRUCTED(tagptr) (((*(const uint8_t *)tagptr)&0x20)?1:0) #define BER_TAGS_EQUAL(tag1, tag2) ((tag1) == (tag2)) -/* - * Several functions for printing the TAG in the canonical form - * (i.e. "[PRIVATE 0]"). - * Return values correspond to their libc counterparts (if any). - */ -ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); -ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); -char *ber_tlv_tag_string(ber_tlv_tag_t tag); + /* + * Several functions for printing the TAG in the canonical form + * (i.e. "[PRIVATE 0]"). + * Return values correspond to their libc counterparts (if any). + */ + ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); + ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); + char *ber_tlv_tag_string(ber_tlv_tag_t tag); -/* - * This function tries to fetch the tag from the input stream. - * RETURN VALUES: - * 0: More data expected than bufptr contains. - * -1: Fatal error deciphering tag. - * >0: Number of bytes used from bufptr. tag_r will contain the tag. - */ -ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); + /* + * This function tries to fetch the tag from the input stream. + * RETURN VALUES: + * 0: More data expected than bufptr contains. + * -1: Fatal error deciphering tag. + * >0: Number of bytes used from bufptr. tag_r will contain the tag. + */ + ssize_t ber_fetch_tag(const void *bufptr, size_t size, ber_tlv_tag_t *tag_r); -/* - * This function serializes the tag (T from TLV) in BER format. - * It always returns number of bytes necessary to represent the tag, - * it is a caller's responsibility to check the return value - * against the supplied buffer's size. - */ -size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); + /* + * This function serializes the tag (T from TLV) in BER format. + * It always returns number of bytes necessary to represent the tag, + * it is a caller's responsibility to check the return value + * against the supplied buffer's size. + */ + size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size); #ifdef __cplusplus } diff --git a/src/third_party/asn1/constr_CHOICE.c b/src/third_party/asn1/constr_CHOICE.c index a9eb7194..df4641e9 100644 --- a/src/third_party/asn1/constr_CHOICE.c +++ b/src/third_party/asn1/constr_CHOICE.c @@ -99,7 +99,7 @@ _search4tag(const void *ap, const void *bp) { */ asn_dec_rval_t CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const void *ptr, size_t size, int tag_mode) { + void **struct_ptr, const void *ptr, size_t size, int tag_mode) { /* * Bring closer parts of structure description. */ @@ -134,7 +134,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - + /* * Start to parse where left previously */ @@ -148,10 +148,10 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(tag_mode || td->tags_count) { rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, - tag_mode, -1, &ctx->left, 0); + tag_mode, -1, &ctx->left, 0); if(rval.code != RC_OK) { ASN_DEBUG("%s tagging check failed: %d", - td->name, rval.code); + td->name, rval.code); return rval; } @@ -167,7 +167,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, NEXT_PHASE(ctx); ASN_DEBUG("Structure consumes %ld bytes, buffer %ld", - (long)ctx->left, (long)size); + (long)ctx->left, (long)size); /* Fall through */ case 1: @@ -177,9 +177,11 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); ASN_DEBUG("In %s CHOICE tag length %d", td->name, (int)tag_len); switch(tag_len) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); + case 0: + if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ - case -1: RETURN(RC_FAIL); + case -1: + RETURN(RC_FAIL); } do { @@ -188,8 +190,8 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, key.el_tag = tlv_tag; t2m = (asn_TYPE_tag2member_t *)bsearch(&key, - specs->tag2el, specs->tag2el_count, - sizeof(specs->tag2el[0]), _search4tag); + specs->tag2el, specs->tag2el_count, + sizeof(specs->tag2el[0]), _search4tag); if(t2m) { /* * Found the element corresponding to the tag. @@ -199,25 +201,27 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, break; } else if(specs->ext_start == -1) { ASN_DEBUG("Unexpected tag %s " - "in non-extensible CHOICE %s", - ber_tlv_tag_string(tlv_tag), td->name); + "in non-extensible CHOICE %s", + ber_tlv_tag_string(tlv_tag), td->name); RETURN(RC_FAIL); } else { /* Skip this tag */ ssize_t skip; ASN_DEBUG("Skipping unknown tag %s", - ber_tlv_tag_string(tlv_tag)); + ber_tlv_tag_string(tlv_tag)); skip = ber_skip_length(opt_codec_ctx, - BER_TLV_CONSTRUCTED(ptr), - (const char *)ptr + tag_len, - LEFT - tag_len); + BER_TLV_CONSTRUCTED(ptr), + (const char *)ptr + tag_len, + LEFT - tag_len); switch(skip) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); + case 0: + if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ - case -1: RETURN(RC_FAIL); + case -1: + RETURN(RC_FAIL); } ADVANCE(skip + tag_len); @@ -230,60 +234,60 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * PHASE 2. * Read in the element. */ - do { - asn_TYPE_member_t *elm;/* CHOICE's element */ - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ + do { + asn_TYPE_member_t *elm;/* CHOICE's element */ + void *memb_ptr; /* Pointer to the member */ + void **memb_ptr2; /* Pointer to that pointer */ - elm = &elements[ctx->step]; + elm = &elements[ctx->step]; - /* - * Compute the position of the member inside a structure, - * and also a type of containment (it may be contained - * as pointer or using inline inclusion). - */ - if(elm->flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { /* - * A pointer to a pointer - * holding the start of the structure + * Compute the position of the member inside a structure, + * and also a type of containment (it may be contained + * as pointer or using inline inclusion). */ - memb_ptr = (char *)st + elm->memb_offset; - memb_ptr2 = &memb_ptr; - } - /* Set presence to be able to free it properly at any time */ - _set_present_idx(st, specs->pres_offset, - specs->pres_size, ctx->step + 1); - /* - * Invoke the member fetch routine according to member's type - */ - rval = elm->type->ber_decoder(opt_codec_ctx, elm->type, - memb_ptr2, ptr, LEFT, elm->tag_mode); - switch(rval.code) { - case RC_OK: - break; - case RC_WMORE: /* More data expected */ - if(!SIZE_VIOLATION) { - ADVANCE(rval.consumed); - RETURN(RC_WMORE); + if(elm->flags & ATF_POINTER) { + /* Member is a pointer to another structure */ + memb_ptr2 = (void **)((char *)st + elm->memb_offset); + } else { + /* + * A pointer to a pointer + * holding the start of the structure + */ + memb_ptr = (char *)st + elm->memb_offset; + memb_ptr2 = &memb_ptr; } - RETURN(RC_FAIL); - case RC_FAIL: /* Fatal error */ - RETURN(rval.code); - } /* switch(rval) */ - - ADVANCE(rval.consumed); - } while(0); + /* Set presence to be able to free it properly at any time */ + _set_present_idx(st, specs->pres_offset, + specs->pres_size, ctx->step + 1); + /* + * Invoke the member fetch routine according to member's type + */ + rval = elm->type->ber_decoder(opt_codec_ctx, elm->type, + memb_ptr2, ptr, LEFT, elm->tag_mode); + switch(rval.code) { + case RC_OK: + break; + case RC_WMORE: /* More data expected */ + if(!SIZE_VIOLATION) { + ADVANCE(rval.consumed); + RETURN(RC_WMORE); + } + RETURN(RC_FAIL); + case RC_FAIL: /* Fatal error */ + RETURN(rval.code); + } /* switch(rval) */ + + ADVANCE(rval.consumed); + } while(0); NEXT_PHASE(ctx); /* Fall through */ case 3: ASN_DEBUG("CHOICE %s Leftover: %ld, size = %ld, tm=%d, tc=%d", - td->name, (long)ctx->left, (long)size, - tag_mode, td->tags_count); + td->name, (long)ctx->left, (long)size, + tag_mode, td->tags_count); if(ctx->left > 0) { /* @@ -294,7 +298,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, } if(ctx->left == -1 - && !(tag_mode || td->tags_count)) { + && !(tag_mode || td->tags_count)) { /* * This is an untagged CHOICE. * It doesn't contain nothing @@ -313,9 +317,11 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); switch(tl) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); + case 0: + if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ - case -1: RETURN(RC_FAIL); + case -1: + RETURN(RC_FAIL); } /* @@ -337,7 +343,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, } } else { ASN_DEBUG("Unexpected continuation in %s", - td->name); + td->name); RETURN(RC_FAIL); } @@ -349,14 +355,14 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* No meaningful work here */ break; } - + RETURN(RC_OK); } asn_enc_rval_t CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; asn_TYPE_member_t *elm; /* CHOICE element */ asn_enc_rval_t erval; @@ -367,10 +373,10 @@ CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr, if(!sptr) _ASN_ENCODE_FAILED; ASN_DEBUG("%s %s as CHOICE", - cb?"Encoding":"Estimating", td->name); + cb?"Encoding":"Estimating", td->name); present = _fetch_present_idx(sptr, - specs->pres_offset, specs->pres_size); + specs->pres_offset, specs->pres_size); /* * If the structure was not initialized, it cannot be encoded: @@ -416,13 +422,13 @@ CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr, /* Encode member with its tag */ erval = elm->type->der_encoder(elm->type, memb_ptr, - elm->tag_mode, elm->tag, 0, 0); + elm->tag_mode, elm->tag, 0, 0); if(erval.encoded == -1) return erval; /* Encode CHOICE with parent or my own tag */ ret = der_write_tags(td, erval.encoded, tag_mode, 1, tag, - cb, app_key); + cb, app_key); if(ret == -1) _ASN_ENCODE_FAILED; computed_size += ret; @@ -432,12 +438,12 @@ CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr, * Encode the single underlying member. */ erval = elm->type->der_encoder(elm->type, memb_ptr, - elm->tag_mode, elm->tag, cb, app_key); + elm->tag_mode, elm->tag, cb, app_key); if(erval.encoded == -1) return erval; ASN_DEBUG("Encoded CHOICE member in %ld bytes (+%ld)", - (long)erval.encoded, (long)computed_size); + (long)erval.encoded, (long)computed_size); erval.encoded += computed_size; @@ -449,8 +455,10 @@ CHOICE_outmost_tag(asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; int present; - assert(tag_mode == 0); (void)tag_mode; - assert(tag == 0); (void)tag; + assert(tag_mode == 0); + (void)tag_mode; + assert(tag == 0); + (void)tag; /* * Figure out which CHOICE element is encoded. @@ -463,14 +471,14 @@ CHOICE_outmost_tag(asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber if(elm->flags & ATF_POINTER) { memb_ptr = *(const void * const *) - ((const char *)ptr + elm->memb_offset); + ((const char *)ptr + elm->memb_offset); } else { memb_ptr = (const void *) - ((const char *)ptr + elm->memb_offset); + ((const char *)ptr + elm->memb_offset); } return asn_TYPE_outmost_tag(elm->type, memb_ptr, - elm->tag_mode, elm->tag); + elm->tag_mode, elm->tag); } else { return (ber_tlv_tag_t)-1; } @@ -478,14 +486,14 @@ CHOICE_outmost_tag(asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber int CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; int present; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } @@ -503,8 +511,8 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, if(elm->optional) return 0; _ASN_CTFAIL(app_key, td, sptr, - "%s: mandatory CHOICE element %s absent (%s:%d)", - td->name, elm->name, __FILE__, __LINE__); + "%s: mandatory CHOICE element %s absent (%s:%d)", + td->name, elm->name, __FILE__, __LINE__); return -1; } } else { @@ -513,10 +521,10 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, if(elm->memb_constraints) { return elm->memb_constraints(elm->type, memb_ptr, - ctfailcb, app_key); + ctfailcb, app_key); } else { int ret = elm->type->check_constraints(elm->type, - memb_ptr, ctfailcb, app_key); + memb_ptr, ctfailcb, app_key); /* * Cannot inherit it eralier: * need to make sure we get the updated version. @@ -526,8 +534,8 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } } else { _ASN_CTFAIL(app_key, td, sptr, - "%s: no CHOICE element given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: no CHOICE element given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } } @@ -545,8 +553,8 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, */ asn_dec_rval_t CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const char *opt_mname, - const void *buf_ptr, size_t size) { + void **struct_ptr, const char *opt_mname, + const void *buf_ptr, size_t size) { /* * Bring closer parts of structure description. */ @@ -606,7 +614,7 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(elm->flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st - + elm->memb_offset); + + elm->memb_offset); } else { memb_ptr = (char *)st + elm->memb_offset; memb_ptr2 = &memb_ptr; @@ -614,18 +622,18 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* Start/Continue decoding the inner member */ tmprval = elm->type->xer_decoder(opt_codec_ctx, - elm->type, memb_ptr2, elm->name, - buf_ptr, size); + elm->type, memb_ptr2, elm->name, + buf_ptr, size); XER_ADVANCE(tmprval.consumed); ASN_DEBUG("XER/CHOICE: itdf: [%s] code=%d", - elm->type->name, tmprval.code); + elm->type->name, tmprval.code); if(tmprval.code != RC_OK) RETURN(tmprval.code); assert(_fetch_present_idx(st, - specs->pres_offset, specs->pres_size) == 0); + specs->pres_offset, specs->pres_size) == 0); /* Record what we've got */ _set_present_idx(st, - specs->pres_offset, specs->pres_size, edx + 1); + specs->pres_offset, specs->pres_size, edx + 1); ctx->phase = 3; /* Fall through */ } @@ -641,8 +649,10 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, */ ch_size = xer_next_token(&ctx->context, buf_ptr, size, &ch_type); switch(ch_size) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); + case -1: + RETURN(RC_FAIL); + case 0: + RETURN(RC_WMORE); default: switch(ch_type) { case PXER_COMMENT: /* Got XML comment */ @@ -656,16 +666,16 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); ASN_DEBUG("XER/CHOICE checked [%c%c%c%c] vs [%s], tcv=%d", - ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', - ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', - ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', - ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - xml_tag, tcv); + ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', + ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', + ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', + ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', + xml_tag, tcv); /* Skip the extensions section */ if(ctx->phase == 4) { ASN_DEBUG("skip_unknown(%d, %ld)", - tcv, (long)ctx->left); + tcv, (long)ctx->left); switch(xer_skip_unknown(tcv, &ctx->left)) { case -1: ctx->phase = 5; @@ -757,12 +767,12 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, } ASN_DEBUG("Unexpected XML tag [%c%c%c%c] in CHOICE [%s]" - " (ph=%d, tag=%s)", - ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', - ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', - ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', - ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', - td->name, ctx->phase, xml_tag); + " (ph=%d, tag=%s)", + ch_size>0?((const uint8_t *)buf_ptr)[0]:'?', + ch_size>1?((const uint8_t *)buf_ptr)[1]:'?', + ch_size>2?((const uint8_t *)buf_ptr)[2]:'?', + ch_size>3?((const uint8_t *)buf_ptr)[3]:'?', + td->name, ctx->phase, xml_tag); break; } @@ -773,8 +783,8 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_enc_rval_t CHOICE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { asn_CHOICE_specifics_t *specs=(asn_CHOICE_specifics_t *)td->specifics; asn_enc_rval_t er; int present; @@ -805,11 +815,11 @@ CHOICE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, er.encoded = 0; - if(!(flags & XER_F_CANONICAL)) _i_ASN_TEXT_INDENT(1, ilevel); + if(!(flags & XER_F_CANONICAL)) _i_ASN_TEXT_INDENT(1, ilevel); _ASN_CALLBACK3("<", 1, mname, mlen, ">", 1); tmper = elm->type->xer_encoder(elm->type, memb_ptr, - ilevel + 1, flags, cb, app_key); + ilevel + 1, flags, cb, app_key); if(tmper.encoded == -1) return tmper; _ASN_CALLBACK3("", 1); @@ -826,7 +836,7 @@ cb_failed: asn_dec_rval_t CHOICE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; asn_dec_rval_t rv; asn_per_constraint_t *ct; @@ -861,7 +871,7 @@ CHOICE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, value = per_get_few_bits(pd, ct->range_bits); if(value < 0) _ASN_DECODE_STARVED; ASN_DEBUG("CHOICE %s got index %d in range %d", - td->name, value, ct->range_bits); + td->name, value, ct->range_bits); if(value > ct->upper_bound) _ASN_DECODE_FAILED; } else { @@ -893,21 +903,21 @@ CHOICE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(ct && ct->range_bits >= 0) { rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, - elm->per_constraints, memb_ptr2, pd); + elm->per_constraints, memb_ptr2, pd); } else { rv = uper_open_type_get(opt_codec_ctx, elm->type, - elm->per_constraints, memb_ptr2, pd); + elm->per_constraints, memb_ptr2, pd); } if(rv.code != RC_OK) ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d", - elm->name, td->name, rv.code); + elm->name, td->name, rv.code); return rv; } - + asn_enc_rval_t CHOICE_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; asn_TYPE_member_t *elm; /* CHOICE's element */ asn_per_constraint_t *ct; @@ -923,7 +933,7 @@ CHOICE_encode_uper(asn_TYPE_descriptor_t *td, else ct = 0; present = _fetch_present_idx(sptr, - specs->pres_offset, specs->pres_size); + specs->pres_offset, specs->pres_size); /* * If the structure was not initialized properly, it cannot be encoded: @@ -942,7 +952,7 @@ CHOICE_encode_uper(asn_TYPE_descriptor_t *td, if(ct && ct->range_bits >= 0) { if(present < ct->lower_bound - || present > ct->upper_bound) { + || present > ct->upper_bound) { if(ct->flags & APC_EXTENSIBLE) { if(per_put_few_bits(po, 1, 1)) _ASN_ENCODE_FAILED; @@ -970,7 +980,7 @@ CHOICE_encode_uper(asn_TYPE_descriptor_t *td, _ASN_ENCODE_FAILED; return elm->type->uper_encoder(elm->type, elm->per_constraints, - memb_ptr, po); + memb_ptr, po); } else { asn_enc_rval_t rval; if(specs->ext_start == -1) @@ -978,17 +988,17 @@ CHOICE_encode_uper(asn_TYPE_descriptor_t *td, if(uper_put_nsnnwn(po, present - specs->ext_start)) _ASN_ENCODE_FAILED; if(uper_open_type_put(elm->type, elm->per_constraints, - memb_ptr, po)) + memb_ptr, po)) _ASN_ENCODE_FAILED; rval.encoded = 0; _ASN_ENCODED_OK(rval); } } - + int CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics; int present; @@ -1016,12 +1026,12 @@ CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, /* Print member's name and stuff */ if(0) { if(cb(elm->name, strlen(elm->name), app_key) < 0 - || cb(": ", 2, app_key) < 0) + || cb(": ", 2, app_key) < 0) return -1; } return elm->type->print_struct(elm->type, memb_ptr, ilevel, - cb, app_key); + cb, app_key); } else { return (cb("", 8, app_key) < 0) ? -1 : 0; } @@ -1082,9 +1092,15 @@ _fetch_present_idx(const void *struct_ptr, int pres_offset, int pres_size) { present_ptr = ((const char *)struct_ptr) + pres_offset; switch(pres_size) { - case sizeof(int): present = *(const int *)present_ptr; break; - case sizeof(short): present = *(const short *)present_ptr; break; - case sizeof(char): present = *(const char *)present_ptr; break; + case sizeof(int): + present = *(const int *)present_ptr; + break; + case sizeof(short): + present = *(const short *)present_ptr; + break; + case sizeof(char): + present = *(const char *)present_ptr; + break; default: /* ANSI C mandates enum to be equivalent to integer */ assert(pres_size != sizeof(int)); @@ -1100,9 +1116,15 @@ _set_present_idx(void *struct_ptr, int pres_offset, int pres_size, int present) present_ptr = ((char *)struct_ptr) + pres_offset; switch(pres_size) { - case sizeof(int): *(int *)present_ptr = present; break; - case sizeof(short): *(short *)present_ptr = present; break; - case sizeof(char): *(char *)present_ptr = present; break; + case sizeof(int): + *(int *)present_ptr = present; + break; + case sizeof(short): + *(short *)present_ptr = present; + break; + case sizeof(char): + *(char *)present_ptr = present; + break; default: /* ANSI C mandates enum to be equivalent to integer */ assert(pres_size != sizeof(int)); diff --git a/src/third_party/asn1/constr_CHOICE.h b/src/third_party/asn1/constr_CHOICE.h index 83404e6d..219b9917 100644 --- a/src/third_party/asn1/constr_CHOICE.h +++ b/src/third_party/asn1/constr_CHOICE.h @@ -12,43 +12,43 @@ extern "C" { #endif -typedef struct asn_CHOICE_specifics_s { - /* - * Target structure description. - */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_codec_ctx_t member */ - int pres_offset; /* Identifier of the present member */ - int pres_size; /* Size of the identifier (enum) */ + typedef struct asn_CHOICE_specifics_s { + /* + * Target structure description. + */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_codec_ctx_t member */ + int pres_offset; /* Identifier of the present member */ + int pres_size; /* Size of the identifier (enum) */ + + /* + * Tags to members mapping table. + */ + asn_TYPE_tag2member_t *tag2el; + int tag2el_count; + + /* Canonical ordering of CHOICE elements, for PER */ + int *canonical_order; + + /* + * Extensions-related stuff. + */ + int ext_start; /* First member of extensions, or -1 */ + } asn_CHOICE_specifics_t; /* - * Tags to members mapping table. + * A set specialized functions dealing with the CHOICE type. */ - asn_TYPE_tag2member_t *tag2el; - int tag2el_count; - - /* Canonical ordering of CHOICE elements, for PER */ - int *canonical_order; - - /* - * Extensions-related stuff. - */ - int ext_start; /* First member of extensions, or -1 */ -} asn_CHOICE_specifics_t; - -/* - * A set specialized functions dealing with the CHOICE type. - */ -asn_struct_free_f CHOICE_free; -asn_struct_print_f CHOICE_print; -asn_constr_check_f CHOICE_constraint; -ber_type_decoder_f CHOICE_decode_ber; -der_type_encoder_f CHOICE_encode_der; -xer_type_decoder_f CHOICE_decode_xer; -xer_type_encoder_f CHOICE_encode_xer; -per_type_decoder_f CHOICE_decode_uper; -per_type_encoder_f CHOICE_encode_uper; -asn_outmost_tag_f CHOICE_outmost_tag; + asn_struct_free_f CHOICE_free; + asn_struct_print_f CHOICE_print; + asn_constr_check_f CHOICE_constraint; + ber_type_decoder_f CHOICE_decode_ber; + der_type_encoder_f CHOICE_encode_der; + xer_type_decoder_f CHOICE_decode_xer; + xer_type_encoder_f CHOICE_encode_xer; + per_type_decoder_f CHOICE_decode_uper; + per_type_encoder_f CHOICE_encode_uper; + asn_outmost_tag_f CHOICE_outmost_tag; #ifdef __cplusplus } diff --git a/src/third_party/asn1/constr_SEQUENCE.c b/src/third_party/asn1/constr_SEQUENCE.c index bc7f4ad3..510ed8b7 100644 --- a/src/third_party/asn1/constr_SEQUENCE.c +++ b/src/third_party/asn1/constr_SEQUENCE.c @@ -110,7 +110,7 @@ _t2e_cmp(const void *ap, const void *bp) { */ asn_dec_rval_t SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const void *ptr, size_t size, int tag_mode) { + void **struct_ptr, const void *ptr, size_t size, int tag_mode) { /* * Bring closer parts of structure description. */ @@ -130,7 +130,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, int edx; /* SEQUENCE element's index */ ASN_DEBUG("Decoding %s as SEQUENCE", td->name); - + /* * Create the target structure if it is not present already. */ @@ -145,7 +145,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - + /* * Start to parse where left previously */ @@ -158,10 +158,10 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, */ rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, - tag_mode, 1, &ctx->left, 0); + tag_mode, 1, &ctx->left, 0); if(rval.code != RC_OK) { ASN_DEBUG("%s tagging check failed: %d", - td->name, rval.code); + td->name, rval.code); return rval; } @@ -172,7 +172,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, NEXT_PHASE(ctx); ASN_DEBUG("Structure consumes %ld bytes, buffer %ld", - (long)ctx->left, (long)size); + (long)ctx->left, (long)size); /* Fall through */ case 1: @@ -186,262 +186,266 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * that member: * step = ( * 2 + ). */ - for(edx = (ctx->step >> 1); edx < td->elements_count; - edx++, ctx->step = (ctx->step & ~1) + 2) { - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - ssize_t tag_len; /* Length of TLV's T */ - int opt_edx_end; /* Next non-optional element */ - int use_bsearch; - int n; + for(edx = (ctx->step >> 1); edx < td->elements_count; + edx++, ctx->step = (ctx->step & ~1) + 2) { + void *memb_ptr; /* Pointer to the member */ + void **memb_ptr2; /* Pointer to that pointer */ + ssize_t tag_len; /* Length of TLV's T */ + int opt_edx_end; /* Next non-optional element */ + int use_bsearch; + int n; - if(ctx->step & 1) - goto microphase2; - - /* - * MICROPHASE 1: Synchronize decoding. - */ - ASN_DEBUG("In %s SEQUENCE left %d, edx=%d flags=%d" - " opt=%d ec=%d", - td->name, (int)ctx->left, edx, - elements[edx].flags, elements[edx].optional, - td->elements_count); - - if(ctx->left == 0 /* No more stuff is expected */ - && ( - /* Explicit OPTIONAL specification reaches the end */ - (edx + elements[edx].optional - == td->elements_count) - || - /* All extensions are optional */ - (IN_EXTENSION_GROUP(specs, edx) - && specs->ext_before > td->elements_count) - ) - ) { - ASN_DEBUG("End of SEQUENCE %s", td->name); - /* - * Found the legitimate end of the structure. - */ - PHASE_OUT(ctx); - RETURN(RC_OK); - } - - /* - * Fetch the T from TLV. - */ - tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); - ASN_DEBUG("Current tag in %s SEQUENCE for element %d " - "(%s) is %s encoded in %d bytes, of frame %ld", - td->name, edx, elements[edx].name, - ber_tlv_tag_string(tlv_tag), (int)tag_len, (long)LEFT); - switch(tag_len) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { - if(LEFT < 2) { - if(SIZE_VIOLATION) - RETURN(RC_FAIL); - else - RETURN(RC_WMORE); - } else if(((const uint8_t *)ptr)[1] == 0) { - ASN_DEBUG("edx = %d, opt = %d, ec=%d", - edx, elements[edx].optional, - td->elements_count); - if((edx + elements[edx].optional - == td->elements_count) - || (IN_EXTENSION_GROUP(specs, edx) - && specs->ext_before - > td->elements_count)) { - /* - * Yeah, baby! Found the terminator - * of the indefinite length structure. - */ - /* - * Proceed to the canonical - * finalization function. - * No advancing is necessary. - */ - goto phase3; - } - } - } - - /* - * Find the next available type with this tag. - */ - use_bsearch = 0; - opt_edx_end = edx + elements[edx].optional + 1; - if(opt_edx_end > td->elements_count) - opt_edx_end = td->elements_count; /* Cap */ - else if(opt_edx_end - edx > 8) { - /* Limit the scope of linear search... */ - opt_edx_end = edx + 8; - use_bsearch = 1; - /* ... and resort to bsearch() */ - } - for(n = edx; n < opt_edx_end; n++) { - if(BER_TAGS_EQUAL(tlv_tag, elements[n].tag)) { - /* - * Found element corresponding to the tag - * being looked at. - * Reposition over the right element. - */ - edx = n; - ctx->step = 1 + 2 * edx; /* Remember! */ + if(ctx->step & 1) goto microphase2; - } else if(elements[n].flags & ATF_OPEN_TYPE) { - /* - * This is the ANY type, which may bear - * any flag whatsoever. - */ - edx = n; - ctx->step = 1 + 2 * edx; /* Remember! */ - goto microphase2; - } else if(elements[n].tag == (ber_tlv_tag_t)-1) { - use_bsearch = 1; - break; - } - } - if(use_bsearch) { + /* - * Resort to a binary search over - * sorted array of tags. + * MICROPHASE 1: Synchronize decoding. */ - asn_TYPE_tag2member_t *t2m; - asn_TYPE_tag2member_t key; - key.el_tag = tlv_tag; - key.el_no = edx; - t2m = (asn_TYPE_tag2member_t *)bsearch(&key, - specs->tag2el, specs->tag2el_count, - sizeof(specs->tag2el[0]), _t2e_cmp); - if(t2m) { - asn_TYPE_tag2member_t *best = 0; - asn_TYPE_tag2member_t *t2m_f, *t2m_l; - int edx_max = edx + elements[edx].optional; + ASN_DEBUG("In %s SEQUENCE left %d, edx=%d flags=%d" + " opt=%d ec=%d", + td->name, (int)ctx->left, edx, + elements[edx].flags, elements[edx].optional, + td->elements_count); + + if(ctx->left == 0 /* No more stuff is expected */ + && ( + /* Explicit OPTIONAL specification reaches the end */ + (edx + elements[edx].optional + == td->elements_count) + || + /* All extensions are optional */ + (IN_EXTENSION_GROUP(specs, edx) + && specs->ext_before > td->elements_count) + ) + ) { + ASN_DEBUG("End of SEQUENCE %s", td->name); /* - * Rewind to the first element with that tag, - * `cause bsearch() does not guarantee order. + * Found the legitimate end of the structure. */ - t2m_f = t2m + t2m->toff_first; - t2m_l = t2m + t2m->toff_last; - for(t2m = t2m_f; t2m <= t2m_l; t2m++) { - if(t2m->el_no > edx_max) break; - if(t2m->el_no < edx) continue; - best = t2m; - } - if(best) { - edx = best->el_no; - ctx->step = 1 + 2 * edx; - goto microphase2; - } + PHASE_OUT(ctx); + RETURN(RC_OK); } - n = opt_edx_end; - } - if(n == opt_edx_end) { + /* - * If tag is unknown, it may be either - * an unknown (thus, incorrect) tag, - * or an extension (...), - * or an end of the indefinite-length structure. + * Fetch the T from TLV. */ - if(!IN_EXTENSION_GROUP(specs, - edx + elements[edx].optional)) { - ASN_DEBUG("Unexpected tag %s (at %d)", - ber_tlv_tag_string(tlv_tag), edx); - ASN_DEBUG("Expected tag %s (%s)%s", - ber_tlv_tag_string(elements[edx].tag), - elements[edx].name, - elements[edx].optional - ?" or alternatives":""); + tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); + ASN_DEBUG("Current tag in %s SEQUENCE for element %d " + "(%s) is %s encoded in %d bytes, of frame %ld", + td->name, edx, elements[edx].name, + ber_tlv_tag_string(tlv_tag), (int)tag_len, (long)LEFT); + switch(tag_len) { + case 0: + if(!SIZE_VIOLATION) RETURN(RC_WMORE); + /* Fall through */ + case -1: RETURN(RC_FAIL); - } else { - /* Skip this tag */ - ssize_t skip; - edx += elements[edx].optional; + } - ASN_DEBUG("Skipping unexpected %s (at %d)", - ber_tlv_tag_string(tlv_tag), edx); - skip = ber_skip_length(opt_codec_ctx, - BER_TLV_CONSTRUCTED(ptr), - (const char *)ptr + tag_len, - LEFT - tag_len); - ASN_DEBUG("Skip length %d in %s", - (int)skip, td->name); - switch(skip) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); + if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { + if(LEFT < 2) { + if(SIZE_VIOLATION) + RETURN(RC_FAIL); + else + RETURN(RC_WMORE); + } else if(((const uint8_t *)ptr)[1] == 0) { + ASN_DEBUG("edx = %d, opt = %d, ec=%d", + edx, elements[edx].optional, + td->elements_count); + if((edx + elements[edx].optional + == td->elements_count) + || (IN_EXTENSION_GROUP(specs, edx) + && specs->ext_before + > td->elements_count)) { + /* + * Yeah, baby! Found the terminator + * of the indefinite length structure. + */ + /* + * Proceed to the canonical + * finalization function. + * No advancing is necessary. + */ + goto phase3; + } } - - ADVANCE(skip + tag_len); - ctx->step -= 2; - edx--; - continue; /* Try again with the next tag */ } - } - /* - * MICROPHASE 2: Invoke the member-specific decoder. - */ - ctx->step |= 1; /* Confirm entering next microphase */ - microphase2: - ASN_DEBUG("Inside SEQUENCE %s MF2", td->name); - - /* - * Compute the position of the member inside a structure, - * and also a type of containment (it may be contained - * as pointer or using inline inclusion). - */ - if(elements[edx].flags & ATF_POINTER) { - /* Member is a pointer to another structure */ - memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset); - } else { /* - * A pointer to a pointer - * holding the start of the structure + * Find the next available type with this tag. */ - memb_ptr = (char *)st + elements[edx].memb_offset; - memb_ptr2 = &memb_ptr; - } - /* - * Invoke the member fetch routine according to member's type - */ - rval = elements[edx].type->ber_decoder(opt_codec_ctx, - elements[edx].type, - memb_ptr2, ptr, LEFT, - elements[edx].tag_mode); - ASN_DEBUG("In %s SEQUENCE decoded %d %s of %d " - "in %d bytes rval.code %d, size=%d", - td->name, edx, elements[edx].type->name, - (int)LEFT, (int)rval.consumed, rval.code, (int)size); - switch(rval.code) { - case RC_OK: - break; - case RC_WMORE: /* More data expected */ - if(!SIZE_VIOLATION) { - ADVANCE(rval.consumed); - RETURN(RC_WMORE); + use_bsearch = 0; + opt_edx_end = edx + elements[edx].optional + 1; + if(opt_edx_end > td->elements_count) + opt_edx_end = td->elements_count; /* Cap */ + else if(opt_edx_end - edx > 8) { + /* Limit the scope of linear search... */ + opt_edx_end = edx + 8; + use_bsearch = 1; + /* ... and resort to bsearch() */ } - ASN_DEBUG("Size violation (c->l=%ld <= s=%ld)", - (long)ctx->left, (long)size); - /* Fall through */ - case RC_FAIL: /* Fatal error */ - RETURN(RC_FAIL); - } /* switch(rval) */ - - ADVANCE(rval.consumed); - } /* for(all structure members) */ + for(n = edx; n < opt_edx_end; n++) { + if(BER_TAGS_EQUAL(tlv_tag, elements[n].tag)) { + /* + * Found element corresponding to the tag + * being looked at. + * Reposition over the right element. + */ + edx = n; + ctx->step = 1 + 2 * edx; /* Remember! */ + goto microphase2; + } else if(elements[n].flags & ATF_OPEN_TYPE) { + /* + * This is the ANY type, which may bear + * any flag whatsoever. + */ + edx = n; + ctx->step = 1 + 2 * edx; /* Remember! */ + goto microphase2; + } else if(elements[n].tag == (ber_tlv_tag_t)-1) { + use_bsearch = 1; + break; + } + } + if(use_bsearch) { + /* + * Resort to a binary search over + * sorted array of tags. + */ + asn_TYPE_tag2member_t *t2m; + asn_TYPE_tag2member_t key; + key.el_tag = tlv_tag; + key.el_no = edx; + t2m = (asn_TYPE_tag2member_t *)bsearch(&key, + specs->tag2el, specs->tag2el_count, + sizeof(specs->tag2el[0]), _t2e_cmp); + if(t2m) { + asn_TYPE_tag2member_t *best = 0; + asn_TYPE_tag2member_t *t2m_f, *t2m_l; + int edx_max = edx + elements[edx].optional; + /* + * Rewind to the first element with that tag, + * `cause bsearch() does not guarantee order. + */ + t2m_f = t2m + t2m->toff_first; + t2m_l = t2m + t2m->toff_last; + for(t2m = t2m_f; t2m <= t2m_l; t2m++) { + if(t2m->el_no > edx_max) break; + if(t2m->el_no < edx) continue; + best = t2m; + } + if(best) { + edx = best->el_no; + ctx->step = 1 + 2 * edx; + goto microphase2; + } + } + n = opt_edx_end; + } + if(n == opt_edx_end) { + /* + * If tag is unknown, it may be either + * an unknown (thus, incorrect) tag, + * or an extension (...), + * or an end of the indefinite-length structure. + */ + if(!IN_EXTENSION_GROUP(specs, + edx + elements[edx].optional)) { + ASN_DEBUG("Unexpected tag %s (at %d)", + ber_tlv_tag_string(tlv_tag), edx); + ASN_DEBUG("Expected tag %s (%s)%s", + ber_tlv_tag_string(elements[edx].tag), + elements[edx].name, + elements[edx].optional + ?" or alternatives":""); + RETURN(RC_FAIL); + } else { + /* Skip this tag */ + ssize_t skip; + edx += elements[edx].optional; - phase3: + ASN_DEBUG("Skipping unexpected %s (at %d)", + ber_tlv_tag_string(tlv_tag), edx); + skip = ber_skip_length(opt_codec_ctx, + BER_TLV_CONSTRUCTED(ptr), + (const char *)ptr + tag_len, + LEFT - tag_len); + ASN_DEBUG("Skip length %d in %s", + (int)skip, td->name); + switch(skip) { + case 0: + if(!SIZE_VIOLATION) RETURN(RC_WMORE); + /* Fall through */ + case -1: + RETURN(RC_FAIL); + } + + ADVANCE(skip + tag_len); + ctx->step -= 2; + edx--; + continue; /* Try again with the next tag */ + } + } + + /* + * MICROPHASE 2: Invoke the member-specific decoder. + */ + ctx->step |= 1; /* Confirm entering next microphase */ +microphase2: + ASN_DEBUG("Inside SEQUENCE %s MF2", td->name); + + /* + * Compute the position of the member inside a structure, + * and also a type of containment (it may be contained + * as pointer or using inline inclusion). + */ + if(elements[edx].flags & ATF_POINTER) { + /* Member is a pointer to another structure */ + memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset); + } else { + /* + * A pointer to a pointer + * holding the start of the structure + */ + memb_ptr = (char *)st + elements[edx].memb_offset; + memb_ptr2 = &memb_ptr; + } + /* + * Invoke the member fetch routine according to member's type + */ + rval = elements[edx].type->ber_decoder(opt_codec_ctx, + elements[edx].type, + memb_ptr2, ptr, LEFT, + elements[edx].tag_mode); + ASN_DEBUG("In %s SEQUENCE decoded %d %s of %d " + "in %d bytes rval.code %d, size=%d", + td->name, edx, elements[edx].type->name, + (int)LEFT, (int)rval.consumed, rval.code, (int)size); + switch(rval.code) { + case RC_OK: + break; + case RC_WMORE: /* More data expected */ + if(!SIZE_VIOLATION) { + ADVANCE(rval.consumed); + RETURN(RC_WMORE); + } + ASN_DEBUG("Size violation (c->l=%ld <= s=%ld)", + (long)ctx->left, (long)size); + /* Fall through */ + case RC_FAIL: /* Fatal error */ + RETURN(RC_FAIL); + } /* switch(rval) */ + + ADVANCE(rval.consumed); + } /* for(all structure members) */ + +phase3: ctx->phase = 3; case 3: /* 00 and other tags expected */ case 4: /* only 00's expected */ ASN_DEBUG("SEQUENCE %s Leftover: %ld, size = %ld", - td->name, (long)ctx->left, (long)size); + td->name, (long)ctx->left, (long)size); /* * Skip everything until the end of the SEQUENCE. @@ -451,16 +455,18 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, tl = ber_fetch_tag(ptr, LEFT, &tlv_tag); switch(tl) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); + case 0: + if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ - case -1: RETURN(RC_FAIL); + case -1: + RETURN(RC_FAIL); } /* * If expected <0><0>... */ if(ctx->left < 0 - && ((const uint8_t *)ptr)[0] == 0) { + && ((const uint8_t *)ptr)[0] == 0) { if(LEFT < 2) { if(SIZE_VIOLATION) RETURN(RC_FAIL); @@ -478,22 +484,24 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, } if(!IN_EXTENSION_GROUP(specs, td->elements_count) - || ctx->phase == 4) { + || ctx->phase == 4) { ASN_DEBUG("Unexpected continuation " - "of a non-extensible type " - "%s (SEQUENCE): %s", - td->name, - ber_tlv_tag_string(tlv_tag)); + "of a non-extensible type " + "%s (SEQUENCE): %s", + td->name, + ber_tlv_tag_string(tlv_tag)); RETURN(RC_FAIL); } ll = ber_skip_length(opt_codec_ctx, - BER_TLV_CONSTRUCTED(ptr), - (const char *)ptr + tl, LEFT - tl); + BER_TLV_CONSTRUCTED(ptr), + (const char *)ptr + tl, LEFT - tl); switch(ll) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); + case 0: + if(!SIZE_VIOLATION) RETURN(RC_WMORE); /* Fall through */ - case -1: RETURN(RC_FAIL); + case -1: + RETURN(RC_FAIL); } ADVANCE(tl + ll); @@ -501,7 +509,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, PHASE_OUT(ctx); } - + RETURN(RC_OK); } @@ -511,15 +519,15 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, */ asn_enc_rval_t SEQUENCE_encode_der(asn_TYPE_descriptor_t *td, - void *sptr, int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + void *sptr, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { size_t computed_size = 0; asn_enc_rval_t erval; ssize_t ret; int edx; ASN_DEBUG("%s %s as SEQUENCE", - cb?"Encoding":"Estimating", td->name); + cb?"Encoding":"Estimating", td->name); /* * Gather the length of the underlying members sequence. @@ -538,13 +546,13 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td, memb_ptr = (void *)((char *)sptr + elm->memb_offset); } erval = elm->type->der_encoder(elm->type, memb_ptr, - elm->tag_mode, elm->tag, - 0, 0); + elm->tag_mode, elm->tag, + 0, 0); if(erval.encoded == -1) return erval; computed_size += erval.encoded; ASN_DEBUG("Member %d %s estimated %ld bytes", - edx, elm->name, (long)erval.encoded); + edx, elm->name, (long)erval.encoded); } /* @@ -573,13 +581,13 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td, memb_ptr = (void *)((char *)sptr + elm->memb_offset); } tmperval = elm->type->der_encoder(elm->type, memb_ptr, - elm->tag_mode, elm->tag, - cb, app_key); + elm->tag_mode, elm->tag, + cb, app_key); if(tmperval.encoded == -1) return tmperval; computed_size -= tmperval.encoded; ASN_DEBUG("Member %d %s of SEQUENCE %s encoded in %ld bytes", - edx, elm->name, td->name, (long)tmperval.encoded); + edx, elm->name, td->name, (long)tmperval.encoded); } if(computed_size != 0) @@ -605,13 +613,13 @@ SEQUENCE_encode_der(asn_TYPE_descriptor_t *td, */ asn_dec_rval_t SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const char *opt_mname, - const void *buf_ptr, size_t size) { + void **struct_ptr, const char *opt_mname, + const void *buf_ptr, size_t size) { /* * Bring closer parts of structure description. */ asn_SEQUENCE_specifics_t *specs - = (asn_SEQUENCE_specifics_t *)td->specifics; + = (asn_SEQUENCE_specifics_t *)td->specifics; asn_TYPE_member_t *elements = td->elements; const char *xml_tag = opt_mname ? opt_mname : td->xml_tag; @@ -668,7 +676,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(elm->flags & ATF_POINTER) { /* Member is a pointer to another structure */ memb_ptr2 = (void **)((char *)st - + elm->memb_offset); + + elm->memb_offset); } else { memb_ptr = (char *)st + elm->memb_offset; memb_ptr2 = &memb_ptr; @@ -676,15 +684,15 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* Invoke the inner type decoder, m.b. multiple times */ tmprval = elm->type->xer_decoder(opt_codec_ctx, - elm->type, memb_ptr2, elm->name, - buf_ptr, size); + elm->type, memb_ptr2, elm->name, + buf_ptr, size); XER_ADVANCE(tmprval.consumed); if(tmprval.code != RC_OK) RETURN(tmprval.code); ctx->phase = 1; /* Back to body processing */ ctx->step = ++edx; ASN_DEBUG("XER/SEQUENCE phase => %d, step => %d", - ctx->phase, ctx->step); + ctx->phase, ctx->step); /* Fall through */ } @@ -692,10 +700,12 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * Get the next part of the XML stream. */ ch_size = xer_next_token(&ctx->context, buf_ptr, size, - &ch_type); + &ch_type); switch(ch_size) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); + case -1: + RETURN(RC_FAIL); + case 0: + RETURN(RC_WMORE); default: switch(ch_type) { case PXER_COMMENT: /* Got XML comment */ @@ -709,7 +719,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); ASN_DEBUG("XER/SEQUENCE: tcv = %d, ph=%d [%s]", - tcv, ctx->phase, xml_tag); + tcv, ctx->phase, xml_tag); /* Skip the extensions section */ if(ctx->phase == 3) { @@ -738,16 +748,16 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, case XCT_BOTH: if(ctx->phase == 0) { if(edx >= td->elements_count - || - /* Explicit OPTIONAL specs reaches the end */ - (edx + elements[edx].optional - == td->elements_count) - || - /* All extensions are optional */ - (IN_EXTENSION_GROUP(specs, edx) - && specs->ext_before - > td->elements_count) - ) { + || + /* Explicit OPTIONAL specs reaches the end */ + (edx + elements[edx].optional + == td->elements_count) + || + /* All extensions are optional */ + (IN_EXTENSION_GROUP(specs, edx) + && specs->ext_before + > td->elements_count) + ) { XER_ADVANCE(ch_size); ctx->phase = 4; /* Phase out */ RETURN(RC_OK); @@ -768,7 +778,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, case XCT_UNKNOWN_BO: ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d, edx=%d", - tcv, ctx->phase, edx); + tcv, ctx->phase, edx); if(ctx->phase != 1) { break; /* Really unexpected */ } @@ -783,7 +793,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, for(n = edx; n < edx_end; n++) { elm = &td->elements[n]; tcv = xer_check_tag(buf_ptr, - ch_size, elm->name); + ch_size, elm->name); switch(tcv) { case XCT_BOTH: case XCT_OPENING: @@ -806,15 +816,15 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, continue; } else { ASN_DEBUG("Out of defined members: %d/%d", - edx, td->elements_count); + edx, td->elements_count); } /* It is expected extension */ if(IN_EXTENSION_GROUP(specs, - edx + (edx < td->elements_count - ? elements[edx].optional : 0))) { + edx + (edx < td->elements_count + ? elements[edx].optional : 0))) { ASN_DEBUG("Got anticipated extension at %d", - edx); + edx); /* * Check for (XCT_BOTH or XCT_UNKNOWN_BO) * By using a mask. Only record a pure @@ -836,12 +846,12 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, } ASN_DEBUG("Unexpected XML tag in SEQUENCE [%c%c%c%c%c%c]", - size>0?((const char *)buf_ptr)[0]:'.', - size>1?((const char *)buf_ptr)[1]:'.', - size>2?((const char *)buf_ptr)[2]:'.', - size>3?((const char *)buf_ptr)[3]:'.', - size>4?((const char *)buf_ptr)[4]:'.', - size>5?((const char *)buf_ptr)[5]:'.'); + size>0?((const char *)buf_ptr)[0]:'.', + size>1?((const char *)buf_ptr)[1]:'.', + size>2?((const char *)buf_ptr)[2]:'.', + size>3?((const char *)buf_ptr)[3]:'.', + size>4?((const char *)buf_ptr)[4]:'.', + size>5?((const char *)buf_ptr)[5]:'.'); break; } @@ -851,8 +861,8 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_enc_rval_t SEQUENCE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; int xcan = (flags & XER_F_CANONICAL); int edx; @@ -886,7 +896,7 @@ SEQUENCE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, /* Print the member itself */ tmper = elm->type->xer_encoder(elm->type, memb_ptr, - ilevel + 1, flags, cb, app_key); + ilevel + 1, flags, cb, app_key); if(tmper.encoded == -1) return tmper; _ASN_CALLBACK3("", 1); @@ -902,7 +912,7 @@ cb_failed: int SEQUENCE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { int edx; int ret; @@ -910,7 +920,7 @@ SEQUENCE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, /* Dump preamble */ if(cb(td->name, strlen(td->name), app_key) < 0 - || cb(" ::= {", 6, app_key) < 0) + || cb(" ::= {", 6, app_key) < 0) return -1; for(edx = 0; edx < td->elements_count; edx++) { @@ -933,12 +943,12 @@ SEQUENCE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, /* Print the member's name and stuff */ if(cb(elm->name, strlen(elm->name), app_key) < 0 - || cb(": ", 2, app_key) < 0) + || cb(": ", 2, app_key) < 0) return -1; /* Print the member itself */ ret = elm->type->print_struct(elm->type, memb_ptr, ilevel + 1, - cb, app_key); + cb, app_key); if(ret) return ret; } @@ -977,13 +987,13 @@ SEQUENCE_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) { int SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { int edx; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } @@ -1000,8 +1010,8 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, if(elm->optional) continue; _ASN_CTFAIL(app_key, td, sptr, - "%s: mandatory element %s absent (%s:%d)", - td->name, elm->name, __FILE__, __LINE__); + "%s: mandatory element %s absent (%s:%d)", + td->name, elm->name, __FILE__, __LINE__); return -1; } } else { @@ -1010,11 +1020,11 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, if(elm->memb_constraints) { int ret = elm->memb_constraints(elm->type, memb_ptr, - ctfailcb, app_key); + ctfailcb, app_key); if(ret) return ret; } else { int ret = elm->type->check_constraints(elm->type, - memb_ptr, ctfailcb, app_key); + memb_ptr, ctfailcb, app_key); if(ret) return ret; /* * Cannot inherit it earlier: @@ -1029,7 +1039,7 @@ SEQUENCE_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_dec_rval_t SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics; void *st = *sptr; /* Target structure. */ int extpresent; /* Extension additions are present */ @@ -1071,7 +1081,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, opmd.buffer = opres; opmd.nbits = specs->roms_count; ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)", - td->name, specs->roms_count, *opres); + td->name, specs->roms_count, *opres); } else { opres = 0; } @@ -1099,8 +1109,8 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(elm->optional) { int present = per_get_few_bits(&opmd, 1); ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)", - td->name, elm->name, present, - (int)opmd.nboff, (int)opmd.nbits); + td->name, elm->name, present, + (int)opmd.nboff, (int)opmd.nbits); if(present == 0) { /* This element is not present */ if(elm->default_value) { @@ -1120,10 +1130,10 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* Fetch the member from the stream */ ASN_DEBUG("Decoding member %s in %s", elm->name, td->name); rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, - elm->per_constraints, memb_ptr2, pd); + elm->per_constraints, memb_ptr2, pd); if(rv.code != RC_OK) { ASN_DEBUG("Failed decode %s in %s", - elm->name, td->name); + elm->name, td->name); FREEMEM(opres); return rv; } @@ -1156,50 +1166,52 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, epmd.buffer = epres; epmd.nbits = bmlength; ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)", - td->name, (long)bmlength, *epres); + td->name, (long)bmlength, *epres); - /* Go over extensions and read them in */ - for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) { - asn_TYPE_member_t *elm = &td->elements[edx]; - void *memb_ptr; /* Pointer to the member */ - void **memb_ptr2; /* Pointer to that pointer */ - int present; + /* Go over extensions and read them in */ + for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) { + asn_TYPE_member_t *elm = &td->elements[edx]; + void *memb_ptr; /* Pointer to the member */ + void **memb_ptr2; /* Pointer to that pointer */ + int present; - if(!IN_EXTENSION_GROUP(specs, edx)) { - ASN_DEBUG("%d is not extension", edx); - continue; + if(!IN_EXTENSION_GROUP(specs, edx)) { + ASN_DEBUG("%d is not extension", edx); + continue; + } + + /* Fetch the pointer to this member */ + if(elm->flags & ATF_POINTER) { + memb_ptr2 = (void **)((char *)st + elm->memb_offset); + } else { + memb_ptr = (void *)((char *)st + elm->memb_offset); + memb_ptr2 = &memb_ptr; + } + + present = per_get_few_bits(&epmd, 1); + if(present <= 0) { + if(present < 0) break; /* No more extensions */ + continue; + } + + ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, *memb_ptr2); + rv = uper_open_type_get(opt_codec_ctx, elm->type, + elm->per_constraints, memb_ptr2, pd); + if(rv.code != RC_OK) { + FREEMEM(epres); + return rv; + } } - /* Fetch the pointer to this member */ - if(elm->flags & ATF_POINTER) { - memb_ptr2 = (void **)((char *)st + elm->memb_offset); - } else { - memb_ptr = (void *)((char *)st + elm->memb_offset); - memb_ptr2 = &memb_ptr; - } - - present = per_get_few_bits(&epmd, 1); - if(present <= 0) { - if(present < 0) break; /* No more extensions */ - continue; - } - - ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, *memb_ptr2); - rv = uper_open_type_get(opt_codec_ctx, elm->type, - elm->per_constraints, memb_ptr2, pd); - if(rv.code != RC_OK) { - FREEMEM(epres); - return rv; - } - } - /* Skip over overflow extensions which aren't present * in this system's version of the protocol */ for(;;) { ASN_DEBUG("Getting overflow extensions"); switch(per_get_few_bits(&epmd, 1)) { - case -1: break; - case 0: continue; + case -1: + break; + case 0: + continue; default: if(uper_open_type_skip(opt_codec_ctx, pd)) { FREEMEM(epres); @@ -1214,7 +1226,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* Fill DEFAULT members in extensions */ for(edx = specs->roms_count; edx < specs->roms_count - + specs->aoms_count; edx++) { + + specs->aoms_count; edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void **memb_ptr2; /* Pointer to member pointer */ @@ -1223,7 +1235,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* Fetch the pointer to this member */ if(elm->flags & ATF_POINTER) { memb_ptr2 = (void **)((char *)st - + elm->memb_offset); + + elm->memb_offset); if(*memb_ptr2) continue; } else { continue; /* Extensions are all optionals */ @@ -1242,9 +1254,9 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, static int SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr, - asn_per_outp_t *po1, asn_per_outp_t *po2) { + asn_per_outp_t *po1, asn_per_outp_t *po2) { asn_SEQUENCE_specifics_t *specs - = (asn_SEQUENCE_specifics_t *)td->specifics; + = (asn_SEQUENCE_specifics_t *)td->specifics; int exts_present = 0; int exts_count = 0; int edx; @@ -1275,7 +1287,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr, } ASN_DEBUG("checking %s (@%d) present => %d", - elm->type->name, edx, present); + elm->type->name, edx, present); exts_count++; exts_present += present; @@ -1284,7 +1296,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr, return -1; /* Encode as open type field */ if(po2 && present && uper_open_type_put(elm->type, - elm->per_constraints, *memb_ptr2, po2)) + elm->per_constraints, *memb_ptr2, po2)) return -1; } @@ -1294,9 +1306,9 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr, asn_enc_rval_t SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_SEQUENCE_specifics_t *specs - = (asn_SEQUENCE_specifics_t *)td->specifics; + = (asn_SEQUENCE_specifics_t *)td->specifics; asn_enc_rval_t er; int n_extensions; int edx; @@ -1345,13 +1357,13 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td, /* Eliminate default values */ if(present && elm->default_value - && elm->default_value(0, memb_ptr2) == 1) + && elm->default_value(0, memb_ptr2) == 1) present = 0; ASN_DEBUG("Element %s %s %s->%s is %s", - elm->flags & ATF_POINTER ? "ptr" : "inline", - elm->default_value ? "def" : "wtv", - td->name, elm->name, present ? "present" : "absent"); + elm->flags & ATF_POINTER ? "ptr" : "inline", + elm->default_value ? "def" : "wtv", + td->name, elm->name, present ? "present" : "absent"); if(per_put_few_bits(po, present, 1)) _ASN_ENCODE_FAILED; } @@ -1361,7 +1373,7 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td, */ ASN_DEBUG("ext_after = %d, ec = %d, eb = %d", specs->ext_after, td->elements_count, specs->ext_before); for(edx = 0; edx < ((specs->ext_after < 0) - ? td->elements_count : specs->ext_before - 1); edx++) { + ? td->elements_count : specs->ext_before - 1); edx++) { asn_TYPE_member_t *elm = &td->elements[edx]; void *memb_ptr; /* Pointer to the member */ @@ -1377,7 +1389,7 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td, memb_ptr2 = (void **)((char *)sptr + elm->memb_offset); if(!*memb_ptr2) { ASN_DEBUG("Element %s %d not present", - elm->name, edx); + elm->name, edx); if(elm->optional) continue; /* Mandatory element is missing */ @@ -1394,7 +1406,7 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td, ASN_DEBUG("Encoding %s->%s", td->name, elm->name); er = elm->type->uper_encoder(elm->type, elm->per_constraints, - *memb_ptr2, po); + *memb_ptr2, po); if(er.encoded == -1) return er; } diff --git a/src/third_party/asn1/constr_SEQUENCE.h b/src/third_party/asn1/constr_SEQUENCE.h index 5f589d5c..72781be2 100644 --- a/src/third_party/asn1/constr_SEQUENCE.h +++ b/src/third_party/asn1/constr_SEQUENCE.h @@ -11,47 +11,47 @@ extern "C" { #endif -typedef struct asn_SEQUENCE_specifics_s { - /* - * Target structure description. - */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + typedef struct asn_SEQUENCE_specifics_s { + /* + * Target structure description. + */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + + /* + * Tags to members mapping table (sorted). + */ + asn_TYPE_tag2member_t *tag2el; + int tag2el_count; + + /* + * Optional members of the extensions root (roms) or additions (aoms). + * Meaningful for PER. + */ + int *oms; /* Optional MemberS */ + int roms_count; /* Root optional members count */ + int aoms_count; /* Additions optional members count */ + + /* + * Description of an extensions group. + */ + int ext_after; /* Extensions start after this member */ + int ext_before; /* Extensions stop before this member */ + } asn_SEQUENCE_specifics_t; + /* - * Tags to members mapping table (sorted). + * A set specialized functions dealing with the SEQUENCE type. */ - asn_TYPE_tag2member_t *tag2el; - int tag2el_count; - - /* - * Optional members of the extensions root (roms) or additions (aoms). - * Meaningful for PER. - */ - int *oms; /* Optional MemberS */ - int roms_count; /* Root optional members count */ - int aoms_count; /* Additions optional members count */ - - /* - * Description of an extensions group. - */ - int ext_after; /* Extensions start after this member */ - int ext_before; /* Extensions stop before this member */ -} asn_SEQUENCE_specifics_t; - - -/* - * A set specialized functions dealing with the SEQUENCE type. - */ -asn_struct_free_f SEQUENCE_free; -asn_struct_print_f SEQUENCE_print; -asn_constr_check_f SEQUENCE_constraint; -ber_type_decoder_f SEQUENCE_decode_ber; -der_type_encoder_f SEQUENCE_encode_der; -xer_type_decoder_f SEQUENCE_decode_xer; -xer_type_encoder_f SEQUENCE_encode_xer; -per_type_decoder_f SEQUENCE_decode_uper; -per_type_encoder_f SEQUENCE_encode_uper; + asn_struct_free_f SEQUENCE_free; + asn_struct_print_f SEQUENCE_print; + asn_constr_check_f SEQUENCE_constraint; + ber_type_decoder_f SEQUENCE_decode_ber; + der_type_encoder_f SEQUENCE_encode_der; + xer_type_decoder_f SEQUENCE_decode_xer; + xer_type_encoder_f SEQUENCE_encode_xer; + per_type_decoder_f SEQUENCE_decode_uper; + per_type_encoder_f SEQUENCE_encode_uper; #ifdef __cplusplus } diff --git a/src/third_party/asn1/constr_SEQUENCE_OF.c b/src/third_party/asn1/constr_SEQUENCE_OF.c index aa101176..a3fa5c2f 100644 --- a/src/third_party/asn1/constr_SEQUENCE_OF.c +++ b/src/third_party/asn1/constr_SEQUENCE_OF.c @@ -12,8 +12,8 @@ */ asn_enc_rval_t SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { asn_TYPE_member_t *elm = td->elements; asn_anonymous_sequence_ *list = _A_SEQUENCE_FROM_VOID(ptr); size_t computed_size = 0; @@ -30,8 +30,8 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, void *memb_ptr = list->array[edx]; if(!memb_ptr) continue; erval = elm->type->der_encoder(elm->type, memb_ptr, - 0, elm->tag, - 0, 0); + 0, elm->tag, + 0, 0); if(erval.encoded == -1) return erval; computed_size += erval.encoded; @@ -41,7 +41,7 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, * Encode the TLV for the sequence itself. */ encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, - cb, app_key); + cb, app_key); if(encoding_size == -1) { erval.encoded = -1; erval.failed_type = td; @@ -64,8 +64,8 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, void *memb_ptr = list->array[edx]; if(!memb_ptr) continue; erval = elm->type->der_encoder(elm->type, memb_ptr, - 0, elm->tag, - cb, app_key); + 0, elm->tag, + cb, app_key); if(erval.encoded == -1) return erval; encoding_size += erval.encoded; @@ -89,14 +89,14 @@ SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, asn_enc_rval_t SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_TYPE_member_t *elm = td->elements; asn_anonymous_sequence_ *list = _A_SEQUENCE_FROM_VOID(sptr); const char *mname = specs->as_XMLValueList - ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); + ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); unsigned int mlen = mname ? strlen(mname) : 0; int xcan = (flags & XER_F_CANONICAL); int i; @@ -116,14 +116,14 @@ SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, } tmper = elm->type->xer_encoder(elm->type, memb_ptr, - ilevel + 1, flags, cb, app_key); + ilevel + 1, flags, cb, app_key); if(tmper.encoded == -1) return tmper; - if(tmper.encoded == 0 && specs->as_XMLValueList) { - const char *name = elm->type->xml_tag; + if(tmper.encoded == 0 && specs->as_XMLValueList) { + const char *name = elm->type->xml_tag; size_t len = strlen(name); if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel + 1); _ASN_CALLBACK3("<", 1, name, len, "/>", 2); - } + } if(mname) { _ASN_CALLBACK3("", 1); @@ -142,7 +142,7 @@ cb_failed: asn_enc_rval_t SEQUENCE_OF_encode_uper(asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { + asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) { asn_anonymous_sequence_ *list; asn_per_constraint_t *ct; asn_enc_rval_t er; @@ -163,10 +163,10 @@ SEQUENCE_OF_encode_uper(asn_TYPE_descriptor_t *td, /* If extensible constraint, check if size is in root */ if(ct) { int not_in_root = (list->count < ct->lower_bound - || list->count > ct->upper_bound); + || list->count > ct->upper_bound); ASN_DEBUG("lb %ld ub %ld %s", - ct->lower_bound, ct->upper_bound, - ct->flags & APC_EXTENSIBLE ? "ext" : "fix"); + ct->lower_bound, ct->upper_bound, + ct->flags & APC_EXTENSIBLE ? "ext" : "fix"); if(ct->flags & APC_EXTENSIBLE) { /* Declare whether size is in extension root */ if(per_put_few_bits(po, not_in_root, 1)) @@ -179,7 +179,7 @@ SEQUENCE_OF_encode_uper(asn_TYPE_descriptor_t *td, if(ct && ct->effective_bits >= 0) { /* X.691, #19.5: No length determinant */ if(per_put_few_bits(po, list->count - ct->lower_bound, - ct->effective_bits)) + ct->effective_bits)) _ASN_ENCODE_FAILED; } @@ -197,7 +197,7 @@ SEQUENCE_OF_encode_uper(asn_TYPE_descriptor_t *td, void *memb_ptr = list->array[seq++]; if(!memb_ptr) _ASN_ENCODE_FAILED; er = elm->type->uper_encoder(elm->type, - elm->per_constraints, memb_ptr, po); + elm->per_constraints, memb_ptr, po); if(er.encoded == -1) _ASN_ENCODE_FAILED; } diff --git a/src/third_party/asn1/constr_SEQUENCE_OF.h b/src/third_party/asn1/constr_SEQUENCE_OF.h index e2272f32..b75fe4e9 100644 --- a/src/third_party/asn1/constr_SEQUENCE_OF.h +++ b/src/third_party/asn1/constr_SEQUENCE_OF.h @@ -12,19 +12,19 @@ extern "C" { #endif -/* - * A set specialized functions dealing with the SEQUENCE OF type. - * Generally implemented using SET OF. - */ + /* + * A set specialized functions dealing with the SEQUENCE OF type. + * Generally implemented using SET OF. + */ #define SEQUENCE_OF_free SET_OF_free #define SEQUENCE_OF_print SET_OF_print #define SEQUENCE_OF_constraint SET_OF_constraint #define SEQUENCE_OF_decode_ber SET_OF_decode_ber #define SEQUENCE_OF_decode_xer SET_OF_decode_xer #define SEQUENCE_OF_decode_uper SET_OF_decode_uper -der_type_encoder_f SEQUENCE_OF_encode_der; -xer_type_encoder_f SEQUENCE_OF_encode_xer; -per_type_encoder_f SEQUENCE_OF_encode_uper; + der_type_encoder_f SEQUENCE_OF_encode_der; + xer_type_encoder_f SEQUENCE_OF_encode_xer; + per_type_encoder_f SEQUENCE_OF_encode_uper; #ifdef __cplusplus } diff --git a/src/third_party/asn1/constr_SET_OF.c b/src/third_party/asn1/constr_SET_OF.c index 11eac57a..44fc4c70 100644 --- a/src/third_party/asn1/constr_SET_OF.c +++ b/src/third_party/asn1/constr_SET_OF.c @@ -67,7 +67,7 @@ */ asn_dec_rval_t SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const void *ptr, size_t size, int tag_mode) { + void **struct_ptr, const void *ptr, size_t size, int tag_mode) { /* * Bring closer parts of structure description. */ @@ -86,7 +86,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ssize_t consumed_myself = 0; /* Consumed bytes from ptr */ ASN_DEBUG("Decoding %s as SET OF", td->name); - + /* * Create the target structure if it is not present already. */ @@ -101,7 +101,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * Restore parsing context. */ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset); - + /* * Start to parse where left previously */ @@ -114,10 +114,10 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, */ rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size, - tag_mode, 1, &ctx->left, 0); + tag_mode, 1, &ctx->left, 0); if(rval.code != RC_OK) { ASN_DEBUG("%s tagging check failed: %d", - td->name, rval.code); + td->name, rval.code); return rval; } @@ -126,7 +126,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ADVANCE(rval.consumed); ASN_DEBUG("Structure consumes %ld bytes, " - "buffer %ld", (long)ctx->left, (long)size); + "buffer %ld", (long)ctx->left, (long)size); NEXT_PHASE(ctx); /* Fall through */ @@ -136,82 +136,84 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * From the place where we've left it previously, * try to decode the next item. */ - for(;; ctx->step = 0) { - ssize_t tag_len; /* Length of TLV's T */ + for(;; ctx->step = 0) { + ssize_t tag_len; /* Length of TLV's T */ - if(ctx->step & 1) - goto microphase2; + if(ctx->step & 1) + goto microphase2; - /* - * MICROPHASE 1: Synchronize decoding. - */ - - if(ctx->left == 0) { - ASN_DEBUG("End of SET OF %s", td->name); /* - * No more things to decode. - * Exit out of here. + * MICROPHASE 1: Synchronize decoding. */ - PHASE_OUT(ctx); - RETURN(RC_OK); - } - /* - * Fetch the T from TLV. - */ - tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); - switch(tag_len) { - case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE); - /* Fall through */ - case -1: RETURN(RC_FAIL); - } - - if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { - if(LEFT < 2) { - if(SIZE_VIOLATION) - RETURN(RC_FAIL); - else - RETURN(RC_WMORE); - } else if(((const uint8_t *)ptr)[1] == 0) { + if(ctx->left == 0) { + ASN_DEBUG("End of SET OF %s", td->name); /* - * Found the terminator of the - * indefinite length structure. + * No more things to decode. + * Exit out of here. */ - break; + PHASE_OUT(ctx); + RETURN(RC_OK); } - } - /* Outmost tag may be unknown and cannot be fetched/compared */ - if(elm->tag != (ber_tlv_tag_t)-1) { - if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) { /* - * The new list member of expected type has arrived. + * Fetch the T from TLV. */ - } else { - ASN_DEBUG("Unexpected tag %s fixed SET OF %s", - ber_tlv_tag_string(tlv_tag), td->name); - ASN_DEBUG("%s SET OF has tag %s", - td->name, ber_tlv_tag_string(elm->tag)); - RETURN(RC_FAIL); - } - } + tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag); + switch(tag_len) { + case 0: + if(!SIZE_VIOLATION) RETURN(RC_WMORE); + /* Fall through */ + case -1: + RETURN(RC_FAIL); + } - /* - * MICROPHASE 2: Invoke the member-specific decoder. - */ - ctx->step |= 1; /* Confirm entering next microphase */ - microphase2: - - /* - * Invoke the member fetch routine according to member's type - */ - rval = elm->type->ber_decoder(opt_codec_ctx, - elm->type, &ctx->ptr, ptr, LEFT, 0); - ASN_DEBUG("In %s SET OF %s code %d consumed %d", - td->name, elm->type->name, - rval.code, (int)rval.consumed); - switch(rval.code) { - case RC_OK: + if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) { + if(LEFT < 2) { + if(SIZE_VIOLATION) + RETURN(RC_FAIL); + else + RETURN(RC_WMORE); + } else if(((const uint8_t *)ptr)[1] == 0) { + /* + * Found the terminator of the + * indefinite length structure. + */ + break; + } + } + + /* Outmost tag may be unknown and cannot be fetched/compared */ + if(elm->tag != (ber_tlv_tag_t)-1) { + if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) { + /* + * The new list member of expected type has arrived. + */ + } else { + ASN_DEBUG("Unexpected tag %s fixed SET OF %s", + ber_tlv_tag_string(tlv_tag), td->name); + ASN_DEBUG("%s SET OF has tag %s", + td->name, ber_tlv_tag_string(elm->tag)); + RETURN(RC_FAIL); + } + } + + /* + * MICROPHASE 2: Invoke the member-specific decoder. + */ + ctx->step |= 1; /* Confirm entering next microphase */ +microphase2: + + /* + * Invoke the member fetch routine according to member's type + */ + rval = elm->type->ber_decoder(opt_codec_ctx, + elm->type, &ctx->ptr, ptr, LEFT, 0); + ASN_DEBUG("In %s SET OF %s code %d consumed %d", + td->name, elm->type->name, + rval.code, (int)rval.consumed); + switch(rval.code) { + case RC_OK: { asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); if(ASN_SET_ADD(list, ctx->ptr) != 0) @@ -220,20 +222,20 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ctx->ptr = 0; } break; - case RC_WMORE: /* More data expected */ - if(!SIZE_VIOLATION) { - ADVANCE(rval.consumed); - RETURN(RC_WMORE); - } - /* Fall through */ - case RC_FAIL: /* Fatal error */ - ASN_STRUCT_FREE(*elm->type, ctx->ptr); - ctx->ptr = 0; - RETURN(RC_FAIL); - } /* switch(rval) */ - - ADVANCE(rval.consumed); - } /* for(all list members) */ + case RC_WMORE: /* More data expected */ + if(!SIZE_VIOLATION) { + ADVANCE(rval.consumed); + RETURN(RC_WMORE); + } + /* Fall through */ + case RC_FAIL: /* Fatal error */ + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; + RETURN(RC_FAIL); + } /* switch(rval) */ + + ADVANCE(rval.consumed); + } /* for(all list members) */ NEXT_PHASE(ctx); case 2: @@ -250,7 +252,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, } } if(((const char *)ptr)[0] == 0 - && ((const char *)ptr)[1] == 0) { + && ((const char *)ptr)[1] == 0) { ADVANCE(2); ctx->left++; } else { @@ -260,7 +262,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, PHASE_OUT(ctx); } - + RETURN(RC_OK); } @@ -311,8 +313,8 @@ static int _el_buf_cmp(const void *ap, const void *bp) { */ asn_enc_rval_t SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, - int tag_mode, ber_tlv_tag_t tag, - asn_app_consume_bytes_f *cb, void *app_key) { + int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *cb, void *app_key) { asn_TYPE_member_t *elm = td->elements; asn_TYPE_descriptor_t *elm_type = elm->type; der_type_encoder_f *der_encoder = elm_type->der_encoder; @@ -348,7 +350,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, * Encode the TLV for the sequence itself. */ encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag, - cb, app_key); + cb, app_key); if(encoding_size == -1) { erval.encoded = -1; erval.failed_type = td; @@ -368,7 +370,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, * encoded elements. */ encoded_els = (struct _el_buffer *)MALLOC( - list->count * sizeof(encoded_els[0])); + list->count * sizeof(encoded_els[0])); if(encoded_els == NULL) { erval.encoded = -1; erval.failed_type = td; @@ -408,7 +410,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, * Encode the member into the prepared space. */ erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, - _el_addbytes, encoded_el); + _el_addbytes, encoded_el); if(erval.encoded == -1) { for(; edx >= 0; edx--) FREEMEM(encoded_els[edx].buf); @@ -433,7 +435,7 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, struct _el_buffer *encoded_el = &encoded_els[edx]; /* Report encoded chunks to the application */ if(ret == 0 - && cb(encoded_el->buf, encoded_el->length, app_key) < 0) + && cb(encoded_el->buf, encoded_el->length, app_key) < 0) ret = -1; FREEMEM(encoded_el->buf); } @@ -467,8 +469,8 @@ SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr, */ asn_dec_rval_t SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const char *opt_mname, - const void *buf_ptr, size_t size) { + void **struct_ptr, const char *opt_mname, + const void *buf_ptr, size_t size) { /* * Bring closer parts of structure description. */ @@ -499,7 +501,7 @@ SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, elm_tag = (specs->as_XMLValueList == 1) ? 0 : ""; } else { elm_tag = (*element->name) - ? element->name : element->type->xml_tag; + ? element->name : element->type->xml_tag; } /* @@ -527,8 +529,8 @@ SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* Invoke the inner type decoder, m.b. multiple times */ ASN_DEBUG("XER/SET OF element [%s]", elm_tag); tmprval = element->type->xer_decoder(opt_codec_ctx, - element->type, &ctx->ptr, elm_tag, - buf_ptr, size); + element->type, &ctx->ptr, elm_tag, + buf_ptr, size); if(tmprval.code == RC_OK) { asn_anonymous_set_ *list = _A_SET_FROM_VOID(st); if(ASN_SET_ADD(list, ctx->ptr) != 0) @@ -548,10 +550,12 @@ SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, * Get the next part of the XML stream. */ ch_size = xer_next_token(&ctx->context, - buf_ptr, size, &ch_type); + buf_ptr, size, &ch_type); switch(ch_size) { - case -1: RETURN(RC_FAIL); - case 0: RETURN(RC_WMORE); + case -1: + RETURN(RC_FAIL); + case 0: + RETURN(RC_WMORE); default: switch(ch_type) { case PXER_COMMENT: /* Got XML comment */ @@ -565,7 +569,7 @@ SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, tcv = xer_check_tag(buf_ptr, ch_size, xml_tag); ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s", - tcv, ctx->phase, xml_tag); + tcv, ctx->phase, xml_tag); switch(tcv) { case XCT_CLOSING: if(ctx->phase == 0) break; @@ -651,14 +655,14 @@ SET_OF_xer_order(const void *aptr, const void *bptr) { asn_enc_rval_t SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, - int ilevel, enum xer_encoder_flags_e flags, - asn_app_consume_bytes_f *cb, void *app_key) { + int ilevel, enum xer_encoder_flags_e flags, + asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er; asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_TYPE_member_t *elm = td->elements; asn_anonymous_set_ *list = _A_SET_FROM_VOID(sptr); const char *mname = specs->as_XMLValueList - ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); + ? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag); size_t mlen = mname ? strlen(mname) : 0; int xcan = (flags & XER_F_CANONICAL); xer_tmp_enc_t *encs = 0; @@ -697,8 +701,8 @@ SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr, if(!xcan && specs->as_XMLValueList == 1) _i_ASN_TEXT_INDENT(1, ilevel + 1); tmper = elm->type->xer_encoder(elm->type, memb_ptr, - ilevel + (specs->as_XMLValueList != 2), - flags, cb, app_key); + ilevel + (specs->as_XMLValueList != 2), + flags, cb, app_key); if(tmper.encoded == -1) { td = tmper.failed_type; sptr = tmper.structure_ptr; @@ -756,7 +760,7 @@ cleanup: int SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, - asn_app_consume_bytes_f *cb, void *app_key) { + asn_app_consume_bytes_f *cb, void *app_key) { asn_TYPE_member_t *elm = td->elements; const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); int ret; @@ -766,7 +770,7 @@ SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, /* Dump preamble */ if(cb(td->name, strlen(td->name), app_key) < 0 - || cb(" ::= {", 6, app_key) < 0) + || cb(" ::= {", 6, app_key) < 0) return -1; for(i = 0; i < list->count; i++) { @@ -776,7 +780,7 @@ SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, _i_INDENT(1); ret = elm->type->print_struct(elm->type, memb_ptr, - ilevel + 1, cb, app_key); + ilevel + 1, cb, app_key); if(ret) return ret; } @@ -802,7 +806,7 @@ SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { for(i = 0; i < list->count; i++) { void *memb_ptr = list->array[i]; if(memb_ptr) - ASN_STRUCT_FREE(*elm->type, memb_ptr); + ASN_STRUCT_FREE(*elm->type, memb_ptr); } list->count = 0; /* No meaningful elements left */ @@ -823,7 +827,7 @@ SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { int SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, - asn_app_constraint_failed_f *ctfailcb, void *app_key) { + asn_app_constraint_failed_f *ctfailcb, void *app_key) { asn_TYPE_member_t *elm = td->elements; asn_constr_check_f *constr; const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr); @@ -831,8 +835,8 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, - "%s: value not given (%s:%d)", - td->name, __FILE__, __LINE__); + "%s: value not given (%s:%d)", + td->name, __FILE__, __LINE__); return -1; } @@ -865,9 +869,9 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_dec_rval_t SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; - asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; + asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics; asn_TYPE_member_t *elm = td->elements; /* Single one */ void *st = *sptr; asn_anonymous_set_ *list; @@ -884,7 +888,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(!st) { st = *sptr = CALLOC(1, specs->struct_size); if(!st) _ASN_DECODE_FAILED; - } + } list = _A_SET_FROM_VOID(st); /* Figure out which constraints to use */ @@ -902,7 +906,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, /* X.691, #19.5: No length determinant */ nelems = per_get_few_bits(pd, ct->effective_bits); ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s", - (long)nelems, ct->lower_bound, td->name); + (long)nelems, ct->lower_bound, td->name); if(nelems < 0) _ASN_DECODE_STARVED; nelems += ct->lower_bound; } else { @@ -913,9 +917,9 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, int i; if(nelems < 0) { nelems = uper_get_length(pd, - ct ? ct->effective_bits : -1, &repeat); + ct ? ct->effective_bits : -1, &repeat); ASN_DEBUG("Got to decode %d elements (eff %d)", - (int)nelems, (int)ct ? ct->effective_bits : -1); + (int)nelems, (int)ct ? ct->effective_bits : -1); if(nelems < 0) _ASN_DECODE_STARVED; } @@ -923,19 +927,19 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void *ptr = 0; ASN_DEBUG("SET OF %s decoding", elm->type->name); rv = elm->type->uper_decoder(opt_codec_ctx, elm->type, - elm->per_constraints, &ptr, pd); + elm->per_constraints, &ptr, pd); ASN_DEBUG("%s SET OF %s decoded %d, %p", - td->name, elm->type->name, rv.code, ptr); + td->name, elm->type->name, rv.code, ptr); if(rv.code == RC_OK) { if(ASN_SET_ADD(list, ptr) == 0) continue; ASN_DEBUG("Failed to add element into %s", - td->name); + td->name); /* Fall through */ rv.code = RC_FAIL; } else { ASN_DEBUG("Failed decoding %s of %s (SET OF)", - elm->type->name, td->name); + elm->type->name, td->name); } if(ptr) ASN_STRUCT_FREE(*elm->type, ptr); return rv; diff --git a/src/third_party/asn1/constr_SET_OF.h b/src/third_party/asn1/constr_SET_OF.h index bcd09662..2e01a0df 100644 --- a/src/third_party/asn1/constr_SET_OF.h +++ b/src/third_party/asn1/constr_SET_OF.h @@ -11,29 +11,29 @@ extern "C" { #endif -typedef struct asn_SET_OF_specifics_s { + typedef struct asn_SET_OF_specifics_s { + /* + * Target structure description. + */ + int struct_size; /* Size of the target structure. */ + int ctx_offset; /* Offset of the asn_struct_ctx_t member */ + + /* XER-specific stuff */ + int as_XMLValueList; /* The member type must be encoded like this */ + } asn_SET_OF_specifics_t; + /* - * Target structure description. + * A set specialized functions dealing with the SET OF type. */ - int struct_size; /* Size of the target structure. */ - int ctx_offset; /* Offset of the asn_struct_ctx_t member */ - - /* XER-specific stuff */ - int as_XMLValueList; /* The member type must be encoded like this */ -} asn_SET_OF_specifics_t; - -/* - * A set specialized functions dealing with the SET OF type. - */ -asn_struct_free_f SET_OF_free; -asn_struct_print_f SET_OF_print; -asn_constr_check_f SET_OF_constraint; -ber_type_decoder_f SET_OF_decode_ber; -der_type_encoder_f SET_OF_encode_der; -xer_type_decoder_f SET_OF_decode_xer; -xer_type_encoder_f SET_OF_encode_xer; -per_type_decoder_f SET_OF_decode_uper; -per_type_encoder_f SET_OF_encode_uper; + asn_struct_free_f SET_OF_free; + asn_struct_print_f SET_OF_print; + asn_constr_check_f SET_OF_constraint; + ber_type_decoder_f SET_OF_decode_ber; + der_type_encoder_f SET_OF_encode_der; + xer_type_decoder_f SET_OF_decode_xer; + xer_type_encoder_f SET_OF_encode_xer; + per_type_decoder_f SET_OF_decode_uper; + per_type_encoder_f SET_OF_encode_uper; #ifdef __cplusplus } diff --git a/src/third_party/asn1/constr_TYPE.c b/src/third_party/asn1/constr_TYPE.c index 4bc88d44..eeb6c900 100644 --- a/src/third_party/asn1/constr_TYPE.c +++ b/src/third_party/asn1/constr_TYPE.c @@ -9,7 +9,9 @@ /* * Version of the ASN.1 infrastructure shipped with compiler. */ -int get_asn1c_environment_version() { return ASN1C_ENVIRONMENT_VERSION; } +int get_asn1c_environment_version() { + return ASN1C_ENVIRONMENT_VERSION; +} static asn_app_consume_bytes_f _print2fp; @@ -18,7 +20,7 @@ static asn_app_consume_bytes_f _print2fp; */ ber_tlv_tag_t asn_TYPE_outmost_tag(asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) { + const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) { if(tag_mode) return tag; diff --git a/src/third_party/asn1/constr_TYPE.h b/src/third_party/asn1/constr_TYPE.h index 95507c80..daf53c91 100644 --- a/src/third_party/asn1/constr_TYPE.h +++ b/src/third_party/asn1/constr_TYPE.h @@ -19,21 +19,21 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ -struct asn_TYPE_member_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_member_s; /* Forward declaration */ -/* - * This type provides the context information for various ASN.1 routines, - * primarily ones doing decoding. A member _asn_ctx of this type must be - * included into certain target language's structures, such as compound types. - */ -typedef struct asn_struct_ctx_s { - short phase; /* Decoding phase */ - short step; /* Elementary step of a phase */ - int context; /* Other context information */ - void *ptr; /* Decoder-specific stuff (stack elements) */ - ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ -} asn_struct_ctx_t; + /* + * This type provides the context information for various ASN.1 routines, + * primarily ones doing decoding. A member _asn_ctx of this type must be + * included into certain target language's structures, such as compound types. + */ + typedef struct asn_struct_ctx_s { + short phase; /* Decoding phase */ + short step; /* Elementary step of a phase */ + int context; /* Other context information */ + void *ptr; /* Decoder-specific stuff (stack elements) */ + ber_tlv_len_t left; /* Number of bytes left, -1 for indefinite */ + } asn_struct_ctx_t; #include /* Basic Encoding Rules decoder */ #include /* Distinguished Encoding Rules encoder */ @@ -43,135 +43,135 @@ typedef struct asn_struct_ctx_s { #include /* Packet Encoding Rules encoder */ #include /* Subtype constraints support */ -/* - * Free the structure according to its specification. - * If (free_contents_only) is set, the wrapper structure itself (struct_ptr) - * will not be freed. (It may be useful in case the structure is allocated - * statically or arranged on the stack, yet its elements are allocated - * dynamically.) - */ -typedef void (asn_struct_free_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, int free_contents_only); + /* + * Free the structure according to its specification. + * If (free_contents_only) is set, the wrapper structure itself (struct_ptr) + * will not be freed. (It may be useful in case the structure is allocated + * statically or arranged on the stack, yet its elements are allocated + * dynamically.) + */ + typedef void (asn_struct_free_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, int free_contents_only); #define ASN_STRUCT_FREE(asn_DEF, ptr) (asn_DEF).free_struct(&(asn_DEF),ptr,0) #define ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF, ptr) \ (asn_DEF).free_struct(&(asn_DEF),ptr,1) -/* - * Print the structure according to its specification. - */ -typedef int (asn_struct_print_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, - int level, /* Indentation level */ - asn_app_consume_bytes_f *callback, void *app_key); - -/* - * Return the outmost tag of the type. - * If the type is untagged CHOICE, the dynamic operation is performed. - * NOTE: This function pointer type is only useful internally. - * Do not use it in your application. - */ -typedef ber_tlv_tag_t (asn_outmost_tag_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); -/* The instance of the above function type; used internally. */ -asn_outmost_tag_f asn_TYPE_outmost_tag; - - -/* - * The definitive description of the destination language's structure. - */ -typedef struct asn_TYPE_descriptor_s { - char *name; /* A name of the ASN.1 type. "" in some cases. */ - char *xml_tag; /* Name used in XML tag */ + /* + * Print the structure according to its specification. + */ + typedef int (asn_struct_print_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, + int level, /* Indentation level */ + asn_app_consume_bytes_f *callback, void *app_key); /* - * Generalized functions for dealing with the specific type. - * May be directly invoked by applications. + * Return the outmost tag of the type. + * If the type is untagged CHOICE, the dynamic operation is performed. + * NOTE: This function pointer type is only useful internally. + * Do not use it in your application. */ - asn_struct_free_f *free_struct; /* Free the structure */ - asn_struct_print_f *print_struct; /* Human readable output */ - asn_constr_check_f *check_constraints; /* Constraints validator */ - ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ - der_type_encoder_f *der_encoder; /* Canonical DER encoder */ - xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ - xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ - per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ - per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ + typedef ber_tlv_tag_t (asn_outmost_tag_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag); + /* The instance of the above function type; used internally. */ + asn_outmost_tag_f asn_TYPE_outmost_tag; - /*********************************************************************** - * Internally useful members. Not to be used by applications directly. * - **********************************************************************/ + + /* + * The definitive description of the destination language's structure. + */ + typedef struct asn_TYPE_descriptor_s { + char *name; /* A name of the ASN.1 type. "" in some cases. */ + char *xml_tag; /* Name used in XML tag */ + + /* + * Generalized functions for dealing with the specific type. + * May be directly invoked by applications. + */ + asn_struct_free_f *free_struct; /* Free the structure */ + asn_struct_print_f *print_struct; /* Human readable output */ + asn_constr_check_f *check_constraints; /* Constraints validator */ + ber_type_decoder_f *ber_decoder; /* Generic BER decoder */ + der_type_encoder_f *der_encoder; /* Canonical DER encoder */ + xer_type_decoder_f *xer_decoder; /* Generic XER decoder */ + xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */ + per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */ + per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */ + + /*********************************************************************** + * Internally useful members. Not to be used by applications directly. * + **********************************************************************/ + + /* + * Tags that are expected to occur. + */ + asn_outmost_tag_f *outmost_tag; /* */ + ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ + int tags_count; /* Number of tags which are expected */ + ber_tlv_tag_t *all_tags;/* Every tag for BER/containment */ + int all_tags_count; /* Number of tags */ + + asn_per_constraints_t *per_constraints; /* PER compiled constraints */ + + /* + * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE). + */ + struct asn_TYPE_member_s *elements; + int elements_count; + + /* + * Additional information describing the type, used by appropriate + * functions above. + */ + void *specifics; + } asn_TYPE_descriptor_t; /* - * Tags that are expected to occur. + * This type describes an element of the constructed type, + * i.e. SEQUENCE, SET, CHOICE, etc. */ - asn_outmost_tag_f *outmost_tag; /* */ - ber_tlv_tag_t *tags; /* Effective tags sequence for this type */ - int tags_count; /* Number of tags which are expected */ - ber_tlv_tag_t *all_tags;/* Every tag for BER/containment */ - int all_tags_count; /* Number of tags */ - - asn_per_constraints_t *per_constraints; /* PER compiled constraints */ + enum asn_TYPE_flags_e { + ATF_NOFLAGS, + ATF_POINTER = 0x01, /* Represented by the pointer */ + ATF_OPEN_TYPE = 0x02 /* ANY type, without meaningful tag */ + }; + typedef struct asn_TYPE_member_s { + enum asn_TYPE_flags_e flags; /* Element's presentation flags */ + int optional; /* Following optional members, including current */ + int memb_offset; /* Offset of the element */ + ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ + int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ + asn_TYPE_descriptor_t *type; /* Member type descriptor */ + asn_constr_check_f *memb_constraints; /* Constraints validator */ + asn_per_constraints_t *per_constraints; /* PER compiled constraints */ + int (*default_value)(int setval, void **sptr); /* DEFAULT */ + char *name; /* ASN.1 identifier of the element */ + } asn_TYPE_member_t; /* - * An ASN.1 production type members (members of SEQUENCE, SET, CHOICE). + * BER tag to element number mapping. */ - struct asn_TYPE_member_s *elements; - int elements_count; + typedef struct asn_TYPE_tag2member_s { + ber_tlv_tag_t el_tag; /* Outmost tag of the member */ + int el_no; /* Index of the associated member, base 0 */ + int toff_first; /* First occurence of the el_tag, relative */ + int toff_last; /* Last occurence of the el_tag, relatvie */ + } asn_TYPE_tag2member_t; /* - * Additional information describing the type, used by appropriate - * functions above. + * This function is a wrapper around (td)->print_struct, which prints out + * the contents of the target language's structure (struct_ptr) into the + * file pointer (stream) in human readable form. + * RETURN VALUES: + * 0: The structure is printed. + * -1: Problem dumping the structure. + * (See also xer_fprint() in xer_encoder.h) */ - void *specifics; -} asn_TYPE_descriptor_t; - -/* - * This type describes an element of the constructed type, - * i.e. SEQUENCE, SET, CHOICE, etc. - */ - enum asn_TYPE_flags_e { - ATF_NOFLAGS, - ATF_POINTER = 0x01, /* Represented by the pointer */ - ATF_OPEN_TYPE = 0x02 /* ANY type, without meaningful tag */ - }; -typedef struct asn_TYPE_member_s { - enum asn_TYPE_flags_e flags; /* Element's presentation flags */ - int optional; /* Following optional members, including current */ - int memb_offset; /* Offset of the element */ - ber_tlv_tag_t tag; /* Outmost (most immediate) tag */ - int tag_mode; /* IMPLICIT/no/EXPLICIT tag at current level */ - asn_TYPE_descriptor_t *type; /* Member type descriptor */ - asn_constr_check_f *memb_constraints; /* Constraints validator */ - asn_per_constraints_t *per_constraints; /* PER compiled constraints */ - int (*default_value)(int setval, void **sptr); /* DEFAULT */ - char *name; /* ASN.1 identifier of the element */ -} asn_TYPE_member_t; - -/* - * BER tag to element number mapping. - */ -typedef struct asn_TYPE_tag2member_s { - ber_tlv_tag_t el_tag; /* Outmost tag of the member */ - int el_no; /* Index of the associated member, base 0 */ - int toff_first; /* First occurence of the el_tag, relative */ - int toff_last; /* Last occurence of the el_tag, relatvie */ -} asn_TYPE_tag2member_t; - -/* - * This function is a wrapper around (td)->print_struct, which prints out - * the contents of the target language's structure (struct_ptr) into the - * file pointer (stream) in human readable form. - * RETURN VALUES: - * 0: The structure is printed. - * -1: Problem dumping the structure. - * (See also xer_fprint() in xer_encoder.h) - */ -int asn_fprint(FILE *stream, /* Destination stream descriptor */ - asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ - const void *struct_ptr); /* Structure to be printed */ + int asn_fprint(FILE *stream, /* Destination stream descriptor */ + asn_TYPE_descriptor_t *td, /* ASN.1 type descriptor */ + const void *struct_ptr); /* Structure to be printed */ #ifdef __cplusplus } diff --git a/src/third_party/asn1/constraints.c b/src/third_party/asn1/constraints.c index 1bdda73e..97d9d69d 100644 --- a/src/third_party/asn1/constraints.c +++ b/src/third_party/asn1/constraints.c @@ -3,7 +3,7 @@ int asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { + const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { (void)type_descriptor; /* Unused argument */ (void)struct_ptr; /* Unused argument */ @@ -16,7 +16,7 @@ asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, int asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { + const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { (void)type_descriptor; /* Unused argument */ (void)struct_ptr; /* Unused argument */ @@ -74,7 +74,7 @@ _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const ch int asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, - const void *struct_ptr, char *errbuf, size_t *errlen) { + const void *struct_ptr, char *errbuf, size_t *errlen) { struct errbufDesc arg; int ret; @@ -84,7 +84,7 @@ asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, arg.errlen = errlen ? *errlen : 0; ret = type_descriptor->check_constraints(type_descriptor, - struct_ptr, _asn_i_ctfailcb, &arg); + struct_ptr, _asn_i_ctfailcb, &arg); if(ret == -1 && errlen) *errlen = arg.errlen; diff --git a/src/third_party/asn1/constraints.h b/src/third_party/asn1/constraints.h index 5032345e..3bd2c104 100644 --- a/src/third_party/asn1/constraints.h +++ b/src/third_party/asn1/constraints.h @@ -11,49 +11,49 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* - * Validate the structure according to the ASN.1 constraints. - * If errbuf and errlen are given, they shall be pointing to the appropriate - * buffer space and its length before calling this function. Alternatively, - * they could be passed as NULL's. If constraints validation fails, - * errlen will contain the actual number of bytes taken from the errbuf - * to encode an error message (properly 0-terminated). - * - * RETURN VALUES: - * This function returns 0 in case all ASN.1 constraints are met - * and -1 if one or more constraints were failed. - */ -int -asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, /* Target language's structure */ - char *errbuf, /* Returned error description */ - size_t *errlen /* Length of the error description */ + /* + * Validate the structure according to the ASN.1 constraints. + * If errbuf and errlen are given, they shall be pointing to the appropriate + * buffer space and its length before calling this function. Alternatively, + * they could be passed as NULL's. If constraints validation fails, + * errlen will contain the actual number of bytes taken from the errbuf + * to encode an error message (properly 0-terminated). + * + * RETURN VALUES: + * This function returns 0 in case all ASN.1 constraints are met + * and -1 if one or more constraints were failed. + */ + int + asn_check_constraints(struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, /* Target language's structure */ + char *errbuf, /* Returned error description */ + size_t *errlen /* Length of the error description */ + ); + + + /* + * Generic type for constraint checking callback, + * associated with every type descriptor. + */ + typedef int (asn_constr_check_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + const void *struct_ptr, + asn_app_constraint_failed_f *optional_callback, /* Log the error */ + void *optional_app_key /* Opaque key passed to a callback */ ); + /******************************* + * INTERNALLY USEFUL FUNCTIONS * + *******************************/ -/* - * Generic type for constraint checking callback, - * associated with every type descriptor. - */ -typedef int (asn_constr_check_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - const void *struct_ptr, - asn_app_constraint_failed_f *optional_callback, /* Log the error */ - void *optional_app_key /* Opaque key passed to a callback */ - ); + asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ + asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ -/******************************* - * INTERNALLY USEFUL FUNCTIONS * - *******************************/ - -asn_constr_check_f asn_generic_no_constraint; /* No constraint whatsoever */ -asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ - -/* - * Invoke the callback with a complete error message. - */ + /* + * Invoke the callback with a complete error message. + */ #define _ASN_CTFAIL if(ctfailcb) ctfailcb #ifdef __cplusplus diff --git a/src/third_party/asn1/converter-sample.c b/src/third_party/asn1/converter-sample.c index 0a682a27..efa5b98e 100644 --- a/src/third_party/asn1/converter-sample.c +++ b/src/third_party/asn1/converter-sample.c @@ -2,9 +2,9 @@ * Generic converter template for a selected ASN.1 type. * Copyright (c) 2005, 2006, 2007 Lev Walkin . * All rights reserved. - * + * * To compile with your own ASN.1 type, please redefine the PDU as shown: - * + * * cc -DPDU=MyCustomType -o myDecoder.o -c converter-sample.c */ #ifdef HAVE_CONFIG_H @@ -35,12 +35,12 @@ extern asn_TYPE_descriptor_t *asn_pdu_collection[]; * Open file and parse its contens. */ static void *data_decode_from_file(asn_TYPE_descriptor_t *asnTypeOfPDU, - FILE *file, const char *name, ssize_t suggested_bufsize, int first_pdu); + FILE *file, const char *name, ssize_t suggested_bufsize, int first_pdu); static int write_out(const void *buffer, size_t size, void *key); static FILE *argument_to_file(char *av[], int idx); static char *argument_to_name(char *av[], int idx); - int opt_debug; /* -d (or -dd) */ +int opt_debug; /* -d (or -dd) */ static int opt_check; /* -c (constraints checking) */ static int opt_stack; /* -s (maximum stack size) */ static int opt_nopad; /* -per-nopad (PER input is not padded) */ @@ -99,243 +99,270 @@ main(int ac, char *av[]) { * Pocess the command-line argments. */ while((ch = getopt(ac, av, "i:o:1b:cdn:p:hs:" JUNKOPT)) != -1) - switch(ch) { - case 'i': - if(optarg[0] == 'b') { iform = INP_BER; break; } - if(optarg[0] == 'x') { iform = INP_XER; break; } - if(pduType->uper_decoder - && optarg[0] == 'p') { iform = INP_PER; break; } - fprintf(stderr, "-i: '%s': improper format selector\n", - optarg); - exit(EX_UNAVAILABLE); - case 'o': - if(optarg[0] == 'd') { oform = OUT_DER; break; } - if(pduType->uper_encoder - && optarg[0] == 'p') { oform = OUT_PER; break; } - if(optarg[0] == 'x') { oform = OUT_XER; break; } - if(optarg[0] == 't') { oform = OUT_TEXT; break; } - if(optarg[0] == 'n') { oform = OUT_NULL; break; } - fprintf(stderr, "-o: '%s': improper format selector\n", - optarg); - exit(EX_UNAVAILABLE); - case '1': - opt_onepdu = 1; - break; - case 'b': - suggested_bufsize = atoi(optarg); - if(suggested_bufsize < 1 - || suggested_bufsize > 16 * 1024 * 1024) { - fprintf(stderr, - "-b %s: Improper buffer size (1..16M)\n", - optarg); + switch(ch) { + case 'i': + if(optarg[0] == 'b') { + iform = INP_BER; + break; + } + if(optarg[0] == 'x') { + iform = INP_XER; + break; + } + if(pduType->uper_decoder + && optarg[0] == 'p') { + iform = INP_PER; + break; + } + fprintf(stderr, "-i: '%s': improper format selector\n", + optarg); exit(EX_UNAVAILABLE); - } - break; - case 'c': - opt_check = 1; - break; - case 'd': - opt_debug++; /* Double -dd means ASN.1 debug */ - break; - case 'n': - number_of_iterations = atoi(optarg); - if(number_of_iterations < 1) { - fprintf(stderr, - "-n %s: Improper iterations count\n", optarg); + case 'o': + if(optarg[0] == 'd') { + oform = OUT_DER; + break; + } + if(pduType->uper_encoder + && optarg[0] == 'p') { + oform = OUT_PER; + break; + } + if(optarg[0] == 'x') { + oform = OUT_XER; + break; + } + if(optarg[0] == 't') { + oform = OUT_TEXT; + break; + } + if(optarg[0] == 'n') { + oform = OUT_NULL; + break; + } + fprintf(stderr, "-o: '%s': improper format selector\n", + optarg); exit(EX_UNAVAILABLE); - } - break; - case 'p': - if(strcmp(optarg, "er-nopad") == 0) { - opt_nopad = 1; + case '1': + opt_onepdu = 1; break; - } + case 'b': + suggested_bufsize = atoi(optarg); + if(suggested_bufsize < 1 + || suggested_bufsize > 16 * 1024 * 1024) { + fprintf(stderr, + "-b %s: Improper buffer size (1..16M)\n", + optarg); + exit(EX_UNAVAILABLE); + } + break; + case 'c': + opt_check = 1; + break; + case 'd': + opt_debug++; /* Double -dd means ASN.1 debug */ + break; + case 'n': + number_of_iterations = atoi(optarg); + if(number_of_iterations < 1) { + fprintf(stderr, + "-n %s: Improper iterations count\n", optarg); + exit(EX_UNAVAILABLE); + } + break; + case 'p': + if(strcmp(optarg, "er-nopad") == 0) { + opt_nopad = 1; + break; + } #ifdef ASN_PDU_COLLECTION - if(strcmp(optarg, "list") == 0) { - asn_TYPE_descriptor_t **pdu = asn_pdu_collection; - fprintf(stderr, "Available PDU types:\n"); - for(; *pdu; pdu++) printf("%s\n", (*pdu)->name); - exit(0); - } else if(optarg[0] >= 'A' && optarg[0] <= 'Z') { - asn_TYPE_descriptor_t **pdu = asn_pdu_collection; - while(*pdu && strcmp((*pdu)->name, optarg)) pdu++; - if(*pdu) { pduType = *pdu; break; } - fprintf(stderr, "-p %s: Unrecognized PDU\n", optarg); - } + if(strcmp(optarg, "list") == 0) { + asn_TYPE_descriptor_t **pdu = asn_pdu_collection; + fprintf(stderr, "Available PDU types:\n"); + for(; *pdu; pdu++) printf("%s\n", (*pdu)->name); + exit(0); + } else if(optarg[0] >= 'A' && optarg[0] <= 'Z') { + asn_TYPE_descriptor_t **pdu = asn_pdu_collection; + while(*pdu && strcmp((*pdu)->name, optarg)) pdu++; + if(*pdu) { + pduType = *pdu; + break; + } + fprintf(stderr, "-p %s: Unrecognized PDU\n", optarg); + } #endif /* ASN_PDU_COLLECTION */ - fprintf(stderr, "-p %s: Unrecognized option\n", optarg); - exit(EX_UNAVAILABLE); - case 's': - opt_stack = atoi(optarg); - if(opt_stack < 0) { - fprintf(stderr, - "-s %s: Non-negative value expected\n", - optarg); + fprintf(stderr, "-p %s: Unrecognized option\n", optarg); exit(EX_UNAVAILABLE); - } - break; + case 's': + opt_stack = atoi(optarg); + if(opt_stack < 0) { + fprintf(stderr, + "-s %s: Non-negative value expected\n", + optarg); + exit(EX_UNAVAILABLE); + } + break; #ifdef JUNKTEST - case 'J': - opt_jprob = strtod(optarg, 0); - if(opt_jprob <= 0.0 || opt_jprob > 1.0) { - fprintf(stderr, - "-J %s: Probability range 0..1 expected \n", - optarg); - exit(EX_UNAVAILABLE); - } - break; + case 'J': + opt_jprob = strtod(optarg, 0); + if(opt_jprob <= 0.0 || opt_jprob > 1.0) { + fprintf(stderr, + "-J %s: Probability range 0..1 expected \n", + optarg); + exit(EX_UNAVAILABLE); + } + break; #endif /* JUNKTEST */ - case 'h': - default: + case 'h': + default: #ifdef ASN_CONVERTER_TITLE #define _AXS(x) #x #define _ASX(x) _AXS(x) - fprintf(stderr, "%s\n", _ASX(ASN_CONVERTER_TITLE)); + fprintf(stderr, "%s\n", _ASX(ASN_CONVERTER_TITLE)); #endif - fprintf(stderr, "Usage: %s [options] ...\n", av[0]); - fprintf(stderr, "Where options are:\n"); - if(pduType->uper_decoder) - fprintf(stderr, - " -iper Input is in Unaligned PER (Packed Encoding Rules) (DEFAULT)\n"); - fprintf(stderr, - " -iber Input is in BER (Basic Encoding Rules)%s\n", - iform == INP_PER ? "" : " (DEFAULT)"); - fprintf(stderr, - " -ixer Input is in XER (XML Encoding Rules)\n"); - if(pduType->uper_encoder) - fprintf(stderr, - " -oper Output in Unaligned PER (Packed Encoding Rules)\n"); - fprintf(stderr, - " -oder Output in DER (Distinguished Encoding Rules)\n" - " -oxer Output in XER (XML Encoding Rules) (DEFAULT)\n" - " -otext Output in plain semi-structured text (dump)\n" - " -onull Verify (decode) input, but do not output\n"); - if(pduType->uper_decoder) - fprintf(stderr, - " -per-nopad Assume PER PDUs are not padded (-iper)\n"); + fprintf(stderr, "Usage: %s [options] ...\n", av[0]); + fprintf(stderr, "Where options are:\n"); + if(pduType->uper_decoder) + fprintf(stderr, + " -iper Input is in Unaligned PER (Packed Encoding Rules) (DEFAULT)\n"); + fprintf(stderr, + " -iber Input is in BER (Basic Encoding Rules)%s\n", + iform == INP_PER ? "" : " (DEFAULT)"); + fprintf(stderr, + " -ixer Input is in XER (XML Encoding Rules)\n"); + if(pduType->uper_encoder) + fprintf(stderr, + " -oper Output in Unaligned PER (Packed Encoding Rules)\n"); + fprintf(stderr, + " -oder Output in DER (Distinguished Encoding Rules)\n" + " -oxer Output in XER (XML Encoding Rules) (DEFAULT)\n" + " -otext Output in plain semi-structured text (dump)\n" + " -onull Verify (decode) input, but do not output\n"); + if(pduType->uper_decoder) + fprintf(stderr, + " -per-nopad Assume PER PDUs are not padded (-iper)\n"); #ifdef ASN_PDU_COLLECTION - fprintf(stderr, - " -p Specify PDU type to decode\n" - " -p list List available PDUs\n"); + fprintf(stderr, + " -p Specify PDU type to decode\n" + " -p list List available PDUs\n"); #endif /* ASN_PDU_COLLECTION */ - fprintf(stderr, - " -1 Decode only the first PDU in file\n" - " -b Set the i/o buffer size (default is %ld)\n" - " -c Check ASN.1 constraints after decoding\n" - " -d Enable debugging (-dd is even better)\n" - " -n Process files times\n" - " -s Set the stack usage limit (default is %d)\n" + fprintf(stderr, + " -1 Decode only the first PDU in file\n" + " -b Set the i/o buffer size (default is %ld)\n" + " -c Check ASN.1 constraints after decoding\n" + " -d Enable debugging (-dd is even better)\n" + " -n Process files times\n" + " -s Set the stack usage limit (default is %d)\n" #ifdef JUNKTEST - " -J Set random junk test bit garbaging probability\n" + " -J Set random junk test bit garbaging probability\n" #endif - , (long)suggested_bufsize, _ASN_DEFAULT_STACK_MAX); - exit(EX_USAGE); - } + , (long)suggested_bufsize, _ASN_DEFAULT_STACK_MAX); + exit(EX_USAGE); + } ac -= optind; av += optind; if(ac < 1) { fprintf(stderr, "%s: No input files specified. " - "Try '-h' for more information\n", - av[-optind]); + "Try '-h' for more information\n", + av[-optind]); exit(EX_USAGE); } setvbuf(stdout, 0, _IOLBF, 0); for(num = 0; num < number_of_iterations; num++) { - int ac_i; - /* - * Process all files in turn. - */ - for(ac_i = 0; ac_i < ac; ac_i++) { - asn_enc_rval_t erv; - void *structure; /* Decoded structure */ - FILE *file = argument_to_file(av, ac_i); - char *name = argument_to_name(av, ac_i); - int first_pdu; - - for(first_pdu = 1; first_pdu || !opt_onepdu; first_pdu = 0) { + int ac_i; /* - * Decode the encoded structure from file. + * Process all files in turn. */ - structure = data_decode_from_file(pduType, - file, name, suggested_bufsize, first_pdu); - if(!structure) { - if(errno) { - /* Error message is already printed */ - exit(EX_DATAERR); - } else { - /* EOF */ - break; - } - } + for(ac_i = 0; ac_i < ac; ac_i++) { + asn_enc_rval_t erv; + void *structure; /* Decoded structure */ + FILE *file = argument_to_file(av, ac_i); + char *name = argument_to_name(av, ac_i); + int first_pdu; - /* Check ASN.1 constraints */ - if(opt_check) { - char errbuf[128]; - size_t errlen = sizeof(errbuf); - if(asn_check_constraints(pduType, structure, - errbuf, &errlen)) { - fprintf(stderr, "%s: ASN.1 constraint " - "check failed: %s\n", name, errbuf); - exit(EX_DATAERR); - } - } + for(first_pdu = 1; first_pdu || !opt_onepdu; first_pdu = 0) { + /* + * Decode the encoded structure from file. + */ + structure = data_decode_from_file(pduType, + file, name, suggested_bufsize, first_pdu); + if(!structure) { + if(errno) { + /* Error message is already printed */ + exit(EX_DATAERR); + } else { + /* EOF */ + break; + } + } - switch(oform) { - case OUT_NULL: + /* Check ASN.1 constraints */ + if(opt_check) { + char errbuf[128]; + size_t errlen = sizeof(errbuf); + if(asn_check_constraints(pduType, structure, + errbuf, &errlen)) { + fprintf(stderr, "%s: ASN.1 constraint " + "check failed: %s\n", name, errbuf); + exit(EX_DATAERR); + } + } + + switch(oform) { + case OUT_NULL: #ifdef JUNKTEST - if(opt_jprob == 0.0) + if(opt_jprob == 0.0) #endif - fprintf(stderr, "%s: decoded successfully\n", name); - break; - case OUT_TEXT: /* -otext */ - asn_fprint(stdout, pduType, structure); - break; - case OUT_XER: /* -oxer */ - if(xer_fprint(stdout, pduType, structure)) { - fprintf(stderr, - "%s: Cannot convert %s into XML\n", - name, pduType->name); - exit(EX_UNAVAILABLE); + fprintf(stderr, "%s: decoded successfully\n", name); + break; + case OUT_TEXT: /* -otext */ + asn_fprint(stdout, pduType, structure); + break; + case OUT_XER: /* -oxer */ + if(xer_fprint(stdout, pduType, structure)) { + fprintf(stderr, + "%s: Cannot convert %s into XML\n", + name, pduType->name); + exit(EX_UNAVAILABLE); + } + break; + case OUT_DER: + erv = der_encode(pduType, structure, write_out, stdout); + if(erv.encoded < 0) { + fprintf(stderr, + "%s: Cannot convert %s into DER\n", + name, pduType->name); + exit(EX_UNAVAILABLE); + } + DEBUG("Encoded in %ld bytes of DER", (long)erv.encoded); + break; + case OUT_PER: + erv = uper_encode(pduType, structure, write_out, stdout); + if(erv.encoded < 0) { + fprintf(stderr, + "%s: Cannot convert %s into Unaligned PER\n", + name, pduType->name); + exit(EX_UNAVAILABLE); + } + DEBUG("Encoded in %ld bits of UPER", (long)erv.encoded); + break; + } + + ASN_STRUCT_FREE(*pduType, structure); } - break; - case OUT_DER: - erv = der_encode(pduType, structure, write_out, stdout); - if(erv.encoded < 0) { - fprintf(stderr, - "%s: Cannot convert %s into DER\n", - name, pduType->name); - exit(EX_UNAVAILABLE); - } - DEBUG("Encoded in %ld bytes of DER", (long)erv.encoded); - break; - case OUT_PER: - erv = uper_encode(pduType, structure, write_out, stdout); - if(erv.encoded < 0) { - fprintf(stderr, - "%s: Cannot convert %s into Unaligned PER\n", - name, pduType->name); - exit(EX_UNAVAILABLE); - } - DEBUG("Encoded in %ld bits of UPER", (long)erv.encoded); - break; + + if(file && file != stdin) + fclose(file); } - - ASN_STRUCT_FREE(*pduType, structure); - } - - if(file && file != stdin) - fclose(file); - } } #ifdef JUNKTEST if(opt_jprob > 0.0) { fprintf(stderr, "Junked %f OK (%d/%d)\n", - opt_jprob, junk_failures, number_of_iterations); + opt_jprob, junk_failures, number_of_iterations); } #endif /* JUNKTEST */ @@ -358,22 +385,22 @@ buffer_dump() { uint8_t *e = p + DynamicBuffer.length - (DynamicBuffer.unbits ? 1 : 0); if(!opt_debug) return; DEBUG("Buffer: { d=%p, o=%ld, l=%ld, u=%ld, a=%ld, s=%ld }", - DynamicBuffer.data, - (long)DynamicBuffer.offset, - (long)DynamicBuffer.length, - (long)DynamicBuffer.unbits, - (long)DynamicBuffer.allocated, - (long)DynamicBuffer.bytes_shifted); + DynamicBuffer.data, + (long)DynamicBuffer.offset, + (long)DynamicBuffer.length, + (long)DynamicBuffer.unbits, + (long)DynamicBuffer.allocated, + (long)DynamicBuffer.bytes_shifted); for(; p < e; p++) { fprintf(stderr, " %c%c%c%c%c%c%c%c", - ((*p >> 7) & 1) ? '1' : '0', - ((*p >> 6) & 1) ? '1' : '0', - ((*p >> 5) & 1) ? '1' : '0', - ((*p >> 4) & 1) ? '1' : '0', - ((*p >> 3) & 1) ? '1' : '0', - ((*p >> 2) & 1) ? '1' : '0', - ((*p >> 1) & 1) ? '1' : '0', - ((*p >> 0) & 1) ? '1' : '0'); + ((*p >> 7) & 1) ? '1' : '0', + ((*p >> 6) & 1) ? '1' : '0', + ((*p >> 5) & 1) ? '1' : '0', + ((*p >> 4) & 1) ? '1' : '0', + ((*p >> 3) & 1) ? '1' : '0', + ((*p >> 2) & 1) ? '1' : '0', + ((*p >> 1) & 1) ? '1' : '0', + ((*p >> 0) & 1) ? '1' : '0'); } if(DynamicBuffer.unbits) { unsigned int shift; @@ -381,8 +408,8 @@ buffer_dump() { for(shift = 7; shift >= DynamicBuffer.unbits; shift--) fprintf(stderr, "%c", ((*p >> shift) & 1) ? '1' : '0'); fprintf(stderr, " %ld:%ld\n", - (long)DynamicBuffer.length - 1, - (long)8 - DynamicBuffer.unbits); + (long)DynamicBuffer.length - 1, + (long)8 - DynamicBuffer.unbits); } else { fprintf(stderr, " %d\n", DynamicBuffer.length); } @@ -396,61 +423,61 @@ static void buffer_shift_left(size_t offset, int bits) { uint8_t *ptr = DynamicBuffer.data + DynamicBuffer.offset + offset; uint8_t *end = DynamicBuffer.data + DynamicBuffer.offset - + DynamicBuffer.length - 1; - + + DynamicBuffer.length - 1; + if(!bits) return; DEBUG("Shifting left %d bits off %ld (o=%ld, u=%ld, l=%ld)", - bits, (long)offset, - (long)DynamicBuffer.offset, - (long)DynamicBuffer.unbits, - (long)DynamicBuffer.length); + bits, (long)offset, + (long)DynamicBuffer.offset, + (long)DynamicBuffer.unbits, + (long)DynamicBuffer.length); if(offset) { int right; right = ptr[0] >> (8 - bits); DEBUG("oleft: %c%c%c%c%c%c%c%c", - ((ptr[-1] >> 7) & 1) ? '1' : '0', - ((ptr[-1] >> 6) & 1) ? '1' : '0', - ((ptr[-1] >> 5) & 1) ? '1' : '0', - ((ptr[-1] >> 4) & 1) ? '1' : '0', - ((ptr[-1] >> 3) & 1) ? '1' : '0', - ((ptr[-1] >> 2) & 1) ? '1' : '0', - ((ptr[-1] >> 1) & 1) ? '1' : '0', - ((ptr[-1] >> 0) & 1) ? '1' : '0'); + ((ptr[-1] >> 7) & 1) ? '1' : '0', + ((ptr[-1] >> 6) & 1) ? '1' : '0', + ((ptr[-1] >> 5) & 1) ? '1' : '0', + ((ptr[-1] >> 4) & 1) ? '1' : '0', + ((ptr[-1] >> 3) & 1) ? '1' : '0', + ((ptr[-1] >> 2) & 1) ? '1' : '0', + ((ptr[-1] >> 1) & 1) ? '1' : '0', + ((ptr[-1] >> 0) & 1) ? '1' : '0'); DEBUG("oriht: %c%c%c%c%c%c%c%c", - ((ptr[0] >> 7) & 1) ? '1' : '0', - ((ptr[0] >> 6) & 1) ? '1' : '0', - ((ptr[0] >> 5) & 1) ? '1' : '0', - ((ptr[0] >> 4) & 1) ? '1' : '0', - ((ptr[0] >> 3) & 1) ? '1' : '0', - ((ptr[0] >> 2) & 1) ? '1' : '0', - ((ptr[0] >> 1) & 1) ? '1' : '0', - ((ptr[0] >> 0) & 1) ? '1' : '0'); + ((ptr[0] >> 7) & 1) ? '1' : '0', + ((ptr[0] >> 6) & 1) ? '1' : '0', + ((ptr[0] >> 5) & 1) ? '1' : '0', + ((ptr[0] >> 4) & 1) ? '1' : '0', + ((ptr[0] >> 3) & 1) ? '1' : '0', + ((ptr[0] >> 2) & 1) ? '1' : '0', + ((ptr[0] >> 1) & 1) ? '1' : '0', + ((ptr[0] >> 0) & 1) ? '1' : '0'); DEBUG("mriht: %c%c%c%c%c%c%c%c", - ((right >> 7) & 1) ? '1' : '0', - ((right >> 6) & 1) ? '1' : '0', - ((right >> 5) & 1) ? '1' : '0', - ((right >> 4) & 1) ? '1' : '0', - ((right >> 3) & 1) ? '1' : '0', - ((right >> 2) & 1) ? '1' : '0', - ((right >> 1) & 1) ? '1' : '0', - ((right >> 0) & 1) ? '1' : '0'); + ((right >> 7) & 1) ? '1' : '0', + ((right >> 6) & 1) ? '1' : '0', + ((right >> 5) & 1) ? '1' : '0', + ((right >> 4) & 1) ? '1' : '0', + ((right >> 3) & 1) ? '1' : '0', + ((right >> 2) & 1) ? '1' : '0', + ((right >> 1) & 1) ? '1' : '0', + ((right >> 0) & 1) ? '1' : '0'); ptr[-1] = (ptr[-1] & (0xff << bits)) | right; DEBUG("after: %c%c%c%c%c%c%c%c", - ((ptr[-1] >> 7) & 1) ? '1' : '0', - ((ptr[-1] >> 6) & 1) ? '1' : '0', - ((ptr[-1] >> 5) & 1) ? '1' : '0', - ((ptr[-1] >> 4) & 1) ? '1' : '0', - ((ptr[-1] >> 3) & 1) ? '1' : '0', - ((ptr[-1] >> 2) & 1) ? '1' : '0', - ((ptr[-1] >> 1) & 1) ? '1' : '0', - ((ptr[-1] >> 0) & 1) ? '1' : '0'); + ((ptr[-1] >> 7) & 1) ? '1' : '0', + ((ptr[-1] >> 6) & 1) ? '1' : '0', + ((ptr[-1] >> 5) & 1) ? '1' : '0', + ((ptr[-1] >> 4) & 1) ? '1' : '0', + ((ptr[-1] >> 3) & 1) ? '1' : '0', + ((ptr[-1] >> 2) & 1) ? '1' : '0', + ((ptr[-1] >> 1) & 1) ? '1' : '0', + ((ptr[-1] >> 0) & 1) ? '1' : '0'); } buffer_dump(); @@ -477,10 +504,10 @@ buffer_shift_left(size_t offset, int bits) { buffer_dump(); DEBUG("Shifted. Now (o=%ld, u=%ld l=%ld)", - (long)DynamicBuffer.offset, - (long)DynamicBuffer.unbits, - (long)DynamicBuffer.length); - + (long)DynamicBuffer.offset, + (long)DynamicBuffer.unbits, + (long)DynamicBuffer.length); + } @@ -492,14 +519,14 @@ static void add_bytes_to_buffer(const void *data2add, size_t bytes) { if(bytes == 0) return; DEBUG("=> add_bytes(%ld) { o=%ld l=%ld u=%ld, s=%ld }", - (long)bytes, - (long)DynamicBuffer.offset, - (long)DynamicBuffer.length, - (long)DynamicBuffer.unbits, - (long)DynamicBuffer.allocated); + (long)bytes, + (long)DynamicBuffer.offset, + (long)DynamicBuffer.length, + (long)DynamicBuffer.unbits, + (long)DynamicBuffer.allocated); if(DynamicBuffer.allocated - >= (DynamicBuffer.offset + DynamicBuffer.length + bytes)) { + >= (DynamicBuffer.offset + DynamicBuffer.length + bytes)) { DEBUG("\tNo buffer reallocation is necessary"); } else if(bytes <= DynamicBuffer.offset) { DEBUG("\tContents shifted by %ld", DynamicBuffer.offset); @@ -507,7 +534,7 @@ static void add_bytes_to_buffer(const void *data2add, size_t bytes) { /* Shift the buffer contents */ memmove(DynamicBuffer.data, DynamicBuffer.data + DynamicBuffer.offset, - DynamicBuffer.length); + DynamicBuffer.length); DynamicBuffer.bytes_shifted += DynamicBuffer.offset; DynamicBuffer.offset = 0; } else { @@ -518,20 +545,20 @@ static void add_bytes_to_buffer(const void *data2add, size_t bytes) { exit(EX_OSERR); } memcpy(p, - DynamicBuffer.data + DynamicBuffer.offset, - DynamicBuffer.length); + DynamicBuffer.data + DynamicBuffer.offset, + DynamicBuffer.length); FREEMEM(DynamicBuffer.data); DynamicBuffer.data = (uint8_t *)p; DynamicBuffer.offset = 0; DynamicBuffer.allocated = newsize; DynamicBuffer.nreallocs++; DEBUG("\tBuffer reallocated to %ld (%d time)", - newsize, DynamicBuffer.nreallocs); + newsize, DynamicBuffer.nreallocs); } memcpy(DynamicBuffer.data - + DynamicBuffer.offset + DynamicBuffer.length, - data2add, bytes); + + DynamicBuffer.offset + DynamicBuffer.length, + data2add, bytes); DynamicBuffer.length += bytes; if(DynamicBuffer.unbits) { int bits = DynamicBuffer.unbits; @@ -540,11 +567,11 @@ static void add_bytes_to_buffer(const void *data2add, size_t bytes) { } DEBUG("<= add_bytes(%ld) { o=%ld l=%ld u=%ld, s=%ld }", - (long)bytes, - (long)DynamicBuffer.offset, - (long)DynamicBuffer.length, - (long)DynamicBuffer.unbits, - (long)DynamicBuffer.allocated); + (long)bytes, + (long)DynamicBuffer.offset, + (long)DynamicBuffer.length, + (long)DynamicBuffer.unbits, + (long)DynamicBuffer.allocated); } static void * @@ -555,7 +582,7 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na asn_codec_ctx_t *opt_codec_ctx = 0; void *structure = 0; asn_dec_rval_t rval; - size_t old_offset; + size_t old_offset; size_t new_offset; int tolerate_eof; size_t rd; @@ -599,10 +626,10 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na rval.consumed = 0; for(tolerate_eof = 1; /* Allow EOF first time buffer is non-empty */ - (rd = fread(fbuf, 1, fbuf_size, file)) - || feof(file) == 0 - || (tolerate_eof && DynamicBuffer.length) - ;) { + (rd = fread(fbuf, 1, fbuf_size, file)) + || feof(file) == 0 + || (tolerate_eof && DynamicBuffer.length) + ;) { int ecbits = 0; /* Extra consumed bits in case of PER */ uint8_t *i_bptr; size_t i_size; @@ -629,20 +656,20 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na switch(iform) { case INP_BER: rval = ber_decode(opt_codec_ctx, pduType, - (void **)&structure, i_bptr, i_size); + (void **)&structure, i_bptr, i_size); break; case INP_XER: rval = xer_decode(opt_codec_ctx, pduType, - (void **)&structure, i_bptr, i_size); + (void **)&structure, i_bptr, i_size); break; case INP_PER: if(opt_nopad) - rval = uper_decode(opt_codec_ctx, pduType, - (void **)&structure, i_bptr, i_size, 0, - DynamicBuffer.unbits); + rval = uper_decode(opt_codec_ctx, pduType, + (void **)&structure, i_bptr, i_size, 0, + DynamicBuffer.unbits); else - rval = uper_decode_complete(opt_codec_ctx, pduType, - (void **)&structure, i_bptr, i_size); + rval = uper_decode_complete(opt_codec_ctx, pduType, + (void **)&structure, i_bptr, i_size); switch(rval.code) { case RC_OK: /* Fall through */ @@ -666,9 +693,9 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na break; } DEBUG("decode(%ld) consumed %ld+%db (%ld), code %d", - (long)DynamicBuffer.length, - (long)rval.consumed, ecbits, (long)i_size, - rval.code); + (long)DynamicBuffer.length, + (long)rval.consumed, ecbits, (long)i_size, + rval.code); if(DynamicBuffer.allocated == 0) { /* @@ -676,7 +703,7 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na */ if(rval.code != RC_FAIL && rval.consumed < rd) { add_bytes_to_buffer(fbuf + rval.consumed, - rd - rval.consumed); + rd - rval.consumed); buffer_shift_left(0, ecbits); DynamicBuffer.bytes_shifted = rval.consumed; rval.consumed = 0; @@ -698,17 +725,17 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na case RC_OK: if(ecbits) buffer_shift_left(0, ecbits); DEBUG("RC_OK, finishing up with %ld+%d", - (long)rval.consumed, ecbits); + (long)rval.consumed, ecbits); return structure; case RC_WMORE: DEBUG("RC_WMORE, continuing read=%ld, cons=%ld " - " with %ld..%ld-%ld..%ld", - (long)rd, - (long)rval.consumed, - (long)DynamicBuffer.offset, - (long)DynamicBuffer.length, - (long)DynamicBuffer.unbits, - (long)DynamicBuffer.allocated); + " with %ld..%ld-%ld..%ld", + (long)rd, + (long)rval.consumed, + (long)DynamicBuffer.offset, + (long)DynamicBuffer.length, + (long)DynamicBuffer.unbits, + (long)DynamicBuffer.allocated); if(!rd) tolerate_eof--; continue; case RC_FAIL: @@ -727,9 +754,9 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na * unless this is our first PDU (empty file). */ if(on_first_pdu - || DynamicBuffer.length - || new_offset - old_offset > ((iform == INP_XER)?sizeof("\r\n")-1:0) - ) { + || DynamicBuffer.length + || new_offset - old_offset > ((iform == INP_XER)?sizeof("\r\n")-1:0) + ) { #ifdef JUNKTEST /* @@ -744,14 +771,14 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na #endif DEBUG("ofp %d, no=%ld, oo=%ld, dbl=%ld", - on_first_pdu, (long)new_offset, (long)old_offset, - (long)DynamicBuffer.length); + on_first_pdu, (long)new_offset, (long)old_offset, + (long)DynamicBuffer.length); fprintf(stderr, "%s: " - "Decode failed past byte %ld: %s\n", - name, (long)new_offset, - (rval.code == RC_WMORE) - ? "Unexpected end of input" - : "Input processing error"); + "Decode failed past byte %ld: %s\n", + name, (long)new_offset, + (rval.code == RC_WMORE) + ? "Unexpected end of input" + : "Input processing error"); #ifndef ENOMSG #define ENOMSG EINVAL #endif @@ -787,14 +814,14 @@ static int argument_is_stdin(char *av[], int idx) { static FILE *argument_to_file(char *av[], int idx) { return argument_is_stdin(av, idx) - ? stdin - : fopen(av[idx], "r"); + ? stdin + : fopen(av[idx], "r"); } static char *argument_to_name(char *av[], int idx) { return argument_is_stdin(av, idx) - ? "standard input" - : av[idx]; + ? "standard input" + : av[idx]; } #ifdef JUNKTEST @@ -825,7 +852,7 @@ junk_bytes_with_probability(uint8_t *buf, size_t size, double prob) { } if(byte != *ptr) { DEBUG("Junk buf[%d] %02x -> %02x", - ptr - buf, *ptr, byte); + ptr - buf, *ptr, byte); *ptr = byte; } } diff --git a/src/third_party/asn1/der_encoder.c b/src/third_party/asn1/der_encoder.c index 6c859e1b..72ca5d6f 100644 --- a/src/third_party/asn1/der_encoder.c +++ b/src/third_party/asn1/der_encoder.c @@ -6,25 +6,25 @@ #include static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len, - asn_app_consume_bytes_f *cb, void *app_key, int constructed); + asn_app_consume_bytes_f *cb, void *app_key, int constructed); /* * The DER encoder of any type. */ asn_enc_rval_t der_encode(asn_TYPE_descriptor_t *type_descriptor, void *struct_ptr, - asn_app_consume_bytes_f *consume_bytes, void *app_key) { + asn_app_consume_bytes_f *consume_bytes, void *app_key) { ASN_DEBUG("DER encoder invoked for %s", - type_descriptor->name); + type_descriptor->name); /* * Invoke type-specific encoder. */ return type_descriptor->der_encoder(type_descriptor, - struct_ptr, /* Pointer to the destination structure */ - 0, 0, - consume_bytes, app_key); + struct_ptr, /* Pointer to the destination structure */ + 0, 0, + consume_bytes, app_key); } /* @@ -52,7 +52,7 @@ static int encode_to_buffer_cb(const void *buffer, size_t size, void *key) { */ asn_enc_rval_t der_encode_to_buffer(asn_TYPE_descriptor_t *type_descriptor, void *struct_ptr, - void *buffer, size_t buffer_size) { + void *buffer, size_t buffer_size) { enc_to_buf_arg arg; asn_enc_rval_t ec; @@ -60,8 +60,8 @@ der_encode_to_buffer(asn_TYPE_descriptor_t *type_descriptor, void *struct_ptr, arg.left = buffer_size; ec = type_descriptor->der_encoder(type_descriptor, - struct_ptr, /* Pointer to the destination structure */ - 0, 0, encode_to_buffer_cb, &arg); + struct_ptr, /* Pointer to the destination structure */ + 0, 0, encode_to_buffer_cb, &arg); if(ec.encoded != -1) { assert(ec.encoded == (ssize_t)(buffer_size - arg.left)); /* Return the encoded contents size */ @@ -75,11 +75,11 @@ der_encode_to_buffer(asn_TYPE_descriptor_t *type_descriptor, void *struct_ptr, */ ssize_t der_write_tags(asn_TYPE_descriptor_t *sd, - size_t struct_length, - int tag_mode, int last_tag_form, - ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */ - asn_app_consume_bytes_f *cb, - void *app_key) { + size_t struct_length, + int tag_mode, int last_tag_form, + ber_tlv_tag_t tag, /* EXPLICIT or IMPLICIT tag */ + asn_app_consume_bytes_f *cb, + void *app_key) { ber_tlv_tag_t *tags; /* Copy of tags stream */ int tags_count; /* Number of tags */ size_t overall_length; @@ -87,13 +87,13 @@ der_write_tags(asn_TYPE_descriptor_t *sd, int i; ASN_DEBUG("Writing tags (%s, tm=%d, tc=%d, tag=%s, mtc=%d)", - sd->name, tag_mode, sd->tags_count, - ber_tlv_tag_string(tag), - tag_mode - ?(sd->tags_count+1 - -((tag_mode == -1) && sd->tags_count)) - :sd->tags_count - ); + sd->name, tag_mode, sd->tags_count, + ber_tlv_tag_string(tag), + tag_mode + ?(sd->tags_count+1 + -((tag_mode == -1) && sd->tags_count)) + :sd->tags_count + ); if(tag_mode) { /* @@ -108,8 +108,8 @@ der_write_tags(asn_TYPE_descriptor_t *sd, return -1; } tags_count = sd->tags_count - + 1 /* EXPLICIT or IMPLICIT tag is given */ - - ((tag_mode == -1) && sd->tags_count); + + 1 /* EXPLICIT or IMPLICIT tag is given */ + - ((tag_mode == -1) && sd->tags_count); /* Copy tags over */ tags[0] = tag; stag_offset = -1 + ((tag_mode == -1) && sd->tags_count); @@ -145,7 +145,7 @@ der_write_tags(asn_TYPE_descriptor_t *sd, if(!cb) return overall_length - struct_length; ASN_DEBUG("%s %s TL sequence (%d elements)", - cb?"Encoding":"Estimating", sd->name, tags_count); + cb?"Encoding":"Estimating", sd->name, tags_count); /* * Encode the TL sequence for real. @@ -166,8 +166,8 @@ der_write_tags(asn_TYPE_descriptor_t *sd, static ssize_t der_write_TL(ber_tlv_tag_t tag, ber_tlv_len_t len, - asn_app_consume_bytes_f *cb, void *app_key, - int constructed) { + asn_app_consume_bytes_f *cb, void *app_key, + int constructed) { uint8_t buf[32]; size_t size = 0; int buf_size = cb?sizeof(buf):0; diff --git a/src/third_party/asn1/der_encoder.h b/src/third_party/asn1/der_encoder.h index 61431c6d..e0b2114f 100644 --- a/src/third_party/asn1/der_encoder.h +++ b/src/third_party/asn1/der_encoder.h @@ -11,54 +11,54 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* - * The DER encoder of any type. May be invoked by the application. - * The ber_decode() function (ber_decoder.h) is an opposite of der_encode(). - */ -asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ + /* + * The DER encoder of any type. May be invoked by the application. + * The ber_decode() function (ber_decoder.h) is an opposite of der_encode(). + */ + asn_enc_rval_t der_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ + ); + + /* A variant of der_encode() which encodes data into the pre-allocated buffer */ + asn_enc_rval_t der_encode_to_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + void *buffer, /* Pre-allocated buffer */ + size_t buffer_size /* Initial buffer size (maximum) */ ); -/* A variant of der_encode() which encodes data into the pre-allocated buffer */ -asn_enc_rval_t der_encode_to_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (maximum) */ - ); - -/* - * Type of the generic DER encoder. - */ -typedef asn_enc_rval_t (der_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - ber_tlv_tag_t tag, - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ + /* + * Type of the generic DER encoder. + */ + typedef asn_enc_rval_t (der_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ ); -/******************************* - * INTERNALLY USEFUL FUNCTIONS * - *******************************/ + /******************************* + * INTERNALLY USEFUL FUNCTIONS * + *******************************/ -/* - * Write out leading TL[v] sequence according to the type definition. - */ -ssize_t der_write_tags( - struct asn_TYPE_descriptor_s *type_descriptor, - size_t struct_length, - int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ - int last_tag_form, /* {0,!0}: prim, constructed */ - ber_tlv_tag_t tag, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key + /* + * Write out leading TL[v] sequence according to the type definition. + */ + ssize_t der_write_tags( + struct asn_TYPE_descriptor_s *type_descriptor, + size_t struct_length, + int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ + int last_tag_form, /* {0,!0}: prim, constructed */ + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key ); #ifdef __cplusplus diff --git a/src/third_party/asn1/per_decoder.c b/src/third_party/asn1/per_decoder.c index 220d7f9f..bc53282f 100644 --- a/src/third_party/asn1/per_decoder.c +++ b/src/third_party/asn1/per_decoder.c @@ -43,8 +43,8 @@ uper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sp asn_per_data_t pd; if(skip_bits < 0 || skip_bits > 7 - || unused_bits < 0 || unused_bits > 7 - || (unused_bits > 0 && !size)) + || unused_bits < 0 || unused_bits > 7 + || (unused_bits > 0 && !size)) _ASN_DECODE_FAILED; /* @@ -80,9 +80,9 @@ uper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sp if(rval.code == RC_OK) { /* Return the number of consumed bits */ rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3) - + pd.nboff - skip_bits; + + pd.nboff - skip_bits; ASN_DEBUG("PER decoding consumed %ld, counted %ld", - (long)rval.consumed, (long)pd.moved); + (long)rval.consumed, (long)pd.moved); assert(rval.consumed == pd.moved); } else { /* PER codec is not a restartable */ diff --git a/src/third_party/asn1/per_decoder.h b/src/third_party/asn1/per_decoder.h index 8397a545..8d2d6847 100644 --- a/src/third_party/asn1/per_decoder.h +++ b/src/third_party/asn1/per_decoder.h @@ -12,42 +12,42 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* - * Unaligned PER decoder of a "complete encoding" as per X.691#10.1. - * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. - */ -asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of data buffer */ - ); + /* + * Unaligned PER decoder of a "complete encoding" as per X.691#10.1. + * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. + */ + asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of data buffer */ + ); -/* - * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. - * WARNING: This call returns the number of BITS read from the stream. Beware. - */ -asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size, /* Size of data buffer */ - int skip_bits, /* Number of unused leading bits, 0..7 */ - int unused_bits /* Number of unused tailing bits, 0..7 */ - ); + /* + * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. + * WARNING: This call returns the number of BITS read from the stream. Beware. + */ + asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size, /* Size of data buffer */ + int skip_bits, /* Number of unused leading bits, 0..7 */ + int unused_bits /* Number of unused tailing bits, 0..7 */ + ); -/* - * Type of the type-specific PER decoder function. - */ -typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void **struct_ptr, - asn_per_data_t *per_data - ); + /* + * Type of the type-specific PER decoder function. + */ + typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void **struct_ptr, + asn_per_data_t *per_data + ); #ifdef __cplusplus } diff --git a/src/third_party/asn1/per_encoder.h b/src/third_party/asn1/per_encoder.h index 95a6506e..24752d1a 100644 --- a/src/third_party/asn1/per_encoder.h +++ b/src/third_party/asn1/per_encoder.h @@ -12,55 +12,55 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* - * Unaligned PER encoder of any ASN.1 type. May be invoked by the application. - * WARNING: This function returns the number of encoded bits in the .encoded - * field of the return value. Use the following formula to convert to bytes: - * bytes = ((.encoded + 7) / 8) - */ -asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ - void *app_key /* Arbitrary callback argument */ -); + /* + * Unaligned PER encoder of any ASN.1 type. May be invoked by the application. + * WARNING: This function returns the number of encoded bits in the .encoded + * field of the return value. Use the following formula to convert to bytes: + * bytes = ((.encoded + 7) / 8) + */ + asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ + void *app_key /* Arbitrary callback argument */ + ); -/* - * A variant of uper_encode() which encodes data into the existing buffer - * WARNING: This function returns the number of encoded bits in the .encoded - * field of the return value. - */ -asn_enc_rval_t uper_encode_to_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - void *buffer, /* Pre-allocated buffer */ - size_t buffer_size /* Initial buffer size (max) */ -); + /* + * A variant of uper_encode() which encodes data into the existing buffer + * WARNING: This function returns the number of encoded bits in the .encoded + * field of the return value. + */ + asn_enc_rval_t uper_encode_to_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + void *buffer, /* Pre-allocated buffer */ + size_t buffer_size /* Initial buffer size (max) */ + ); -/* - * A variant of uper_encode_to_buffer() which allocates buffer itself. - * Returns the number of bytes in the buffer or -1 in case of failure. - * WARNING: This function produces a "Production of the complete encoding", - * with length of at least one octet. Contrast this to precise bit-packing - * encoding of uper_encode() and uper_encode_to_buffer(). - */ -ssize_t uper_encode_to_new_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void *struct_ptr, /* Structure to be encoded */ - void **buffer_r /* Buffer allocated and returned */ -); + /* + * A variant of uper_encode_to_buffer() which allocates buffer itself. + * Returns the number of bytes in the buffer or -1 in case of failure. + * WARNING: This function produces a "Production of the complete encoding", + * with length of at least one octet. Contrast this to precise bit-packing + * encoding of uper_encode() and uper_encode_to_buffer(). + */ + ssize_t uper_encode_to_new_buffer( + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void *struct_ptr, /* Structure to be encoded */ + void **buffer_r /* Buffer allocated and returned */ + ); -/* - * Type of the generic PER encoder function. - */ -typedef asn_enc_rval_t (per_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - asn_per_constraints_t *constraints, - void *struct_ptr, - asn_per_outp_t *per_output -); + /* + * Type of the generic PER encoder function. + */ + typedef asn_enc_rval_t (per_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + asn_per_constraints_t *constraints, + void *struct_ptr, + asn_per_outp_t *per_output + ); #ifdef __cplusplus } diff --git a/src/third_party/asn1/per_opentype.c b/src/third_party/asn1/per_opentype.c index ebcf076c..0cd9ef6c 100644 --- a/src/third_party/asn1/per_opentype.c +++ b/src/third_party/asn1/per_opentype.c @@ -39,7 +39,7 @@ uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints for(bptr = buf, toGo = size; toGo;) { ssize_t maySave = uper_put_length(po, toGo); ASN_DEBUG("Prepending length %d to %s and allowing to save %d", - (int)size, td->name, (int)maySave); + (int)size, td->name, (int)maySave); if(maySave < 0) break; if(per_put_many_bits(po, bptr, maySave * 8)) break; bptr = (char *)bptr + maySave; @@ -50,14 +50,14 @@ uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints if(toGo) return -1; ASN_DEBUG("Open type put %s of length %ld + overhead (1byte?)", - td->name, (long)size); + td->name, (long)size); return 0; } static asn_dec_rval_t uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; ssize_t chunk_bytes; int repeat; @@ -95,7 +95,7 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, } while(repeat); ASN_DEBUG("Getting open type %s encoded in %ld bytes", td->name, - (long)bufLen); + (long)bufLen); memset(&spd, 0, sizeof(spd)); spd.buffer = buf; @@ -108,10 +108,10 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, if(rv.code == RC_OK) { /* Check padding validity */ padding = spd.nbits - spd.nboff; - if ((padding < 8 || - /* X.691#10.1.3 */ - (spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) && - per_get_few_bits(&spd, padding) == 0) { + if ((padding < 8 || + /* X.691#10.1.3 */ + (spd.nboff == 0 && spd.nbits == 8 && spd.buffer == buf)) && + per_get_few_bits(&spd, padding) == 0) { /* Everything is cool */ FREEMEM(buf); return rv; @@ -135,7 +135,7 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, static asn_dec_rval_t GCC_NOTUSED uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { uper_ugot_key arg; asn_dec_rval_t rv; ssize_t padding; @@ -143,7 +143,7 @@ uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, _ASN_STACK_OVERFLOW_CHECK(ctx); ASN_DEBUG("Getting open type %s from %s", td->name, - per_data_string(pd)); + per_data_string(pd)); arg.oldpd = *pd; arg.unclaimed = 0; arg.ot_moved = 0; @@ -171,16 +171,16 @@ uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, } ASN_DEBUG("OpenType %s pd%s old%s unclaimed=%d, repeat=%d", td->name, - per_data_string(pd), - per_data_string(&arg.oldpd), - (int)arg.unclaimed, (int)arg.repeat); + per_data_string(pd), + per_data_string(&arg.oldpd), + (int)arg.unclaimed, (int)arg.repeat); padding = pd->moved % 8; if(padding) { int32_t pvalue; if(padding > 7) { ASN_DEBUG("Too large padding %d in open type", - (int)padding); + (int)padding); rv.code = RC_FAIL; UPDRESTOREPD; return rv; @@ -193,17 +193,18 @@ uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, ASN_DEBUG("Padding skip failed"); UPDRESTOREPD; _ASN_DECODE_STARVED; - case 0: break; + case 0: + break; default: ASN_DEBUG("Non-blank padding (%d bits 0x%02x)", - (int)padding, (int)pvalue); + (int)padding, (int)pvalue); UPDRESTOREPD; _ASN_DECODE_FAILED; } } if(pd->nboff != pd->nbits) { ASN_DEBUG("Open type %s overhead pd%s old%s", td->name, - per_data_string(pd), per_data_string(&arg.oldpd)); + per_data_string(pd), per_data_string(&arg.oldpd)); if(1) { UPDRESTOREPD; _ASN_DECODE_FAILED; @@ -245,7 +246,7 @@ uper_open_type_get_complex(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { return uper_open_type_get_simple(ctx, td, constraints, sptr, pd); } @@ -271,7 +272,7 @@ uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) { static asn_dec_rval_t uper_sot_suck(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, - asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { + asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv; (void)ctx; @@ -296,7 +297,7 @@ uper_ugot_refill(asn_per_data_t *pd) { asn_per_data_t *oldpd = &arg->oldpd; ASN_DEBUG("REFILLING pd->moved=%ld, oldpd->moved=%ld", - (long)pd->moved, (long)oldpd->moved); + (long)pd->moved, (long)oldpd->moved); /* Advance our position to where pd is */ oldpd->buffer = pd->buffer; @@ -317,7 +318,7 @@ uper_ugot_refill(asn_per_data_t *pd) { pd->nboff = oldpd->nboff - 1; pd->nbits = oldpd->nbits; ASN_DEBUG("UNCLAIMED <- return from (pd->moved=%ld)", - (long)pd->moved); + (long)pd->moved); return 0; } @@ -328,7 +329,7 @@ uper_ugot_refill(asn_per_data_t *pd) { next_chunk_bytes = uper_get_length(oldpd, -1, &arg->repeat); ASN_DEBUG("Open type LENGTH %ld bytes at off %ld, repeat %ld", - (long)next_chunk_bytes, (long)oldpd->moved, (long)arg->repeat); + (long)next_chunk_bytes, (long)oldpd->moved, (long)arg->repeat); if(next_chunk_bytes < 0) return -1; if(next_chunk_bytes == 0) { pd->refill = 0; /* No more refills, naturally */ @@ -340,20 +341,20 @@ uper_ugot_refill(asn_per_data_t *pd) { pd->nbits = oldpd->nboff + next_chunk_bits; arg->unclaimed = 0; ASN_DEBUG("!+Parent frame %ld bits, alloting %ld [%ld..%ld] (%ld)", - (long)next_chunk_bits, (long)oldpd->moved, - (long)oldpd->nboff, (long)oldpd->nbits, - (long)(oldpd->nbits - oldpd->nboff)); + (long)next_chunk_bits, (long)oldpd->moved, + (long)oldpd->nboff, (long)oldpd->nbits, + (long)(oldpd->nbits - oldpd->nboff)); } else { pd->nbits = oldpd->nbits; arg->unclaimed = next_chunk_bits - avail; ASN_DEBUG("!-Parent frame %ld, require %ld, will claim %ld", - (long)avail, (long)next_chunk_bits, - (long)arg->unclaimed); + (long)avail, (long)next_chunk_bits, + (long)arg->unclaimed); } pd->buffer = oldpd->buffer; pd->nboff = oldpd->nboff; ASN_DEBUG("Refilled pd%s old%s", - per_data_string(pd), per_data_string(oldpd)); + per_data_string(pd), per_data_string(oldpd)); return 0; } @@ -369,9 +370,13 @@ per_skip_bits(asn_per_data_t *pd, int skip_nbits) { skip_nbits -= skip; switch(per_get_few_bits(pd, skip)) { - case -1: return -1; /* Starving */ - case 0: continue; /* Skipped empty space */ - default: hasNonZeroBits = 1; continue; + case -1: + return -1; /* Starving */ + case 0: + continue; /* Skipped empty space */ + default: + hasNonZeroBits = 1; + continue; } } return hasNonZeroBits; diff --git a/src/third_party/asn1/per_opentype.h b/src/third_party/asn1/per_opentype.h index facfaa63..628d9720 100644 --- a/src/third_party/asn1/per_opentype.h +++ b/src/third_party/asn1/per_opentype.h @@ -9,11 +9,11 @@ extern "C" { #endif -asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); + asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); -int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); + int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); -int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); + int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po); #ifdef __cplusplus } diff --git a/src/third_party/asn1/per_support.c b/src/third_party/asn1/per_support.c index c2d4247a..27912c16 100644 --- a/src/third_party/asn1/per_support.c +++ b/src/third_party/asn1/per_support.c @@ -13,11 +13,11 @@ per_data_string(asn_per_data_t *pd) { static int n; n = (n+1) % 2; snprintf(buf[n], sizeof(buf), - "{m=%ld span %+d[%d..%d] (%d)}", - (long)pd->moved, - (((int)pd->buffer) & 0xf), - (int)pd->nboff, (int)pd->nbits, - (int)(pd->nbits - pd->nboff)); + "{m=%ld span %+d[%d..%d] (%d)}", + (long)pd->moved, + (((int)pd->buffer) & 0xf), + (int)pd->nboff, (int)pd->nbits, + (int)(pd->nbits - pd->nboff)); return buf[n]; } @@ -50,7 +50,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) { if(!pd->refill || nbits > 31) return -1; /* Accumulate unused bytes before refill */ ASN_DEBUG("Obtain the rest %d bits (want %d)", - (int)nleft, (int)nbits); + (int)nleft, (int)nbits); tailv = per_get_few_bits(pd, nleft); if(tailv < 0) return -1; /* Refill (replace pd contents with new data) */ @@ -87,7 +87,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) { accum = ((buf[0] << 16) + (buf[1] << 8) + buf[2]) >> (24 - off); else if(off <= 31) accum = ((buf[0] << 24) + (buf[1] << 16) - + (buf[2] << 8) + (buf[3])) >> (32 - off); + + (buf[2] << 8) + (buf[3])) >> (32 - off); else if(nbits <= 31) { asn_per_data_t tpd = *pd; /* Here are we with our 31-bits limit plus 1..7 bits offset. */ @@ -105,13 +105,13 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) { accum &= (((uint32_t)1 << nbits) - 1); ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+d[%d..%d]:%02x (%d) => 0x%x]", - (int)nbits, (int)nleft, - (int)pd->moved, - (((int)pd->buffer) & 0xf), - (int)pd->nboff, (int)pd->nbits, - pd->buffer[0], - (int)(pd->nbits - pd->nboff), - (int)accum); + (int)nbits, (int)nleft, + (int)pd->moved, + (((int)pd->buffer) & 0xf), + (int)pd->nboff, (int)pd->nbits, + pd->buffer[0], + (int)(pd->nbits - pd->nboff), + (int)accum); return accum; } @@ -144,7 +144,7 @@ per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int alright, int nbits) { if(value < 0) return -1; if(nbits & 7) { /* implies left alignment */ value <<= 8 - (nbits & 7), - nbits += 8 - (nbits & 7); + nbits += 8 - (nbits & 7); if(nbits > 24) *dst++ = value >> 24; } @@ -276,7 +276,7 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) { if(obits <= 0 || obits >= 32) return obits ? -1 : 0; ASN_DEBUG("[PER put %d bits %x to %p+%d bits]", - obits, (int)bits, po->buffer, (int)po->nboff); + obits, (int)bits, po->buffer, (int)po->nboff); /* * Normalize position indicator. @@ -293,7 +293,7 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) { if(po->nboff + obits > po->nbits) { int complete_bytes = (po->buffer - po->tmpspace); ASN_DEBUG("[PER output %ld complete + %ld]", - (long)complete_bytes, (long)po->flushed_bytes); + (long)complete_bytes, (long)po->flushed_bytes); if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0) return -1; if(po->nboff) @@ -314,41 +314,41 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) { bits &= (((uint32_t)1 << obits) - 1); ASN_DEBUG("[PER out %d %u/%x (t=%d,o=%d) %x&%x=%x]", obits, - (int)bits, (int)bits, - (int)po->nboff, (int)off, - buf[0], (int)(omsk&0xff), - (int)(buf[0] & omsk)); + (int)bits, (int)bits, + (int)po->nboff, (int)off, + buf[0], (int)(omsk&0xff), + (int)(buf[0] & omsk)); if(off <= 8) /* Completely within 1 byte */ po->nboff = off, - bits <<= (8 - off), - buf[0] = (buf[0] & omsk) | bits; + bits <<= (8 - off), + buf[0] = (buf[0] & omsk) | bits; else if(off <= 16) po->nboff = off, - bits <<= (16 - off), - buf[0] = (buf[0] & omsk) | (bits >> 8), - buf[1] = bits; + bits <<= (16 - off), + buf[0] = (buf[0] & omsk) | (bits >> 8), + buf[1] = bits; else if(off <= 24) po->nboff = off, - bits <<= (24 - off), - buf[0] = (buf[0] & omsk) | (bits >> 16), - buf[1] = bits >> 8, - buf[2] = bits; + bits <<= (24 - off), + buf[0] = (buf[0] & omsk) | (bits >> 16), + buf[1] = bits >> 8, + buf[2] = bits; else if(off <= 31) po->nboff = off, - bits <<= (32 - off), - buf[0] = (buf[0] & omsk) | (bits >> 24), - buf[1] = bits >> 16, - buf[2] = bits >> 8, - buf[3] = bits; + bits <<= (32 - off), + buf[0] = (buf[0] & omsk) | (bits >> 24), + buf[1] = bits >> 16, + buf[2] = bits >> 8, + buf[3] = bits; else { per_put_few_bits(po, bits >> (obits - 24), 24); per_put_few_bits(po, bits, obits - 24); } ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]", - (int)bits, (int)bits, buf[0], - (long)(po->buffer - po->tmpspace)); + (int)bits, (int)bits, buf[0], + (long)(po->buffer - po->tmpspace)); return 0; } @@ -394,16 +394,16 @@ uper_put_length(asn_per_outp_t *po, size_t length) { if(length <= 127) /* #10.9.3.6 */ return per_put_few_bits(po, length, 8) - ? -1 : (ssize_t)length; + ? -1 : (ssize_t)length; else if(length < 16384) /* #10.9.3.7 */ return per_put_few_bits(po, length|0x8000, 16) - ? -1 : (ssize_t)length; + ? -1 : (ssize_t)length; length >>= 14; if(length > 4) length = 4; return per_put_few_bits(po, 0xC0 | length, 8) - ? -1 : (ssize_t)(length << 14); + ? -1 : (ssize_t)(length << 14); } diff --git a/src/third_party/asn1/per_support.h b/src/third_party/asn1/per_support.h index 7cb1a0ca..630449b6 100644 --- a/src/third_party/asn1/per_support.h +++ b/src/third_party/asn1/per_support.h @@ -12,114 +12,114 @@ extern "C" { #endif -/* - * Pre-computed PER constraints. - */ -typedef struct asn_per_constraint_s { - enum asn_per_constraint_flags { - APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */ - APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */ - APC_CONSTRAINED = 0x2, /* Fully constrained */ - APC_EXTENSIBLE = 0x4 /* May have extension */ - } flags; - int range_bits; /* Full number of bits in the range */ - int effective_bits; /* Effective bits */ - long lower_bound; /* "lb" value */ - long upper_bound; /* "ub" value */ -} asn_per_constraint_t; -typedef struct asn_per_constraints_s { - asn_per_constraint_t value; - asn_per_constraint_t size; - int (*value2code)(unsigned int value); - int (*code2value)(unsigned int code); -} asn_per_constraints_t; + /* + * Pre-computed PER constraints. + */ + typedef struct asn_per_constraint_s { + enum asn_per_constraint_flags { + APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */ + APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */ + APC_CONSTRAINED = 0x2, /* Fully constrained */ + APC_EXTENSIBLE = 0x4 /* May have extension */ + } flags; + int range_bits; /* Full number of bits in the range */ + int effective_bits; /* Effective bits */ + long lower_bound; /* "lb" value */ + long upper_bound; /* "ub" value */ + } asn_per_constraint_t; + typedef struct asn_per_constraints_s { + asn_per_constraint_t value; + asn_per_constraint_t size; + int (*value2code)(unsigned int value); + int (*code2value)(unsigned int code); + } asn_per_constraints_t; -/* - * This structure describes a position inside an incoming PER bit stream. - */ -typedef struct asn_per_data_s { - const uint8_t *buffer; /* Pointer to the octet stream */ - size_t nboff; /* Bit offset to the meaningful bit */ - size_t nbits; /* Number of bits in the stream */ - size_t moved; /* Number of bits moved through this bit stream */ - int (*refill)(struct asn_per_data_s *); - void *refill_key; -} asn_per_data_t; + /* + * This structure describes a position inside an incoming PER bit stream. + */ + typedef struct asn_per_data_s { + const uint8_t *buffer; /* Pointer to the octet stream */ + size_t nboff; /* Bit offset to the meaningful bit */ + size_t nbits; /* Number of bits in the stream */ + size_t moved; /* Number of bits moved through this bit stream */ + int (*refill)(struct asn_per_data_s *); + void *refill_key; + } asn_per_data_t; -/* - * Extract a small number of bits (<= 31) from the specified PER data pointer. - * This function returns -1 if the specified number of bits could not be - * extracted due to EOD or other conditions. - */ -int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); + /* + * Extract a small number of bits (<= 31) from the specified PER data pointer. + * This function returns -1 if the specified number of bits could not be + * extracted due to EOD or other conditions. + */ + int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); -/* Undo the immediately preceeding "get_few_bits" operation */ -void per_get_undo(asn_per_data_t *per_data, int get_nbits); + /* Undo the immediately preceeding "get_few_bits" operation */ + void per_get_undo(asn_per_data_t *per_data, int get_nbits); -/* - * Extract a large number of bits from the specified PER data pointer. - * This function returns -1 if the specified number of bits could not be - * extracted due to EOD or other conditions. - */ -int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, - int get_nbits); + /* + * Extract a large number of bits from the specified PER data pointer. + * This function returns -1 if the specified number of bits could not be + * extracted due to EOD or other conditions. + */ + int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, + int get_nbits); -/* - * Get the length "n" from the Unaligned PER stream. - */ -ssize_t uper_get_length(asn_per_data_t *pd, - int effective_bound_bits, - int *repeat); + /* + * Get the length "n" from the Unaligned PER stream. + */ + ssize_t uper_get_length(asn_per_data_t *pd, + int effective_bound_bits, + int *repeat); -/* - * Get the normally small length "n". - */ -ssize_t uper_get_nslength(asn_per_data_t *pd); + /* + * Get the normally small length "n". + */ + ssize_t uper_get_nslength(asn_per_data_t *pd); -/* - * Get the normally small non-negative whole number. - */ -ssize_t uper_get_nsnnwn(asn_per_data_t *pd); + /* + * Get the normally small non-negative whole number. + */ + ssize_t uper_get_nsnnwn(asn_per_data_t *pd); -/* Non-thread-safe debugging function, don't use it */ -char *per_data_string(asn_per_data_t *pd); + /* Non-thread-safe debugging function, don't use it */ + char *per_data_string(asn_per_data_t *pd); -/* - * This structure supports forming PER output. - */ -typedef struct asn_per_outp_s { - uint8_t *buffer; /* Pointer into the (tmpspace) */ - size_t nboff; /* Bit offset to the meaningful bit */ - size_t nbits; /* Number of bits left in (tmpspace) */ - uint8_t tmpspace[32]; /* Preliminary storage to hold data */ - int (*outper)(const void *data, size_t size, void *op_key); - void *op_key; /* Key for (outper) data callback */ - size_t flushed_bytes; /* Bytes already flushed through (outper) */ -} asn_per_outp_t; + /* + * This structure supports forming PER output. + */ + typedef struct asn_per_outp_s { + uint8_t *buffer; /* Pointer into the (tmpspace) */ + size_t nboff; /* Bit offset to the meaningful bit */ + size_t nbits; /* Number of bits left in (tmpspace) */ + uint8_t tmpspace[32]; /* Preliminary storage to hold data */ + int (*outper)(const void *data, size_t size, void *op_key); + void *op_key; /* Key for (outper) data callback */ + size_t flushed_bytes; /* Bytes already flushed through (outper) */ + } asn_per_outp_t; -/* Output a small number of bits (<= 31) */ -int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); + /* Output a small number of bits (<= 31) */ + int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); -/* Output a large number of bits */ -int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); + /* Output a large number of bits */ + int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); -/* - * Put the length "n" to the Unaligned PER stream. - * This function returns the number of units which may be flushed - * in the next units saving iteration. - */ -ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length); + /* + * Put the length "n" to the Unaligned PER stream. + * This function returns the number of units which may be flushed + * in the next units saving iteration. + */ + ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length); -/* - * Put the normally small length "n" to the Unaligned PER stream. - * Returns 0 or -1. - */ -int uper_put_nslength(asn_per_outp_t *po, size_t length); + /* + * Put the normally small length "n" to the Unaligned PER stream. + * Returns 0 or -1. + */ + int uper_put_nslength(asn_per_outp_t *po, size_t length); -/* - * Put the normally small non-negative whole number. - */ -int uper_put_nsnnwn(asn_per_outp_t *po, int n); + /* + * Put the normally small non-negative whole number. + */ + int uper_put_nsnnwn(asn_per_outp_t *po, int n); #ifdef __cplusplus } diff --git a/src/third_party/asn1/xer_decoder.c b/src/third_party/asn1/xer_decoder.c index 161dc78c..bfff2e17 100644 --- a/src/third_party/asn1/xer_decoder.c +++ b/src/third_party/asn1/xer_decoder.c @@ -12,7 +12,7 @@ */ asn_dec_rval_t xer_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, - void **struct_ptr, const void *buffer, size_t size) { + void **struct_ptr, const void *buffer, size_t size) { asn_codec_ctx_t s_codec_ctx; /* @@ -83,7 +83,8 @@ xer_next_token(int *stateContext, const void *buffer, size_t size, pxer_chunk_ty case PXML_TEXT: *ch_type = PXER_TEXT; break; - case PXML_TAG: return 0; /* Want more */ + case PXML_TAG: + return 0; /* Want more */ case PXML_TAG_END: *ch_type = PXER_TAG; break; @@ -109,7 +110,7 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { if(size < 2 || buf[0] != LANGLE || buf[size-1] != RANGLE) { if(size >= 2) - ASN_DEBUG("Broken XML tag: \"%c...%c\"", buf[0], buf[size - 1]); + ASN_DEBUG("Broken XML tag: \"%c...%c\"", buf[0], buf[size - 1]); return XCT_BROKEN; } @@ -143,7 +144,10 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { if(b != n) { if(n == 0) { switch(b) { - case 0x09: case 0x0a: case 0x0c: case 0x0d: + case 0x09: + case 0x0a: + case 0x0c: + case 0x0d: case 0x20: /* "": whitespace is normal */ return ct; @@ -198,16 +202,16 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { */ asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, - asn_struct_ctx_t *ctx, /* Type decoder context */ - void *struct_key, - const char *xml_tag, /* Expected XML tag */ - const void *buf_ptr, size_t size, - int (*opt_unexpected_tag_decoder) - (void *struct_key, const void *chunk_buf, size_t chunk_size), - ssize_t (*body_receiver) - (void *struct_key, const void *chunk_buf, size_t chunk_size, - int have_more) - ) { + asn_struct_ctx_t *ctx, /* Type decoder context */ + void *struct_key, + const char *xml_tag, /* Expected XML tag */ + const void *buf_ptr, size_t size, + int (*opt_unexpected_tag_decoder) + (void *struct_key, const void *chunk_buf, size_t chunk_size), + ssize_t (*body_receiver) + (void *struct_key, const void *chunk_buf, size_t chunk_size, + int have_more) + ) { asn_dec_rval_t rval; ssize_t consumed_myself = 0; @@ -229,9 +233,10 @@ xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, * Get the next part of the XML stream. */ ch_size = xer_next_token(&ctx->context, buf_ptr, size, - &ch_type); + &ch_type); switch(ch_size) { - case -1: RETURN(RC_FAIL); + case -1: + RETURN(RC_FAIL); case 0: RETURN(RC_WMORE); default: @@ -290,8 +295,8 @@ xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, * Certain tags in the body may be expected. */ if(opt_unexpected_tag_decoder - && opt_unexpected_tag_decoder(struct_key, - buf_ptr, ch_size) >= 0) { + && opt_unexpected_tag_decoder(struct_key, + buf_ptr, ch_size) >= 0) { /* Tag's processed fine */ ADVANCE(ch_size); if(!ctx->phase) { @@ -322,13 +327,16 @@ xer_is_whitespace(const void *chunk_buf, size_t chunk_size) { for(; p < pend; p++) { switch(*p) { - /* X.693, #8.1.4 - * HORISONTAL TAB (9) - * LINE FEED (10) - * CARRIAGE RETURN (13) - * SPACE (32) - */ - case 0x09: case 0x0a: case 0x0d: case 0x20: + /* X.693, #8.1.4 + * HORISONTAL TAB (9) + * LINE FEED (10) + * CARRIAGE RETURN (13) + * SPACE (32) + */ + case 0x09: + case 0x0a: + case 0x0d: + case 0x20: break; default: return 0; diff --git a/src/third_party/asn1/xer_decoder.h b/src/third_party/asn1/xer_decoder.h index cf0d846f..a2f6c685 100644 --- a/src/third_party/asn1/xer_decoder.h +++ b/src/third_party/asn1/xer_decoder.h @@ -11,93 +11,93 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* - * The XER decoder of any ASN.1 type. May be invoked by the application. - */ -asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ - size_t size /* Size of data buffer */ - ); + /* + * The XER decoder of any ASN.1 type. May be invoked by the application. + */ + asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, /* Pointer to a target structure's pointer */ + const void *buffer, /* Data to be decoded */ + size_t size /* Size of data buffer */ + ); -/* - * Type of the type-specific XER decoder function. - */ -typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, - void **struct_ptr, - const char *opt_mname, /* Member name */ - const void *buf_ptr, size_t size - ); + /* + * Type of the type-specific XER decoder function. + */ + typedef asn_dec_rval_t (xer_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, + struct asn_TYPE_descriptor_s *type_descriptor, + void **struct_ptr, + const char *opt_mname, /* Member name */ + const void *buf_ptr, size_t size + ); -/******************************* - * INTERNALLY USEFUL FUNCTIONS * - *******************************/ + /******************************* + * INTERNALLY USEFUL FUNCTIONS * + *******************************/ -/* - * Generalized function for decoding the primitive values. - * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8 - * and others. This function should not be used by applications, as its API - * is subject to changes. - */ -asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, - asn_struct_ctx_t *ctx, /* Type decoder context */ - void *struct_key, /* Treated as opaque pointer */ - const char *xml_tag, /* Expected XML tag name */ - const void *buf_ptr, size_t size, - int (*opt_unexpected_tag_decoder) - (void *struct_key, const void *chunk_buf, size_t chunk_size), - ssize_t (*body_receiver) - (void *struct_key, const void *chunk_buf, size_t chunk_size, - int have_more) - ); + /* + * Generalized function for decoding the primitive values. + * Used by more specialized functions, such as OCTET_STRING_decode_xer_utf8 + * and others. This function should not be used by applications, as its API + * is subject to changes. + */ + asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, + asn_struct_ctx_t *ctx, /* Type decoder context */ + void *struct_key, /* Treated as opaque pointer */ + const char *xml_tag, /* Expected XML tag name */ + const void *buf_ptr, size_t size, + int (*opt_unexpected_tag_decoder) + (void *struct_key, const void *chunk_buf, size_t chunk_size), + ssize_t (*body_receiver) + (void *struct_key, const void *chunk_buf, size_t chunk_size, + int have_more) + ); -/* - * Fetch the next XER (XML) token from the stream. - * The function returns the number of bytes occupied by the chunk type, - * returned in the _ch_type. The _ch_type is only set (and valid) when - * the return value is greater than 0. - */ - typedef enum pxer_chunk_type { - PXER_TAG, /* Complete XER tag */ - PXER_TEXT, /* Plain text between XER tags */ - PXER_COMMENT /* A comment, may be part of */ - } pxer_chunk_type_e; -ssize_t xer_next_token(int *stateContext, - const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); + /* + * Fetch the next XER (XML) token from the stream. + * The function returns the number of bytes occupied by the chunk type, + * returned in the _ch_type. The _ch_type is only set (and valid) when + * the return value is greater than 0. + */ + typedef enum pxer_chunk_type { + PXER_TAG, /* Complete XER tag */ + PXER_TEXT, /* Plain text between XER tags */ + PXER_COMMENT /* A comment, may be part of */ + } pxer_chunk_type_e; + ssize_t xer_next_token(int *stateContext, + const void *buffer, size_t size, pxer_chunk_type_e *_ch_type); -/* - * This function checks the buffer against the tag name is expected to occur. - */ - typedef enum xer_check_tag { - XCT_BROKEN = 0, /* The tag is broken */ - XCT_OPENING = 1, /* This is the tag */ - XCT_CLOSING = 2, /* This is the tag */ - XCT_BOTH = 3, /* This is the tag */ - XCT__UNK__MASK = 4, /* Mask of everything unexpected */ - XCT_UNKNOWN_OP = 5, /* Unexpected tag */ - XCT_UNKNOWN_CL = 6, /* Unexpected tag */ - XCT_UNKNOWN_BO = 7 /* Unexpected tag */ - } xer_check_tag_e; -xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, - const char *need_tag); + /* + * This function checks the buffer against the tag name is expected to occur. + */ + typedef enum xer_check_tag { + XCT_BROKEN = 0, /* The tag is broken */ + XCT_OPENING = 1, /* This is the tag */ + XCT_CLOSING = 2, /* This is the tag */ + XCT_BOTH = 3, /* This is the tag */ + XCT__UNK__MASK = 4, /* Mask of everything unexpected */ + XCT_UNKNOWN_OP = 5, /* Unexpected tag */ + XCT_UNKNOWN_CL = 6, /* Unexpected tag */ + XCT_UNKNOWN_BO = 7 /* Unexpected tag */ + } xer_check_tag_e; + xer_check_tag_e xer_check_tag(const void *buf_ptr, int size, + const char *need_tag); -/* - * Check whether this buffer consists of entirely XER whitespace characters. - * RETURN VALUES: - * 1: Whitespace or empty string - * 0: Non-whitespace - */ -int xer_is_whitespace(const void *chunk_buf, size_t chunk_size); + /* + * Check whether this buffer consists of entirely XER whitespace characters. + * RETURN VALUES: + * 1: Whitespace or empty string + * 0: Non-whitespace + */ + int xer_is_whitespace(const void *chunk_buf, size_t chunk_size); -/* - * Skip the series of anticipated extensions. - */ -int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); + /* + * Skip the series of anticipated extensions. + */ + int xer_skip_unknown(xer_check_tag_e tcv, ber_tlv_len_t *depth); #ifdef __cplusplus } diff --git a/src/third_party/asn1/xer_encoder.c b/src/third_party/asn1/xer_encoder.c index aa7cf040..c83f189e 100644 --- a/src/third_party/asn1/xer_encoder.c +++ b/src/third_party/asn1/xer_encoder.c @@ -11,8 +11,8 @@ */ asn_enc_rval_t xer_encode(asn_TYPE_descriptor_t *td, void *sptr, - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *cb, void *app_key) { + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *cb, void *app_key) { asn_enc_rval_t er, tmper; const char *mname; size_t mlen; diff --git a/src/third_party/asn1/xer_encoder.h b/src/third_party/asn1/xer_encoder.h index 055e73c0..ce0d3ad5 100644 --- a/src/third_party/asn1/xer_encoder.h +++ b/src/third_party/asn1/xer_encoder.h @@ -11,45 +11,45 @@ extern "C" { #endif -struct asn_TYPE_descriptor_s; /* Forward declaration */ + struct asn_TYPE_descriptor_s; /* Forward declaration */ -/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ -enum xer_encoder_flags_e { - /* Mode of encoding */ - XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ - XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ -}; + /* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ + enum xer_encoder_flags_e { + /* Mode of encoding */ + XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ + XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ + }; -/* - * The XER encoder of any type. May be invoked by the application. - */ -asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ - ); + /* + * The XER encoder of any type. May be invoked by the application. + */ + asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ + ); -/* - * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) - * output into the chosen file pointer. - * RETURN VALUES: - * 0: The structure is printed. - * -1: Problem printing the structure. - * WARNING: No sensible errno value is returned. - */ -int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); + /* + * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) + * output into the chosen file pointer. + * RETURN VALUES: + * 0: The structure is printed. + * -1: Problem printing the structure. + * WARNING: No sensible errno value is returned. + */ + int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); -/* - * Type of the generic XER encoder. - */ -typedef asn_enc_rval_t (xer_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - int ilevel, /* Level of indentation */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ + /* + * Type of the generic XER encoder. + */ + typedef asn_enc_rval_t (xer_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + int ilevel, /* Level of indentation */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ ); #ifdef __cplusplus diff --git a/src/third_party/asn1/xer_support.c b/src/third_party/asn1/xer_support.c index 9e34e692..26f656e7 100644 --- a/src/third_party/asn1/xer_support.c +++ b/src/third_party/asn1/xer_support.c @@ -92,123 +92,123 @@ ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_call const char *end = p + size; for(; p < end; p++) { - int C = *(const unsigned char *)p; - switch(state) { - case ST_TEXT: - /* - * Initial state: we're in the middle of some text, - * or just have started. - */ - if (C == LANGLE) - /* We're now in the tag, probably */ - TOKEN_CB(PXML_TEXT, ST_TAG_START, 0); - break; - case ST_TAG_START: - if (ALPHA(C) || (C == CSLASH)) - state = ST_TAG_BODY; - else if (C == EXCLAM) - state = ST_COMMENT_WAIT_DASH1; - else + int C = *(const unsigned char *)p; + switch(state) { + case ST_TEXT: /* - * Not characters and not whitespace. - * Must be something like "3 < 4". + * Initial state: we're in the middle of some text, + * or just have started. */ - TOKEN_CB(PXML_TEXT, ST_TEXT, 1);/* Flush as data */ - break; - case ST_TAG_BODY: - switch(C) { - case RANGLE: - /* End of the tag */ - TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); + if (C == LANGLE) + /* We're now in the tag, probably */ + TOKEN_CB(PXML_TEXT, ST_TAG_START, 0); break; - case LANGLE: + case ST_TAG_START: + if (ALPHA(C) || (C == CSLASH)) + state = ST_TAG_BODY; + else if (C == EXCLAM) + state = ST_COMMENT_WAIT_DASH1; + else + /* + * Not characters and not whitespace. + * Must be something like "3 < 4". + */ + TOKEN_CB(PXML_TEXT, ST_TEXT, 1);/* Flush as data */ + break; + case ST_TAG_BODY: + switch(C) { + case RANGLE: + /* End of the tag */ + TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); + break; + case LANGLE: + /* + * The previous tag wasn't completed, but still + * recognized as valid. (Mozilla-compatible) + */ + TOKEN_CB_FINAL(PXML_TAG, ST_TAG_START, 0); + break; + case CEQUAL: + state = ST_TAG_QUOTE_WAIT; + break; + } + break; + case ST_TAG_QUOTE_WAIT: /* - * The previous tag wasn't completed, but still - * recognized as valid. (Mozilla-compatible) + * State after the equal sign ("=") in the tag. */ - TOKEN_CB_FINAL(PXML_TAG, ST_TAG_START, 0); + switch(C) { + case CQUOTE: + state = ST_TAG_QUOTED_STRING; + break; + case RANGLE: + /* End of the tag */ + TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); + break; + default: + if(!WHITESPACE(C)) + /* Unquoted string value */ + state = ST_TAG_UNQUOTED_STRING; + } break; - case CEQUAL: - state = ST_TAG_QUOTE_WAIT; + case ST_TAG_QUOTED_STRING: + /* + * Tag attribute's string value in quotes. + */ + if(C == CQUOTE) { + /* Return back to the tag state */ + state = ST_TAG_BODY; + } break; - } - break; - case ST_TAG_QUOTE_WAIT: - /* - * State after the equal sign ("=") in the tag. - */ - switch(C) { - case CQUOTE: - state = ST_TAG_QUOTED_STRING; + case ST_TAG_UNQUOTED_STRING: + if(C == RANGLE) { + /* End of the tag */ + TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); + } else if(WHITESPACE(C)) { + /* Return back to the tag state */ + state = ST_TAG_BODY; + } break; - case RANGLE: - /* End of the tag */ - TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); + case ST_COMMENT_WAIT_DASH1: + if(C == CDASH) { + state = ST_COMMENT_WAIT_DASH2; + } else { + /* Some ordinary tag. */ + state = ST_TAG_BODY; + } break; - default: - if(!WHITESPACE(C)) - /* Unquoted string value */ - state = ST_TAG_UNQUOTED_STRING; - } - break; - case ST_TAG_QUOTED_STRING: - /* - * Tag attribute's string value in quotes. - */ - if(C == CQUOTE) { - /* Return back to the tag state */ - state = ST_TAG_BODY; - } - break; - case ST_TAG_UNQUOTED_STRING: - if(C == RANGLE) { - /* End of the tag */ - TOKEN_CB_FINAL(PXML_TAG, ST_TEXT, 1); - } else if(WHITESPACE(C)) { - /* Return back to the tag state */ - state = ST_TAG_BODY; - } - break; - case ST_COMMENT_WAIT_DASH1: - if(C == CDASH) { - state = ST_COMMENT_WAIT_DASH2; - } else { - /* Some ordinary tag. */ - state = ST_TAG_BODY; - } - break; - case ST_COMMENT_WAIT_DASH2: - if(C == CDASH) { - /* Seen "<--" */ - state = ST_COMMENT; - } else { - /* Some ordinary tag */ - state = ST_TAG_BODY; - } - break; - case ST_COMMENT: - if(C == CDASH) { - state = ST_COMMENT_CLO_DASH2; - } - break; - case ST_COMMENT_CLO_DASH2: - if(C == CDASH) { - state = ST_COMMENT_CLO_RT; - } else { - /* This is not an end of a comment */ - state = ST_COMMENT; - } - break; - case ST_COMMENT_CLO_RT: - if(C == RANGLE) { - TOKEN_CB_FINAL(PXML_COMMENT, ST_TEXT, 1); - } else if(C == CDASH) { - /* Maintain current state, still waiting for '>' */ - } else { - state = ST_COMMENT; - } - break; - } /* switch(*ptr) */ + case ST_COMMENT_WAIT_DASH2: + if(C == CDASH) { + /* Seen "<--" */ + state = ST_COMMENT; + } else { + /* Some ordinary tag */ + state = ST_TAG_BODY; + } + break; + case ST_COMMENT: + if(C == CDASH) { + state = ST_COMMENT_CLO_DASH2; + } + break; + case ST_COMMENT_CLO_DASH2: + if(C == CDASH) { + state = ST_COMMENT_CLO_RT; + } else { + /* This is not an end of a comment */ + state = ST_COMMENT; + } + break; + case ST_COMMENT_CLO_RT: + if(C == RANGLE) { + TOKEN_CB_FINAL(PXML_COMMENT, ST_TEXT, 1); + } else if(C == CDASH) { + /* Maintain current state, still waiting for '>' */ + } else { + state = ST_COMMENT; + } + break; + } /* switch(*ptr) */ } /* for() */ /* @@ -222,7 +222,8 @@ ssize_t pxml_parse(int *stateContext, const void *xmlbuf, size_t size, pxml_call case ST_TEXT: TOKEN_CB(PXML_TEXT, state, 0); break; - default: break; /* a no-op */ + default: + break; /* a no-op */ } } diff --git a/src/third_party/asn1/xer_support.h b/src/third_party/asn1/xer_support.h index 8b01944a..190ed464 100644 --- a/src/third_party/asn1/xer_support.h +++ b/src/third_party/asn1/xer_support.h @@ -12,41 +12,42 @@ extern "C" { #endif -/* - * Types of data transferred to the application. - */ -typedef enum { - PXML_TEXT, /* Plain text between XML tags. */ - PXML_TAG, /* A tag, starting with '<'. */ - PXML_COMMENT, /* An XML comment, including "". */ - /* - * The following chunk types are reported if the chunk - * terminates the specified XML element. + /* + * Types of data transferred to the application. */ - PXML_TAG_END, /* Tag ended */ - PXML_COMMENT_END /* Comment ended */ -} pxml_chunk_type_e; + typedef enum { + PXML_TEXT, /* Plain text between XML tags. */ + PXML_TAG, /* A tag, starting with '<'. */ + PXML_COMMENT, /* An XML comment, including "". */ + /* + * The following chunk types are reported if the chunk + * terminates the specified XML element. + */ + PXML_TAG_END, /* Tag ended */ + PXML_COMMENT_END /* Comment ended */ + } + pxml_chunk_type_e; -/* - * Callback function that is called by the parser when parsed data is - * available. The _opaque is the pointer to a field containing opaque user - * data specified in pxml_create() call. The chunk type is _type and the text - * data is the piece of buffer identified by _bufid (as supplied to - * pxml_feed() call) starting at offset _offset and of _size bytes size. - * The chunk is NOT '\0'-terminated. - */ -typedef int (pxml_callback_f)(pxml_chunk_type_e _type, - const void *_chunk_data, size_t _chunk_size, void *_key); + /* + * Callback function that is called by the parser when parsed data is + * available. The _opaque is the pointer to a field containing opaque user + * data specified in pxml_create() call. The chunk type is _type and the text + * data is the piece of buffer identified by _bufid (as supplied to + * pxml_feed() call) starting at offset _offset and of _size bytes size. + * The chunk is NOT '\0'-terminated. + */ + typedef int (pxml_callback_f)(pxml_chunk_type_e _type, + const void *_chunk_data, size_t _chunk_size, void *_key); -/* - * Parse the given buffer as it were a chunk of XML data. - * Invoke the specified callback each time the meaninful data is found. - * This function returns number of bytes consumed from the bufer. - * It will always be lesser than or equal to the specified _size. - * The next invocation of this function must account the difference. - */ -ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, - pxml_callback_f *cb, void *_key); + /* + * Parse the given buffer as it were a chunk of XML data. + * Invoke the specified callback each time the meaninful data is found. + * This function returns number of bytes consumed from the bufer. + * It will always be lesser than or equal to the specified _size. + * The next invocation of this function must account the difference. + */ + ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, + pxml_callback_f *cb, void *_key); #ifdef __cplusplus }