<commit_before>#!/usr/bin/python

from pyroute2.netlink.iproute import *
from pyroute2 import IPRoute
from pyroute2 import IPDB
import dns
from qmf.console import Session
import subprocess
import netaddr
import select
import sys
import dns.resolver
import os
import re
import radvd
import routerlink
import datapath
import time
import qmf2
import cqmf2
import cqpid
    


EVENT_QUIT = 0
EVENT_IPROUTE = 1
EVENT_RA_ATTACHED = 2
EVENT_RA_DETACHED = 3
EVENT_PREFIX_ATTACHED = 4
EVENT_PREFIX_DETACHED = 5

ifaces = {'wan': ['ge0'], 'lan': ['ge1'], 'dmz': []}
brokerUrl = "amqp://127.0.0.1:5672"



class HomeGatewayQmfAgentHandler(qmf2.AgentHandler):
    """
    QMF agent handler for class HomeGateway
    """
    def __init__(self, homegw, agentSession):
        qmf2.AgentHandler.__init__(self, agentSession)
        self.agentSession = agentSession
        
        self.qmfSchemaHomeGateway = qmf2.Schema(qmf2.SCHEMA_TYPE_DATA, "de.bisdn.proact.homegw", "homegw")
        #self.qmfSchemaHomeGateway.addProperty(qmf2.SchemaProperty("dptcoreid", qmf2.SCHEMA_DATA_INT))
        
        self.qmfSchemaHomeGateway_testMethod = qmf2.SchemaMethod("test", desc='testing method for QMF agent support in python')
        self.qmfSchemaHomeGateway_testMethod.addArgument(qmf2.SchemaProperty("subcmd", qmf2.SCHEMA_DATA_STRING, direction=qmf2.DIR_IN))
        self.qmfSchemaHomeGateway_testMethod.addArgument(qmf2.SchemaProperty("outstring", qmf2.SCHEMA_DATA_STRING, direction=qmf2.DIR_OUT))
        self.qmfSchemaHomeGateway.addMethod(self.qmfSchemaHomeGateway_testMethod)

        # add further methods here ...
<commit_msg>homegw: assign IP address for L2TP tunnel via dptcore<commit_after>#!/usr/bin/python

from pyroute2.netlink.iproute import *
from pyroute2 import IPRoute
from pyroute2 import IPDB
import dns
from qmf.console import Session
import subprocess
import netaddr
import select
import sys
import dns.resolver
import os
import re
import radvd
import routerlink
import datapath
import time
import qmf2
import cqmf2
import cqpid
    


EVENT_QUIT = 0
EVENT_IPROUTE = 1
EVENT_RA_ATTACHED = 2
EVENT_RA_DETACHED = 3
EVENT_PREFIX_ATTACHED = 4
EVENT_PREFIX_DETACHED = 5

ifaces = {'wan': ['ge0'], 'lan': ['ge1'], 'dmz': ['veth0']}
brokerUrl = "amqp://127.0.0.1:5672"



class HomeGatewayQmfAgentHandler(qmf2.AgentHandler):
    """
    QMF agent handler for class HomeGateway
    """
    def __init__(self, homegw, agentSession):
        qmf2.AgentHandler.__init__(self, agentSession)
        self.agentSession = agentSession
        
        self.qmfSchemaHomeGateway = qmf2.Schema(qmf2.SCHEMA_TYPE_DATA, "de.bisdn.proact.homegw", "homegw")
        #self.qmfSchemaHomeGateway.addProperty(qmf2.SchemaProperty("dptcoreid", qmf2.SCHEMA_DATA_INT))
        
        self.qmfSchemaHomeGateway_testMethod = qmf2.SchemaMethod("test", desc='testing method for QMF agent support in python')
        self.qmfSchemaHomeGateway_testMethod.addArgument(qmf2.SchemaProperty("subcmd", qmf2.SCHEMA_DATA_STRING, direction=qmf2.DIR_IN))
        self.qmfSchemaHomeGateway_testMethod.addArgument(qmf2.SchemaProperty("outstring", qmf2.SCHEMA_DATA_STRING, direction=qmf2.DIR_OUT))
        self.qmfSchemaHomeGateway.addMethod(self.qmfSchemaHomeGateway_testMethod)

        # add further methods here ...

{'fraction_non_alphanumeric': 0.09240622140896615, 'fraction_numerical': 0.022567856053674902, 'mean_word_length': 4.587734241908007, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4083965', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1131, 'n_words': 227}