mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
fix various typos in raet code comments+docstrings
This commit is contained in:
parent
58829cda49
commit
e0343c9fa7
@ -16,7 +16,7 @@ OSI Layers
|
||||
4: Transport: Format: Segments (Reliable delivery of Message, Transactions, Segmentation, Error checking)
|
||||
3: Network: Format: Packets/Datagrams (Addressing Routing)
|
||||
2: Link: Format: Frames ( Reliable per frame communications connection, Media access controller )
|
||||
1: Physical: Bits (Transciever communication connection not reliable)
|
||||
1: Physical: Bits (Transceiver communication connection not reliable)
|
||||
|
||||
Link is hidden from Raet
|
||||
Network is IP host address and Udp Port
|
||||
@ -137,7 +137,7 @@ Session ID
|
||||
SID
|
||||
sid
|
||||
|
||||
GUID hash to guarantee uniqueness since no guarantee of nonvolitile storage
|
||||
GUID hash to guarantee uniqueness since no guarantee of nonvolatile storage
|
||||
or require file storage to keep last session ID used.
|
||||
|
||||
Service Types or Modular Services
|
||||
@ -215,7 +215,7 @@ B2) Exactly One
|
||||
C) One of sequence
|
||||
D) End to End
|
||||
|
||||
A) Sender creates transaction id for number of repeats but reciever does not
|
||||
A) Sender creates transaction id for number of repeats but receiver does not
|
||||
keep transaction alive
|
||||
|
||||
B1) Sender creates transaction id keeps it for retries.
|
||||
|
@ -199,7 +199,7 @@ class AllowedStackUdpRaet(deeding.Deed): # pylint: disable=W0232
|
||||
|
||||
class IdledStackUdpRaet(deeding.Deed): # pylint: disable=W0232
|
||||
'''
|
||||
Updates idle status to true if there are no oustanding transactions in stack
|
||||
Updates idle status to true if there are no outstanding transactions in stack
|
||||
'''
|
||||
Ioinits = odict(
|
||||
inode=".raet.udp.stack.",
|
||||
|
@ -45,7 +45,7 @@ class Estate(object):
|
||||
self.sid = sid # current session ID
|
||||
self.tid = tid # current transaction ID
|
||||
|
||||
if ha: # takes precendence
|
||||
if ha: # takes precedence
|
||||
host, port = ha
|
||||
self.host = socket.gethostbyname(host)
|
||||
self.port = port
|
||||
|
@ -6,7 +6,7 @@ nacling.py raet protocol nacl (crypto) management classes
|
||||
# Import python libs
|
||||
import time
|
||||
|
||||
# Import Cyptographic libs
|
||||
# Import Cryptographic libs
|
||||
import nacl.public
|
||||
import nacl.signing
|
||||
import nacl.encoding
|
||||
|
@ -65,7 +65,7 @@ class Head(Part):
|
||||
|
||||
class TxHead(Head):
|
||||
'''
|
||||
RAET protocl transmit packet header class
|
||||
RAET protocol transmit packet header class
|
||||
'''
|
||||
def pack(self):
|
||||
'''
|
||||
@ -107,7 +107,7 @@ class TxHead(Head):
|
||||
data['pl'] = pl
|
||||
# Tray checks for packet length greater than UDP_MAX_PACKET_SIZE
|
||||
# and segments appropriately so pl may be truncated below in this case
|
||||
# subsitute true lengths
|
||||
# substitute true lengths
|
||||
packed = packed.replace('\npl {val:{fmt}}\n'.format(
|
||||
val=kit['pl'],
|
||||
fmt=raeting.FIELD_FORMATS['pl']),
|
||||
@ -141,7 +141,7 @@ class TxHead(Head):
|
||||
raise raeting.PacketError(emsg)
|
||||
pl = hl + self.packet.coat.size + data['fl']
|
||||
data['pl'] = pl
|
||||
#subsitute true length converted to 2 byte hex string
|
||||
#substitute true length converted to 2 byte hex string
|
||||
packed = packed.replace('"pl":"0000000"', '"pl":"{0}"'.format("{0:07x}".format(pl)[-7:]), 1)
|
||||
self.packed = packed.replace('"hl":"00"', '"hl":"{0}"'.format("{0:02x}".format(hl)[-2:]), 1)
|
||||
|
||||
@ -158,7 +158,7 @@ class TxHead(Head):
|
||||
|
||||
class RxHead(Head):
|
||||
'''
|
||||
RAET protocl receive packet header class
|
||||
RAET protocol receive packet header class
|
||||
'''
|
||||
def parse(self):
|
||||
'''
|
||||
@ -234,9 +234,9 @@ class RxHead(Head):
|
||||
raise raeting.PacketError(emsg)
|
||||
data['pl'] = pl
|
||||
|
||||
else: # notify unrecognizible packet head
|
||||
else: # notify unrecognizable packet head
|
||||
data['hk'] = raeting.headKinds.unknown
|
||||
emsg = "Unrecognizible packet head."
|
||||
emsg = "Unrecognizable packet head."
|
||||
raise raeting.PacketError(emsg)
|
||||
|
||||
def unpackFlags(self, flags):
|
||||
@ -251,7 +251,7 @@ class RxHead(Head):
|
||||
class Body(Part):
|
||||
'''
|
||||
RAET protocol packet body class
|
||||
Manages the messsage portion of the packet
|
||||
Manages the message portion of the packet
|
||||
'''
|
||||
def __init__(self, data=None, **kwa):
|
||||
'''
|
||||
@ -297,7 +297,7 @@ class RxBody(Body):
|
||||
|
||||
if bk not in raeting.BODY_KIND_NAMES:
|
||||
self.packet.data['bk']= raeting.bodyKinds.unknown
|
||||
emsg = "Unrecognizible packet body."
|
||||
emsg = "Unrecognizable packet body."
|
||||
raise raeting.PacketError(emsg)
|
||||
|
||||
self.data = odict()
|
||||
@ -327,7 +327,7 @@ class RxBody(Body):
|
||||
class Coat(Part):
|
||||
'''
|
||||
RAET protocol packet coat class
|
||||
Supports enapsulated encrypt/decrypt of body portion of packet
|
||||
Supports encapsulated encrypt/decrypt of body portion of packet
|
||||
'''
|
||||
def __init__(self, **kwa):
|
||||
''' Setup Coat instance'''
|
||||
@ -365,7 +365,7 @@ class RxCoat(Coat):
|
||||
|
||||
if ck not in raeting.COAT_KIND_NAMES:
|
||||
self.packet.data['ck'] = raeting.coatKinds.unknown
|
||||
emsg = "Unrecognizible packet coat."
|
||||
emsg = "Unrecognizable packet coat."
|
||||
raise raeting.PacketError(emsg)
|
||||
|
||||
if ck == raeting.coatKinds.nacl:
|
||||
@ -407,7 +407,7 @@ class TxFoot(Foot):
|
||||
|
||||
if fk not in raeting.FOOT_KIND_NAMES:
|
||||
self.packet.data['fk'] = raeting.footKinds.unknown
|
||||
emsg = "Unrecognizible packet foot."
|
||||
emsg = "Unrecognizable packet foot."
|
||||
raise raeting.PacketError(emsg)
|
||||
|
||||
if fk == raeting.footKinds.nacl:
|
||||
@ -423,7 +423,7 @@ class TxFoot(Foot):
|
||||
fk = self.packet.data['fk']
|
||||
if fk not in raeting.FOOT_KIND_NAMES:
|
||||
self.packet.data['fk'] = raeting.footKinds.unknown
|
||||
emsg = "Unrecognizible packet foot."
|
||||
emsg = "Unrecognizable packet foot."
|
||||
raise raeting.PacketError(emsg)
|
||||
|
||||
if fk == raeting.footKinds.nacl:
|
||||
@ -446,7 +446,7 @@ class RxFoot(Foot):
|
||||
|
||||
if fk not in raeting.FOOT_KIND_NAMES:
|
||||
self.packet.data['fk'] = raeting.footKinds.unknown
|
||||
emsg = "Unrecognizible packet foot."
|
||||
emsg = "Unrecognizable packet foot."
|
||||
raise raeting.PacketError(emsg)
|
||||
|
||||
if self.packet.size < fl:
|
||||
@ -488,7 +488,7 @@ class Packet(object):
|
||||
if kind:
|
||||
if kind not in raeting.PCKT_KIND_NAMES:
|
||||
self.data['pk'] = raeting.pcktKinds.unknown
|
||||
emsg = "Unrecognizible packet kind."
|
||||
emsg = "Unrecognizable packet kind."
|
||||
raise raeting.PacketError(emsg)
|
||||
self.data.update(pk=kind)
|
||||
|
||||
|
@ -25,7 +25,7 @@ or holds the field from a received packet.
|
||||
What fields are included in a header is dependent on the header kind.
|
||||
|
||||
Header encoding.
|
||||
When the head kind is json = 0,then certain optimizations are
|
||||
When the head kind is json = 0, then certain optimizations are
|
||||
used to minimize the header length.
|
||||
The header field keys are two bytes long
|
||||
If a header field value is the default then the field is not included
|
||||
|
@ -69,10 +69,10 @@ class Transaction(object):
|
||||
Property is transaction tuple (rf, le, re, si, ti, bf,)
|
||||
'''
|
||||
le = self.stack.estate.eid
|
||||
if le == 0: #bootstapping onto channel use ha
|
||||
if le == 0: #bootstrapping onto channel use ha
|
||||
le = self.stack.estate.ha
|
||||
re = self.reid
|
||||
if re == 0: #bootstapping onto channel use ha
|
||||
if re == 0: #bootstrapping onto channel use ha
|
||||
re = self.stack.estates[self.reid].ha
|
||||
return ((self.rmt, le, re, self.sid, self.tid, self.bcst,))
|
||||
|
||||
@ -173,7 +173,7 @@ class Staler(Initiator):
|
||||
'''
|
||||
for key in ['kind', 'reid', 'sid', 'tid', 'rxPacket']:
|
||||
if key not in kwa:
|
||||
emsg = "Missing required keyword argumens: '{0}'".format(key)
|
||||
emsg = "Missing required keyword arguments: '{0}'".format(key)
|
||||
raise TypeError(emsg)
|
||||
super(Staler, self).__init__(**kwa)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user