From b8160915909e59fc65cc08855fb32fee6f5d89ad Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 8 Jul 2012 11:58:20 -0700 Subject: Convert to X.Org standard indentation & cleanup whitespace Performed with util/modular/x-indent-all.sh, followed by manual fixups Signed-off-by: Alan Coopersmith --- nas.h | 155 +++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 77 insertions(+), 78 deletions(-) (limited to 'nas.h') diff --git a/nas.h b/nas.h index 04d169f..bcbccf0 100644 --- a/nas.h +++ b/nas.h @@ -15,7 +15,7 @@ /* */ /* ************************************************************ */ -/* +/* In general, we are called with a buffer of bytes and are supposed to try to make sense of these bytes according to the NAS protocol. There are two different types of communication: requests from the client to @@ -32,7 +32,7 @@ have until more bytes arrive. In general, we do two things: we wait for some number of bytes, and - then we interpret this set of bytes. To interpret this data we use + then we interpret this set of bytes. To interpret this data we use a modified state machine. We keep two pieces of information: (1) the number of bytes that we need @@ -46,7 +46,7 @@ The data going from the client to the x11 server consists of a set-up message followed by an infinite stream of variable length - requests. + requests. Our overall flow is then: @@ -55,7 +55,7 @@ length of the rest of the message. (c) Wait for the rest of the set-up message. (d) Interpret and print the set-up message. - + *** end of set-up phase -- start normal request loop *** (e) Wait for 4 bytes. @@ -96,19 +96,19 @@ This latter seems more effective. It appears reply/error/event formats were selected to allow waiting for 32 bytes, and it will allow short packets which are only 32 bytes long, to be processed completely in one step. - - Thus, For normal reply/error/event processing we have + + Thus, For normal reply/error/event processing we have (e) Wait for 32 bytes. (f) Interpret these 32 bytes. If possible, go back to step (e). (g) If the packet is a reply with bytes 4-7 non-zero, wait for the remainder of the the reply. (h) Interpret and print the longer reply. Go back to step (e). - + The similarity in approach to how both the client and server are handled suggests we can use the same control structure to drive the interpretation - of both types of communication client->server and server->client. + of both types of communication client->server and server->client. Accordingly, we package up the relevant variables in a ConnState record. The ConnState record contains the buffer of saved bytes (if any), the size and length of this buffer, the number of bytes we are waiting for @@ -123,77 +123,76 @@ */ /* audio.c */ -extern void NewAudio (FD fd); -extern void InitializeAudio (void); +extern void NewAudio(FD fd); +extern void InitializeAudio(void); /* decodenas.c */ -extern void DecodeAudioRequest (FD fd, const unsigned char *buf, long n); -extern void DecodeAudioReply (FD fd, const unsigned char *buf, long n); -extern void DecodeAudioEvent (FD fd, const unsigned char *buf, long n); -extern void DecodeAudioError (FD fd, const unsigned char *buf, long n); - -extern void InitializeAudioDecode (void); +extern void DecodeAudioRequest(FD fd, const unsigned char *buf, long n); +extern void DecodeAudioReply(FD fd, const unsigned char *buf, long n); +extern void DecodeAudioEvent(FD fd, const unsigned char *buf, long n); +extern void DecodeAudioError(FD fd, const unsigned char *buf, long n); +extern void InitializeAudioDecode(void); /* printnas.c */ -extern void PrintAudioSetUpMessage (const unsigned char *buf); -extern void PrintAudioSetUpReply (const unsigned char *buf); -extern void AudioElementNotify (const unsigned char *buf); -extern void AudioGrabNotify (const unsigned char *buf); -extern void AudioMonitorNotify (const unsigned char *buf); -extern void AudioBucketNotify (const unsigned char *buf); -extern void AudioDeviceNotify (const unsigned char *buf); -extern void UnknownAudioReply (const unsigned char *buf); -extern void AudioListDevices (const unsigned char *buf); -extern void AudioListDevicesReply (const unsigned char *buf); -extern void AudioGetDeviceAttributes (const unsigned char *buf); -extern void AudioGetDeviceAttributesReply (const unsigned char *buf); -extern void AudioSetDeviceAttributes (const unsigned char *buf); -extern void AudioCreateBucket (const unsigned char *buf); -extern void AudioDestroyBucket (const unsigned char *buf); -extern void AudioListBuckets (const unsigned char *buf); -extern void AudioListBucketsReply (const unsigned char *buf); -extern void AudioGetBucketAttributes (const unsigned char *buf); -extern void AudioGetBucketAttributesReply (const unsigned char *buf); -extern void AudioSetBucketAttributes (const unsigned char *buf); -extern void AudioCreateRadio (const unsigned char *buf); -extern void AudioDestroyRadio (const unsigned char *buf); -extern void AudioListRadios (const unsigned char *buf); -extern void AudioListRadiosReply (const unsigned char *buf); -extern void AudioGetRadioAttributes (const unsigned char *buf); -extern void AudioGetRadioAttributesReply (const unsigned char *buf); -extern void AudioSetRadioAttributes (const unsigned char *buf); -extern void AudioCreateFlow (const unsigned char *buf); -extern void AudioDestroyFlow (const unsigned char *buf); -extern void AudioGetFlowAttributes (const unsigned char *buf); -extern void AudioGetFlowAttributesReply (const unsigned char *buf); -extern void AudioSetFlowAttributes (const unsigned char *buf); -extern void AudioGetElements (const unsigned char *buf); -extern void AudioGetElementsReply (const unsigned char *buf); -extern void AudioSetElements (const unsigned char *buf); -extern void AudioGetElementStates (const unsigned char *buf); -extern void AudioElementState (const unsigned char *buf); -extern void AudioGetElementStatesReply (const unsigned char *buf); -extern void AudioSetElementStates (const unsigned char *buf); -extern void AudioGetElementParameters (const unsigned char *buf); -extern void AudioGetElementParametersReply (const unsigned char *buf); -extern void AudioSetElementParameters (const unsigned char *buf); -extern void AudioWriteElement (const unsigned char *buf); -extern void AudioReadElement (const unsigned char *buf); -extern void AudioReadElementReply (const unsigned char *buf); -extern void AudioGrabComponent (const unsigned char *buf); -extern void AudioUngrabComponent (const unsigned char *buf); -extern void AudioSendEvent (const unsigned char *buf); -extern void AudioGetAllowedUsers (const unsigned char *buf); -extern void AudioGetAllowedUsersReply (const unsigned char *buf); -extern void AudioSetAllowedUsers (const unsigned char *buf); -extern void AudioListExtensions (const unsigned char *buf); -extern void AudioListExtensionsReply (const unsigned char *buf); -extern void AudioQueryExtension (const unsigned char *buf); -extern void AudioQueryExtensionReply (const unsigned char *buf); -extern void AudioGetCloseDownMode (const unsigned char *buf); -extern void AudioGetCloseDownModeReply (const unsigned char *buf); -extern void AudioSetCloseDownMode (const unsigned char *buf); -extern void AudioKillClient (const unsigned char *buf); -extern void AudioGetServerTime (const unsigned char *buf); -extern void AudioGetServerTimeReply (const unsigned char *buf); -extern void AudioNoOperation (const unsigned char *buf); +extern void PrintAudioSetUpMessage(const unsigned char *buf); +extern void PrintAudioSetUpReply(const unsigned char *buf); +extern void AudioElementNotify(const unsigned char *buf); +extern void AudioGrabNotify(const unsigned char *buf); +extern void AudioMonitorNotify(const unsigned char *buf); +extern void AudioBucketNotify(const unsigned char *buf); +extern void AudioDeviceNotify(const unsigned char *buf); +extern void UnknownAudioReply(const unsigned char *buf); +extern void AudioListDevices(const unsigned char *buf); +extern void AudioListDevicesReply(const unsigned char *buf); +extern void AudioGetDeviceAttributes(const unsigned char *buf); +extern void AudioGetDeviceAttributesReply(const unsigned char *buf); +extern void AudioSetDeviceAttributes(const unsigned char *buf); +extern void AudioCreateBucket(const unsigned char *buf); +extern void AudioDestroyBucket(const unsigned char *buf); +extern void AudioListBuckets(const unsigned char *buf); +extern void AudioListBucketsReply(const unsigned char *buf); +extern void AudioGetBucketAttributes(const unsigned char *buf); +extern void AudioGetBucketAttributesReply(const unsigned char *buf); +extern void AudioSetBucketAttributes(const unsigned char *buf); +extern void AudioCreateRadio(const unsigned char *buf); +extern void AudioDestroyRadio(const unsigned char *buf); +extern void AudioListRadios(const unsigned char *buf); +extern void AudioListRadiosReply(const unsigned char *buf); +extern void AudioGetRadioAttributes(const unsigned char *buf); +extern void AudioGetRadioAttributesReply(const unsigned char *buf); +extern void AudioSetRadioAttributes(const unsigned char *buf); +extern void AudioCreateFlow(const unsigned char *buf); +extern void AudioDestroyFlow(const unsigned char *buf); +extern void AudioGetFlowAttributes(const unsigned char *buf); +extern void AudioGetFlowAttributesReply(const unsigned char *buf); +extern void AudioSetFlowAttributes(const unsigned char *buf); +extern void AudioGetElements(const unsigned char *buf); +extern void AudioGetElementsReply(const unsigned char *buf); +extern void AudioSetElements(const unsigned char *buf); +extern void AudioGetElementStates(const unsigned char *buf); +extern void AudioElementState(const unsigned char *buf); +extern void AudioGetElementStatesReply(const unsigned char *buf); +extern void AudioSetElementStates(const unsigned char *buf); +extern void AudioGetElementParameters(const unsigned char *buf); +extern void AudioGetElementParametersReply(const unsigned char *buf); +extern void AudioSetElementParameters(const unsigned char *buf); +extern void AudioWriteElement(const unsigned char *buf); +extern void AudioReadElement(const unsigned char *buf); +extern void AudioReadElementReply(const unsigned char *buf); +extern void AudioGrabComponent(const unsigned char *buf); +extern void AudioUngrabComponent(const unsigned char *buf); +extern void AudioSendEvent(const unsigned char *buf); +extern void AudioGetAllowedUsers(const unsigned char *buf); +extern void AudioGetAllowedUsersReply(const unsigned char *buf); +extern void AudioSetAllowedUsers(const unsigned char *buf); +extern void AudioListExtensions(const unsigned char *buf); +extern void AudioListExtensionsReply(const unsigned char *buf); +extern void AudioQueryExtension(const unsigned char *buf); +extern void AudioQueryExtensionReply(const unsigned char *buf); +extern void AudioGetCloseDownMode(const unsigned char *buf); +extern void AudioGetCloseDownModeReply(const unsigned char *buf); +extern void AudioSetCloseDownMode(const unsigned char *buf); +extern void AudioKillClient(const unsigned char *buf); +extern void AudioGetServerTime(const unsigned char *buf); +extern void AudioGetServerTimeReply(const unsigned char *buf); +extern void AudioNoOperation(const unsigned char *buf); -- cgit v1.2.1