Hi,<br><br>SCP? FTP?<br><br>My company will be releasing soon in OSS an application built on top of Twisted that in other things perform this<br><br>Nicolas<br><br><div class="gmail_quote">On Tue, Jan 20, 2009 at 9:57 PM, Worsham, Michael <span dir="ltr">&lt;<a href="mailto:michael.worsham@morris.com">michael.worsham@morris.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">










<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><span><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">I was recommended to look at the
Twisted application framework for replacing a legacy application that relies on
RPC portmapper, so here's my issue and question…</span></font></span></p>

<p><span><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></span></p>

<p><span><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Currently, we use an in-house
designed application called &#39;Fileman&#39;, which acts as a combined bi-directional
shared library (client) and server system to transfer data files between other
&#39;Fileman&#39; server points. The problem is that the Fileman application requires
portmapper under Linux which exposes all TCP ports (i.e. a network security
nightmare). Fileman also has the ability to send data in either ASCII or binary
format and at receiver end -- change directories, modify user id (uid) and
group id (gid) of file once data is received.</span></font></span><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"><br>
<br>
<span>---</span><br>
<br>
<span>Here is what Fileman can perform via following functions from
client side code:</span><br>
<br>
<span>struct StatResult &nbsp; *pFileMan_FileStat(char *host, char
*file, int userid, int groupid);</span><br>
<span>struct StatResult &nbsp; *pFileMan_GetDirectoryListing(char
*host, char *dir, int userid, int groupid, int *entries);</span><br>
<span>int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
iFileMan_PutAsciiFile(char *host, char *file, char *cpBuf, int bMakeDir,
int userid, int groupid);</span><br>
<span>char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;*cpFileMan_GetAsciiFile(char *host, char *file, int userid, int
groupid, int *result);</span><br>
<span>int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
iFileMan_PutBinaryFile(char *host, char *file, char *cpBuf, int bMakeDir,
int userid, int groupid, int length);</span><br>
<span>char &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;*cpFileMan_GetBinaryFile(char *host, char *file, int userid, int
groupid, int *result, int *length);</span><br>
<span>int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
iFileMan_DeleteFile(char *host, char *file, int userid, int groupid);</span><br>
<span>int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
bFileMan_Ping(char *cpHost);</span><br>
<span>void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;vFileMan_ResetStats(void);</span><br>
<span>int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
iFileMan_GetNumOps();</span><br>
<span>double &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;dFileMan_GetSecsSpent();</span><br>
<span>void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;vFileMan_SetTimeout(int iSecs);</span><br>
<br>
<span>Above functions translates to &#39;over the wire&#39; execution of:</span><br>
<span>stat</span><br>
<span>opendir, readdir</span><br>
<span>fopen, fwrite with any necessary mkdir, chown/chgrp to given
group</span><br>
<span>fopen, read, subject to uid/gid restrictions</span><br>
<span>fopen, fwrite with any necessary mkdir, chown/chgrp to given
group</span><br>
<span>fopen, read, subject to uid/gid restrictions</span><br>
<span>unlink subject to uid/gid restrictions</span><br>
<span>noop response from server</span><br>
<span>Internal stat change</span><br>
<span>Internal stat info</span><br>
<span>Internal stat info</span><br>
<span>Set network timeout parameters for operation</span><br>
<br>
</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Usage/Syntax from 'Fileman' client:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">void printUsage()</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">{</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot;Usage: \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot;&nbsp; \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot; fileman Get [remote_host]
[remote_file] [remote_uid] [remote_gid] [local_file] \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot; fileman GetAscii
[remote_host] [remote_file] [remote_uid] [remote_gid] [local_file] \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot; fileman GetBinary
[remote_host] [remote_file] [remote_uid] [remote_gid] [local_file] \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot; fileman Put [remote_host]
[remote_file] [remote_uid] [remote_gid] [local_file] \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot; fileman PutAscii
[remote_host] [remote_file] [remote_uid] [remote_gid] [local_file] \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot; fileman PutBinary
[remote_host] [remote_file] [remote_uid] [remote_gid] [local_file] \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot; fileman Stat [remote_host]
[remote_file] [remote_uid] [remote_gid] \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot; fileman Ping
[remote_host] \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp; printf(&quot;&nbsp; \n&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">}</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"><br>
<span>---</span><br>
<br>
<span>My question is can the Twisted framework be utilized in a way
that can do actions of sending and receiving data in either ASCII or binary
format, change uid or gid permissions of files once delivered, run as a
client/server client &amp; listener and utilize one (or two) TCP ports for both
sending and listening upon?</span><br>
<br>
<span>Known application replacement requirements:</span><br>
<span>1) Application must be able to run upon RHEL/CentOS 5.x Linux
platform.</span><br>
<span>2) Application must be able to be locked down to one or two
TCP ports for listening and sending data upon.</span><br>
<span>3) Application must be able to take command line (CLI)
instructions</span><br>
<span>4) Application must be able to transfer data in ASCII or
binary format (i.e. graphic images)</span><br>
<span>5) Application must be able to [at receiver end]: change
directories, modify user id (uid) and group id (gid) of file once data is
received.</span><br>
<br>
<span>Current solutions we are actively looking at now:</span><br>
<span>&nbsp;-- Apache&#39;s WebDAV: Uses port 80; Needs apache instance
on each server; cannot change uid or gid permissions of files</span><br>
<span>&nbsp;-- Apache&#39;s ActiveMQ: Uses channel/queue/broker system;
requires trigger queue and external program for dumping queue data; Needs Java
platform</span><br>
<span>&nbsp;-- JBoss Messaging: Suffers same issues as Apache&#39;s
ActiveMQ; Requires costly licensing</span><br>
<span>&nbsp;-- IBM Websphere MQ: Suffers same issues as Apache&#39;s
ActiveMQ; Requires costly licensing</span></span></font></p>

<p><span><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;-- XML-RPC Library for C &amp;
C++ -- <a href="http://xmlrpc-c.sourceforge.net/" target="_blank">http://xmlrpc-c.sourceforge.net/</a></span></font></span></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"><br>
<span>Anyone have any ideas or other plausible solutions for
solving this problem?</span></span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">-- Michael</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">---<br>
Michael Worsham<br>
Sr. System Engineer, IT Architect<br>
Morris Technology Services, IHS Division</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

</div>

</div>


<br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>A+<br>Nico<br><a href="http://www.deviant-abstraction.net">http://www.deviant-abstraction.net</a><br>