<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>


        
        
        
        <style type="text/css">p { margin-bottom: 0.25cm; line-height: 120%; }</style>


<p style="margin-bottom: 0cm; line-height: 100%">class
AddPortCommand(BaseCommand):<br>
    def
__init__(self, api, bridge, port, may_exist):<br>
       
super(AddPortCommand, self).__init__(api)<br>
       
self.bridge = bridge<br>
       
self.port = port<br>
       
self.may_exist = may_exist<br>
<br>
    def
run_idl(self, txn):<br>
       
br = idlutils.row_by_value(self.api.idl, 'Bridge', 'name',
self.bridge)<br>
        if
self.may_exist:<br>
           
port = idlutils.row_by_value(self.api.idl, 'Port',
'name',<br>
                                        
self.port, None)<br>
           
if port:<br>
               
return<br>
        port =
txn.insert(self.api._tables['Port'])<br>
       
port.name = self.port<br>
       
br.verify('ports')<br>
       
ports = getattr(br, 'ports', [])<br>
       
ports.append(port)<br>
       
br.ports = ports<br>
<br>
       
iface = txn.insert(self.api._tables['Interface'])<br>
       
iface.name = self.port<br>
       
port.verify('interfaces')<br>
       
ifaces = getattr(port, 'interfaces', [])<br>
       
ifaces.append(iface)<br>
       
port.interfaces = ifaces.</p><p style="margin-bottom: 0cm; line-height: 100%"><br></p><p style="margin-bottom: 0cm; line-height: 100%"><br></p><p style="margin-bottom: 0cm; line-height: 100%"><br></p><p style="margin-bottom: 0cm; line-height: 100%">I want to do some changing in this code.</p><p style="margin-bottom: 0cm; line-height: 100%"><br></p><p style="margin-bottom: 0cm; line-height: 100%">1. Make sure to only bridge TAP interfaces with private ethernet interfaces
 which are protected behind a firewall. Never bridge a TAP interface 
with the same ethernet interface you use to connect to the internet, as 
that would create a potential security hole.</p><p style="margin-bottom: 0cm; line-height: 100%"><br></p><p style="margin-bottom: 0cm; line-height: 100%">how can I do this:- any help please.</p><p style="margin-bottom: 0cm; line-height: 100%"><br></p><p style="margin-bottom: 0cm; line-height: 100%"><br></p><p style="margin-bottom: 0cm; line-height: 100%">Regards, <br></p><p style="margin-bottom: 0cm; line-height: 100%"><br></p><p style="margin-bottom: 0cm; line-height: 100%">A.<br></p>

                                          </div></body>
</html>