So far we only thought of default filling coming from a template. However, filling can happen from the Fcp, and we need to properly parse and [re-]encode that information.
Commit
34423337608c56db3c83cda0b0c372e38aa1c01e
by laforge
esim.saip: New methods for inserting ProfileElement into sequence
ProfileElements.insert_after_pe() is a convenience method to insert a new PE after an existing one in the sequence. This is a frequent task as there are strict ordering requirements in the SAIP format.
Commit
0516e4c47ae07ad35dfad5eb5aed1fd26f43602b
by laforge
esim.saip.File: Re-compute file_size when changing body
If the API user modifies the size of the body, we need to check if we need to re-compute the file_size attribute which is later encoded into the fileDescriptor. The size obviously must be large enough to fit the body. Let's do this implicitly by introducing a setter for File.body
Commit
0f1ffd20efe9a3b34ed5288bd725ec83beeac555
by laforge
esim.saip.File: Proper ARR conversion of template (into) to file (bytes)
The encoding of the access rule reference is different in FileTemplate vs File, let's make sure we properly convert it when instantiating a File from a FileTemplate.
Commit
9ac4ff3229edb34e9956f4da84ece64a4a5d70ba
by laforge
esim.saip.File: Suppress encoding attributes that are like template
The point of the SAIP template mechanism is to reduce the size of the encoded profile. Therefore, our encoder in the to_fileDescriptor() method should suppress generating attributes if their value is identical to that of the template (if any).
So far we mainly created File() instances when parsing existing profiles. However, sometimes we want to programmatically create Files and we should offer a convenience helper to do so, rather than asking API users to worry about low-level details.