`Page 1/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`1
`+++++¬
`…
`¬2
`Copyright (c) 2001 BeComm Corporation¬
`3
`¬4
`Filename:¬
`5
`¬6
` fanout.c¬
`7
`¬8
`Group Name:¬
`9
`¬10
` todo¬
`11
`¬12
`Group Overview:¬
`13
`¬14
` todo¬
`15
`¬16
`Owner:¬
`17
`¬18
` Guy Carpenter (guyc) 28-Sep-2001¬
`19
`¬20
`--------------------------------------------------------------------------
`21
`---*/¬
`…
`¬22
`#define SOS_DEBUG_ZONE "/beads/fanout"¬
`23
`¬24
`#include <sosstrings.h>¬
`25
`#include <sosmultimedia.h>¬
`26
`¬27
`SOS_SOURCE_VERSION (¬
`28
` "$Id: fanout.c,v 1.2 2001/10/22 23:31:42 guyc Exp $"¬
`29
`);¬
`30
`¬31
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`32
`+++++¬
`…
`Named Constants¬
`33
`--------------------------------------------------------------------------
`34
`---*/¬
`…
`¬35
`/*¬
`36
`* Name of bead¬
`37
`*/¬
`38
`static const char BEAD_NAME[] = "fanout";¬
`39
`¬40
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`41
`
`Page 1 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`
`
`/Users/implicit/Desktop/Source Code/2001.11.01/beads/fa…/main/fanout.c
`Page 2/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
`+++++¬
`41…
`Structs¬
`42
`--------------------------------------------------------------------------
`43
`---*/¬
`…
`¬44
`typedef struct {¬
`45
` SOS_UINT32 PathCount;¬
`46
` SOS_PATH ** PathList;¬
`47
`} FANOUT_CONTEXT;¬
`48
`¬49
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`50
`+++++¬
`…
`Context Stuff¬
`51
`--------------------------------------------------------------------------
`52
`---*/¬
`…
`¬53
`static¬
`54
`void¬
`55
`FanOut_ContextDestroy(¬
`56
` FANOUT_CONTEXT * Context¬
`57
`)¬
`58
`{¬
`59
` SOS_DEBUGOUT_FUNC_TRACE("FanOut_ContextDestroy\n");¬
`60
`¬61
` if (Context) {¬
`62
` if (Context->PathList) {¬
`63
` SOS_UINT32 i;¬
`64
` for (i=0;i<Context->PathCount;i++) {¬
`65
` SOS_Path_Destroy(Context->PathList[i]);¬
`66
` }¬
`67
` SOS_Mem_Free(Context->PathList);¬
`68
` }¬
`69
` SOS_Mem_Free(Context);¬
`70
` }¬
`71
`}¬
`72
`¬73
`static¬
`74
`FANOUT_CONTEXT *¬
`75
`FanOut_ContextCreate(¬
`76
` void¬
`77
`)¬
`78
`{¬
`79
` FANOUT_CONTEXT *context;¬
`80
`¬81
` SOS_DEBUGOUT_FUNC_TRACE("FanOut_ContextCreate\n");¬
`82
`
`Page 2 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`
`
`/Users/implicit/Desktop/Source Code/2001.11.01/beads/fa…/main/fanout.c
`Page 3/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
`¬83
` context = SOS_Mem_Alloc(sizeof(*context));¬
`84
` if (context) {¬
`85
` SOS_memset(context, 0, sizeof(*context));¬
`86
` }¬
`87
`¬88
` return context;¬
`89
`}¬
`90
`¬91
`static¬
`92
`SOS_STATUS¬
`93
`FanOut_ContextInit(¬
`94
` FANOUT_CONTEXT * Context,¬
`95
` SOS_PATH * ParentPath,¬
`96
` SOS_UINT32 PathCount¬
`97
`)¬
`98
`{¬
`99
` SOS_STATUS status = SOS_Success;¬
`100
` SOS_UINT32 i;¬
`101
`¬
`102
` Context->PathCount = PathCount;¬
`103
` Context->PathList = SOS_Mem_Alloc(sizeof(SOS_PATH*)*PathCount);¬
`104
`¬
`105
` if (Context->PathList) {¬
`106
` SOS_memset(Context->PathList, 0, sizeof(SOS_PATH*)*PathCount);¬
`107
` for (i=0;i<PathCount && SOS_SUCCEEDED(status);i++) {¬
`108
` Context->PathList[i]=SOS_Path_Create(ParentPath);¬
`109
` if (Context->PathList[i]) {¬
`110
` SOS_REGOBJECT *object = SOS_UInt32_Create(i);¬
`111
` SOS_Path_AttributeSet(¬
`112
` Context->PathList[i],¬
`113
` "FanoutIndex",¬
`114
` object¬
`115
` );¬
`116
` SOS_RegObject_Release(object);¬
`117
` } else {¬
`118
` status = SOS_Error;¬
`119
` }¬
`120
` }¬
`121
` } else {¬
`122
` /* no pathlist */¬
`123
` status = SOS_Error;¬
`124
` }¬
`125
`¬
`126
` return status;¬
`127
`
`Page 3 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`
`
`/Users/implicit/Desktop/Source Code/2001.11.01/beads/fa…/main/fanout.c
`Page 4/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
`128
`129
`130
`131
`132
`133
`134
`135
`136
`137
`138
`139
`140
`141
`142
`143
`…
`144
`145
`146
`147
`148
`149
`150
`151
`152
`…
`153
`154
`…
`155
`156
`157
`158
`159
`160
`161
`162
`163
`164
`165
`166
`167
`168
`169
`
`}¬
`¬
`static¬
`SOS_STATUS¬
`FanOut_MessageSend(¬
` FANOUT_CONTEXT * Context,¬
` SOS_MESSAGE * Message¬
`)¬
`{¬
` SOS_STATUS status = SOS_Success;¬
` ¬
` if (Context->PathList) {¬
` SOS_UINT32 i;¬
` for (i=0;i<Context->PathCount && SOS_SUCCEEDED(status);i++) {¬
` SOS_MESSAGE *copy;¬
` SOS_Message_HeadMessageCopyFrom(Message,SOS_UINT32_MAX,
`©);¬
` status = SOS_Path_MessageSend(Context->PathList[i], copy);¬
` }¬
` } else {¬
` status = SOS_Error;¬
` }¬
` return status;¬
`}¬
`¬
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++++¬
`¬
`++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++*/¬
`¬
`static¬
`SOS_STATUS¬
`FanOut_KeyCreate(¬
` SOS_PATH *Path,¬
` SOS_MESSAGE *Message¬
`)¬
`{¬
` SOS_STATUS status = SOS_Success;¬
` static SOS_UINT32 s_UniqueId = 0;¬
` SOS_REGOBJECT* uniqueSessionKey;¬
` ¬
` SOS_DEBUGOUT_FUNC_TRACE("FanOut_KeyCreate\n");¬
`¬
` uniqueSessionKey = SOS_UInt32_Create(s_UniqueId++);¬
`
`Page 4 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`
`
`/Users/implicit/Desktop/Source Code/2001.11.01/beads/fa…/main/fanout.c
`Page 5/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
`170
`171
`172
`173
`174
`175
`176
`…
`177
`178
`…
`179
`180
`181
`182
`183
`184
`185
`186
`187
`188
`189
`190
`191
`192
`193
`194
`195
`196
`197
`198
`199
`200
`201
`…
`202
`203
`…
`204
`205
`206
`207
`208
`209
`210
`
` SOS_Path_SessionKeySet(Path, uniqueSessionKey);¬
` SOS_RegObject_Release(uniqueSessionKey);¬
`¬
` return status;¬
`}¬
`¬
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++++¬
`Bead Definition¬
`--------------------------------------------------------------------------
`---*/¬
`¬
`static¬
`SOS_STATUS¬
`FanOut_MessageHandler(¬
` SOS_PATH *Path,¬
` SOS_MESSAGE *Message¬
`)¬
`{¬
` SOS_STATUS status = SOS_Success;¬
` FANOUT_CONTEXT *context;¬
`¬
` SOS_DEBUGOUT_FUNC_TRACE("FanOut_MessageHandler\n");¬
`¬
` SOS_Path_SessionContextPeek(Path, (void**)&context);¬
`¬
` status = FanOut_MessageSend(context, Message);¬
`¬
` SOS_Message_Destroy(Message);¬
`¬
` return status;¬
`}¬
`¬
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++++¬
`Session Setup¬
`++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++*/¬
`¬
`static¬
`SOS_STATUS¬
`FanOut_SessionInit(¬
` SOS_PATH *Path¬
`)¬
`{¬
`
`Page 5 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`
`
`/Users/implicit/Desktop/Source Code/2001.11.01/beads/fa…/main/fanout.c
`Page 6/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
`211
`212
`213
`214
`215
`216
`217
`218
`219
`220
`221
`222
`223
`224
`225
`226
`227
`228
`229
`230
`231
`232
`233
`234
`…
`235
`236
`237
`238
`239
`240
`241
`242
`243
`244
`245
`246
`247
`248
`…
`249
`250
`251
`252
`253
`
` SOS_STATUS status = SOS_Success;¬
` FANOUT_CONTEXT *context = FanOut_ContextCreate();¬
`¬
` SOS_DEBUGOUT_FUNC_TRACE("FanOut_SessionInit\n");¬
`¬
` if (context) {¬
` SOS_Path_SessionContextPut(Path, context);¬
`¬
` {¬
` SOS_UINT32 count;¬
` SOS_REGOBJECT *countObject;¬
` SOS_IINTVALUE *countInterface;¬
`¬
` if (SOS_SUCCEEDED(¬
` SOS_Path_AttributeGet(¬
` Path,¬
` "FanoutCount",¬
` &countObject))) {¬
` if (SOS_SUCCEEDED(¬
` SOS_RegObject_InterfaceGet(¬
` countObject,¬
` SOS_IINTVALUE_ID,¬
` (void**)&countInterface))) {¬
` status = countInterface->Int32ValueGet(countInterface,
`&count);¬
` status = FanOut_ContextInit(context, Path, count);¬
` SOS_Interface_Release(countInterface);¬
` } else {¬
` /* couldn't get interface */¬
` status = SOS_Error;¬
` }¬
` SOS_RegObject_Release(countObject);¬
` } else {¬
` /* couldn't get FanoutCount */¬
` status = SOS_Error;¬
` }¬
` SOS_ASSERT_ASSUMPTION(¬
` SOS_SUCCEEDED(status),¬
` "Fanout did not find required path context entry
`'FanoutCount'"¬
` );¬
` }¬
`¬
` } else {¬
` status = SOS_Error;¬
`
`Page 6 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`
`
`/Users/implicit/Desktop/Source Code/2001.11.01/beads/fa…/main/fanout.c
`Page 7/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
`254
`255
`256
`257
`258
`259
`260
`261
`262
`263
`264
`265
`266
`267
`268
`269
`270
`271
`272
`273
`274
`275
`276
`277
`278
`279
`…
`280
`281
`…
`282
`283
`284
`285
`286
`287
`288
`289
`290
`291
`292
`293
`294
`295
`296
`
` }¬
` ¬
` return status;¬
`}¬
`¬
`static¬
`SOS_STATUS¬
`FanOut_SessionUninit(¬
` SOS_PATH *Path¬
`)¬
`{¬
` SOS_STATUS status = SOS_Success;¬
` FANOUT_CONTEXT *context;¬
`¬
` SOS_DEBUGOUT_FUNC_TRACE("FanOut_SessionUninit\n");¬
`¬
` SOS_Path_SessionContextPeek(Path, (void**)&context);¬
`¬
` if (context) {¬
` FanOut_ContextDestroy(context);¬
` }¬
`¬
` return status;¬
`}¬
`¬
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++++¬
`Bead Setup¬
`++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++*/¬
`¬
`static¬
`SOS_STATUS¬
`FanOut_BeadInit(¬
` SOS_BEAD *Bead,¬
` SOS_REGOBJECT *InitContext¬
`)¬
`{¬
` SOS_STATUS status;¬
`¬
` SOS_DEBUGOUT_FUNC_TRACE("FanOut_BeadInit\n");¬
` ¬
` /* register Decode Edge */¬
` status = SOS_Edge_Register(¬
` Bead,¬
`
`Page 7 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`
`
`/Users/implicit/Desktop/Source Code/2001.11.01/beads/fa…/main/fanout.c
`Page 8/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
`297
`298
`299
`300
`301
`302
`303
`304
`305
`306
`307
`308
`309
`310
`311
`312
`313
`314
`315
`316
`317
`318
`319
`320
`321
`322
`323
`…
`324
`325
`…
`326
`327
`328
`329
`330
`331
`332
`333
`334
`335
`336
`337
`338
`339
`
` "decode",¬
` NULL,¬
` NULL,¬
` NULL,¬
` FanOut_KeyCreate,¬
` FanOut_MessageHandler,¬
` NULL,¬
` NULL,¬
` NULL,¬
` NULL);¬
`¬
` if (SOS_FAILED(status)) {¬
` SOS_DEBUGOUT_MAJOR_EVENT( "Could not register decode edge\n");¬
` }¬
` return status;¬
`}¬
`¬
`static¬
`SOS_STATUS¬
`FanOut_BeadUninit(¬
` void *BeadContext¬
`)¬
`{¬
` return SOS_Success;¬
`}¬
`¬
`/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++++¬
`Module Setup¬
`++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
`+++*/¬
`¬
`SOS_STATUS¬
`SOS_ModuleInit (¬
` SOS_OBJECTFILE *ObjectFile,¬
` SOS_REGOBJECT *InitContext¬
`)¬
`{¬
` SOS_STATUS status;¬
` ¬
` /* register the Bead */¬
` status = SOS_Bead_Register(¬
` ObjectFile,¬
` BEAD_NAME,¬
` NULL, /* Bead context */¬
`
`Page 8 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`
`
`/Users/implicit/Desktop/Source Code/2001.11.01/beads/fa…/main/fanout.c
`Page 9/9
`Saved: 10/22/01, 6:31:42 PM
`Printed for: Implicit
`
` FanOut_BeadInit,¬
` FanOut_BeadUninit,¬
` FanOut_SessionInit,¬
` FanOut_SessionUninit¬
` );¬
` ¬
` return status;¬
`}¬
`¬
`¬
`void¬
`SOS_ModuleUninit (¬
` SOS_OBJECTFILE *ObjectFile¬
`)¬
`{¬
`¬
`}¬
`
`340
`341
`342
`343
`344
`345
`346
`347
`348
`349
`350
`351
`352
`353
`354
`355
`356
`357
`
`Page 9 of 9
`
`Implicit Exhibit 2046
`Sonos v. Implicit, IPR2018-0766, -0767
`
`