<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/unix/modsocket.c, branch v1.5.1</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.5.1</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.5.1'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2015-11-21T15:21:49+00:00</updated>
<entry>
<title>unix/modsocket: Use snprintf(), as defined by lib/utils/printf.c.</title>
<updated>2015-11-21T15:21:49+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-11-21T15:17:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ede1f547e72c89125b78d3fb1cf5dd7d9c68ec92'/>
<id>urn:sha1:ede1f547e72c89125b78d3fb1cf5dd7d9c68ec92</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unix/modsocket: Implement sockaddr() function to decode raw socket address.</title>
<updated>2015-11-20T23:38:59+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-11-20T23:38:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3ba61656bdc725e6dda46f05b5a65247b3ce7925'/>
<id>urn:sha1:3ba61656bdc725e6dda46f05b5a65247b3ce7925</id>
<content type='text'>
Return tuple of (address_family, net_addr, [port, [extra_data]]). net_addr
is still raw network address as bytes object, but suitable for passing to
inet_ntop() function. At the very least, sockaddr() will separate address
family value from binary socket address (and currently, only AF_INET family
is decoded).
</content>
</entry>
<entry>
<title>unix/modsocket: Removed dangling references to sockaddr_in_type.</title>
<updated>2015-11-20T19:32:27+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-11-20T19:32:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2ae7ced72185fbe881a9e878d7463467e857f984'/>
<id>urn:sha1:2ae7ced72185fbe881a9e878d7463467e857f984</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unix/modsocket: Fix usage of pointers to locals outside scope</title>
<updated>2015-10-10T11:59:26+00:00</updated>
<author>
<name>Anmol Sarma</name>
<email>me@anmolsarma.in</email>
</author>
<published>2015-10-10T11:59:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=95b352064ea86f94158a1389a34aeedede01f6fb'/>
<id>urn:sha1:95b352064ea86f94158a1389a34aeedede01f6fb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unix: modsocket: Implement inet_pton() in preference of inet_aton().</title>
<updated>2015-07-14T21:06:03+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-07-14T21:05:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c48740e20b5bfee6cfee271f67f8e99e9df102d7'/>
<id>urn:sha1:c48740e20b5bfee6cfee271f67f8e99e9df102d7</id>
<content type='text'>
inet_pton supports both ipv4 and ipv6 addresses. Interface is also extensible
for other address families, but underlying libc inet_pton() function isn't
really extensible (e.g., it doesn't return length of binary address, i.e. it's
really hardcoded to AF_INET and AF_INET6). But anyway, on Python side, we could
extend it to support other addresses.
</content>
</entry>
<entry>
<title>unix: modsocket: Implement recvfrom().</title>
<updated>2015-07-13T22:47:02+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-07-13T22:46:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b178dccb9cf1f08f4bd55a82f96b597a5e6afc18'/>
<id>urn:sha1:b178dccb9cf1f08f4bd55a82f96b597a5e6afc18</id>
<content type='text'>
Required to implement UDP servers.
</content>
</entry>
<entry>
<title>unix: modsocket: Implement sendto().</title>
<updated>2015-07-12T10:53:35+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-07-12T10:51:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3b83aeb4038d62fc50511584516f4a1709bfdc8a'/>
<id>urn:sha1:3b83aeb4038d62fc50511584516f4a1709bfdc8a</id>
<content type='text'>
sendto() turns out to be mandatory function to work with UDP. It may seem
that connect(addr) + send() would achieve the same effect, but what connect()
appears to do is to set source address filter on a socket to its argument.
Then everything falls apart: socket sends to a broad-/multi-cast address,
but reply is sent from real peer address, which doesn't match filter set
by connect(), so local socket never sees a reply.
</content>
</entry>
<entry>
<title>unix: socket.getaddrinfo: Port is unsigned value.</title>
<updated>2015-07-10T21:06:10+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-07-10T21:05:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=115afdb07d10ed9f8c1f886f880a11a77243d2ba'/>
<id>urn:sha1:115afdb07d10ed9f8c1f886f880a11a77243d2ba</id>
<content type='text'>
Treating it as signed lead to buffer overflow for ports &gt;= 32768.
</content>
</entry>
<entry>
<title>unix: socket.getaddrinfo: Accept family &amp; socktype arguments.</title>
<updated>2015-07-09T22:50:23+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-07-09T22:48:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8eb802a55b1ef5386829e5dfdb12710d7391b9f1'/>
<id>urn:sha1:8eb802a55b1ef5386829e5dfdb12710d7391b9f1</id>
<content type='text'>
This usually allows to get just a single address entry.
</content>
</entry>
<entry>
<title>py: Overhaul and simplify printf/pfenv mechanism.</title>
<updated>2015-04-16T14:30:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-04-09T22:56:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7f9d1d6ab923096582622b700bedb6a571518eac'/>
<id>urn:sha1:7f9d1d6ab923096582622b700bedb6a571518eac</id>
<content type='text'>
Previous to this patch the printing mechanism was a bit of a tangled
mess.  This patch attempts to consolidate printing into one interface.

All (non-debug) printing now uses the mp_print* family of functions,
mainly mp_printf.  All these functions take an mp_print_t structure as
their first argument, and this structure defines the printing backend
through the "print_strn" function of said structure.

Printing from the uPy core can reach the platform-defined print code via
two paths: either through mp_sys_stdout_obj (defined pert port) in
conjunction with mp_stream_write; or through the mp_plat_print structure
which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
on the platform.  The former is only used when MICROPY_PY_IO is defined.

With this new scheme printing is generally more efficient (less layers
to go through, less arguments to pass), and, given an mp_print_t*
structure, one can call mp_print_str for efficiency instead of
mp_printf("%s", ...).  Code size is also reduced by around 200 bytes on
Thumb2 archs.
</content>
</entry>
</feed>
