This doc is an alternative to what was posted by Steve/Zsolt[1] to try to map to protocol. There are similarities but big difference in terms of the encoding. It is based on discussion with Joel and Weiming. It by no means imposes a decision i.e this is merely here as a discussion place holder with the a desire to speed things up. NOTE: ----- A small reminder on layout: main hdr (eg type = config) | | +--- T = LFBselect | | | +-- LFBCLASSID = 0x45 | | | | | +-- LFBInstance = 0x1234 | | | +-- T = ADD //operation | | | | | +-- // path target X | | // with data to be added | | // This is the discussion point | | | +-- T = ADD //operation | | | | | +-- // path target Y | | // with data to be added | | // This is the discussion point | | | | | +-- T = DEL //operation | . | | . +-- // path target Z | . // This is the discussion point | 1) There could be multiple operations on any instance 2) path-data comes after the operation. 3) there is only one path-data per operation. A possible path-data layout. ---------------------------- OPER_TLV : = PATH-DATA := flags IDcount [BLOCK_OR_KEY_NOTATION] [DATA] The operational TLV contains an opcode in the T part. Its V contains the PATH-DATA. Opcodes discussed so far: * SET (create, modify or both depending on PATH-DATA flags} * DEL (remove an existing entity specified by PATH-DATA } * GET (Access a entity specified in PATH-DATA } * EV_S (subscribe to an event defined in PATH-DATA } * EV_U (unsubscribe to an event defined in PATH-DATA } (not sure if we need to distinguish between attributes, capabilities and events really) -> IDs := a series of 32bit IDs (whose size is given by IDcount) defining the path. -> flags are used to further refine the operation to be applied on the ID_TLV. -> BLOCK_OR_KEY_NOTATION := optional different BLOCK or KEY extension to extend the path. -> DATA : = Optional variable sized data dependent on PATH and applied operations (eg GET will not have DATA). flags ----- Derived from netlink and BSD route sockets to meet requirements defined in [1]: --> F_EXCL: The exclusive flag. Donot replace the config attribute(s) if already exists - Report back error instead. A CREATE operation with this flag is equivalent to INS_IDX if index is passed and equivalent to INS if index is not passed in the IDs. A DEL with this flag is equivalent to DEL! in [1]. Without this flag the equivalency is to DEL. --> F_REPLACE: Replace existing matching config attribute(s) with passed data. An index must be passed. In the case of key operations, a KEY must be passed. A CREATE operation with this flag is equivalent to a SET or a INS_IDX!. A CREATE operation with F_EXCL|F_REPLACE is equivalent to SET! ** Other flags used for block operations mentioned in the BLOCK section. BLOCK path selection/enhancement -------------------------------- These extend the path. For block operations three modes exist [a,b], [a,N] or a list [a,c,e,f] We introduce three TLVs to extend the path. 1) BLOCK_RANGE_INDEX TLV T = BLOCK_INDEX_RANGE, length of 4+8 start // "a" end // "b" 2) BLOCK_COUNT_INDEX TLV T=BLOCK_COUNT_INDEX, length = 4+8 start // "a" count //"N" 3) BLOCK_LIST_INDEX TLV T= BLOCK_LIST_INDEX, length = 4+(4*(count of indices)) index0 // "a" index1 //"c" index2 //"e" ...... ...... indexN //"?" Content path selection/enhancement ---------------------------------- We introduce a KEY_INFO TLV which will describe the KEY as well as associated KEY data (example Key = 3 for "foo1" and Key_data = 5"). T = KEY_INFO KEY KEY_DATA I will leave this open for now - revisit later. DATA: ----- We introduce a LFB_DATA TLV T = LFB_DATA L = length of encoded data V = attached data USE CASES --------- Assume LFB with following attributes foo1, type u32, ID = 1 foo2, type u32, ID = 2 table2: type array, ID = 4 elements are: j1, type u32, ID = 1 j2, type u32, ID = 2 table1: type array, ID = 3 elements are: t1, type u32, ID = 1 t2, type u32, ID = 2 // index into table 2 1) To get foo1 Path IDs = 1 Result: Path = 1, DATA_TLV with value of foo1 2) to set foo2 to 10 Path IDs = 2 DATA_TLV: L = 4+4, V=10 3) To dump table2 (get) Path = 4 Result: Path = 4 DATA_TLV, Length = 4 + (#of entries in table2)(8+4) This is followed by data of the form: subscript,j1value,j2value (subscript is 4 bytes, j1 + j2 is 8 bytes) Note the above allows for holes in subscripts, i.e if subscript is not in use it doesnt take space 4) Block operations To set entry 0-2 of table2 (I am going to ignore error conditions for now) path = 4, DATA_TLV, Length = 4+3*(4+8) Values: 0, j1value,j2value 1, j1value,j2value 2, j1value,j2value 5) Block operations (with holes) To set entry 0,2 of table2 (I am going to ignore error conditions for now) path = 4, DATA_TLV, Length = 4+2*(4+8) Values: 0, j1value,j2value 2, j1value,j2value 6) Getting rows To get entry 1 of table2 path = 4,0 Result: path=4 DATA_TLV, Length = 4+ 1*(4+8) value: 0, j1value,j2value 7) to get entry 0-2 of table2 Path = 4 followed by BLOCK_RANGE_INDEX TLV to extend path T = BLOCK_INDEX_RANGE, length of 4+8 start = 0 end = 2 Result: DATA_TLV, Length = 4+2*(4+8) Values: 0, j1value,j2value 1, j1value,j2value 2, j1value,j2value 8)Using BLOCK_COUNT_INDEX for #7 Path = 4 followed by BLOCK_COUNT_INDEX TLV to extend path T = BLOCK_COUNT_INDEX, length of 4+8 start = 0 count = 3 Result: DATA_TLV, Length = 4+2*(4+8) Values: 0, j1value,j2value 1, j1value,j2value 2, j1value,j2value 9)Using BLOCK_LIST_INDEX TLV for #7 Path = 4 followed by BLOCK_LIST_INDEX TLV to extend path T = BLOCK_COUNT_INDEX, length of 4+3*(4+8) Values: 0 1 2 Result: DATA_TLV, Length = 4+2*(4+8) Values: 0, j1value,j2value 1, j1value,j2value 2, j1value,j2value 10) Dump contents of table1, GET Path = 3 Result Path = 3 DATA_TLV, Length = 4+C*(4+8) where C is the count of number of entries Values: subscript,t1, t2, j1value,j2value (note t2 is subscript for table2) TODO: ---- - Complete section on content access - column and cell access in a table use cases - Provide a more complex use case example (where a table cell points to a whole table) $Log: data_path2.txt,v $ Revision 1.1 2004/11/14 18:47:07 hadi Initial revision