repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
peterm-itr/edx-platform
common/djangoapps/terrain/stubs/lti.py
13
12432
""" Stub implementation of LTI Provider. What is supported: ------------------ 1.) This LTI Provider can service only one Tool Consumer at the same time. It is not possible to have this LTI multiple times on a single page in LMS. """ from uuid import uuid4 import textwrap import urllib import re from oauthlib.oauth1.rfc5849 import signature, parameters import oauthlib.oauth1 import hashlib import base64 import mock import requests from http import StubHttpRequestHandler, StubHttpService class StubLtiHandler(StubHttpRequestHandler): """ A handler for LTI POST and GET requests. """ DEFAULT_CLIENT_KEY = 'test_client_key' DEFAULT_CLIENT_SECRET = 'test_client_secret' DEFAULT_LTI_ENDPOINT = 'correct_lti_endpoint' DEFAULT_LTI_ADDRESS = 'http://127.0.0.1:{port}/' def do_GET(self): """ Handle a GET request from the client and sends response back. Used for checking LTI Provider started correctly. """ self.send_response(200, 'This is LTI Provider.', {'Content-type': 'text/plain'}) def do_POST(self): """ Handle a POST request from the client and sends response back. """ if 'grade' in self.path and self._send_graded_result().status_code == 200: status_message = 'LTI consumer (edX) responded with XML content:<br>' + self.server.grade_data['TC answer'] content = self._create_content(status_message) self.send_response(200, content) elif 'lti2_outcome' in self.path and self._send_lti2_outcome().status_code == 200: status_message = 'LTI consumer (edX) responded with HTTP {}<br>'.format( self.server.grade_data['status_code']) content = self._create_content(status_message) self.send_response(200, content) elif 'lti2_delete' in self.path and self._send_lti2_delete().status_code == 200: status_message = 'LTI consumer (edX) responded with HTTP {}<br>'.format( self.server.grade_data['status_code']) content = self._create_content(status_message) self.send_response(200, content) # Respond to request with correct lti endpoint elif self._is_correct_lti_request(): params = {k: v for k, v in self.post_dict.items() if k != 'oauth_signature'} if self._check_oauth_signature(params, self.post_dict.get('oauth_signature', "")): status_message = "This is LTI tool. Success." # Set data for grades what need to be stored as server data if 'lis_outcome_service_url' in self.post_dict: self.server.grade_data = { 'callback_url': self.post_dict.get('lis_outcome_service_url').replace('https', 'http'), 'sourcedId': self.post_dict.get('lis_result_sourcedid') } submit_url = '//{}:{}'.format(*self.server.server_address) content = self._create_content(status_message, submit_url) self.send_response(200, content) else: content = self._create_content("Wrong LTI signature") self.send_response(200, content) else: content = self._create_content("Invalid request URL") self.send_response(500, content) def _send_graded_result(self): """ Send grade request. """ values = { 'textString': 0.5, 'sourcedId': self.server.grade_data['sourcedId'], 'imsx_messageIdentifier': uuid4().hex, } payload = textwrap.dedent(""" <?xml version = "1.0" encoding = "UTF-8"?> <imsx_POXEnvelopeRequest xmlns="http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0"> <imsx_POXHeader> <imsx_POXRequestHeaderInfo> <imsx_version>V1.0</imsx_version> <imsx_messageIdentifier>{imsx_messageIdentifier}</imsx_messageIdentifier> / </imsx_POXRequestHeaderInfo> </imsx_POXHeader> <imsx_POXBody> <replaceResultRequest> <resultRecord> <sourcedGUID> <sourcedId>{sourcedId}</sourcedId> </sourcedGUID> <result> <resultScore> <language>en-us</language> <textString>{textString}</textString> </resultScore> </result> </resultRecord> </replaceResultRequest> </imsx_POXBody> </imsx_POXEnvelopeRequest> """) data = payload.format(**values) url = self.server.grade_data['callback_url'] headers = { 'Content-Type': 'application/xml', 'X-Requested-With': 'XMLHttpRequest', 'Authorization': self._oauth_sign(url, data) } # Send request ignoring verifirecation of SSL certificate response = requests.post(url, data=data, headers=headers, verify=False) self.server.grade_data['TC answer'] = response.content return response def _send_lti2_outcome(self): """ Send a grade back to consumer """ payload = textwrap.dedent(""" {{ "@context" : "http://purl.imsglobal.org/ctx/lis/v2/Result", "@type" : "Result", "resultScore" : {score}, "comment" : "This is awesome." }} """) data = payload.format(score=0.8) return self._send_lti2(data) def _send_lti2_delete(self): """ Send a delete back to consumer """ payload = textwrap.dedent(""" { "@context" : "http://purl.imsglobal.org/ctx/lis/v2/Result", "@type" : "Result" } """) return self._send_lti2(payload) def _send_lti2(self, payload): """ Send lti2 json result service request. """ ### We compute the LTI V2.0 service endpoint from the callback_url (which is set by the launch call) url = self.server.grade_data['callback_url'] url_parts = url.split('/') url_parts[-1] = "lti_2_0_result_rest_handler" anon_id = self.server.grade_data['sourcedId'].split(":")[-1] url_parts.extend(["user", anon_id]) new_url = '/'.join(url_parts) content_type = 'application/vnd.ims.lis.v2.result+json' headers = { 'Content-Type': content_type, 'Authorization': self._oauth_sign(new_url, payload, method='PUT', content_type=content_type) } # Send request ignoring verifirecation of SSL certificate response = requests.put(new_url, data=payload, headers=headers, verify=False) self.server.grade_data['status_code'] = response.status_code self.server.grade_data['TC answer'] = response.content return response def _create_content(self, response_text, submit_url=None): """ Return content (str) either for launch, send grade or get result from TC. """ if submit_url: submit_form = textwrap.dedent(""" <form action="{submit_url}/grade" method="post"> <input type="submit" name="submit-button" value="Submit"> </form> <form action="{submit_url}/lti2_outcome" method="post"> <input type="submit" name="submit-lti2-button" value="Submit"> </form> <form action="{submit_url}/lti2_delete" method="post"> <input type="submit" name="submit-lti2-delete-button" value="Submit"> </form> """).format(submit_url=submit_url) else: submit_form = '' # Show roles only for LTI launch. if self.post_dict.get('roles'): role = '<h5>Role: {}</h5>'.format(self.post_dict['roles']) else: role = '' response_str = textwrap.dedent(""" <html> <head> <title>TEST TITLE</title> </head> <body> <div> <h2>IFrame loaded</h2> <h3>Server response is:</h3> <h3 class="result">{response}</h3> {role} </div> {submit_form} </body> </html> """).format(response=response_text, role=role, submit_form=submit_form) # Currently LTI module doublequotes the lis_result_sourcedid parameter. # Unquote response two times. return urllib.unquote(urllib.unquote(response_str)) def _is_correct_lti_request(self): """ Return a boolean indicating whether the URL path is a valid LTI end-point. """ lti_endpoint = self.server.config.get('lti_endpoint', self.DEFAULT_LTI_ENDPOINT) return lti_endpoint in self.path def _oauth_sign(self, url, body, content_type=u'application/x-www-form-urlencoded', method=u'POST'): """ Signs request and returns signed Authorization header. """ client_key = self.server.config.get('client_key', self.DEFAULT_CLIENT_KEY) client_secret = self.server.config.get('client_secret', self.DEFAULT_CLIENT_SECRET) client = oauthlib.oauth1.Client( client_key=unicode(client_key), client_secret=unicode(client_secret) ) headers = { # This is needed for body encoding: 'Content-Type': content_type, } # Calculate and encode body hash. See http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html sha1 = hashlib.sha1() sha1.update(body) oauth_body_hash = unicode(base64.b64encode(sha1.digest())) # pylint: disable=too-many-function-args params = client.get_oauth_params(None) params.append((u'oauth_body_hash', oauth_body_hash)) mock_request = mock.Mock( uri=unicode(urllib.unquote(url)), headers=headers, body=u"", decoded_body=u"", oauth_params=params, http_method=unicode(method), ) sig = client.get_oauth_signature(mock_request) mock_request.oauth_params.append((u'oauth_signature', sig)) new_headers = parameters.prepare_headers(mock_request.oauth_params, headers, realm=None) return new_headers['Authorization'] def _check_oauth_signature(self, params, client_signature): """ Checks oauth signature from client. `params` are params from post request except signature, `client_signature` is signature from request. Builds mocked request and verifies hmac-sha1 signing:: 1. builds string to sign from `params`, `url` and `http_method`. 2. signs it with `client_secret` which comes from server settings. 3. obtains signature after sign and then compares it with request.signature (request signature comes form client in request) Returns `True` if signatures are correct, otherwise `False`. """ client_secret = unicode(self.server.config.get('client_secret', self.DEFAULT_CLIENT_SECRET)) port = self.server.server_address[1] lti_base = self.DEFAULT_LTI_ADDRESS.format(port=port) lti_endpoint = self.server.config.get('lti_endpoint', self.DEFAULT_LTI_ENDPOINT) url = lti_base + lti_endpoint request = mock.Mock() request.params = [(unicode(k), unicode(v)) for k, v in params.items()] request.uri = unicode(url) request.http_method = u'POST' request.signature = unicode(client_signature) return signature.verify_hmac_sha1(request, client_secret) class StubLtiService(StubHttpService): """ A stub LTI provider server that responds to POST and GET requests to localhost. """ HANDLER_CLASS = StubLtiHandler
agpl-3.0
mitya57/django
django/contrib/admin/helpers.py
17
14265
import json from django import forms from django.conf import settings from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field, ) from django.core.exceptions import ObjectDoesNotExist from django.db.models.fields.related import ManyToManyRel from django.forms.utils import flatatt from django.template.defaultfilters import capfirst, linebreaksbr from django.utils.html import conditional_escape, format_html from django.utils.safestring import mark_safe from django.utils.translation import gettext, gettext_lazy as _ ACTION_CHECKBOX_NAME = '_selected_action' class ActionForm(forms.Form): action = forms.ChoiceField(label=_('Action:')) select_across = forms.BooleanField( label='', required=False, initial=0, widget=forms.HiddenInput({'class': 'select-across'}), ) checkbox = forms.CheckboxInput({'class': 'action-select'}, lambda value: False) class AdminForm: def __init__(self, form, fieldsets, prepopulated_fields, readonly_fields=None, model_admin=None): self.form, self.fieldsets = form, fieldsets self.prepopulated_fields = [{ 'field': form[field_name], 'dependencies': [form[f] for f in dependencies] } for field_name, dependencies in prepopulated_fields.items()] self.model_admin = model_admin if readonly_fields is None: readonly_fields = () self.readonly_fields = readonly_fields def __iter__(self): for name, options in self.fieldsets: yield Fieldset( self.form, name, readonly_fields=self.readonly_fields, model_admin=self.model_admin, **options ) @property def errors(self): return self.form.errors @property def non_field_errors(self): return self.form.non_field_errors @property def media(self): media = self.form.media for fs in self: media = media + fs.media return media class Fieldset: def __init__(self, form, name=None, readonly_fields=(), fields=(), classes=(), description=None, model_admin=None): self.form = form self.name, self.fields = name, fields self.classes = ' '.join(classes) self.description = description self.model_admin = model_admin self.readonly_fields = readonly_fields @property def media(self): if 'collapse' in self.classes: extra = '' if settings.DEBUG else '.min' js = [ 'vendor/jquery/jquery%s.js' % extra, 'jquery.init.js', 'collapse%s.js' % extra, ] return forms.Media(js=['admin/js/%s' % url for url in js]) return forms.Media() def __iter__(self): for field in self.fields: yield Fieldline(self.form, field, self.readonly_fields, model_admin=self.model_admin) class Fieldline: def __init__(self, form, field, readonly_fields=None, model_admin=None): self.form = form # A django.forms.Form instance if not hasattr(field, "__iter__") or isinstance(field, str): self.fields = [field] else: self.fields = field self.has_visible_field = not all( field in self.form.fields and self.form.fields[field].widget.is_hidden for field in self.fields ) self.model_admin = model_admin if readonly_fields is None: readonly_fields = () self.readonly_fields = readonly_fields def __iter__(self): for i, field in enumerate(self.fields): if field in self.readonly_fields: yield AdminReadonlyField(self.form, field, is_first=(i == 0), model_admin=self.model_admin) else: yield AdminField(self.form, field, is_first=(i == 0)) def errors(self): return mark_safe( '\n'.join( self.form[f].errors.as_ul() for f in self.fields if f not in self.readonly_fields ).strip('\n') ) class AdminField: def __init__(self, form, field, is_first): self.field = form[field] # A django.forms.BoundField instance self.is_first = is_first # Whether this field is first on the line self.is_checkbox = isinstance(self.field.field.widget, forms.CheckboxInput) self.is_readonly = False def label_tag(self): classes = [] contents = conditional_escape(self.field.label) if self.is_checkbox: classes.append('vCheckboxLabel') if self.field.field.required: classes.append('required') if not self.is_first: classes.append('inline') attrs = {'class': ' '.join(classes)} if classes else {} # checkboxes should not have a label suffix as the checkbox appears # to the left of the label. return self.field.label_tag( contents=mark_safe(contents), attrs=attrs, label_suffix='' if self.is_checkbox else None, ) def errors(self): return mark_safe(self.field.errors.as_ul()) class AdminReadonlyField: def __init__(self, form, field, is_first, model_admin=None): # Make self.field look a little bit like a field. This means that # {{ field.name }} must be a useful class name to identify the field. # For convenience, store other field-related data here too. if callable(field): class_name = field.__name__ if field.__name__ != '<lambda>' else '' else: class_name = field if form._meta.labels and class_name in form._meta.labels: label = form._meta.labels[class_name] else: label = label_for_field(field, form._meta.model, model_admin) if form._meta.help_texts and class_name in form._meta.help_texts: help_text = form._meta.help_texts[class_name] else: help_text = help_text_for_field(class_name, form._meta.model) self.field = { 'name': class_name, 'label': label, 'help_text': help_text, 'field': field, } self.form = form self.model_admin = model_admin self.is_first = is_first self.is_checkbox = False self.is_readonly = True self.empty_value_display = model_admin.get_empty_value_display() def label_tag(self): attrs = {} if not self.is_first: attrs["class"] = "inline" label = self.field['label'] return format_html('<label{}>{}:</label>', flatatt(attrs), capfirst(label)) def contents(self): from django.contrib.admin.templatetags.admin_list import _boolean_icon field, obj, model_admin = self.field['field'], self.form.instance, self.model_admin try: f, attr, value = lookup_field(field, obj, model_admin) except (AttributeError, ValueError, ObjectDoesNotExist): result_repr = self.empty_value_display else: if f is None: boolean = getattr(attr, "boolean", False) if boolean: result_repr = _boolean_icon(value) else: if hasattr(value, "__html__"): result_repr = value else: result_repr = linebreaksbr(value) else: if isinstance(f.remote_field, ManyToManyRel) and value is not None: result_repr = ", ".join(map(str, value.all())) else: result_repr = display_for_field(value, f, self.empty_value_display) result_repr = linebreaksbr(result_repr) return conditional_escape(result_repr) class InlineAdminFormSet: """ A wrapper around an inline formset for use in the admin system. """ def __init__(self, inline, formset, fieldsets, prepopulated_fields=None, readonly_fields=None, model_admin=None): self.opts = inline self.formset = formset self.fieldsets = fieldsets self.model_admin = model_admin if readonly_fields is None: readonly_fields = () self.readonly_fields = readonly_fields if prepopulated_fields is None: prepopulated_fields = {} self.prepopulated_fields = prepopulated_fields self.classes = ' '.join(inline.classes) if inline.classes else '' def __iter__(self): for form, original in zip(self.formset.initial_forms, self.formset.get_queryset()): view_on_site_url = self.opts.get_view_on_site_url(original) yield InlineAdminForm( self.formset, form, self.fieldsets, self.prepopulated_fields, original, self.readonly_fields, model_admin=self.opts, view_on_site_url=view_on_site_url, ) for form in self.formset.extra_forms: yield InlineAdminForm( self.formset, form, self.fieldsets, self.prepopulated_fields, None, self.readonly_fields, model_admin=self.opts, ) yield InlineAdminForm( self.formset, self.formset.empty_form, self.fieldsets, self.prepopulated_fields, None, self.readonly_fields, model_admin=self.opts, ) def fields(self): fk = getattr(self.formset, "fk", None) for i, field_name in enumerate(flatten_fieldsets(self.fieldsets)): if fk and fk.name == field_name: continue if field_name in self.readonly_fields: yield { 'label': label_for_field(field_name, self.opts.model, self.opts), 'widget': {'is_hidden': False}, 'required': False, 'help_text': help_text_for_field(field_name, self.opts.model), } else: form_field = self.formset.empty_form.fields[field_name] label = form_field.label if label is None: label = label_for_field(field_name, self.opts.model, self.opts) yield { 'label': label, 'widget': form_field.widget, 'required': form_field.required, 'help_text': form_field.help_text, } def inline_formset_data(self): verbose_name = self.opts.verbose_name return json.dumps({ 'name': '#%s' % self.formset.prefix, 'options': { 'prefix': self.formset.prefix, 'addText': gettext('Add another %(verbose_name)s') % { 'verbose_name': capfirst(verbose_name), }, 'deleteText': gettext('Remove'), } }) @property def forms(self): return self.formset.forms @property def non_form_errors(self): return self.formset.non_form_errors @property def media(self): media = self.opts.media + self.formset.media for fs in self: media = media + fs.media return media class InlineAdminForm(AdminForm): """ A wrapper around an inline form for use in the admin system. """ def __init__(self, formset, form, fieldsets, prepopulated_fields, original, readonly_fields=None, model_admin=None, view_on_site_url=None): self.formset = formset self.model_admin = model_admin self.original = original self.show_url = original and view_on_site_url is not None self.absolute_url = view_on_site_url super().__init__(form, fieldsets, prepopulated_fields, readonly_fields, model_admin) def __iter__(self): for name, options in self.fieldsets: yield InlineFieldset( self.formset, self.form, name, self.readonly_fields, model_admin=self.model_admin, **options ) def needs_explicit_pk_field(self): # Auto fields are editable (oddly), so need to check for auto or non-editable pk if self.form._meta.model._meta.auto_field or not self.form._meta.model._meta.pk.editable: return True # Also search any parents for an auto field. (The pk info is propagated to child # models so that does not need to be checked in parents.) for parent in self.form._meta.model._meta.get_parent_list(): if parent._meta.auto_field: return True return False def pk_field(self): return AdminField(self.form, self.formset._pk_field.name, False) def fk_field(self): fk = getattr(self.formset, "fk", None) if fk: return AdminField(self.form, fk.name, False) else: return "" def deletion_field(self): from django.forms.formsets import DELETION_FIELD_NAME return AdminField(self.form, DELETION_FIELD_NAME, False) def ordering_field(self): from django.forms.formsets import ORDERING_FIELD_NAME return AdminField(self.form, ORDERING_FIELD_NAME, False) class InlineFieldset(Fieldset): def __init__(self, formset, *args, **kwargs): self.formset = formset super().__init__(*args, **kwargs) def __iter__(self): fk = getattr(self.formset, "fk", None) for field in self.fields: if fk and fk.name == field: continue yield Fieldline(self.form, field, self.readonly_fields, model_admin=self.model_admin) class AdminErrorList(forms.utils.ErrorList): """Store errors for the form/formsets in an add/change view.""" def __init__(self, form, inline_formsets): super().__init__() if form.is_bound: self.extend(form.errors.values()) for inline_formset in inline_formsets: self.extend(inline_formset.non_form_errors()) for errors_in_inline_form in inline_formset.errors: self.extend(errors_in_inline_form.values())
bsd-3-clause
bdfoster/blumate
tests/components/notify/test_demo.py
1
1653
"""The tests for the notify demo platform.""" import unittest import blumate.components.notify as notify from blumate.components.notify import demo from tests.common import get_test_home_assistant class TestNotifyDemo(unittest.TestCase): """Test the demo notify.""" def setUp(self): # pylint: disable=invalid-name """Setup things to be run when tests are started.""" self.hass = get_test_home_assistant() self.assertTrue(notify.setup(self.hass, { 'notify': { 'platform': 'demo' } })) self.events = [] def record_event(event): """Record event to send notification.""" self.events.append(event) self.hass.bus.listen(demo.EVENT_NOTIFY, record_event) def tearDown(self): # pylint: disable=invalid-name """"Stop down everything that was started.""" self.hass.stop() def test_sending_none_message(self): """Test send with None as message.""" notify.send_message(self.hass, None) self.hass.pool.block_till_done() self.assertTrue(len(self.events) == 0) def test_sending_templated_message(self): """Send a templated message.""" self.hass.states.set('sensor.temperature', 10) notify.send_message(self.hass, '{{ states.sensor.temperature.state }}', '{{ states.sensor.temperature.name }}') self.hass.pool.block_till_done() last_event = self.events[-1] self.assertEqual(last_event.data[notify.ATTR_TITLE], 'temperature') self.assertEqual(last_event.data[notify.ATTR_MESSAGE], '10')
mit
elijah513/ice
scripts/IceGridAdmin.py
3
11771
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # ********************************************************************** import sys, os, TestUtil, shlex from threading import Thread # # Set nreplicas to a number N to test replication with N replicas. # nreplicas=0 #nreplicas=1 iceGridPort = 12010; nodeOptions = r' --Ice.Warn.Connections=0' + \ r' --IceGrid.InstanceName=TestIceGrid' + \ r' --IceGrid.Node.Endpoints=default' + \ r' --IceGrid.Node.WaitTime=240' + \ r' --Ice.ProgramName=icegridnode' + \ r' --IceGrid.Node.Trace.Replica=0' + \ r' --IceGrid.Node.Trace.Activator=0' + \ r' --IceGrid.Node.Trace.Adapter=0' + \ r' --IceGrid.Node.Trace.Server=0' + \ r' --IceGrid.Node.ThreadPool.SizeWarn=0' + \ r' --IceGrid.Node.PrintServersReady=node1' + \ r' --Ice.NullHandleAbort' + \ r' --Ice.ThreadPool.Server.Size=1' + \ r' --Ice.ServerIdleTime=0' registryOptions = r' --Ice.Warn.Connections=0' + \ r' --IceGrid.InstanceName=TestIceGrid' + \ r' --IceGrid.Registry.PermissionsVerifier=TestIceGrid/NullPermissionsVerifier' + \ r' --IceGrid.Registry.AdminPermissionsVerifier=TestIceGrid/NullPermissionsVerifier' + \ r' --IceGrid.Registry.SSLPermissionsVerifier=TestIceGrid/NullSSLPermissionsVerifier' + \ r' --IceGrid.Registry.AdminSSLPermissionsVerifier=TestIceGrid/NullSSLPermissionsVerifier' + \ r' --IceGrid.Registry.Server.Endpoints=default' + \ r' --IceGrid.Registry.Internal.Endpoints=default' + \ r' --IceGrid.Registry.SessionManager.Endpoints=default' + \ r' --IceGrid.Registry.AdminSessionManager.Endpoints=default' + \ r' --IceGrid.Registry.Trace.Session=0' + \ r' --IceGrid.Registry.Trace.Application=0' + \ r' --IceGrid.Registry.Trace.Node=0' + \ r' --IceGrid.Registry.Trace.Replica=0' + \ r' --IceGrid.Registry.Trace.Adapter=0' + \ r' --IceGrid.Registry.Trace.Object=0' + \ r' --IceGrid.Registry.Trace.Server=0' + \ r' --IceGrid.Registry.Trace.Locator=0' + \ r' --IceGrid.Registry.SessionTimeout=5' + \ r' --Ice.ThreadPool.Server.Size=1 ' + \ r' --Ice.ThreadPool.Client.SizeWarn=0' + \ r' --IceGrid.Registry.Client.ThreadPool.SizeWarn=0' + \ r' --Ice.ServerIdleTime=0' + \ r' --IceGrid.Registry.DefaultTemplates="' + \ os.path.abspath(os.path.join(TestUtil.toplevel, "cpp", "config", "templates.xml") + '"') if TestUtil.ipv6 and TestUtil.isDarwin(): registryOptions += r' --IceGrid.Registry.Discovery.Interface="::1"' def getDefaultLocatorProperty(): i = 0 property = '--Ice.Default.Locator="TestIceGrid/Locator'; objrefs = "" while i < nreplicas + 1: objrefs = objrefs + ':default -p ' + str(iceGridPort + i) i = i + 1 return ' %s%s"' % (property, objrefs) def startIceGridRegistry(testdir, dynamicRegistration = False): iceGrid = TestUtil.getIceGridRegistry() command = ' --nowarn ' + registryOptions if dynamicRegistration: command += r' --IceGrid.Registry.DynamicRegistration' procs = [] i = 0 while i < (nreplicas + 1): if i == 0: name = "registry" else: name = "replica-" + str(i) dataDir = os.path.join(testdir, "db", name) if not os.path.exists(dataDir): os.mkdir(dataDir) else: cleanDbDir(dataDir) sys.stdout.write("starting icegrid " + name + "... ") sys.stdout.flush() cmd = command + ' ' + \ r' --Ice.ProgramName=' + name + \ r' --IceGrid.Registry.Client.Endpoints="default -p ' + str(iceGridPort + i) + '" ' + \ r' --IceGrid.Registry.Data="' + dataDir + '" ' if i > 0: cmd += r' --IceGrid.Registry.ReplicaName=' + name + ' ' + getDefaultLocatorProperty() driverConfig = TestUtil.DriverConfig("server") driverConfig.lang = "cpp" proc = TestUtil.startServer(iceGrid, cmd, driverConfig, count = 5) procs.append(proc) print("ok") i = i + 1 return procs def shutdownIceGridRegistry(procs): i = nreplicas while i > 0: sys.stdout.write("shutting down icegrid replica-" + str(i) + "... ") sys.stdout.flush() iceGridAdmin("registry shutdown replica-" + str(i)) print("ok") i = i - 1 sys.stdout.write("shutting down icegrid registry... ") sys.stdout.flush() iceGridAdmin("registry shutdown") print("ok") for p in procs: p.waitTestSuccess() def iceGridNodePropertiesOverride(): # # Create property overrides from command line options. # overrideOptions = '' for opt in shlex.split(TestUtil.getCommandLineProperties("", TestUtil.DriverConfig("server"))): opt = opt.strip().replace("--", "") index = opt.find("=") if index == -1: overrideOptions += ("%s=1 ") % opt else: key = opt[0:index] value = opt[index + 1:] if(value.find(' ') == -1): overrideOptions += ("%s=%s ") % (key, value) else: # # NOTE: We need 2 backslash before the quote to run the # C# test/IceGrid/simple test with SSL. # overrideOptions += ("%s=\\\"%s\\\" ") % (key, value.replace('"', '\\\\\\"')) return overrideOptions def startIceGridNode(testdir): iceGrid = TestUtil.getIceGridNode() dataDir = os.path.join(testdir, "db", "node") if not os.path.exists(dataDir): os.mkdir(dataDir) else: cleanDbDir(dataDir) overrideOptions = '" ' + iceGridNodePropertiesOverride() overrideOptions += ' Ice.ServerIdleTime=0 Ice.PrintProcessId=0 Ice.PrintAdapterReady=0"' sys.stdout.write("starting icegrid node... ") sys.stdout.flush() command = r' --nowarn ' + nodeOptions + getDefaultLocatorProperty() + \ r' --IceGrid.Node.Data="' + dataDir + '"' \ r' --IceGrid.Node.Name=localnode' + \ r' --IceGrid.Node.PropertiesOverride=' + overrideOptions driverConfig = TestUtil.DriverConfig("server") driverConfig.lang = "cpp" proc = TestUtil.startServer(iceGrid, command, driverConfig, adapter='node1') print("ok") return proc def iceGridAdmin(cmd, ignoreFailure = False): iceGridAdmin = TestUtil.getIceGridAdmin() user = r"admin1" if cmd == "registry shutdown": user = r"shutdown" command = getDefaultLocatorProperty() + r" --IceGridAdmin.Username=" + user + " --IceGridAdmin.Password=test1 " + \ r' -e "' + cmd + '"' if TestUtil.appverifier: TestUtil.setAppVerifierSettings([TestUtil.getIceGridAdmin()]) driverConfig = TestUtil.DriverConfig("client") driverConfig.lang = "cpp" proc = TestUtil.startClient(iceGridAdmin, command, driverConfig) status = proc.wait() if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd([TestUtil.getIceGridAdmin()]) if not ignoreFailure and status: print(proc.buf) sys.exit(1) return proc.buf def killNodeServers(): for server in iceGridAdmin("server list"): server = server.strip() iceGridAdmin("server disable " + server, True) iceGridAdmin("server signal " + server + " SIGKILL", True) def iceGridTest(application, additionalOptions = "", applicationOptions = ""): testdir = os.getcwd() if not TestUtil.isWin32() and os.getuid() == 0: print print("*** can't run test as root ***") print return client = TestUtil.getDefaultClientFile() if TestUtil.getDefaultMapping() != "java": client = os.path.join(testdir, client) clientOptions = ' ' + getDefaultLocatorProperty() + ' ' + additionalOptions targets = [] if TestUtil.appverifier: targets = [client, TestUtil.getIceGridNode(), TestUtil.getIceGridRegistry()] TestUtil.setAppVerifierSettings(targets) registryProcs = startIceGridRegistry(testdir) iceGridNodeProc = startIceGridNode(testdir) javaHome = os.environ.get("JAVA_HOME", None) javaExe = os.path.join(javaHome, "bin", "java") if javaHome else "java" if application != "": sys.stdout.write("adding application... ") sys.stdout.flush() iceGridAdmin("application add -n '" + os.path.join(testdir, application) + "' " + "test.dir='" + testdir + "' " + "ice.bindir='" + TestUtil.getCppBinDir() + "' " + "java.exe='" + javaExe + "' " + applicationOptions) print("ok") sys.stdout.write("starting client... ") sys.stdout.flush() clientProc = TestUtil.startClient(client, clientOptions, TestUtil.DriverConfig("client"), startReader = False) print("ok") clientProc.startReader() clientProc.waitTestSuccess() if application != "": sys.stdout.write("remove application... ") sys.stdout.flush() iceGridAdmin("application remove Test") print("ok") sys.stdout.write("shutting down icegrid node... ") sys.stdout.flush() iceGridAdmin("node shutdown localnode") print("ok") shutdownIceGridRegistry(registryProcs) iceGridNodeProc.waitTestSuccess() if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd(targets) def iceGridClientServerTest(additionalClientOptions, additionalServerOptions): testdir = os.getcwd() server = TestUtil.getDefaultServerFile() client = TestUtil.getDefaultClientFile() if TestUtil.getDefaultMapping() != "java": server = os.path.join(testdir, server) client = os.path.join(testdir, client) targets = [] if TestUtil.appverifier: targets = [client, server, TestUtil.getIceGridRegistry()] TestUtil.setAppVerifierSettings(targets) clientOptions = getDefaultLocatorProperty() + ' ' + additionalClientOptions serverOptions = getDefaultLocatorProperty() + ' ' + additionalServerOptions registryProcs = startIceGridRegistry(testdir, True) sys.stdout.write("starting server... ") sys.stdout.flush() serverProc= TestUtil.startServer(server, serverOptions, TestUtil.DriverConfig("server")) print("ok") sys.stdout.write("starting client... ") sys.stdout.flush() clientProc = TestUtil.startClient(client, clientOptions, TestUtil.DriverConfig("client")) print("ok") clientProc.waitTestSuccess() serverProc.waitTestSuccess() shutdownIceGridRegistry(registryProcs) if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd(targets) def cleanDbDir(path): for filename in [ os.path.join(path, f) for f in os.listdir(path) if f != ".gitignore"]: if os.path.isdir(filename): cleanDbDir(filename) try: os.rmdir(filename) except OSError: # This might fail if the directory is empty (because # it itself contains a .gitignore file. pass else: os.remove(filename)
gpl-2.0
plotly/python-api
packages/python/plotly/plotly/validators/layout/template/data/__init__.py
1
4498
import sys if sys.version_info < (3, 7): from ._waterfall import WaterfallValidator from ._volume import VolumeValidator from ._violin import ViolinValidator from ._treemap import TreemapValidator from ._table import TableValidator from ._surface import SurfaceValidator from ._sunburst import SunburstValidator from ._streamtube import StreamtubeValidator from ._splom import SplomValidator from ._scatterternary import ScatterternaryValidator from ._scatter import ScatterValidator from ._scatterpolar import ScatterpolarValidator from ._scatterpolargl import ScatterpolarglValidator from ._scattermapbox import ScattermapboxValidator from ._scattergl import ScatterglValidator from ._scattergeo import ScattergeoValidator from ._scattercarpet import ScattercarpetValidator from ._scatter3d import Scatter3DValidator from ._sankey import SankeyValidator from ._pointcloud import PointcloudValidator from ._pie import PieValidator from ._parcoords import ParcoordsValidator from ._parcats import ParcatsValidator from ._ohlc import OhlcValidator from ._mesh3d import Mesh3DValidator from ._isosurface import IsosurfaceValidator from ._indicator import IndicatorValidator from ._image import ImageValidator from ._histogram import HistogramValidator from ._histogram2d import Histogram2DValidator from ._histogram2dcontour import Histogram2DcontourValidator from ._heatmap import HeatmapValidator from ._heatmapgl import HeatmapglValidator from ._funnel import FunnelValidator from ._funnelarea import FunnelareaValidator from ._densitymapbox import DensitymapboxValidator from ._contour import ContourValidator from ._contourcarpet import ContourcarpetValidator from ._cone import ConeValidator from ._choropleth import ChoroplethValidator from ._choroplethmapbox import ChoroplethmapboxValidator from ._carpet import CarpetValidator from ._candlestick import CandlestickValidator from ._box import BoxValidator from ._bar import BarValidator from ._barpolar import BarpolarValidator from ._area import AreaValidator else: from _plotly_utils.importers import relative_import __all__, __getattr__, __dir__ = relative_import( __name__, [], [ "._waterfall.WaterfallValidator", "._volume.VolumeValidator", "._violin.ViolinValidator", "._treemap.TreemapValidator", "._table.TableValidator", "._surface.SurfaceValidator", "._sunburst.SunburstValidator", "._streamtube.StreamtubeValidator", "._splom.SplomValidator", "._scatterternary.ScatterternaryValidator", "._scatter.ScatterValidator", "._scatterpolar.ScatterpolarValidator", "._scatterpolargl.ScatterpolarglValidator", "._scattermapbox.ScattermapboxValidator", "._scattergl.ScatterglValidator", "._scattergeo.ScattergeoValidator", "._scattercarpet.ScattercarpetValidator", "._scatter3d.Scatter3DValidator", "._sankey.SankeyValidator", "._pointcloud.PointcloudValidator", "._pie.PieValidator", "._parcoords.ParcoordsValidator", "._parcats.ParcatsValidator", "._ohlc.OhlcValidator", "._mesh3d.Mesh3DValidator", "._isosurface.IsosurfaceValidator", "._indicator.IndicatorValidator", "._image.ImageValidator", "._histogram.HistogramValidator", "._histogram2d.Histogram2DValidator", "._histogram2dcontour.Histogram2DcontourValidator", "._heatmap.HeatmapValidator", "._heatmapgl.HeatmapglValidator", "._funnel.FunnelValidator", "._funnelarea.FunnelareaValidator", "._densitymapbox.DensitymapboxValidator", "._contour.ContourValidator", "._contourcarpet.ContourcarpetValidator", "._cone.ConeValidator", "._choropleth.ChoroplethValidator", "._choroplethmapbox.ChoroplethmapboxValidator", "._carpet.CarpetValidator", "._candlestick.CandlestickValidator", "._box.BoxValidator", "._bar.BarValidator", "._barpolar.BarpolarValidator", "._area.AreaValidator", ], )
mit
amki/pingcat
database.py
1
1090
__author__ = 'bawki' import sqlite3 class CatDb(): def __init__(self): self.db = None self.c = None def connect(self): self.db = sqlite3.connect('pingcat.db') self.c = self.db.cursor() ''' def createTables(self): configured = False self.c.execute("""SELECT name FROM sqlite_master WHERE type='table' AND name='pingdata';""") data = self.c.fetchall() for row in data: if row[0] == 'pingdata': configured = True if not configured: self.c.execute("""create table pingdata ( date REAL, dst text, timeout int, count int, numDataBytes int, data BLOB )""") self.db.commit() self.c.fetchone() def newPingTest(self, dst, timeout, count, numDataBytes, data): self.c.execute("""INSERT INTO 'pingdata' VALUES (?, ?, ?, ?, ?, ?)""", (time.time(), dst, timeout, count, numDataBytes, data)) self.db.commit() '''
agpl-3.0
k0ste/ansible
test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/vyos.py
47
4523
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete work. # # (c) 2016 Red Hat Inc. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # import json from ansible.module_utils._text import to_text from ansible.module_utils.basic import env_fallback from ansible.module_utils.connection import Connection, ConnectionError _DEVICE_CONFIGS = {} vyos_provider_spec = { "host": dict(), "port": dict(type="int"), "username": dict(fallback=(env_fallback, ["ANSIBLE_NET_USERNAME"])), "password": dict( fallback=(env_fallback, ["ANSIBLE_NET_PASSWORD"]), no_log=True ), "ssh_keyfile": dict( fallback=(env_fallback, ["ANSIBLE_NET_SSH_KEYFILE"]), type="path" ), "timeout": dict(type="int"), } vyos_argument_spec = { "provider": dict( type="dict", options=vyos_provider_spec, removed_in_version=2.14 ), } def get_provider_argspec(): return vyos_provider_spec def get_connection(module): if hasattr(module, "_vyos_connection"): return module._vyos_connection capabilities = get_capabilities(module) network_api = capabilities.get("network_api") if network_api == "cliconf": module._vyos_connection = Connection(module._socket_path) else: module.fail_json(msg="Invalid connection type %s" % network_api) return module._vyos_connection def get_capabilities(module): if hasattr(module, "_vyos_capabilities"): return module._vyos_capabilities try: capabilities = Connection(module._socket_path).get_capabilities() except ConnectionError as exc: module.fail_json(msg=to_text(exc, errors="surrogate_then_replace")) module._vyos_capabilities = json.loads(capabilities) return module._vyos_capabilities def get_config(module, flags=None, format=None): flags = [] if flags is None else flags global _DEVICE_CONFIGS if _DEVICE_CONFIGS != {}: return _DEVICE_CONFIGS else: connection = get_connection(module) try: out = connection.get_config(flags=flags, format=format) except ConnectionError as exc: module.fail_json(msg=to_text(exc, errors="surrogate_then_replace")) cfg = to_text(out, errors="surrogate_then_replace").strip() _DEVICE_CONFIGS = cfg return cfg def run_commands(module, commands, check_rc=True): connection = get_connection(module) try: response = connection.run_commands( commands=commands, check_rc=check_rc ) except ConnectionError as exc: module.fail_json(msg=to_text(exc, errors="surrogate_then_replace")) return response def load_config(module, commands, commit=False, comment=None): connection = get_connection(module) try: response = connection.edit_config( candidate=commands, commit=commit, comment=comment ) except ConnectionError as exc: module.fail_json(msg=to_text(exc, errors="surrogate_then_replace")) return response.get("diff")
gpl-3.0
moijes12/oh-mainline
vendor/packages/twisted/twisted/pair/test/test_ethernet.py
35
6684
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # from twisted.trial import unittest from twisted.internet import protocol, reactor, error from twisted.python import failure, components from twisted.pair import ethernet, raw from zope.interface import implements class MyProtocol: implements(raw.IRawPacketProtocol) def __init__(self, expecting): self.expecting = list(expecting) def datagramReceived(self, data, **kw): assert self.expecting, 'Got a packet when not expecting anymore.' expect = self.expecting.pop(0) assert expect == (data, kw), \ "Expected %r, got %r" % ( expect, (data, kw), ) class EthernetTestCase(unittest.TestCase): def testPacketParsing(self): proto = ethernet.EthernetProtocol() p1 = MyProtocol([ ('foobar', { 'partial': 0, 'dest': "123456", 'source': "987654", 'protocol': 0x0800, }), ]) proto.addProto(0x0800, p1) proto.datagramReceived("123456987654\x08\x00foobar", partial=0) assert not p1.expecting, \ 'Should not expect any more packets, but still want %r' % p1.expecting def testMultiplePackets(self): proto = ethernet.EthernetProtocol() p1 = MyProtocol([ ('foobar', { 'partial': 0, 'dest': "123456", 'source': "987654", 'protocol': 0x0800, }), ('quux', { 'partial': 1, 'dest': "012345", 'source': "abcdef", 'protocol': 0x0800, }), ]) proto.addProto(0x0800, p1) proto.datagramReceived("123456987654\x08\x00foobar", partial=0) proto.datagramReceived("012345abcdef\x08\x00quux", partial=1) assert not p1.expecting, \ 'Should not expect any more packets, but still want %r' % p1.expecting def testMultipleSameProtos(self): proto = ethernet.EthernetProtocol() p1 = MyProtocol([ ('foobar', { 'partial': 0, 'dest': "123456", 'source': "987654", 'protocol': 0x0800, }), ]) p2 = MyProtocol([ ('foobar', { 'partial': 0, 'dest': "123456", 'source': "987654", 'protocol': 0x0800, }), ]) proto.addProto(0x0800, p1) proto.addProto(0x0800, p2) proto.datagramReceived("123456987654\x08\x00foobar", partial=0) assert not p1.expecting, \ 'Should not expect any more packets, but still want %r' % p1.expecting assert not p2.expecting, \ 'Should not expect any more packets, but still want %r' % p2.expecting def testWrongProtoNotSeen(self): proto = ethernet.EthernetProtocol() p1 = MyProtocol([]) proto.addProto(0x0801, p1) proto.datagramReceived("123456987654\x08\x00foobar", partial=0) proto.datagramReceived("012345abcdef\x08\x00quux", partial=1) def testDemuxing(self): proto = ethernet.EthernetProtocol() p1 = MyProtocol([ ('foobar', { 'partial': 0, 'dest': "123456", 'source': "987654", 'protocol': 0x0800, }), ('quux', { 'partial': 1, 'dest': "012345", 'source': "abcdef", 'protocol': 0x0800, }), ]) proto.addProto(0x0800, p1) p2 = MyProtocol([ ('quux', { 'partial': 1, 'dest': "012345", 'source': "abcdef", 'protocol': 0x0806, }), ('foobar', { 'partial': 0, 'dest': "123456", 'source': "987654", 'protocol': 0x0806, }), ]) proto.addProto(0x0806, p2) proto.datagramReceived("123456987654\x08\x00foobar", partial=0) proto.datagramReceived("012345abcdef\x08\x06quux", partial=1) proto.datagramReceived("123456987654\x08\x06foobar", partial=0) proto.datagramReceived("012345abcdef\x08\x00quux", partial=1) assert not p1.expecting, \ 'Should not expect any more packets, but still want %r' % p1.expecting assert not p2.expecting, \ 'Should not expect any more packets, but still want %r' % p2.expecting def testAddingBadProtos_WrongLevel(self): """Adding a wrong level protocol raises an exception.""" e = ethernet.EthernetProtocol() try: e.addProto(42, "silliness") except components.CannotAdapt: pass else: raise AssertionError, 'addProto must raise an exception for bad protocols' def testAddingBadProtos_TooSmall(self): """Adding a protocol with a negative number raises an exception.""" e = ethernet.EthernetProtocol() try: e.addProto(-1, MyProtocol([])) except TypeError, e: if e.args == ('Added protocol must be positive or zero',): pass else: raise else: raise AssertionError, 'addProto must raise an exception for bad protocols' def testAddingBadProtos_TooBig(self): """Adding a protocol with a number >=2**16 raises an exception.""" e = ethernet.EthernetProtocol() try: e.addProto(2**16, MyProtocol([])) except TypeError, e: if e.args == ('Added protocol must fit in 16 bits',): pass else: raise else: raise AssertionError, 'addProto must raise an exception for bad protocols' def testAddingBadProtos_TooBig2(self): """Adding a protocol with a number >=2**16 raises an exception.""" e = ethernet.EthernetProtocol() try: e.addProto(2**16+1, MyProtocol([])) except TypeError, e: if e.args == ('Added protocol must fit in 16 bits',): pass else: raise else: raise AssertionError, 'addProto must raise an exception for bad protocols'
agpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python3.4/test/test_gdb.py
8
36777
# Verify that gdb can pretty-print the various PyObject* types # # The code for testing gdb was adapted from similar work in Unladen Swallow's # Lib/test/test_jit_gdb.py import os import re import pprint import subprocess import sys import sysconfig import unittest import locale # Is this Python configured to support threads? try: import _thread except ImportError: _thread = None from test import support from test.support import run_unittest, findfile, python_is_optimized try: gdb_version, _ = subprocess.Popen(["gdb", "-nx", "--version"], stdout=subprocess.PIPE).communicate() except OSError: # This is what "no gdb" looks like. There may, however, be other # errors that manifest this way too. raise unittest.SkipTest("Couldn't find gdb on the path") gdb_version_number = re.search(b"^GNU gdb [^\d]*(\d+)\.(\d)", gdb_version) gdb_major_version = int(gdb_version_number.group(1)) gdb_minor_version = int(gdb_version_number.group(2)) if gdb_major_version < 7: raise unittest.SkipTest("gdb versions before 7.0 didn't support python embedding" " Saw:\n" + gdb_version.decode('ascii', 'replace')) if not sysconfig.is_python_build(): raise unittest.SkipTest("test_gdb only works on source builds at the moment.") # Location of custom hooks file in a repository checkout. checkout_hook_path = os.path.join(os.path.dirname(sys.executable), 'python-gdb.py') PYTHONHASHSEED = '123' def run_gdb(*args, **env_vars): """Runs gdb in --batch mode with the additional arguments given by *args. Returns its (stdout, stderr) decoded from utf-8 using the replace handler. """ if env_vars: env = os.environ.copy() env.update(env_vars) else: env = None # -nx: Do not execute commands from any .gdbinit initialization files # (issue #22188) base_cmd = ('gdb', '--batch', '-nx') if (gdb_major_version, gdb_minor_version) >= (7, 4): base_cmd += ('-iex', 'add-auto-load-safe-path ' + checkout_hook_path) out, err = subprocess.Popen(base_cmd + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, ).communicate() return out.decode('utf-8', 'replace'), err.decode('utf-8', 'replace') # Verify that "gdb" was built with the embedded python support enabled: gdbpy_version, _ = run_gdb("--eval-command=python import sys; print(sys.version_info)") if not gdbpy_version: raise unittest.SkipTest("gdb not built with embedded python support") # Verify that "gdb" can load our custom hooks, as OS security settings may # disallow this without a customised .gdbinit. cmd = ['--args', sys.executable] _, gdbpy_errors = run_gdb('--args', sys.executable) if "auto-loading has been declined" in gdbpy_errors: msg = "gdb security settings prevent use of custom hooks: " raise unittest.SkipTest(msg + gdbpy_errors.rstrip()) def gdb_has_frame_select(): # Does this build of gdb have gdb.Frame.select ? stdout, _ = run_gdb("--eval-command=python print(dir(gdb.Frame))") m = re.match(r'.*\[(.*)\].*', stdout) if not m: raise unittest.SkipTest("Unable to parse output from gdb.Frame.select test") gdb_frame_dir = m.group(1).split(', ') return "'select'" in gdb_frame_dir HAS_PYUP_PYDOWN = gdb_has_frame_select() BREAKPOINT_FN='builtin_id' class DebuggerTests(unittest.TestCase): """Test that the debugger can debug Python.""" def get_stack_trace(self, source=None, script=None, breakpoint=BREAKPOINT_FN, cmds_after_breakpoint=None, import_site=False): ''' Run 'python -c SOURCE' under gdb with a breakpoint. Support injecting commands after the breakpoint is reached Returns the stdout from gdb cmds_after_breakpoint: if provided, a list of strings: gdb commands ''' # We use "set breakpoint pending yes" to avoid blocking with a: # Function "foo" not defined. # Make breakpoint pending on future shared library load? (y or [n]) # error, which typically happens python is dynamically linked (the # breakpoints of interest are to be found in the shared library) # When this happens, we still get: # Function "textiowrapper_write" not defined. # emitted to stderr each time, alas. # Initially I had "--eval-command=continue" here, but removed it to # avoid repeated print breakpoints when traversing hierarchical data # structures # Generate a list of commands in gdb's language: commands = ['set breakpoint pending yes', 'break %s' % breakpoint, # The tests assume that the first frame of printed # backtrace will not contain program counter, # that is however not guaranteed by gdb # therefore we need to use 'set print address off' to # make sure the counter is not there. For example: # #0 in PyObject_Print ... # is assumed, but sometimes this can be e.g. # #0 0x00003fffb7dd1798 in PyObject_Print ... 'set print address off', 'run'] # GDB as of 7.4 onwards can distinguish between the # value of a variable at entry vs current value: # http://sourceware.org/gdb/onlinedocs/gdb/Variables.html # which leads to the selftests failing with errors like this: # AssertionError: 'v@entry=()' != '()' # Disable this: if (gdb_major_version, gdb_minor_version) >= (7, 4): commands += ['set print entry-values no'] if cmds_after_breakpoint: commands += cmds_after_breakpoint else: commands += ['backtrace'] # print commands # Use "commands" to generate the arguments with which to invoke "gdb": args = ["gdb", "--batch", "-nx"] args += ['--eval-command=%s' % cmd for cmd in commands] args += ["--args", sys.executable] if not import_site: # -S suppresses the default 'import site' args += ["-S"] if source: args += ["-c", source] elif script: args += [script] # print args # print (' '.join(args)) # Use "args" to invoke gdb, capturing stdout, stderr: out, err = run_gdb(*args, PYTHONHASHSEED=PYTHONHASHSEED) errlines = err.splitlines() unexpected_errlines = [] # Ignore some benign messages on stderr. ignore_patterns = ( 'Function "%s" not defined.' % breakpoint, "warning: no loadable sections found in added symbol-file" " system-supplied DSO", "warning: Unable to find libthread_db matching" " inferior's thread library, thread debugging will" " not be available.", "warning: Cannot initialize thread debugging" " library: Debugger service failed", 'warning: Could not load shared library symbols for ' 'linux-vdso.so', 'warning: Could not load shared library symbols for ' 'linux-gate.so', 'Do you need "set solib-search-path" or ' '"set sysroot"?', 'warning: Source file is more recent than executable.', # Issue #19753: missing symbols on System Z 'Missing separate debuginfo for ', 'Try: zypper install -C ', ) for line in errlines: if not line.startswith(ignore_patterns): unexpected_errlines.append(line) # Ensure no unexpected error messages: self.assertEqual(unexpected_errlines, []) return out def get_gdb_repr(self, source, cmds_after_breakpoint=None, import_site=False): # Given an input python source representation of data, # run "python -c'id(DATA)'" under gdb with a breakpoint on # builtin_id and scrape out gdb's representation of the "op" # parameter, and verify that the gdb displays the same string # # Verify that the gdb displays the expected string # # For a nested structure, the first time we hit the breakpoint will # give us the top-level structure # NOTE: avoid decoding too much of the traceback as some # undecodable characters may lurk there in optimized mode # (issue #19743). cmds_after_breakpoint = cmds_after_breakpoint or ["backtrace 1"] gdb_output = self.get_stack_trace(source, breakpoint=BREAKPOINT_FN, cmds_after_breakpoint=cmds_after_breakpoint, import_site=import_site) # gdb can insert additional '\n' and space characters in various places # in its output, depending on the width of the terminal it's connected # to (using its "wrap_here" function) m = re.match('.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+\S*Python/bltinmodule.c.*', gdb_output, re.DOTALL) if not m: self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output)) return m.group(1), gdb_output def assertEndsWith(self, actual, exp_end): '''Ensure that the given "actual" string ends with "exp_end"''' self.assertTrue(actual.endswith(exp_end), msg='%r did not end with %r' % (actual, exp_end)) def assertMultilineMatches(self, actual, pattern): m = re.match(pattern, actual, re.DOTALL) if not m: self.fail(msg='%r did not match %r' % (actual, pattern)) def get_sample_script(self): return findfile('gdb_sample.py') class PrettyPrintTests(DebuggerTests): def test_getting_backtrace(self): gdb_output = self.get_stack_trace('id(42)') self.assertTrue(BREAKPOINT_FN in gdb_output) def assertGdbRepr(self, val, exp_repr=None): # Ensure that gdb's rendering of the value in a debugged process # matches repr(value) in this process: gdb_repr, gdb_output = self.get_gdb_repr('id(' + ascii(val) + ')') if not exp_repr: exp_repr = repr(val) self.assertEqual(gdb_repr, exp_repr, ('%r did not equal expected %r; full output was:\n%s' % (gdb_repr, exp_repr, gdb_output))) def test_int(self): 'Verify the pretty-printing of various int values' self.assertGdbRepr(42) self.assertGdbRepr(0) self.assertGdbRepr(-7) self.assertGdbRepr(1000000000000) self.assertGdbRepr(-1000000000000000) def test_singletons(self): 'Verify the pretty-printing of True, False and None' self.assertGdbRepr(True) self.assertGdbRepr(False) self.assertGdbRepr(None) def test_dicts(self): 'Verify the pretty-printing of dictionaries' self.assertGdbRepr({}) self.assertGdbRepr({'foo': 'bar'}, "{'foo': 'bar'}") self.assertGdbRepr({'foo': 'bar', 'douglas': 42}, "{'douglas': 42, 'foo': 'bar'}") def test_lists(self): 'Verify the pretty-printing of lists' self.assertGdbRepr([]) self.assertGdbRepr(list(range(5))) def test_bytes(self): 'Verify the pretty-printing of bytes' self.assertGdbRepr(b'') self.assertGdbRepr(b'And now for something hopefully the same') self.assertGdbRepr(b'string with embedded NUL here \0 and then some more text') self.assertGdbRepr(b'this is a tab:\t' b' this is a slash-N:\n' b' this is a slash-R:\r' ) self.assertGdbRepr(b'this is byte 255:\xff and byte 128:\x80') self.assertGdbRepr(bytes([b for b in range(255)])) def test_strings(self): 'Verify the pretty-printing of unicode strings' encoding = locale.getpreferredencoding() def check_repr(text): try: text.encode(encoding) printable = True except UnicodeEncodeError: self.assertGdbRepr(text, ascii(text)) else: self.assertGdbRepr(text) self.assertGdbRepr('') self.assertGdbRepr('And now for something hopefully the same') self.assertGdbRepr('string with embedded NUL here \0 and then some more text') # Test printing a single character: # U+2620 SKULL AND CROSSBONES check_repr('\u2620') # Test printing a Japanese unicode string # (I believe this reads "mojibake", using 3 characters from the CJK # Unified Ideographs area, followed by U+3051 HIRAGANA LETTER KE) check_repr('\u6587\u5b57\u5316\u3051') # Test a character outside the BMP: # U+1D121 MUSICAL SYMBOL C CLEF # This is: # UTF-8: 0xF0 0x9D 0x84 0xA1 # UTF-16: 0xD834 0xDD21 check_repr(chr(0x1D121)) def test_tuples(self): 'Verify the pretty-printing of tuples' self.assertGdbRepr(tuple(), '()') self.assertGdbRepr((1,), '(1,)') self.assertGdbRepr(('foo', 'bar', 'baz')) def test_sets(self): 'Verify the pretty-printing of sets' if (gdb_major_version, gdb_minor_version) < (7, 3): self.skipTest("pretty-printing of sets needs gdb 7.3 or later") self.assertGdbRepr(set(), 'set()') self.assertGdbRepr(set(['a', 'b']), "{'a', 'b'}") self.assertGdbRepr(set([4, 5, 6]), "{4, 5, 6}") # Ensure that we handle sets containing the "dummy" key value, # which happens on deletion: gdb_repr, gdb_output = self.get_gdb_repr('''s = set(['a','b']) s.remove('a') id(s)''') self.assertEqual(gdb_repr, "{'b'}") def test_frozensets(self): 'Verify the pretty-printing of frozensets' if (gdb_major_version, gdb_minor_version) < (7, 3): self.skipTest("pretty-printing of frozensets needs gdb 7.3 or later") self.assertGdbRepr(frozenset(), 'frozenset()') self.assertGdbRepr(frozenset(['a', 'b']), "frozenset({'a', 'b'})") self.assertGdbRepr(frozenset([4, 5, 6]), "frozenset({4, 5, 6})") def test_exceptions(self): # Test a RuntimeError gdb_repr, gdb_output = self.get_gdb_repr(''' try: raise RuntimeError("I am an error") except RuntimeError as e: id(e) ''') self.assertEqual(gdb_repr, "RuntimeError('I am an error',)") # Test division by zero: gdb_repr, gdb_output = self.get_gdb_repr(''' try: a = 1 / 0 except ZeroDivisionError as e: id(e) ''') self.assertEqual(gdb_repr, "ZeroDivisionError('division by zero',)") def test_modern_class(self): 'Verify the pretty-printing of new-style class instances' gdb_repr, gdb_output = self.get_gdb_repr(''' class Foo: pass foo = Foo() foo.an_int = 42 id(foo)''') m = re.match(r'<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>', gdb_repr) self.assertTrue(m, msg='Unexpected new-style class rendering %r' % gdb_repr) def test_subclassing_list(self): 'Verify the pretty-printing of an instance of a list subclass' gdb_repr, gdb_output = self.get_gdb_repr(''' class Foo(list): pass foo = Foo() foo += [1, 2, 3] foo.an_int = 42 id(foo)''') m = re.match(r'<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>', gdb_repr) self.assertTrue(m, msg='Unexpected new-style class rendering %r' % gdb_repr) def test_subclassing_tuple(self): 'Verify the pretty-printing of an instance of a tuple subclass' # This should exercise the negative tp_dictoffset code in the # new-style class support gdb_repr, gdb_output = self.get_gdb_repr(''' class Foo(tuple): pass foo = Foo((1, 2, 3)) foo.an_int = 42 id(foo)''') m = re.match(r'<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>', gdb_repr) self.assertTrue(m, msg='Unexpected new-style class rendering %r' % gdb_repr) def assertSane(self, source, corruption, exprepr=None): '''Run Python under gdb, corrupting variables in the inferior process immediately before taking a backtrace. Verify that the variable's representation is the expected failsafe representation''' if corruption: cmds_after_breakpoint=[corruption, 'backtrace'] else: cmds_after_breakpoint=['backtrace'] gdb_repr, gdb_output = \ self.get_gdb_repr(source, cmds_after_breakpoint=cmds_after_breakpoint) if exprepr: if gdb_repr == exprepr: # gdb managed to print the value in spite of the corruption; # this is good (see http://bugs.python.org/issue8330) return # Match anything for the type name; 0xDEADBEEF could point to # something arbitrary (see http://bugs.python.org/issue8330) pattern = '<.* at remote 0x-?[0-9a-f]+>' m = re.match(pattern, gdb_repr) if not m: self.fail('Unexpected gdb representation: %r\n%s' % \ (gdb_repr, gdb_output)) def test_NULL_ptr(self): 'Ensure that a NULL PyObject* is handled gracefully' gdb_repr, gdb_output = ( self.get_gdb_repr('id(42)', cmds_after_breakpoint=['set variable v=0', 'backtrace']) ) self.assertEqual(gdb_repr, '0x0') def test_NULL_ob_type(self): 'Ensure that a PyObject* with NULL ob_type is handled gracefully' self.assertSane('id(42)', 'set v->ob_type=0') def test_corrupt_ob_type(self): 'Ensure that a PyObject* with a corrupt ob_type is handled gracefully' self.assertSane('id(42)', 'set v->ob_type=0xDEADBEEF', exprepr='42') def test_corrupt_tp_flags(self): 'Ensure that a PyObject* with a type with corrupt tp_flags is handled' self.assertSane('id(42)', 'set v->ob_type->tp_flags=0x0', exprepr='42') def test_corrupt_tp_name(self): 'Ensure that a PyObject* with a type with corrupt tp_name is handled' self.assertSane('id(42)', 'set v->ob_type->tp_name=0xDEADBEEF', exprepr='42') def test_builtins_help(self): 'Ensure that the new-style class _Helper in site.py can be handled' # (this was the issue causing tracebacks in # http://bugs.python.org/issue8032#msg100537 ) gdb_repr, gdb_output = self.get_gdb_repr('id(__builtins__.help)', import_site=True) m = re.match(r'<_Helper at remote 0x-?[0-9a-f]+>', gdb_repr) self.assertTrue(m, msg='Unexpected rendering %r' % gdb_repr) def test_selfreferential_list(self): '''Ensure that a reference loop involving a list doesn't lead proxyval into an infinite loop:''' gdb_repr, gdb_output = \ self.get_gdb_repr("a = [3, 4, 5] ; a.append(a) ; id(a)") self.assertEqual(gdb_repr, '[3, 4, 5, [...]]') gdb_repr, gdb_output = \ self.get_gdb_repr("a = [3, 4, 5] ; b = [a] ; a.append(b) ; id(a)") self.assertEqual(gdb_repr, '[3, 4, 5, [[...]]]') def test_selfreferential_dict(self): '''Ensure that a reference loop involving a dict doesn't lead proxyval into an infinite loop:''' gdb_repr, gdb_output = \ self.get_gdb_repr("a = {} ; b = {'bar':a} ; a['foo'] = b ; id(a)") self.assertEqual(gdb_repr, "{'foo': {'bar': {...}}}") def test_selfreferential_old_style_instance(self): gdb_repr, gdb_output = \ self.get_gdb_repr(''' class Foo: pass foo = Foo() foo.an_attr = foo id(foo)''') self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>', gdb_repr), 'Unexpected gdb representation: %r\n%s' % \ (gdb_repr, gdb_output)) def test_selfreferential_new_style_instance(self): gdb_repr, gdb_output = \ self.get_gdb_repr(''' class Foo(object): pass foo = Foo() foo.an_attr = foo id(foo)''') self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>', gdb_repr), 'Unexpected gdb representation: %r\n%s' % \ (gdb_repr, gdb_output)) gdb_repr, gdb_output = \ self.get_gdb_repr(''' class Foo(object): pass a = Foo() b = Foo() a.an_attr = b b.an_attr = a id(a)''') self.assertTrue(re.match('<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>\) at remote 0x-?[0-9a-f]+>', gdb_repr), 'Unexpected gdb representation: %r\n%s' % \ (gdb_repr, gdb_output)) def test_truncation(self): 'Verify that very long output is truncated' gdb_repr, gdb_output = self.get_gdb_repr('id(list(range(1000)))') self.assertEqual(gdb_repr, "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, " "14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, " "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, " "40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, " "53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, " "66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, " "79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, " "92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, " "104, 105, 106, 107, 108, 109, 110, 111, 112, 113, " "114, 115, 116, 117, 118, 119, 120, 121, 122, 123, " "124, 125, 126, 127, 128, 129, 130, 131, 132, 133, " "134, 135, 136, 137, 138, 139, 140, 141, 142, 143, " "144, 145, 146, 147, 148, 149, 150, 151, 152, 153, " "154, 155, 156, 157, 158, 159, 160, 161, 162, 163, " "164, 165, 166, 167, 168, 169, 170, 171, 172, 173, " "174, 175, 176, 177, 178, 179, 180, 181, 182, 183, " "184, 185, 186, 187, 188, 189, 190, 191, 192, 193, " "194, 195, 196, 197, 198, 199, 200, 201, 202, 203, " "204, 205, 206, 207, 208, 209, 210, 211, 212, 213, " "214, 215, 216, 217, 218, 219, 220, 221, 222, 223, " "224, 225, 226...(truncated)") self.assertEqual(len(gdb_repr), 1024 + len('...(truncated)')) def test_builtin_method(self): gdb_repr, gdb_output = self.get_gdb_repr('import sys; id(sys.stdout.readlines)') self.assertTrue(re.match('<built-in method readlines of _io.TextIOWrapper object at remote 0x-?[0-9a-f]+>', gdb_repr), 'Unexpected gdb representation: %r\n%s' % \ (gdb_repr, gdb_output)) def test_frames(self): gdb_output = self.get_stack_trace(''' def foo(a, b, c): pass foo(3, 4, 5) id(foo.__code__)''', breakpoint='builtin_id', cmds_after_breakpoint=['print (PyFrameObject*)(((PyCodeObject*)v)->co_zombieframe)'] ) self.assertTrue(re.match('.*\s+\$1 =\s+Frame 0x-?[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*', gdb_output, re.DOTALL), 'Unexpected gdb representation: %r\n%s' % (gdb_output, gdb_output)) @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") class PyListTests(DebuggerTests): def assertListing(self, expected, actual): self.assertEndsWith(actual, expected) def test_basic_command(self): 'Verify that the "py-list" command works' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-list']) self.assertListing(' 5 \n' ' 6 def bar(a, b, c):\n' ' 7 baz(a, b, c)\n' ' 8 \n' ' 9 def baz(*args):\n' ' >10 id(42)\n' ' 11 \n' ' 12 foo(1, 2, 3)\n', bt) def test_one_abs_arg(self): 'Verify the "py-list" command with one absolute argument' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-list 9']) self.assertListing(' 9 def baz(*args):\n' ' >10 id(42)\n' ' 11 \n' ' 12 foo(1, 2, 3)\n', bt) def test_two_abs_args(self): 'Verify the "py-list" command with two absolute arguments' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-list 1,3']) self.assertListing(' 1 # Sample script for use by test_gdb.py\n' ' 2 \n' ' 3 def foo(a, b, c):\n', bt) class StackNavigationTests(DebuggerTests): @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_pyup_command(self): 'Verify that the "py-up" command works' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-up']) self.assertMultilineMatches(bt, r'''^.* #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) baz\(a, b, c\) $''') @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") def test_down_at_bottom(self): 'Verify handling of "py-down" at the bottom of the stack' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-down']) self.assertEndsWith(bt, 'Unable to find a newer python frame\n') @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") def test_up_at_top(self): 'Verify handling of "py-up" at the top of the stack' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-up'] * 4) self.assertEndsWith(bt, 'Unable to find an older python frame\n') @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_up_then_down(self): 'Verify "py-up" followed by "py-down"' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-up', 'py-down']) self.assertMultilineMatches(bt, r'''^.* #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) baz\(a, b, c\) #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 10, in baz \(args=\(1, 2, 3\)\) id\(42\) $''') class PyBtTests(DebuggerTests): @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_bt(self): 'Verify that the "py-bt" command works' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-bt']) self.assertMultilineMatches(bt, r'''^.* Traceback \(most recent call first\): File ".*gdb_sample.py", line 10, in baz id\(42\) File ".*gdb_sample.py", line 7, in bar baz\(a, b, c\) File ".*gdb_sample.py", line 4, in foo bar\(a, b, c\) File ".*gdb_sample.py", line 12, in <module> foo\(1, 2, 3\) ''') @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_bt_full(self): 'Verify that the "py-bt-full" command works' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-bt-full']) self.assertMultilineMatches(bt, r'''^.* #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) baz\(a, b, c\) #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\) bar\(a, b, c\) #[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 12, in <module> \(\) foo\(1, 2, 3\) ''') @unittest.skipUnless(_thread, "Python was compiled without thread support") def test_threads(self): 'Verify that "py-bt" indicates threads that are waiting for the GIL' cmd = ''' from threading import Thread class TestThread(Thread): # These threads would run forever, but we'll interrupt things with the # debugger def run(self): i = 0 while 1: i += 1 t = {} for i in range(4): t[i] = TestThread() t[i].start() # Trigger a breakpoint on the main thread id(42) ''' # Verify with "py-bt": gdb_output = self.get_stack_trace(cmd, cmds_after_breakpoint=['thread apply all py-bt']) self.assertIn('Waiting for the GIL', gdb_output) # Verify with "py-bt-full": gdb_output = self.get_stack_trace(cmd, cmds_after_breakpoint=['thread apply all py-bt-full']) self.assertIn('Waiting for the GIL', gdb_output) @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") # Some older versions of gdb will fail with # "Cannot find new threads: generic error" # unless we add LD_PRELOAD=PATH-TO-libpthread.so.1 as a workaround @unittest.skipUnless(_thread, "Python was compiled without thread support") def test_gc(self): 'Verify that "py-bt" indicates if a thread is garbage-collecting' cmd = ('from gc import collect\n' 'id(42)\n' 'def foo():\n' ' collect()\n' 'def bar():\n' ' foo()\n' 'bar()\n') # Verify with "py-bt": gdb_output = self.get_stack_trace(cmd, cmds_after_breakpoint=['break update_refs', 'continue', 'py-bt'], ) self.assertIn('Garbage-collecting', gdb_output) # Verify with "py-bt-full": gdb_output = self.get_stack_trace(cmd, cmds_after_breakpoint=['break update_refs', 'continue', 'py-bt-full'], ) self.assertIn('Garbage-collecting', gdb_output) @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") # Some older versions of gdb will fail with # "Cannot find new threads: generic error" # unless we add LD_PRELOAD=PATH-TO-libpthread.so.1 as a workaround @unittest.skipUnless(_thread, "Python was compiled without thread support") def test_pycfunction(self): 'Verify that "py-bt" displays invocations of PyCFunction instances' cmd = ('from time import sleep\n' 'def foo():\n' ' sleep(1)\n' 'def bar():\n' ' foo()\n' 'bar()\n') # Verify with "py-bt": gdb_output = self.get_stack_trace(cmd, breakpoint='time_sleep', cmds_after_breakpoint=['bt', 'py-bt'], ) self.assertIn('<built-in method sleep', gdb_output) # Verify with "py-bt-full": gdb_output = self.get_stack_trace(cmd, breakpoint='time_sleep', cmds_after_breakpoint=['py-bt-full'], ) self.assertIn('#0 <built-in method sleep', gdb_output) class PyPrintTests(DebuggerTests): @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_basic_command(self): 'Verify that the "py-print" command works' bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-print args']) self.assertMultilineMatches(bt, r".*\nlocal 'args' = \(1, 2, 3\)\n.*") @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") def test_print_after_up(self): bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-up', 'py-print c', 'py-print b', 'py-print a']) self.assertMultilineMatches(bt, r".*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*") @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_printing_global(self): bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-print __name__']) self.assertMultilineMatches(bt, r".*\nglobal '__name__' = '__main__'\n.*") @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_printing_builtin(self): bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-print len']) self.assertMultilineMatches(bt, r".*\nbuiltin 'len' = <built-in method len of module object at remote 0x-?[0-9a-f]+>\n.*") class PyLocalsTests(DebuggerTests): @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_basic_command(self): bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-locals']) self.assertMultilineMatches(bt, r".*\nargs = \(1, 2, 3\)\n.*") @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") @unittest.skipIf(python_is_optimized(), "Python was compiled with optimizations") def test_locals_after_up(self): bt = self.get_stack_trace(script=self.get_sample_script(), cmds_after_breakpoint=['py-up', 'py-locals']) self.assertMultilineMatches(bt, r".*\na = 1\nb = 2\nc = 3\n.*") def test_main(): if support.verbose: print("GDB version:") for line in os.fsdecode(gdb_version).splitlines(): print(" " * 4 + line) run_unittest(PrettyPrintTests, PyListTests, StackNavigationTests, PyBtTests, PyPrintTests, PyLocalsTests ) if __name__ == "__main__": test_main()
gpl-2.0
Bitergia/allura
ForgeTracker/forgetracker/tests/unit/test_root_controller.py
3
3065
from mock import Mock, patch from ming.orm.ormsession import session from allura.lib import helpers as h from allura.model import User from pylons import c from forgetracker.tests.unit import TrackerTestWithModel from forgetracker.model import Ticket, Globals from forgetracker import tracker_main class WithUserAndBugsApp(TrackerTestWithModel): def setUp(self): super(WithUserAndBugsApp, self).setUp() c.user = User(username='test-user') h.set_context('test', 'bugs', neighborhood='Projects') class TestWhenSearchingWithCustomFields(WithUserAndBugsApp): def setUp(self): super(TestWhenSearchingWithCustomFields, self).setUp() with solr_search_returning_colors_are_wrong_ticket(): self.response = tracker_main.RootController().search(q='friends') def test_that_sortable_custom_fields_are_present(self): expected = [dict(sortable_name='_iteration_number_s', name='_iteration_number', label='Iteration Number')] assert self.response['sortable_custom_fields'] == expected def test_that_tickets_are_listed(self): assert self.response['tickets'][0].summary == 'colors are wrong' class TestWhenLoadingFrontPage(WithUserAndBugsApp): def setUp(self): super(TestWhenLoadingFrontPage, self).setUp() with mongo_search_returning_colors_are_wrong_ticket(): self.response = tracker_main.RootController().index() def test_that_recent_tickets_are_shown(self): tickets = self.response['tickets'] assert tickets[0].summary == 'colors are wrong' def solr_search_returning_colors_are_wrong_ticket(): ticket = create_colors_are_wrong_ticket() search_artifact = Mock() matches = Mock() matches.docs = [dict(ticket_num_i=ticket.ticket_num)] search_artifact.return_value = matches return patch('forgetracker.model.ticket.search_artifact', search_artifact) def mongo_search_returning_colors_are_wrong_ticket(): ticket = create_colors_are_wrong_ticket() tickets = [ ticket ] paged_query = Mock() paged_query.return_value = dict(tickets=tickets) return patch('forgetracker.tracker_main.TM.Ticket.paged_query', paged_query) def create_colors_are_wrong_ticket(): set_tracker_custom_fields([dict(name='_iteration_number', label='Iteration Number', show_in_search=True)]) ticket = create_ticket(summary="colors are wrong", custom_fields=dict(_iteration_number='Iteration 1')) ticket.commit() session(ticket).flush() return ticket def set_tracker_custom_fields(custom_fields): c.app.globals.custom_fields = custom_fields session(c.app.globals).flush() def create_ticket(summary, custom_fields): ticket = Ticket(app_config_id=c.app.config._id, ticket_num=1, summary=summary, custom_fields=custom_fields) session(ticket).flush() return ticket
apache-2.0
op3/hdtv
hdtv/plugins/config.py
1
3366
# -*- coding: utf-8 -*- # HDTV - A ROOT-based spectrum analysis software # Copyright (C) 2006-2009 The HDTV development team (see file AUTHORS) # # This file is part of HDTV. # # HDTV is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # HDTV is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with HDTV; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA import re from prompt_toolkit.completion import WordCompleter import hdtv.options import hdtv.cmdline import hdtv.util def ConfigSet(args): try: hdtv.options.Set(args.variable, args.value) except KeyError: raise hdtv.cmdline.HDTVCommandAbort(args.variable + ": no such option") except ValueError as err: raise hdtv.cmdline.HDTVCommandAbort( "Invalid value (%s) for option %s. %s" % (args.value, args.variable, err) ) def ConfigShow(args): if args.variable: try: hdtv.ui.msg(html=hdtv.options.Show(args.variable)) except KeyError: hdtv.ui.warning(args.variable + ": no such option") else: hdtv.ui.msg(html=hdtv.options.Str(), end="") def ConfigReset(args): if args.variable: if args.variable == "all": hdtv.options.ResetAll() hdtv.ui.debug("All configuration variables were reset.") else: try: hdtv.options.Reset(args.variable) hdtv.ui.debug("Reset configuration variable " + args.variable) except KeyError: hdtv.ui.warning(args.variable + ": no such option") else: hdtv.ui.msg(hdtv.options.Str(), end="") config_var_completer = WordCompleter( hdtv.options.OptionManager.__dict__.keys(), pattern=re.compile(r"^([^\s]+)"), ) prog = "config set" description = "Set a configuration variable" parser = hdtv.cmdline.HDTVOptionParser(prog=prog, description=description) parser.add_argument("variable") parser.add_argument("value") hdtv.cmdline.AddCommand( prog, ConfigSet, level=2, parser=parser, completer=config_var_completer ) prog = "config show" description = "Show the configuration or a single configuration variable" parser = hdtv.cmdline.HDTVOptionParser(prog=prog, description=description) parser.add_argument("variable", nargs="?", default=None) hdtv.cmdline.AddCommand( prog, ConfigShow, level=1, parser=parser, completer=config_var_completer ) prog = "config reset" description = "Reset a single configuration variable" parser = hdtv.cmdline.HDTVOptionParser(prog=prog, description=description) parser.add_argument( "variable", nargs="?", default=None, help="Name of the variable to reset. Use 'all' to reset all configuration variables.", ) hdtv.cmdline.AddCommand( prog, ConfigReset, level=2, parser=parser, completer=config_var_completer ) hdtv.ui.debug("Loaded user interface for configuration variables")
gpl-2.0
tardieu/swift
utils/swift_build_support/tests/products/test_ninja.py
37
3759
# tests/products/test_ninja.py ----------------------------------*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors # ---------------------------------------------------------------------------- import argparse import os import platform import shutil import sys import tempfile import unittest try: # py2 from StringIO import StringIO except ImportError: # py3 from io import StringIO from swift_build_support import shell from swift_build_support import xcrun from swift_build_support.products import Ninja from swift_build_support.toolchain import host_toolchain from swift_build_support.workspace import Workspace class NinjaTestCase(unittest.TestCase): def setUp(self): # Setup workspace tmpdir1 = os.path.realpath(tempfile.mkdtemp()) tmpdir2 = os.path.realpath(tempfile.mkdtemp()) os.makedirs(os.path.join(tmpdir1, 'ninja')) self.workspace = Workspace(source_root=tmpdir1, build_root=tmpdir2) # Setup toolchain self.toolchain = host_toolchain() self.toolchain.cc = '/path/to/cc' self.toolchain.cxx = '/path/to/cxx' # Setup args self.args = argparse.Namespace( build_ninja=True, darwin_deployment_version_osx="10.9") # Setup shell shell.dry_run = True self._orig_stdout = sys.stdout self._orig_stderr = sys.stderr self.stdout = StringIO() self.stderr = StringIO() sys.stdout = self.stdout sys.stderr = self.stderr def tearDown(self): shutil.rmtree(self.workspace.build_root) shutil.rmtree(self.workspace.source_root) sys.stdout = self._orig_stdout sys.stderr = self._orig_stderr shell.dry_run = False self.workspace = None self.toolchain = None self.args = None def test_ninja_bin_path(self): ninja_build = Ninja( args=self.args, toolchain=self.toolchain, source_dir='/path/to/src', build_dir='/path/to/build') self.assertEqual(ninja_build.ninja_bin_path, '/path/to/build/ninja') def test_do_build(self): ninja_build = Ninja( args=self.args, toolchain=self.toolchain, source_dir=self.workspace.source_dir('ninja'), build_dir=self.workspace.build_dir('build', 'ninja')) ninja_build.do_build() expect_env = "" if platform.system() == "Darwin": expect_env = ( "env " "'CFLAGS=-isysroot {sysroot} -mmacosx-version-min=10.9' " "CXX={cxx} " "LDFLAGS=-mmacosx-version-min=10.9 " ).format( cxx=self.toolchain.cxx, sysroot=xcrun.sdk_path('macosx') ) elif self.toolchain.cxx: expect_env = ( "env " "CXX={cxx} " ).format( cxx=self.toolchain.cxx, ) self.assertEqual(self.stdout.getvalue(), """\ + rm -rf {build_dir} + cp -r {source_dir} {build_dir} + pushd {build_dir} + {expect_env}{python} configure.py --bootstrap + popd """.format( source_dir=os.path.join(self.workspace.source_root, 'ninja'), build_dir=os.path.join(self.workspace.build_root, 'ninja-build'), expect_env=expect_env, python=sys.executable))
apache-2.0
bendmorris/retriever
setup.py
1
3832
"""Use the following command to install retriever: python setup.py install""" from setuptools import setup import platform import sys import warnings p = platform.platform().lower() extra_includes = [] if "darwin" in p: try: import py2app except ImportError: pass extra_includes = [] elif "win" in p: try: import py2exe except ImportError: pass import sys extra_includes = ['pyodbc', 'inspect'] sys.path.append("C:\\Windows\\winsxs\\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91") from __init__ import VERSION def is_wxpython_installed(): """Returns True if wxpython is installed""" try: return __import__("wx") except ImportError: return False def clean_version(v): if v == 'master': return '1.0.0' return v.replace('v', '').replace('.rc', '').replace('.beta', '') packages = [ 'retriever.lib', 'retriever.engines', 'retriever.app', 'retriever', ] includes = [ 'xlrd', 'wx', 'pymysql', 'psycopg2', 'sqlite3', ] + extra_includes excludes = [ 'pyreadline', 'doctest', 'optparse', 'getopt', 'pickle', 'calendar', 'pdb', 'inspect', 'email', 'pywin', 'pywin.debugger', 'pywin.debugger.dbgcon', 'pywin.dialogs', 'pywin.dialogs.list', 'Tkconstants', 'Tkinter', 'tcl', ] wx_installed = is_wxpython_installed() if wx_installed is False: warnings.warn("""wxpython is not installed. Retriever will not work in GUI mode. For retriever-gui install python-wxpython and run 'python setup.py install' again.""", UserWarning ) setup(name='retriever', version=clean_version(VERSION), description='EcoData Retriever', author='Ben Morris', author_email='[email protected]', url='http://www.ecodataretriever.org', packages=packages, package_dir={ 'retriever':'' }, entry_points={ 'console_scripts': [ 'retriever = retriever.__main__:main', ], }, install_requires=[ 'xlrd', ], # py2exe flags console = [{'script': "__main__.py", 'dest_base': "retriever", 'icon_resources':[(1,'icon.ico')] }], zipfile = None, # py2app flags app=['__main__.py'], data_files=[('', ['CITATION'])], setup_requires=['py2app'] if 'darwin' in p else [], # options # optimize is set to 1 of py2app to avoid errors with pymysql # bundle_files = 1 or 2 was causing failed builds so we moved # to bundle_files = 3 and Inno Setup options = {'py2exe': {'bundle_files': 3, 'compressed': 2, 'optimize': 1, 'packages': packages, 'includes': includes, 'excludes': excludes, }, 'py2app': {'packages': ['retriever'], 'includes': includes, 'site_packages': True, 'resources': [], 'optimize': 1, 'argv_emulation': True, 'no_chdir': True, 'iconfile': 'osx_icon.icns', }, }, ) try: from compile import compile compile() except: pass
mit
SuderPawel/api-python-library
src/api_python_library/tools/config.py
5
1040
import ConfigParser import sys __author__ = 'paoolo' class Config(object): def __init__(self, *args): self.__config = ConfigParser.ConfigParser() self.add_config_ini(*args) def __getattr__(self, name): # noinspection PyBroadException try: return self.__config.get('default', name) except Exception as n_exp: print('Cannot found value for %s in config: %s\n' % (name, n_exp)) return None def set_attr(self, key, value): # noinspection PyBroadException try: self.__config.set('default', key, str(value)) except Exception as n_exp: print('Cannot set value %s for %s to config: %s\n' % (value, key, n_exp)) def add_config_ini(self, *args): map(lambda config_file_path: self.__config.read(config_file_path), args) sys.modules[__name__] = Config() def add_config_ini(*args): sys.modules[__name__].add_config_ini(*args) def set_attr(*args): sys.modules[__name__].set_attr(*args)
mit
EttusResearch/gnuradio
gr-digital/python/digital/modulation_utils.py
59
3782
# # Copyright 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # """ Miscellaneous utilities for managing mods and demods, as well as other items useful in dealing with generalized handling of different modulations and demods. """ import inspect # Type 1 modulators accept a stream of bytes on their input and produce complex baseband output _type_1_modulators = {} def type_1_mods(): return _type_1_modulators def add_type_1_mod(name, mod_class): _type_1_modulators[name] = mod_class # Type 1 demodulators accept complex baseband input and produce a stream of bits, packed # 1 bit / byte as their output. Their output is completely unambiguous. There is no need # to resolve phase or polarity ambiguities. _type_1_demodulators = {} def type_1_demods(): return _type_1_demodulators def add_type_1_demod(name, demod_class): _type_1_demodulators[name] = demod_class # Also record the constellation making functions of the modulations _type_1_constellations = {} def type_1_constellations(): return _type_1_constellations def add_type_1_constellation(name, constellation): _type_1_constellations[name] = constellation def extract_kwargs_from_options(function, excluded_args, options): """ Given a function, a list of excluded arguments and the result of parsing command line options, create a dictionary of key word arguments suitable for passing to the function. The dictionary will be populated with key/value pairs where the keys are those that are common to the function's argument list (minus the excluded_args) and the attributes in options. The values are the corresponding values from options unless that value is None. In that case, the corresponding dictionary entry is not populated. (This allows different modulations that have the same parameter names, but different default values to coexist. The downside is that --help in the option parser will list the default as None, but in that case the default provided in the __init__ argument list will be used since there is no kwargs entry.) Args: function: the function whose parameter list will be examined excluded_args: function arguments that are NOT to be added to the dictionary (sequence of strings) options: result of command argument parsing (optparse.Values) """ # Try this in C++ ;) args, varargs, varkw, defaults = inspect.getargspec(function) d = {} for kw in [a for a in args if a not in excluded_args]: if hasattr(options, kw): if getattr(options, kw) is not None: d[kw] = getattr(options, kw) return d def extract_kwargs_from_options_for_class(cls, options): """ Given command line options, create dictionary suitable for passing to __init__ """ d = extract_kwargs_from_options( cls.__init__, ('self',), options) for base in cls.__bases__: if hasattr(base, 'extract_kwargs_from_options'): d.update(base.extract_kwargs_from_options(options)) return d
gpl-3.0
402231466/40223146
static/Brython3.1.0-20150301-090019/Lib/xml/etree/ElementTree.py
730
61800
# # ElementTree # $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $ # # light-weight XML support for Python 2.3 and later. # # history (since 1.2.6): # 2005-11-12 fl added tostringlist/fromstringlist helpers # 2006-07-05 fl merged in selected changes from the 1.3 sandbox # 2006-07-05 fl removed support for 2.1 and earlier # 2007-06-21 fl added deprecation/future warnings # 2007-08-25 fl added doctype hook, added parser version attribute etc # 2007-08-26 fl added new serializer code (better namespace handling, etc) # 2007-08-27 fl warn for broken /tag searches on tree level # 2007-09-02 fl added html/text methods to serializer (experimental) # 2007-09-05 fl added method argument to tostring/tostringlist # 2007-09-06 fl improved error handling # 2007-09-13 fl added itertext, iterfind; assorted cleanups # 2007-12-15 fl added C14N hooks, copy method (experimental) # # Copyright (c) 1999-2008 by Fredrik Lundh. All rights reserved. # # [email protected] # http://www.pythonware.com # # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2008 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you agree that you have read, understood, # and will comply with the following terms and conditions: # # Permission to use, copy, modify, and distribute this software and # its associated documentation for any purpose and without fee is # hereby granted, provided that the above copyright notice appears in # all copies, and that both that copyright notice and this permission # notice appear in supporting documentation, and that the name of # Secret Labs AB or the author not be used in advertising or publicity # pertaining to distribution of the software without specific, written # prior permission. # # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # -------------------------------------------------------------------- # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/psf/license for licensing details. __all__ = [ # public symbols "Comment", "dump", "Element", "ElementTree", "fromstring", "fromstringlist", "iselement", "iterparse", "parse", "ParseError", "PI", "ProcessingInstruction", "QName", "SubElement", "tostring", "tostringlist", "TreeBuilder", "VERSION", "XML", "XMLID", "XMLParser", "XMLTreeBuilder", "register_namespace", ] VERSION = "1.3.0" ## # The <b>Element</b> type is a flexible container object, designed to # store hierarchical data structures in memory. The type can be # described as a cross between a list and a dictionary. # <p> # Each element has a number of properties associated with it: # <ul> # <li>a <i>tag</i>. This is a string identifying what kind of data # this element represents (the element type, in other words).</li> # <li>a number of <i>attributes</i>, stored in a Python dictionary.</li> # <li>a <i>text</i> string.</li> # <li>an optional <i>tail</i> string.</li> # <li>a number of <i>child elements</i>, stored in a Python sequence</li> # </ul> # # To create an element instance, use the {@link #Element} constructor # or the {@link #SubElement} factory function. # <p> # The {@link #ElementTree} class can be used to wrap an element # structure, and convert it from and to XML. ## import sys import re import warnings import io import contextlib from . import ElementPath ## # Parser error. This is a subclass of <b>SyntaxError</b>. # <p> # In addition to the exception value, an exception instance contains a # specific exception code in the <b>code</b> attribute, and the line and # column of the error in the <b>position</b> attribute. class ParseError(SyntaxError): pass # -------------------------------------------------------------------- ## # Checks if an object appears to be a valid element object. # # @param An element instance. # @return A true value if this is an element object. # @defreturn flag def iselement(element): # FIXME: not sure about this; # isinstance(element, Element) or look for tag/attrib/text attributes return hasattr(element, 'tag') ## # Element class. This class defines the Element interface, and # provides a reference implementation of this interface. # <p> # The element name, attribute names, and attribute values can be # either ASCII strings (ordinary Python strings containing only 7-bit # ASCII characters) or Unicode strings. # # @param tag The element name. # @param attrib An optional dictionary, containing element attributes. # @param **extra Additional attributes, given as keyword arguments. # @see Element # @see SubElement # @see Comment # @see ProcessingInstruction class Element: # <tag attrib>text<child/>...</tag>tail ## # (Attribute) Element tag. tag = None ## # (Attribute) Element attribute dictionary. Where possible, use # {@link #Element.get}, # {@link #Element.set}, # {@link #Element.keys}, and # {@link #Element.items} to access # element attributes. attrib = None ## # (Attribute) Text before first subelement. This is either a # string or the value None. Note that if there was no text, this # attribute may be either None or an empty string, depending on # the parser. text = None ## # (Attribute) Text after this element's end tag, but before the # next sibling element's start tag. This is either a string or # the value None. Note that if there was no text, this attribute # may be either None or an empty string, depending on the parser. tail = None # text after end tag, if any # constructor def __init__(self, tag, attrib={}, **extra): if not isinstance(attrib, dict): raise TypeError("attrib must be dict, not %s" % ( attrib.__class__.__name__,)) attrib = attrib.copy() attrib.update(extra) self.tag = tag self.attrib = attrib self._children = [] def __repr__(self): return "<Element %s at 0x%x>" % (repr(self.tag), id(self)) ## # Creates a new element object of the same type as this element. # # @param tag Element tag. # @param attrib Element attributes, given as a dictionary. # @return A new element instance. def makeelement(self, tag, attrib): return self.__class__(tag, attrib) ## # (Experimental) Copies the current element. This creates a # shallow copy; subelements will be shared with the original tree. # # @return A new element instance. def copy(self): elem = self.makeelement(self.tag, self.attrib) elem.text = self.text elem.tail = self.tail elem[:] = self return elem ## # Returns the number of subelements. Note that this only counts # full elements; to check if there's any content in an element, you # have to check both the length and the <b>text</b> attribute. # # @return The number of subelements. def __len__(self): return len(self._children) def __bool__(self): warnings.warn( "The behavior of this method will change in future versions. " "Use specific 'len(elem)' or 'elem is not None' test instead.", FutureWarning, stacklevel=2 ) return len(self._children) != 0 # emulate old behaviour, for now ## # Returns the given subelement, by index. # # @param index What subelement to return. # @return The given subelement. # @exception IndexError If the given element does not exist. def __getitem__(self, index): return self._children[index] ## # Replaces the given subelement, by index. # # @param index What subelement to replace. # @param element The new element value. # @exception IndexError If the given element does not exist. def __setitem__(self, index, element): # if isinstance(index, slice): # for elt in element: # assert iselement(elt) # else: # assert iselement(element) self._children[index] = element ## # Deletes the given subelement, by index. # # @param index What subelement to delete. # @exception IndexError If the given element does not exist. def __delitem__(self, index): del self._children[index] ## # Adds a subelement to the end of this element. In document order, # the new element will appear after the last existing subelement (or # directly after the text, if it's the first subelement), but before # the end tag for this element. # # @param element The element to add. def append(self, element): self._assert_is_element(element) self._children.append(element) ## # Appends subelements from a sequence. # # @param elements A sequence object with zero or more elements. # @since 1.3 def extend(self, elements): for element in elements: self._assert_is_element(element) self._children.extend(elements) ## # Inserts a subelement at the given position in this element. # # @param index Where to insert the new subelement. def insert(self, index, element): self._assert_is_element(element) self._children.insert(index, element) def _assert_is_element(self, e): # Need to refer to the actual Python implementation, not the # shadowing C implementation. if not isinstance(e, _Element): raise TypeError('expected an Element, not %s' % type(e).__name__) ## # Removes a matching subelement. Unlike the <b>find</b> methods, # this method compares elements based on identity, not on tag # value or contents. To remove subelements by other means, the # easiest way is often to use a list comprehension to select what # elements to keep, and use slice assignment to update the parent # element. # # @param element What element to remove. # @exception ValueError If a matching element could not be found. def remove(self, element): # assert iselement(element) self._children.remove(element) ## # (Deprecated) Returns all subelements. The elements are returned # in document order. # # @return A list of subelements. # @defreturn list of Element instances def getchildren(self): warnings.warn( "This method will be removed in future versions. " "Use 'list(elem)' or iteration over elem instead.", DeprecationWarning, stacklevel=2 ) return self._children ## # Finds the first matching subelement, by tag name or path. # # @param path What element to look for. # @keyparam namespaces Optional namespace prefix map. # @return The first matching element, or None if no element was found. # @defreturn Element or None def find(self, path, namespaces=None): return ElementPath.find(self, path, namespaces) ## # Finds text for the first matching subelement, by tag name or path. # # @param path What element to look for. # @param default What to return if the element was not found. # @keyparam namespaces Optional namespace prefix map. # @return The text content of the first matching element, or the # default value no element was found. Note that if the element # is found, but has no text content, this method returns an # empty string. # @defreturn string def findtext(self, path, default=None, namespaces=None): return ElementPath.findtext(self, path, default, namespaces) ## # Finds all matching subelements, by tag name or path. # # @param path What element to look for. # @keyparam namespaces Optional namespace prefix map. # @return A list or other sequence containing all matching elements, # in document order. # @defreturn list of Element instances def findall(self, path, namespaces=None): return ElementPath.findall(self, path, namespaces) ## # Finds all matching subelements, by tag name or path. # # @param path What element to look for. # @keyparam namespaces Optional namespace prefix map. # @return An iterator or sequence containing all matching elements, # in document order. # @defreturn a generated sequence of Element instances def iterfind(self, path, namespaces=None): return ElementPath.iterfind(self, path, namespaces) ## # Resets an element. This function removes all subelements, clears # all attributes, and sets the <b>text</b> and <b>tail</b> attributes # to None. def clear(self): self.attrib.clear() self._children = [] self.text = self.tail = None ## # Gets an element attribute. Equivalent to <b>attrib.get</b>, but # some implementations may handle this a bit more efficiently. # # @param key What attribute to look for. # @param default What to return if the attribute was not found. # @return The attribute value, or the default value, if the # attribute was not found. # @defreturn string or None def get(self, key, default=None): return self.attrib.get(key, default) ## # Sets an element attribute. Equivalent to <b>attrib[key] = value</b>, # but some implementations may handle this a bit more efficiently. # # @param key What attribute to set. # @param value The attribute value. def set(self, key, value): self.attrib[key] = value ## # Gets a list of attribute names. The names are returned in an # arbitrary order (just like for an ordinary Python dictionary). # Equivalent to <b>attrib.keys()</b>. # # @return A list of element attribute names. # @defreturn list of strings def keys(self): return self.attrib.keys() ## # Gets element attributes, as a sequence. The attributes are # returned in an arbitrary order. Equivalent to <b>attrib.items()</b>. # # @return A list of (name, value) tuples for all attributes. # @defreturn list of (string, string) tuples def items(self): return self.attrib.items() ## # Creates a tree iterator. The iterator loops over this element # and all subelements, in document order, and returns all elements # with a matching tag. # <p> # If the tree structure is modified during iteration, new or removed # elements may or may not be included. To get a stable set, use the # list() function on the iterator, and loop over the resulting list. # # @param tag What tags to look for (default is to return all elements). # @return An iterator containing all the matching elements. # @defreturn iterator def iter(self, tag=None): if tag == "*": tag = None if tag is None or self.tag == tag: yield self for e in self._children: for e in e.iter(tag): yield e # compatibility def getiterator(self, tag=None): # Change for a DeprecationWarning in 1.4 warnings.warn( "This method will be removed in future versions. " "Use 'elem.iter()' or 'list(elem.iter())' instead.", PendingDeprecationWarning, stacklevel=2 ) return list(self.iter(tag)) ## # Creates a text iterator. The iterator loops over this element # and all subelements, in document order, and returns all inner # text. # # @return An iterator containing all inner text. # @defreturn iterator def itertext(self): tag = self.tag if not isinstance(tag, str) and tag is not None: return if self.text: yield self.text for e in self: for s in e.itertext(): yield s if e.tail: yield e.tail # compatibility _Element = _ElementInterface = Element ## # Subelement factory. This function creates an element instance, and # appends it to an existing element. # <p> # The element name, attribute names, and attribute values can be # either 8-bit ASCII strings or Unicode strings. # # @param parent The parent element. # @param tag The subelement name. # @param attrib An optional dictionary, containing element attributes. # @param **extra Additional attributes, given as keyword arguments. # @return An element instance. # @defreturn Element def SubElement(parent, tag, attrib={}, **extra): attrib = attrib.copy() attrib.update(extra) element = parent.makeelement(tag, attrib) parent.append(element) return element ## # Comment element factory. This factory function creates a special # element that will be serialized as an XML comment by the standard # serializer. # <p> # The comment string can be either an 8-bit ASCII string or a Unicode # string. # # @param text A string containing the comment string. # @return An element instance, representing a comment. # @defreturn Element def Comment(text=None): element = Element(Comment) element.text = text return element ## # PI element factory. This factory function creates a special element # that will be serialized as an XML processing instruction by the standard # serializer. # # @param target A string containing the PI target. # @param text A string containing the PI contents, if any. # @return An element instance, representing a PI. # @defreturn Element def ProcessingInstruction(target, text=None): element = Element(ProcessingInstruction) element.text = target if text: element.text = element.text + " " + text return element PI = ProcessingInstruction ## # QName wrapper. This can be used to wrap a QName attribute value, in # order to get proper namespace handling on output. # # @param text A string containing the QName value, in the form {uri}local, # or, if the tag argument is given, the URI part of a QName. # @param tag Optional tag. If given, the first argument is interpreted as # an URI, and this argument is interpreted as a local name. # @return An opaque object, representing the QName. class QName: def __init__(self, text_or_uri, tag=None): if tag: text_or_uri = "{%s}%s" % (text_or_uri, tag) self.text = text_or_uri def __str__(self): return self.text def __repr__(self): return '<QName %r>' % (self.text,) def __hash__(self): return hash(self.text) def __le__(self, other): if isinstance(other, QName): return self.text <= other.text return self.text <= other def __lt__(self, other): if isinstance(other, QName): return self.text < other.text return self.text < other def __ge__(self, other): if isinstance(other, QName): return self.text >= other.text return self.text >= other def __gt__(self, other): if isinstance(other, QName): return self.text > other.text return self.text > other def __eq__(self, other): if isinstance(other, QName): return self.text == other.text return self.text == other def __ne__(self, other): if isinstance(other, QName): return self.text != other.text return self.text != other # -------------------------------------------------------------------- ## # ElementTree wrapper class. This class represents an entire element # hierarchy, and adds some extra support for serialization to and from # standard XML. # # @param element Optional root element. # @keyparam file Optional file handle or file name. If given, the # tree is initialized with the contents of this XML file. class ElementTree: def __init__(self, element=None, file=None): # assert element is None or iselement(element) self._root = element # first node if file: self.parse(file) ## # Gets the root element for this tree. # # @return An element instance. # @defreturn Element def getroot(self): return self._root ## # Replaces the root element for this tree. This discards the # current contents of the tree, and replaces it with the given # element. Use with care. # # @param element An element instance. def _setroot(self, element): # assert iselement(element) self._root = element ## # Loads an external XML document into this element tree. # # @param source A file name or file object. If a file object is # given, it only has to implement a <b>read(n)</b> method. # @keyparam parser An optional parser instance. If not given, the # standard {@link XMLParser} parser is used. # @return The document root element. # @defreturn Element # @exception ParseError If the parser fails to parse the document. def parse(self, source, parser=None): close_source = False if not hasattr(source, "read"): source = open(source, "rb") close_source = True try: if not parser: parser = XMLParser(target=TreeBuilder()) while 1: data = source.read(65536) if not data: break parser.feed(data) self._root = parser.close() return self._root finally: if close_source: source.close() ## # Creates a tree iterator for the root element. The iterator loops # over all elements in this tree, in document order. # # @param tag What tags to look for (default is to return all elements) # @return An iterator. # @defreturn iterator def iter(self, tag=None): # assert self._root is not None return self._root.iter(tag) # compatibility def getiterator(self, tag=None): # Change for a DeprecationWarning in 1.4 warnings.warn( "This method will be removed in future versions. " "Use 'tree.iter()' or 'list(tree.iter())' instead.", PendingDeprecationWarning, stacklevel=2 ) return list(self.iter(tag)) ## # Same as getroot().find(path), starting at the root of the tree. # # @param path What element to look for. # @keyparam namespaces Optional namespace prefix map. # @return The first matching element, or None if no element was found. # @defreturn Element or None def find(self, path, namespaces=None): # assert self._root is not None if path[:1] == "/": path = "." + path warnings.warn( "This search is broken in 1.3 and earlier, and will be " "fixed in a future version. If you rely on the current " "behaviour, change it to %r" % path, FutureWarning, stacklevel=2 ) return self._root.find(path, namespaces) ## # Same as getroot().findtext(path), starting at the root of the tree. # # @param path What element to look for. # @param default What to return if the element was not found. # @keyparam namespaces Optional namespace prefix map. # @return The text content of the first matching element, or the # default value no element was found. Note that if the element # is found, but has no text content, this method returns an # empty string. # @defreturn string def findtext(self, path, default=None, namespaces=None): # assert self._root is not None if path[:1] == "/": path = "." + path warnings.warn( "This search is broken in 1.3 and earlier, and will be " "fixed in a future version. If you rely on the current " "behaviour, change it to %r" % path, FutureWarning, stacklevel=2 ) return self._root.findtext(path, default, namespaces) ## # Same as getroot().findall(path), starting at the root of the tree. # # @param path What element to look for. # @keyparam namespaces Optional namespace prefix map. # @return A list or iterator containing all matching elements, # in document order. # @defreturn list of Element instances def findall(self, path, namespaces=None): # assert self._root is not None if path[:1] == "/": path = "." + path warnings.warn( "This search is broken in 1.3 and earlier, and will be " "fixed in a future version. If you rely on the current " "behaviour, change it to %r" % path, FutureWarning, stacklevel=2 ) return self._root.findall(path, namespaces) ## # Finds all matching subelements, by tag name or path. # Same as getroot().iterfind(path). # # @param path What element to look for. # @keyparam namespaces Optional namespace prefix map. # @return An iterator or sequence containing all matching elements, # in document order. # @defreturn a generated sequence of Element instances def iterfind(self, path, namespaces=None): # assert self._root is not None if path[:1] == "/": path = "." + path warnings.warn( "This search is broken in 1.3 and earlier, and will be " "fixed in a future version. If you rely on the current " "behaviour, change it to %r" % path, FutureWarning, stacklevel=2 ) return self._root.iterfind(path, namespaces) ## # Writes the element tree to a file, as XML. # # @def write(file, **options) # @param file A file name, or a file object opened for writing. # @param **options Options, given as keyword arguments. # @keyparam encoding Optional output encoding (default is US-ASCII). # Use "unicode" to return a Unicode string. # @keyparam xml_declaration Controls if an XML declaration should # be added to the file. Use False for never, True for always, # None for only if not US-ASCII or UTF-8 or Unicode. None is default. # @keyparam default_namespace Sets the default XML namespace (for "xmlns"). # @keyparam method Optional output method ("xml", "html", "text" or # "c14n"; default is "xml"). def write(self, file_or_filename, encoding=None, xml_declaration=None, default_namespace=None, method=None): if not method: method = "xml" elif method not in _serialize: raise ValueError("unknown method %r" % method) if not encoding: if method == "c14n": encoding = "utf-8" else: encoding = "us-ascii" else: encoding = encoding.lower() with _get_writer(file_or_filename, encoding) as write: if method == "xml" and (xml_declaration or (xml_declaration is None and encoding not in ("utf-8", "us-ascii", "unicode"))): declared_encoding = encoding if encoding == "unicode": # Retrieve the default encoding for the xml declaration import locale declared_encoding = locale.getpreferredencoding() write("<?xml version='1.0' encoding='%s'?>\n" % ( declared_encoding,)) if method == "text": _serialize_text(write, self._root) else: qnames, namespaces = _namespaces(self._root, default_namespace) serialize = _serialize[method] serialize(write, self._root, qnames, namespaces) def write_c14n(self, file): # lxml.etree compatibility. use output method instead return self.write(file, method="c14n") # -------------------------------------------------------------------- # serialization support @contextlib.contextmanager def _get_writer(file_or_filename, encoding): # returns text write method and release all resourses after using try: write = file_or_filename.write except AttributeError: # file_or_filename is a file name if encoding == "unicode": file = open(file_or_filename, "w") else: file = open(file_or_filename, "w", encoding=encoding, errors="xmlcharrefreplace") with file: yield file.write else: # file_or_filename is a file-like object # encoding determines if it is a text or binary writer if encoding == "unicode": # use a text writer as is yield write else: # wrap a binary writer with TextIOWrapper with contextlib.ExitStack() as stack: if isinstance(file_or_filename, io.BufferedIOBase): file = file_or_filename elif isinstance(file_or_filename, io.RawIOBase): file = io.BufferedWriter(file_or_filename) # Keep the original file open when the BufferedWriter is # destroyed stack.callback(file.detach) else: # This is to handle passed objects that aren't in the # IOBase hierarchy, but just have a write method file = io.BufferedIOBase() file.writable = lambda: True file.write = write try: # TextIOWrapper uses this methods to determine # if BOM (for UTF-16, etc) should be added file.seekable = file_or_filename.seekable file.tell = file_or_filename.tell except AttributeError: pass file = io.TextIOWrapper(file, encoding=encoding, errors="xmlcharrefreplace", newline="\n") # Keep the original file open when the TextIOWrapper is # destroyed stack.callback(file.detach) yield file.write def _namespaces(elem, default_namespace=None): # identify namespaces used in this tree # maps qnames to *encoded* prefix:local names qnames = {None: None} # maps uri:s to prefixes namespaces = {} if default_namespace: namespaces[default_namespace] = "" def add_qname(qname): # calculate serialized qname representation try: if qname[:1] == "{": uri, tag = qname[1:].rsplit("}", 1) prefix = namespaces.get(uri) if prefix is None: prefix = _namespace_map.get(uri) if prefix is None: prefix = "ns%d" % len(namespaces) if prefix != "xml": namespaces[uri] = prefix if prefix: qnames[qname] = "%s:%s" % (prefix, tag) else: qnames[qname] = tag # default element else: if default_namespace: # FIXME: can this be handled in XML 1.0? raise ValueError( "cannot use non-qualified names with " "default_namespace option" ) qnames[qname] = qname except TypeError: _raise_serialization_error(qname) # populate qname and namespaces table for elem in elem.iter(): tag = elem.tag if isinstance(tag, QName): if tag.text not in qnames: add_qname(tag.text) elif isinstance(tag, str): if tag not in qnames: add_qname(tag) elif tag is not None and tag is not Comment and tag is not PI: _raise_serialization_error(tag) for key, value in elem.items(): if isinstance(key, QName): key = key.text if key not in qnames: add_qname(key) if isinstance(value, QName) and value.text not in qnames: add_qname(value.text) text = elem.text if isinstance(text, QName) and text.text not in qnames: add_qname(text.text) return qnames, namespaces def _serialize_xml(write, elem, qnames, namespaces): tag = elem.tag text = elem.text if tag is Comment: write("<!--%s-->" % text) elif tag is ProcessingInstruction: write("<?%s?>" % text) else: tag = qnames[tag] if tag is None: if text: write(_escape_cdata(text)) for e in elem: _serialize_xml(write, e, qnames, None) else: write("<" + tag) items = list(elem.items()) if items or namespaces: if namespaces: for v, k in sorted(namespaces.items(), key=lambda x: x[1]): # sort on prefix if k: k = ":" + k write(" xmlns%s=\"%s\"" % ( k, _escape_attrib(v) )) for k, v in sorted(items): # lexical order if isinstance(k, QName): k = k.text if isinstance(v, QName): v = qnames[v.text] else: v = _escape_attrib(v) write(" %s=\"%s\"" % (qnames[k], v)) if text or len(elem): write(">") if text: write(_escape_cdata(text)) for e in elem: _serialize_xml(write, e, qnames, None) write("</" + tag + ">") else: write(" />") if elem.tail: write(_escape_cdata(elem.tail)) HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr", "img", "input", "isindex", "link", "meta", "param") try: HTML_EMPTY = set(HTML_EMPTY) except NameError: pass def _serialize_html(write, elem, qnames, namespaces): tag = elem.tag text = elem.text if tag is Comment: write("<!--%s-->" % _escape_cdata(text)) elif tag is ProcessingInstruction: write("<?%s?>" % _escape_cdata(text)) else: tag = qnames[tag] if tag is None: if text: write(_escape_cdata(text)) for e in elem: _serialize_html(write, e, qnames, None) else: write("<" + tag) items = list(elem.items()) if items or namespaces: if namespaces: for v, k in sorted(namespaces.items(), key=lambda x: x[1]): # sort on prefix if k: k = ":" + k write(" xmlns%s=\"%s\"" % ( k, _escape_attrib(v) )) for k, v in sorted(items): # lexical order if isinstance(k, QName): k = k.text if isinstance(v, QName): v = qnames[v.text] else: v = _escape_attrib_html(v) # FIXME: handle boolean attributes write(" %s=\"%s\"" % (qnames[k], v)) write(">") tag = tag.lower() if text: if tag == "script" or tag == "style": write(text) else: write(_escape_cdata(text)) for e in elem: _serialize_html(write, e, qnames, None) if tag not in HTML_EMPTY: write("</" + tag + ">") if elem.tail: write(_escape_cdata(elem.tail)) def _serialize_text(write, elem): for part in elem.itertext(): write(part) if elem.tail: write(elem.tail) _serialize = { "xml": _serialize_xml, "html": _serialize_html, "text": _serialize_text, # this optional method is imported at the end of the module # "c14n": _serialize_c14n, } ## # Registers a namespace prefix. The registry is global, and any # existing mapping for either the given prefix or the namespace URI # will be removed. # # @param prefix Namespace prefix. # @param uri Namespace uri. Tags and attributes in this namespace # will be serialized with the given prefix, if at all possible. # @exception ValueError If the prefix is reserved, or is otherwise # invalid. def register_namespace(prefix, uri): if re.match("ns\d+$", prefix): raise ValueError("Prefix format reserved for internal use") for k, v in list(_namespace_map.items()): if k == uri or v == prefix: del _namespace_map[k] _namespace_map[uri] = prefix _namespace_map = { # "well-known" namespace prefixes "http://www.w3.org/XML/1998/namespace": "xml", "http://www.w3.org/1999/xhtml": "html", "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", "http://schemas.xmlsoap.org/wsdl/": "wsdl", # xml schema "http://www.w3.org/2001/XMLSchema": "xs", "http://www.w3.org/2001/XMLSchema-instance": "xsi", # dublin core "http://purl.org/dc/elements/1.1/": "dc", } # For tests and troubleshooting register_namespace._namespace_map = _namespace_map def _raise_serialization_error(text): raise TypeError( "cannot serialize %r (type %s)" % (text, type(text).__name__) ) def _escape_cdata(text): # escape character data try: # it's worth avoiding do-nothing calls for strings that are # shorter than 500 character, or so. assume that's, by far, # the most common case in most applications. if "&" in text: text = text.replace("&", "&amp;") if "<" in text: text = text.replace("<", "&lt;") if ">" in text: text = text.replace(">", "&gt;") return text except (TypeError, AttributeError): _raise_serialization_error(text) def _escape_attrib(text): # escape attribute value try: if "&" in text: text = text.replace("&", "&amp;") if "<" in text: text = text.replace("<", "&lt;") if ">" in text: text = text.replace(">", "&gt;") if "\"" in text: text = text.replace("\"", "&quot;") if "\n" in text: text = text.replace("\n", "&#10;") return text except (TypeError, AttributeError): _raise_serialization_error(text) def _escape_attrib_html(text): # escape attribute value try: if "&" in text: text = text.replace("&", "&amp;") if ">" in text: text = text.replace(">", "&gt;") if "\"" in text: text = text.replace("\"", "&quot;") return text except (TypeError, AttributeError): _raise_serialization_error(text) # -------------------------------------------------------------------- ## # Generates a string representation of an XML element, including all # subelements. If encoding is "unicode", the return type is a string; # otherwise it is a bytes array. # # @param element An Element instance. # @keyparam encoding Optional output encoding (default is US-ASCII). # Use "unicode" to return a Unicode string. # @keyparam method Optional output method ("xml", "html", "text" or # "c14n"; default is "xml"). # @return An (optionally) encoded string containing the XML data. # @defreturn string def tostring(element, encoding=None, method=None): stream = io.StringIO() if encoding == 'unicode' else io.BytesIO() ElementTree(element).write(stream, encoding, method=method) return stream.getvalue() ## # Generates a string representation of an XML element, including all # subelements. # # @param element An Element instance. # @keyparam encoding Optional output encoding (default is US-ASCII). # Use "unicode" to return a Unicode string. # @keyparam method Optional output method ("xml", "html", "text" or # "c14n"; default is "xml"). # @return A sequence object containing the XML data. # @defreturn sequence # @since 1.3 class _ListDataStream(io.BufferedIOBase): """ An auxiliary stream accumulating into a list reference """ def __init__(self, lst): self.lst = lst def writable(self): return True def seekable(self): return True def write(self, b): self.lst.append(b) def tell(self): return len(self.lst) def tostringlist(element, encoding=None, method=None): lst = [] stream = _ListDataStream(lst) ElementTree(element).write(stream, encoding, method=method) return lst ## # Writes an element tree or element structure to sys.stdout. This # function should be used for debugging only. # <p> # The exact output format is implementation dependent. In this # version, it's written as an ordinary XML file. # # @param elem An element tree or an individual element. def dump(elem): # debugging if not isinstance(elem, ElementTree): elem = ElementTree(elem) elem.write(sys.stdout, encoding="unicode") tail = elem.getroot().tail if not tail or tail[-1] != "\n": sys.stdout.write("\n") # -------------------------------------------------------------------- # parsing ## # Parses an XML document into an element tree. # # @param source A filename or file object containing XML data. # @param parser An optional parser instance. If not given, the # standard {@link XMLParser} parser is used. # @return An ElementTree instance def parse(source, parser=None): tree = ElementTree() tree.parse(source, parser) return tree ## # Parses an XML document into an element tree incrementally, and reports # what's going on to the user. # # @param source A filename or file object containing XML data. # @param events A list of events to report back. If omitted, only "end" # events are reported. # @param parser An optional parser instance. If not given, the # standard {@link XMLParser} parser is used. # @return A (event, elem) iterator. def iterparse(source, events=None, parser=None): close_source = False if not hasattr(source, "read"): source = open(source, "rb") close_source = True if not parser: parser = XMLParser(target=TreeBuilder()) return _IterParseIterator(source, events, parser, close_source) class _IterParseIterator: def __init__(self, source, events, parser, close_source=False): self._file = source self._close_file = close_source self._events = [] self._index = 0 self._error = None self.root = self._root = None self._parser = parser # wire up the parser for event reporting parser = self._parser._parser append = self._events.append if events is None: events = ["end"] for event in events: if event == "start": try: parser.ordered_attributes = 1 parser.specified_attributes = 1 def handler(tag, attrib_in, event=event, append=append, start=self._parser._start_list): append((event, start(tag, attrib_in))) parser.StartElementHandler = handler except AttributeError: def handler(tag, attrib_in, event=event, append=append, start=self._parser._start): append((event, start(tag, attrib_in))) parser.StartElementHandler = handler elif event == "end": def handler(tag, event=event, append=append, end=self._parser._end): append((event, end(tag))) parser.EndElementHandler = handler elif event == "start-ns": def handler(prefix, uri, event=event, append=append): append((event, (prefix or "", uri or ""))) parser.StartNamespaceDeclHandler = handler elif event == "end-ns": def handler(prefix, event=event, append=append): append((event, None)) parser.EndNamespaceDeclHandler = handler else: raise ValueError("unknown event %r" % event) def __next__(self): while 1: try: item = self._events[self._index] self._index += 1 return item except IndexError: pass if self._error: e = self._error self._error = None raise e if self._parser is None: self.root = self._root if self._close_file: self._file.close() raise StopIteration # load event buffer del self._events[:] self._index = 0 data = self._file.read(16384) if data: try: self._parser.feed(data) except SyntaxError as exc: self._error = exc else: self._root = self._parser.close() self._parser = None def __iter__(self): return self ## # Parses an XML document from a string constant. This function can # be used to embed "XML literals" in Python code. # # @param source A string containing XML data. # @param parser An optional parser instance. If not given, the # standard {@link XMLParser} parser is used. # @return An Element instance. # @defreturn Element def XML(text, parser=None): if not parser: parser = XMLParser(target=TreeBuilder()) parser.feed(text) return parser.close() ## # Parses an XML document from a string constant, and also returns # a dictionary which maps from element id:s to elements. # # @param source A string containing XML data. # @param parser An optional parser instance. If not given, the # standard {@link XMLParser} parser is used. # @return A tuple containing an Element instance and a dictionary. # @defreturn (Element, dictionary) def XMLID(text, parser=None): if not parser: parser = XMLParser(target=TreeBuilder()) parser.feed(text) tree = parser.close() ids = {} for elem in tree.iter(): id = elem.get("id") if id: ids[id] = elem return tree, ids ## # Parses an XML document from a string constant. Same as {@link #XML}. # # @def fromstring(text) # @param source A string containing XML data. # @return An Element instance. # @defreturn Element fromstring = XML ## # Parses an XML document from a sequence of string fragments. # # @param sequence A list or other sequence containing XML data fragments. # @param parser An optional parser instance. If not given, the # standard {@link XMLParser} parser is used. # @return An Element instance. # @defreturn Element # @since 1.3 def fromstringlist(sequence, parser=None): if not parser: parser = XMLParser(target=TreeBuilder()) for text in sequence: parser.feed(text) return parser.close() # -------------------------------------------------------------------- ## # Generic element structure builder. This builder converts a sequence # of {@link #TreeBuilder.start}, {@link #TreeBuilder.data}, and {@link # #TreeBuilder.end} method calls to a well-formed element structure. # <p> # You can use this class to build an element structure using a custom XML # parser, or a parser for some other XML-like format. # # @param element_factory Optional element factory. This factory # is called to create new Element instances, as necessary. class TreeBuilder: def __init__(self, element_factory=None): self._data = [] # data collector self._elem = [] # element stack self._last = None # last element self._tail = None # true if we're after an end tag if element_factory is None: element_factory = Element self._factory = element_factory ## # Flushes the builder buffers, and returns the toplevel document # element. # # @return An Element instance. # @defreturn Element def close(self): assert len(self._elem) == 0, "missing end tags" assert self._last is not None, "missing toplevel element" return self._last def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string. def data(self, data): self._data.append(data) ## # Opens a new element. # # @param tag The element name. # @param attrib A dictionary containing element attributes. # @return The opened element. # @defreturn Element def start(self, tag, attrs): self._flush() self._last = elem = self._factory(tag, attrs) if self._elem: self._elem[-1].append(elem) self._elem.append(elem) self._tail = 0 return elem ## # Closes the current element. # # @param tag The element name. # @return The closed element. # @defreturn Element def end(self, tag): self._flush() self._last = self._elem.pop() assert self._last.tag == tag,\ "end tag mismatch (expected %s, got %s)" % ( self._last.tag, tag) self._tail = 1 return self._last ## # Element structure builder for XML source data, based on the # <b>expat</b> parser. # # @keyparam target Target object. If omitted, the builder uses an # instance of the standard {@link #TreeBuilder} class. # @keyparam html Predefine HTML entities. This flag is not supported # by the current implementation. # @keyparam encoding Optional encoding. If given, the value overrides # the encoding specified in the XML file. # @see #ElementTree # @see #TreeBuilder class XMLParser: def __init__(self, html=0, target=None, encoding=None): try: from xml.parsers import expat except ImportError: try: import pyexpat as expat except ImportError: raise ImportError( "No module named expat; use SimpleXMLTreeBuilder instead" ) parser = expat.ParserCreate(encoding, "}") if target is None: target = TreeBuilder() # underscored names are provided for compatibility only self.parser = self._parser = parser self.target = self._target = target self._error = expat.error self._names = {} # name memo cache # main callbacks parser.DefaultHandlerExpand = self._default if hasattr(target, 'start'): parser.StartElementHandler = self._start if hasattr(target, 'end'): parser.EndElementHandler = self._end if hasattr(target, 'data'): parser.CharacterDataHandler = target.data # miscellaneous callbacks if hasattr(target, 'comment'): parser.CommentHandler = target.comment if hasattr(target, 'pi'): parser.ProcessingInstructionHandler = target.pi # let expat do the buffering, if supported try: parser.buffer_text = 1 except AttributeError: pass # use new-style attribute handling, if supported try: parser.ordered_attributes = 1 parser.specified_attributes = 1 if hasattr(target, 'start'): parser.StartElementHandler = self._start_list except AttributeError: pass self._doctype = None self.entity = {} try: self.version = "Expat %d.%d.%d" % expat.version_info except AttributeError: pass # unknown def _raiseerror(self, value): err = ParseError(value) err.code = value.code err.position = value.lineno, value.offset raise err def _fixname(self, key): # expand qname, and convert name string to ascii, if possible try: name = self._names[key] except KeyError: name = key if "}" in name: name = "{" + name self._names[key] = name return name def _start(self, tag, attrib_in): fixname = self._fixname tag = fixname(tag) attrib = {} for key, value in attrib_in.items(): attrib[fixname(key)] = value return self.target.start(tag, attrib) def _start_list(self, tag, attrib_in): fixname = self._fixname tag = fixname(tag) attrib = {} if attrib_in: for i in range(0, len(attrib_in), 2): attrib[fixname(attrib_in[i])] = attrib_in[i+1] return self.target.start(tag, attrib) def _end(self, tag): return self.target.end(self._fixname(tag)) def _default(self, text): prefix = text[:1] if prefix == "&": # deal with undefined entities try: data_handler = self.target.data except AttributeError: return try: data_handler(self.entity[text[1:-1]]) except KeyError: from xml.parsers import expat err = expat.error( "undefined entity %s: line %d, column %d" % (text, self.parser.ErrorLineNumber, self.parser.ErrorColumnNumber) ) err.code = 11 # XML_ERROR_UNDEFINED_ENTITY err.lineno = self.parser.ErrorLineNumber err.offset = self.parser.ErrorColumnNumber raise err elif prefix == "<" and text[:9] == "<!DOCTYPE": self._doctype = [] # inside a doctype declaration elif self._doctype is not None: # parse doctype contents if prefix == ">": self._doctype = None return text = text.strip() if not text: return self._doctype.append(text) n = len(self._doctype) if n > 2: type = self._doctype[1] if type == "PUBLIC" and n == 4: name, type, pubid, system = self._doctype if pubid: pubid = pubid[1:-1] elif type == "SYSTEM" and n == 3: name, type, system = self._doctype pubid = None else: return if hasattr(self.target, "doctype"): self.target.doctype(name, pubid, system[1:-1]) elif self.doctype != self._XMLParser__doctype: # warn about deprecated call self._XMLParser__doctype(name, pubid, system[1:-1]) self.doctype(name, pubid, system[1:-1]) self._doctype = None ## # (Deprecated) Handles a doctype declaration. # # @param name Doctype name. # @param pubid Public identifier. # @param system System identifier. def doctype(self, name, pubid, system): """This method of XMLParser is deprecated.""" warnings.warn( "This method of XMLParser is deprecated. Define doctype() " "method on the TreeBuilder target.", DeprecationWarning, ) # sentinel, if doctype is redefined in a subclass __doctype = doctype ## # Feeds data to the parser. # # @param data Encoded data. def feed(self, data): try: self.parser.Parse(data, 0) except self._error as v: self._raiseerror(v) ## # Finishes feeding data to the parser. # # @return An element structure. # @defreturn Element def close(self): try: self.parser.Parse("", 1) # end of data except self._error as v: self._raiseerror(v) try: close_handler = self.target.close except AttributeError: pass else: return close_handler() finally: # get rid of circular references del self.parser, self._parser del self.target, self._target # Import the C accelerators try: # Element, SubElement, ParseError, TreeBuilder, XMLParser from _elementtree import * except ImportError: pass else: # Overwrite 'ElementTree.parse' and 'iterparse' to use the C XMLParser class ElementTree(ElementTree): def parse(self, source, parser=None): close_source = False if not hasattr(source, 'read'): source = open(source, 'rb') close_source = True try: if parser is not None: while True: data = source.read(65536) if not data: break parser.feed(data) self._root = parser.close() else: parser = XMLParser() self._root = parser._parse(source) return self._root finally: if close_source: source.close() class iterparse: """Parses an XML section into an element tree incrementally. Reports what’s going on to the user. 'source' is a filename or file object containing XML data. 'events' is a list of events to report back. The supported events are the strings "start", "end", "start-ns" and "end-ns" (the "ns" events are used to get detailed namespace information). If 'events' is omitted, only "end" events are reported. 'parser' is an optional parser instance. If not given, the standard XMLParser parser is used. Returns an iterator providing (event, elem) pairs. """ root = None def __init__(self, file, events=None, parser=None): self._close_file = False if not hasattr(file, 'read'): file = open(file, 'rb') self._close_file = True self._file = file self._events = [] self._index = 0 self._error = None self.root = self._root = None if parser is None: parser = XMLParser(target=TreeBuilder()) self._parser = parser self._parser._setevents(self._events, events) def __next__(self): while True: try: item = self._events[self._index] self._index += 1 return item except IndexError: pass if self._error: e = self._error self._error = None raise e if self._parser is None: self.root = self._root if self._close_file: self._file.close() raise StopIteration # load event buffer del self._events[:] self._index = 0 data = self._file.read(16384) if data: try: self._parser.feed(data) except SyntaxError as exc: self._error = exc else: self._root = self._parser.close() self._parser = None def __iter__(self): return self # compatibility XMLTreeBuilder = XMLParser # workaround circular import. try: from ElementC14N import _serialize_c14n _serialize["c14n"] = _serialize_c14n except ImportError: pass
gpl-3.0
kenkov/kovot
kovot/stream/mastodon.py
1
5191
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import collections.abc from html.parser import HTMLParser from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI from collections import OrderedDict from queue import Queue from kovot import Message, Response, Speaker from logging import Logger from typing import Iterator, List, Tuple __all__ = ['Mastodon'] TOOT_LIMIT: int = 500 CACHE_SIZE: int = 16 class Mastodon(collections.abc.Iterable): """ An implementation of Stream for communicating by Mastodon. Attributes ---------- logger: logging.logger A logger instance dealing with messages sent by this instance. api: mastodon.Mastodon A Mastodon instance wrapping APIs of the connected Mastodon instance. """ def __init__( self, logger: Logger, client_id: str, client_secret: str, access_token: str, api_base_url: str, reply_everyone: bool = False ): self.logger = logger self.api = MastodonAPI( client_id, client_secret, access_token, api_base_url ) self.myself = self.api.account_verify_credentials() self.reply_everyone = reply_everyone self._cached = dict() def __iter__(self) -> Iterator: listener = _TootListener() self.api.stream_user(listener, run_async=True) self._cached = listener.cache return iter(listener) def post(self, response: Response) -> bool: self.logger.info("Trying to toot: " + response.text) if response.message is not None and response.message.id_ in self._cached: in_reply_to = self._cached[response.message.id_] if self.reply_everyone: for user in reversed(in_reply_to['mentions']): if user['id'] != self.myself['id']: response.text = '@%s %s' % (user['acct'], response.text) response.text = '@%s %s' % (in_reply_to['account']['acct'], response.text) if len(response.text) > TOOT_LIMIT: self.logger.error('Length of given status has exceeded the limit: %d' % len(response.text)) return False try: if response.message is None: result = self.api.status_post(response.text) else: result = self.api.status_post(response.text, in_reply_to_id=response.message.id_) self.logger.info('Updated: ' + str(result)) except MastodonError: self.logger.error('An API error has occured.') return False return True class _CleansingParser(HTMLParser): """ This class provides a function which removes HTML tags appearing in toots. """ def __init__(self, *args, **kwargs): super(_CleansingParser, self).__init__(*args, **kwargs) self.sb: List[str] = [] self._skip: bool = False def __str__(self) -> str: return ''.join(self.sb) def _append(self, text: str) -> None: if self._skip: return self.sb.append(text) def handle_starttag(self, tag: str, attrs: List[Tuple[str, str]]) -> None: self._strip = False attr = {name: value for name, value in attrs} classes = attr['class'].split() if 'class' in attr else [] if tag == 'br': self._append('\n') if tag == 'a' and 'mention' in classes: self._skip = True def handle_endtag(self, tag: str) -> None: if self._skip and tag == 'a': self._skip = False self._strip = True def handle_data(self, data: str) -> None: if self._strip: data = data.lstrip() self._strip = False self._append(data) class _TootListener(collections.abc.Iterable, StreamListener): """ A listener collecting only toots related to the connected account, that is, mentions sent to the account. This listener **cannot** generate multiple iterators due to some implemental issue for duplicating them. Attributes ---------- queue: queue.Queue A queue for processing collected toots in order. cache: collections.OrderedDict This attribute caches recent raw results given by Mastodon API. """ def __init__(self): self.queue = Queue() self.cache = OrderedDict() def __iter__(self) -> Iterator[Message]: while True: raw = self.queue.get() self.cache[raw['id']] = raw while len(self.cache) > CACHE_SIZE: self.cache.popitem(last=False) content = self._cleanse_html(raw['content']) speaker = Speaker(raw['account']['display_name']) yield Message(content, id_=raw['id'], speaker=speaker) def on_notification(self, notification: dict) -> None: if notification['type'] == 'mention': self.queue.put(notification['status']) @staticmethod def _cleanse_html(html: str) -> str: parser = _CleansingParser(convert_charrefs=True) parser.feed(html) return str(parser)
mit
alangwansui/mtl_ordercenter
openerp/addons/project/report/__init__.py
444
1069
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## import project_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
agpl-3.0
fkazimierczak/flask
examples/flaskr/test_flaskr.py
157
2059
# -*- coding: utf-8 -*- """ Flaskr Tests ~~~~~~~~~~~~ Tests the Flaskr application. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import pytest import os import flaskr import tempfile @pytest.fixture def client(request): db_fd, flaskr.app.config['DATABASE'] = tempfile.mkstemp() flaskr.app.config['TESTING'] = True client = flaskr.app.test_client() with flaskr.app.app_context(): flaskr.init_db() def teardown(): os.close(db_fd) os.unlink(flaskr.app.config['DATABASE']) request.addfinalizer(teardown) return client def login(client, username, password): return client.post('/login', data=dict( username=username, password=password ), follow_redirects=True) def logout(client): return client.get('/logout', follow_redirects=True) def test_empty_db(client): """Start with a blank database.""" rv = client.get('/') assert b'No entries here so far' in rv.data def test_login_logout(client): """Make sure login and logout works""" rv = login(client, flaskr.app.config['USERNAME'], flaskr.app.config['PASSWORD']) assert b'You were logged in' in rv.data rv = logout(client) assert b'You were logged out' in rv.data rv = login(client, flaskr.app.config['USERNAME'] + 'x', flaskr.app.config['PASSWORD']) assert b'Invalid username' in rv.data rv = login(client, flaskr.app.config['USERNAME'], flaskr.app.config['PASSWORD'] + 'x') assert b'Invalid password' in rv.data def test_messages(client): """Test that messages work""" login(client, flaskr.app.config['USERNAME'], flaskr.app.config['PASSWORD']) rv = client.post('/add', data=dict( title='<Hello>', text='<strong>HTML</strong> allowed here' ), follow_redirects=True) assert b'No entries here so far' not in rv.data assert b'&lt;Hello&gt;' in rv.data assert b'<strong>HTML</strong> allowed here' in rv.data
bsd-3-clause
binhqnguyen/lena
src/dsr/bindings/modulegen__gcc_LP64.py
10
851128
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) return True pybindgen.settings.error_handler = ErrorHandler() import sys def module_init(): root_module = Module('ns.dsr', cpp_namespace='::ns3') return root_module def register_types(module): root_module = module.get_root() ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacType [enumeration] module.add_enum('WifiMacType', ['WIFI_MAC_CTL_RTS', 'WIFI_MAC_CTL_CTS', 'WIFI_MAC_CTL_ACK', 'WIFI_MAC_CTL_BACKREQ', 'WIFI_MAC_CTL_BACKRESP', 'WIFI_MAC_CTL_CTLWRAPPER', 'WIFI_MAC_MGT_BEACON', 'WIFI_MAC_MGT_ASSOCIATION_REQUEST', 'WIFI_MAC_MGT_ASSOCIATION_RESPONSE', 'WIFI_MAC_MGT_DISASSOCIATION', 'WIFI_MAC_MGT_REASSOCIATION_REQUEST', 'WIFI_MAC_MGT_REASSOCIATION_RESPONSE', 'WIFI_MAC_MGT_PROBE_REQUEST', 'WIFI_MAC_MGT_PROBE_RESPONSE', 'WIFI_MAC_MGT_AUTHENTICATION', 'WIFI_MAC_MGT_DEAUTHENTICATION', 'WIFI_MAC_MGT_ACTION', 'WIFI_MAC_MGT_ACTION_NO_ACK', 'WIFI_MAC_MGT_MULTIHOP_ACTION', 'WIFI_MAC_DATA', 'WIFI_MAC_DATA_CFACK', 'WIFI_MAC_DATA_CFPOLL', 'WIFI_MAC_DATA_CFACK_CFPOLL', 'WIFI_MAC_DATA_NULL', 'WIFI_MAC_DATA_NULL_CFACK', 'WIFI_MAC_DATA_NULL_CFPOLL', 'WIFI_MAC_DATA_NULL_CFACK_CFPOLL', 'WIFI_MAC_QOSDATA', 'WIFI_MAC_QOSDATA_CFACK', 'WIFI_MAC_QOSDATA_CFPOLL', 'WIFI_MAC_QOSDATA_CFACK_CFPOLL', 'WIFI_MAC_QOSDATA_NULL', 'WIFI_MAC_QOSDATA_NULL_CFPOLL', 'WIFI_MAC_QOSDATA_NULL_CFACK_CFPOLL'], import_from_module='ns.wifi') ## wifi-preamble.h (module 'wifi'): ns3::WifiPreamble [enumeration] module.add_enum('WifiPreamble', ['WIFI_PREAMBLE_LONG', 'WIFI_PREAMBLE_SHORT', 'WIFI_PREAMBLE_HT_MF', 'WIFI_PREAMBLE_HT_GF'], import_from_module='ns.wifi') ## wifi-mode.h (module 'wifi'): ns3::WifiModulationClass [enumeration] module.add_enum('WifiModulationClass', ['WIFI_MOD_CLASS_UNKNOWN', 'WIFI_MOD_CLASS_IR', 'WIFI_MOD_CLASS_FHSS', 'WIFI_MOD_CLASS_DSSS', 'WIFI_MOD_CLASS_ERP_PBCC', 'WIFI_MOD_CLASS_DSSS_OFDM', 'WIFI_MOD_CLASS_ERP_OFDM', 'WIFI_MOD_CLASS_OFDM', 'WIFI_MOD_CLASS_HT'], import_from_module='ns.wifi') ## wifi-phy-standard.h (module 'wifi'): ns3::WifiPhyStandard [enumeration] module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_80211g', 'WIFI_PHY_STANDARD_80211_10MHZ', 'WIFI_PHY_STANDARD_80211_5MHZ', 'WIFI_PHY_STANDARD_holland', 'WIFI_PHY_STANDARD_80211n_2_4GHZ', 'WIFI_PHY_STANDARD_80211n_5GHZ'], import_from_module='ns.wifi') ## qos-utils.h (module 'wifi'): ns3::AcIndex [enumeration] module.add_enum('AcIndex', ['AC_BE', 'AC_BK', 'AC_VI', 'AC_VO', 'AC_BE_NQOS', 'AC_UNDEF'], import_from_module='ns.wifi') ## wifi-mode.h (module 'wifi'): ns3::WifiCodeRate [enumeration] module.add_enum('WifiCodeRate', ['WIFI_CODE_RATE_UNDEFINED', 'WIFI_CODE_RATE_3_4', 'WIFI_CODE_RATE_2_3', 'WIFI_CODE_RATE_1_2', 'WIFI_CODE_RATE_5_6'], import_from_module='ns.wifi') ## address.h (module 'network'): ns3::Address [class] module.add_class('Address', import_from_module='ns.network') ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration] module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address'], import_from_module='ns.network') ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList [class] module.add_class('AttributeConstructionList', import_from_module='ns.core') ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item [struct] module.add_class('Item', import_from_module='ns.core', outer_class=root_module['ns3::AttributeConstructionList']) ## buffer.h (module 'network'): ns3::Buffer [class] module.add_class('Buffer', import_from_module='ns.network') ## buffer.h (module 'network'): ns3::Buffer::Iterator [class] module.add_class('Iterator', import_from_module='ns.network', outer_class=root_module['ns3::Buffer']) ## packet.h (module 'network'): ns3::ByteTagIterator [class] module.add_class('ByteTagIterator', import_from_module='ns.network') ## packet.h (module 'network'): ns3::ByteTagIterator::Item [class] module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagIterator']) ## byte-tag-list.h (module 'network'): ns3::ByteTagList [class] module.add_class('ByteTagList', import_from_module='ns.network') ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator [class] module.add_class('Iterator', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList']) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item [struct] module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList::Iterator']) ## callback.h (module 'core'): ns3::CallbackBase [class] module.add_class('CallbackBase', import_from_module='ns.core') ## dsr-helper.h (module 'dsr'): ns3::DsrHelper [class] module.add_class('DsrHelper') ## dsr-main-helper.h (module 'dsr'): ns3::DsrMainHelper [class] module.add_class('DsrMainHelper') ## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector [class] module.add_class('EventGarbageCollector', import_from_module='ns.core') ## event-id.h (module 'core'): ns3::EventId [class] module.add_class('EventId', import_from_module='ns.core') ## hash.h (module 'core'): ns3::Hasher [class] module.add_class('Hasher', import_from_module='ns.core') ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class] module.add_class('Inet6SocketAddress', import_from_module='ns.network') ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class] root_module['ns3::Inet6SocketAddress'].implicitly_converts_to(root_module['ns3::Address']) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class] module.add_class('InetSocketAddress', import_from_module='ns.network') ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class] root_module['ns3::InetSocketAddress'].implicitly_converts_to(root_module['ns3::Address']) ## int-to-type.h (module 'core'): ns3::IntToType<0> [struct] module.add_class('IntToType', import_from_module='ns.core', template_parameters=['0']) ## int-to-type.h (module 'core'): ns3::IntToType<0>::v_e [enumeration] module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 0 >'], import_from_module='ns.core') ## int-to-type.h (module 'core'): ns3::IntToType<1> [struct] module.add_class('IntToType', import_from_module='ns.core', template_parameters=['1']) ## int-to-type.h (module 'core'): ns3::IntToType<1>::v_e [enumeration] module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 1 >'], import_from_module='ns.core') ## int-to-type.h (module 'core'): ns3::IntToType<2> [struct] module.add_class('IntToType', import_from_module='ns.core', template_parameters=['2']) ## int-to-type.h (module 'core'): ns3::IntToType<2>::v_e [enumeration] module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 2 >'], import_from_module='ns.core') ## int-to-type.h (module 'core'): ns3::IntToType<3> [struct] module.add_class('IntToType', import_from_module='ns.core', template_parameters=['3']) ## int-to-type.h (module 'core'): ns3::IntToType<3>::v_e [enumeration] module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 3 >'], import_from_module='ns.core') ## int-to-type.h (module 'core'): ns3::IntToType<4> [struct] module.add_class('IntToType', import_from_module='ns.core', template_parameters=['4']) ## int-to-type.h (module 'core'): ns3::IntToType<4>::v_e [enumeration] module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 4 >'], import_from_module='ns.core') ## int-to-type.h (module 'core'): ns3::IntToType<5> [struct] module.add_class('IntToType', import_from_module='ns.core', template_parameters=['5']) ## int-to-type.h (module 'core'): ns3::IntToType<5>::v_e [enumeration] module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 5 >'], import_from_module='ns.core') ## int-to-type.h (module 'core'): ns3::IntToType<6> [struct] module.add_class('IntToType', import_from_module='ns.core', template_parameters=['6']) ## int-to-type.h (module 'core'): ns3::IntToType<6>::v_e [enumeration] module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 6 >'], import_from_module='ns.core') ## ipv4-address.h (module 'network'): ns3::Ipv4Address [class] module.add_class('Ipv4Address', import_from_module='ns.network') ## ipv4-address.h (module 'network'): ns3::Ipv4Address [class] root_module['ns3::Ipv4Address'].implicitly_converts_to(root_module['ns3::Address']) ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress [class] module.add_class('Ipv4InterfaceAddress', import_from_module='ns.internet') ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e [enumeration] module.add_enum('InterfaceAddressScope_e', ['HOST', 'LINK', 'GLOBAL'], outer_class=root_module['ns3::Ipv4InterfaceAddress'], import_from_module='ns.internet') ## ipv4-address.h (module 'network'): ns3::Ipv4Mask [class] module.add_class('Ipv4Mask', import_from_module='ns.network') ## ipv6-address.h (module 'network'): ns3::Ipv6Address [class] module.add_class('Ipv6Address', import_from_module='ns.network') ## ipv6-address.h (module 'network'): ns3::Ipv6Address [class] root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address']) ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress [class] module.add_class('Ipv6InterfaceAddress', import_from_module='ns.internet') ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress::State_e [enumeration] module.add_enum('State_e', ['TENTATIVE', 'DEPRECATED', 'PREFERRED', 'PERMANENT', 'HOMEADDRESS', 'TENTATIVE_OPTIMISTIC', 'INVALID'], outer_class=root_module['ns3::Ipv6InterfaceAddress'], import_from_module='ns.internet') ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress::Scope_e [enumeration] module.add_enum('Scope_e', ['HOST', 'LINKLOCAL', 'GLOBAL'], outer_class=root_module['ns3::Ipv6InterfaceAddress'], import_from_module='ns.internet') ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class] module.add_class('Ipv6Prefix', import_from_module='ns.network') ## mac48-address.h (module 'network'): ns3::Mac48Address [class] module.add_class('Mac48Address', import_from_module='ns.network') ## mac48-address.h (module 'network'): ns3::Mac48Address [class] root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address']) ## node-container.h (module 'network'): ns3::NodeContainer [class] module.add_class('NodeContainer', import_from_module='ns.network') ## object-base.h (module 'core'): ns3::ObjectBase [class] module.add_class('ObjectBase', allow_subclassing=True, import_from_module='ns.core') ## object.h (module 'core'): ns3::ObjectDeleter [struct] module.add_class('ObjectDeleter', import_from_module='ns.core') ## object-factory.h (module 'core'): ns3::ObjectFactory [class] module.add_class('ObjectFactory', import_from_module='ns.core') ## packet-metadata.h (module 'network'): ns3::PacketMetadata [class] module.add_class('PacketMetadata', import_from_module='ns.network') ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item [struct] module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::PacketMetadata']) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item [enumeration] module.add_enum('', ['PAYLOAD', 'HEADER', 'TRAILER'], outer_class=root_module['ns3::PacketMetadata::Item'], import_from_module='ns.network') ## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator [class] module.add_class('ItemIterator', import_from_module='ns.network', outer_class=root_module['ns3::PacketMetadata']) ## packet.h (module 'network'): ns3::PacketTagIterator [class] module.add_class('PacketTagIterator', import_from_module='ns.network') ## packet.h (module 'network'): ns3::PacketTagIterator::Item [class] module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagIterator']) ## packet-tag-list.h (module 'network'): ns3::PacketTagList [class] module.add_class('PacketTagList', import_from_module='ns.network') ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData [struct] module.add_class('TagData', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagList']) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData_e [enumeration] module.add_enum('TagData_e', ['MAX_SIZE'], outer_class=root_module['ns3::PacketTagList::TagData'], import_from_module='ns.network') ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simulator.h (module 'core'): ns3::Simulator [class] module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core') ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs [class] module.add_class('SystemWallClockMs', import_from_module='ns.core') ## tag.h (module 'network'): ns3::Tag [class] module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase']) ## tag-buffer.h (module 'network'): ns3::TagBuffer [class] module.add_class('TagBuffer', import_from_module='ns.network') ## timer.h (module 'core'): ns3::Timer [class] module.add_class('Timer', import_from_module='ns.core') ## timer.h (module 'core'): ns3::Timer::DestroyPolicy [enumeration] module.add_enum('DestroyPolicy', ['CANCEL_ON_DESTROY', 'REMOVE_ON_DESTROY', 'CHECK_ON_DESTROY'], outer_class=root_module['ns3::Timer'], import_from_module='ns.core') ## timer.h (module 'core'): ns3::Timer::State [enumeration] module.add_enum('State', ['RUNNING', 'EXPIRED', 'SUSPENDED'], outer_class=root_module['ns3::Timer'], import_from_module='ns.core') ## timer-impl.h (module 'core'): ns3::TimerImpl [class] module.add_class('TimerImpl', allow_subclassing=True, import_from_module='ns.core') ## type-id.h (module 'core'): ns3::TypeId [class] module.add_class('TypeId', import_from_module='ns.core') ## type-id.h (module 'core'): ns3::TypeId::AttributeFlag [enumeration] module.add_enum('AttributeFlag', ['ATTR_GET', 'ATTR_SET', 'ATTR_CONSTRUCT', 'ATTR_SGC'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core') ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation [struct] module.add_class('AttributeInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId']) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation [struct] module.add_class('TraceSourceInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId']) ## wifi-mode.h (module 'wifi'): ns3::WifiMode [class] module.add_class('WifiMode', import_from_module='ns.wifi') ## wifi-mode.h (module 'wifi'): ns3::WifiModeFactory [class] module.add_class('WifiModeFactory', import_from_module='ns.wifi') ## wifi-phy.h (module 'wifi'): ns3::WifiPhyListener [class] module.add_class('WifiPhyListener', allow_subclassing=True, import_from_module='ns.wifi') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation [struct] module.add_class('WifiRemoteStation', import_from_module='ns.wifi') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationInfo [class] module.add_class('WifiRemoteStationInfo', import_from_module='ns.wifi') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState [struct] module.add_class('WifiRemoteStationState', import_from_module='ns.wifi') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState [enumeration] module.add_enum('', ['BRAND_NEW', 'DISASSOC', 'WAIT_ASSOC_TX_OK', 'GOT_ASSOC_TX_OK'], outer_class=root_module['ns3::WifiRemoteStationState'], import_from_module='ns.wifi') ## wifi-tx-vector.h (module 'wifi'): ns3::WifiTxVector [class] module.add_class('WifiTxVector', import_from_module='ns.wifi') ## empty.h (module 'core'): ns3::empty [class] module.add_class('empty', import_from_module='ns.core') ## int64x64-double.h (module 'core'): ns3::int64x64_t [class] module.add_class('int64x64_t', import_from_module='ns.core') ## chunk.h (module 'network'): ns3::Chunk [class] module.add_class('Chunk', import_from_module='ns.network', parent=root_module['ns3::ObjectBase']) ## header.h (module 'network'): ns3::Header [class] module.add_class('Header', import_from_module='ns.network', parent=root_module['ns3::Chunk']) ## icmpv4.h (module 'internet'): ns3::Icmpv4DestinationUnreachable [class] module.add_class('Icmpv4DestinationUnreachable', import_from_module='ns.internet', parent=root_module['ns3::Header']) ## icmpv4.h (module 'internet'): ns3::Icmpv4DestinationUnreachable [enumeration] module.add_enum('', ['NET_UNREACHABLE', 'HOST_UNREACHABLE', 'PROTOCOL_UNREACHABLE', 'PORT_UNREACHABLE', 'FRAG_NEEDED', 'SOURCE_ROUTE_FAILED'], outer_class=root_module['ns3::Icmpv4DestinationUnreachable'], import_from_module='ns.internet') ## icmpv4.h (module 'internet'): ns3::Icmpv4Echo [class] module.add_class('Icmpv4Echo', import_from_module='ns.internet', parent=root_module['ns3::Header']) ## icmpv4.h (module 'internet'): ns3::Icmpv4Header [class] module.add_class('Icmpv4Header', import_from_module='ns.internet', parent=root_module['ns3::Header']) ## icmpv4.h (module 'internet'): ns3::Icmpv4Header [enumeration] module.add_enum('', ['ECHO_REPLY', 'DEST_UNREACH', 'ECHO', 'TIME_EXCEEDED'], outer_class=root_module['ns3::Icmpv4Header'], import_from_module='ns.internet') ## icmpv4.h (module 'internet'): ns3::Icmpv4TimeExceeded [class] module.add_class('Icmpv4TimeExceeded', import_from_module='ns.internet', parent=root_module['ns3::Header']) ## icmpv4.h (module 'internet'): ns3::Icmpv4TimeExceeded [enumeration] module.add_enum('', ['TIME_TO_LIVE', 'FRAGMENT_REASSEMBLY'], outer_class=root_module['ns3::Icmpv4TimeExceeded'], import_from_module='ns.internet') ## ipv4-header.h (module 'internet'): ns3::Ipv4Header [class] module.add_class('Ipv4Header', import_from_module='ns.internet', parent=root_module['ns3::Header']) ## ipv4-header.h (module 'internet'): ns3::Ipv4Header::DscpType [enumeration] module.add_enum('DscpType', ['DscpDefault', 'DSCP_CS1', 'DSCP_AF11', 'DSCP_AF12', 'DSCP_AF13', 'DSCP_CS2', 'DSCP_AF21', 'DSCP_AF22', 'DSCP_AF23', 'DSCP_CS3', 'DSCP_AF31', 'DSCP_AF32', 'DSCP_AF33', 'DSCP_CS4', 'DSCP_AF41', 'DSCP_AF42', 'DSCP_AF43', 'DSCP_CS5', 'DSCP_EF', 'DSCP_CS6', 'DSCP_CS7'], outer_class=root_module['ns3::Ipv4Header'], import_from_module='ns.internet') ## ipv4-header.h (module 'internet'): ns3::Ipv4Header::EcnType [enumeration] module.add_enum('EcnType', ['ECN_NotECT', 'ECN_ECT1', 'ECN_ECT0', 'ECN_CE'], outer_class=root_module['ns3::Ipv4Header'], import_from_module='ns.internet') ## ipv6-header.h (module 'internet'): ns3::Ipv6Header [class] module.add_class('Ipv6Header', import_from_module='ns.internet', parent=root_module['ns3::Header']) ## ipv6-header.h (module 'internet'): ns3::Ipv6Header::NextHeader_e [enumeration] module.add_enum('NextHeader_e', ['IPV6_EXT_HOP_BY_HOP', 'IPV6_IPV4', 'IPV6_TCP', 'IPV6_UDP', 'IPV6_IPV6', 'IPV6_EXT_ROUTING', 'IPV6_EXT_FRAGMENTATION', 'IPV6_EXT_CONFIDENTIALITY', 'IPV6_EXT_AUTHENTIFICATION', 'IPV6_ICMPV6', 'IPV6_EXT_END', 'IPV6_EXT_DESTINATION', 'IPV6_SCTP', 'IPV6_EXT_MOBILITY', 'IPV6_UDP_LITE'], outer_class=root_module['ns3::Ipv6Header'], import_from_module='ns.internet') ## object.h (module 'core'): ns3::Object [class] module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) ## object.h (module 'core'): ns3::Object::AggregateIterator [class] module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object']) ## random-variable-stream.h (module 'core'): ns3::RandomVariableStream [class] module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object']) ## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable [class] module.add_class('SequentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeChecker', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeChecker>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::EventImpl', 'ns3::empty', 'ns3::DefaultDeleter<ns3::EventImpl>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Hash::Implementation>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Ipv4MulticastRoute', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Ipv4MulticastRoute>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Ipv4Route', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Ipv4Route>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::NixVector', 'ns3::empty', 'ns3::DefaultDeleter<ns3::NixVector>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::OutputStreamWrapper', 'ns3::empty', 'ns3::DefaultDeleter<ns3::OutputStreamWrapper>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Packet', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Packet>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::WifiInformationElement', 'ns3::empty', 'ns3::DefaultDeleter<ns3::WifiInformationElement>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## socket.h (module 'network'): ns3::Socket [class] module.add_class('Socket', import_from_module='ns.network', parent=root_module['ns3::Object']) ## socket.h (module 'network'): ns3::Socket::SocketErrno [enumeration] module.add_enum('SocketErrno', ['ERROR_NOTERROR', 'ERROR_ISCONN', 'ERROR_NOTCONN', 'ERROR_MSGSIZE', 'ERROR_AGAIN', 'ERROR_SHUTDOWN', 'ERROR_OPNOTSUPP', 'ERROR_AFNOSUPPORT', 'ERROR_INVAL', 'ERROR_BADF', 'ERROR_NOROUTETOHOST', 'ERROR_NODEV', 'ERROR_ADDRNOTAVAIL', 'ERROR_ADDRINUSE', 'SOCKET_ERRNO_LAST'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network') ## socket.h (module 'network'): ns3::Socket::SocketType [enumeration] module.add_enum('SocketType', ['NS3_SOCK_STREAM', 'NS3_SOCK_SEQPACKET', 'NS3_SOCK_DGRAM', 'NS3_SOCK_RAW'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network') ## socket.h (module 'network'): ns3::SocketAddressTag [class] module.add_class('SocketAddressTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) ## socket.h (module 'network'): ns3::SocketIpTosTag [class] module.add_class('SocketIpTosTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) ## socket.h (module 'network'): ns3::SocketIpTtlTag [class] module.add_class('SocketIpTtlTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) ## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag [class] module.add_class('SocketIpv6HopLimitTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) ## socket.h (module 'network'): ns3::SocketIpv6TclassTag [class] module.add_class('SocketIpv6TclassTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) ## socket.h (module 'network'): ns3::SocketSetDontFragmentTag [class] module.add_class('SocketSetDontFragmentTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) ## nstime.h (module 'core'): ns3::Time [class] module.add_class('Time', import_from_module='ns.core') ## nstime.h (module 'core'): ns3::Time::Unit [enumeration] module.add_enum('Unit', ['S', 'MS', 'US', 'NS', 'PS', 'FS', 'LAST'], outer_class=root_module['ns3::Time'], import_from_module='ns.core') ## nstime.h (module 'core'): ns3::Time [class] root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t']) ## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class] module.add_class('TraceSourceAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >']) ## trailer.h (module 'network'): ns3::Trailer [class] module.add_class('Trailer', import_from_module='ns.network', parent=root_module['ns3::Chunk']) ## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable [class] module.add_class('TriangularRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable [class] module.add_class('UniformRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable [class] module.add_class('WeibullRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElement [class] module.add_class('WifiInformationElement', import_from_module='ns.wifi', parent=root_module['ns3::SimpleRefCount< ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >']) ## wifi-mac.h (module 'wifi'): ns3::WifiMac [class] module.add_class('WifiMac', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacHeader [class] module.add_class('WifiMacHeader', import_from_module='ns.wifi', parent=root_module['ns3::Header']) ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacHeader::QosAckPolicy [enumeration] module.add_enum('QosAckPolicy', ['NORMAL_ACK', 'NO_ACK', 'NO_EXPLICIT_ACK', 'BLOCK_ACK'], outer_class=root_module['ns3::WifiMacHeader'], import_from_module='ns.wifi') ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacHeader::AddressType [enumeration] module.add_enum('AddressType', ['ADDR1', 'ADDR2', 'ADDR3', 'ADDR4'], outer_class=root_module['ns3::WifiMacHeader'], import_from_module='ns.wifi') ## wifi-phy.h (module 'wifi'): ns3::WifiPhy [class] module.add_class('WifiPhy', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::State [enumeration] module.add_enum('State', ['IDLE', 'CCA_BUSY', 'TX', 'RX', 'SWITCHING'], outer_class=root_module['ns3::WifiPhy'], import_from_module='ns.wifi') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager [class] module.add_class('WifiRemoteStationManager', import_from_module='ns.wifi', parent=root_module['ns3::Object']) ## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable [class] module.add_class('ZetaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable [class] module.add_class('ZipfRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## arp-cache.h (module 'internet'): ns3::ArpCache [class] module.add_class('ArpCache', import_from_module='ns.internet', parent=root_module['ns3::Object']) ## arp-cache.h (module 'internet'): ns3::ArpCache::Entry [class] module.add_class('Entry', import_from_module='ns.internet', outer_class=root_module['ns3::ArpCache']) ## attribute.h (module 'core'): ns3::AttributeAccessor [class] module.add_class('AttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >']) ## attribute.h (module 'core'): ns3::AttributeChecker [class] module.add_class('AttributeChecker', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >']) ## attribute.h (module 'core'): ns3::AttributeValue [class] module.add_class('AttributeValue', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >']) ## callback.h (module 'core'): ns3::CallbackChecker [class] module.add_class('CallbackChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## callback.h (module 'core'): ns3::CallbackImplBase [class] module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >']) ## callback.h (module 'core'): ns3::CallbackValue [class] module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable [class] module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable [class] module.add_class('DeterministicRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable [class] module.add_class('EmpiricalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## attribute.h (module 'core'): ns3::EmptyAttributeValue [class] module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## enum.h (module 'core'): ns3::EnumChecker [class] module.add_class('EnumChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## enum.h (module 'core'): ns3::EnumValue [class] module.add_class('EnumValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable [class] module.add_class('ErlangRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## event-impl.h (module 'core'): ns3::EventImpl [class] module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >']) ## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable [class] module.add_class('ExponentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable [class] module.add_class('GammaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilities [class] module.add_class('HtCapabilities', import_from_module='ns.wifi', parent=root_module['ns3::WifiInformationElement']) ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilitiesChecker [class] module.add_class('HtCapabilitiesChecker', import_from_module='ns.wifi', parent=root_module['ns3::AttributeChecker']) ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilitiesValue [class] module.add_class('HtCapabilitiesValue', import_from_module='ns.wifi', parent=root_module['ns3::AttributeValue']) ## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol [class] module.add_class('IpL4Protocol', import_from_module='ns.internet', parent=root_module['ns3::Object']) ## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus [enumeration] module.add_enum('RxStatus', ['RX_OK', 'RX_CSUM_FAILED', 'RX_ENDPOINT_CLOSED', 'RX_ENDPOINT_UNREACH'], outer_class=root_module['ns3::IpL4Protocol'], import_from_module='ns.internet') ## ipv4.h (module 'internet'): ns3::Ipv4 [class] module.add_class('Ipv4', import_from_module='ns.internet', parent=root_module['ns3::Object']) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker [class] module.add_class('Ipv4AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue [class] module.add_class('Ipv4AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) ## ipv4-interface.h (module 'internet'): ns3::Ipv4Interface [class] module.add_class('Ipv4Interface', import_from_module='ns.internet', parent=root_module['ns3::Object']) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol [class] module.add_class('Ipv4L3Protocol', import_from_module='ns.internet', parent=root_module['ns3::Ipv4']) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol::DropReason [enumeration] module.add_enum('DropReason', ['DROP_TTL_EXPIRED', 'DROP_NO_ROUTE', 'DROP_BAD_CHECKSUM', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR', 'DROP_FRAGMENT_TIMEOUT'], outer_class=root_module['ns3::Ipv4L3Protocol'], import_from_module='ns.internet') ## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker [class] module.add_class('Ipv4MaskChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue [class] module.add_class('Ipv4MaskValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) ## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute [class] module.add_class('Ipv4MulticastRoute', import_from_module='ns.internet', parent=root_module['ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >']) ## ipv4-route.h (module 'internet'): ns3::Ipv4Route [class] module.add_class('Ipv4Route', import_from_module='ns.internet', parent=root_module['ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >']) ## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol [class] module.add_class('Ipv4RoutingProtocol', import_from_module='ns.internet', parent=root_module['ns3::Object']) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker [class] module.add_class('Ipv6AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue [class] module.add_class('Ipv6AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) ## ipv6-interface.h (module 'internet'): ns3::Ipv6Interface [class] module.add_class('Ipv6Interface', import_from_module='ns.internet', parent=root_module['ns3::Object']) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker [class] module.add_class('Ipv6PrefixChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue [class] module.add_class('Ipv6PrefixValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) ## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable [class] module.add_class('LogNormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## mac48-address.h (module 'network'): ns3::Mac48AddressChecker [class] module.add_class('Mac48AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## mac48-address.h (module 'network'): ns3::Mac48AddressValue [class] module.add_class('Mac48AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) ## net-device.h (module 'network'): ns3::NetDevice [class] module.add_class('NetDevice', import_from_module='ns.network', parent=root_module['ns3::Object']) ## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration] module.add_enum('PacketType', ['PACKET_HOST', 'NS3_PACKET_HOST', 'PACKET_BROADCAST', 'NS3_PACKET_BROADCAST', 'PACKET_MULTICAST', 'NS3_PACKET_MULTICAST', 'PACKET_OTHERHOST', 'NS3_PACKET_OTHERHOST'], outer_class=root_module['ns3::NetDevice'], import_from_module='ns.network') ## nix-vector.h (module 'network'): ns3::NixVector [class] module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >']) ## node.h (module 'network'): ns3::Node [class] module.add_class('Node', import_from_module='ns.network', parent=root_module['ns3::Object']) ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable [class] module.add_class('NormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class] module.add_class('ObjectFactoryChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## object-factory.h (module 'core'): ns3::ObjectFactoryValue [class] module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper [class] module.add_class('OutputStreamWrapper', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >']) ## packet.h (module 'network'): ns3::Packet [class] module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >']) ## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable [class] module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) ## ssid.h (module 'wifi'): ns3::Ssid [class] module.add_class('Ssid', import_from_module='ns.wifi', parent=root_module['ns3::WifiInformationElement']) ## ssid.h (module 'wifi'): ns3::SsidChecker [class] module.add_class('SsidChecker', import_from_module='ns.wifi', parent=root_module['ns3::AttributeChecker']) ## ssid.h (module 'wifi'): ns3::SsidValue [class] module.add_class('SsidValue', import_from_module='ns.wifi', parent=root_module['ns3::AttributeValue']) ## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol [class] module.add_class('TcpL4Protocol', import_from_module='ns.internet', parent=root_module['ns3::IpL4Protocol']) ## nstime.h (module 'core'): ns3::TimeValue [class] module.add_class('TimeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## type-id.h (module 'core'): ns3::TypeIdChecker [class] module.add_class('TypeIdChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## type-id.h (module 'core'): ns3::TypeIdValue [class] module.add_class('TypeIdValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## udp-l4-protocol.h (module 'internet'): ns3::UdpL4Protocol [class] module.add_class('UdpL4Protocol', import_from_module='ns.internet', parent=root_module['ns3::IpL4Protocol']) ## uinteger.h (module 'core'): ns3::UintegerValue [class] module.add_class('UintegerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## wifi-mode.h (module 'wifi'): ns3::WifiModeChecker [class] module.add_class('WifiModeChecker', import_from_module='ns.wifi', parent=root_module['ns3::AttributeChecker']) ## wifi-mode.h (module 'wifi'): ns3::WifiModeValue [class] module.add_class('WifiModeValue', import_from_module='ns.wifi', parent=root_module['ns3::AttributeValue']) ## address.h (module 'network'): ns3::AddressChecker [class] module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) ## address.h (module 'network'): ns3::AddressValue [class] module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) ## icmpv4-l4-protocol.h (module 'internet'): ns3::Icmpv4L4Protocol [class] module.add_class('Icmpv4L4Protocol', import_from_module='ns.internet', parent=root_module['ns3::IpL4Protocol']) module.add_container('ns3::WifiModeList', 'ns3::WifiMode', container_type='vector') module.add_container('ns3::WifiMcsList', 'unsigned char', container_type='vector') module.add_container('std::list< ns3::Ptr< ns3::Packet > >', 'ns3::Ptr< ns3::Packet >', container_type='list') module.add_container('std::map< unsigned int, unsigned int >', ('unsigned int', 'unsigned int'), container_type='map') typehandlers.add_type_alias('__gnu_cxx::__normal_iterator< unsigned char const *, std::vector< unsigned char, std::allocator< unsigned char > > >', 'ns3::WifiMcsListIterator') typehandlers.add_type_alias('__gnu_cxx::__normal_iterator< unsigned char const *, std::vector< unsigned char, std::allocator< unsigned char > > >*', 'ns3::WifiMcsListIterator*') typehandlers.add_type_alias('__gnu_cxx::__normal_iterator< unsigned char const *, std::vector< unsigned char, std::allocator< unsigned char > > >&', 'ns3::WifiMcsListIterator&') typehandlers.add_type_alias('std::vector< unsigned char, std::allocator< unsigned char > >', 'ns3::WifiMcsList') typehandlers.add_type_alias('std::vector< unsigned char, std::allocator< unsigned char > >*', 'ns3::WifiMcsList*') typehandlers.add_type_alias('std::vector< unsigned char, std::allocator< unsigned char > >&', 'ns3::WifiMcsList&') typehandlers.add_type_alias('uint8_t', 'ns3::WifiInformationElementId') typehandlers.add_type_alias('uint8_t*', 'ns3::WifiInformationElementId*') typehandlers.add_type_alias('uint8_t&', 'ns3::WifiInformationElementId&') typehandlers.add_type_alias('__gnu_cxx::__normal_iterator< ns3::WifiMode const *, std::vector< ns3::WifiMode, std::allocator< ns3::WifiMode > > >', 'ns3::WifiModeListIterator') typehandlers.add_type_alias('__gnu_cxx::__normal_iterator< ns3::WifiMode const *, std::vector< ns3::WifiMode, std::allocator< ns3::WifiMode > > >*', 'ns3::WifiModeListIterator*') typehandlers.add_type_alias('__gnu_cxx::__normal_iterator< ns3::WifiMode const *, std::vector< ns3::WifiMode, std::allocator< ns3::WifiMode > > >&', 'ns3::WifiModeListIterator&') typehandlers.add_type_alias('std::vector< ns3::WifiMode, std::allocator< ns3::WifiMode > >', 'ns3::WifiModeList') typehandlers.add_type_alias('std::vector< ns3::WifiMode, std::allocator< ns3::WifiMode > >*', 'ns3::WifiModeList*') typehandlers.add_type_alias('std::vector< ns3::WifiMode, std::allocator< ns3::WifiMode > >&', 'ns3::WifiModeList&') ## Register a nested module for the namespace FatalImpl nested_module = module.add_cpp_namespace('FatalImpl') register_types_ns3_FatalImpl(nested_module) ## Register a nested module for the namespace Hash nested_module = module.add_cpp_namespace('Hash') register_types_ns3_Hash(nested_module) ## Register a nested module for the namespace dsr nested_module = module.add_cpp_namespace('dsr') register_types_ns3_dsr(nested_module) ## Register a nested module for the namespace internal nested_module = module.add_cpp_namespace('internal') register_types_ns3_internal(nested_module) def register_types_ns3_FatalImpl(module): root_module = module.get_root() def register_types_ns3_Hash(module): root_module = module.get_root() ## hash-function.h (module 'core'): ns3::Hash::Implementation [class] module.add_class('Implementation', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >']) typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash64Function_ptr') typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash64Function_ptr*') typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash64Function_ptr&') typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash32Function_ptr') typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash32Function_ptr*') typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash32Function_ptr&') ## Register a nested module for the namespace Function nested_module = module.add_cpp_namespace('Function') register_types_ns3_Hash_Function(nested_module) def register_types_ns3_Hash_Function(module): root_module = module.get_root() ## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a [class] module.add_class('Fnv1a', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation']) ## hash-function.h (module 'core'): ns3::Hash::Function::Hash32 [class] module.add_class('Hash32', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation']) ## hash-function.h (module 'core'): ns3::Hash::Function::Hash64 [class] module.add_class('Hash64', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation']) ## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3 [class] module.add_class('Murmur3', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation']) def register_types_ns3_dsr(module): root_module = module.get_root() ## dsr-option-header.h (module 'dsr'): ns3::dsr::ErrorType [enumeration] module.add_enum('ErrorType', ['NODE_UNREACHABLE', 'FLOW_STATE_NOT_SUPPORTED', 'OPTION_NOT_SUPPORTED']) ## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrMessageType [enumeration] module.add_enum('DsrMessageType', ['DSR_CONTROL_PACKET', 'DSR_DATA_PACKET']) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::LinkStates [enumeration] module.add_enum('LinkStates', ['PROBABLE', 'QUESTIONABLE']) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList [struct] module.add_class('BlackList') ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrFsHeader [class] module.add_class('DsrFsHeader', parent=root_module['ns3::Header']) ## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueue [class] module.add_class('DsrNetworkQueue', parent=root_module['ns3::Object']) ## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueueEntry [class] module.add_class('DsrNetworkQueueEntry') ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrOptionField [class] module.add_class('DsrOptionField') ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader [class] module.add_class('DsrOptionHeader', parent=root_module['ns3::Header']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment [struct] module.add_class('Alignment', outer_class=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPad1Header [class] module.add_class('DsrOptionPad1Header', parent=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPadnHeader [class] module.add_class('DsrOptionPadnHeader', parent=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrHeader [class] module.add_class('DsrOptionRerrHeader', parent=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnreachHeader [class] module.add_class('DsrOptionRerrUnreachHeader', parent=root_module['ns3::dsr::DsrOptionRerrHeader']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnsupportHeader [class] module.add_class('DsrOptionRerrUnsupportHeader', parent=root_module['ns3::dsr::DsrOptionRerrHeader']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRrepHeader [class] module.add_class('DsrOptionRrepHeader', parent=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRreqHeader [class] module.add_class('DsrOptionRreqHeader', parent=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionSRHeader [class] module.add_class('DsrOptionSRHeader', parent=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptions [class] module.add_class('DsrOptions', parent=root_module['ns3::Object']) ## dsr-routing.h (module 'dsr'): ns3::dsr::DsrRouting [class] module.add_class('DsrRouting', parent=root_module['ns3::IpL4Protocol']) ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrRoutingHeader [class] module.add_class('DsrRoutingHeader', parent=[root_module['ns3::dsr::DsrFsHeader'], root_module['ns3::dsr::DsrOptionField']]) ## dsr-errorbuff.h (module 'dsr'): ns3::dsr::ErrorBuffEntry [class] module.add_class('ErrorBuffEntry') ## dsr-errorbuff.h (module 'dsr'): ns3::dsr::ErrorBuffer [class] module.add_class('ErrorBuffer') ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReply [class] module.add_class('GraReply', parent=root_module['ns3::Object']) ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry [struct] module.add_class('GraReplyEntry') ## dsr-rcache.h (module 'dsr'): ns3::dsr::Link [struct] module.add_class('Link') ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey [struct] module.add_class('LinkKey') ## dsr-rcache.h (module 'dsr'): ns3::dsr::LinkStab [class] module.add_class('LinkStab') ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::MaintainBuffEntry [class] module.add_class('MaintainBuffEntry') ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::MaintainBuffer [class] module.add_class('MaintainBuffer') ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey [struct] module.add_class('NetworkKey') ## dsr-rcache.h (module 'dsr'): ns3::dsr::NodeStab [class] module.add_class('NodeStab') ## dsr-passive-buff.h (module 'dsr'): ns3::dsr::PassiveBuffEntry [class] module.add_class('PassiveBuffEntry') ## dsr-passive-buff.h (module 'dsr'): ns3::dsr::PassiveBuffer [class] module.add_class('PassiveBuffer', parent=root_module['ns3::Object']) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey [struct] module.add_class('PassiveKey') ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::ReceivedRreqEntry [class] module.add_class('ReceivedRreqEntry') ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache [class] module.add_class('RouteCache', parent=root_module['ns3::Object']) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::Neighbor [struct] module.add_class('Neighbor', outer_class=root_module['ns3::dsr::RouteCache']) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCacheEntry [class] module.add_class('RouteCacheEntry') ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTable [class] module.add_class('RreqTable', parent=root_module['ns3::Object']) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry [struct] module.add_class('RreqTableEntry') ## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::SendBuffEntry [class] module.add_class('SendBuffEntry') ## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::SendBuffer [class] module.add_class('SendBuffer') ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAck [class] module.add_class('DsrOptionAck', parent=root_module['ns3::dsr::DsrOptions']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckHeader [class] module.add_class('DsrOptionAckHeader', parent=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAckReq [class] module.add_class('DsrOptionAckReq', parent=root_module['ns3::dsr::DsrOptions']) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckReqHeader [class] module.add_class('DsrOptionAckReqHeader', parent=root_module['ns3::dsr::DsrOptionHeader']) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPad1 [class] module.add_class('DsrOptionPad1', parent=root_module['ns3::dsr::DsrOptions']) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPadn [class] module.add_class('DsrOptionPadn', parent=root_module['ns3::dsr::DsrOptions']) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRerr [class] module.add_class('DsrOptionRerr', parent=root_module['ns3::dsr::DsrOptions']) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRrep [class] module.add_class('DsrOptionRrep', parent=root_module['ns3::dsr::DsrOptions']) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRreq [class] module.add_class('DsrOptionRreq', parent=root_module['ns3::dsr::DsrOptions']) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionSR [class] module.add_class('DsrOptionSR', parent=root_module['ns3::dsr::DsrOptions']) module.add_container('std::vector< ns3::dsr::DsrNetworkQueueEntry >', 'ns3::dsr::DsrNetworkQueueEntry', container_type='vector') module.add_container('std::vector< ns3::Ipv4Address >', 'ns3::Ipv4Address', container_type='vector') module.add_container('std::vector< std::string >', 'std::string', container_type='vector') module.add_container('std::vector< ns3::dsr::ErrorBuffEntry >', 'ns3::dsr::ErrorBuffEntry', container_type='vector') module.add_container('std::vector< ns3::dsr::RouteCache::Neighbor >', 'ns3::dsr::RouteCache::Neighbor', container_type='vector') module.add_container('std::vector< ns3::Ptr< ns3::ArpCache > >', 'ns3::Ptr< ns3::ArpCache >', container_type='vector') module.add_container('std::list< std::vector< ns3::Ipv4Address > >', 'std::vector< ns3::Ipv4Address >', container_type='list') module.add_container('std::list< ns3::dsr::RouteCacheEntry >', 'ns3::dsr::RouteCacheEntry', container_type='list') module.add_container('std::map< ns3::Ipv4Address, ns3::dsr::RreqTableEntry >', ('ns3::Ipv4Address', 'ns3::dsr::RreqTableEntry'), container_type='map') module.add_container('std::vector< ns3::dsr::SendBuffEntry >', 'ns3::dsr::SendBuffEntry', container_type='vector') def register_types_ns3_internal(module): root_module = module.get_root() def register_methods(root_module): register_Ns3Address_methods(root_module, root_module['ns3::Address']) register_Ns3AttributeConstructionList_methods(root_module, root_module['ns3::AttributeConstructionList']) register_Ns3AttributeConstructionListItem_methods(root_module, root_module['ns3::AttributeConstructionList::Item']) register_Ns3Buffer_methods(root_module, root_module['ns3::Buffer']) register_Ns3BufferIterator_methods(root_module, root_module['ns3::Buffer::Iterator']) register_Ns3ByteTagIterator_methods(root_module, root_module['ns3::ByteTagIterator']) register_Ns3ByteTagIteratorItem_methods(root_module, root_module['ns3::ByteTagIterator::Item']) register_Ns3ByteTagList_methods(root_module, root_module['ns3::ByteTagList']) register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator']) register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item']) register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase']) register_Ns3DsrHelper_methods(root_module, root_module['ns3::DsrHelper']) register_Ns3DsrMainHelper_methods(root_module, root_module['ns3::DsrMainHelper']) register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector']) register_Ns3EventId_methods(root_module, root_module['ns3::EventId']) register_Ns3Hasher_methods(root_module, root_module['ns3::Hasher']) register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress']) register_Ns3InetSocketAddress_methods(root_module, root_module['ns3::InetSocketAddress']) register_Ns3IntToType__0_methods(root_module, root_module['ns3::IntToType< 0 >']) register_Ns3IntToType__1_methods(root_module, root_module['ns3::IntToType< 1 >']) register_Ns3IntToType__2_methods(root_module, root_module['ns3::IntToType< 2 >']) register_Ns3IntToType__3_methods(root_module, root_module['ns3::IntToType< 3 >']) register_Ns3IntToType__4_methods(root_module, root_module['ns3::IntToType< 4 >']) register_Ns3IntToType__5_methods(root_module, root_module['ns3::IntToType< 5 >']) register_Ns3IntToType__6_methods(root_module, root_module['ns3::IntToType< 6 >']) register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address']) register_Ns3Ipv4InterfaceAddress_methods(root_module, root_module['ns3::Ipv4InterfaceAddress']) register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask']) register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address']) register_Ns3Ipv6InterfaceAddress_methods(root_module, root_module['ns3::Ipv6InterfaceAddress']) register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix']) register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address']) register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer']) register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase']) register_Ns3ObjectDeleter_methods(root_module, root_module['ns3::ObjectDeleter']) register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory']) register_Ns3PacketMetadata_methods(root_module, root_module['ns3::PacketMetadata']) register_Ns3PacketMetadataItem_methods(root_module, root_module['ns3::PacketMetadata::Item']) register_Ns3PacketMetadataItemIterator_methods(root_module, root_module['ns3::PacketMetadata::ItemIterator']) register_Ns3PacketTagIterator_methods(root_module, root_module['ns3::PacketTagIterator']) register_Ns3PacketTagIteratorItem_methods(root_module, root_module['ns3::PacketTagIterator::Item']) register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList']) register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData']) register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator']) register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs']) register_Ns3Tag_methods(root_module, root_module['ns3::Tag']) register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer']) register_Ns3Timer_methods(root_module, root_module['ns3::Timer']) register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl']) register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId']) register_Ns3TypeIdAttributeInformation_methods(root_module, root_module['ns3::TypeId::AttributeInformation']) register_Ns3TypeIdTraceSourceInformation_methods(root_module, root_module['ns3::TypeId::TraceSourceInformation']) register_Ns3WifiMode_methods(root_module, root_module['ns3::WifiMode']) register_Ns3WifiModeFactory_methods(root_module, root_module['ns3::WifiModeFactory']) register_Ns3WifiPhyListener_methods(root_module, root_module['ns3::WifiPhyListener']) register_Ns3WifiRemoteStation_methods(root_module, root_module['ns3::WifiRemoteStation']) register_Ns3WifiRemoteStationInfo_methods(root_module, root_module['ns3::WifiRemoteStationInfo']) register_Ns3WifiRemoteStationState_methods(root_module, root_module['ns3::WifiRemoteStationState']) register_Ns3WifiTxVector_methods(root_module, root_module['ns3::WifiTxVector']) register_Ns3Empty_methods(root_module, root_module['ns3::empty']) register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t']) register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) register_Ns3Header_methods(root_module, root_module['ns3::Header']) register_Ns3Icmpv4DestinationUnreachable_methods(root_module, root_module['ns3::Icmpv4DestinationUnreachable']) register_Ns3Icmpv4Echo_methods(root_module, root_module['ns3::Icmpv4Echo']) register_Ns3Icmpv4Header_methods(root_module, root_module['ns3::Icmpv4Header']) register_Ns3Icmpv4TimeExceeded_methods(root_module, root_module['ns3::Icmpv4TimeExceeded']) register_Ns3Ipv4Header_methods(root_module, root_module['ns3::Ipv4Header']) register_Ns3Ipv6Header_methods(root_module, root_module['ns3::Ipv6Header']) register_Ns3Object_methods(root_module, root_module['ns3::Object']) register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator']) register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream']) register_Ns3SequentialRandomVariable_methods(root_module, root_module['ns3::SequentialRandomVariable']) register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >']) register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >']) register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >']) register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >']) register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >']) register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >']) register_Ns3SimpleRefCount__Ns3Ipv4MulticastRoute_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4MulticastRoute__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >']) register_Ns3SimpleRefCount__Ns3Ipv4Route_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4Route__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >']) register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >']) register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >']) register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >']) register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >']) register_Ns3SimpleRefCount__Ns3WifiInformationElement_Ns3Empty_Ns3DefaultDeleter__lt__ns3WifiInformationElement__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >']) register_Ns3Socket_methods(root_module, root_module['ns3::Socket']) register_Ns3SocketAddressTag_methods(root_module, root_module['ns3::SocketAddressTag']) register_Ns3SocketIpTosTag_methods(root_module, root_module['ns3::SocketIpTosTag']) register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag']) register_Ns3SocketIpv6HopLimitTag_methods(root_module, root_module['ns3::SocketIpv6HopLimitTag']) register_Ns3SocketIpv6TclassTag_methods(root_module, root_module['ns3::SocketIpv6TclassTag']) register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag']) register_Ns3Time_methods(root_module, root_module['ns3::Time']) register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor']) register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) register_Ns3TriangularRandomVariable_methods(root_module, root_module['ns3::TriangularRandomVariable']) register_Ns3UniformRandomVariable_methods(root_module, root_module['ns3::UniformRandomVariable']) register_Ns3WeibullRandomVariable_methods(root_module, root_module['ns3::WeibullRandomVariable']) register_Ns3WifiInformationElement_methods(root_module, root_module['ns3::WifiInformationElement']) register_Ns3WifiMac_methods(root_module, root_module['ns3::WifiMac']) register_Ns3WifiMacHeader_methods(root_module, root_module['ns3::WifiMacHeader']) register_Ns3WifiPhy_methods(root_module, root_module['ns3::WifiPhy']) register_Ns3WifiRemoteStationManager_methods(root_module, root_module['ns3::WifiRemoteStationManager']) register_Ns3ZetaRandomVariable_methods(root_module, root_module['ns3::ZetaRandomVariable']) register_Ns3ZipfRandomVariable_methods(root_module, root_module['ns3::ZipfRandomVariable']) register_Ns3ArpCache_methods(root_module, root_module['ns3::ArpCache']) register_Ns3ArpCacheEntry_methods(root_module, root_module['ns3::ArpCache::Entry']) register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor']) register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker']) register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue']) register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker']) register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable']) register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable']) register_Ns3EmpiricalRandomVariable_methods(root_module, root_module['ns3::EmpiricalRandomVariable']) register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue']) register_Ns3EnumChecker_methods(root_module, root_module['ns3::EnumChecker']) register_Ns3EnumValue_methods(root_module, root_module['ns3::EnumValue']) register_Ns3ErlangRandomVariable_methods(root_module, root_module['ns3::ErlangRandomVariable']) register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl']) register_Ns3ExponentialRandomVariable_methods(root_module, root_module['ns3::ExponentialRandomVariable']) register_Ns3GammaRandomVariable_methods(root_module, root_module['ns3::GammaRandomVariable']) register_Ns3HtCapabilities_methods(root_module, root_module['ns3::HtCapabilities']) register_Ns3HtCapabilitiesChecker_methods(root_module, root_module['ns3::HtCapabilitiesChecker']) register_Ns3HtCapabilitiesValue_methods(root_module, root_module['ns3::HtCapabilitiesValue']) register_Ns3IpL4Protocol_methods(root_module, root_module['ns3::IpL4Protocol']) register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4']) register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker']) register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue']) register_Ns3Ipv4Interface_methods(root_module, root_module['ns3::Ipv4Interface']) register_Ns3Ipv4L3Protocol_methods(root_module, root_module['ns3::Ipv4L3Protocol']) register_Ns3Ipv4MaskChecker_methods(root_module, root_module['ns3::Ipv4MaskChecker']) register_Ns3Ipv4MaskValue_methods(root_module, root_module['ns3::Ipv4MaskValue']) register_Ns3Ipv4MulticastRoute_methods(root_module, root_module['ns3::Ipv4MulticastRoute']) register_Ns3Ipv4Route_methods(root_module, root_module['ns3::Ipv4Route']) register_Ns3Ipv4RoutingProtocol_methods(root_module, root_module['ns3::Ipv4RoutingProtocol']) register_Ns3Ipv6AddressChecker_methods(root_module, root_module['ns3::Ipv6AddressChecker']) register_Ns3Ipv6AddressValue_methods(root_module, root_module['ns3::Ipv6AddressValue']) register_Ns3Ipv6Interface_methods(root_module, root_module['ns3::Ipv6Interface']) register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker']) register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue']) register_Ns3LogNormalRandomVariable_methods(root_module, root_module['ns3::LogNormalRandomVariable']) register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker']) register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue']) register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice']) register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector']) register_Ns3Node_methods(root_module, root_module['ns3::Node']) register_Ns3NormalRandomVariable_methods(root_module, root_module['ns3::NormalRandomVariable']) register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker']) register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue']) register_Ns3OutputStreamWrapper_methods(root_module, root_module['ns3::OutputStreamWrapper']) register_Ns3Packet_methods(root_module, root_module['ns3::Packet']) register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable']) register_Ns3Ssid_methods(root_module, root_module['ns3::Ssid']) register_Ns3SsidChecker_methods(root_module, root_module['ns3::SsidChecker']) register_Ns3SsidValue_methods(root_module, root_module['ns3::SsidValue']) register_Ns3TcpL4Protocol_methods(root_module, root_module['ns3::TcpL4Protocol']) register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue']) register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker']) register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue']) register_Ns3UdpL4Protocol_methods(root_module, root_module['ns3::UdpL4Protocol']) register_Ns3UintegerValue_methods(root_module, root_module['ns3::UintegerValue']) register_Ns3WifiModeChecker_methods(root_module, root_module['ns3::WifiModeChecker']) register_Ns3WifiModeValue_methods(root_module, root_module['ns3::WifiModeValue']) register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker']) register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue']) register_Ns3Icmpv4L4Protocol_methods(root_module, root_module['ns3::Icmpv4L4Protocol']) register_Ns3HashImplementation_methods(root_module, root_module['ns3::Hash::Implementation']) register_Ns3HashFunctionFnv1a_methods(root_module, root_module['ns3::Hash::Function::Fnv1a']) register_Ns3HashFunctionHash32_methods(root_module, root_module['ns3::Hash::Function::Hash32']) register_Ns3HashFunctionHash64_methods(root_module, root_module['ns3::Hash::Function::Hash64']) register_Ns3HashFunctionMurmur3_methods(root_module, root_module['ns3::Hash::Function::Murmur3']) register_Ns3DsrBlackList_methods(root_module, root_module['ns3::dsr::BlackList']) register_Ns3DsrDsrFsHeader_methods(root_module, root_module['ns3::dsr::DsrFsHeader']) register_Ns3DsrDsrNetworkQueue_methods(root_module, root_module['ns3::dsr::DsrNetworkQueue']) register_Ns3DsrDsrNetworkQueueEntry_methods(root_module, root_module['ns3::dsr::DsrNetworkQueueEntry']) register_Ns3DsrDsrOptionField_methods(root_module, root_module['ns3::dsr::DsrOptionField']) register_Ns3DsrDsrOptionHeader_methods(root_module, root_module['ns3::dsr::DsrOptionHeader']) register_Ns3DsrDsrOptionHeaderAlignment_methods(root_module, root_module['ns3::dsr::DsrOptionHeader::Alignment']) register_Ns3DsrDsrOptionPad1Header_methods(root_module, root_module['ns3::dsr::DsrOptionPad1Header']) register_Ns3DsrDsrOptionPadnHeader_methods(root_module, root_module['ns3::dsr::DsrOptionPadnHeader']) register_Ns3DsrDsrOptionRerrHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRerrHeader']) register_Ns3DsrDsrOptionRerrUnreachHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRerrUnreachHeader']) register_Ns3DsrDsrOptionRerrUnsupportHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRerrUnsupportHeader']) register_Ns3DsrDsrOptionRrepHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRrepHeader']) register_Ns3DsrDsrOptionRreqHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRreqHeader']) register_Ns3DsrDsrOptionSRHeader_methods(root_module, root_module['ns3::dsr::DsrOptionSRHeader']) register_Ns3DsrDsrOptions_methods(root_module, root_module['ns3::dsr::DsrOptions']) register_Ns3DsrDsrRouting_methods(root_module, root_module['ns3::dsr::DsrRouting']) register_Ns3DsrDsrRoutingHeader_methods(root_module, root_module['ns3::dsr::DsrRoutingHeader']) register_Ns3DsrErrorBuffEntry_methods(root_module, root_module['ns3::dsr::ErrorBuffEntry']) register_Ns3DsrErrorBuffer_methods(root_module, root_module['ns3::dsr::ErrorBuffer']) register_Ns3DsrGraReply_methods(root_module, root_module['ns3::dsr::GraReply']) register_Ns3DsrGraReplyEntry_methods(root_module, root_module['ns3::dsr::GraReplyEntry']) register_Ns3DsrLink_methods(root_module, root_module['ns3::dsr::Link']) register_Ns3DsrLinkKey_methods(root_module, root_module['ns3::dsr::LinkKey']) register_Ns3DsrLinkStab_methods(root_module, root_module['ns3::dsr::LinkStab']) register_Ns3DsrMaintainBuffEntry_methods(root_module, root_module['ns3::dsr::MaintainBuffEntry']) register_Ns3DsrMaintainBuffer_methods(root_module, root_module['ns3::dsr::MaintainBuffer']) register_Ns3DsrNetworkKey_methods(root_module, root_module['ns3::dsr::NetworkKey']) register_Ns3DsrNodeStab_methods(root_module, root_module['ns3::dsr::NodeStab']) register_Ns3DsrPassiveBuffEntry_methods(root_module, root_module['ns3::dsr::PassiveBuffEntry']) register_Ns3DsrPassiveBuffer_methods(root_module, root_module['ns3::dsr::PassiveBuffer']) register_Ns3DsrPassiveKey_methods(root_module, root_module['ns3::dsr::PassiveKey']) register_Ns3DsrReceivedRreqEntry_methods(root_module, root_module['ns3::dsr::ReceivedRreqEntry']) register_Ns3DsrRouteCache_methods(root_module, root_module['ns3::dsr::RouteCache']) register_Ns3DsrRouteCacheNeighbor_methods(root_module, root_module['ns3::dsr::RouteCache::Neighbor']) register_Ns3DsrRouteCacheEntry_methods(root_module, root_module['ns3::dsr::RouteCacheEntry']) register_Ns3DsrRreqTable_methods(root_module, root_module['ns3::dsr::RreqTable']) register_Ns3DsrRreqTableEntry_methods(root_module, root_module['ns3::dsr::RreqTableEntry']) register_Ns3DsrSendBuffEntry_methods(root_module, root_module['ns3::dsr::SendBuffEntry']) register_Ns3DsrSendBuffer_methods(root_module, root_module['ns3::dsr::SendBuffer']) register_Ns3DsrDsrOptionAck_methods(root_module, root_module['ns3::dsr::DsrOptionAck']) register_Ns3DsrDsrOptionAckHeader_methods(root_module, root_module['ns3::dsr::DsrOptionAckHeader']) register_Ns3DsrDsrOptionAckReq_methods(root_module, root_module['ns3::dsr::DsrOptionAckReq']) register_Ns3DsrDsrOptionAckReqHeader_methods(root_module, root_module['ns3::dsr::DsrOptionAckReqHeader']) register_Ns3DsrDsrOptionPad1_methods(root_module, root_module['ns3::dsr::DsrOptionPad1']) register_Ns3DsrDsrOptionPadn_methods(root_module, root_module['ns3::dsr::DsrOptionPadn']) register_Ns3DsrDsrOptionRerr_methods(root_module, root_module['ns3::dsr::DsrOptionRerr']) register_Ns3DsrDsrOptionRrep_methods(root_module, root_module['ns3::dsr::DsrOptionRrep']) register_Ns3DsrDsrOptionRreq_methods(root_module, root_module['ns3::dsr::DsrOptionRreq']) register_Ns3DsrDsrOptionSR_methods(root_module, root_module['ns3::dsr::DsrOptionSR']) return def register_Ns3Address_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('<') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## address.h (module 'network'): ns3::Address::Address() [constructor] cls.add_constructor([]) ## address.h (module 'network'): ns3::Address::Address(uint8_t type, uint8_t const * buffer, uint8_t len) [constructor] cls.add_constructor([param('uint8_t', 'type'), param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) ## address.h (module 'network'): ns3::Address::Address(ns3::Address const & address) [copy constructor] cls.add_constructor([param('ns3::Address const &', 'address')]) ## address.h (module 'network'): bool ns3::Address::CheckCompatible(uint8_t type, uint8_t len) const [member function] cls.add_method('CheckCompatible', 'bool', [param('uint8_t', 'type'), param('uint8_t', 'len')], is_const=True) ## address.h (module 'network'): uint32_t ns3::Address::CopyAllFrom(uint8_t const * buffer, uint8_t len) [member function] cls.add_method('CopyAllFrom', 'uint32_t', [param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) ## address.h (module 'network'): uint32_t ns3::Address::CopyAllTo(uint8_t * buffer, uint8_t len) const [member function] cls.add_method('CopyAllTo', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint8_t', 'len')], is_const=True) ## address.h (module 'network'): uint32_t ns3::Address::CopyFrom(uint8_t const * buffer, uint8_t len) [member function] cls.add_method('CopyFrom', 'uint32_t', [param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) ## address.h (module 'network'): uint32_t ns3::Address::CopyTo(uint8_t * buffer) const [member function] cls.add_method('CopyTo', 'uint32_t', [param('uint8_t *', 'buffer')], is_const=True) ## address.h (module 'network'): void ns3::Address::Deserialize(ns3::TagBuffer buffer) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'buffer')]) ## address.h (module 'network'): uint8_t ns3::Address::GetLength() const [member function] cls.add_method('GetLength', 'uint8_t', [], is_const=True) ## address.h (module 'network'): uint32_t ns3::Address::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## address.h (module 'network'): bool ns3::Address::IsInvalid() const [member function] cls.add_method('IsInvalid', 'bool', [], is_const=True) ## address.h (module 'network'): bool ns3::Address::IsMatchingType(uint8_t type) const [member function] cls.add_method('IsMatchingType', 'bool', [param('uint8_t', 'type')], is_const=True) ## address.h (module 'network'): static uint8_t ns3::Address::Register() [member function] cls.add_method('Register', 'uint8_t', [], is_static=True) ## address.h (module 'network'): void ns3::Address::Serialize(ns3::TagBuffer buffer) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'buffer')], is_const=True) return def register_Ns3AttributeConstructionList_methods(root_module, cls): ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList(ns3::AttributeConstructionList const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeConstructionList const &', 'arg0')]) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList() [constructor] cls.add_constructor([]) ## attribute-construction-list.h (module 'core'): void ns3::AttributeConstructionList::Add(std::string name, ns3::Ptr<ns3::AttributeChecker const> checker, ns3::Ptr<ns3::AttributeValue> value) [member function] cls.add_method('Add', 'void', [param('std::string', 'name'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::Ptr< ns3::AttributeValue >', 'value')]) ## attribute-construction-list.h (module 'core'): std::_List_const_iterator<ns3::AttributeConstructionList::Item> ns3::AttributeConstructionList::Begin() const [member function] cls.add_method('Begin', 'std::_List_const_iterator< ns3::AttributeConstructionList::Item >', [], is_const=True) ## attribute-construction-list.h (module 'core'): std::_List_const_iterator<ns3::AttributeConstructionList::Item> ns3::AttributeConstructionList::End() const [member function] cls.add_method('End', 'std::_List_const_iterator< ns3::AttributeConstructionList::Item >', [], is_const=True) ## attribute-construction-list.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeConstructionList::Find(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('Find', 'ns3::Ptr< ns3::AttributeValue >', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True) return def register_Ns3AttributeConstructionListItem_methods(root_module, cls): ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item() [constructor] cls.add_constructor([]) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item(ns3::AttributeConstructionList::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeConstructionList::Item const &', 'arg0')]) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::checker [variable] cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::name [variable] cls.add_instance_attribute('name', 'std::string', is_const=False) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::value [variable] cls.add_instance_attribute('value', 'ns3::Ptr< ns3::AttributeValue >', is_const=False) return def register_Ns3Buffer_methods(root_module, cls): ## buffer.h (module 'network'): ns3::Buffer::Buffer() [constructor] cls.add_constructor([]) ## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize) [constructor] cls.add_constructor([param('uint32_t', 'dataSize')]) ## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize, bool initialize) [constructor] cls.add_constructor([param('uint32_t', 'dataSize'), param('bool', 'initialize')]) ## buffer.h (module 'network'): ns3::Buffer::Buffer(ns3::Buffer const & o) [copy constructor] cls.add_constructor([param('ns3::Buffer const &', 'o')]) ## buffer.h (module 'network'): bool ns3::Buffer::AddAtEnd(uint32_t end) [member function] cls.add_method('AddAtEnd', 'bool', [param('uint32_t', 'end')]) ## buffer.h (module 'network'): void ns3::Buffer::AddAtEnd(ns3::Buffer const & o) [member function] cls.add_method('AddAtEnd', 'void', [param('ns3::Buffer const &', 'o')]) ## buffer.h (module 'network'): bool ns3::Buffer::AddAtStart(uint32_t start) [member function] cls.add_method('AddAtStart', 'bool', [param('uint32_t', 'start')]) ## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::Begin() const [member function] cls.add_method('Begin', 'ns3::Buffer::Iterator', [], is_const=True) ## buffer.h (module 'network'): void ns3::Buffer::CopyData(std::ostream * os, uint32_t size) const [member function] cls.add_method('CopyData', 'void', [param('std::ostream *', 'os'), param('uint32_t', 'size')], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::CopyData(uint8_t * buffer, uint32_t size) const [member function] cls.add_method('CopyData', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')], is_const=True) ## buffer.h (module 'network'): ns3::Buffer ns3::Buffer::CreateFragment(uint32_t start, uint32_t length) const [member function] cls.add_method('CreateFragment', 'ns3::Buffer', [param('uint32_t', 'start'), param('uint32_t', 'length')], is_const=True) ## buffer.h (module 'network'): ns3::Buffer ns3::Buffer::CreateFullCopy() const [member function] cls.add_method('CreateFullCopy', 'ns3::Buffer', [], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Deserialize(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('Deserialize', 'uint32_t', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::End() const [member function] cls.add_method('End', 'ns3::Buffer::Iterator', [], is_const=True) ## buffer.h (module 'network'): int32_t ns3::Buffer::GetCurrentEndOffset() const [member function] cls.add_method('GetCurrentEndOffset', 'int32_t', [], is_const=True) ## buffer.h (module 'network'): int32_t ns3::Buffer::GetCurrentStartOffset() const [member function] cls.add_method('GetCurrentStartOffset', 'int32_t', [], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSize() const [member function] cls.add_method('GetSize', 'uint32_t', [], is_const=True) ## buffer.h (module 'network'): uint8_t const * ns3::Buffer::PeekData() const [member function] cls.add_method('PeekData', 'uint8_t const *', [], is_const=True) ## buffer.h (module 'network'): void ns3::Buffer::RemoveAtEnd(uint32_t end) [member function] cls.add_method('RemoveAtEnd', 'void', [param('uint32_t', 'end')]) ## buffer.h (module 'network'): void ns3::Buffer::RemoveAtStart(uint32_t start) [member function] cls.add_method('RemoveAtStart', 'void', [param('uint32_t', 'start')]) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function] cls.add_method('Serialize', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], is_const=True) return def register_Ns3BufferIterator_methods(root_module, cls): ## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator(ns3::Buffer::Iterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::Buffer::Iterator const &', 'arg0')]) ## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator() [constructor] cls.add_constructor([]) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size) [member function] cls.add_method('CalculateIpChecksum', 'uint16_t', [param('uint16_t', 'size')]) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size, uint32_t initialChecksum) [member function] cls.add_method('CalculateIpChecksum', 'uint16_t', [param('uint16_t', 'size'), param('uint32_t', 'initialChecksum')]) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetDistanceFrom(ns3::Buffer::Iterator const & o) const [member function] cls.add_method('GetDistanceFrom', 'uint32_t', [param('ns3::Buffer::Iterator const &', 'o')], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetSize() const [member function] cls.add_method('GetSize', 'uint32_t', [], is_const=True) ## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsEnd() const [member function] cls.add_method('IsEnd', 'bool', [], is_const=True) ## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsStart() const [member function] cls.add_method('IsStart', 'bool', [], is_const=True) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next() [member function] cls.add_method('Next', 'void', []) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next(uint32_t delta) [member function] cls.add_method('Next', 'void', [param('uint32_t', 'delta')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function] cls.add_method('Prev', 'void', []) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev(uint32_t delta) [member function] cls.add_method('Prev', 'void', [param('uint32_t', 'delta')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(uint8_t * buffer, uint32_t size) [member function] cls.add_method('Read', 'void', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')]) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function] cls.add_method('ReadLsbtohU16', 'uint16_t', []) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadLsbtohU32() [member function] cls.add_method('ReadLsbtohU32', 'uint32_t', []) ## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadLsbtohU64() [member function] cls.add_method('ReadLsbtohU64', 'uint64_t', []) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadNtohU16() [member function] cls.add_method('ReadNtohU16', 'uint16_t', []) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadNtohU32() [member function] cls.add_method('ReadNtohU32', 'uint32_t', []) ## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadNtohU64() [member function] cls.add_method('ReadNtohU64', 'uint64_t', []) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadU16() [member function] cls.add_method('ReadU16', 'uint16_t', []) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadU32() [member function] cls.add_method('ReadU32', 'uint32_t', []) ## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadU64() [member function] cls.add_method('ReadU64', 'uint64_t', []) ## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::ReadU8() [member function] cls.add_method('ReadU8', 'uint8_t', []) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('Write', 'void', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function] cls.add_method('Write', 'void', [param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU16(uint16_t data) [member function] cls.add_method('WriteHtolsbU16', 'void', [param('uint16_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU32(uint32_t data) [member function] cls.add_method('WriteHtolsbU32', 'void', [param('uint32_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU64(uint64_t data) [member function] cls.add_method('WriteHtolsbU64', 'void', [param('uint64_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU16(uint16_t data) [member function] cls.add_method('WriteHtonU16', 'void', [param('uint16_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU32(uint32_t data) [member function] cls.add_method('WriteHtonU32', 'void', [param('uint32_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU64(uint64_t data) [member function] cls.add_method('WriteHtonU64', 'void', [param('uint64_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU16(uint16_t data) [member function] cls.add_method('WriteU16', 'void', [param('uint16_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU32(uint32_t data) [member function] cls.add_method('WriteU32', 'void', [param('uint32_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU64(uint64_t data) [member function] cls.add_method('WriteU64', 'void', [param('uint64_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data) [member function] cls.add_method('WriteU8', 'void', [param('uint8_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data, uint32_t len) [member function] cls.add_method('WriteU8', 'void', [param('uint8_t', 'data'), param('uint32_t', 'len')]) return def register_Ns3ByteTagIterator_methods(root_module, cls): ## packet.h (module 'network'): ns3::ByteTagIterator::ByteTagIterator(ns3::ByteTagIterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::ByteTagIterator const &', 'arg0')]) ## packet.h (module 'network'): bool ns3::ByteTagIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## packet.h (module 'network'): ns3::ByteTagIterator::Item ns3::ByteTagIterator::Next() [member function] cls.add_method('Next', 'ns3::ByteTagIterator::Item', []) return def register_Ns3ByteTagIteratorItem_methods(root_module, cls): ## packet.h (module 'network'): ns3::ByteTagIterator::Item::Item(ns3::ByteTagIterator::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::ByteTagIterator::Item const &', 'arg0')]) ## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetEnd() const [member function] cls.add_method('GetEnd', 'uint32_t', [], is_const=True) ## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetStart() const [member function] cls.add_method('GetStart', 'uint32_t', [], is_const=True) ## packet.h (module 'network'): void ns3::ByteTagIterator::Item::GetTag(ns3::Tag & tag) const [member function] cls.add_method('GetTag', 'void', [param('ns3::Tag &', 'tag')], is_const=True) ## packet.h (module 'network'): ns3::TypeId ns3::ByteTagIterator::Item::GetTypeId() const [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_const=True) return def register_Ns3ByteTagList_methods(root_module, cls): ## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList() [constructor] cls.add_constructor([]) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList(ns3::ByteTagList const & o) [copy constructor] cls.add_constructor([param('ns3::ByteTagList const &', 'o')]) ## byte-tag-list.h (module 'network'): ns3::TagBuffer ns3::ByteTagList::Add(ns3::TypeId tid, uint32_t bufferSize, int32_t start, int32_t end) [member function] cls.add_method('Add', 'ns3::TagBuffer', [param('ns3::TypeId', 'tid'), param('uint32_t', 'bufferSize'), param('int32_t', 'start'), param('int32_t', 'end')]) ## byte-tag-list.h (module 'network'): void ns3::ByteTagList::Add(ns3::ByteTagList const & o) [member function] cls.add_method('Add', 'void', [param('ns3::ByteTagList const &', 'o')]) ## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtEnd(int32_t adjustment, int32_t appendOffset) [member function] cls.add_method('AddAtEnd', 'void', [param('int32_t', 'adjustment'), param('int32_t', 'appendOffset')]) ## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtStart(int32_t adjustment, int32_t prependOffset) [member function] cls.add_method('AddAtStart', 'void', [param('int32_t', 'adjustment'), param('int32_t', 'prependOffset')]) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator ns3::ByteTagList::Begin(int32_t offsetStart, int32_t offsetEnd) const [member function] cls.add_method('Begin', 'ns3::ByteTagList::Iterator', [param('int32_t', 'offsetStart'), param('int32_t', 'offsetEnd')], is_const=True) ## byte-tag-list.h (module 'network'): void ns3::ByteTagList::RemoveAll() [member function] cls.add_method('RemoveAll', 'void', []) return def register_Ns3ByteTagListIterator_methods(root_module, cls): ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Iterator(ns3::ByteTagList::Iterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::ByteTagList::Iterator const &', 'arg0')]) ## byte-tag-list.h (module 'network'): uint32_t ns3::ByteTagList::Iterator::GetOffsetStart() const [member function] cls.add_method('GetOffsetStart', 'uint32_t', [], is_const=True) ## byte-tag-list.h (module 'network'): bool ns3::ByteTagList::Iterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item ns3::ByteTagList::Iterator::Next() [member function] cls.add_method('Next', 'ns3::ByteTagList::Iterator::Item', []) return def register_Ns3ByteTagListIteratorItem_methods(root_module, cls): ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::ByteTagList::Iterator::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::ByteTagList::Iterator::Item const &', 'arg0')]) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::TagBuffer buf) [constructor] cls.add_constructor([param('ns3::TagBuffer', 'buf')]) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::buf [variable] cls.add_instance_attribute('buf', 'ns3::TagBuffer', is_const=False) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::end [variable] cls.add_instance_attribute('end', 'int32_t', is_const=False) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::size [variable] cls.add_instance_attribute('size', 'uint32_t', is_const=False) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::start [variable] cls.add_instance_attribute('start', 'int32_t', is_const=False) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::tid [variable] cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) return def register_Ns3CallbackBase_methods(root_module, cls): ## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::CallbackBase const & arg0) [copy constructor] cls.add_constructor([param('ns3::CallbackBase const &', 'arg0')]) ## callback.h (module 'core'): ns3::CallbackBase::CallbackBase() [constructor] cls.add_constructor([]) ## callback.h (module 'core'): ns3::Ptr<ns3::CallbackImplBase> ns3::CallbackBase::GetImpl() const [member function] cls.add_method('GetImpl', 'ns3::Ptr< ns3::CallbackImplBase >', [], is_const=True) ## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::Ptr<ns3::CallbackImplBase> impl) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::CallbackImplBase >', 'impl')], visibility='protected') ## callback.h (module 'core'): static std::string ns3::CallbackBase::Demangle(std::string const & mangled) [member function] cls.add_method('Demangle', 'std::string', [param('std::string const &', 'mangled')], is_static=True, visibility='protected') return def register_Ns3DsrHelper_methods(root_module, cls): ## dsr-helper.h (module 'dsr'): ns3::DsrHelper::DsrHelper() [constructor] cls.add_constructor([]) ## dsr-helper.h (module 'dsr'): ns3::DsrHelper::DsrHelper(ns3::DsrHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::DsrHelper const &', 'arg0')]) ## dsr-helper.h (module 'dsr'): ns3::DsrHelper * ns3::DsrHelper::Copy() const [member function] cls.add_method('Copy', 'ns3::DsrHelper *', [], is_const=True) ## dsr-helper.h (module 'dsr'): ns3::Ptr<ns3::dsr::DsrRouting> ns3::DsrHelper::Create(ns3::Ptr<ns3::Node> node) const [member function] cls.add_method('Create', 'ns3::Ptr< ns3::dsr::DsrRouting >', [param('ns3::Ptr< ns3::Node >', 'node')], is_const=True) ## dsr-helper.h (module 'dsr'): void ns3::DsrHelper::Set(std::string name, ns3::AttributeValue const & value) [member function] cls.add_method('Set', 'void', [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) return def register_Ns3DsrMainHelper_methods(root_module, cls): ## dsr-main-helper.h (module 'dsr'): ns3::DsrMainHelper::DsrMainHelper() [constructor] cls.add_constructor([]) ## dsr-main-helper.h (module 'dsr'): ns3::DsrMainHelper::DsrMainHelper(ns3::DsrMainHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::DsrMainHelper const &', 'arg0')]) ## dsr-main-helper.h (module 'dsr'): void ns3::DsrMainHelper::Install(ns3::DsrHelper & dsrHelper, ns3::NodeContainer nodes) [member function] cls.add_method('Install', 'void', [param('ns3::DsrHelper &', 'dsrHelper'), param('ns3::NodeContainer', 'nodes')]) ## dsr-main-helper.h (module 'dsr'): void ns3::DsrMainHelper::SetDsrHelper(ns3::DsrHelper & dsrHelper) [member function] cls.add_method('SetDsrHelper', 'void', [param('ns3::DsrHelper &', 'dsrHelper')]) return def register_Ns3EventGarbageCollector_methods(root_module, cls): ## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector::EventGarbageCollector(ns3::EventGarbageCollector const & arg0) [copy constructor] cls.add_constructor([param('ns3::EventGarbageCollector const &', 'arg0')]) ## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector::EventGarbageCollector() [constructor] cls.add_constructor([]) ## event-garbage-collector.h (module 'core'): void ns3::EventGarbageCollector::Track(ns3::EventId event) [member function] cls.add_method('Track', 'void', [param('ns3::EventId', 'event')]) return def register_Ns3EventId_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('==') ## event-id.h (module 'core'): ns3::EventId::EventId(ns3::EventId const & arg0) [copy constructor] cls.add_constructor([param('ns3::EventId const &', 'arg0')]) ## event-id.h (module 'core'): ns3::EventId::EventId() [constructor] cls.add_constructor([]) ## event-id.h (module 'core'): ns3::EventId::EventId(ns3::Ptr<ns3::EventImpl> const & impl, uint64_t ts, uint32_t context, uint32_t uid) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::EventImpl > const &', 'impl'), param('uint64_t', 'ts'), param('uint32_t', 'context'), param('uint32_t', 'uid')]) ## event-id.h (module 'core'): void ns3::EventId::Cancel() [member function] cls.add_method('Cancel', 'void', []) ## event-id.h (module 'core'): uint32_t ns3::EventId::GetContext() const [member function] cls.add_method('GetContext', 'uint32_t', [], is_const=True) ## event-id.h (module 'core'): uint64_t ns3::EventId::GetTs() const [member function] cls.add_method('GetTs', 'uint64_t', [], is_const=True) ## event-id.h (module 'core'): uint32_t ns3::EventId::GetUid() const [member function] cls.add_method('GetUid', 'uint32_t', [], is_const=True) ## event-id.h (module 'core'): bool ns3::EventId::IsExpired() const [member function] cls.add_method('IsExpired', 'bool', [], is_const=True) ## event-id.h (module 'core'): bool ns3::EventId::IsRunning() const [member function] cls.add_method('IsRunning', 'bool', [], is_const=True) ## event-id.h (module 'core'): ns3::EventImpl * ns3::EventId::PeekEventImpl() const [member function] cls.add_method('PeekEventImpl', 'ns3::EventImpl *', [], is_const=True) return def register_Ns3Hasher_methods(root_module, cls): ## hash.h (module 'core'): ns3::Hasher::Hasher(ns3::Hasher const & arg0) [copy constructor] cls.add_constructor([param('ns3::Hasher const &', 'arg0')]) ## hash.h (module 'core'): ns3::Hasher::Hasher() [constructor] cls.add_constructor([]) ## hash.h (module 'core'): ns3::Hasher::Hasher(ns3::Ptr<ns3::Hash::Implementation> hp) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Hash::Implementation >', 'hp')]) ## hash.h (module 'core'): uint32_t ns3::Hasher::GetHash32(char const * buffer, size_t const size) [member function] cls.add_method('GetHash32', 'uint32_t', [param('char const *', 'buffer'), param('size_t const', 'size')]) ## hash.h (module 'core'): uint32_t ns3::Hasher::GetHash32(std::string const s) [member function] cls.add_method('GetHash32', 'uint32_t', [param('std::string const', 's')]) ## hash.h (module 'core'): uint64_t ns3::Hasher::GetHash64(char const * buffer, size_t const size) [member function] cls.add_method('GetHash64', 'uint64_t', [param('char const *', 'buffer'), param('size_t const', 'size')]) ## hash.h (module 'core'): uint64_t ns3::Hasher::GetHash64(std::string const s) [member function] cls.add_method('GetHash64', 'uint64_t', [param('std::string const', 's')]) ## hash.h (module 'core'): ns3::Hasher & ns3::Hasher::clear() [member function] cls.add_method('clear', 'ns3::Hasher &', []) return def register_Ns3Inet6SocketAddress_methods(root_module, cls): ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Inet6SocketAddress const & arg0) [copy constructor] cls.add_constructor([param('ns3::Inet6SocketAddress const &', 'arg0')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6, uint16_t port) [constructor] cls.add_constructor([param('ns3::Ipv6Address', 'ipv6'), param('uint16_t', 'port')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6) [constructor] cls.add_constructor([param('ns3::Ipv6Address', 'ipv6')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(uint16_t port) [constructor] cls.add_constructor([param('uint16_t', 'port')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6, uint16_t port) [constructor] cls.add_constructor([param('char const *', 'ipv6'), param('uint16_t', 'port')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6) [constructor] cls.add_constructor([param('char const *', 'ipv6')]) ## inet6-socket-address.h (module 'network'): static ns3::Inet6SocketAddress ns3::Inet6SocketAddress::ConvertFrom(ns3::Address const & addr) [member function] cls.add_method('ConvertFrom', 'ns3::Inet6SocketAddress', [param('ns3::Address const &', 'addr')], is_static=True) ## inet6-socket-address.h (module 'network'): ns3::Ipv6Address ns3::Inet6SocketAddress::GetIpv6() const [member function] cls.add_method('GetIpv6', 'ns3::Ipv6Address', [], is_const=True) ## inet6-socket-address.h (module 'network'): uint16_t ns3::Inet6SocketAddress::GetPort() const [member function] cls.add_method('GetPort', 'uint16_t', [], is_const=True) ## inet6-socket-address.h (module 'network'): static bool ns3::Inet6SocketAddress::IsMatchingType(ns3::Address const & addr) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'addr')], is_static=True) ## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetIpv6(ns3::Ipv6Address ipv6) [member function] cls.add_method('SetIpv6', 'void', [param('ns3::Ipv6Address', 'ipv6')]) ## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetPort(uint16_t port) [member function] cls.add_method('SetPort', 'void', [param('uint16_t', 'port')]) return def register_Ns3InetSocketAddress_methods(root_module, cls): ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::InetSocketAddress const & arg0) [copy constructor] cls.add_constructor([param('ns3::InetSocketAddress const &', 'arg0')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4, uint16_t port) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ipv4'), param('uint16_t', 'port')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ipv4')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(uint16_t port) [constructor] cls.add_constructor([param('uint16_t', 'port')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4, uint16_t port) [constructor] cls.add_constructor([param('char const *', 'ipv4'), param('uint16_t', 'port')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4) [constructor] cls.add_constructor([param('char const *', 'ipv4')]) ## inet-socket-address.h (module 'network'): static ns3::InetSocketAddress ns3::InetSocketAddress::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::InetSocketAddress', [param('ns3::Address const &', 'address')], is_static=True) ## inet-socket-address.h (module 'network'): ns3::Ipv4Address ns3::InetSocketAddress::GetIpv4() const [member function] cls.add_method('GetIpv4', 'ns3::Ipv4Address', [], is_const=True) ## inet-socket-address.h (module 'network'): uint16_t ns3::InetSocketAddress::GetPort() const [member function] cls.add_method('GetPort', 'uint16_t', [], is_const=True) ## inet-socket-address.h (module 'network'): static bool ns3::InetSocketAddress::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) ## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetIpv4(ns3::Ipv4Address address) [member function] cls.add_method('SetIpv4', 'void', [param('ns3::Ipv4Address', 'address')]) ## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetPort(uint16_t port) [member function] cls.add_method('SetPort', 'void', [param('uint16_t', 'port')]) return def register_Ns3IntToType__0_methods(root_module, cls): ## int-to-type.h (module 'core'): ns3::IntToType<0>::IntToType() [constructor] cls.add_constructor([]) ## int-to-type.h (module 'core'): ns3::IntToType<0>::IntToType(ns3::IntToType<0> const & arg0) [copy constructor] cls.add_constructor([param('ns3::IntToType< 0 > const &', 'arg0')]) return def register_Ns3IntToType__1_methods(root_module, cls): ## int-to-type.h (module 'core'): ns3::IntToType<1>::IntToType() [constructor] cls.add_constructor([]) ## int-to-type.h (module 'core'): ns3::IntToType<1>::IntToType(ns3::IntToType<1> const & arg0) [copy constructor] cls.add_constructor([param('ns3::IntToType< 1 > const &', 'arg0')]) return def register_Ns3IntToType__2_methods(root_module, cls): ## int-to-type.h (module 'core'): ns3::IntToType<2>::IntToType() [constructor] cls.add_constructor([]) ## int-to-type.h (module 'core'): ns3::IntToType<2>::IntToType(ns3::IntToType<2> const & arg0) [copy constructor] cls.add_constructor([param('ns3::IntToType< 2 > const &', 'arg0')]) return def register_Ns3IntToType__3_methods(root_module, cls): ## int-to-type.h (module 'core'): ns3::IntToType<3>::IntToType() [constructor] cls.add_constructor([]) ## int-to-type.h (module 'core'): ns3::IntToType<3>::IntToType(ns3::IntToType<3> const & arg0) [copy constructor] cls.add_constructor([param('ns3::IntToType< 3 > const &', 'arg0')]) return def register_Ns3IntToType__4_methods(root_module, cls): ## int-to-type.h (module 'core'): ns3::IntToType<4>::IntToType() [constructor] cls.add_constructor([]) ## int-to-type.h (module 'core'): ns3::IntToType<4>::IntToType(ns3::IntToType<4> const & arg0) [copy constructor] cls.add_constructor([param('ns3::IntToType< 4 > const &', 'arg0')]) return def register_Ns3IntToType__5_methods(root_module, cls): ## int-to-type.h (module 'core'): ns3::IntToType<5>::IntToType() [constructor] cls.add_constructor([]) ## int-to-type.h (module 'core'): ns3::IntToType<5>::IntToType(ns3::IntToType<5> const & arg0) [copy constructor] cls.add_constructor([param('ns3::IntToType< 5 > const &', 'arg0')]) return def register_Ns3IntToType__6_methods(root_module, cls): ## int-to-type.h (module 'core'): ns3::IntToType<6>::IntToType() [constructor] cls.add_constructor([]) ## int-to-type.h (module 'core'): ns3::IntToType<6>::IntToType(ns3::IntToType<6> const & arg0) [copy constructor] cls.add_constructor([param('ns3::IntToType< 6 > const &', 'arg0')]) return def register_Ns3Ipv4Address_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('<') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(ns3::Ipv4Address const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4Address const &', 'arg0')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(uint32_t address) [constructor] cls.add_constructor([param('uint32_t', 'address')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(char const * address) [constructor] cls.add_constructor([param('char const *', 'address')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::CombineMask(ns3::Ipv4Mask const & mask) const [member function] cls.add_method('CombineMask', 'ns3::Ipv4Address', [param('ns3::Ipv4Mask const &', 'mask')], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::Ipv4Address', [param('ns3::Address const &', 'address')], is_static=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::Deserialize(uint8_t const * buf) [member function] cls.add_method('Deserialize', 'ns3::Ipv4Address', [param('uint8_t const *', 'buf')], is_static=True) ## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function] cls.add_method('Get', 'uint32_t', [], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function] cls.add_method('GetAny', 'ns3::Ipv4Address', [], is_static=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetBroadcast() [member function] cls.add_method('GetBroadcast', 'ns3::Ipv4Address', [], is_static=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetLoopback() [member function] cls.add_method('GetLoopback', 'ns3::Ipv4Address', [], is_static=True) ## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::GetSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function] cls.add_method('GetSubnetDirectedBroadcast', 'ns3::Ipv4Address', [param('ns3::Ipv4Mask const &', 'mask')], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetZero() [member function] cls.add_method('GetZero', 'ns3::Ipv4Address', [], is_static=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', [], is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsEqual(ns3::Ipv4Address const & other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ipv4Address const &', 'other')], is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalMulticast() const [member function] cls.add_method('IsLocalMulticast', 'bool', [], is_const=True) ## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsMulticast() const [member function] cls.add_method('IsMulticast', 'bool', [], is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function] cls.add_method('IsSubnetDirectedBroadcast', 'bool', [param('ns3::Ipv4Mask const &', 'mask')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Serialize(uint8_t * buf) const [member function] cls.add_method('Serialize', 'void', [param('uint8_t *', 'buf')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(uint32_t address) [member function] cls.add_method('Set', 'void', [param('uint32_t', 'address')]) ## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(char const * address) [member function] cls.add_method('Set', 'void', [param('char const *', 'address')]) return def register_Ns3Ipv4InterfaceAddress_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress() [constructor] cls.add_constructor([]) ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress(ns3::Ipv4Address local, ns3::Ipv4Mask mask) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'local'), param('ns3::Ipv4Mask', 'mask')]) ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress(ns3::Ipv4InterfaceAddress const & o) [copy constructor] cls.add_constructor([param('ns3::Ipv4InterfaceAddress const &', 'o')]) ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetBroadcast() const [member function] cls.add_method('GetBroadcast', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetLocal() const [member function] cls.add_method('GetLocal', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Mask ns3::Ipv4InterfaceAddress::GetMask() const [member function] cls.add_method('GetMask', 'ns3::Ipv4Mask', [], is_const=True) ## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e ns3::Ipv4InterfaceAddress::GetScope() const [member function] cls.add_method('GetScope', 'ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', [], is_const=True) ## ipv4-interface-address.h (module 'internet'): bool ns3::Ipv4InterfaceAddress::IsSecondary() const [member function] cls.add_method('IsSecondary', 'bool', [], is_const=True) ## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetBroadcast(ns3::Ipv4Address broadcast) [member function] cls.add_method('SetBroadcast', 'void', [param('ns3::Ipv4Address', 'broadcast')]) ## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetLocal(ns3::Ipv4Address local) [member function] cls.add_method('SetLocal', 'void', [param('ns3::Ipv4Address', 'local')]) ## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetMask(ns3::Ipv4Mask mask) [member function] cls.add_method('SetMask', 'void', [param('ns3::Ipv4Mask', 'mask')]) ## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetPrimary() [member function] cls.add_method('SetPrimary', 'void', []) ## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetScope(ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function] cls.add_method('SetScope', 'void', [param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')]) ## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetSecondary() [member function] cls.add_method('SetSecondary', 'void', []) return def register_Ns3Ipv4Mask_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(ns3::Ipv4Mask const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4Mask const &', 'arg0')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(uint32_t mask) [constructor] cls.add_constructor([param('uint32_t', 'mask')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(char const * mask) [constructor] cls.add_constructor([param('char const *', 'mask')]) ## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::Get() const [member function] cls.add_method('Get', 'uint32_t', [], is_const=True) ## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::GetInverse() const [member function] cls.add_method('GetInverse', 'uint32_t', [], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetLoopback() [member function] cls.add_method('GetLoopback', 'ns3::Ipv4Mask', [], is_static=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetOnes() [member function] cls.add_method('GetOnes', 'ns3::Ipv4Mask', [], is_static=True) ## ipv4-address.h (module 'network'): uint16_t ns3::Ipv4Mask::GetPrefixLength() const [member function] cls.add_method('GetPrefixLength', 'uint16_t', [], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetZero() [member function] cls.add_method('GetZero', 'ns3::Ipv4Mask', [], is_static=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsEqual(ns3::Ipv4Mask other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ipv4Mask', 'other')], is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsMatch(ns3::Ipv4Address a, ns3::Ipv4Address b) const [member function] cls.add_method('IsMatch', 'bool', [param('ns3::Ipv4Address', 'a'), param('ns3::Ipv4Address', 'b')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Set(uint32_t mask) [member function] cls.add_method('Set', 'void', [param('uint32_t', 'mask')]) return def register_Ns3Ipv6Address_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('<') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(char const * address) [constructor] cls.add_constructor([param('char const *', 'address')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(uint8_t * address) [constructor] cls.add_constructor([param('uint8_t *', 'address')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const & addr) [copy constructor] cls.add_constructor([param('ns3::Ipv6Address const &', 'addr')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const * addr) [constructor] cls.add_constructor([param('ns3::Ipv6Address const *', 'addr')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6Address::CombinePrefix(ns3::Ipv6Prefix const & prefix) [member function] cls.add_method('CombinePrefix', 'ns3::Ipv6Address', [param('ns3::Ipv6Prefix const &', 'prefix')]) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::Ipv6Address', [param('ns3::Address const &', 'address')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::Deserialize(uint8_t const * buf) [member function] cls.add_method('Deserialize', 'ns3::Ipv6Address', [param('uint8_t const *', 'buf')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllHostsMulticast() [member function] cls.add_method('GetAllHostsMulticast', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllNodesMulticast() [member function] cls.add_method('GetAllNodesMulticast', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllRoutersMulticast() [member function] cls.add_method('GetAllRoutersMulticast', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAny() [member function] cls.add_method('GetAny', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::GetBytes(uint8_t * buf) const [member function] cls.add_method('GetBytes', 'void', [param('uint8_t *', 'buf')], is_const=True) ## ipv6-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv6Address::GetIpv4MappedAddress() const [member function] cls.add_method('GetIpv4MappedAddress', 'ns3::Ipv4Address', [], is_const=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetLoopback() [member function] cls.add_method('GetLoopback', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetOnes() [member function] cls.add_method('GetOnes', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetZero() [member function] cls.add_method('GetZero', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllHostsMulticast() const [member function] cls.add_method('IsAllHostsMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllNodesMulticast() const [member function] cls.add_method('IsAllNodesMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllRoutersMulticast() const [member function] cls.add_method('IsAllRoutersMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAny() const [member function] cls.add_method('IsAny', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsDocumentation() const [member function] cls.add_method('IsDocumentation', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsEqual(ns3::Ipv6Address const & other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ipv6Address const &', 'other')], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsIpv4MappedAddress() [member function] cls.add_method('IsIpv4MappedAddress', 'bool', []) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocal() const [member function] cls.add_method('IsLinkLocal', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocalMulticast() const [member function] cls.add_method('IsLinkLocalMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLocalhost() const [member function] cls.add_method('IsLocalhost', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): static bool ns3::Ipv6Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsMulticast() const [member function] cls.add_method('IsMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsSolicitedMulticast() const [member function] cls.add_method('IsSolicitedMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac16Address addr, ns3::Ipv6Address prefix) [member function] cls.add_method('MakeAutoconfiguredAddress', 'ns3::Ipv6Address', [param('ns3::Mac16Address', 'addr'), param('ns3::Ipv6Address', 'prefix')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac48Address addr, ns3::Ipv6Address prefix) [member function] cls.add_method('MakeAutoconfiguredAddress', 'ns3::Ipv6Address', [param('ns3::Mac48Address', 'addr'), param('ns3::Ipv6Address', 'prefix')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac64Address addr, ns3::Ipv6Address prefix) [member function] cls.add_method('MakeAutoconfiguredAddress', 'ns3::Ipv6Address', [param('ns3::Mac64Address', 'addr'), param('ns3::Ipv6Address', 'prefix')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac16Address mac) [member function] cls.add_method('MakeAutoconfiguredLinkLocalAddress', 'ns3::Ipv6Address', [param('ns3::Mac16Address', 'mac')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac48Address mac) [member function] cls.add_method('MakeAutoconfiguredLinkLocalAddress', 'ns3::Ipv6Address', [param('ns3::Mac48Address', 'mac')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac64Address mac) [member function] cls.add_method('MakeAutoconfiguredLinkLocalAddress', 'ns3::Ipv6Address', [param('ns3::Mac64Address', 'mac')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeIpv4MappedAddress(ns3::Ipv4Address addr) [member function] cls.add_method('MakeIpv4MappedAddress', 'ns3::Ipv6Address', [param('ns3::Ipv4Address', 'addr')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeSolicitedAddress(ns3::Ipv6Address addr) [member function] cls.add_method('MakeSolicitedAddress', 'ns3::Ipv6Address', [param('ns3::Ipv6Address', 'addr')], is_static=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Serialize(uint8_t * buf) const [member function] cls.add_method('Serialize', 'void', [param('uint8_t *', 'buf')], is_const=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(char const * address) [member function] cls.add_method('Set', 'void', [param('char const *', 'address')]) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(uint8_t * address) [member function] cls.add_method('Set', 'void', [param('uint8_t *', 'address')]) return def register_Ns3Ipv6InterfaceAddress_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress() [constructor] cls.add_constructor([]) ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress(ns3::Ipv6Address address) [constructor] cls.add_constructor([param('ns3::Ipv6Address', 'address')]) ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress(ns3::Ipv6Address address, ns3::Ipv6Prefix prefix) [constructor] cls.add_constructor([param('ns3::Ipv6Address', 'address'), param('ns3::Ipv6Prefix', 'prefix')]) ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress::Ipv6InterfaceAddress(ns3::Ipv6InterfaceAddress const & o) [copy constructor] cls.add_constructor([param('ns3::Ipv6InterfaceAddress const &', 'o')]) ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6Address ns3::Ipv6InterfaceAddress::GetAddress() const [member function] cls.add_method('GetAddress', 'ns3::Ipv6Address', [], is_const=True) ## ipv6-interface-address.h (module 'internet'): uint32_t ns3::Ipv6InterfaceAddress::GetNsDadUid() const [member function] cls.add_method('GetNsDadUid', 'uint32_t', [], is_const=True) ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6Prefix ns3::Ipv6InterfaceAddress::GetPrefix() const [member function] cls.add_method('GetPrefix', 'ns3::Ipv6Prefix', [], is_const=True) ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress::Scope_e ns3::Ipv6InterfaceAddress::GetScope() const [member function] cls.add_method('GetScope', 'ns3::Ipv6InterfaceAddress::Scope_e', [], is_const=True) ## ipv6-interface-address.h (module 'internet'): ns3::Ipv6InterfaceAddress::State_e ns3::Ipv6InterfaceAddress::GetState() const [member function] cls.add_method('GetState', 'ns3::Ipv6InterfaceAddress::State_e', [], is_const=True) ## ipv6-interface-address.h (module 'internet'): void ns3::Ipv6InterfaceAddress::SetAddress(ns3::Ipv6Address address) [member function] cls.add_method('SetAddress', 'void', [param('ns3::Ipv6Address', 'address')]) ## ipv6-interface-address.h (module 'internet'): void ns3::Ipv6InterfaceAddress::SetNsDadUid(uint32_t uid) [member function] cls.add_method('SetNsDadUid', 'void', [param('uint32_t', 'uid')]) ## ipv6-interface-address.h (module 'internet'): void ns3::Ipv6InterfaceAddress::SetScope(ns3::Ipv6InterfaceAddress::Scope_e scope) [member function] cls.add_method('SetScope', 'void', [param('ns3::Ipv6InterfaceAddress::Scope_e', 'scope')]) ## ipv6-interface-address.h (module 'internet'): void ns3::Ipv6InterfaceAddress::SetState(ns3::Ipv6InterfaceAddress::State_e state) [member function] cls.add_method('SetState', 'void', [param('ns3::Ipv6InterfaceAddress::State_e', 'state')]) return def register_Ns3Ipv6Prefix_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t * prefix) [constructor] cls.add_constructor([param('uint8_t *', 'prefix')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(char const * prefix) [constructor] cls.add_constructor([param('char const *', 'prefix')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t prefix) [constructor] cls.add_constructor([param('uint8_t', 'prefix')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const & prefix) [copy constructor] cls.add_constructor([param('ns3::Ipv6Prefix const &', 'prefix')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const * prefix) [constructor] cls.add_constructor([param('ns3::Ipv6Prefix const *', 'prefix')]) ## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::GetBytes(uint8_t * buf) const [member function] cls.add_method('GetBytes', 'void', [param('uint8_t *', 'buf')], is_const=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetLoopback() [member function] cls.add_method('GetLoopback', 'ns3::Ipv6Prefix', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetOnes() [member function] cls.add_method('GetOnes', 'ns3::Ipv6Prefix', [], is_static=True) ## ipv6-address.h (module 'network'): uint8_t ns3::Ipv6Prefix::GetPrefixLength() const [member function] cls.add_method('GetPrefixLength', 'uint8_t', [], is_const=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetZero() [member function] cls.add_method('GetZero', 'ns3::Ipv6Prefix', [], is_static=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsEqual(ns3::Ipv6Prefix const & other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ipv6Prefix const &', 'other')], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsMatch(ns3::Ipv6Address a, ns3::Ipv6Address b) const [member function] cls.add_method('IsMatch', 'bool', [param('ns3::Ipv6Address', 'a'), param('ns3::Ipv6Address', 'b')], is_const=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) return def register_Ns3Mac48Address_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('<') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(ns3::Mac48Address const & arg0) [copy constructor] cls.add_constructor([param('ns3::Mac48Address const &', 'arg0')]) ## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address() [constructor] cls.add_constructor([]) ## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(char const * str) [constructor] cls.add_constructor([param('char const *', 'str')]) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::Allocate() [member function] cls.add_method('Allocate', 'ns3::Mac48Address', [], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::Mac48Address', [param('ns3::Address const &', 'address')], is_static=True) ## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyFrom(uint8_t const * buffer) [member function] cls.add_method('CopyFrom', 'void', [param('uint8_t const *', 'buffer')]) ## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyTo(uint8_t * buffer) const [member function] cls.add_method('CopyTo', 'void', [param('uint8_t *', 'buffer')], is_const=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetBroadcast() [member function] cls.add_method('GetBroadcast', 'ns3::Mac48Address', [], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv4Address address) [member function] cls.add_method('GetMulticast', 'ns3::Mac48Address', [param('ns3::Ipv4Address', 'address')], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv6Address address) [member function] cls.add_method('GetMulticast', 'ns3::Mac48Address', [param('ns3::Ipv6Address', 'address')], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast6Prefix() [member function] cls.add_method('GetMulticast6Prefix', 'ns3::Mac48Address', [], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticastPrefix() [member function] cls.add_method('GetMulticastPrefix', 'ns3::Mac48Address', [], is_static=True) ## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', [], is_const=True) ## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsGroup() const [member function] cls.add_method('IsGroup', 'bool', [], is_const=True) ## mac48-address.h (module 'network'): static bool ns3::Mac48Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) return def register_Ns3NodeContainer_methods(root_module, cls): ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & arg0) [copy constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'arg0')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer() [constructor] cls.add_constructor([]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::Ptr<ns3::Node> node) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'node')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(std::string nodeName) [constructor] cls.add_constructor([param('std::string', 'nodeName')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b) [constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c) [constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d) [constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d, ns3::NodeContainer const & e) [constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd'), param('ns3::NodeContainer const &', 'e')]) ## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::NodeContainer other) [member function] cls.add_method('Add', 'void', [param('ns3::NodeContainer', 'other')]) ## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## node-container.h (module 'network'): void ns3::NodeContainer::Add(std::string nodeName) [member function] cls.add_method('Add', 'void', [param('std::string', 'nodeName')]) ## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::Begin() const [member function] cls.add_method('Begin', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', [], is_const=True) ## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n) [member function] cls.add_method('Create', 'void', [param('uint32_t', 'n')]) ## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n, uint32_t systemId) [member function] cls.add_method('Create', 'void', [param('uint32_t', 'n'), param('uint32_t', 'systemId')]) ## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::End() const [member function] cls.add_method('End', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', [], is_const=True) ## node-container.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NodeContainer::Get(uint32_t i) const [member function] cls.add_method('Get', 'ns3::Ptr< ns3::Node >', [param('uint32_t', 'i')], is_const=True) ## node-container.h (module 'network'): static ns3::NodeContainer ns3::NodeContainer::GetGlobal() [member function] cls.add_method('GetGlobal', 'ns3::NodeContainer', [], is_static=True) ## node-container.h (module 'network'): uint32_t ns3::NodeContainer::GetN() const [member function] cls.add_method('GetN', 'uint32_t', [], is_const=True) return def register_Ns3ObjectBase_methods(root_module, cls): ## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase() [constructor] cls.add_constructor([]) ## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase(ns3::ObjectBase const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectBase const &', 'arg0')]) ## object-base.h (module 'core'): void ns3::ObjectBase::GetAttribute(std::string name, ns3::AttributeValue & value) const [member function] cls.add_method('GetAttribute', 'void', [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], is_const=True) ## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & attribute) const [member function] cls.add_method('GetAttributeFailSafe', 'bool', [param('std::string', 'name'), param('ns3::AttributeValue &', 'attribute')], is_const=True) ## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## object-base.h (module 'core'): static ns3::TypeId ns3::ObjectBase::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## object-base.h (module 'core'): void ns3::ObjectBase::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] cls.add_method('SetAttribute', 'void', [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::SetAttributeFailSafe(std::string name, ns3::AttributeValue const & value) [member function] cls.add_method('SetAttributeFailSafe', 'bool', [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function] cls.add_method('TraceConnect', 'bool', [param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function] cls.add_method('TraceConnectWithoutContext', 'bool', [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function] cls.add_method('TraceDisconnect', 'bool', [param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function] cls.add_method('TraceDisconnectWithoutContext', 'bool', [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) ## object-base.h (module 'core'): void ns3::ObjectBase::ConstructSelf(ns3::AttributeConstructionList const & attributes) [member function] cls.add_method('ConstructSelf', 'void', [param('ns3::AttributeConstructionList const &', 'attributes')], visibility='protected') ## object-base.h (module 'core'): void ns3::ObjectBase::NotifyConstructionCompleted() [member function] cls.add_method('NotifyConstructionCompleted', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3ObjectDeleter_methods(root_module, cls): ## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter() [constructor] cls.add_constructor([]) ## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter(ns3::ObjectDeleter const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectDeleter const &', 'arg0')]) ## object.h (module 'core'): static void ns3::ObjectDeleter::Delete(ns3::Object * object) [member function] cls.add_method('Delete', 'void', [param('ns3::Object *', 'object')], is_static=True) return def register_Ns3ObjectFactory_methods(root_module, cls): cls.add_output_stream_operator() ## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(ns3::ObjectFactory const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectFactory const &', 'arg0')]) ## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory() [constructor] cls.add_constructor([]) ## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(std::string typeId) [constructor] cls.add_constructor([param('std::string', 'typeId')]) ## object-factory.h (module 'core'): ns3::Ptr<ns3::Object> ns3::ObjectFactory::Create() const [member function] cls.add_method('Create', 'ns3::Ptr< ns3::Object >', [], is_const=True) ## object-factory.h (module 'core'): ns3::TypeId ns3::ObjectFactory::GetTypeId() const [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_const=True) ## object-factory.h (module 'core'): void ns3::ObjectFactory::Set(std::string name, ns3::AttributeValue const & value) [member function] cls.add_method('Set', 'void', [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) ## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(ns3::TypeId tid) [member function] cls.add_method('SetTypeId', 'void', [param('ns3::TypeId', 'tid')]) ## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(char const * tid) [member function] cls.add_method('SetTypeId', 'void', [param('char const *', 'tid')]) ## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(std::string tid) [member function] cls.add_method('SetTypeId', 'void', [param('std::string', 'tid')]) return def register_Ns3PacketMetadata_methods(root_module, cls): ## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(uint64_t uid, uint32_t size) [constructor] cls.add_constructor([param('uint64_t', 'uid'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(ns3::PacketMetadata const & o) [copy constructor] cls.add_constructor([param('ns3::PacketMetadata const &', 'o')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddAtEnd(ns3::PacketMetadata const & o) [member function] cls.add_method('AddAtEnd', 'void', [param('ns3::PacketMetadata const &', 'o')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddHeader(ns3::Header const & header, uint32_t size) [member function] cls.add_method('AddHeader', 'void', [param('ns3::Header const &', 'header'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddPaddingAtEnd(uint32_t end) [member function] cls.add_method('AddPaddingAtEnd', 'void', [param('uint32_t', 'end')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddTrailer(ns3::Trailer const & trailer, uint32_t size) [member function] cls.add_method('AddTrailer', 'void', [param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::PacketMetadata::BeginItem(ns3::Buffer buffer) const [member function] cls.add_method('BeginItem', 'ns3::PacketMetadata::ItemIterator', [param('ns3::Buffer', 'buffer')], is_const=True) ## packet-metadata.h (module 'network'): ns3::PacketMetadata ns3::PacketMetadata::CreateFragment(uint32_t start, uint32_t end) const [member function] cls.add_method('CreateFragment', 'ns3::PacketMetadata', [param('uint32_t', 'start'), param('uint32_t', 'end')], is_const=True) ## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Deserialize(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('Deserialize', 'uint32_t', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::Enable() [member function] cls.add_method('Enable', 'void', [], is_static=True) ## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::EnableChecking() [member function] cls.add_method('EnableChecking', 'void', [], is_static=True) ## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packet-metadata.h (module 'network'): uint64_t ns3::PacketMetadata::GetUid() const [member function] cls.add_method('GetUid', 'uint64_t', [], is_const=True) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtEnd(uint32_t end) [member function] cls.add_method('RemoveAtEnd', 'void', [param('uint32_t', 'end')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtStart(uint32_t start) [member function] cls.add_method('RemoveAtStart', 'void', [param('uint32_t', 'start')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveHeader(ns3::Header const & header, uint32_t size) [member function] cls.add_method('RemoveHeader', 'void', [param('ns3::Header const &', 'header'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveTrailer(ns3::Trailer const & trailer, uint32_t size) [member function] cls.add_method('RemoveTrailer', 'void', [param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function] cls.add_method('Serialize', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], is_const=True) return def register_Ns3PacketMetadataItem_methods(root_module, cls): ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item() [constructor] cls.add_constructor([]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item(ns3::PacketMetadata::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketMetadata::Item const &', 'arg0')]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::current [variable] cls.add_instance_attribute('current', 'ns3::Buffer::Iterator', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentSize [variable] cls.add_instance_attribute('currentSize', 'uint32_t', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromEnd [variable] cls.add_instance_attribute('currentTrimedFromEnd', 'uint32_t', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromStart [variable] cls.add_instance_attribute('currentTrimedFromStart', 'uint32_t', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::isFragment [variable] cls.add_instance_attribute('isFragment', 'bool', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::tid [variable] cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) return def register_Ns3PacketMetadataItemIterator_methods(root_module, cls): ## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata::ItemIterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketMetadata::ItemIterator const &', 'arg0')]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata const * metadata, ns3::Buffer buffer) [constructor] cls.add_constructor([param('ns3::PacketMetadata const *', 'metadata'), param('ns3::Buffer', 'buffer')]) ## packet-metadata.h (module 'network'): bool ns3::PacketMetadata::ItemIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item ns3::PacketMetadata::ItemIterator::Next() [member function] cls.add_method('Next', 'ns3::PacketMetadata::Item', []) return def register_Ns3PacketTagIterator_methods(root_module, cls): ## packet.h (module 'network'): ns3::PacketTagIterator::PacketTagIterator(ns3::PacketTagIterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketTagIterator const &', 'arg0')]) ## packet.h (module 'network'): bool ns3::PacketTagIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## packet.h (module 'network'): ns3::PacketTagIterator::Item ns3::PacketTagIterator::Next() [member function] cls.add_method('Next', 'ns3::PacketTagIterator::Item', []) return def register_Ns3PacketTagIteratorItem_methods(root_module, cls): ## packet.h (module 'network'): ns3::PacketTagIterator::Item::Item(ns3::PacketTagIterator::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketTagIterator::Item const &', 'arg0')]) ## packet.h (module 'network'): void ns3::PacketTagIterator::Item::GetTag(ns3::Tag & tag) const [member function] cls.add_method('GetTag', 'void', [param('ns3::Tag &', 'tag')], is_const=True) ## packet.h (module 'network'): ns3::TypeId ns3::PacketTagIterator::Item::GetTypeId() const [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_const=True) return def register_Ns3PacketTagList_methods(root_module, cls): ## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList() [constructor] cls.add_constructor([]) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList(ns3::PacketTagList const & o) [copy constructor] cls.add_constructor([param('ns3::PacketTagList const &', 'o')]) ## packet-tag-list.h (module 'network'): void ns3::PacketTagList::Add(ns3::Tag const & tag) const [member function] cls.add_method('Add', 'void', [param('ns3::Tag const &', 'tag')], is_const=True) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData const * ns3::PacketTagList::Head() const [member function] cls.add_method('Head', 'ns3::PacketTagList::TagData const *', [], is_const=True) ## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Peek(ns3::Tag & tag) const [member function] cls.add_method('Peek', 'bool', [param('ns3::Tag &', 'tag')], is_const=True) ## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Remove(ns3::Tag & tag) [member function] cls.add_method('Remove', 'bool', [param('ns3::Tag &', 'tag')]) ## packet-tag-list.h (module 'network'): void ns3::PacketTagList::RemoveAll() [member function] cls.add_method('RemoveAll', 'void', []) ## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Replace(ns3::Tag & tag) [member function] cls.add_method('Replace', 'bool', [param('ns3::Tag &', 'tag')]) return def register_Ns3PacketTagListTagData_methods(root_module, cls): ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData() [constructor] cls.add_constructor([]) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData(ns3::PacketTagList::TagData const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketTagList::TagData const &', 'arg0')]) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::count [variable] cls.add_instance_attribute('count', 'uint32_t', is_const=False) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::data [variable] cls.add_instance_attribute('data', 'uint8_t [ 20 ]', is_const=False) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::next [variable] cls.add_instance_attribute('next', 'ns3::PacketTagList::TagData *', is_const=False) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::tid [variable] cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) return def register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount(ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3Simulator_methods(root_module, cls): ## simulator.h (module 'core'): ns3::Simulator::Simulator(ns3::Simulator const & arg0) [copy constructor] cls.add_constructor([param('ns3::Simulator const &', 'arg0')]) ## simulator.h (module 'core'): static void ns3::Simulator::Cancel(ns3::EventId const & id) [member function] cls.add_method('Cancel', 'void', [param('ns3::EventId const &', 'id')], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::Destroy() [member function] cls.add_method('Destroy', 'void', [], is_static=True) ## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetContext() [member function] cls.add_method('GetContext', 'uint32_t', [], is_static=True) ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetDelayLeft(ns3::EventId const & id) [member function] cls.add_method('GetDelayLeft', 'ns3::Time', [param('ns3::EventId const &', 'id')], is_static=True) ## simulator.h (module 'core'): static ns3::Ptr<ns3::SimulatorImpl> ns3::Simulator::GetImplementation() [member function] cls.add_method('GetImplementation', 'ns3::Ptr< ns3::SimulatorImpl >', [], is_static=True) ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetMaximumSimulationTime() [member function] cls.add_method('GetMaximumSimulationTime', 'ns3::Time', [], is_static=True) ## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetSystemId() [member function] cls.add_method('GetSystemId', 'uint32_t', [], is_static=True) ## simulator.h (module 'core'): static bool ns3::Simulator::IsExpired(ns3::EventId const & id) [member function] cls.add_method('IsExpired', 'bool', [param('ns3::EventId const &', 'id')], is_static=True) ## simulator.h (module 'core'): static bool ns3::Simulator::IsFinished() [member function] cls.add_method('IsFinished', 'bool', [], is_static=True) ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Now() [member function] cls.add_method('Now', 'ns3::Time', [], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::Remove(ns3::EventId const & id) [member function] cls.add_method('Remove', 'void', [param('ns3::EventId const &', 'id')], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::SetImplementation(ns3::Ptr<ns3::SimulatorImpl> impl) [member function] cls.add_method('SetImplementation', 'void', [param('ns3::Ptr< ns3::SimulatorImpl >', 'impl')], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function] cls.add_method('SetScheduler', 'void', [param('ns3::ObjectFactory', 'schedulerFactory')], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::Stop() [member function] cls.add_method('Stop', 'void', [], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::Stop(ns3::Time const & time) [member function] cls.add_method('Stop', 'void', [param('ns3::Time const &', 'time')], is_static=True) return def register_Ns3SystemWallClockMs_methods(root_module, cls): ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [copy constructor] cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')]) ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs() [constructor] cls.add_constructor([]) ## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::End() [member function] cls.add_method('End', 'int64_t', []) ## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedReal() const [member function] cls.add_method('GetElapsedReal', 'int64_t', [], is_const=True) ## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedSystem() const [member function] cls.add_method('GetElapsedSystem', 'int64_t', [], is_const=True) ## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedUser() const [member function] cls.add_method('GetElapsedUser', 'int64_t', [], is_const=True) ## system-wall-clock-ms.h (module 'core'): void ns3::SystemWallClockMs::Start() [member function] cls.add_method('Start', 'void', []) return def register_Ns3Tag_methods(root_module, cls): ## tag.h (module 'network'): ns3::Tag::Tag() [constructor] cls.add_constructor([]) ## tag.h (module 'network'): ns3::Tag::Tag(ns3::Tag const & arg0) [copy constructor] cls.add_constructor([param('ns3::Tag const &', 'arg0')]) ## tag.h (module 'network'): void ns3::Tag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_pure_virtual=True, is_virtual=True) ## tag.h (module 'network'): uint32_t ns3::Tag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## tag.h (module 'network'): static ns3::TypeId ns3::Tag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## tag.h (module 'network'): void ns3::Tag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) ## tag.h (module 'network'): void ns3::Tag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3TagBuffer_methods(root_module, cls): ## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(ns3::TagBuffer const & arg0) [copy constructor] cls.add_constructor([param('ns3::TagBuffer const &', 'arg0')]) ## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(uint8_t * start, uint8_t * end) [constructor] cls.add_constructor([param('uint8_t *', 'start'), param('uint8_t *', 'end')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::CopyFrom(ns3::TagBuffer o) [member function] cls.add_method('CopyFrom', 'void', [param('ns3::TagBuffer', 'o')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::Read(uint8_t * buffer, uint32_t size) [member function] cls.add_method('Read', 'void', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')]) ## tag-buffer.h (module 'network'): double ns3::TagBuffer::ReadDouble() [member function] cls.add_method('ReadDouble', 'double', []) ## tag-buffer.h (module 'network'): uint16_t ns3::TagBuffer::ReadU16() [member function] cls.add_method('ReadU16', 'uint16_t', []) ## tag-buffer.h (module 'network'): uint32_t ns3::TagBuffer::ReadU32() [member function] cls.add_method('ReadU32', 'uint32_t', []) ## tag-buffer.h (module 'network'): uint64_t ns3::TagBuffer::ReadU64() [member function] cls.add_method('ReadU64', 'uint64_t', []) ## tag-buffer.h (module 'network'): uint8_t ns3::TagBuffer::ReadU8() [member function] cls.add_method('ReadU8', 'uint8_t', []) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::TrimAtEnd(uint32_t trim) [member function] cls.add_method('TrimAtEnd', 'void', [param('uint32_t', 'trim')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::Write(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('Write', 'void', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteDouble(double v) [member function] cls.add_method('WriteDouble', 'void', [param('double', 'v')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU16(uint16_t data) [member function] cls.add_method('WriteU16', 'void', [param('uint16_t', 'data')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU32(uint32_t data) [member function] cls.add_method('WriteU32', 'void', [param('uint32_t', 'data')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU64(uint64_t v) [member function] cls.add_method('WriteU64', 'void', [param('uint64_t', 'v')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU8(uint8_t v) [member function] cls.add_method('WriteU8', 'void', [param('uint8_t', 'v')]) return def register_Ns3Timer_methods(root_module, cls): ## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer const & arg0) [copy constructor] cls.add_constructor([param('ns3::Timer const &', 'arg0')]) ## timer.h (module 'core'): ns3::Timer::Timer() [constructor] cls.add_constructor([]) ## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer::DestroyPolicy destroyPolicy) [constructor] cls.add_constructor([param('ns3::Timer::DestroyPolicy', 'destroyPolicy')]) ## timer.h (module 'core'): void ns3::Timer::Cancel() [member function] cls.add_method('Cancel', 'void', []) ## timer.h (module 'core'): ns3::Time ns3::Timer::GetDelay() const [member function] cls.add_method('GetDelay', 'ns3::Time', [], is_const=True) ## timer.h (module 'core'): ns3::Time ns3::Timer::GetDelayLeft() const [member function] cls.add_method('GetDelayLeft', 'ns3::Time', [], is_const=True) ## timer.h (module 'core'): ns3::Timer::State ns3::Timer::GetState() const [member function] cls.add_method('GetState', 'ns3::Timer::State', [], is_const=True) ## timer.h (module 'core'): bool ns3::Timer::IsExpired() const [member function] cls.add_method('IsExpired', 'bool', [], is_const=True) ## timer.h (module 'core'): bool ns3::Timer::IsRunning() const [member function] cls.add_method('IsRunning', 'bool', [], is_const=True) ## timer.h (module 'core'): bool ns3::Timer::IsSuspended() const [member function] cls.add_method('IsSuspended', 'bool', [], is_const=True) ## timer.h (module 'core'): void ns3::Timer::Remove() [member function] cls.add_method('Remove', 'void', []) ## timer.h (module 'core'): void ns3::Timer::Resume() [member function] cls.add_method('Resume', 'void', []) ## timer.h (module 'core'): void ns3::Timer::Schedule() [member function] cls.add_method('Schedule', 'void', []) ## timer.h (module 'core'): void ns3::Timer::Schedule(ns3::Time delay) [member function] cls.add_method('Schedule', 'void', [param('ns3::Time', 'delay')]) ## timer.h (module 'core'): void ns3::Timer::SetDelay(ns3::Time const & delay) [member function] cls.add_method('SetDelay', 'void', [param('ns3::Time const &', 'delay')]) ## timer.h (module 'core'): void ns3::Timer::Suspend() [member function] cls.add_method('Suspend', 'void', []) return def register_Ns3TimerImpl_methods(root_module, cls): ## timer-impl.h (module 'core'): ns3::TimerImpl::TimerImpl() [constructor] cls.add_constructor([]) ## timer-impl.h (module 'core'): ns3::TimerImpl::TimerImpl(ns3::TimerImpl const & arg0) [copy constructor] cls.add_constructor([param('ns3::TimerImpl const &', 'arg0')]) ## timer-impl.h (module 'core'): void ns3::TimerImpl::Invoke() [member function] cls.add_method('Invoke', 'void', [], is_pure_virtual=True, is_virtual=True) ## timer-impl.h (module 'core'): ns3::EventId ns3::TimerImpl::Schedule(ns3::Time const & delay) [member function] cls.add_method('Schedule', 'ns3::EventId', [param('ns3::Time const &', 'delay')], is_pure_virtual=True, is_virtual=True) return def register_Ns3TypeId_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('<') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## type-id.h (module 'core'): ns3::TypeId::TypeId(char const * name) [constructor] cls.add_constructor([param('char const *', 'name')]) ## type-id.h (module 'core'): ns3::TypeId::TypeId() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeId::TypeId(ns3::TypeId const & o) [copy constructor] cls.add_constructor([param('ns3::TypeId const &', 'o')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr<ns3::AttributeAccessor const> accessor, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('AddAttribute', 'ns3::TypeId', [param('std::string', 'name'), param('std::string', 'help'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, uint32_t flags, ns3::AttributeValue const & initialValue, ns3::Ptr<ns3::AttributeAccessor const> accessor, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('AddAttribute', 'ns3::TypeId', [param('std::string', 'name'), param('std::string', 'help'), param('uint32_t', 'flags'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor) [member function] cls.add_method('AddTraceSource', 'ns3::TypeId', [param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')]) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(uint32_t i) const [member function] cls.add_method('GetAttribute', 'ns3::TypeId::AttributeInformation', [param('uint32_t', 'i')], is_const=True) ## type-id.h (module 'core'): std::string ns3::TypeId::GetAttributeFullName(uint32_t i) const [member function] cls.add_method('GetAttributeFullName', 'std::string', [param('uint32_t', 'i')], is_const=True) ## type-id.h (module 'core'): uint32_t ns3::TypeId::GetAttributeN() const [member function] cls.add_method('GetAttributeN', 'uint32_t', [], is_const=True) ## type-id.h (module 'core'): ns3::Callback<ns3::ObjectBase*,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::TypeId::GetConstructor() const [member function] cls.add_method('GetConstructor', 'ns3::Callback< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True) ## type-id.h (module 'core'): std::string ns3::TypeId::GetGroupName() const [member function] cls.add_method('GetGroupName', 'std::string', [], is_const=True) ## type-id.h (module 'core'): uint32_t ns3::TypeId::GetHash() const [member function] cls.add_method('GetHash', 'uint32_t', [], is_const=True) ## type-id.h (module 'core'): std::string ns3::TypeId::GetName() const [member function] cls.add_method('GetName', 'std::string', [], is_const=True) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::GetParent() const [member function] cls.add_method('GetParent', 'ns3::TypeId', [], is_const=True) ## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::GetRegistered(uint32_t i) [member function] cls.add_method('GetRegistered', 'ns3::TypeId', [param('uint32_t', 'i')], is_static=True) ## type-id.h (module 'core'): static uint32_t ns3::TypeId::GetRegisteredN() [member function] cls.add_method('GetRegisteredN', 'uint32_t', [], is_static=True) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(uint32_t i) const [member function] cls.add_method('GetTraceSource', 'ns3::TypeId::TraceSourceInformation', [param('uint32_t', 'i')], is_const=True) ## type-id.h (module 'core'): uint32_t ns3::TypeId::GetTraceSourceN() const [member function] cls.add_method('GetTraceSourceN', 'uint32_t', [], is_const=True) ## type-id.h (module 'core'): uint16_t ns3::TypeId::GetUid() const [member function] cls.add_method('GetUid', 'uint16_t', [], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::HasConstructor() const [member function] cls.add_method('HasConstructor', 'bool', [], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::HasParent() const [member function] cls.add_method('HasParent', 'bool', [], is_const=True) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::HideFromDocumentation() [member function] cls.add_method('HideFromDocumentation', 'ns3::TypeId', []) ## type-id.h (module 'core'): bool ns3::TypeId::IsChildOf(ns3::TypeId other) const [member function] cls.add_method('IsChildOf', 'bool', [param('ns3::TypeId', 'other')], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::LookupAttributeByName(std::string name, ns3::TypeId::AttributeInformation * info) const [member function] cls.add_method('LookupAttributeByName', 'bool', [param('std::string', 'name'), param('ns3::TypeId::AttributeInformation *', 'info', transfer_ownership=False)], is_const=True) ## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByHash(uint32_t hash) [member function] cls.add_method('LookupByHash', 'ns3::TypeId', [param('uint32_t', 'hash')], is_static=True) ## type-id.h (module 'core'): static bool ns3::TypeId::LookupByHashFailSafe(uint32_t hash, ns3::TypeId * tid) [member function] cls.add_method('LookupByHashFailSafe', 'bool', [param('uint32_t', 'hash'), param('ns3::TypeId *', 'tid')], is_static=True) ## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByName(std::string name) [member function] cls.add_method('LookupByName', 'ns3::TypeId', [param('std::string', 'name')], is_static=True) ## type-id.h (module 'core'): ns3::Ptr<ns3::TraceSourceAccessor const> ns3::TypeId::LookupTraceSourceByName(std::string name) const [member function] cls.add_method('LookupTraceSourceByName', 'ns3::Ptr< ns3::TraceSourceAccessor const >', [param('std::string', 'name')], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::MustHideFromDocumentation() const [member function] cls.add_method('MustHideFromDocumentation', 'bool', [], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::SetAttributeInitialValue(uint32_t i, ns3::Ptr<ns3::AttributeValue const> initialValue) [member function] cls.add_method('SetAttributeInitialValue', 'bool', [param('uint32_t', 'i'), param('ns3::Ptr< ns3::AttributeValue const >', 'initialValue')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetGroupName(std::string groupName) [member function] cls.add_method('SetGroupName', 'ns3::TypeId', [param('std::string', 'groupName')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetParent(ns3::TypeId tid) [member function] cls.add_method('SetParent', 'ns3::TypeId', [param('ns3::TypeId', 'tid')]) ## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t tid) [member function] cls.add_method('SetUid', 'void', [param('uint16_t', 'tid')]) return def register_Ns3TypeIdAttributeInformation_methods(root_module, cls): ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation(ns3::TypeId::AttributeInformation const & arg0) [copy constructor] cls.add_constructor([param('ns3::TypeId::AttributeInformation const &', 'arg0')]) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::accessor [variable] cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::AttributeAccessor const >', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::checker [variable] cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::flags [variable] cls.add_instance_attribute('flags', 'uint32_t', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::help [variable] cls.add_instance_attribute('help', 'std::string', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::initialValue [variable] cls.add_instance_attribute('initialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::name [variable] cls.add_instance_attribute('name', 'std::string', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::originalInitialValue [variable] cls.add_instance_attribute('originalInitialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False) return def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls): ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation(ns3::TypeId::TraceSourceInformation const & arg0) [copy constructor] cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')]) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable] cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable] cls.add_instance_attribute('help', 'std::string', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable] cls.add_instance_attribute('name', 'std::string', is_const=False) return def register_Ns3WifiMode_methods(root_module, cls): cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## wifi-mode.h (module 'wifi'): ns3::WifiMode::WifiMode(ns3::WifiMode const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiMode const &', 'arg0')]) ## wifi-mode.h (module 'wifi'): ns3::WifiMode::WifiMode() [constructor] cls.add_constructor([]) ## wifi-mode.h (module 'wifi'): ns3::WifiMode::WifiMode(std::string name) [constructor] cls.add_constructor([param('std::string', 'name')]) ## wifi-mode.h (module 'wifi'): uint32_t ns3::WifiMode::GetBandwidth() const [member function] cls.add_method('GetBandwidth', 'uint32_t', [], is_const=True) ## wifi-mode.h (module 'wifi'): ns3::WifiCodeRate ns3::WifiMode::GetCodeRate() const [member function] cls.add_method('GetCodeRate', 'ns3::WifiCodeRate', [], is_const=True) ## wifi-mode.h (module 'wifi'): uint8_t ns3::WifiMode::GetConstellationSize() const [member function] cls.add_method('GetConstellationSize', 'uint8_t', [], is_const=True) ## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetDataRate() const [member function] cls.add_method('GetDataRate', 'uint64_t', [], is_const=True) ## wifi-mode.h (module 'wifi'): ns3::WifiModulationClass ns3::WifiMode::GetModulationClass() const [member function] cls.add_method('GetModulationClass', 'ns3::WifiModulationClass', [], is_const=True) ## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetPhyRate() const [member function] cls.add_method('GetPhyRate', 'uint64_t', [], is_const=True) ## wifi-mode.h (module 'wifi'): uint32_t ns3::WifiMode::GetUid() const [member function] cls.add_method('GetUid', 'uint32_t', [], is_const=True) ## wifi-mode.h (module 'wifi'): std::string ns3::WifiMode::GetUniqueName() const [member function] cls.add_method('GetUniqueName', 'std::string', [], is_const=True) ## wifi-mode.h (module 'wifi'): bool ns3::WifiMode::IsMandatory() const [member function] cls.add_method('IsMandatory', 'bool', [], is_const=True) return def register_Ns3WifiModeFactory_methods(root_module, cls): ## wifi-mode.h (module 'wifi'): ns3::WifiModeFactory::WifiModeFactory(ns3::WifiModeFactory const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiModeFactory const &', 'arg0')]) ## wifi-mode.h (module 'wifi'): static ns3::WifiMode ns3::WifiModeFactory::CreateWifiMode(std::string uniqueName, ns3::WifiModulationClass modClass, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, ns3::WifiCodeRate codingRate, uint8_t constellationSize) [member function] cls.add_method('CreateWifiMode', 'ns3::WifiMode', [param('std::string', 'uniqueName'), param('ns3::WifiModulationClass', 'modClass'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('ns3::WifiCodeRate', 'codingRate'), param('uint8_t', 'constellationSize')], is_static=True) return def register_Ns3WifiPhyListener_methods(root_module, cls): ## wifi-phy.h (module 'wifi'): ns3::WifiPhyListener::WifiPhyListener() [constructor] cls.add_constructor([]) ## wifi-phy.h (module 'wifi'): ns3::WifiPhyListener::WifiPhyListener(ns3::WifiPhyListener const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiPhyListener const &', 'arg0')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyMaybeCcaBusyStart(ns3::Time duration) [member function] cls.add_method('NotifyMaybeCcaBusyStart', 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyRxEndError() [member function] cls.add_method('NotifyRxEndError', 'void', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyRxEndOk() [member function] cls.add_method('NotifyRxEndOk', 'void', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyRxStart(ns3::Time duration) [member function] cls.add_method('NotifyRxStart', 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifySwitchingStart(ns3::Time duration) [member function] cls.add_method('NotifySwitchingStart', 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhyListener::NotifyTxStart(ns3::Time duration) [member function] cls.add_method('NotifyTxStart', 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) return def register_Ns3WifiRemoteStation_methods(root_module, cls): ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::WifiRemoteStation() [constructor] cls.add_constructor([]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::WifiRemoteStation(ns3::WifiRemoteStation const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiRemoteStation const &', 'arg0')]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::m_slrc [variable] cls.add_instance_attribute('m_slrc', 'uint32_t', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::m_ssrc [variable] cls.add_instance_attribute('m_ssrc', 'uint32_t', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::m_state [variable] cls.add_instance_attribute('m_state', 'ns3::WifiRemoteStationState *', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::m_tid [variable] cls.add_instance_attribute('m_tid', 'uint8_t', is_const=False) return def register_Ns3WifiRemoteStationInfo_methods(root_module, cls): ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationInfo::WifiRemoteStationInfo(ns3::WifiRemoteStationInfo const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiRemoteStationInfo const &', 'arg0')]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationInfo::WifiRemoteStationInfo() [constructor] cls.add_constructor([]) ## wifi-remote-station-manager.h (module 'wifi'): double ns3::WifiRemoteStationInfo::GetFrameErrorRate() const [member function] cls.add_method('GetFrameErrorRate', 'double', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationInfo::NotifyTxFailed() [member function] cls.add_method('NotifyTxFailed', 'void', []) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationInfo::NotifyTxSuccess(uint32_t retryCounter) [member function] cls.add_method('NotifyTxSuccess', 'void', [param('uint32_t', 'retryCounter')]) return def register_Ns3WifiRemoteStationState_methods(root_module, cls): ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::WifiRemoteStationState() [constructor] cls.add_constructor([]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::WifiRemoteStationState(ns3::WifiRemoteStationState const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiRemoteStationState const &', 'arg0')]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_address [variable] cls.add_instance_attribute('m_address', 'ns3::Mac48Address', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_greenfield [variable] cls.add_instance_attribute('m_greenfield', 'bool', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_info [variable] cls.add_instance_attribute('m_info', 'ns3::WifiRemoteStationInfo', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_operationalMcsSet [variable] cls.add_instance_attribute('m_operationalMcsSet', 'ns3::WifiMcsList', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_operationalRateSet [variable] cls.add_instance_attribute('m_operationalRateSet', 'ns3::WifiModeList', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_rx [variable] cls.add_instance_attribute('m_rx', 'uint32_t', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_shortGuardInterval [variable] cls.add_instance_attribute('m_shortGuardInterval', 'bool', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_stbc [variable] cls.add_instance_attribute('m_stbc', 'bool', is_const=False) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_tx [variable] cls.add_instance_attribute('m_tx', 'uint32_t', is_const=False) return def register_Ns3WifiTxVector_methods(root_module, cls): cls.add_output_stream_operator() ## wifi-tx-vector.h (module 'wifi'): ns3::WifiTxVector::WifiTxVector(ns3::WifiTxVector const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiTxVector const &', 'arg0')]) ## wifi-tx-vector.h (module 'wifi'): ns3::WifiTxVector::WifiTxVector() [constructor] cls.add_constructor([]) ## wifi-tx-vector.h (module 'wifi'): ns3::WifiTxVector::WifiTxVector(ns3::WifiMode m, uint8_t l, uint8_t r, bool sg, uint8_t ns, uint8_t ne, bool Stbc) [constructor] cls.add_constructor([param('ns3::WifiMode', 'm'), param('uint8_t', 'l'), param('uint8_t', 'r'), param('bool', 'sg'), param('uint8_t', 'ns'), param('uint8_t', 'ne'), param('bool', 'Stbc')]) ## wifi-tx-vector.h (module 'wifi'): ns3::WifiMode ns3::WifiTxVector::GetMode() const [member function] cls.add_method('GetMode', 'ns3::WifiMode', [], is_const=True) ## wifi-tx-vector.h (module 'wifi'): uint8_t ns3::WifiTxVector::GetNess() const [member function] cls.add_method('GetNess', 'uint8_t', [], is_const=True) ## wifi-tx-vector.h (module 'wifi'): uint8_t ns3::WifiTxVector::GetNss() const [member function] cls.add_method('GetNss', 'uint8_t', [], is_const=True) ## wifi-tx-vector.h (module 'wifi'): uint8_t ns3::WifiTxVector::GetRetries() const [member function] cls.add_method('GetRetries', 'uint8_t', [], is_const=True) ## wifi-tx-vector.h (module 'wifi'): uint8_t ns3::WifiTxVector::GetTxPowerLevel() const [member function] cls.add_method('GetTxPowerLevel', 'uint8_t', [], is_const=True) ## wifi-tx-vector.h (module 'wifi'): bool ns3::WifiTxVector::IsShortGuardInterval() const [member function] cls.add_method('IsShortGuardInterval', 'bool', [], is_const=True) ## wifi-tx-vector.h (module 'wifi'): bool ns3::WifiTxVector::IsStbc() const [member function] cls.add_method('IsStbc', 'bool', [], is_const=True) ## wifi-tx-vector.h (module 'wifi'): void ns3::WifiTxVector::SetMode(ns3::WifiMode mode) [member function] cls.add_method('SetMode', 'void', [param('ns3::WifiMode', 'mode')]) ## wifi-tx-vector.h (module 'wifi'): void ns3::WifiTxVector::SetNess(uint8_t ness) [member function] cls.add_method('SetNess', 'void', [param('uint8_t', 'ness')]) ## wifi-tx-vector.h (module 'wifi'): void ns3::WifiTxVector::SetNss(uint8_t nss) [member function] cls.add_method('SetNss', 'void', [param('uint8_t', 'nss')]) ## wifi-tx-vector.h (module 'wifi'): void ns3::WifiTxVector::SetRetries(uint8_t retries) [member function] cls.add_method('SetRetries', 'void', [param('uint8_t', 'retries')]) ## wifi-tx-vector.h (module 'wifi'): void ns3::WifiTxVector::SetShortGuardInterval(bool guardinterval) [member function] cls.add_method('SetShortGuardInterval', 'void', [param('bool', 'guardinterval')]) ## wifi-tx-vector.h (module 'wifi'): void ns3::WifiTxVector::SetStbc(bool stbcsatuts) [member function] cls.add_method('SetStbc', 'void', [param('bool', 'stbcsatuts')]) ## wifi-tx-vector.h (module 'wifi'): void ns3::WifiTxVector::SetTxPowerLevel(uint8_t powerlevel) [member function] cls.add_method('SetTxPowerLevel', 'void', [param('uint8_t', 'powerlevel')]) return def register_Ns3Empty_methods(root_module, cls): ## empty.h (module 'core'): ns3::empty::empty() [constructor] cls.add_constructor([]) ## empty.h (module 'core'): ns3::empty::empty(ns3::empty const & arg0) [copy constructor] cls.add_constructor([param('ns3::empty const &', 'arg0')]) return def register_Ns3Int64x64_t_methods(root_module, cls): cls.add_binary_comparison_operator('<=') cls.add_binary_comparison_operator('!=') cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short unsigned int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned char const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('signed char const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('double const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short unsigned int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned char const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('signed char const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('double const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short unsigned int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned char const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('signed char const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('double const', 'right')) cls.add_unary_numeric_operator('-') cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short unsigned int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned char const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('signed char const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('double const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right')) cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('>') cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right')) cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right')) cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right')) cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('>=') ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor] cls.add_constructor([]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(double v) [constructor] cls.add_constructor([param('double', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(int v) [constructor] cls.add_constructor([param('int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(long int v) [constructor] cls.add_constructor([param('long int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(long long int v) [constructor] cls.add_constructor([param('long long int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(unsigned int v) [constructor] cls.add_constructor([param('unsigned int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(long unsigned int v) [constructor] cls.add_constructor([param('long unsigned int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(int64_t hi, uint64_t lo) [constructor] cls.add_constructor([param('int64_t', 'hi'), param('uint64_t', 'lo')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(ns3::int64x64_t const & o) [copy constructor] cls.add_constructor([param('ns3::int64x64_t const &', 'o')]) ## int64x64-double.h (module 'core'): double ns3::int64x64_t::GetDouble() const [member function] cls.add_method('GetDouble', 'double', [], is_const=True) ## int64x64-double.h (module 'core'): int64_t ns3::int64x64_t::GetHigh() const [member function] cls.add_method('GetHigh', 'int64_t', [], is_const=True) ## int64x64-double.h (module 'core'): uint64_t ns3::int64x64_t::GetLow() const [member function] cls.add_method('GetLow', 'uint64_t', [], is_const=True) ## int64x64-double.h (module 'core'): static ns3::int64x64_t ns3::int64x64_t::Invert(uint64_t v) [member function] cls.add_method('Invert', 'ns3::int64x64_t', [param('uint64_t', 'v')], is_static=True) ## int64x64-double.h (module 'core'): void ns3::int64x64_t::MulByInvert(ns3::int64x64_t const & o) [member function] cls.add_method('MulByInvert', 'void', [param('ns3::int64x64_t const &', 'o')]) return def register_Ns3Chunk_methods(root_module, cls): ## chunk.h (module 'network'): ns3::Chunk::Chunk() [constructor] cls.add_constructor([]) ## chunk.h (module 'network'): ns3::Chunk::Chunk(ns3::Chunk const & arg0) [copy constructor] cls.add_constructor([param('ns3::Chunk const &', 'arg0')]) ## chunk.h (module 'network'): uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_virtual=True) ## chunk.h (module 'network'): static ns3::TypeId ns3::Chunk::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## chunk.h (module 'network'): void ns3::Chunk::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3Header_methods(root_module, cls): cls.add_output_stream_operator() ## header.h (module 'network'): ns3::Header::Header() [constructor] cls.add_constructor([]) ## header.h (module 'network'): ns3::Header::Header(ns3::Header const & arg0) [copy constructor] cls.add_constructor([param('ns3::Header const &', 'arg0')]) ## header.h (module 'network'): uint32_t ns3::Header::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_virtual=True) ## header.h (module 'network'): uint32_t ns3::Header::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## header.h (module 'network'): static ns3::TypeId ns3::Header::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## header.h (module 'network'): void ns3::Header::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) ## header.h (module 'network'): void ns3::Header::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3Icmpv4DestinationUnreachable_methods(root_module, cls): ## icmpv4.h (module 'internet'): ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable(ns3::Icmpv4DestinationUnreachable const & arg0) [copy constructor] cls.add_constructor([param('ns3::Icmpv4DestinationUnreachable const &', 'arg0')]) ## icmpv4.h (module 'internet'): ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable() [constructor] cls.add_constructor([]) ## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::GetData(uint8_t * payload) const [member function] cls.add_method('GetData', 'void', [param('uint8_t *', 'payload')], is_const=True) ## icmpv4.h (module 'internet'): ns3::Ipv4Header ns3::Icmpv4DestinationUnreachable::GetHeader() const [member function] cls.add_method('GetHeader', 'ns3::Ipv4Header', [], is_const=True) ## icmpv4.h (module 'internet'): uint16_t ns3::Icmpv4DestinationUnreachable::GetNextHopMtu() const [member function] cls.add_method('GetNextHopMtu', 'uint16_t', [], is_const=True) ## icmpv4.h (module 'internet'): static ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::SetData(ns3::Ptr<ns3::Packet const> data) [member function] cls.add_method('SetData', 'void', [param('ns3::Ptr< ns3::Packet const >', 'data')]) ## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::SetHeader(ns3::Ipv4Header header) [member function] cls.add_method('SetHeader', 'void', [param('ns3::Ipv4Header', 'header')]) ## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::SetNextHopMtu(uint16_t mtu) [member function] cls.add_method('SetNextHopMtu', 'void', [param('uint16_t', 'mtu')]) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4DestinationUnreachable::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], visibility='private', is_virtual=True) ## icmpv4.h (module 'internet'): ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, visibility='private', is_virtual=True) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4DestinationUnreachable::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, visibility='private', is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, visibility='private', is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, visibility='private', is_virtual=True) return def register_Ns3Icmpv4Echo_methods(root_module, cls): ## icmpv4.h (module 'internet'): ns3::Icmpv4Echo::Icmpv4Echo(ns3::Icmpv4Echo const & arg0) [copy constructor] cls.add_constructor([param('ns3::Icmpv4Echo const &', 'arg0')]) ## icmpv4.h (module 'internet'): ns3::Icmpv4Echo::Icmpv4Echo() [constructor] cls.add_constructor([]) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Echo::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Echo::GetData(uint8_t * payload) const [member function] cls.add_method('GetData', 'uint32_t', [param('uint8_t *', 'payload')], is_const=True) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Echo::GetDataSize() const [member function] cls.add_method('GetDataSize', 'uint32_t', [], is_const=True) ## icmpv4.h (module 'internet'): uint16_t ns3::Icmpv4Echo::GetIdentifier() const [member function] cls.add_method('GetIdentifier', 'uint16_t', [], is_const=True) ## icmpv4.h (module 'internet'): ns3::TypeId ns3::Icmpv4Echo::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): uint16_t ns3::Icmpv4Echo::GetSequenceNumber() const [member function] cls.add_method('GetSequenceNumber', 'uint16_t', [], is_const=True) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Echo::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): static ns3::TypeId ns3::Icmpv4Echo::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::SetData(ns3::Ptr<ns3::Packet const> data) [member function] cls.add_method('SetData', 'void', [param('ns3::Ptr< ns3::Packet const >', 'data')]) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::SetIdentifier(uint16_t id) [member function] cls.add_method('SetIdentifier', 'void', [param('uint16_t', 'id')]) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::SetSequenceNumber(uint16_t seq) [member function] cls.add_method('SetSequenceNumber', 'void', [param('uint16_t', 'seq')]) return def register_Ns3Icmpv4Header_methods(root_module, cls): ## icmpv4.h (module 'internet'): ns3::Icmpv4Header::Icmpv4Header(ns3::Icmpv4Header const & arg0) [copy constructor] cls.add_constructor([param('ns3::Icmpv4Header const &', 'arg0')]) ## icmpv4.h (module 'internet'): ns3::Icmpv4Header::Icmpv4Header() [constructor] cls.add_constructor([]) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Header::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::EnableChecksum() [member function] cls.add_method('EnableChecksum', 'void', []) ## icmpv4.h (module 'internet'): uint8_t ns3::Icmpv4Header::GetCode() const [member function] cls.add_method('GetCode', 'uint8_t', [], is_const=True) ## icmpv4.h (module 'internet'): ns3::TypeId ns3::Icmpv4Header::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Header::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): uint8_t ns3::Icmpv4Header::GetType() const [member function] cls.add_method('GetType', 'uint8_t', [], is_const=True) ## icmpv4.h (module 'internet'): static ns3::TypeId ns3::Icmpv4Header::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::SetCode(uint8_t code) [member function] cls.add_method('SetCode', 'void', [param('uint8_t', 'code')]) ## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::SetType(uint8_t type) [member function] cls.add_method('SetType', 'void', [param('uint8_t', 'type')]) return def register_Ns3Icmpv4TimeExceeded_methods(root_module, cls): ## icmpv4.h (module 'internet'): ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded(ns3::Icmpv4TimeExceeded const & arg0) [copy constructor] cls.add_constructor([param('ns3::Icmpv4TimeExceeded const &', 'arg0')]) ## icmpv4.h (module 'internet'): ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded() [constructor] cls.add_constructor([]) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4TimeExceeded::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::GetData(uint8_t * payload) const [member function] cls.add_method('GetData', 'void', [param('uint8_t *', 'payload')], is_const=True) ## icmpv4.h (module 'internet'): ns3::Ipv4Header ns3::Icmpv4TimeExceeded::GetHeader() const [member function] cls.add_method('GetHeader', 'ns3::Ipv4Header', [], is_const=True) ## icmpv4.h (module 'internet'): ns3::TypeId ns3::Icmpv4TimeExceeded::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4TimeExceeded::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): static ns3::TypeId ns3::Icmpv4TimeExceeded::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::SetData(ns3::Ptr<ns3::Packet const> data) [member function] cls.add_method('SetData', 'void', [param('ns3::Ptr< ns3::Packet const >', 'data')]) ## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::SetHeader(ns3::Ipv4Header header) [member function] cls.add_method('SetHeader', 'void', [param('ns3::Ipv4Header', 'header')]) return def register_Ns3Ipv4Header_methods(root_module, cls): ## ipv4-header.h (module 'internet'): ns3::Ipv4Header::Ipv4Header(ns3::Ipv4Header const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4Header const &', 'arg0')]) ## ipv4-header.h (module 'internet'): ns3::Ipv4Header::Ipv4Header() [constructor] cls.add_constructor([]) ## ipv4-header.h (module 'internet'): uint32_t ns3::Ipv4Header::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## ipv4-header.h (module 'internet'): std::string ns3::Ipv4Header::DscpTypeToString(ns3::Ipv4Header::DscpType dscp) const [member function] cls.add_method('DscpTypeToString', 'std::string', [param('ns3::Ipv4Header::DscpType', 'dscp')], is_const=True) ## ipv4-header.h (module 'internet'): std::string ns3::Ipv4Header::EcnTypeToString(ns3::Ipv4Header::EcnType ecn) const [member function] cls.add_method('EcnTypeToString', 'std::string', [param('ns3::Ipv4Header::EcnType', 'ecn')], is_const=True) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::EnableChecksum() [member function] cls.add_method('EnableChecksum', 'void', []) ## ipv4-header.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Header::GetDestination() const [member function] cls.add_method('GetDestination', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-header.h (module 'internet'): ns3::Ipv4Header::DscpType ns3::Ipv4Header::GetDscp() const [member function] cls.add_method('GetDscp', 'ns3::Ipv4Header::DscpType', [], is_const=True) ## ipv4-header.h (module 'internet'): ns3::Ipv4Header::EcnType ns3::Ipv4Header::GetEcn() const [member function] cls.add_method('GetEcn', 'ns3::Ipv4Header::EcnType', [], is_const=True) ## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetFragmentOffset() const [member function] cls.add_method('GetFragmentOffset', 'uint16_t', [], is_const=True) ## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetIdentification() const [member function] cls.add_method('GetIdentification', 'uint16_t', [], is_const=True) ## ipv4-header.h (module 'internet'): ns3::TypeId ns3::Ipv4Header::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetPayloadSize() const [member function] cls.add_method('GetPayloadSize', 'uint16_t', [], is_const=True) ## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetProtocol() const [member function] cls.add_method('GetProtocol', 'uint8_t', [], is_const=True) ## ipv4-header.h (module 'internet'): uint32_t ns3::Ipv4Header::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## ipv4-header.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Header::GetSource() const [member function] cls.add_method('GetSource', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetTos() const [member function] cls.add_method('GetTos', 'uint8_t', [], is_const=True) ## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetTtl() const [member function] cls.add_method('GetTtl', 'uint8_t', [], is_const=True) ## ipv4-header.h (module 'internet'): static ns3::TypeId ns3::Ipv4Header::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsChecksumOk() const [member function] cls.add_method('IsChecksumOk', 'bool', [], is_const=True) ## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsDontFragment() const [member function] cls.add_method('IsDontFragment', 'bool', [], is_const=True) ## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsLastFragment() const [member function] cls.add_method('IsLastFragment', 'bool', [], is_const=True) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDestination(ns3::Ipv4Address destination) [member function] cls.add_method('SetDestination', 'void', [param('ns3::Ipv4Address', 'destination')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDontFragment() [member function] cls.add_method('SetDontFragment', 'void', []) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDscp(ns3::Ipv4Header::DscpType dscp) [member function] cls.add_method('SetDscp', 'void', [param('ns3::Ipv4Header::DscpType', 'dscp')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetEcn(ns3::Ipv4Header::EcnType ecn) [member function] cls.add_method('SetEcn', 'void', [param('ns3::Ipv4Header::EcnType', 'ecn')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetFragmentOffset(uint16_t offsetBytes) [member function] cls.add_method('SetFragmentOffset', 'void', [param('uint16_t', 'offsetBytes')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetIdentification(uint16_t identification) [member function] cls.add_method('SetIdentification', 'void', [param('uint16_t', 'identification')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetLastFragment() [member function] cls.add_method('SetLastFragment', 'void', []) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetMayFragment() [member function] cls.add_method('SetMayFragment', 'void', []) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetMoreFragments() [member function] cls.add_method('SetMoreFragments', 'void', []) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetPayloadSize(uint16_t size) [member function] cls.add_method('SetPayloadSize', 'void', [param('uint16_t', 'size')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetProtocol(uint8_t num) [member function] cls.add_method('SetProtocol', 'void', [param('uint8_t', 'num')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetSource(ns3::Ipv4Address source) [member function] cls.add_method('SetSource', 'void', [param('ns3::Ipv4Address', 'source')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetTos(uint8_t tos) [member function] cls.add_method('SetTos', 'void', [param('uint8_t', 'tos')]) ## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetTtl(uint8_t ttl) [member function] cls.add_method('SetTtl', 'void', [param('uint8_t', 'ttl')]) return def register_Ns3Ipv6Header_methods(root_module, cls): ## ipv6-header.h (module 'internet'): ns3::Ipv6Header::Ipv6Header(ns3::Ipv6Header const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6Header const &', 'arg0')]) ## ipv6-header.h (module 'internet'): ns3::Ipv6Header::Ipv6Header() [constructor] cls.add_constructor([]) ## ipv6-header.h (module 'internet'): uint32_t ns3::Ipv6Header::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## ipv6-header.h (module 'internet'): ns3::Ipv6Address ns3::Ipv6Header::GetDestinationAddress() const [member function] cls.add_method('GetDestinationAddress', 'ns3::Ipv6Address', [], is_const=True) ## ipv6-header.h (module 'internet'): uint32_t ns3::Ipv6Header::GetFlowLabel() const [member function] cls.add_method('GetFlowLabel', 'uint32_t', [], is_const=True) ## ipv6-header.h (module 'internet'): uint8_t ns3::Ipv6Header::GetHopLimit() const [member function] cls.add_method('GetHopLimit', 'uint8_t', [], is_const=True) ## ipv6-header.h (module 'internet'): ns3::TypeId ns3::Ipv6Header::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## ipv6-header.h (module 'internet'): uint8_t ns3::Ipv6Header::GetNextHeader() const [member function] cls.add_method('GetNextHeader', 'uint8_t', [], is_const=True) ## ipv6-header.h (module 'internet'): uint16_t ns3::Ipv6Header::GetPayloadLength() const [member function] cls.add_method('GetPayloadLength', 'uint16_t', [], is_const=True) ## ipv6-header.h (module 'internet'): uint32_t ns3::Ipv6Header::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## ipv6-header.h (module 'internet'): ns3::Ipv6Address ns3::Ipv6Header::GetSourceAddress() const [member function] cls.add_method('GetSourceAddress', 'ns3::Ipv6Address', [], is_const=True) ## ipv6-header.h (module 'internet'): uint8_t ns3::Ipv6Header::GetTrafficClass() const [member function] cls.add_method('GetTrafficClass', 'uint8_t', [], is_const=True) ## ipv6-header.h (module 'internet'): static ns3::TypeId ns3::Ipv6Header::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetDestinationAddress(ns3::Ipv6Address dst) [member function] cls.add_method('SetDestinationAddress', 'void', [param('ns3::Ipv6Address', 'dst')]) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetFlowLabel(uint32_t flow) [member function] cls.add_method('SetFlowLabel', 'void', [param('uint32_t', 'flow')]) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetHopLimit(uint8_t limit) [member function] cls.add_method('SetHopLimit', 'void', [param('uint8_t', 'limit')]) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetNextHeader(uint8_t next) [member function] cls.add_method('SetNextHeader', 'void', [param('uint8_t', 'next')]) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetPayloadLength(uint16_t len) [member function] cls.add_method('SetPayloadLength', 'void', [param('uint16_t', 'len')]) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetSourceAddress(ns3::Ipv6Address src) [member function] cls.add_method('SetSourceAddress', 'void', [param('ns3::Ipv6Address', 'src')]) ## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetTrafficClass(uint8_t traffic) [member function] cls.add_method('SetTrafficClass', 'void', [param('uint8_t', 'traffic')]) return def register_Ns3Object_methods(root_module, cls): ## object.h (module 'core'): ns3::Object::Object() [constructor] cls.add_constructor([]) ## object.h (module 'core'): void ns3::Object::AggregateObject(ns3::Ptr<ns3::Object> other) [member function] cls.add_method('AggregateObject', 'void', [param('ns3::Ptr< ns3::Object >', 'other')]) ## object.h (module 'core'): void ns3::Object::Dispose() [member function] cls.add_method('Dispose', 'void', []) ## object.h (module 'core'): ns3::Object::AggregateIterator ns3::Object::GetAggregateIterator() const [member function] cls.add_method('GetAggregateIterator', 'ns3::Object::AggregateIterator', [], is_const=True) ## object.h (module 'core'): ns3::TypeId ns3::Object::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## object.h (module 'core'): static ns3::TypeId ns3::Object::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## object.h (module 'core'): void ns3::Object::Initialize() [member function] cls.add_method('Initialize', 'void', []) ## object.h (module 'core'): ns3::Object::Object(ns3::Object const & o) [copy constructor] cls.add_constructor([param('ns3::Object const &', 'o')], visibility='protected') ## object.h (module 'core'): void ns3::Object::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## object.h (module 'core'): void ns3::Object::DoInitialize() [member function] cls.add_method('DoInitialize', 'void', [], visibility='protected', is_virtual=True) ## object.h (module 'core'): void ns3::Object::NotifyNewAggregate() [member function] cls.add_method('NotifyNewAggregate', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3ObjectAggregateIterator_methods(root_module, cls): ## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator(ns3::Object::AggregateIterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::Object::AggregateIterator const &', 'arg0')]) ## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator() [constructor] cls.add_constructor([]) ## object.h (module 'core'): bool ns3::Object::AggregateIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## object.h (module 'core'): ns3::Ptr<ns3::Object const> ns3::Object::AggregateIterator::Next() [member function] cls.add_method('Next', 'ns3::Ptr< ns3::Object const >', []) return def register_Ns3RandomVariableStream_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::RandomVariableStream::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::RandomVariableStream::RandomVariableStream() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetStream(int64_t stream) [member function] cls.add_method('SetStream', 'void', [param('int64_t', 'stream')]) ## random-variable-stream.h (module 'core'): int64_t ns3::RandomVariableStream::GetStream() const [member function] cls.add_method('GetStream', 'int64_t', [], is_const=True) ## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetAntithetic(bool isAntithetic) [member function] cls.add_method('SetAntithetic', 'void', [param('bool', 'isAntithetic')]) ## random-variable-stream.h (module 'core'): bool ns3::RandomVariableStream::IsAntithetic() const [member function] cls.add_method('IsAntithetic', 'bool', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::RandomVariableStream::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_pure_virtual=True, is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::RandomVariableStream::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_pure_virtual=True, is_virtual=True) ## random-variable-stream.h (module 'core'): ns3::RngStream * ns3::RandomVariableStream::Peek() const [member function] cls.add_method('Peek', 'ns3::RngStream *', [], is_const=True, visibility='protected') return def register_Ns3SequentialRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::SequentialRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable::SequentialRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMin() const [member function] cls.add_method('GetMin', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMax() const [member function] cls.add_method('GetMax', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): ns3::Ptr<ns3::RandomVariableStream> ns3::SequentialRandomVariable::GetIncrement() const [member function] cls.add_method('GetIncrement', 'ns3::Ptr< ns3::RandomVariableStream >', [], is_const=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetConsecutive() const [member function] cls.add_method('GetConsecutive', 'uint32_t', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter< ns3::AttributeAccessor > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter< ns3::AttributeChecker > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter< ns3::AttributeValue > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount(ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter< ns3::CallbackImplBase > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount(ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter< ns3::EventImpl > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter< ns3::Hash::Implementation > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3Ipv4MulticastRoute_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4MulticastRoute__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter< ns3::Ipv4MulticastRoute > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3Ipv4Route_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4Route__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter< ns3::Ipv4Route > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount(ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter< ns3::NixVector > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount(ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter< ns3::OutputStreamWrapper > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter< ns3::Packet > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter< ns3::TraceSourceAccessor > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3WifiInformationElement_Ns3Empty_Ns3DefaultDeleter__lt__ns3WifiInformationElement__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >::SimpleRefCount(ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter< ns3::WifiInformationElement > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3Socket_methods(root_module, cls): ## socket.h (module 'network'): ns3::Socket::Socket(ns3::Socket const & arg0) [copy constructor] cls.add_constructor([param('ns3::Socket const &', 'arg0')]) ## socket.h (module 'network'): ns3::Socket::Socket() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): int ns3::Socket::Bind(ns3::Address const & address) [member function] cls.add_method('Bind', 'int', [param('ns3::Address const &', 'address')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Bind() [member function] cls.add_method('Bind', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Bind6() [member function] cls.add_method('Bind6', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::BindToNetDevice(ns3::Ptr<ns3::NetDevice> netdevice) [member function] cls.add_method('BindToNetDevice', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'netdevice')], is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Close() [member function] cls.add_method('Close', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Connect(ns3::Address const & address) [member function] cls.add_method('Connect', 'int', [param('ns3::Address const &', 'address')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): static ns3::Ptr<ns3::Socket> ns3::Socket::CreateSocket(ns3::Ptr<ns3::Node> node, ns3::TypeId tid) [member function] cls.add_method('CreateSocket', 'ns3::Ptr< ns3::Socket >', [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::TypeId', 'tid')], is_static=True) ## socket.h (module 'network'): bool ns3::Socket::GetAllowBroadcast() const [member function] cls.add_method('GetAllowBroadcast', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Socket::GetBoundNetDevice() [member function] cls.add_method('GetBoundNetDevice', 'ns3::Ptr< ns3::NetDevice >', []) ## socket.h (module 'network'): ns3::Socket::SocketErrno ns3::Socket::GetErrno() const [member function] cls.add_method('GetErrno', 'ns3::Socket::SocketErrno', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): uint8_t ns3::Socket::GetIpTos() const [member function] cls.add_method('GetIpTos', 'uint8_t', [], is_const=True) ## socket.h (module 'network'): uint8_t ns3::Socket::GetIpTtl() const [member function] cls.add_method('GetIpTtl', 'uint8_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6HopLimit() const [member function] cls.add_method('GetIpv6HopLimit', 'uint8_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6Tclass() const [member function] cls.add_method('GetIpv6Tclass', 'uint8_t', [], is_const=True) ## socket.h (module 'network'): ns3::Ptr<ns3::Node> ns3::Socket::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::Socket::GetRxAvailable() const [member function] cls.add_method('GetRxAvailable', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::GetSockName(ns3::Address & address) const [member function] cls.add_method('GetSockName', 'int', [param('ns3::Address &', 'address')], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): ns3::Socket::SocketType ns3::Socket::GetSocketType() const [member function] cls.add_method('GetSocketType', 'ns3::Socket::SocketType', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::Socket::GetTxAvailable() const [member function] cls.add_method('GetTxAvailable', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): static ns3::TypeId ns3::Socket::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): bool ns3::Socket::IsIpRecvTos() const [member function] cls.add_method('IsIpRecvTos', 'bool', [], is_const=True) ## socket.h (module 'network'): bool ns3::Socket::IsIpRecvTtl() const [member function] cls.add_method('IsIpRecvTtl', 'bool', [], is_const=True) ## socket.h (module 'network'): bool ns3::Socket::IsIpv6RecvHopLimit() const [member function] cls.add_method('IsIpv6RecvHopLimit', 'bool', [], is_const=True) ## socket.h (module 'network'): bool ns3::Socket::IsIpv6RecvTclass() const [member function] cls.add_method('IsIpv6RecvTclass', 'bool', [], is_const=True) ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function] cls.add_method('IsRecvPktInfo', 'bool', [], is_const=True) ## socket.h (module 'network'): int ns3::Socket::Listen() [member function] cls.add_method('Listen', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv(uint32_t maxSize, uint32_t flags) [member function] cls.add_method('Recv', 'ns3::Ptr< ns3::Packet >', [param('uint32_t', 'maxSize'), param('uint32_t', 'flags')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv() [member function] cls.add_method('Recv', 'ns3::Ptr< ns3::Packet >', []) ## socket.h (module 'network'): int ns3::Socket::Recv(uint8_t * buf, uint32_t size, uint32_t flags) [member function] cls.add_method('Recv', 'int', [param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')]) ## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function] cls.add_method('RecvFrom', 'ns3::Ptr< ns3::Packet >', [param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(ns3::Address & fromAddress) [member function] cls.add_method('RecvFrom', 'ns3::Ptr< ns3::Packet >', [param('ns3::Address &', 'fromAddress')]) ## socket.h (module 'network'): int ns3::Socket::RecvFrom(uint8_t * buf, uint32_t size, uint32_t flags, ns3::Address & fromAddress) [member function] cls.add_method('RecvFrom', 'int', [param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')]) ## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p, uint32_t flags) [member function] cls.add_method('Send', 'int', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('Send', 'int', [param('ns3::Ptr< ns3::Packet >', 'p')]) ## socket.h (module 'network'): int ns3::Socket::Send(uint8_t const * buf, uint32_t size, uint32_t flags) [member function] cls.add_method('Send', 'int', [param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')]) ## socket.h (module 'network'): int ns3::Socket::SendTo(ns3::Ptr<ns3::Packet> p, uint32_t flags, ns3::Address const & toAddress) [member function] cls.add_method('SendTo', 'int', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'toAddress')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::SendTo(uint8_t const * buf, uint32_t size, uint32_t flags, ns3::Address const & address) [member function] cls.add_method('SendTo', 'int', [param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address const &', 'address')]) ## socket.h (module 'network'): void ns3::Socket::SetAcceptCallback(ns3::Callback<bool, ns3::Ptr<ns3::Socket>, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionRequest, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> newConnectionCreated) [member function] cls.add_method('SetAcceptCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionRequest'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'newConnectionCreated')]) ## socket.h (module 'network'): bool ns3::Socket::SetAllowBroadcast(bool allowBroadcast) [member function] cls.add_method('SetAllowBroadcast', 'bool', [param('bool', 'allowBroadcast')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::SetCloseCallbacks(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> normalClose, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> errorClose) [member function] cls.add_method('SetCloseCallbacks', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'normalClose'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'errorClose')]) ## socket.h (module 'network'): void ns3::Socket::SetConnectCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionSucceeded, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionFailed) [member function] cls.add_method('SetConnectCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionSucceeded'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionFailed')]) ## socket.h (module 'network'): void ns3::Socket::SetDataSentCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> dataSent) [member function] cls.add_method('SetDataSentCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataSent')]) ## socket.h (module 'network'): void ns3::Socket::SetIpRecvTos(bool ipv4RecvTos) [member function] cls.add_method('SetIpRecvTos', 'void', [param('bool', 'ipv4RecvTos')]) ## socket.h (module 'network'): void ns3::Socket::SetIpRecvTtl(bool ipv4RecvTtl) [member function] cls.add_method('SetIpRecvTtl', 'void', [param('bool', 'ipv4RecvTtl')]) ## socket.h (module 'network'): void ns3::Socket::SetIpTos(uint8_t ipTos) [member function] cls.add_method('SetIpTos', 'void', [param('uint8_t', 'ipTos')]) ## socket.h (module 'network'): void ns3::Socket::SetIpTtl(uint8_t ipTtl) [member function] cls.add_method('SetIpTtl', 'void', [param('uint8_t', 'ipTtl')], is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::SetIpv6HopLimit(uint8_t ipHopLimit) [member function] cls.add_method('SetIpv6HopLimit', 'void', [param('uint8_t', 'ipHopLimit')], is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::SetIpv6RecvHopLimit(bool ipv6RecvHopLimit) [member function] cls.add_method('SetIpv6RecvHopLimit', 'void', [param('bool', 'ipv6RecvHopLimit')]) ## socket.h (module 'network'): void ns3::Socket::SetIpv6RecvTclass(bool ipv6RecvTclass) [member function] cls.add_method('SetIpv6RecvTclass', 'void', [param('bool', 'ipv6RecvTclass')]) ## socket.h (module 'network'): void ns3::Socket::SetIpv6Tclass(int ipTclass) [member function] cls.add_method('SetIpv6Tclass', 'void', [param('int', 'ipTclass')]) ## socket.h (module 'network'): void ns3::Socket::SetRecvCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> arg0) [member function] cls.add_method('SetRecvCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arg0')]) ## socket.h (module 'network'): void ns3::Socket::SetRecvPktInfo(bool flag) [member function] cls.add_method('SetRecvPktInfo', 'void', [param('bool', 'flag')]) ## socket.h (module 'network'): void ns3::Socket::SetSendCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> sendCb) [member function] cls.add_method('SetSendCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'sendCb')]) ## socket.h (module 'network'): int ns3::Socket::ShutdownRecv() [member function] cls.add_method('ShutdownRecv', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::ShutdownSend() [member function] cls.add_method('ShutdownSend', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## socket.h (module 'network'): bool ns3::Socket::IsManualIpTos() const [member function] cls.add_method('IsManualIpTos', 'bool', [], is_const=True, visibility='protected') ## socket.h (module 'network'): bool ns3::Socket::IsManualIpTtl() const [member function] cls.add_method('IsManualIpTtl', 'bool', [], is_const=True, visibility='protected') ## socket.h (module 'network'): bool ns3::Socket::IsManualIpv6HopLimit() const [member function] cls.add_method('IsManualIpv6HopLimit', 'bool', [], is_const=True, visibility='protected') ## socket.h (module 'network'): bool ns3::Socket::IsManualIpv6Tclass() const [member function] cls.add_method('IsManualIpv6Tclass', 'bool', [], is_const=True, visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyConnectionFailed() [member function] cls.add_method('NotifyConnectionFailed', 'void', [], visibility='protected') ## socket.h (module 'network'): bool ns3::Socket::NotifyConnectionRequest(ns3::Address const & from) [member function] cls.add_method('NotifyConnectionRequest', 'bool', [param('ns3::Address const &', 'from')], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyConnectionSucceeded() [member function] cls.add_method('NotifyConnectionSucceeded', 'void', [], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyDataRecv() [member function] cls.add_method('NotifyDataRecv', 'void', [], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyDataSent(uint32_t size) [member function] cls.add_method('NotifyDataSent', 'void', [param('uint32_t', 'size')], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyErrorClose() [member function] cls.add_method('NotifyErrorClose', 'void', [], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyNewConnectionCreated(ns3::Ptr<ns3::Socket> socket, ns3::Address const & from) [member function] cls.add_method('NotifyNewConnectionCreated', 'void', [param('ns3::Ptr< ns3::Socket >', 'socket'), param('ns3::Address const &', 'from')], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyNormalClose() [member function] cls.add_method('NotifyNormalClose', 'void', [], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifySend(uint32_t spaceAvailable) [member function] cls.add_method('NotifySend', 'void', [param('uint32_t', 'spaceAvailable')], visibility='protected') return def register_Ns3SocketAddressTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketAddressTag::SocketAddressTag(ns3::SocketAddressTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketAddressTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketAddressTag::SocketAddressTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketAddressTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): ns3::Address ns3::SocketAddressTag::GetAddress() const [member function] cls.add_method('GetAddress', 'ns3::Address', [], is_const=True) ## socket.h (module 'network'): ns3::TypeId ns3::SocketAddressTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketAddressTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketAddressTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): void ns3::SocketAddressTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketAddressTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketAddressTag::SetAddress(ns3::Address addr) [member function] cls.add_method('SetAddress', 'void', [param('ns3::Address', 'addr')]) return def register_Ns3SocketIpTosTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketIpTosTag::SocketIpTosTag(ns3::SocketIpTosTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketIpTosTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketIpTosTag::SocketIpTosTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketIpTosTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTosTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketIpTosTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint8_t ns3::SocketIpTosTag::GetTos() const [member function] cls.add_method('GetTos', 'uint8_t', [], is_const=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTosTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): void ns3::SocketIpTosTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpTosTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpTosTag::SetTos(uint8_t tos) [member function] cls.add_method('SetTos', 'void', [param('uint8_t', 'tos')]) return def register_Ns3SocketIpTtlTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag(ns3::SocketIpTtlTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketIpTtlTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketIpTtlTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTtlTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketIpTtlTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint8_t ns3::SocketIpTtlTag::GetTtl() const [member function] cls.add_method('GetTtl', 'uint8_t', [], is_const=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTtlTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): void ns3::SocketIpTtlTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpTtlTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpTtlTag::SetTtl(uint8_t ttl) [member function] cls.add_method('SetTtl', 'void', [param('uint8_t', 'ttl')]) return def register_Ns3SocketIpv6HopLimitTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag::SocketIpv6HopLimitTag(ns3::SocketIpv6HopLimitTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketIpv6HopLimitTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag::SocketIpv6HopLimitTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): uint8_t ns3::SocketIpv6HopLimitTag::GetHopLimit() const [member function] cls.add_method('GetHopLimit', 'uint8_t', [], is_const=True) ## socket.h (module 'network'): ns3::TypeId ns3::SocketIpv6HopLimitTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketIpv6HopLimitTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpv6HopLimitTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::SetHopLimit(uint8_t hopLimit) [member function] cls.add_method('SetHopLimit', 'void', [param('uint8_t', 'hopLimit')]) return def register_Ns3SocketIpv6TclassTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketIpv6TclassTag::SocketIpv6TclassTag(ns3::SocketIpv6TclassTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketIpv6TclassTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketIpv6TclassTag::SocketIpv6TclassTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): ns3::TypeId ns3::SocketIpv6TclassTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketIpv6TclassTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint8_t ns3::SocketIpv6TclassTag::GetTclass() const [member function] cls.add_method('GetTclass', 'uint8_t', [], is_const=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpv6TclassTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::SetTclass(uint8_t tclass) [member function] cls.add_method('SetTclass', 'void', [param('uint8_t', 'tclass')]) return def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag(ns3::SocketSetDontFragmentTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketSetDontFragmentTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Disable() [member function] cls.add_method('Disable', 'void', []) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Enable() [member function] cls.add_method('Enable', 'void', []) ## socket.h (module 'network'): ns3::TypeId ns3::SocketSetDontFragmentTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketSetDontFragmentTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketSetDontFragmentTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): bool ns3::SocketSetDontFragmentTag::IsEnabled() const [member function] cls.add_method('IsEnabled', 'bool', [], is_const=True) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) return def register_Ns3Time_methods(root_module, cls): cls.add_binary_comparison_operator('<=') cls.add_binary_comparison_operator('!=') cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right')) cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('>') cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right')) cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('>=') ## nstime.h (module 'core'): ns3::Time::Time() [constructor] cls.add_constructor([]) ## nstime.h (module 'core'): ns3::Time::Time(ns3::Time const & o) [copy constructor] cls.add_constructor([param('ns3::Time const &', 'o')]) ## nstime.h (module 'core'): ns3::Time::Time(double v) [constructor] cls.add_constructor([param('double', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(int v) [constructor] cls.add_constructor([param('int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long int v) [constructor] cls.add_constructor([param('long int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long int v) [constructor] cls.add_constructor([param('long long int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(unsigned int v) [constructor] cls.add_constructor([param('unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long unsigned int v) [constructor] cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function] cls.add_method('Compare', 'int', [param('ns3::Time const &', 'o')], is_const=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] cls.add_method('From', 'ns3::Time', [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], is_static=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', [param('ns3::int64x64_t const &', 'value')], is_static=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] cls.add_method('FromDouble', 'ns3::Time', [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], is_static=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] cls.add_method('FromInteger', 'ns3::Time', [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDouble() const [member function] cls.add_method('GetDouble', 'double', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetFemtoSeconds() const [member function] cls.add_method('GetFemtoSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetInteger() const [member function] cls.add_method('GetInteger', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetMicroSeconds() const [member function] cls.add_method('GetMicroSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetMilliSeconds() const [member function] cls.add_method('GetMilliSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetNanoSeconds() const [member function] cls.add_method('GetNanoSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetPicoSeconds() const [member function] cls.add_method('GetPicoSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): static ns3::Time::Unit ns3::Time::GetResolution() [member function] cls.add_method('GetResolution', 'ns3::Time::Unit', [], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetSeconds() const [member function] cls.add_method('GetSeconds', 'double', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetTimeStep() const [member function] cls.add_method('GetTimeStep', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsNegative() const [member function] cls.add_method('IsNegative', 'bool', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsPositive() const [member function] cls.add_method('IsPositive', 'bool', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsStrictlyNegative() const [member function] cls.add_method('IsStrictlyNegative', 'bool', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsStrictlyPositive() const [member function] cls.add_method('IsStrictlyPositive', 'bool', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsZero() const [member function] cls.add_method('IsZero', 'bool', [], is_const=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::Max() [member function] cls.add_method('Max', 'ns3::Time', [], is_static=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::Min() [member function] cls.add_method('Min', 'ns3::Time', [], is_static=True) ## nstime.h (module 'core'): static void ns3::Time::SetResolution(ns3::Time::Unit resolution) [member function] cls.add_method('SetResolution', 'void', [param('ns3::Time::Unit', 'resolution')], is_static=True) ## nstime.h (module 'core'): static bool ns3::Time::StaticInit() [member function] cls.add_method('StaticInit', 'bool', [], is_static=True) ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] cls.add_method('To', 'ns3::int64x64_t', [param('ns3::Time::Unit', 'timeUnit')], is_const=True) ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] cls.add_method('ToDouble', 'double', [param('ns3::Time::Unit', 'timeUnit')], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] cls.add_method('ToInteger', 'int64_t', [param('ns3::Time::Unit', 'timeUnit')], is_const=True) return def register_Ns3TraceSourceAccessor_methods(root_module, cls): ## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor(ns3::TraceSourceAccessor const & arg0) [copy constructor] cls.add_constructor([param('ns3::TraceSourceAccessor const &', 'arg0')]) ## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor() [constructor] cls.add_constructor([]) ## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Connect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function] cls.add_method('Connect', 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) ## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::ConnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function] cls.add_method('ConnectWithoutContext', 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) ## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Disconnect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function] cls.add_method('Disconnect', 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) ## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::DisconnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function] cls.add_method('DisconnectWithoutContext', 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3Trailer_methods(root_module, cls): cls.add_output_stream_operator() ## trailer.h (module 'network'): ns3::Trailer::Trailer() [constructor] cls.add_constructor([]) ## trailer.h (module 'network'): ns3::Trailer::Trailer(ns3::Trailer const & arg0) [copy constructor] cls.add_constructor([param('ns3::Trailer const &', 'arg0')]) ## trailer.h (module 'network'): uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator end) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'end')], is_pure_virtual=True, is_virtual=True) ## trailer.h (module 'network'): uint32_t ns3::Trailer::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## trailer.h (module 'network'): static ns3::TypeId ns3::Trailer::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## trailer.h (module 'network'): void ns3::Trailer::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) ## trailer.h (module 'network'): void ns3::Trailer::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3TriangularRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::TriangularRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable::TriangularRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMean() const [member function] cls.add_method('GetMean', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMin() const [member function] cls.add_method('GetMin', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMax() const [member function] cls.add_method('GetMax', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue(double mean, double min, double max) [member function] cls.add_method('GetValue', 'double', [param('double', 'mean'), param('double', 'min'), param('double', 'max')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger(uint32_t mean, uint32_t min, uint32_t max) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'mean'), param('uint32_t', 'min'), param('uint32_t', 'max')]) ## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3UniformRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::UniformRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable::UniformRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMin() const [member function] cls.add_method('GetMin', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMax() const [member function] cls.add_method('GetMax', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue(double min, double max) [member function] cls.add_method('GetValue', 'double', [param('double', 'min'), param('double', 'max')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger(uint32_t min, uint32_t max) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'min'), param('uint32_t', 'max')]) ## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3WeibullRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::WeibullRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable::WeibullRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetScale() const [member function] cls.add_method('GetScale', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetShape() const [member function] cls.add_method('GetShape', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetBound() const [member function] cls.add_method('GetBound', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue(double scale, double shape, double bound) [member function] cls.add_method('GetValue', 'double', [param('double', 'scale'), param('double', 'shape'), param('double', 'bound')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')]) ## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3WifiInformationElement_methods(root_module, cls): cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('==') ## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElement::WifiInformationElement() [constructor] cls.add_constructor([]) ## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElement::WifiInformationElement(ns3::WifiInformationElement const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiInformationElement const &', 'arg0')]) ## wifi-information-element.h (module 'wifi'): ns3::Buffer::Iterator ns3::WifiInformationElement::Deserialize(ns3::Buffer::Iterator i) [member function] cls.add_method('Deserialize', 'ns3::Buffer::Iterator', [param('ns3::Buffer::Iterator', 'i')]) ## wifi-information-element.h (module 'wifi'): ns3::Buffer::Iterator ns3::WifiInformationElement::DeserializeIfPresent(ns3::Buffer::Iterator i) [member function] cls.add_method('DeserializeIfPresent', 'ns3::Buffer::Iterator', [param('ns3::Buffer::Iterator', 'i')]) ## wifi-information-element.h (module 'wifi'): uint8_t ns3::WifiInformationElement::DeserializeInformationField(ns3::Buffer::Iterator start, uint8_t length) [member function] cls.add_method('DeserializeInformationField', 'uint8_t', [param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')], is_pure_virtual=True, is_virtual=True) ## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElementId ns3::WifiInformationElement::ElementId() const [member function] cls.add_method('ElementId', 'ns3::WifiInformationElementId', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-information-element.h (module 'wifi'): uint8_t ns3::WifiInformationElement::GetInformationFieldSize() const [member function] cls.add_method('GetInformationFieldSize', 'uint8_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-information-element.h (module 'wifi'): uint16_t ns3::WifiInformationElement::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint16_t', [], is_const=True) ## wifi-information-element.h (module 'wifi'): void ns3::WifiInformationElement::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## wifi-information-element.h (module 'wifi'): ns3::Buffer::Iterator ns3::WifiInformationElement::Serialize(ns3::Buffer::Iterator i) const [member function] cls.add_method('Serialize', 'ns3::Buffer::Iterator', [param('ns3::Buffer::Iterator', 'i')], is_const=True) ## wifi-information-element.h (module 'wifi'): void ns3::WifiInformationElement::SerializeInformationField(ns3::Buffer::Iterator start) const [member function] cls.add_method('SerializeInformationField', 'void', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3WifiMac_methods(root_module, cls): ## wifi-mac.h (module 'wifi'): ns3::WifiMac::WifiMac() [constructor] cls.add_constructor([]) ## wifi-mac.h (module 'wifi'): ns3::WifiMac::WifiMac(ns3::WifiMac const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiMac const &', 'arg0')]) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::ConfigureStandard(ns3::WifiPhyStandard standard) [member function] cls.add_method('ConfigureStandard', 'void', [param('ns3::WifiPhyStandard', 'standard')]) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::Enqueue(ns3::Ptr<ns3::Packet const> packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function] cls.add_method('Enqueue', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::Enqueue(ns3::Ptr<ns3::Packet const> packet, ns3::Mac48Address to) [member function] cls.add_method('Enqueue', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'to')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetAckTimeout() const [member function] cls.add_method('GetAckTimeout', 'ns3::Time', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Mac48Address ns3::WifiMac::GetAddress() const [member function] cls.add_method('GetAddress', 'ns3::Mac48Address', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetBasicBlockAckTimeout() const [member function] cls.add_method('GetBasicBlockAckTimeout', 'ns3::Time', [], is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Mac48Address ns3::WifiMac::GetBssid() const [member function] cls.add_method('GetBssid', 'ns3::Mac48Address', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetCompressedBlockAckTimeout() const [member function] cls.add_method('GetCompressedBlockAckTimeout', 'ns3::Time', [], is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetCtsTimeout() const [member function] cls.add_method('GetCtsTimeout', 'ns3::Time', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetEifsNoDifs() const [member function] cls.add_method('GetEifsNoDifs', 'ns3::Time', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetMaxPropagationDelay() const [member function] cls.add_method('GetMaxPropagationDelay', 'ns3::Time', [], is_const=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetMsduLifetime() const [member function] cls.add_method('GetMsduLifetime', 'ns3::Time', [], is_const=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetPifs() const [member function] cls.add_method('GetPifs', 'ns3::Time', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetRifs() const [member function] cls.add_method('GetRifs', 'ns3::Time', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetSifs() const [member function] cls.add_method('GetSifs', 'ns3::Time', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Time ns3::WifiMac::GetSlot() const [member function] cls.add_method('GetSlot', 'ns3::Time', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): ns3::Ssid ns3::WifiMac::GetSsid() const [member function] cls.add_method('GetSsid', 'ns3::Ssid', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): static ns3::TypeId ns3::WifiMac::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyPromiscRx(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyPromiscRx', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyRx(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyRx', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyRxDrop(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyRxDrop', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyTx(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyTx', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyTxDrop(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyTxDrop', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetAckTimeout(ns3::Time ackTimeout) [member function] cls.add_method('SetAckTimeout', 'void', [param('ns3::Time', 'ackTimeout')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetAddress(ns3::Mac48Address address) [member function] cls.add_method('SetAddress', 'void', [param('ns3::Mac48Address', 'address')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetBasicBlockAckTimeout(ns3::Time blockAckTimeout) [member function] cls.add_method('SetBasicBlockAckTimeout', 'void', [param('ns3::Time', 'blockAckTimeout')], is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetCompressedBlockAckTimeout(ns3::Time blockAckTimeout) [member function] cls.add_method('SetCompressedBlockAckTimeout', 'void', [param('ns3::Time', 'blockAckTimeout')], is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetCtsTimeout(ns3::Time ctsTimeout) [member function] cls.add_method('SetCtsTimeout', 'void', [param('ns3::Time', 'ctsTimeout')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetEifsNoDifs(ns3::Time eifsNoDifs) [member function] cls.add_method('SetEifsNoDifs', 'void', [param('ns3::Time', 'eifsNoDifs')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetForwardUpCallback(ns3::Callback<void,ns3::Ptr<ns3::Packet>,ns3::Mac48Address,ns3::Mac48Address,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> upCallback) [member function] cls.add_method('SetForwardUpCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetLinkDownCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> linkDown) [member function] cls.add_method('SetLinkDownCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetLinkUpCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> linkUp) [member function] cls.add_method('SetLinkUpCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetMaxPropagationDelay(ns3::Time delay) [member function] cls.add_method('SetMaxPropagationDelay', 'void', [param('ns3::Time', 'delay')]) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetPifs(ns3::Time pifs) [member function] cls.add_method('SetPifs', 'void', [param('ns3::Time', 'pifs')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetPromisc() [member function] cls.add_method('SetPromisc', 'void', [], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetRifs(ns3::Time rifs) [member function] cls.add_method('SetRifs', 'void', [param('ns3::Time', 'rifs')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetSifs(ns3::Time sifs) [member function] cls.add_method('SetSifs', 'void', [param('ns3::Time', 'sifs')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetSlot(ns3::Time slotTime) [member function] cls.add_method('SetSlot', 'void', [param('ns3::Time', 'slotTime')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetSsid(ns3::Ssid ssid) [member function] cls.add_method('SetSsid', 'void', [param('ns3::Ssid', 'ssid')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetWifiPhy(ns3::Ptr<ns3::WifiPhy> phy) [member function] cls.add_method('SetWifiPhy', 'void', [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetWifiRemoteStationManager(ns3::Ptr<ns3::WifiRemoteStationManager> stationManager) [member function] cls.add_method('SetWifiRemoteStationManager', 'void', [param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')], is_pure_virtual=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): bool ns3::WifiMac::SupportsSendFrom() const [member function] cls.add_method('SupportsSendFrom', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::ConfigureDcf(ns3::Ptr<ns3::Dcf> dcf, uint32_t cwmin, uint32_t cwmax, ns3::AcIndex ac) [member function] cls.add_method('ConfigureDcf', 'void', [param('ns3::Ptr< ns3::Dcf >', 'dcf'), param('uint32_t', 'cwmin'), param('uint32_t', 'cwmax'), param('ns3::AcIndex', 'ac')], visibility='protected') ## wifi-mac.h (module 'wifi'): void ns3::WifiMac::FinishConfigureStandard(ns3::WifiPhyStandard standard) [member function] cls.add_method('FinishConfigureStandard', 'void', [param('ns3::WifiPhyStandard', 'standard')], is_pure_virtual=True, visibility='private', is_virtual=True) return def register_Ns3WifiMacHeader_methods(root_module, cls): ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacHeader::WifiMacHeader(ns3::WifiMacHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiMacHeader const &', 'arg0')]) ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacHeader::WifiMacHeader() [constructor] cls.add_constructor([]) ## wifi-mac-header.h (module 'wifi'): uint32_t ns3::WifiMacHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## wifi-mac-header.h (module 'wifi'): ns3::Mac48Address ns3::WifiMacHeader::GetAddr1() const [member function] cls.add_method('GetAddr1', 'ns3::Mac48Address', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): ns3::Mac48Address ns3::WifiMacHeader::GetAddr2() const [member function] cls.add_method('GetAddr2', 'ns3::Mac48Address', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): ns3::Mac48Address ns3::WifiMacHeader::GetAddr3() const [member function] cls.add_method('GetAddr3', 'ns3::Mac48Address', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): ns3::Mac48Address ns3::WifiMacHeader::GetAddr4() const [member function] cls.add_method('GetAddr4', 'ns3::Mac48Address', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): ns3::Time ns3::WifiMacHeader::GetDuration() const [member function] cls.add_method('GetDuration', 'ns3::Time', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): uint16_t ns3::WifiMacHeader::GetFragmentNumber() const [member function] cls.add_method('GetFragmentNumber', 'uint16_t', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): ns3::TypeId ns3::WifiMacHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacHeader::QosAckPolicy ns3::WifiMacHeader::GetQosAckPolicy() const [member function] cls.add_method('GetQosAckPolicy', 'ns3::WifiMacHeader::QosAckPolicy', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): uint8_t ns3::WifiMacHeader::GetQosTid() const [member function] cls.add_method('GetQosTid', 'uint8_t', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): uint8_t ns3::WifiMacHeader::GetQosTxopLimit() const [member function] cls.add_method('GetQosTxopLimit', 'uint8_t', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): uint16_t ns3::WifiMacHeader::GetRawDuration() const [member function] cls.add_method('GetRawDuration', 'uint16_t', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): uint16_t ns3::WifiMacHeader::GetSequenceControl() const [member function] cls.add_method('GetSequenceControl', 'uint16_t', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): uint16_t ns3::WifiMacHeader::GetSequenceNumber() const [member function] cls.add_method('GetSequenceNumber', 'uint16_t', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): uint32_t ns3::WifiMacHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## wifi-mac-header.h (module 'wifi'): uint32_t ns3::WifiMacHeader::GetSize() const [member function] cls.add_method('GetSize', 'uint32_t', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): ns3::WifiMacType ns3::WifiMacHeader::GetType() const [member function] cls.add_method('GetType', 'ns3::WifiMacType', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): static ns3::TypeId ns3::WifiMacHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## wifi-mac-header.h (module 'wifi'): char const * ns3::WifiMacHeader::GetTypeString() const [member function] cls.add_method('GetTypeString', 'char const *', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsAck() const [member function] cls.add_method('IsAck', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsAction() const [member function] cls.add_method('IsAction', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsAssocReq() const [member function] cls.add_method('IsAssocReq', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsAssocResp() const [member function] cls.add_method('IsAssocResp', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsAuthentication() const [member function] cls.add_method('IsAuthentication', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsBeacon() const [member function] cls.add_method('IsBeacon', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsBlockAck() const [member function] cls.add_method('IsBlockAck', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsBlockAckReq() const [member function] cls.add_method('IsBlockAckReq', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsCfpoll() const [member function] cls.add_method('IsCfpoll', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsCtl() const [member function] cls.add_method('IsCtl', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsCts() const [member function] cls.add_method('IsCts', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsData() const [member function] cls.add_method('IsData', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsDeauthentication() const [member function] cls.add_method('IsDeauthentication', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsDisassociation() const [member function] cls.add_method('IsDisassociation', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsFromDs() const [member function] cls.add_method('IsFromDs', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsMgt() const [member function] cls.add_method('IsMgt', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsMoreFragments() const [member function] cls.add_method('IsMoreFragments', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsMultihopAction() const [member function] cls.add_method('IsMultihopAction', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsProbeReq() const [member function] cls.add_method('IsProbeReq', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsProbeResp() const [member function] cls.add_method('IsProbeResp', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsQosAck() const [member function] cls.add_method('IsQosAck', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsQosAmsdu() const [member function] cls.add_method('IsQosAmsdu', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsQosBlockAck() const [member function] cls.add_method('IsQosBlockAck', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsQosData() const [member function] cls.add_method('IsQosData', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsQosEosp() const [member function] cls.add_method('IsQosEosp', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsQosNoAck() const [member function] cls.add_method('IsQosNoAck', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsReassocReq() const [member function] cls.add_method('IsReassocReq', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsReassocResp() const [member function] cls.add_method('IsReassocResp', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsRetry() const [member function] cls.add_method('IsRetry', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsRts() const [member function] cls.add_method('IsRts', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): bool ns3::WifiMacHeader::IsToDs() const [member function] cls.add_method('IsToDs', 'bool', [], is_const=True) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetAction() [member function] cls.add_method('SetAction', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetAddr1(ns3::Mac48Address address) [member function] cls.add_method('SetAddr1', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetAddr2(ns3::Mac48Address address) [member function] cls.add_method('SetAddr2', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetAddr3(ns3::Mac48Address address) [member function] cls.add_method('SetAddr3', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetAddr4(ns3::Mac48Address address) [member function] cls.add_method('SetAddr4', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetAssocReq() [member function] cls.add_method('SetAssocReq', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetAssocResp() [member function] cls.add_method('SetAssocResp', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetBeacon() [member function] cls.add_method('SetBeacon', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetBlockAck() [member function] cls.add_method('SetBlockAck', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetBlockAckReq() [member function] cls.add_method('SetBlockAckReq', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetDsFrom() [member function] cls.add_method('SetDsFrom', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetDsNotFrom() [member function] cls.add_method('SetDsNotFrom', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetDsNotTo() [member function] cls.add_method('SetDsNotTo', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetDsTo() [member function] cls.add_method('SetDsTo', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetDuration(ns3::Time duration) [member function] cls.add_method('SetDuration', 'void', [param('ns3::Time', 'duration')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetFragmentNumber(uint8_t frag) [member function] cls.add_method('SetFragmentNumber', 'void', [param('uint8_t', 'frag')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetId(uint16_t id) [member function] cls.add_method('SetId', 'void', [param('uint16_t', 'id')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetMoreFragments() [member function] cls.add_method('SetMoreFragments', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetMultihopAction() [member function] cls.add_method('SetMultihopAction', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetNoMoreFragments() [member function] cls.add_method('SetNoMoreFragments', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetNoOrder() [member function] cls.add_method('SetNoOrder', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetNoRetry() [member function] cls.add_method('SetNoRetry', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetOrder() [member function] cls.add_method('SetOrder', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetProbeReq() [member function] cls.add_method('SetProbeReq', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetProbeResp() [member function] cls.add_method('SetProbeResp', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosAckPolicy(ns3::WifiMacHeader::QosAckPolicy arg0) [member function] cls.add_method('SetQosAckPolicy', 'void', [param('ns3::WifiMacHeader::QosAckPolicy', 'arg0')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosAmsdu() [member function] cls.add_method('SetQosAmsdu', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosBlockAck() [member function] cls.add_method('SetQosBlockAck', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosEosp() [member function] cls.add_method('SetQosEosp', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosNoAck() [member function] cls.add_method('SetQosNoAck', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosNoAmsdu() [member function] cls.add_method('SetQosNoAmsdu', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosNoEosp() [member function] cls.add_method('SetQosNoEosp', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosNormalAck() [member function] cls.add_method('SetQosNormalAck', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosTid(uint8_t tid) [member function] cls.add_method('SetQosTid', 'void', [param('uint8_t', 'tid')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetQosTxopLimit(uint8_t txop) [member function] cls.add_method('SetQosTxopLimit', 'void', [param('uint8_t', 'txop')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetRawDuration(uint16_t duration) [member function] cls.add_method('SetRawDuration', 'void', [param('uint16_t', 'duration')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetRetry() [member function] cls.add_method('SetRetry', 'void', []) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetSequenceNumber(uint16_t seq) [member function] cls.add_method('SetSequenceNumber', 'void', [param('uint16_t', 'seq')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetType(ns3::WifiMacType type) [member function] cls.add_method('SetType', 'void', [param('ns3::WifiMacType', 'type')]) ## wifi-mac-header.h (module 'wifi'): void ns3::WifiMacHeader::SetTypeData() [member function] cls.add_method('SetTypeData', 'void', []) return def register_Ns3WifiPhy_methods(root_module, cls): ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::WifiPhy(ns3::WifiPhy const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiPhy const &', 'arg0')]) ## wifi-phy.h (module 'wifi'): ns3::WifiPhy::WifiPhy() [constructor] cls.add_constructor([]) ## wifi-phy.h (module 'wifi'): int64_t ns3::WifiPhy::AssignStreams(int64_t stream) [member function] cls.add_method('AssignStreams', 'int64_t', [param('int64_t', 'stream')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): double ns3::WifiPhy::CalculateSnr(ns3::WifiMode txMode, double ber) const [member function] cls.add_method('CalculateSnr', 'double', [param('ns3::WifiMode', 'txMode'), param('double', 'ber')], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): static ns3::Time ns3::WifiPhy::CalculateTxDuration(uint32_t size, ns3::WifiTxVector txvector, ns3::WifiPreamble preamble) [member function] cls.add_method('CalculateTxDuration', 'ns3::Time', [param('uint32_t', 'size'), param('ns3::WifiTxVector', 'txvector'), param('ns3::WifiPreamble', 'preamble')], is_static=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::ConfigureStandard(ns3::WifiPhyStandard standard) [member function] cls.add_method('ConfigureStandard', 'void', [param('ns3::WifiPhyStandard', 'standard')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint32_t ns3::WifiPhy::GetBssMembershipSelector(uint32_t selector) const [member function] cls.add_method('GetBssMembershipSelector', 'uint32_t', [param('uint32_t', 'selector')], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): ns3::Ptr<ns3::WifiChannel> ns3::WifiPhy::GetChannel() const [member function] cls.add_method('GetChannel', 'ns3::Ptr< ns3::WifiChannel >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::GetChannelBonding() const [member function] cls.add_method('GetChannelBonding', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint16_t ns3::WifiPhy::GetChannelNumber() const [member function] cls.add_method('GetChannelNumber', 'uint16_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): ns3::Time ns3::WifiPhy::GetDelayUntilIdle() [member function] cls.add_method('GetDelayUntilIdle', 'ns3::Time', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetDsssRate11Mbps() [member function] cls.add_method('GetDsssRate11Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetDsssRate1Mbps() [member function] cls.add_method('GetDsssRate1Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetDsssRate2Mbps() [member function] cls.add_method('GetDsssRate2Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetDsssRate5_5Mbps() [member function] cls.add_method('GetDsssRate5_5Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetErpOfdmRate12Mbps() [member function] cls.add_method('GetErpOfdmRate12Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetErpOfdmRate18Mbps() [member function] cls.add_method('GetErpOfdmRate18Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetErpOfdmRate24Mbps() [member function] cls.add_method('GetErpOfdmRate24Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetErpOfdmRate36Mbps() [member function] cls.add_method('GetErpOfdmRate36Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetErpOfdmRate48Mbps() [member function] cls.add_method('GetErpOfdmRate48Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetErpOfdmRate54Mbps() [member function] cls.add_method('GetErpOfdmRate54Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetErpOfdmRate6Mbps() [member function] cls.add_method('GetErpOfdmRate6Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetErpOfdmRate9Mbps() [member function] cls.add_method('GetErpOfdmRate9Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): uint32_t ns3::WifiPhy::GetFrequency() const [member function] cls.add_method('GetFrequency', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::GetGreenfield() const [member function] cls.add_method('GetGreenfield', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::GetGuardInterval() const [member function] cls.add_method('GetGuardInterval', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): ns3::Time ns3::WifiPhy::GetLastRxStartTime() const [member function] cls.add_method('GetLastRxStartTime', 'ns3::Time', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::GetLdpc() const [member function] cls.add_method('GetLdpc', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetMFPlcpHeaderMode(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function] cls.add_method('GetMFPlcpHeaderMode', 'ns3::WifiMode', [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], is_static=True) ## wifi-phy.h (module 'wifi'): uint8_t ns3::WifiPhy::GetMcs(uint8_t mcs) const [member function] cls.add_method('GetMcs', 'uint8_t', [param('uint8_t', 'mcs')], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): ns3::WifiModeList ns3::WifiPhy::GetMembershipSelectorModes(uint32_t selector) [member function] cls.add_method('GetMembershipSelectorModes', 'ns3::WifiModeList', [param('uint32_t', 'selector')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): ns3::WifiMode ns3::WifiPhy::GetMode(uint32_t mode) const [member function] cls.add_method('GetMode', 'ns3::WifiMode', [param('uint32_t', 'mode')], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint32_t ns3::WifiPhy::GetNBssMembershipSelectors() const [member function] cls.add_method('GetNBssMembershipSelectors', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint8_t ns3::WifiPhy::GetNMcs() const [member function] cls.add_method('GetNMcs', 'uint8_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint32_t ns3::WifiPhy::GetNModes() const [member function] cls.add_method('GetNModes', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint32_t ns3::WifiPhy::GetNTxPower() const [member function] cls.add_method('GetNTxPower', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint32_t ns3::WifiPhy::GetNumberOfReceiveAntennas() const [member function] cls.add_method('GetNumberOfReceiveAntennas', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint32_t ns3::WifiPhy::GetNumberOfTransmitAntennas() const [member function] cls.add_method('GetNumberOfTransmitAntennas', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate108MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate108MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate120MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate120MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate121_5MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate121_5MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate12Mbps() [member function] cls.add_method('GetOfdmRate12Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate12MbpsBW10MHz() [member function] cls.add_method('GetOfdmRate12MbpsBW10MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate12MbpsBW5MHz() [member function] cls.add_method('GetOfdmRate12MbpsBW5MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate135MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate135MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate135MbpsBW40MHzShGi() [member function] cls.add_method('GetOfdmRate135MbpsBW40MHzShGi', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate13MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate13MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate13_5MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate13_5MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate13_5MbpsBW5MHz() [member function] cls.add_method('GetOfdmRate13_5MbpsBW5MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate14_4MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate14_4MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate150MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate150MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate15MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate15MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate18Mbps() [member function] cls.add_method('GetOfdmRate18Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate18MbpsBW10MHz() [member function] cls.add_method('GetOfdmRate18MbpsBW10MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate19_5MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate19_5MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate1_5MbpsBW5MHz() [member function] cls.add_method('GetOfdmRate1_5MbpsBW5MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate21_7MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate21_7MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate24Mbps() [member function] cls.add_method('GetOfdmRate24Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate24MbpsBW10MHz() [member function] cls.add_method('GetOfdmRate24MbpsBW10MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate26MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate26MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate27MbpsBW10MHz() [member function] cls.add_method('GetOfdmRate27MbpsBW10MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate27MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate27MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate28_9MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate28_9MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate2_25MbpsBW5MHz() [member function] cls.add_method('GetOfdmRate2_25MbpsBW5MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate30MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate30MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate36Mbps() [member function] cls.add_method('GetOfdmRate36Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate39MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate39MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate3MbpsBW10MHz() [member function] cls.add_method('GetOfdmRate3MbpsBW10MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate3MbpsBW5MHz() [member function] cls.add_method('GetOfdmRate3MbpsBW5MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate40_5MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate40_5MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate43_3MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate43_3MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate45MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate45MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate48Mbps() [member function] cls.add_method('GetOfdmRate48Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate4_5MbpsBW10MHz() [member function] cls.add_method('GetOfdmRate4_5MbpsBW10MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate4_5MbpsBW5MHz() [member function] cls.add_method('GetOfdmRate4_5MbpsBW5MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate52MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate52MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate54Mbps() [member function] cls.add_method('GetOfdmRate54Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate54MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate54MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate57_8MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate57_8MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate58_5MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate58_5MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate60MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate60MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate65MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate65MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate65MbpsBW20MHzShGi() [member function] cls.add_method('GetOfdmRate65MbpsBW20MHzShGi', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate6Mbps() [member function] cls.add_method('GetOfdmRate6Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate6MbpsBW10MHz() [member function] cls.add_method('GetOfdmRate6MbpsBW10MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate6MbpsBW5MHz() [member function] cls.add_method('GetOfdmRate6MbpsBW5MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate6_5MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate6_5MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate72_2MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate72_2MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate7_2MbpsBW20MHz() [member function] cls.add_method('GetOfdmRate7_2MbpsBW20MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate81MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate81MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate90MbpsBW40MHz() [member function] cls.add_method('GetOfdmRate90MbpsBW40MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate9Mbps() [member function] cls.add_method('GetOfdmRate9Mbps', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate9MbpsBW10MHz() [member function] cls.add_method('GetOfdmRate9MbpsBW10MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetOfdmRate9MbpsBW5MHz() [member function] cls.add_method('GetOfdmRate9MbpsBW5MHz', 'ns3::WifiMode', [], is_static=True) ## wifi-phy.h (module 'wifi'): static double ns3::WifiPhy::GetPayloadDurationMicroSeconds(uint32_t size, ns3::WifiTxVector txvector) [member function] cls.add_method('GetPayloadDurationMicroSeconds', 'double', [param('uint32_t', 'size'), param('ns3::WifiTxVector', 'txvector')], is_static=True) ## wifi-phy.h (module 'wifi'): static uint32_t ns3::WifiPhy::GetPlcpHeaderDurationMicroSeconds(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function] cls.add_method('GetPlcpHeaderDurationMicroSeconds', 'uint32_t', [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], is_static=True) ## wifi-phy.h (module 'wifi'): static ns3::WifiMode ns3::WifiPhy::GetPlcpHeaderMode(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function] cls.add_method('GetPlcpHeaderMode', 'ns3::WifiMode', [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], is_static=True) ## wifi-phy.h (module 'wifi'): static uint32_t ns3::WifiPhy::GetPlcpHtSigHeaderDurationMicroSeconds(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function] cls.add_method('GetPlcpHtSigHeaderDurationMicroSeconds', 'uint32_t', [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], is_static=True) ## wifi-phy.h (module 'wifi'): static uint32_t ns3::WifiPhy::GetPlcpHtTrainingSymbolDurationMicroSeconds(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble, ns3::WifiTxVector txvector) [member function] cls.add_method('GetPlcpHtTrainingSymbolDurationMicroSeconds', 'uint32_t', [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble'), param('ns3::WifiTxVector', 'txvector')], is_static=True) ## wifi-phy.h (module 'wifi'): static uint32_t ns3::WifiPhy::GetPlcpPreambleDurationMicroSeconds(ns3::WifiMode payloadMode, ns3::WifiPreamble preamble) [member function] cls.add_method('GetPlcpPreambleDurationMicroSeconds', 'uint32_t', [param('ns3::WifiMode', 'payloadMode'), param('ns3::WifiPreamble', 'preamble')], is_static=True) ## wifi-phy.h (module 'wifi'): ns3::Time ns3::WifiPhy::GetStateDuration() [member function] cls.add_method('GetStateDuration', 'ns3::Time', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::GetStbc() const [member function] cls.add_method('GetStbc', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): double ns3::WifiPhy::GetTxPowerEnd() const [member function] cls.add_method('GetTxPowerEnd', 'double', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): double ns3::WifiPhy::GetTxPowerStart() const [member function] cls.add_method('GetTxPowerStart', 'double', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): static ns3::TypeId ns3::WifiPhy::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateBusy() [member function] cls.add_method('IsStateBusy', 'bool', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateCcaBusy() [member function] cls.add_method('IsStateCcaBusy', 'bool', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateIdle() [member function] cls.add_method('IsStateIdle', 'bool', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateRx() [member function] cls.add_method('IsStateRx', 'bool', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateSwitching() [member function] cls.add_method('IsStateSwitching', 'bool', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): bool ns3::WifiPhy::IsStateTx() [member function] cls.add_method('IsStateTx', 'bool', [], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): ns3::WifiMode ns3::WifiPhy::McsToWifiMode(uint8_t mcs) [member function] cls.add_method('McsToWifiMode', 'ns3::WifiMode', [param('uint8_t', 'mcs')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyMonitorSniffRx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) [member function] cls.add_method('NotifyMonitorSniffRx', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('double', 'signalDbm'), param('double', 'noiseDbm')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyMonitorSniffTx(ns3::Ptr<ns3::Packet const> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, uint8_t txPower) [member function] cls.add_method('NotifyMonitorSniffTx', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint16_t', 'channelFreqMhz'), param('uint16_t', 'channelNumber'), param('uint32_t', 'rate'), param('bool', 'isShortPreamble'), param('uint8_t', 'txPower')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyRxBegin(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyRxBegin', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyRxDrop(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyRxDrop', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyRxEnd(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyRxEnd', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyTxBegin(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyTxBegin', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyTxDrop(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyTxDrop', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::NotifyTxEnd(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NotifyTxEnd', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::RegisterListener(ns3::WifiPhyListener * listener) [member function] cls.add_method('RegisterListener', 'void', [param('ns3::WifiPhyListener *', 'listener')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SendPacket(ns3::Ptr<ns3::Packet const> packet, ns3::WifiMode mode, ns3::WifiPreamble preamble, ns3::WifiTxVector txvector) [member function] cls.add_method('SendPacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::WifiMode', 'mode'), param('ns3::WifiPreamble', 'preamble'), param('ns3::WifiTxVector', 'txvector')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetChannelBonding(bool channelbonding) [member function] cls.add_method('SetChannelBonding', 'void', [param('bool', 'channelbonding')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetChannelNumber(uint16_t id) [member function] cls.add_method('SetChannelNumber', 'void', [param('uint16_t', 'id')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetFrequency(uint32_t freq) [member function] cls.add_method('SetFrequency', 'void', [param('uint32_t', 'freq')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetGreenfield(bool greenfield) [member function] cls.add_method('SetGreenfield', 'void', [param('bool', 'greenfield')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetGuardInterval(bool GuardInterval) [member function] cls.add_method('SetGuardInterval', 'void', [param('bool', 'GuardInterval')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetLdpc(bool Ldpc) [member function] cls.add_method('SetLdpc', 'void', [param('bool', 'Ldpc')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetNumberOfReceiveAntennas(uint32_t rx) [member function] cls.add_method('SetNumberOfReceiveAntennas', 'void', [param('uint32_t', 'rx')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetNumberOfTransmitAntennas(uint32_t tx) [member function] cls.add_method('SetNumberOfTransmitAntennas', 'void', [param('uint32_t', 'tx')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetReceiveErrorCallback(ns3::Callback<void,ns3::Ptr<const ns3::Packet>,double,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] cls.add_method('SetReceiveErrorCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, double, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetReceiveOkCallback(ns3::Callback<void,ns3::Ptr<ns3::Packet>,double,ns3::WifiMode,ns3::WifiPreamble,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] cls.add_method('SetReceiveOkCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, double, ns3::WifiMode, ns3::WifiPreamble, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): void ns3::WifiPhy::SetStbc(bool stbc) [member function] cls.add_method('SetStbc', 'void', [param('bool', 'stbc')], is_pure_virtual=True, is_virtual=True) ## wifi-phy.h (module 'wifi'): uint32_t ns3::WifiPhy::WifiModeToMcs(ns3::WifiMode mode) [member function] cls.add_method('WifiModeToMcs', 'uint32_t', [param('ns3::WifiMode', 'mode')], is_pure_virtual=True, is_virtual=True) return def register_Ns3WifiRemoteStationManager_methods(root_module, cls): ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager::WifiRemoteStationManager(ns3::WifiRemoteStationManager const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiRemoteStationManager const &', 'arg0')]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager::WifiRemoteStationManager() [constructor] cls.add_constructor([]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddBasicMcs(uint8_t mcs) [member function] cls.add_method('AddBasicMcs', 'void', [param('uint8_t', 'mcs')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddBasicMode(ns3::WifiMode mode) [member function] cls.add_method('AddBasicMode', 'void', [param('ns3::WifiMode', 'mode')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddStationHtCapabilities(ns3::Mac48Address from, ns3::HtCapabilities htcapabilities) [member function] cls.add_method('AddStationHtCapabilities', 'void', [param('ns3::Mac48Address', 'from'), param('ns3::HtCapabilities', 'htcapabilities')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddSupportedMcs(ns3::Mac48Address address, uint8_t mcs) [member function] cls.add_method('AddSupportedMcs', 'void', [param('ns3::Mac48Address', 'address'), param('uint8_t', 'mcs')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddSupportedMode(ns3::Mac48Address address, ns3::WifiMode mode) [member function] cls.add_method('AddSupportedMode', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'mode')]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::DoGetCtsToSelfTxVector() [member function] cls.add_method('DoGetCtsToSelfTxVector', 'ns3::WifiTxVector', []) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetAckTxVector(ns3::Mac48Address address, ns3::WifiMode dataMode) [member function] cls.add_method('GetAckTxVector', 'ns3::WifiTxVector', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'dataMode')]) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetBasicMcs(uint32_t i) const [member function] cls.add_method('GetBasicMcs', 'uint8_t', [param('uint32_t', 'i')], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetBasicMode(uint32_t i) const [member function] cls.add_method('GetBasicMode', 'ns3::WifiMode', [param('uint32_t', 'i')], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetBlockAckTxVector(ns3::Mac48Address address, ns3::WifiMode dataMode) [member function] cls.add_method('GetBlockAckTxVector', 'ns3::WifiTxVector', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'dataMode')]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetCtsToSelfTxVector(ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('GetCtsToSelfTxVector', 'ns3::WifiTxVector', [param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetCtsTxVector(ns3::Mac48Address address, ns3::WifiMode rtsMode) [member function] cls.add_method('GetCtsTxVector', 'ns3::WifiTxVector', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'rtsMode')]) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetDataTxVector(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet, uint32_t fullPacketSize) [member function] cls.add_method('GetDataTxVector', 'ns3::WifiTxVector', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fullPacketSize')]) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetDefaultMcs() const [member function] cls.add_method('GetDefaultMcs', 'uint8_t', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetDefaultMode() const [member function] cls.add_method('GetDefaultMode', 'ns3::WifiMode', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel() const [member function] cls.add_method('GetDefaultTxPowerLevel', 'uint8_t', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetFragmentOffset(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet, uint32_t fragmentNumber) [member function] cls.add_method('GetFragmentOffset', 'uint32_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fragmentNumber')]) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetFragmentSize(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet, uint32_t fragmentNumber) [member function] cls.add_method('GetFragmentSize', 'uint32_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fragmentNumber')]) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetFragmentationThreshold() const [member function] cls.add_method('GetFragmentationThreshold', 'uint32_t', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetGreenfieldSupported(ns3::Mac48Address address) const [member function] cls.add_method('GetGreenfieldSupported', 'bool', [param('ns3::Mac48Address', 'address')], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationInfo ns3::WifiRemoteStationManager::GetInfo(ns3::Mac48Address address) [member function] cls.add_method('GetInfo', 'ns3::WifiRemoteStationInfo', [param('ns3::Mac48Address', 'address')]) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetMaxSlrc() const [member function] cls.add_method('GetMaxSlrc', 'uint32_t', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetMaxSsrc() const [member function] cls.add_method('GetMaxSsrc', 'uint32_t', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNBasicMcs() const [member function] cls.add_method('GetNBasicMcs', 'uint32_t', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNBasicModes() const [member function] cls.add_method('GetNBasicModes', 'uint32_t', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetNonUnicastMode() const [member function] cls.add_method('GetNonUnicastMode', 'ns3::WifiMode', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNumberOfTransmitAntennas() [member function] cls.add_method('GetNumberOfTransmitAntennas', 'uint32_t', []) ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetRtsCtsThreshold() const [member function] cls.add_method('GetRtsCtsThreshold', 'uint32_t', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetRtsTxVector(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('GetRtsTxVector', 'ns3::WifiTxVector', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-remote-station-manager.h (module 'wifi'): static ns3::TypeId ns3::WifiRemoteStationManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::HasHtSupported() const [member function] cls.add_method('HasHtSupported', 'bool', [], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsAssociated(ns3::Mac48Address address) const [member function] cls.add_method('IsAssociated', 'bool', [param('ns3::Mac48Address', 'address')], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsBrandNew(ns3::Mac48Address address) const [member function] cls.add_method('IsBrandNew', 'bool', [param('ns3::Mac48Address', 'address')], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsLastFragment(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet, uint32_t fragmentNumber) [member function] cls.add_method('IsLastFragment', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fragmentNumber')]) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsWaitAssocTxOk(ns3::Mac48Address address) const [member function] cls.add_method('IsWaitAssocTxOk', 'bool', [param('ns3::Mac48Address', 'address')], is_const=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedCtsToSelf(ns3::WifiTxVector txVector) [member function] cls.add_method('NeedCtsToSelf', 'bool', [param('ns3::WifiTxVector', 'txVector')]) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedDataRetransmission(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NeedDataRetransmission', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedFragmentation(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NeedFragmentation', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedRts(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NeedRts', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedRtsRetransmission(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('NeedRtsRetransmission', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::PrepareForQueue(ns3::Mac48Address address, ns3::WifiMacHeader const * header, ns3::Ptr<ns3::Packet const> packet, uint32_t fullPacketSize) [member function] cls.add_method('PrepareForQueue', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('uint32_t', 'fullPacketSize')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RecordDisassociated(ns3::Mac48Address address) [member function] cls.add_method('RecordDisassociated', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RecordGotAssocTxFailed(ns3::Mac48Address address) [member function] cls.add_method('RecordGotAssocTxFailed', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RecordGotAssocTxOk(ns3::Mac48Address address) [member function] cls.add_method('RecordGotAssocTxOk', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RecordWaitAssocTxOk(ns3::Mac48Address address) [member function] cls.add_method('RecordWaitAssocTxOk', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportDataFailed(ns3::Mac48Address address, ns3::WifiMacHeader const * header) [member function] cls.add_method('ReportDataFailed', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportDataOk(ns3::Mac48Address address, ns3::WifiMacHeader const * header, double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] cls.add_method('ReportDataOk', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportFinalDataFailed(ns3::Mac48Address address, ns3::WifiMacHeader const * header) [member function] cls.add_method('ReportFinalDataFailed', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportFinalRtsFailed(ns3::Mac48Address address, ns3::WifiMacHeader const * header) [member function] cls.add_method('ReportFinalRtsFailed', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportRtsFailed(ns3::Mac48Address address, ns3::WifiMacHeader const * header) [member function] cls.add_method('ReportRtsFailed', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportRtsOk(ns3::Mac48Address address, ns3::WifiMacHeader const * header, double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] cls.add_method('ReportRtsOk', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportRxOk(ns3::Mac48Address address, ns3::WifiMacHeader const * header, double rxSnr, ns3::WifiMode txMode) [member function] cls.add_method('ReportRxOk', 'void', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMacHeader const *', 'header'), param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::Reset() [member function] cls.add_method('Reset', 'void', []) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::Reset(ns3::Mac48Address address) [member function] cls.add_method('Reset', 'void', [param('ns3::Mac48Address', 'address')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetDefaultTxPowerLevel(uint8_t txPower) [member function] cls.add_method('SetDefaultTxPowerLevel', 'void', [param('uint8_t', 'txPower')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetFragmentationThreshold(uint32_t threshold) [member function] cls.add_method('SetFragmentationThreshold', 'void', [param('uint32_t', 'threshold')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetHtSupported(bool enable) [member function] cls.add_method('SetHtSupported', 'void', [param('bool', 'enable')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetMaxSlrc(uint32_t maxSlrc) [member function] cls.add_method('SetMaxSlrc', 'void', [param('uint32_t', 'maxSlrc')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetMaxSsrc(uint32_t maxSsrc) [member function] cls.add_method('SetMaxSsrc', 'void', [param('uint32_t', 'maxSsrc')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetRtsCtsThreshold(uint32_t threshold) [member function] cls.add_method('SetRtsCtsThreshold', 'void', [param('uint32_t', 'threshold')]) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetupPhy(ns3::Ptr<ns3::WifiPhy> phy) [member function] cls.add_method('SetupPhy', 'void', [param('ns3::Ptr< ns3::WifiPhy >', 'phy')], is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetGreenfield(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetGreenfield', 'bool', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetLongRetryCount(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetLongRetryCount', 'uint32_t', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetMcsSupported(ns3::WifiRemoteStation const * station, uint32_t i) const [member function] cls.add_method('GetMcsSupported', 'uint8_t', [param('ns3::WifiRemoteStation const *', 'station'), param('uint32_t', 'i')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNMcsSupported(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetNMcsSupported', 'uint32_t', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNSupported(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetNSupported', 'uint32_t', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNumberOfReceiveAntennas(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetNumberOfReceiveAntennas', 'uint32_t', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNumberOfTransmitAntennas(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetNumberOfTransmitAntennas', 'uint32_t', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetShortGuardInterval(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetShortGuardInterval', 'bool', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetShortRetryCount(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetShortRetryCount', 'uint32_t', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetStbc(ns3::WifiRemoteStation const * station) const [member function] cls.add_method('GetStbc', 'bool', [param('ns3::WifiRemoteStation const *', 'station')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetSupported(ns3::WifiRemoteStation const * station, uint32_t i) const [member function] cls.add_method('GetSupported', 'ns3::WifiMode', [param('ns3::WifiRemoteStation const *', 'station'), param('uint32_t', 'i')], is_const=True, visibility='protected') ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation * ns3::WifiRemoteStationManager::DoCreateStation() const [member function] cls.add_method('DoCreateStation', 'ns3::WifiRemoteStation *', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoGetAckTxGuardInterval(ns3::Mac48Address address, ns3::WifiMode ackMode) [member function] cls.add_method('DoGetAckTxGuardInterval', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ackMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetAckTxNess(ns3::Mac48Address address, ns3::WifiMode ackMode) [member function] cls.add_method('DoGetAckTxNess', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ackMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetAckTxNss(ns3::Mac48Address address, ns3::WifiMode ackMode) [member function] cls.add_method('DoGetAckTxNss', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ackMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetAckTxPowerLevel(ns3::Mac48Address address, ns3::WifiMode ackMode) [member function] cls.add_method('DoGetAckTxPowerLevel', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ackMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoGetAckTxStbc(ns3::Mac48Address address, ns3::WifiMode ackMode) [member function] cls.add_method('DoGetAckTxStbc', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ackMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoGetBlockAckTxGuardInterval(ns3::Mac48Address address, ns3::WifiMode blockAckMode) [member function] cls.add_method('DoGetBlockAckTxGuardInterval', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'blockAckMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetBlockAckTxNess(ns3::Mac48Address address, ns3::WifiMode blockAckMode) [member function] cls.add_method('DoGetBlockAckTxNess', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'blockAckMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetBlockAckTxNss(ns3::Mac48Address address, ns3::WifiMode blockAckMode) [member function] cls.add_method('DoGetBlockAckTxNss', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'blockAckMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetBlockAckTxPowerLevel(ns3::Mac48Address address, ns3::WifiMode blockAckMode) [member function] cls.add_method('DoGetBlockAckTxPowerLevel', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'blockAckMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoGetBlockAckTxStbc(ns3::Mac48Address address, ns3::WifiMode blockAckMode) [member function] cls.add_method('DoGetBlockAckTxStbc', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'blockAckMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoGetCtsTxGuardInterval(ns3::Mac48Address address, ns3::WifiMode ctsMode) [member function] cls.add_method('DoGetCtsTxGuardInterval', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ctsMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetCtsTxNess(ns3::Mac48Address address, ns3::WifiMode ctsMode) [member function] cls.add_method('DoGetCtsTxNess', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ctsMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetCtsTxNss(ns3::Mac48Address address, ns3::WifiMode ctsMode) [member function] cls.add_method('DoGetCtsTxNss', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ctsMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::DoGetCtsTxPowerLevel(ns3::Mac48Address address, ns3::WifiMode ctsMode) [member function] cls.add_method('DoGetCtsTxPowerLevel', 'uint8_t', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ctsMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoGetCtsTxStbc(ns3::Mac48Address address, ns3::WifiMode ctsMode) [member function] cls.add_method('DoGetCtsTxStbc', 'bool', [param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'ctsMode')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::DoGetDataTxVector(ns3::WifiRemoteStation * station, uint32_t size) [member function] cls.add_method('DoGetDataTxVector', 'ns3::WifiTxVector', [param('ns3::WifiRemoteStation *', 'station'), param('uint32_t', 'size')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::DoGetRtsTxVector(ns3::WifiRemoteStation * station) [member function] cls.add_method('DoGetRtsTxVector', 'ns3::WifiTxVector', [param('ns3::WifiRemoteStation *', 'station')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoNeedDataRetransmission(ns3::WifiRemoteStation * station, ns3::Ptr<ns3::Packet const> packet, bool normally) [member function] cls.add_method('DoNeedDataRetransmission', 'bool', [param('ns3::WifiRemoteStation *', 'station'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('bool', 'normally')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoNeedFragmentation(ns3::WifiRemoteStation * station, ns3::Ptr<ns3::Packet const> packet, bool normally) [member function] cls.add_method('DoNeedFragmentation', 'bool', [param('ns3::WifiRemoteStation *', 'station'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('bool', 'normally')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoNeedRts(ns3::WifiRemoteStation * station, ns3::Ptr<ns3::Packet const> packet, bool normally) [member function] cls.add_method('DoNeedRts', 'bool', [param('ns3::WifiRemoteStation *', 'station'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('bool', 'normally')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoNeedRtsRetransmission(ns3::WifiRemoteStation * station, ns3::Ptr<ns3::Packet const> packet, bool normally) [member function] cls.add_method('DoNeedRtsRetransmission', 'bool', [param('ns3::WifiRemoteStation *', 'station'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('bool', 'normally')], visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportDataFailed(ns3::WifiRemoteStation * station) [member function] cls.add_method('DoReportDataFailed', 'void', [param('ns3::WifiRemoteStation *', 'station')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportDataOk(ns3::WifiRemoteStation * station, double ackSnr, ns3::WifiMode ackMode, double dataSnr) [member function] cls.add_method('DoReportDataOk', 'void', [param('ns3::WifiRemoteStation *', 'station'), param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportFinalDataFailed(ns3::WifiRemoteStation * station) [member function] cls.add_method('DoReportFinalDataFailed', 'void', [param('ns3::WifiRemoteStation *', 'station')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportFinalRtsFailed(ns3::WifiRemoteStation * station) [member function] cls.add_method('DoReportFinalRtsFailed', 'void', [param('ns3::WifiRemoteStation *', 'station')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportRtsFailed(ns3::WifiRemoteStation * station) [member function] cls.add_method('DoReportRtsFailed', 'void', [param('ns3::WifiRemoteStation *', 'station')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportRtsOk(ns3::WifiRemoteStation * station, double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function] cls.add_method('DoReportRtsOk', 'void', [param('ns3::WifiRemoteStation *', 'station'), param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportRxOk(ns3::WifiRemoteStation * station, double rxSnr, ns3::WifiMode txMode) [member function] cls.add_method('DoReportRxOk', 'void', [param('ns3::WifiRemoteStation *', 'station'), param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')], is_pure_virtual=True, visibility='private', is_virtual=True) ## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsLowLatency() const [member function] cls.add_method('IsLowLatency', 'bool', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) return def register_Ns3ZetaRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZetaRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable::ZetaRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetAlpha() const [member function] cls.add_method('GetAlpha', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue(double alpha) [member function] cls.add_method('GetValue', 'double', [param('double', 'alpha')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger(uint32_t alpha) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'alpha')]) ## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3ZipfRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZipfRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable::ZipfRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetN() const [member function] cls.add_method('GetN', 'uint32_t', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetAlpha() const [member function] cls.add_method('GetAlpha', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue(uint32_t n, double alpha) [member function] cls.add_method('GetValue', 'double', [param('uint32_t', 'n'), param('double', 'alpha')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger(uint32_t n, uint32_t alpha) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'n'), param('uint32_t', 'alpha')]) ## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3ArpCache_methods(root_module, cls): ## arp-cache.h (module 'internet'): ns3::ArpCache::ArpCache() [constructor] cls.add_constructor([]) ## arp-cache.h (module 'internet'): ns3::ArpCache::Entry * ns3::ArpCache::Add(ns3::Ipv4Address to) [member function] cls.add_method('Add', 'ns3::ArpCache::Entry *', [param('ns3::Ipv4Address', 'to')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::Flush() [member function] cls.add_method('Flush', 'void', []) ## arp-cache.h (module 'internet'): ns3::Time ns3::ArpCache::GetAliveTimeout() const [member function] cls.add_method('GetAliveTimeout', 'ns3::Time', [], is_const=True) ## arp-cache.h (module 'internet'): ns3::Time ns3::ArpCache::GetDeadTimeout() const [member function] cls.add_method('GetDeadTimeout', 'ns3::Time', [], is_const=True) ## arp-cache.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::ArpCache::GetDevice() const [member function] cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [], is_const=True) ## arp-cache.h (module 'internet'): ns3::Ptr<ns3::Ipv4Interface> ns3::ArpCache::GetInterface() const [member function] cls.add_method('GetInterface', 'ns3::Ptr< ns3::Ipv4Interface >', [], is_const=True) ## arp-cache.h (module 'internet'): static ns3::TypeId ns3::ArpCache::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## arp-cache.h (module 'internet'): ns3::Time ns3::ArpCache::GetWaitReplyTimeout() const [member function] cls.add_method('GetWaitReplyTimeout', 'ns3::Time', [], is_const=True) ## arp-cache.h (module 'internet'): ns3::ArpCache::Entry * ns3::ArpCache::Lookup(ns3::Ipv4Address destination) [member function] cls.add_method('Lookup', 'ns3::ArpCache::Entry *', [param('ns3::Ipv4Address', 'destination')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::SetAliveTimeout(ns3::Time aliveTimeout) [member function] cls.add_method('SetAliveTimeout', 'void', [param('ns3::Time', 'aliveTimeout')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::SetArpRequestCallback(ns3::Callback<void, ns3::Ptr<ns3::ArpCache const>, ns3::Ipv4Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> arpRequestCallback) [member function] cls.add_method('SetArpRequestCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::ArpCache const >, ns3::Ipv4Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arpRequestCallback')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::SetDeadTimeout(ns3::Time deadTimeout) [member function] cls.add_method('SetDeadTimeout', 'void', [param('ns3::Time', 'deadTimeout')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::SetDevice(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<ns3::Ipv4Interface> interface) [member function] cls.add_method('SetDevice', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Ipv4Interface >', 'interface')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::SetWaitReplyTimeout(ns3::Time waitReplyTimeout) [member function] cls.add_method('SetWaitReplyTimeout', 'void', [param('ns3::Time', 'waitReplyTimeout')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::StartWaitReplyTimer() [member function] cls.add_method('StartWaitReplyTimer', 'void', []) ## arp-cache.h (module 'internet'): void ns3::ArpCache::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='private', is_virtual=True) return def register_Ns3ArpCacheEntry_methods(root_module, cls): ## arp-cache.h (module 'internet'): ns3::ArpCache::Entry::Entry(ns3::ArpCache::Entry const & arg0) [copy constructor] cls.add_constructor([param('ns3::ArpCache::Entry const &', 'arg0')]) ## arp-cache.h (module 'internet'): ns3::ArpCache::Entry::Entry(ns3::ArpCache * arp) [constructor] cls.add_constructor([param('ns3::ArpCache *', 'arp')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::ClearRetries() [member function] cls.add_method('ClearRetries', 'void', []) ## arp-cache.h (module 'internet'): ns3::Ptr<ns3::Packet> ns3::ArpCache::Entry::DequeuePending() [member function] cls.add_method('DequeuePending', 'ns3::Ptr< ns3::Packet >', []) ## arp-cache.h (module 'internet'): ns3::Ipv4Address ns3::ArpCache::Entry::GetIpv4Address() const [member function] cls.add_method('GetIpv4Address', 'ns3::Ipv4Address', [], is_const=True) ## arp-cache.h (module 'internet'): ns3::Address ns3::ArpCache::Entry::GetMacAddress() const [member function] cls.add_method('GetMacAddress', 'ns3::Address', [], is_const=True) ## arp-cache.h (module 'internet'): uint32_t ns3::ArpCache::Entry::GetRetries() const [member function] cls.add_method('GetRetries', 'uint32_t', [], is_const=True) ## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::IncrementRetries() [member function] cls.add_method('IncrementRetries', 'void', []) ## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsAlive() [member function] cls.add_method('IsAlive', 'bool', []) ## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsDead() [member function] cls.add_method('IsDead', 'bool', []) ## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsExpired() const [member function] cls.add_method('IsExpired', 'bool', [], is_const=True) ## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsWaitReply() [member function] cls.add_method('IsWaitReply', 'bool', []) ## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::MarkAlive(ns3::Address macAddress) [member function] cls.add_method('MarkAlive', 'void', [param('ns3::Address', 'macAddress')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::MarkDead() [member function] cls.add_method('MarkDead', 'void', []) ## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::MarkWaitReply(ns3::Ptr<ns3::Packet> waiting) [member function] cls.add_method('MarkWaitReply', 'void', [param('ns3::Ptr< ns3::Packet >', 'waiting')]) ## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::SetIpv4Address(ns3::Ipv4Address destination) [member function] cls.add_method('SetIpv4Address', 'void', [param('ns3::Ipv4Address', 'destination')]) ## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::UpdateWaitReply(ns3::Ptr<ns3::Packet> waiting) [member function] cls.add_method('UpdateWaitReply', 'bool', [param('ns3::Ptr< ns3::Packet >', 'waiting')]) return def register_Ns3AttributeAccessor_methods(root_module, cls): ## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')]) ## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor() [constructor] cls.add_constructor([]) ## attribute.h (module 'core'): bool ns3::AttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function] cls.add_method('Get', 'bool', [param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasGetter() const [member function] cls.add_method('HasGetter', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasSetter() const [member function] cls.add_method('HasSetter', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function] cls.add_method('Set', 'bool', [param('ns3::ObjectBase *', 'object', transfer_ownership=False), param('ns3::AttributeValue const &', 'value')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3AttributeChecker_methods(root_module, cls): ## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker(ns3::AttributeChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeChecker const &', 'arg0')]) ## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker() [constructor] cls.add_constructor([]) ## attribute.h (module 'core'): bool ns3::AttributeChecker::Check(ns3::AttributeValue const & value) const [member function] cls.add_method('Check', 'bool', [param('ns3::AttributeValue const &', 'value')], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function] cls.add_method('Copy', 'bool', [param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::Create() const [member function] cls.add_method('Create', 'ns3::Ptr< ns3::AttributeValue >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::CreateValidValue(ns3::AttributeValue const & value) const [member function] cls.add_method('CreateValidValue', 'ns3::Ptr< ns3::AttributeValue >', [param('ns3::AttributeValue const &', 'value')], is_const=True) ## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetUnderlyingTypeInformation() const [member function] cls.add_method('GetUnderlyingTypeInformation', 'std::string', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetValueTypeName() const [member function] cls.add_method('GetValueTypeName', 'std::string', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeChecker::HasUnderlyingTypeInformation() const [member function] cls.add_method('HasUnderlyingTypeInformation', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3AttributeValue_methods(root_module, cls): ## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue(ns3::AttributeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeValue const &', 'arg0')]) ## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue() [constructor] cls.add_constructor([]) ## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_pure_virtual=True, is_virtual=True) ## attribute.h (module 'core'): std::string ns3::AttributeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3CallbackChecker_methods(root_module, cls): ## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker() [constructor] cls.add_constructor([]) ## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker(ns3::CallbackChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::CallbackChecker const &', 'arg0')]) return def register_Ns3CallbackImplBase_methods(root_module, cls): ## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase() [constructor] cls.add_constructor([]) ## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase(ns3::CallbackImplBase const & arg0) [copy constructor] cls.add_constructor([param('ns3::CallbackImplBase const &', 'arg0')]) ## callback.h (module 'core'): bool ns3::CallbackImplBase::IsEqual(ns3::Ptr<ns3::CallbackImplBase const> other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ptr< ns3::CallbackImplBase const >', 'other')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3CallbackValue_methods(root_module, cls): ## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::CallbackValue const &', 'arg0')]) ## callback.h (module 'core'): ns3::CallbackValue::CallbackValue() [constructor] cls.add_constructor([]) ## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackBase const & base) [constructor] cls.add_constructor([param('ns3::CallbackBase const &', 'base')]) ## callback.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::CallbackValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## callback.h (module 'core'): bool ns3::CallbackValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## callback.h (module 'core'): std::string ns3::CallbackValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## callback.h (module 'core'): void ns3::CallbackValue::Set(ns3::CallbackBase base) [member function] cls.add_method('Set', 'void', [param('ns3::CallbackBase', 'base')]) return def register_Ns3ConstantRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ConstantRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable::ConstantRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetConstant() const [member function] cls.add_method('GetConstant', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue(double constant) [member function] cls.add_method('GetValue', 'double', [param('double', 'constant')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger(uint32_t constant) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'constant')]) ## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3DeterministicRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::DeterministicRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable::DeterministicRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): void ns3::DeterministicRandomVariable::SetValueArray(double * values, uint64_t length) [member function] cls.add_method('SetValueArray', 'void', [param('double *', 'values'), param('uint64_t', 'length')]) ## random-variable-stream.h (module 'core'): double ns3::DeterministicRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::DeterministicRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3EmpiricalRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable::EmpiricalRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::CDF(double v, double c) [member function] cls.add_method('CDF', 'void', [param('double', 'v'), param('double', 'c')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::EmpiricalRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::EmpiricalRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::Interpolate(double arg0, double arg1, double arg2, double arg3, double arg4) [member function] cls.add_method('Interpolate', 'double', [param('double', 'arg0'), param('double', 'arg1'), param('double', 'arg2'), param('double', 'arg3'), param('double', 'arg4')], visibility='private', is_virtual=True) ## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::Validate() [member function] cls.add_method('Validate', 'void', [], visibility='private', is_virtual=True) return def register_Ns3EmptyAttributeValue_methods(root_module, cls): ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')]) ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue() [constructor] cls.add_constructor([]) ## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, visibility='private', is_virtual=True) ## attribute.h (module 'core'): bool ns3::EmptyAttributeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], visibility='private', is_virtual=True) ## attribute.h (module 'core'): std::string ns3::EmptyAttributeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, visibility='private', is_virtual=True) return def register_Ns3EnumChecker_methods(root_module, cls): ## enum.h (module 'core'): ns3::EnumChecker::EnumChecker(ns3::EnumChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::EnumChecker const &', 'arg0')]) ## enum.h (module 'core'): ns3::EnumChecker::EnumChecker() [constructor] cls.add_constructor([]) ## enum.h (module 'core'): void ns3::EnumChecker::Add(int v, std::string name) [member function] cls.add_method('Add', 'void', [param('int', 'v'), param('std::string', 'name')]) ## enum.h (module 'core'): void ns3::EnumChecker::AddDefault(int v, std::string name) [member function] cls.add_method('AddDefault', 'void', [param('int', 'v'), param('std::string', 'name')]) ## enum.h (module 'core'): bool ns3::EnumChecker::Check(ns3::AttributeValue const & value) const [member function] cls.add_method('Check', 'bool', [param('ns3::AttributeValue const &', 'value')], is_const=True, is_virtual=True) ## enum.h (module 'core'): bool ns3::EnumChecker::Copy(ns3::AttributeValue const & src, ns3::AttributeValue & dst) const [member function] cls.add_method('Copy', 'bool', [param('ns3::AttributeValue const &', 'src'), param('ns3::AttributeValue &', 'dst')], is_const=True, is_virtual=True) ## enum.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EnumChecker::Create() const [member function] cls.add_method('Create', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## enum.h (module 'core'): std::string ns3::EnumChecker::GetUnderlyingTypeInformation() const [member function] cls.add_method('GetUnderlyingTypeInformation', 'std::string', [], is_const=True, is_virtual=True) ## enum.h (module 'core'): std::string ns3::EnumChecker::GetValueTypeName() const [member function] cls.add_method('GetValueTypeName', 'std::string', [], is_const=True, is_virtual=True) ## enum.h (module 'core'): bool ns3::EnumChecker::HasUnderlyingTypeInformation() const [member function] cls.add_method('HasUnderlyingTypeInformation', 'bool', [], is_const=True, is_virtual=True) return def register_Ns3EnumValue_methods(root_module, cls): ## enum.h (module 'core'): ns3::EnumValue::EnumValue(ns3::EnumValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::EnumValue const &', 'arg0')]) ## enum.h (module 'core'): ns3::EnumValue::EnumValue() [constructor] cls.add_constructor([]) ## enum.h (module 'core'): ns3::EnumValue::EnumValue(int v) [constructor] cls.add_constructor([param('int', 'v')]) ## enum.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EnumValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## enum.h (module 'core'): bool ns3::EnumValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## enum.h (module 'core'): int ns3::EnumValue::Get() const [member function] cls.add_method('Get', 'int', [], is_const=True) ## enum.h (module 'core'): std::string ns3::EnumValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## enum.h (module 'core'): void ns3::EnumValue::Set(int v) [member function] cls.add_method('Set', 'void', [param('int', 'v')]) return def register_Ns3ErlangRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ErlangRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable::ErlangRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetK() const [member function] cls.add_method('GetK', 'uint32_t', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetLambda() const [member function] cls.add_method('GetLambda', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue(uint32_t k, double lambda) [member function] cls.add_method('GetValue', 'double', [param('uint32_t', 'k'), param('double', 'lambda')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger(uint32_t k, uint32_t lambda) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'k'), param('uint32_t', 'lambda')]) ## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3EventImpl_methods(root_module, cls): ## event-impl.h (module 'core'): ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [copy constructor] cls.add_constructor([param('ns3::EventImpl const &', 'arg0')]) ## event-impl.h (module 'core'): ns3::EventImpl::EventImpl() [constructor] cls.add_constructor([]) ## event-impl.h (module 'core'): void ns3::EventImpl::Cancel() [member function] cls.add_method('Cancel', 'void', []) ## event-impl.h (module 'core'): void ns3::EventImpl::Invoke() [member function] cls.add_method('Invoke', 'void', []) ## event-impl.h (module 'core'): bool ns3::EventImpl::IsCancelled() [member function] cls.add_method('IsCancelled', 'bool', []) ## event-impl.h (module 'core'): void ns3::EventImpl::Notify() [member function] cls.add_method('Notify', 'void', [], is_pure_virtual=True, visibility='protected', is_virtual=True) return def register_Ns3ExponentialRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ExponentialRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable::ExponentialRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetMean() const [member function] cls.add_method('GetMean', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetBound() const [member function] cls.add_method('GetBound', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue(double mean, double bound) [member function] cls.add_method('GetValue', 'double', [param('double', 'mean'), param('double', 'bound')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger(uint32_t mean, uint32_t bound) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'mean'), param('uint32_t', 'bound')]) ## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3GammaRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::GammaRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable::GammaRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetAlpha() const [member function] cls.add_method('GetAlpha', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetBeta() const [member function] cls.add_method('GetBeta', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue(double alpha, double beta) [member function] cls.add_method('GetValue', 'double', [param('double', 'alpha'), param('double', 'beta')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger(uint32_t alpha, uint32_t beta) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'alpha'), param('uint32_t', 'beta')]) ## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3HtCapabilities_methods(root_module, cls): cls.add_output_stream_operator() ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilities::HtCapabilities(ns3::HtCapabilities const & arg0) [copy constructor] cls.add_constructor([param('ns3::HtCapabilities const &', 'arg0')]) ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilities::HtCapabilities() [constructor] cls.add_constructor([]) ## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::DeserializeInformationField(ns3::Buffer::Iterator start, uint8_t length) [member function] cls.add_method('DeserializeInformationField', 'uint8_t', [param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')], is_virtual=True) ## ht-capabilities.h (module 'wifi'): ns3::WifiInformationElementId ns3::HtCapabilities::ElementId() const [member function] cls.add_method('ElementId', 'ns3::WifiInformationElementId', [], is_const=True, is_virtual=True) ## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetAmpduParameters() const [member function] cls.add_method('GetAmpduParameters', 'uint8_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetGreenfield() const [member function] cls.add_method('GetGreenfield', 'uint8_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): uint16_t ns3::HtCapabilities::GetHtCapabilitiesInfo() const [member function] cls.add_method('GetHtCapabilitiesInfo', 'uint16_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetInformationFieldSize() const [member function] cls.add_method('GetInformationFieldSize', 'uint8_t', [], is_const=True, is_virtual=True) ## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetLdpc() const [member function] cls.add_method('GetLdpc', 'uint8_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): uint8_t * ns3::HtCapabilities::GetRxMcsBitmask() [member function] cls.add_method('GetRxMcsBitmask', 'uint8_t *', []) ## ht-capabilities.h (module 'wifi'): uint16_t ns3::HtCapabilities::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint16_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetShortGuardInterval20() const [member function] cls.add_method('GetShortGuardInterval20', 'uint8_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetSupportedChannelWidth() const [member function] cls.add_method('GetSupportedChannelWidth', 'uint8_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): uint64_t ns3::HtCapabilities::GetSupportedMcsSet1() const [member function] cls.add_method('GetSupportedMcsSet1', 'uint64_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): uint64_t ns3::HtCapabilities::GetSupportedMcsSet2() const [member function] cls.add_method('GetSupportedMcsSet2', 'uint64_t', [], is_const=True) ## ht-capabilities.h (module 'wifi'): bool ns3::HtCapabilities::IsSupportedMcs(uint8_t mcs) [member function] cls.add_method('IsSupportedMcs', 'bool', [param('uint8_t', 'mcs')]) ## ht-capabilities.h (module 'wifi'): ns3::Buffer::Iterator ns3::HtCapabilities::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'ns3::Buffer::Iterator', [param('ns3::Buffer::Iterator', 'start')], is_const=True) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SerializeInformationField(ns3::Buffer::Iterator start) const [member function] cls.add_method('SerializeInformationField', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetAmpduParameters(uint8_t ctrl) [member function] cls.add_method('SetAmpduParameters', 'void', [param('uint8_t', 'ctrl')]) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetGreenfield(uint8_t greenfield) [member function] cls.add_method('SetGreenfield', 'void', [param('uint8_t', 'greenfield')]) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetHtCapabilitiesInfo(uint16_t ctrl) [member function] cls.add_method('SetHtCapabilitiesInfo', 'void', [param('uint16_t', 'ctrl')]) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetHtSupported(uint8_t htsupported) [member function] cls.add_method('SetHtSupported', 'void', [param('uint8_t', 'htsupported')]) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetLdpc(uint8_t ldpc) [member function] cls.add_method('SetLdpc', 'void', [param('uint8_t', 'ldpc')]) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetRxMcsBitmask(uint8_t index) [member function] cls.add_method('SetRxMcsBitmask', 'void', [param('uint8_t', 'index')]) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetShortGuardInterval20(uint8_t shortguardinterval) [member function] cls.add_method('SetShortGuardInterval20', 'void', [param('uint8_t', 'shortguardinterval')]) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetSupportedChannelWidth(uint8_t supportedchannelwidth) [member function] cls.add_method('SetSupportedChannelWidth', 'void', [param('uint8_t', 'supportedchannelwidth')]) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetSupportedMcsSet(uint64_t ctrl1, uint64_t ctrl2) [member function] cls.add_method('SetSupportedMcsSet', 'void', [param('uint64_t', 'ctrl1'), param('uint64_t', 'ctrl2')]) return def register_Ns3HtCapabilitiesChecker_methods(root_module, cls): ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilitiesChecker::HtCapabilitiesChecker() [constructor] cls.add_constructor([]) ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilitiesChecker::HtCapabilitiesChecker(ns3::HtCapabilitiesChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::HtCapabilitiesChecker const &', 'arg0')]) return def register_Ns3HtCapabilitiesValue_methods(root_module, cls): ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilitiesValue::HtCapabilitiesValue() [constructor] cls.add_constructor([]) ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilitiesValue::HtCapabilitiesValue(ns3::HtCapabilitiesValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::HtCapabilitiesValue const &', 'arg0')]) ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilitiesValue::HtCapabilitiesValue(ns3::HtCapabilities const & value) [constructor] cls.add_constructor([param('ns3::HtCapabilities const &', 'value')]) ## ht-capabilities.h (module 'wifi'): ns3::Ptr<ns3::AttributeValue> ns3::HtCapabilitiesValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ht-capabilities.h (module 'wifi'): bool ns3::HtCapabilitiesValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ht-capabilities.h (module 'wifi'): ns3::HtCapabilities ns3::HtCapabilitiesValue::Get() const [member function] cls.add_method('Get', 'ns3::HtCapabilities', [], is_const=True) ## ht-capabilities.h (module 'wifi'): std::string ns3::HtCapabilitiesValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilitiesValue::Set(ns3::HtCapabilities const & value) [member function] cls.add_method('Set', 'void', [param('ns3::HtCapabilities const &', 'value')]) return def register_Ns3IpL4Protocol_methods(root_module, cls): ## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::IpL4Protocol() [constructor] cls.add_constructor([]) ## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::IpL4Protocol(ns3::IpL4Protocol const & arg0) [copy constructor] cls.add_constructor([param('ns3::IpL4Protocol const &', 'arg0')]) ## ip-l4-protocol.h (module 'internet'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::IpL4Protocol::GetDownTarget() const [member function] cls.add_method('GetDownTarget', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## ip-l4-protocol.h (module 'internet'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::IpL4Protocol::GetDownTarget6() const [member function] cls.add_method('GetDownTarget6', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## ip-l4-protocol.h (module 'internet'): int ns3::IpL4Protocol::GetProtocolNumber() const [member function] cls.add_method('GetProtocolNumber', 'int', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## ip-l4-protocol.h (module 'internet'): static ns3::TypeId ns3::IpL4Protocol::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::IpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> incomingInterface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')], is_pure_virtual=True, is_virtual=True) ## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::IpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> incomingInterface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')], is_pure_virtual=True, is_virtual=True) ## ip-l4-protocol.h (module 'internet'): void ns3::IpL4Protocol::ReceiveIcmp(ns3::Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv4Address payloadSource, ns3::Ipv4Address payloadDestination, uint8_t const * payload) [member function] cls.add_method('ReceiveIcmp', 'void', [param('ns3::Ipv4Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv4Address', 'payloadSource'), param('ns3::Ipv4Address', 'payloadDestination'), param('uint8_t const *', 'payload')], is_virtual=True) ## ip-l4-protocol.h (module 'internet'): void ns3::IpL4Protocol::ReceiveIcmp(ns3::Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv6Address payloadSource, ns3::Ipv6Address payloadDestination, uint8_t const * payload) [member function] cls.add_method('ReceiveIcmp', 'void', [param('ns3::Ipv6Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv6Address', 'payloadSource'), param('ns3::Ipv6Address', 'payloadDestination'), param('uint8_t const *', 'payload')], is_virtual=True) ## ip-l4-protocol.h (module 'internet'): void ns3::IpL4Protocol::SetDownTarget(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetDownTarget', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_pure_virtual=True, is_virtual=True) ## ip-l4-protocol.h (module 'internet'): void ns3::IpL4Protocol::SetDownTarget6(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetDownTarget6', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_pure_virtual=True, is_virtual=True) return def register_Ns3Ipv4_methods(root_module, cls): ## ipv4.h (module 'internet'): ns3::Ipv4::Ipv4(ns3::Ipv4 const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4 const &', 'arg0')]) ## ipv4.h (module 'internet'): ns3::Ipv4::Ipv4() [constructor] cls.add_constructor([]) ## ipv4.h (module 'internet'): bool ns3::Ipv4::AddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] cls.add_method('AddAddress', 'bool', [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::AddInterface(ns3::Ptr<ns3::NetDevice> device) [member function] cls.add_method('AddInterface', 'uint32_t', [param('ns3::Ptr< ns3::NetDevice >', 'device')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::Ipv4::CreateRawSocket() [member function] cls.add_method('CreateRawSocket', 'ns3::Ptr< ns3::Socket >', [], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::DeleteRawSocket(ns3::Ptr<ns3::Socket> socket) [member function] cls.add_method('DeleteRawSocket', 'void', [param('ns3::Ptr< ns3::Socket >', 'socket')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4::GetAddress(uint32_t interface, uint32_t addressIndex) const [member function] cls.add_method('GetAddress', 'ns3::Ipv4InterfaceAddress', [param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForAddress(ns3::Ipv4Address address) const [member function] cls.add_method('GetInterfaceForAddress', 'int32_t', [param('ns3::Ipv4Address', 'address')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForDevice(ns3::Ptr<const ns3::NetDevice> device) const [member function] cls.add_method('GetInterfaceForDevice', 'int32_t', [param('ns3::Ptr< ns3::NetDevice const >', 'device')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForPrefix(ns3::Ipv4Address address, ns3::Ipv4Mask mask) const [member function] cls.add_method('GetInterfaceForPrefix', 'int32_t', [param('ns3::Ipv4Address', 'address'), param('ns3::Ipv4Mask', 'mask')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): uint16_t ns3::Ipv4::GetMetric(uint32_t interface) const [member function] cls.add_method('GetMetric', 'uint16_t', [param('uint32_t', 'interface')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): uint16_t ns3::Ipv4::GetMtu(uint32_t interface) const [member function] cls.add_method('GetMtu', 'uint16_t', [param('uint32_t', 'interface')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::GetNAddresses(uint32_t interface) const [member function] cls.add_method('GetNAddresses', 'uint32_t', [param('uint32_t', 'interface')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::GetNInterfaces() const [member function] cls.add_method('GetNInterfaces', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4::GetNetDevice(uint32_t interface) [member function] cls.add_method('GetNetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'interface')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ptr<ns3::IpL4Protocol> ns3::Ipv4::GetProtocol(int protocolNumber) const [member function] cls.add_method('GetProtocol', 'ns3::Ptr< ns3::IpL4Protocol >', [param('int', 'protocolNumber')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4::GetRoutingProtocol() const [member function] cls.add_method('GetRoutingProtocol', 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): static ns3::TypeId ns3::Ipv4::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::Insert(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function] cls.add_method('Insert', 'void', [param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::IsDestinationAddress(ns3::Ipv4Address address, uint32_t iif) const [member function] cls.add_method('IsDestinationAddress', 'bool', [param('ns3::Ipv4Address', 'address'), param('uint32_t', 'iif')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::IsForwarding(uint32_t interface) const [member function] cls.add_method('IsForwarding', 'bool', [param('uint32_t', 'interface')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::IsUp(uint32_t interface) const [member function] cls.add_method('IsUp', 'bool', [param('uint32_t', 'interface')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::RemoveAddress(uint32_t interface, uint32_t addressIndex) [member function] cls.add_method('RemoveAddress', 'bool', [param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::RemoveAddress(uint32_t interface, ns3::Ipv4Address address) [member function] cls.add_method('RemoveAddress', 'bool', [param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'address')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4::SelectSourceAddress(ns3::Ptr<const ns3::NetDevice> device, ns3::Ipv4Address dst, ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function] cls.add_method('SelectSourceAddress', 'ns3::Ipv4Address', [param('ns3::Ptr< ns3::NetDevice const >', 'device'), param('ns3::Ipv4Address', 'dst'), param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::SendWithHeader(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Header ipHeader, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('SendWithHeader', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Header', 'ipHeader'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::SetDown(uint32_t interface) [member function] cls.add_method('SetDown', 'void', [param('uint32_t', 'interface')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::SetForwarding(uint32_t interface, bool val) [member function] cls.add_method('SetForwarding', 'void', [param('uint32_t', 'interface'), param('bool', 'val')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::SetMetric(uint32_t interface, uint16_t metric) [member function] cls.add_method('SetMetric', 'void', [param('uint32_t', 'interface'), param('uint16_t', 'metric')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4RoutingProtocol> routingProtocol) [member function] cls.add_method('SetRoutingProtocol', 'void', [param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::SetUp(uint32_t interface) [member function] cls.add_method('SetUp', 'void', [param('uint32_t', 'interface')], is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ipv4::IF_ANY [variable] cls.add_static_attribute('IF_ANY', 'uint32_t const', is_const=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::GetIpForward() const [member function] cls.add_method('GetIpForward', 'bool', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::GetWeakEsModel() const [member function] cls.add_method('GetWeakEsModel', 'bool', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::SetIpForward(bool forward) [member function] cls.add_method('SetIpForward', 'void', [param('bool', 'forward')], is_pure_virtual=True, visibility='private', is_virtual=True) ## ipv4.h (module 'internet'): void ns3::Ipv4::SetWeakEsModel(bool model) [member function] cls.add_method('SetWeakEsModel', 'void', [param('bool', 'model')], is_pure_virtual=True, visibility='private', is_virtual=True) return def register_Ns3Ipv4AddressChecker_methods(root_module, cls): ## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker(ns3::Ipv4AddressChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4AddressChecker const &', 'arg0')]) return def register_Ns3Ipv4AddressValue_methods(root_module, cls): ## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4AddressValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4AddressValue const &', 'arg0')]) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4Address const & value) [constructor] cls.add_constructor([param('ns3::Ipv4Address const &', 'value')]) ## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4AddressValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4AddressValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4AddressValue::Get() const [member function] cls.add_method('Get', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-address.h (module 'network'): std::string ns3::Ipv4AddressValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4AddressValue::Set(ns3::Ipv4Address const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ipv4Address const &', 'value')]) return def register_Ns3Ipv4Interface_methods(root_module, cls): ## ipv4-interface.h (module 'internet'): ns3::Ipv4Interface::Ipv4Interface(ns3::Ipv4Interface const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4Interface const &', 'arg0')]) ## ipv4-interface.h (module 'internet'): ns3::Ipv4Interface::Ipv4Interface() [constructor] cls.add_constructor([]) ## ipv4-interface.h (module 'internet'): bool ns3::Ipv4Interface::AddAddress(ns3::Ipv4InterfaceAddress address) [member function] cls.add_method('AddAddress', 'bool', [param('ns3::Ipv4InterfaceAddress', 'address')]) ## ipv4-interface.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4Interface::GetAddress(uint32_t index) const [member function] cls.add_method('GetAddress', 'ns3::Ipv4InterfaceAddress', [param('uint32_t', 'index')], is_const=True) ## ipv4-interface.h (module 'internet'): ns3::Ptr<ns3::ArpCache> ns3::Ipv4Interface::GetArpCache() const [member function] cls.add_method('GetArpCache', 'ns3::Ptr< ns3::ArpCache >', [], is_const=True) ## ipv4-interface.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4Interface::GetDevice() const [member function] cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [], is_const=True) ## ipv4-interface.h (module 'internet'): uint16_t ns3::Ipv4Interface::GetMetric() const [member function] cls.add_method('GetMetric', 'uint16_t', [], is_const=True) ## ipv4-interface.h (module 'internet'): uint32_t ns3::Ipv4Interface::GetNAddresses() const [member function] cls.add_method('GetNAddresses', 'uint32_t', [], is_const=True) ## ipv4-interface.h (module 'internet'): static ns3::TypeId ns3::Ipv4Interface::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ipv4-interface.h (module 'internet'): bool ns3::Ipv4Interface::IsDown() const [member function] cls.add_method('IsDown', 'bool', [], is_const=True) ## ipv4-interface.h (module 'internet'): bool ns3::Ipv4Interface::IsForwarding() const [member function] cls.add_method('IsForwarding', 'bool', [], is_const=True) ## ipv4-interface.h (module 'internet'): bool ns3::Ipv4Interface::IsUp() const [member function] cls.add_method('IsUp', 'bool', [], is_const=True) ## ipv4-interface.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4Interface::RemoveAddress(uint32_t index) [member function] cls.add_method('RemoveAddress', 'ns3::Ipv4InterfaceAddress', [param('uint32_t', 'index')]) ## ipv4-interface.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4Interface::RemoveAddress(ns3::Ipv4Address address) [member function] cls.add_method('RemoveAddress', 'ns3::Ipv4InterfaceAddress', [param('ns3::Ipv4Address', 'address')]) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::Send(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Address dest) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address', 'dest')]) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetArpCache(ns3::Ptr<ns3::ArpCache> arg0) [member function] cls.add_method('SetArpCache', 'void', [param('ns3::Ptr< ns3::ArpCache >', 'arg0')]) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetDevice(ns3::Ptr<ns3::NetDevice> device) [member function] cls.add_method('SetDevice', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device')]) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetDown() [member function] cls.add_method('SetDown', 'void', []) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetForwarding(bool val) [member function] cls.add_method('SetForwarding', 'void', [param('bool', 'val')]) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetMetric(uint16_t metric) [member function] cls.add_method('SetMetric', 'void', [param('uint16_t', 'metric')]) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetUp() [member function] cls.add_method('SetUp', 'void', []) ## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3Ipv4L3Protocol_methods(root_module, cls): ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol::Ipv4L3Protocol() [constructor] cls.add_constructor([]) ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::AddAddress(uint32_t i, ns3::Ipv4InterfaceAddress address) [member function] cls.add_method('AddAddress', 'bool', [param('uint32_t', 'i'), param('ns3::Ipv4InterfaceAddress', 'address')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): uint32_t ns3::Ipv4L3Protocol::AddInterface(ns3::Ptr<ns3::NetDevice> device) [member function] cls.add_method('AddInterface', 'uint32_t', [param('ns3::Ptr< ns3::NetDevice >', 'device')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::Ipv4L3Protocol::CreateRawSocket() [member function] cls.add_method('CreateRawSocket', 'ns3::Ptr< ns3::Socket >', [], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::DeleteRawSocket(ns3::Ptr<ns3::Socket> socket) [member function] cls.add_method('DeleteRawSocket', 'void', [param('ns3::Ptr< ns3::Socket >', 'socket')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4L3Protocol::GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const [member function] cls.add_method('GetAddress', 'ns3::Ipv4InterfaceAddress', [param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::Ipv4Interface> ns3::Ipv4L3Protocol::GetInterface(uint32_t i) const [member function] cls.add_method('GetInterface', 'ns3::Ptr< ns3::Ipv4Interface >', [param('uint32_t', 'i')], is_const=True) ## ipv4-l3-protocol.h (module 'internet'): int32_t ns3::Ipv4L3Protocol::GetInterfaceForAddress(ns3::Ipv4Address addr) const [member function] cls.add_method('GetInterfaceForAddress', 'int32_t', [param('ns3::Ipv4Address', 'addr')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): int32_t ns3::Ipv4L3Protocol::GetInterfaceForDevice(ns3::Ptr<const ns3::NetDevice> device) const [member function] cls.add_method('GetInterfaceForDevice', 'int32_t', [param('ns3::Ptr< ns3::NetDevice const >', 'device')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): int32_t ns3::Ipv4L3Protocol::GetInterfaceForPrefix(ns3::Ipv4Address addr, ns3::Ipv4Mask mask) const [member function] cls.add_method('GetInterfaceForPrefix', 'int32_t', [param('ns3::Ipv4Address', 'addr'), param('ns3::Ipv4Mask', 'mask')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): uint16_t ns3::Ipv4L3Protocol::GetMetric(uint32_t i) const [member function] cls.add_method('GetMetric', 'uint16_t', [param('uint32_t', 'i')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): uint16_t ns3::Ipv4L3Protocol::GetMtu(uint32_t i) const [member function] cls.add_method('GetMtu', 'uint16_t', [param('uint32_t', 'i')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): uint32_t ns3::Ipv4L3Protocol::GetNAddresses(uint32_t interface) const [member function] cls.add_method('GetNAddresses', 'uint32_t', [param('uint32_t', 'interface')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): uint32_t ns3::Ipv4L3Protocol::GetNInterfaces() const [member function] cls.add_method('GetNInterfaces', 'uint32_t', [], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4L3Protocol::GetNetDevice(uint32_t i) [member function] cls.add_method('GetNetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::IpL4Protocol> ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber) const [member function] cls.add_method('GetProtocol', 'ns3::Ptr< ns3::IpL4Protocol >', [param('int', 'protocolNumber')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4L3Protocol::GetRoutingProtocol() const [member function] cls.add_method('GetRoutingProtocol', 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', [], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): static ns3::TypeId ns3::Ipv4L3Protocol::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Insert(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function] cls.add_method('Insert', 'void', [param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsDestinationAddress(ns3::Ipv4Address address, uint32_t iif) const [member function] cls.add_method('IsDestinationAddress', 'bool', [param('ns3::Ipv4Address', 'address'), param('uint32_t', 'iif')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsForwarding(uint32_t i) const [member function] cls.add_method('IsForwarding', 'bool', [param('uint32_t', 'i')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function] cls.add_method('IsUp', 'bool', [param('uint32_t', 'i')], is_const=True, is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Receive(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<ns3::Packet const> p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function] cls.add_method('Receive', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'from'), param('ns3::Address const &', 'to'), param('ns3::NetDevice::PacketType', 'packetType')]) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Remove(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function] cls.add_method('Remove', 'void', [param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')]) ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex) [member function] cls.add_method('RemoveAddress', 'bool', [param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::RemoveAddress(uint32_t interface, ns3::Ipv4Address address) [member function] cls.add_method('RemoveAddress', 'bool', [param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'address')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4L3Protocol::SelectSourceAddress(ns3::Ptr<const ns3::NetDevice> device, ns3::Ipv4Address dst, ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function] cls.add_method('SelectSourceAddress', 'ns3::Ipv4Address', [param('ns3::Ptr< ns3::NetDevice const >', 'device'), param('ns3::Ipv4Address', 'dst'), param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SendWithHeader(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Header ipHeader, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('SendWithHeader', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Header', 'ipHeader'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetDefaultTtl(uint8_t ttl) [member function] cls.add_method('SetDefaultTtl', 'void', [param('uint8_t', 'ttl')]) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetDown(uint32_t i) [member function] cls.add_method('SetDown', 'void', [param('uint32_t', 'i')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetForwarding(uint32_t i, bool val) [member function] cls.add_method('SetForwarding', 'void', [param('uint32_t', 'i'), param('bool', 'val')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetMetric(uint32_t i, uint16_t metric) [member function] cls.add_method('SetMetric', 'void', [param('uint32_t', 'i'), param('uint16_t', 'metric')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4RoutingProtocol> routingProtocol) [member function] cls.add_method('SetRoutingProtocol', 'void', [param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetUp(uint32_t i) [member function] cls.add_method('SetUp', 'void', [param('uint32_t', 'i')], is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::NotifyNewAggregate() [member function] cls.add_method('NotifyNewAggregate', 'void', [], visibility='protected', is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::GetIpForward() const [member function] cls.add_method('GetIpForward', 'bool', [], is_const=True, visibility='private', is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::GetWeakEsModel() const [member function] cls.add_method('GetWeakEsModel', 'bool', [], is_const=True, visibility='private', is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetIpForward(bool forward) [member function] cls.add_method('SetIpForward', 'void', [param('bool', 'forward')], visibility='private', is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetWeakEsModel(bool model) [member function] cls.add_method('SetWeakEsModel', 'void', [param('bool', 'model')], visibility='private', is_virtual=True) return def register_Ns3Ipv4MaskChecker_methods(root_module, cls): ## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker(ns3::Ipv4MaskChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4MaskChecker const &', 'arg0')]) return def register_Ns3Ipv4MaskValue_methods(root_module, cls): ## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4MaskValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4MaskValue const &', 'arg0')]) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4Mask const & value) [constructor] cls.add_constructor([param('ns3::Ipv4Mask const &', 'value')]) ## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4MaskValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4MaskValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask ns3::Ipv4MaskValue::Get() const [member function] cls.add_method('Get', 'ns3::Ipv4Mask', [], is_const=True) ## ipv4-address.h (module 'network'): std::string ns3::Ipv4MaskValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4MaskValue::Set(ns3::Ipv4Mask const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ipv4Mask const &', 'value')]) return def register_Ns3Ipv4MulticastRoute_methods(root_module, cls): ## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::Ipv4MulticastRoute(ns3::Ipv4MulticastRoute const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4MulticastRoute const &', 'arg0')]) ## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::Ipv4MulticastRoute() [constructor] cls.add_constructor([]) ## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4MulticastRoute::GetGroup() const [member function] cls.add_method('GetGroup', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4MulticastRoute::GetOrigin() const [member function] cls.add_method('GetOrigin', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-route.h (module 'internet'): uint32_t ns3::Ipv4MulticastRoute::GetOutputTtl(uint32_t oif) [member function] cls.add_method('GetOutputTtl', 'uint32_t', [param('uint32_t', 'oif')], deprecated=True) ## ipv4-route.h (module 'internet'): std::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int> > > ns3::Ipv4MulticastRoute::GetOutputTtlMap() const [member function] cls.add_method('GetOutputTtlMap', 'std::map< unsigned int, unsigned int >', [], is_const=True) ## ipv4-route.h (module 'internet'): uint32_t ns3::Ipv4MulticastRoute::GetParent() const [member function] cls.add_method('GetParent', 'uint32_t', [], is_const=True) ## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetGroup(ns3::Ipv4Address const group) [member function] cls.add_method('SetGroup', 'void', [param('ns3::Ipv4Address const', 'group')]) ## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetOrigin(ns3::Ipv4Address const origin) [member function] cls.add_method('SetOrigin', 'void', [param('ns3::Ipv4Address const', 'origin')]) ## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetOutputTtl(uint32_t oif, uint32_t ttl) [member function] cls.add_method('SetOutputTtl', 'void', [param('uint32_t', 'oif'), param('uint32_t', 'ttl')]) ## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetParent(uint32_t iif) [member function] cls.add_method('SetParent', 'void', [param('uint32_t', 'iif')]) ## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::MAX_INTERFACES [variable] cls.add_static_attribute('MAX_INTERFACES', 'uint32_t const', is_const=True) ## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::MAX_TTL [variable] cls.add_static_attribute('MAX_TTL', 'uint32_t const', is_const=True) return def register_Ns3Ipv4Route_methods(root_module, cls): cls.add_output_stream_operator() ## ipv4-route.h (module 'internet'): ns3::Ipv4Route::Ipv4Route(ns3::Ipv4Route const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4Route const &', 'arg0')]) ## ipv4-route.h (module 'internet'): ns3::Ipv4Route::Ipv4Route() [constructor] cls.add_constructor([]) ## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetDestination() const [member function] cls.add_method('GetDestination', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetGateway() const [member function] cls.add_method('GetGateway', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-route.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4Route::GetOutputDevice() const [member function] cls.add_method('GetOutputDevice', 'ns3::Ptr< ns3::NetDevice >', [], is_const=True) ## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetSource() const [member function] cls.add_method('GetSource', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetDestination(ns3::Ipv4Address dest) [member function] cls.add_method('SetDestination', 'void', [param('ns3::Ipv4Address', 'dest')]) ## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetGateway(ns3::Ipv4Address gw) [member function] cls.add_method('SetGateway', 'void', [param('ns3::Ipv4Address', 'gw')]) ## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetOutputDevice(ns3::Ptr<ns3::NetDevice> outputDevice) [member function] cls.add_method('SetOutputDevice', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'outputDevice')]) ## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetSource(ns3::Ipv4Address src) [member function] cls.add_method('SetSource', 'void', [param('ns3::Ipv4Address', 'src')]) return def register_Ns3Ipv4RoutingProtocol_methods(root_module, cls): ## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol::Ipv4RoutingProtocol() [constructor] cls.add_constructor([]) ## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol::Ipv4RoutingProtocol(ns3::Ipv4RoutingProtocol const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4RoutingProtocol const &', 'arg0')]) ## ipv4-routing-protocol.h (module 'internet'): static ns3::TypeId ns3::Ipv4RoutingProtocol::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] cls.add_method('NotifyAddAddress', 'void', [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], is_pure_virtual=True, is_virtual=True) ## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyInterfaceDown(uint32_t interface) [member function] cls.add_method('NotifyInterfaceDown', 'void', [param('uint32_t', 'interface')], is_pure_virtual=True, is_virtual=True) ## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyInterfaceUp(uint32_t interface) [member function] cls.add_method('NotifyInterfaceUp', 'void', [param('uint32_t', 'interface')], is_pure_virtual=True, is_virtual=True) ## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function] cls.add_method('NotifyRemoveAddress', 'void', [param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')], is_pure_virtual=True, is_virtual=True) ## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream) const [member function] cls.add_method('PrintRoutingTable', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')], is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4-routing-protocol.h (module 'internet'): bool ns3::Ipv4RoutingProtocol::RouteInput(ns3::Ptr<ns3::Packet const> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Callback<void,ns3::Ptr<ns3::Ipv4Route>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ucb, ns3::Callback<void,ns3::Ptr<ns3::Ipv4MulticastRoute>,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> mcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,unsigned int,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> lcb, ns3::Callback<void,ns3::Ptr<const ns3::Packet>,const ns3::Ipv4Header&,ns3::Socket::SocketErrno,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ecb) [member function] cls.add_method('RouteInput', 'bool', [param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')], is_pure_virtual=True, is_virtual=True) ## ipv4-routing-protocol.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4RoutingProtocol::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function] cls.add_method('RouteOutput', 'ns3::Ptr< ns3::Ipv4Route >', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')], is_pure_virtual=True, is_virtual=True) ## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function] cls.add_method('SetIpv4', 'void', [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')], is_pure_virtual=True, is_virtual=True) return def register_Ns3Ipv6AddressChecker_methods(root_module, cls): ## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker(ns3::Ipv6AddressChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6AddressChecker const &', 'arg0')]) return def register_Ns3Ipv6AddressValue_methods(root_module, cls): ## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6AddressValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6AddressValue const &', 'arg0')]) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6Address const & value) [constructor] cls.add_constructor([param('ns3::Ipv6Address const &', 'value')]) ## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6AddressValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6AddressValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6AddressValue::Get() const [member function] cls.add_method('Get', 'ns3::Ipv6Address', [], is_const=True) ## ipv6-address.h (module 'network'): std::string ns3::Ipv6AddressValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6AddressValue::Set(ns3::Ipv6Address const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ipv6Address const &', 'value')]) return def register_Ns3Ipv6Interface_methods(root_module, cls): ## ipv6-interface.h (module 'internet'): ns3::Ipv6Interface::Ipv6Interface(ns3::Ipv6Interface const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6Interface const &', 'arg0')]) ## ipv6-interface.h (module 'internet'): ns3::Ipv6Interface::Ipv6Interface() [constructor] cls.add_constructor([]) ## ipv6-interface.h (module 'internet'): bool ns3::Ipv6Interface::AddAddress(ns3::Ipv6InterfaceAddress iface) [member function] cls.add_method('AddAddress', 'bool', [param('ns3::Ipv6InterfaceAddress', 'iface')]) ## ipv6-interface.h (module 'internet'): ns3::Ipv6InterfaceAddress ns3::Ipv6Interface::GetAddress(uint32_t index) const [member function] cls.add_method('GetAddress', 'ns3::Ipv6InterfaceAddress', [param('uint32_t', 'index')], is_const=True) ## ipv6-interface.h (module 'internet'): ns3::Ipv6InterfaceAddress ns3::Ipv6Interface::GetAddressMatchingDestination(ns3::Ipv6Address dst) [member function] cls.add_method('GetAddressMatchingDestination', 'ns3::Ipv6InterfaceAddress', [param('ns3::Ipv6Address', 'dst')]) ## ipv6-interface.h (module 'internet'): uint16_t ns3::Ipv6Interface::GetBaseReachableTime() const [member function] cls.add_method('GetBaseReachableTime', 'uint16_t', [], is_const=True) ## ipv6-interface.h (module 'internet'): uint8_t ns3::Ipv6Interface::GetCurHopLimit() const [member function] cls.add_method('GetCurHopLimit', 'uint8_t', [], is_const=True) ## ipv6-interface.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv6Interface::GetDevice() const [member function] cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [], is_const=True, is_virtual=True) ## ipv6-interface.h (module 'internet'): ns3::Ipv6InterfaceAddress ns3::Ipv6Interface::GetLinkLocalAddress() const [member function] cls.add_method('GetLinkLocalAddress', 'ns3::Ipv6InterfaceAddress', [], is_const=True) ## ipv6-interface.h (module 'internet'): uint16_t ns3::Ipv6Interface::GetMetric() const [member function] cls.add_method('GetMetric', 'uint16_t', [], is_const=True) ## ipv6-interface.h (module 'internet'): uint32_t ns3::Ipv6Interface::GetNAddresses() const [member function] cls.add_method('GetNAddresses', 'uint32_t', [], is_const=True) ## ipv6-interface.h (module 'internet'): uint16_t ns3::Ipv6Interface::GetReachableTime() const [member function] cls.add_method('GetReachableTime', 'uint16_t', [], is_const=True) ## ipv6-interface.h (module 'internet'): uint16_t ns3::Ipv6Interface::GetRetransTimer() const [member function] cls.add_method('GetRetransTimer', 'uint16_t', [], is_const=True) ## ipv6-interface.h (module 'internet'): static ns3::TypeId ns3::Ipv6Interface::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ipv6-interface.h (module 'internet'): bool ns3::Ipv6Interface::IsDown() const [member function] cls.add_method('IsDown', 'bool', [], is_const=True) ## ipv6-interface.h (module 'internet'): bool ns3::Ipv6Interface::IsForwarding() const [member function] cls.add_method('IsForwarding', 'bool', [], is_const=True) ## ipv6-interface.h (module 'internet'): bool ns3::Ipv6Interface::IsUp() const [member function] cls.add_method('IsUp', 'bool', [], is_const=True) ## ipv6-interface.h (module 'internet'): ns3::Ipv6InterfaceAddress ns3::Ipv6Interface::RemoveAddress(uint32_t index) [member function] cls.add_method('RemoveAddress', 'ns3::Ipv6InterfaceAddress', [param('uint32_t', 'index')]) ## ipv6-interface.h (module 'internet'): ns3::Ipv6InterfaceAddress ns3::Ipv6Interface::RemoveAddress(ns3::Ipv6Address address) [member function] cls.add_method('RemoveAddress', 'ns3::Ipv6InterfaceAddress', [param('ns3::Ipv6Address', 'address')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::Send(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Address dest) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Address', 'dest')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetBaseReachableTime(uint16_t baseReachableTime) [member function] cls.add_method('SetBaseReachableTime', 'void', [param('uint16_t', 'baseReachableTime')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetCurHopLimit(uint8_t curHopLimit) [member function] cls.add_method('SetCurHopLimit', 'void', [param('uint8_t', 'curHopLimit')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetDevice(ns3::Ptr<ns3::NetDevice> device) [member function] cls.add_method('SetDevice', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetDown() [member function] cls.add_method('SetDown', 'void', []) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetForwarding(bool forward) [member function] cls.add_method('SetForwarding', 'void', [param('bool', 'forward')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetMetric(uint16_t metric) [member function] cls.add_method('SetMetric', 'void', [param('uint16_t', 'metric')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetNsDadUid(ns3::Ipv6Address address, uint32_t uid) [member function] cls.add_method('SetNsDadUid', 'void', [param('ns3::Ipv6Address', 'address'), param('uint32_t', 'uid')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetReachableTime(uint16_t reachableTime) [member function] cls.add_method('SetReachableTime', 'void', [param('uint16_t', 'reachableTime')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetRetransTimer(uint16_t retransTimer) [member function] cls.add_method('SetRetransTimer', 'void', [param('uint16_t', 'retransTimer')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetState(ns3::Ipv6Address address, ns3::Ipv6InterfaceAddress::State_e state) [member function] cls.add_method('SetState', 'void', [param('ns3::Ipv6Address', 'address'), param('ns3::Ipv6InterfaceAddress::State_e', 'state')]) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::SetUp() [member function] cls.add_method('SetUp', 'void', []) ## ipv6-interface.h (module 'internet'): void ns3::Ipv6Interface::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3Ipv6PrefixChecker_methods(root_module, cls): ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker(ns3::Ipv6PrefixChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6PrefixChecker const &', 'arg0')]) return def register_Ns3Ipv6PrefixValue_methods(root_module, cls): ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6PrefixValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6PrefixValue const &', 'arg0')]) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6Prefix const & value) [constructor] cls.add_constructor([param('ns3::Ipv6Prefix const &', 'value')]) ## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6PrefixValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6PrefixValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix ns3::Ipv6PrefixValue::Get() const [member function] cls.add_method('Get', 'ns3::Ipv6Prefix', [], is_const=True) ## ipv6-address.h (module 'network'): std::string ns3::Ipv6PrefixValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6PrefixValue::Set(ns3::Ipv6Prefix const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ipv6Prefix const &', 'value')]) return def register_Ns3LogNormalRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::LogNormalRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable::LogNormalRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetMu() const [member function] cls.add_method('GetMu', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetSigma() const [member function] cls.add_method('GetSigma', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue(double mu, double sigma) [member function] cls.add_method('GetValue', 'double', [param('double', 'mu'), param('double', 'sigma')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger(uint32_t mu, uint32_t sigma) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'mu'), param('uint32_t', 'sigma')]) ## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3Mac48AddressChecker_methods(root_module, cls): ## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker() [constructor] cls.add_constructor([]) ## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker(ns3::Mac48AddressChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Mac48AddressChecker const &', 'arg0')]) return def register_Ns3Mac48AddressValue_methods(root_module, cls): ## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue() [constructor] cls.add_constructor([]) ## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48AddressValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Mac48AddressValue const &', 'arg0')]) ## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48Address const & value) [constructor] cls.add_constructor([param('ns3::Mac48Address const &', 'value')]) ## mac48-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Mac48AddressValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## mac48-address.h (module 'network'): bool ns3::Mac48AddressValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## mac48-address.h (module 'network'): ns3::Mac48Address ns3::Mac48AddressValue::Get() const [member function] cls.add_method('Get', 'ns3::Mac48Address', [], is_const=True) ## mac48-address.h (module 'network'): std::string ns3::Mac48AddressValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## mac48-address.h (module 'network'): void ns3::Mac48AddressValue::Set(ns3::Mac48Address const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Mac48Address const &', 'value')]) return def register_Ns3NetDevice_methods(root_module, cls): ## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor] cls.add_constructor([]) ## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [copy constructor] cls.add_constructor([param('ns3::NetDevice const &', 'arg0')]) ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] cls.add_method('AddLinkChangeCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetAddress() const [member function] cls.add_method('GetAddress', 'ns3::Address', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetBroadcast() const [member function] cls.add_method('GetBroadcast', 'ns3::Address', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Ptr<ns3::Channel> ns3::NetDevice::GetChannel() const [member function] cls.add_method('GetChannel', 'ns3::Ptr< ns3::Channel >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): uint32_t ns3::NetDevice::GetIfIndex() const [member function] cls.add_method('GetIfIndex', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): uint16_t ns3::NetDevice::GetMtu() const [member function] cls.add_method('GetMtu', 'uint16_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] cls.add_method('GetMulticast', 'ns3::Address', [param('ns3::Ipv4Address', 'multicastGroup')], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] cls.add_method('GetMulticast', 'ns3::Address', [param('ns3::Ipv6Address', 'addr')], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NetDevice::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): static ns3::TypeId ns3::NetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsBridge() const [member function] cls.add_method('IsBridge', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsLinkUp() const [member function] cls.add_method('IsLinkUp', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsMulticast() const [member function] cls.add_method('IsMulticast', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsPointToPoint() const [member function] cls.add_method('IsPointToPoint', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::NeedsArp() const [member function] cls.add_method('NeedsArp', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetAddress(ns3::Address address) [member function] cls.add_method('SetAddress', 'void', [param('ns3::Address', 'address')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetIfIndex(uint32_t const index) [member function] cls.add_method('SetIfIndex', 'void', [param('uint32_t const', 'index')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::SetMtu(uint16_t const mtu) [member function] cls.add_method('SetMtu', 'bool', [param('uint16_t const', 'mtu')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetPromiscReceiveCallback(ns3::Callback<bool,ns3::Ptr<ns3::NetDevice>,ns3::Ptr<const ns3::Packet>,short unsigned int,const ns3::Address&,const ns3::Address&,ns3::NetDevice::PacketType,ns3::empty,ns3::empty,ns3::empty> cb) [member function] cls.add_method('SetPromiscReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, short unsigned int, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetReceiveCallback(ns3::Callback<bool,ns3::Ptr<ns3::NetDevice>,ns3::Ptr<const ns3::Packet>,short unsigned int,const ns3::Address&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> cb) [member function] cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, short unsigned int, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::SupportsSendFrom() const [member function] cls.add_method('SupportsSendFrom', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3NixVector_methods(root_module, cls): cls.add_output_stream_operator() ## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor] cls.add_constructor([]) ## nix-vector.h (module 'network'): ns3::NixVector::NixVector(ns3::NixVector const & o) [copy constructor] cls.add_constructor([param('ns3::NixVector const &', 'o')]) ## nix-vector.h (module 'network'): void ns3::NixVector::AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits) [member function] cls.add_method('AddNeighborIndex', 'void', [param('uint32_t', 'newBits'), param('uint32_t', 'numberOfBits')]) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::BitCount(uint32_t numberOfNeighbors) const [member function] cls.add_method('BitCount', 'uint32_t', [param('uint32_t', 'numberOfNeighbors')], is_const=True) ## nix-vector.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::NixVector::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::NixVector >', [], is_const=True) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Deserialize(uint32_t const * buffer, uint32_t size) [member function] cls.add_method('Deserialize', 'uint32_t', [param('uint32_t const *', 'buffer'), param('uint32_t', 'size')]) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::ExtractNeighborIndex(uint32_t numberOfBits) [member function] cls.add_method('ExtractNeighborIndex', 'uint32_t', [param('uint32_t', 'numberOfBits')]) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetRemainingBits() [member function] cls.add_method('GetRemainingBits', 'uint32_t', []) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Serialize(uint32_t * buffer, uint32_t maxSize) const [member function] cls.add_method('Serialize', 'uint32_t', [param('uint32_t *', 'buffer'), param('uint32_t', 'maxSize')], is_const=True) return def register_Ns3Node_methods(root_module, cls): ## node.h (module 'network'): ns3::Node::Node(ns3::Node const & arg0) [copy constructor] cls.add_constructor([param('ns3::Node const &', 'arg0')]) ## node.h (module 'network'): ns3::Node::Node() [constructor] cls.add_constructor([]) ## node.h (module 'network'): ns3::Node::Node(uint32_t systemId) [constructor] cls.add_constructor([param('uint32_t', 'systemId')]) ## node.h (module 'network'): uint32_t ns3::Node::AddApplication(ns3::Ptr<ns3::Application> application) [member function] cls.add_method('AddApplication', 'uint32_t', [param('ns3::Ptr< ns3::Application >', 'application')]) ## node.h (module 'network'): uint32_t ns3::Node::AddDevice(ns3::Ptr<ns3::NetDevice> device) [member function] cls.add_method('AddDevice', 'uint32_t', [param('ns3::Ptr< ns3::NetDevice >', 'device')]) ## node.h (module 'network'): static bool ns3::Node::ChecksumEnabled() [member function] cls.add_method('ChecksumEnabled', 'bool', [], is_static=True) ## node.h (module 'network'): ns3::Ptr<ns3::Application> ns3::Node::GetApplication(uint32_t index) const [member function] cls.add_method('GetApplication', 'ns3::Ptr< ns3::Application >', [param('uint32_t', 'index')], is_const=True) ## node.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Node::GetDevice(uint32_t index) const [member function] cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'index')], is_const=True) ## node.h (module 'network'): uint32_t ns3::Node::GetId() const [member function] cls.add_method('GetId', 'uint32_t', [], is_const=True) ## node.h (module 'network'): uint32_t ns3::Node::GetNApplications() const [member function] cls.add_method('GetNApplications', 'uint32_t', [], is_const=True) ## node.h (module 'network'): uint32_t ns3::Node::GetNDevices() const [member function] cls.add_method('GetNDevices', 'uint32_t', [], is_const=True) ## node.h (module 'network'): uint32_t ns3::Node::GetSystemId() const [member function] cls.add_method('GetSystemId', 'uint32_t', [], is_const=True) ## node.h (module 'network'): static ns3::TypeId ns3::Node::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## node.h (module 'network'): void ns3::Node::RegisterDeviceAdditionListener(ns3::Callback<void,ns3::Ptr<ns3::NetDevice>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> listener) [member function] cls.add_method('RegisterDeviceAdditionListener', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')]) ## node.h (module 'network'): void ns3::Node::RegisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> handler, uint16_t protocolType, ns3::Ptr<ns3::NetDevice> device, bool promiscuous=false) [member function] cls.add_method('RegisterProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'promiscuous', default_value='false')]) ## node.h (module 'network'): void ns3::Node::UnregisterDeviceAdditionListener(ns3::Callback<void,ns3::Ptr<ns3::NetDevice>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> listener) [member function] cls.add_method('UnregisterDeviceAdditionListener', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')]) ## node.h (module 'network'): void ns3::Node::UnregisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> handler) [member function] cls.add_method('UnregisterProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler')]) ## node.h (module 'network'): void ns3::Node::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## node.h (module 'network'): void ns3::Node::DoInitialize() [member function] cls.add_method('DoInitialize', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3NormalRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::INFINITE_VALUE [variable] cls.add_static_attribute('INFINITE_VALUE', 'double const', is_const=True) ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::NormalRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::NormalRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetMean() const [member function] cls.add_method('GetMean', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetVariance() const [member function] cls.add_method('GetVariance', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetBound() const [member function] cls.add_method('GetBound', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue(double mean, double variance, double bound=ns3::NormalRandomVariable::INFINITE_VALUE) [member function] cls.add_method('GetValue', 'double', [param('double', 'mean'), param('double', 'variance'), param('double', 'bound', default_value='ns3::NormalRandomVariable::INFINITE_VALUE')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger(uint32_t mean, uint32_t variance, uint32_t bound) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'mean'), param('uint32_t', 'variance'), param('uint32_t', 'bound')]) ## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3ObjectFactoryChecker_methods(root_module, cls): ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor] cls.add_constructor([]) ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker(ns3::ObjectFactoryChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectFactoryChecker const &', 'arg0')]) return def register_Ns3ObjectFactoryValue_methods(root_module, cls): ## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue() [constructor] cls.add_constructor([]) ## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactoryValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectFactoryValue const &', 'arg0')]) ## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactory const & value) [constructor] cls.add_constructor([param('ns3::ObjectFactory const &', 'value')]) ## object-factory.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::ObjectFactoryValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## object-factory.h (module 'core'): bool ns3::ObjectFactoryValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## object-factory.h (module 'core'): ns3::ObjectFactory ns3::ObjectFactoryValue::Get() const [member function] cls.add_method('Get', 'ns3::ObjectFactory', [], is_const=True) ## object-factory.h (module 'core'): std::string ns3::ObjectFactoryValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## object-factory.h (module 'core'): void ns3::ObjectFactoryValue::Set(ns3::ObjectFactory const & value) [member function] cls.add_method('Set', 'void', [param('ns3::ObjectFactory const &', 'value')]) return def register_Ns3OutputStreamWrapper_methods(root_module, cls): ## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(ns3::OutputStreamWrapper const & arg0) [copy constructor] cls.add_constructor([param('ns3::OutputStreamWrapper const &', 'arg0')]) ## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::_Ios_Openmode filemode) [constructor] cls.add_constructor([param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode')]) ## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::ostream * os) [constructor] cls.add_constructor([param('std::ostream *', 'os')]) ## output-stream-wrapper.h (module 'network'): std::ostream * ns3::OutputStreamWrapper::GetStream() [member function] cls.add_method('GetStream', 'std::ostream *', []) return def register_Ns3Packet_methods(root_module, cls): cls.add_output_stream_operator() ## packet.h (module 'network'): ns3::Packet::Packet() [constructor] cls.add_constructor([]) ## packet.h (module 'network'): ns3::Packet::Packet(ns3::Packet const & o) [copy constructor] cls.add_constructor([param('ns3::Packet const &', 'o')]) ## packet.h (module 'network'): ns3::Packet::Packet(uint32_t size) [constructor] cls.add_constructor([param('uint32_t', 'size')]) ## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size, bool magic) [constructor] cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size'), param('bool', 'magic')]) ## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size) [constructor] cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<ns3::Packet const> packet) [member function] cls.add_method('AddAtEnd', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## packet.h (module 'network'): void ns3::Packet::AddByteTag(ns3::Tag const & tag) const [member function] cls.add_method('AddByteTag', 'void', [param('ns3::Tag const &', 'tag')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::AddHeader(ns3::Header const & header) [member function] cls.add_method('AddHeader', 'void', [param('ns3::Header const &', 'header')]) ## packet.h (module 'network'): void ns3::Packet::AddPacketTag(ns3::Tag const & tag) const [member function] cls.add_method('AddPacketTag', 'void', [param('ns3::Tag const &', 'tag')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::AddPaddingAtEnd(uint32_t size) [member function] cls.add_method('AddPaddingAtEnd', 'void', [param('uint32_t', 'size')]) ## packet.h (module 'network'): void ns3::Packet::AddTrailer(ns3::Trailer const & trailer) [member function] cls.add_method('AddTrailer', 'void', [param('ns3::Trailer const &', 'trailer')]) ## packet.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::Packet::BeginItem() const [member function] cls.add_method('BeginItem', 'ns3::PacketMetadata::ItemIterator', [], is_const=True) ## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::Packet >', [], is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::CopyData(uint8_t * buffer, uint32_t size) const [member function] cls.add_method('CopyData', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::CopyData(std::ostream * os, uint32_t size) const [member function] cls.add_method('CopyData', 'void', [param('std::ostream *', 'os'), param('uint32_t', 'size')], is_const=True) ## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::CreateFragment(uint32_t start, uint32_t length) const [member function] cls.add_method('CreateFragment', 'ns3::Ptr< ns3::Packet >', [param('uint32_t', 'start'), param('uint32_t', 'length')], is_const=True) ## packet.h (module 'network'): static void ns3::Packet::EnableChecking() [member function] cls.add_method('EnableChecking', 'void', [], is_static=True) ## packet.h (module 'network'): static void ns3::Packet::EnablePrinting() [member function] cls.add_method('EnablePrinting', 'void', [], is_static=True) ## packet.h (module 'network'): bool ns3::Packet::FindFirstMatchingByteTag(ns3::Tag & tag) const [member function] cls.add_method('FindFirstMatchingByteTag', 'bool', [param('ns3::Tag &', 'tag')], is_const=True) ## packet.h (module 'network'): ns3::ByteTagIterator ns3::Packet::GetByteTagIterator() const [member function] cls.add_method('GetByteTagIterator', 'ns3::ByteTagIterator', [], is_const=True) ## packet.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::Packet::GetNixVector() const [member function] cls.add_method('GetNixVector', 'ns3::Ptr< ns3::NixVector >', [], is_const=True) ## packet.h (module 'network'): ns3::PacketTagIterator ns3::Packet::GetPacketTagIterator() const [member function] cls.add_method('GetPacketTagIterator', 'ns3::PacketTagIterator', [], is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::GetSize() const [member function] cls.add_method('GetSize', 'uint32_t', [], is_const=True) ## packet.h (module 'network'): uint64_t ns3::Packet::GetUid() const [member function] cls.add_method('GetUid', 'uint64_t', [], is_const=True) ## packet.h (module 'network'): uint8_t const * ns3::Packet::PeekData() const [member function] cls.add_method('PeekData', 'uint8_t const *', [], deprecated=True, is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header) const [member function] cls.add_method('PeekHeader', 'uint32_t', [param('ns3::Header &', 'header')], is_const=True) ## packet.h (module 'network'): bool ns3::Packet::PeekPacketTag(ns3::Tag & tag) const [member function] cls.add_method('PeekPacketTag', 'bool', [param('ns3::Tag &', 'tag')], is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::PeekTrailer(ns3::Trailer & trailer) [member function] cls.add_method('PeekTrailer', 'uint32_t', [param('ns3::Trailer &', 'trailer')]) ## packet.h (module 'network'): void ns3::Packet::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::PrintByteTags(std::ostream & os) const [member function] cls.add_method('PrintByteTags', 'void', [param('std::ostream &', 'os')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::PrintPacketTags(std::ostream & os) const [member function] cls.add_method('PrintPacketTags', 'void', [param('std::ostream &', 'os')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::RemoveAllByteTags() [member function] cls.add_method('RemoveAllByteTags', 'void', []) ## packet.h (module 'network'): void ns3::Packet::RemoveAllPacketTags() [member function] cls.add_method('RemoveAllPacketTags', 'void', []) ## packet.h (module 'network'): void ns3::Packet::RemoveAtEnd(uint32_t size) [member function] cls.add_method('RemoveAtEnd', 'void', [param('uint32_t', 'size')]) ## packet.h (module 'network'): void ns3::Packet::RemoveAtStart(uint32_t size) [member function] cls.add_method('RemoveAtStart', 'void', [param('uint32_t', 'size')]) ## packet.h (module 'network'): uint32_t ns3::Packet::RemoveHeader(ns3::Header & header) [member function] cls.add_method('RemoveHeader', 'uint32_t', [param('ns3::Header &', 'header')]) ## packet.h (module 'network'): bool ns3::Packet::RemovePacketTag(ns3::Tag & tag) [member function] cls.add_method('RemovePacketTag', 'bool', [param('ns3::Tag &', 'tag')]) ## packet.h (module 'network'): uint32_t ns3::Packet::RemoveTrailer(ns3::Trailer & trailer) [member function] cls.add_method('RemoveTrailer', 'uint32_t', [param('ns3::Trailer &', 'trailer')]) ## packet.h (module 'network'): bool ns3::Packet::ReplacePacketTag(ns3::Tag & tag) [member function] cls.add_method('ReplacePacketTag', 'bool', [param('ns3::Tag &', 'tag')]) ## packet.h (module 'network'): uint32_t ns3::Packet::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function] cls.add_method('Serialize', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> arg0) [member function] cls.add_method('SetNixVector', 'void', [param('ns3::Ptr< ns3::NixVector >', 'arg0')]) return def register_Ns3ParetoRandomVariable_methods(root_module, cls): ## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ParetoRandomVariable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable::ParetoRandomVariable() [constructor] cls.add_constructor([]) ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetMean() const [member function] cls.add_method('GetMean', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetShape() const [member function] cls.add_method('GetShape', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetBound() const [member function] cls.add_method('GetBound', 'double', [], is_const=True) ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue(double mean, double shape, double bound) [member function] cls.add_method('GetValue', 'double', [param('double', 'mean'), param('double', 'shape'), param('double', 'bound')]) ## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger(uint32_t mean, uint32_t shape, uint32_t bound) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 'mean'), param('uint32_t', 'shape'), param('uint32_t', 'bound')]) ## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue() [member function] cls.add_method('GetValue', 'double', [], is_virtual=True) ## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger() [member function] cls.add_method('GetInteger', 'uint32_t', [], is_virtual=True) return def register_Ns3Ssid_methods(root_module, cls): cls.add_output_stream_operator() ## ssid.h (module 'wifi'): ns3::Ssid::Ssid(ns3::Ssid const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ssid const &', 'arg0')]) ## ssid.h (module 'wifi'): ns3::Ssid::Ssid() [constructor] cls.add_constructor([]) ## ssid.h (module 'wifi'): ns3::Ssid::Ssid(std::string s) [constructor] cls.add_constructor([param('std::string', 's')]) ## ssid.h (module 'wifi'): ns3::Ssid::Ssid(char const * ssid, uint8_t length) [constructor] cls.add_constructor([param('char const *', 'ssid'), param('uint8_t', 'length')]) ## ssid.h (module 'wifi'): uint8_t ns3::Ssid::DeserializeInformationField(ns3::Buffer::Iterator start, uint8_t length) [member function] cls.add_method('DeserializeInformationField', 'uint8_t', [param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')], is_virtual=True) ## ssid.h (module 'wifi'): ns3::WifiInformationElementId ns3::Ssid::ElementId() const [member function] cls.add_method('ElementId', 'ns3::WifiInformationElementId', [], is_const=True, is_virtual=True) ## ssid.h (module 'wifi'): uint8_t ns3::Ssid::GetInformationFieldSize() const [member function] cls.add_method('GetInformationFieldSize', 'uint8_t', [], is_const=True, is_virtual=True) ## ssid.h (module 'wifi'): bool ns3::Ssid::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', [], is_const=True) ## ssid.h (module 'wifi'): bool ns3::Ssid::IsEqual(ns3::Ssid const & o) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ssid const &', 'o')], is_const=True) ## ssid.h (module 'wifi'): char * ns3::Ssid::PeekString() const [member function] cls.add_method('PeekString', 'char *', [], is_const=True) ## ssid.h (module 'wifi'): void ns3::Ssid::SerializeInformationField(ns3::Buffer::Iterator start) const [member function] cls.add_method('SerializeInformationField', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) return def register_Ns3SsidChecker_methods(root_module, cls): ## ssid.h (module 'wifi'): ns3::SsidChecker::SsidChecker() [constructor] cls.add_constructor([]) ## ssid.h (module 'wifi'): ns3::SsidChecker::SsidChecker(ns3::SsidChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::SsidChecker const &', 'arg0')]) return def register_Ns3SsidValue_methods(root_module, cls): ## ssid.h (module 'wifi'): ns3::SsidValue::SsidValue() [constructor] cls.add_constructor([]) ## ssid.h (module 'wifi'): ns3::SsidValue::SsidValue(ns3::SsidValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::SsidValue const &', 'arg0')]) ## ssid.h (module 'wifi'): ns3::SsidValue::SsidValue(ns3::Ssid const & value) [constructor] cls.add_constructor([param('ns3::Ssid const &', 'value')]) ## ssid.h (module 'wifi'): ns3::Ptr<ns3::AttributeValue> ns3::SsidValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ssid.h (module 'wifi'): bool ns3::SsidValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ssid.h (module 'wifi'): ns3::Ssid ns3::SsidValue::Get() const [member function] cls.add_method('Get', 'ns3::Ssid', [], is_const=True) ## ssid.h (module 'wifi'): std::string ns3::SsidValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ssid.h (module 'wifi'): void ns3::SsidValue::Set(ns3::Ssid const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ssid const &', 'value')]) return def register_Ns3TcpL4Protocol_methods(root_module, cls): ## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) ## tcp-l4-protocol.h (module 'internet'): static ns3::TypeId ns3::TcpL4Protocol::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol::TcpL4Protocol() [constructor] cls.add_constructor([]) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## tcp-l4-protocol.h (module 'internet'): int ns3::TcpL4Protocol::GetProtocolNumber() const [member function] cls.add_method('GetProtocolNumber', 'int', [], is_const=True, is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::TcpL4Protocol::CreateSocket() [member function] cls.add_method('CreateSocket', 'ns3::Ptr< ns3::Socket >', []) ## tcp-l4-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::TcpL4Protocol::CreateSocket(ns3::TypeId socketTypeId) [member function] cls.add_method('CreateSocket', 'ns3::Ptr< ns3::Socket >', [param('ns3::TypeId', 'socketTypeId')]) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate() [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', []) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ipv4Address address) [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', [param('ns3::Ipv4Address', 'address')]) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(uint16_t port) [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', [param('uint16_t', 'port')]) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ipv4Address address, uint16_t port) [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', [param('ns3::Ipv4Address', 'address'), param('uint16_t', 'port')]) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ipv4Address localAddress, uint16_t localPort, ns3::Ipv4Address peerAddress, uint16_t peerPort) [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', [param('ns3::Ipv4Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv4Address', 'peerAddress'), param('uint16_t', 'peerPort')]) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6() [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', []) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6(ns3::Ipv6Address address) [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', [param('ns3::Ipv6Address', 'address')]) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6(uint16_t port) [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', [param('uint16_t', 'port')]) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6(ns3::Ipv6Address address, uint16_t port) [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', [param('ns3::Ipv6Address', 'address'), param('uint16_t', 'port')]) ## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6(ns3::Ipv6Address localAddress, uint16_t localPort, ns3::Ipv6Address peerAddress, uint16_t peerPort) [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', [param('ns3::Ipv6Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv6Address', 'peerAddress'), param('uint16_t', 'peerPort')]) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::DeAllocate(ns3::Ipv4EndPoint * endPoint) [member function] cls.add_method('DeAllocate', 'void', [param('ns3::Ipv4EndPoint *', 'endPoint')]) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::DeAllocate(ns3::Ipv6EndPoint * endPoint) [member function] cls.add_method('DeAllocate', 'void', [param('ns3::Ipv6EndPoint *', 'endPoint')]) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address saddr, ns3::Ipv4Address daddr, uint16_t sport, uint16_t dport, ns3::Ptr<ns3::NetDevice> oif=0) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'saddr'), param('ns3::Ipv4Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport'), param('ns3::Ptr< ns3::NetDevice >', 'oif', default_value='0')]) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv6Address saddr, ns3::Ipv6Address daddr, uint16_t sport, uint16_t dport, ns3::Ptr<ns3::NetDevice> oif=0) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'saddr'), param('ns3::Ipv6Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport'), param('ns3::Ptr< ns3::NetDevice >', 'oif', default_value='0')]) ## tcp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::TcpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> incomingInterface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')], is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::TcpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> interface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')], is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::ReceiveIcmp(ns3::Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv4Address payloadSource, ns3::Ipv4Address payloadDestination, uint8_t const * payload) [member function] cls.add_method('ReceiveIcmp', 'void', [param('ns3::Ipv4Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv4Address', 'payloadSource'), param('ns3::Ipv4Address', 'payloadDestination'), param('uint8_t const *', 'payload')], is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::ReceiveIcmp(ns3::Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv6Address payloadSource, ns3::Ipv6Address payloadDestination, uint8_t const * payload) [member function] cls.add_method('ReceiveIcmp', 'void', [param('ns3::Ipv6Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv6Address', 'payloadSource'), param('ns3::Ipv6Address', 'payloadDestination'), param('uint8_t const *', 'payload')], is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::SetDownTarget(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetDownTarget', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::SetDownTarget6(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetDownTarget6', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::TcpL4Protocol::GetDownTarget() const [member function] cls.add_method('GetDownTarget', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True, is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::TcpL4Protocol::GetDownTarget6() const [member function] cls.add_method('GetDownTarget6', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True, is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::NotifyNewAggregate() [member function] cls.add_method('NotifyNewAggregate', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3TimeValue_methods(root_module, cls): ## nstime.h (module 'core'): ns3::TimeValue::TimeValue() [constructor] cls.add_constructor([]) ## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::TimeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::TimeValue const &', 'arg0')]) ## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::Time const & value) [constructor] cls.add_constructor([param('ns3::Time const &', 'value')]) ## nstime.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TimeValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## nstime.h (module 'core'): bool ns3::TimeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## nstime.h (module 'core'): ns3::Time ns3::TimeValue::Get() const [member function] cls.add_method('Get', 'ns3::Time', [], is_const=True) ## nstime.h (module 'core'): std::string ns3::TimeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## nstime.h (module 'core'): void ns3::TimeValue::Set(ns3::Time const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Time const &', 'value')]) return def register_Ns3TypeIdChecker_methods(root_module, cls): ## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker(ns3::TypeIdChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::TypeIdChecker const &', 'arg0')]) return def register_Ns3TypeIdValue_methods(root_module, cls): ## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeIdValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::TypeIdValue const &', 'arg0')]) ## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeId const & value) [constructor] cls.add_constructor([param('ns3::TypeId const &', 'value')]) ## type-id.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TypeIdValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## type-id.h (module 'core'): bool ns3::TypeIdValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeIdValue::Get() const [member function] cls.add_method('Get', 'ns3::TypeId', [], is_const=True) ## type-id.h (module 'core'): std::string ns3::TypeIdValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## type-id.h (module 'core'): void ns3::TypeIdValue::Set(ns3::TypeId const & value) [member function] cls.add_method('Set', 'void', [param('ns3::TypeId const &', 'value')]) return def register_Ns3UdpL4Protocol_methods(root_module, cls): ## udp-l4-protocol.h (module 'internet'): ns3::UdpL4Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) ## udp-l4-protocol.h (module 'internet'): static ns3::TypeId ns3::UdpL4Protocol::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## udp-l4-protocol.h (module 'internet'): ns3::UdpL4Protocol::UdpL4Protocol() [constructor] cls.add_constructor([]) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## udp-l4-protocol.h (module 'internet'): int ns3::UdpL4Protocol::GetProtocolNumber() const [member function] cls.add_method('GetProtocolNumber', 'int', [], is_const=True, is_virtual=True) ## udp-l4-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::UdpL4Protocol::CreateSocket() [member function] cls.add_method('CreateSocket', 'ns3::Ptr< ns3::Socket >', []) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate() [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', []) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ipv4Address address) [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', [param('ns3::Ipv4Address', 'address')]) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(uint16_t port) [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', [param('uint16_t', 'port')]) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ipv4Address address, uint16_t port) [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', [param('ns3::Ipv4Address', 'address'), param('uint16_t', 'port')]) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ipv4Address localAddress, uint16_t localPort, ns3::Ipv4Address peerAddress, uint16_t peerPort) [member function] cls.add_method('Allocate', 'ns3::Ipv4EndPoint *', [param('ns3::Ipv4Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv4Address', 'peerAddress'), param('uint16_t', 'peerPort')]) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6() [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', []) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6(ns3::Ipv6Address address) [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', [param('ns3::Ipv6Address', 'address')]) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6(uint16_t port) [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', [param('uint16_t', 'port')]) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6(ns3::Ipv6Address address, uint16_t port) [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', [param('ns3::Ipv6Address', 'address'), param('uint16_t', 'port')]) ## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6(ns3::Ipv6Address localAddress, uint16_t localPort, ns3::Ipv6Address peerAddress, uint16_t peerPort) [member function] cls.add_method('Allocate6', 'ns3::Ipv6EndPoint *', [param('ns3::Ipv6Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv6Address', 'peerAddress'), param('uint16_t', 'peerPort')]) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::DeAllocate(ns3::Ipv4EndPoint * endPoint) [member function] cls.add_method('DeAllocate', 'void', [param('ns3::Ipv4EndPoint *', 'endPoint')]) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::DeAllocate(ns3::Ipv6EndPoint * endPoint) [member function] cls.add_method('DeAllocate', 'void', [param('ns3::Ipv6EndPoint *', 'endPoint')]) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address saddr, ns3::Ipv4Address daddr, uint16_t sport, uint16_t dport) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'saddr'), param('ns3::Ipv4Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport')]) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address saddr, ns3::Ipv4Address daddr, uint16_t sport, uint16_t dport, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'saddr'), param('ns3::Ipv4Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv6Address saddr, ns3::Ipv6Address daddr, uint16_t sport, uint16_t dport) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'saddr'), param('ns3::Ipv6Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport')]) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv6Address saddr, ns3::Ipv6Address daddr, uint16_t sport, uint16_t dport, ns3::Ptr<ns3::Ipv6Route> route) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'saddr'), param('ns3::Ipv6Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport'), param('ns3::Ptr< ns3::Ipv6Route >', 'route')]) ## udp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::UdpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> interface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'interface')], is_virtual=True) ## udp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::UdpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> interface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')], is_virtual=True) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::ReceiveIcmp(ns3::Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv4Address payloadSource, ns3::Ipv4Address payloadDestination, uint8_t const * payload) [member function] cls.add_method('ReceiveIcmp', 'void', [param('ns3::Ipv4Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv4Address', 'payloadSource'), param('ns3::Ipv4Address', 'payloadDestination'), param('uint8_t const *', 'payload')], is_virtual=True) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::ReceiveIcmp(ns3::Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv6Address payloadSource, ns3::Ipv6Address payloadDestination, uint8_t const * payload) [member function] cls.add_method('ReceiveIcmp', 'void', [param('ns3::Ipv6Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv6Address', 'payloadSource'), param('ns3::Ipv6Address', 'payloadDestination'), param('uint8_t const *', 'payload')], is_virtual=True) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::SetDownTarget(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetDownTarget', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::SetDownTarget6(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetDownTarget6', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) ## udp-l4-protocol.h (module 'internet'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::UdpL4Protocol::GetDownTarget() const [member function] cls.add_method('GetDownTarget', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True, is_virtual=True) ## udp-l4-protocol.h (module 'internet'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::UdpL4Protocol::GetDownTarget6() const [member function] cls.add_method('GetDownTarget6', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True, is_virtual=True) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::NotifyNewAggregate() [member function] cls.add_method('NotifyNewAggregate', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3UintegerValue_methods(root_module, cls): ## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue() [constructor] cls.add_constructor([]) ## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(ns3::UintegerValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::UintegerValue const &', 'arg0')]) ## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(uint64_t const & value) [constructor] cls.add_constructor([param('uint64_t const &', 'value')]) ## uinteger.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::UintegerValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## uinteger.h (module 'core'): bool ns3::UintegerValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## uinteger.h (module 'core'): uint64_t ns3::UintegerValue::Get() const [member function] cls.add_method('Get', 'uint64_t', [], is_const=True) ## uinteger.h (module 'core'): std::string ns3::UintegerValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## uinteger.h (module 'core'): void ns3::UintegerValue::Set(uint64_t const & value) [member function] cls.add_method('Set', 'void', [param('uint64_t const &', 'value')]) return def register_Ns3WifiModeChecker_methods(root_module, cls): ## wifi-mode.h (module 'wifi'): ns3::WifiModeChecker::WifiModeChecker() [constructor] cls.add_constructor([]) ## wifi-mode.h (module 'wifi'): ns3::WifiModeChecker::WifiModeChecker(ns3::WifiModeChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiModeChecker const &', 'arg0')]) return def register_Ns3WifiModeValue_methods(root_module, cls): ## wifi-mode.h (module 'wifi'): ns3::WifiModeValue::WifiModeValue() [constructor] cls.add_constructor([]) ## wifi-mode.h (module 'wifi'): ns3::WifiModeValue::WifiModeValue(ns3::WifiModeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::WifiModeValue const &', 'arg0')]) ## wifi-mode.h (module 'wifi'): ns3::WifiModeValue::WifiModeValue(ns3::WifiMode const & value) [constructor] cls.add_constructor([param('ns3::WifiMode const &', 'value')]) ## wifi-mode.h (module 'wifi'): ns3::Ptr<ns3::AttributeValue> ns3::WifiModeValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## wifi-mode.h (module 'wifi'): bool ns3::WifiModeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## wifi-mode.h (module 'wifi'): ns3::WifiMode ns3::WifiModeValue::Get() const [member function] cls.add_method('Get', 'ns3::WifiMode', [], is_const=True) ## wifi-mode.h (module 'wifi'): std::string ns3::WifiModeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## wifi-mode.h (module 'wifi'): void ns3::WifiModeValue::Set(ns3::WifiMode const & value) [member function] cls.add_method('Set', 'void', [param('ns3::WifiMode const &', 'value')]) return def register_Ns3AddressChecker_methods(root_module, cls): ## address.h (module 'network'): ns3::AddressChecker::AddressChecker() [constructor] cls.add_constructor([]) ## address.h (module 'network'): ns3::AddressChecker::AddressChecker(ns3::AddressChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::AddressChecker const &', 'arg0')]) return def register_Ns3AddressValue_methods(root_module, cls): ## address.h (module 'network'): ns3::AddressValue::AddressValue() [constructor] cls.add_constructor([]) ## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::AddressValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::AddressValue const &', 'arg0')]) ## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::Address const & value) [constructor] cls.add_constructor([param('ns3::Address const &', 'value')]) ## address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::AddressValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## address.h (module 'network'): bool ns3::AddressValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## address.h (module 'network'): ns3::Address ns3::AddressValue::Get() const [member function] cls.add_method('Get', 'ns3::Address', [], is_const=True) ## address.h (module 'network'): std::string ns3::AddressValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## address.h (module 'network'): void ns3::AddressValue::Set(ns3::Address const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Address const &', 'value')]) return def register_Ns3Icmpv4L4Protocol_methods(root_module, cls): ## icmpv4-l4-protocol.h (module 'internet'): ns3::Icmpv4L4Protocol::Icmpv4L4Protocol(ns3::Icmpv4L4Protocol const & arg0) [copy constructor] cls.add_constructor([param('ns3::Icmpv4L4Protocol const &', 'arg0')]) ## icmpv4-l4-protocol.h (module 'internet'): ns3::Icmpv4L4Protocol::Icmpv4L4Protocol() [constructor] cls.add_constructor([]) ## icmpv4-l4-protocol.h (module 'internet'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::Icmpv4L4Protocol::GetDownTarget() const [member function] cls.add_method('GetDownTarget', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True, is_virtual=True) ## icmpv4-l4-protocol.h (module 'internet'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::Icmpv4L4Protocol::GetDownTarget6() const [member function] cls.add_method('GetDownTarget6', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True, is_virtual=True) ## icmpv4-l4-protocol.h (module 'internet'): int ns3::Icmpv4L4Protocol::GetProtocolNumber() const [member function] cls.add_method('GetProtocolNumber', 'int', [], is_const=True, is_virtual=True) ## icmpv4-l4-protocol.h (module 'internet'): static uint16_t ns3::Icmpv4L4Protocol::GetStaticProtocolNumber() [member function] cls.add_method('GetStaticProtocolNumber', 'uint16_t', [], is_static=True) ## icmpv4-l4-protocol.h (module 'internet'): static ns3::TypeId ns3::Icmpv4L4Protocol::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## icmpv4-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::Icmpv4L4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> incomingInterface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')], is_virtual=True) ## icmpv4-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::Icmpv4L4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> incomingInterface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')], is_virtual=True) ## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SendDestUnreachFragNeeded(ns3::Ipv4Header header, ns3::Ptr<ns3::Packet const> orgData, uint16_t nextHopMtu) [member function] cls.add_method('SendDestUnreachFragNeeded', 'void', [param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData'), param('uint16_t', 'nextHopMtu')]) ## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SendDestUnreachPort(ns3::Ipv4Header header, ns3::Ptr<ns3::Packet const> orgData) [member function] cls.add_method('SendDestUnreachPort', 'void', [param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData')]) ## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SendTimeExceededTtl(ns3::Ipv4Header header, ns3::Ptr<ns3::Packet const> orgData) [member function] cls.add_method('SendTimeExceededTtl', 'void', [param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData')]) ## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SetDownTarget(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetDownTarget', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) ## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SetDownTarget6(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetDownTarget6', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) ## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## icmpv4-l4-protocol.h (module 'internet'): ns3::Icmpv4L4Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) ## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::NotifyNewAggregate() [member function] cls.add_method('NotifyNewAggregate', 'void', [], visibility='protected', is_virtual=True) ## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='private', is_virtual=True) return def register_Ns3HashImplementation_methods(root_module, cls): ## hash-function.h (module 'core'): ns3::Hash::Implementation::Implementation(ns3::Hash::Implementation const & arg0) [copy constructor] cls.add_constructor([param('ns3::Hash::Implementation const &', 'arg0')]) ## hash-function.h (module 'core'): ns3::Hash::Implementation::Implementation() [constructor] cls.add_constructor([]) ## hash-function.h (module 'core'): uint32_t ns3::Hash::Implementation::GetHash32(char const * buffer, size_t const size) [member function] cls.add_method('GetHash32', 'uint32_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_pure_virtual=True, is_virtual=True) ## hash-function.h (module 'core'): uint64_t ns3::Hash::Implementation::GetHash64(char const * buffer, size_t const size) [member function] cls.add_method('GetHash64', 'uint64_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_virtual=True) ## hash-function.h (module 'core'): void ns3::Hash::Implementation::clear() [member function] cls.add_method('clear', 'void', [], is_pure_virtual=True, is_virtual=True) return def register_Ns3HashFunctionFnv1a_methods(root_module, cls): ## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a::Fnv1a(ns3::Hash::Function::Fnv1a const & arg0) [copy constructor] cls.add_constructor([param('ns3::Hash::Function::Fnv1a const &', 'arg0')]) ## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a::Fnv1a() [constructor] cls.add_constructor([]) ## hash-fnv.h (module 'core'): uint32_t ns3::Hash::Function::Fnv1a::GetHash32(char const * buffer, size_t const size) [member function] cls.add_method('GetHash32', 'uint32_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_virtual=True) ## hash-fnv.h (module 'core'): uint64_t ns3::Hash::Function::Fnv1a::GetHash64(char const * buffer, size_t const size) [member function] cls.add_method('GetHash64', 'uint64_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_virtual=True) ## hash-fnv.h (module 'core'): void ns3::Hash::Function::Fnv1a::clear() [member function] cls.add_method('clear', 'void', [], is_virtual=True) return def register_Ns3HashFunctionHash32_methods(root_module, cls): ## hash-function.h (module 'core'): ns3::Hash::Function::Hash32::Hash32(ns3::Hash::Function::Hash32 const & arg0) [copy constructor] cls.add_constructor([param('ns3::Hash::Function::Hash32 const &', 'arg0')]) ## hash-function.h (module 'core'): ns3::Hash::Function::Hash32::Hash32(ns3::Hash::Hash32Function_ptr hp) [constructor] cls.add_constructor([param('ns3::Hash::Hash32Function_ptr', 'hp')]) ## hash-function.h (module 'core'): uint32_t ns3::Hash::Function::Hash32::GetHash32(char const * buffer, size_t const size) [member function] cls.add_method('GetHash32', 'uint32_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_virtual=True) ## hash-function.h (module 'core'): void ns3::Hash::Function::Hash32::clear() [member function] cls.add_method('clear', 'void', [], is_virtual=True) return def register_Ns3HashFunctionHash64_methods(root_module, cls): ## hash-function.h (module 'core'): ns3::Hash::Function::Hash64::Hash64(ns3::Hash::Function::Hash64 const & arg0) [copy constructor] cls.add_constructor([param('ns3::Hash::Function::Hash64 const &', 'arg0')]) ## hash-function.h (module 'core'): ns3::Hash::Function::Hash64::Hash64(ns3::Hash::Hash64Function_ptr hp) [constructor] cls.add_constructor([param('ns3::Hash::Hash64Function_ptr', 'hp')]) ## hash-function.h (module 'core'): uint32_t ns3::Hash::Function::Hash64::GetHash32(char const * buffer, size_t const size) [member function] cls.add_method('GetHash32', 'uint32_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_virtual=True) ## hash-function.h (module 'core'): uint64_t ns3::Hash::Function::Hash64::GetHash64(char const * buffer, size_t const size) [member function] cls.add_method('GetHash64', 'uint64_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_virtual=True) ## hash-function.h (module 'core'): void ns3::Hash::Function::Hash64::clear() [member function] cls.add_method('clear', 'void', [], is_virtual=True) return def register_Ns3HashFunctionMurmur3_methods(root_module, cls): ## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3::Murmur3(ns3::Hash::Function::Murmur3 const & arg0) [copy constructor] cls.add_constructor([param('ns3::Hash::Function::Murmur3 const &', 'arg0')]) ## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3::Murmur3() [constructor] cls.add_constructor([]) ## hash-murmur3.h (module 'core'): uint32_t ns3::Hash::Function::Murmur3::GetHash32(char const * buffer, size_t const size) [member function] cls.add_method('GetHash32', 'uint32_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_virtual=True) ## hash-murmur3.h (module 'core'): uint64_t ns3::Hash::Function::Murmur3::GetHash64(char const * buffer, size_t const size) [member function] cls.add_method('GetHash64', 'uint64_t', [param('char const *', 'buffer'), param('size_t const', 'size')], is_virtual=True) ## hash-murmur3.h (module 'core'): void ns3::Hash::Function::Murmur3::clear() [member function] cls.add_method('clear', 'void', [], is_virtual=True) return def register_Ns3DsrBlackList_methods(root_module, cls): ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::BlackList(ns3::dsr::BlackList const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::BlackList const &', 'arg0')]) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::BlackList(ns3::Ipv4Address ip, ns3::Time t) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ip'), param('ns3::Time', 't')]) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::m_expireTime [variable] cls.add_instance_attribute('m_expireTime', 'ns3::Time', is_const=False) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::m_linkStates [variable] cls.add_instance_attribute('m_linkStates', 'ns3::dsr::LinkStates', is_const=False) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::m_neighborAddress [variable] cls.add_instance_attribute('m_neighborAddress', 'ns3::Ipv4Address', is_const=False) return def register_Ns3DsrDsrFsHeader_methods(root_module, cls): ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrFsHeader::DsrFsHeader(ns3::dsr::DsrFsHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrFsHeader const &', 'arg0')]) ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrFsHeader::DsrFsHeader() [constructor] cls.add_constructor([]) ## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrFsHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-fs-header.h (module 'dsr'): uint16_t ns3::dsr::DsrFsHeader::GetDestId() const [member function] cls.add_method('GetDestId', 'uint16_t', [], is_const=True) ## dsr-fs-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrFsHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-fs-header.h (module 'dsr'): uint8_t ns3::dsr::DsrFsHeader::GetMessageType() const [member function] cls.add_method('GetMessageType', 'uint8_t', [], is_const=True) ## dsr-fs-header.h (module 'dsr'): uint8_t ns3::dsr::DsrFsHeader::GetNextHeader() const [member function] cls.add_method('GetNextHeader', 'uint8_t', [], is_const=True) ## dsr-fs-header.h (module 'dsr'): uint16_t ns3::dsr::DsrFsHeader::GetPayloadLength() const [member function] cls.add_method('GetPayloadLength', 'uint16_t', [], is_const=True) ## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrFsHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-fs-header.h (module 'dsr'): uint16_t ns3::dsr::DsrFsHeader::GetSourceId() const [member function] cls.add_method('GetSourceId', 'uint16_t', [], is_const=True) ## dsr-fs-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrFsHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetDestId(uint16_t destId) [member function] cls.add_method('SetDestId', 'void', [param('uint16_t', 'destId')]) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetMessageType(uint8_t messageType) [member function] cls.add_method('SetMessageType', 'void', [param('uint8_t', 'messageType')]) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetNextHeader(uint8_t protocol) [member function] cls.add_method('SetNextHeader', 'void', [param('uint8_t', 'protocol')]) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetPayloadLength(uint16_t length) [member function] cls.add_method('SetPayloadLength', 'void', [param('uint16_t', 'length')]) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetSourceId(uint16_t sourceId) [member function] cls.add_method('SetSourceId', 'void', [param('uint16_t', 'sourceId')]) return def register_Ns3DsrDsrNetworkQueue_methods(root_module, cls): ## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueue::DsrNetworkQueue(ns3::dsr::DsrNetworkQueue const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrNetworkQueue const &', 'arg0')]) ## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueue::DsrNetworkQueue() [constructor] cls.add_constructor([]) ## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueue::DsrNetworkQueue(uint32_t maxLen, ns3::Time maxDelay) [constructor] cls.add_constructor([param('uint32_t', 'maxLen'), param('ns3::Time', 'maxDelay')]) ## dsr-network-queue.h (module 'dsr'): bool ns3::dsr::DsrNetworkQueue::Dequeue(ns3::dsr::DsrNetworkQueueEntry & entry) [member function] cls.add_method('Dequeue', 'bool', [param('ns3::dsr::DsrNetworkQueueEntry &', 'entry')]) ## dsr-network-queue.h (module 'dsr'): bool ns3::dsr::DsrNetworkQueue::Enqueue(ns3::dsr::DsrNetworkQueueEntry & entry) [member function] cls.add_method('Enqueue', 'bool', [param('ns3::dsr::DsrNetworkQueueEntry &', 'entry')]) ## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueue::Flush() [member function] cls.add_method('Flush', 'void', []) ## dsr-network-queue.h (module 'dsr'): ns3::Time ns3::dsr::DsrNetworkQueue::GetMaxNetworkDelay() const [member function] cls.add_method('GetMaxNetworkDelay', 'ns3::Time', [], is_const=True) ## dsr-network-queue.h (module 'dsr'): uint32_t ns3::dsr::DsrNetworkQueue::GetMaxNetworkSize() const [member function] cls.add_method('GetMaxNetworkSize', 'uint32_t', [], is_const=True) ## dsr-network-queue.h (module 'dsr'): std::vector<ns3::dsr::DsrNetworkQueueEntry, std::allocator<ns3::dsr::DsrNetworkQueueEntry> > & ns3::dsr::DsrNetworkQueue::GetQueue() [member function] cls.add_method('GetQueue', 'std::vector< ns3::dsr::DsrNetworkQueueEntry > &', []) ## dsr-network-queue.h (module 'dsr'): uint32_t ns3::dsr::DsrNetworkQueue::GetSize() [member function] cls.add_method('GetSize', 'uint32_t', []) ## dsr-network-queue.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrNetworkQueue::GetTypeID() [member function] cls.add_method('GetTypeID', 'ns3::TypeId', [], is_static=True) ## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueue::SetMaxNetworkDelay(ns3::Time delay) [member function] cls.add_method('SetMaxNetworkDelay', 'void', [param('ns3::Time', 'delay')]) ## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueue::SetMaxNetworkSize(uint32_t maxSize) [member function] cls.add_method('SetMaxNetworkSize', 'void', [param('uint32_t', 'maxSize')]) return def register_Ns3DsrDsrNetworkQueueEntry_methods(root_module, cls): cls.add_binary_comparison_operator('==') ## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueueEntry::DsrNetworkQueueEntry(ns3::dsr::DsrNetworkQueueEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrNetworkQueueEntry const &', 'arg0')]) ## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueueEntry::DsrNetworkQueueEntry(ns3::Ptr<ns3::Packet const> pa=0, ns3::Ipv4Address s=ns3::Ipv4Address(), ns3::Ipv4Address n=ns3::Ipv4Address(), ns3::Time exp=ns3::Simulator::Now( ), ns3::Ptr<ns3::Ipv4Route> r=0) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 's', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'n', default_value='ns3::Ipv4Address()'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now( )'), param('ns3::Ptr< ns3::Ipv4Route >', 'r', default_value='0')]) ## dsr-network-queue.h (module 'dsr'): ns3::Time ns3::dsr::DsrNetworkQueueEntry::GetInsertedTimeStamp() const [member function] cls.add_method('GetInsertedTimeStamp', 'ns3::Time', [], is_const=True) ## dsr-network-queue.h (module 'dsr'): ns3::Ptr<ns3::Ipv4Route> ns3::dsr::DsrNetworkQueueEntry::GetIpv4Route() const [member function] cls.add_method('GetIpv4Route', 'ns3::Ptr< ns3::Ipv4Route >', [], is_const=True) ## dsr-network-queue.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrNetworkQueueEntry::GetNextHopAddress() const [member function] cls.add_method('GetNextHopAddress', 'ns3::Ipv4Address', [], is_const=True) ## dsr-network-queue.h (module 'dsr'): ns3::Ptr<ns3::Packet const> ns3::dsr::DsrNetworkQueueEntry::GetPacket() const [member function] cls.add_method('GetPacket', 'ns3::Ptr< ns3::Packet const >', [], is_const=True) ## dsr-network-queue.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrNetworkQueueEntry::GetSourceAddress() const [member function] cls.add_method('GetSourceAddress', 'ns3::Ipv4Address', [], is_const=True) ## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetInsertedTimeStamp(ns3::Time time) [member function] cls.add_method('SetInsertedTimeStamp', 'void', [param('ns3::Time', 'time')]) ## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetIpv4Route(ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('SetIpv4Route', 'void', [param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) ## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetNextHopAddress(ns3::Ipv4Address addr) [member function] cls.add_method('SetNextHopAddress', 'void', [param('ns3::Ipv4Address', 'addr')]) ## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetPacket(ns3::Ptr<ns3::Packet const> p) [member function] cls.add_method('SetPacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'p')]) ## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetSourceAddress(ns3::Ipv4Address addr) [member function] cls.add_method('SetSourceAddress', 'void', [param('ns3::Ipv4Address', 'addr')]) return def register_Ns3DsrDsrOptionField_methods(root_module, cls): ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrOptionField::DsrOptionField(ns3::dsr::DsrOptionField const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionField const &', 'arg0')]) ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrOptionField::DsrOptionField(uint32_t optionsOffset) [constructor] cls.add_constructor([param('uint32_t', 'optionsOffset')]) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrOptionField::AddDsrOption(ns3::dsr::DsrOptionHeader const & option) [member function] cls.add_method('AddDsrOption', 'void', [param('ns3::dsr::DsrOptionHeader const &', 'option')]) ## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionField::Deserialize(ns3::Buffer::Iterator start, uint32_t length) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'length')]) ## dsr-fs-header.h (module 'dsr'): ns3::Buffer ns3::dsr::DsrOptionField::GetDsrOptionBuffer() [member function] cls.add_method('GetDsrOptionBuffer', 'ns3::Buffer', []) ## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionField::GetDsrOptionsOffset() [member function] cls.add_method('GetDsrOptionsOffset', 'uint32_t', []) ## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionField::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrOptionField::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True) return def register_Ns3DsrDsrOptionHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::DsrOptionHeader(ns3::dsr::DsrOptionHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::DsrOptionHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionHeader::GetLength() const [member function] cls.add_method('GetLength', 'uint8_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionHeader::GetType() const [member function] cls.add_method('GetType', 'uint8_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionHeader::SetLength(uint8_t length) [member function] cls.add_method('SetLength', 'void', [param('uint8_t', 'length')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionHeader::SetType(uint8_t type) [member function] cls.add_method('SetType', 'void', [param('uint8_t', 'type')]) return def register_Ns3DsrDsrOptionHeaderAlignment_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment::Alignment() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment::Alignment(ns3::dsr::DsrOptionHeader::Alignment const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionHeader::Alignment const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment::factor [variable] cls.add_instance_attribute('factor', 'uint8_t', is_const=False) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment::offset [variable] cls.add_instance_attribute('offset', 'uint8_t', is_const=False) return def register_Ns3DsrDsrOptionPad1Header_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPad1Header::DsrOptionPad1Header(ns3::dsr::DsrOptionPad1Header const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionPad1Header const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPad1Header::DsrOptionPad1Header() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionPad1Header::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionPad1Header::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionPad1Header::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionPad1Header::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionPad1Header::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionPad1Header::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) return def register_Ns3DsrDsrOptionPadnHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPadnHeader::DsrOptionPadnHeader(ns3::dsr::DsrOptionPadnHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionPadnHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPadnHeader::DsrOptionPadnHeader(uint32_t pad=2) [constructor] cls.add_constructor([param('uint32_t', 'pad', default_value='2')]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionPadnHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionPadnHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionPadnHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionPadnHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionPadnHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionPadnHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) return def register_Ns3DsrDsrOptionRerrHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrHeader::DsrOptionRerrHeader(ns3::dsr::DsrOptionRerrHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionRerrHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrHeader::DsrOptionRerrHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRerrHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrHeader::GetErrorDst() const [member function] cls.add_method('GetErrorDst', 'ns3::Ipv4Address', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrHeader::GetErrorSrc() const [member function] cls.add_method('GetErrorSrc', 'ns3::Ipv4Address', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerrHeader::GetErrorType() const [member function] cls.add_method('GetErrorType', 'uint8_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRerrHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerrHeader::GetSalvage() const [member function] cls.add_method('GetSalvage', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRerrHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::SetErrorDst(ns3::Ipv4Address errorDstAddress) [member function] cls.add_method('SetErrorDst', 'void', [param('ns3::Ipv4Address', 'errorDstAddress')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::SetErrorSrc(ns3::Ipv4Address errorSrcAddress) [member function] cls.add_method('SetErrorSrc', 'void', [param('ns3::Ipv4Address', 'errorSrcAddress')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::SetErrorType(uint8_t errorType) [member function] cls.add_method('SetErrorType', 'void', [param('uint8_t', 'errorType')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::SetSalvage(uint8_t salvage) [member function] cls.add_method('SetSalvage', 'void', [param('uint8_t', 'salvage')], is_virtual=True) return def register_Ns3DsrDsrOptionRerrUnreachHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnreachHeader::DsrOptionRerrUnreachHeader(ns3::dsr::DsrOptionRerrUnreachHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionRerrUnreachHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnreachHeader::DsrOptionRerrUnreachHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrUnreachHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRerrUnreachHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst() const [member function] cls.add_method('GetErrorDst', 'ns3::Ipv4Address', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc() const [member function] cls.add_method('GetErrorSrc', 'ns3::Ipv4Address', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRerrUnreachHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnreachHeader::GetOriginalDst() const [member function] cls.add_method('GetOriginalDst', 'ns3::Ipv4Address', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage() const [member function] cls.add_method('GetSalvage', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrUnreachHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRerrUnreachHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode() const [member function] cls.add_method('GetUnreachNode', 'ns3::Ipv4Address', [], is_const=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorDst(ns3::Ipv4Address errorDstAddress) [member function] cls.add_method('SetErrorDst', 'void', [param('ns3::Ipv4Address', 'errorDstAddress')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorSrc(ns3::Ipv4Address errorSrcAddress) [member function] cls.add_method('SetErrorSrc', 'void', [param('ns3::Ipv4Address', 'errorSrcAddress')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetOriginalDst(ns3::Ipv4Address originalDst) [member function] cls.add_method('SetOriginalDst', 'void', [param('ns3::Ipv4Address', 'originalDst')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(uint8_t salvage) [member function] cls.add_method('SetSalvage', 'void', [param('uint8_t', 'salvage')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode(ns3::Ipv4Address unreachNode) [member function] cls.add_method('SetUnreachNode', 'void', [param('ns3::Ipv4Address', 'unreachNode')]) return def register_Ns3DsrDsrOptionRerrUnsupportHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnsupportHeader::DsrOptionRerrUnsupportHeader(ns3::dsr::DsrOptionRerrUnsupportHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionRerrUnsupportHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnsupportHeader::DsrOptionRerrUnsupportHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrUnsupportHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRerrUnsupportHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnsupportHeader::GetErrorDst() const [member function] cls.add_method('GetErrorDst', 'ns3::Ipv4Address', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnsupportHeader::GetErrorSrc() const [member function] cls.add_method('GetErrorSrc', 'ns3::Ipv4Address', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRerrUnsupportHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerrUnsupportHeader::GetSalvage() const [member function] cls.add_method('GetSalvage', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrUnsupportHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRerrUnsupportHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): uint16_t ns3::dsr::DsrOptionRerrUnsupportHeader::GetUnsupported() const [member function] cls.add_method('GetUnsupported', 'uint16_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::SetErrorDst(ns3::Ipv4Address errorDstAddress) [member function] cls.add_method('SetErrorDst', 'void', [param('ns3::Ipv4Address', 'errorDstAddress')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::SetErrorSrc(ns3::Ipv4Address errorSrcAddress) [member function] cls.add_method('SetErrorSrc', 'void', [param('ns3::Ipv4Address', 'errorSrcAddress')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::SetSalvage(uint8_t salvage) [member function] cls.add_method('SetSalvage', 'void', [param('uint8_t', 'salvage')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::SetUnsupported(uint16_t optionType) [member function] cls.add_method('SetUnsupported', 'void', [param('uint16_t', 'optionType')]) return def register_Ns3DsrDsrOptionRrepHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRrepHeader::DsrOptionRrepHeader(ns3::dsr::DsrOptionRrepHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionRrepHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRrepHeader::DsrOptionRrepHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRrepHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRrepHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRrepHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRrepHeader::GetNodeAddress(uint8_t index) const [member function] cls.add_method('GetNodeAddress', 'ns3::Ipv4Address', [param('uint8_t', 'index')], is_const=True) ## dsr-option-header.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::DsrOptionRrepHeader::GetNodesAddress() const [member function] cls.add_method('GetNodesAddress', 'std::vector< ns3::Ipv4Address >', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRrepHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRrepHeader::GetTargetAddress(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ipv4Address) const [member function] cls.add_method('GetTargetAddress', 'ns3::Ipv4Address', [param('std::vector< ns3::Ipv4Address >', 'ipv4Address')], is_const=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRrepHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::SetNodeAddress(uint8_t index, ns3::Ipv4Address addr) [member function] cls.add_method('SetNodeAddress', 'void', [param('uint8_t', 'index'), param('ns3::Ipv4Address', 'addr')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::SetNodesAddress(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ipv4Address) [member function] cls.add_method('SetNodesAddress', 'void', [param('std::vector< ns3::Ipv4Address >', 'ipv4Address')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::SetNumberAddress(uint8_t n) [member function] cls.add_method('SetNumberAddress', 'void', [param('uint8_t', 'n')]) return def register_Ns3DsrDsrOptionRreqHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRreqHeader::DsrOptionRreqHeader(ns3::dsr::DsrOptionRreqHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionRreqHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRreqHeader::DsrOptionRreqHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::AddNodeAddress(ns3::Ipv4Address ipv4) [member function] cls.add_method('AddNodeAddress', 'void', [param('ns3::Ipv4Address', 'ipv4')]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRreqHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRreqHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint16_t ns3::dsr::DsrOptionRreqHeader::GetId() const [member function] cls.add_method('GetId', 'uint16_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRreqHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRreqHeader::GetNodeAddress(uint8_t index) const [member function] cls.add_method('GetNodeAddress', 'ns3::Ipv4Address', [param('uint8_t', 'index')], is_const=True) ## dsr-option-header.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::DsrOptionRreqHeader::GetNodesAddresses() const [member function] cls.add_method('GetNodesAddresses', 'std::vector< ns3::Ipv4Address >', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRreqHeader::GetNodesNumber() const [member function] cls.add_method('GetNodesNumber', 'uint32_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRreqHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRreqHeader::GetTarget() [member function] cls.add_method('GetTarget', 'ns3::Ipv4Address', []) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRreqHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetId(uint16_t identification) [member function] cls.add_method('SetId', 'void', [param('uint16_t', 'identification')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetNodeAddress(uint8_t index, ns3::Ipv4Address addr) [member function] cls.add_method('SetNodeAddress', 'void', [param('uint8_t', 'index'), param('ns3::Ipv4Address', 'addr')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetNodesAddress(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ipv4Address) [member function] cls.add_method('SetNodesAddress', 'void', [param('std::vector< ns3::Ipv4Address >', 'ipv4Address')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetNumberAddress(uint8_t n) [member function] cls.add_method('SetNumberAddress', 'void', [param('uint8_t', 'n')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetTarget(ns3::Ipv4Address target) [member function] cls.add_method('SetTarget', 'void', [param('ns3::Ipv4Address', 'target')]) return def register_Ns3DsrDsrOptionSRHeader_methods(root_module, cls): cls.add_output_stream_operator() ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionSRHeader::DsrOptionSRHeader(ns3::dsr::DsrOptionSRHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionSRHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionSRHeader::DsrOptionSRHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionSRHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionSRHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionSRHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionSRHeader::GetNodeAddress(uint8_t index) const [member function] cls.add_method('GetNodeAddress', 'ns3::Ipv4Address', [param('uint8_t', 'index')], is_const=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSRHeader::GetNodeListSize() const [member function] cls.add_method('GetNodeListSize', 'uint8_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::DsrOptionSRHeader::GetNodesAddress() const [member function] cls.add_method('GetNodesAddress', 'std::vector< ns3::Ipv4Address >', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSRHeader::GetSalvage() const [member function] cls.add_method('GetSalvage', 'uint8_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSRHeader::GetSegmentsLeft() const [member function] cls.add_method('GetSegmentsLeft', 'uint8_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionSRHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionSRHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetNodeAddress(uint8_t index, ns3::Ipv4Address addr) [member function] cls.add_method('SetNodeAddress', 'void', [param('uint8_t', 'index'), param('ns3::Ipv4Address', 'addr')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetNodesAddress(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ipv4Address) [member function] cls.add_method('SetNodesAddress', 'void', [param('std::vector< ns3::Ipv4Address >', 'ipv4Address')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetNumberAddress(uint8_t n) [member function] cls.add_method('SetNumberAddress', 'void', [param('uint8_t', 'n')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetSalvage(uint8_t salvage) [member function] cls.add_method('SetSalvage', 'void', [param('uint8_t', 'salvage')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(uint8_t segmentsLeft) [member function] cls.add_method('SetSegmentsLeft', 'void', [param('uint8_t', 'segmentsLeft')]) return def register_Ns3DsrDsrOptions_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptions::DsrOptions(ns3::dsr::DsrOptions const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptions const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptions::DsrOptions() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): bool ns3::dsr::DsrOptions::CheckDuplicates(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('CheckDuplicates', 'bool', [param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-options.h (module 'dsr'): bool ns3::dsr::DsrOptions::ContainAddressAfter(ns3::Ipv4Address ipv4Address, ns3::Ipv4Address destAddress, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & nodeList) [member function] cls.add_method('ContainAddressAfter', 'bool', [param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'destAddress'), param('std::vector< ns3::Ipv4Address > &', 'nodeList')]) ## dsr-options.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::DsrOptions::CutRoute(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & nodeList) [member function] cls.add_method('CutRoute', 'std::vector< ns3::Ipv4Address >', [param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'nodeList')]) ## dsr-options.h (module 'dsr'): uint32_t ns3::dsr::DsrOptions::GetIDfromIP(ns3::Ipv4Address address) [member function] cls.add_method('GetIDfromIP', 'uint32_t', [param('ns3::Ipv4Address', 'address')]) ## dsr-options.h (module 'dsr'): ns3::Ptr<ns3::Node> ns3::dsr::DsrOptions::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True) ## dsr-options.h (module 'dsr'): ns3::Ptr<ns3::Node> ns3::dsr::DsrOptions::GetNodeWithAddress(ns3::Ipv4Address ipv4Address) [member function] cls.add_method('GetNodeWithAddress', 'ns3::Ptr< ns3::Node >', [param('ns3::Ipv4Address', 'ipv4Address')]) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptions::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptions::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): bool ns3::dsr::DsrOptions::IfDuplicates(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec2) [member function] cls.add_method('IfDuplicates', 'bool', [param('std::vector< ns3::Ipv4Address > &', 'vec'), param('std::vector< ns3::Ipv4Address > &', 'vec2')]) ## dsr-options.h (module 'dsr'): void ns3::dsr::DsrOptions::PrintVector(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('PrintVector', 'void', [param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptions::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_pure_virtual=True, is_virtual=True) ## dsr-options.h (module 'dsr'): void ns3::dsr::DsrOptions::RemoveDuplicates(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('RemoveDuplicates', 'void', [param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-options.h (module 'dsr'): bool ns3::dsr::DsrOptions::ReverseRoutes(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('ReverseRoutes', 'bool', [param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-options.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptions::ReverseSearchNextHop(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('ReverseSearchNextHop', 'ns3::Ipv4Address', [param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-options.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptions::ReverseSearchNextTwoHop(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('ReverseSearchNextTwoHop', 'ns3::Ipv4Address', [param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-options.h (module 'dsr'): void ns3::dsr::DsrOptions::ScheduleReply(ns3::Ptr<ns3::Packet> & packet, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & nodeList, ns3::Ipv4Address & source, ns3::Ipv4Address & destination) [member function] cls.add_method('ScheduleReply', 'void', [param('ns3::Ptr< ns3::Packet > &', 'packet'), param('std::vector< ns3::Ipv4Address > &', 'nodeList'), param('ns3::Ipv4Address &', 'source'), param('ns3::Ipv4Address &', 'destination')]) ## dsr-options.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptions::SearchNextHop(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('SearchNextHop', 'ns3::Ipv4Address', [param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-options.h (module 'dsr'): void ns3::dsr::DsrOptions::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## dsr-options.h (module 'dsr'): ns3::Ptr<ns3::Ipv4Route> ns3::dsr::DsrOptions::SetRoute(ns3::Ipv4Address nextHop, ns3::Ipv4Address srcAddress) [member function] cls.add_method('SetRoute', 'ns3::Ptr< ns3::Ipv4Route >', [param('ns3::Ipv4Address', 'nextHop'), param('ns3::Ipv4Address', 'srcAddress')], is_virtual=True) return def register_Ns3DsrDsrRouting_methods(root_module, cls): ## dsr-routing.h (module 'dsr'): ns3::dsr::DsrRouting::DsrRouting(ns3::dsr::DsrRouting const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrRouting const &', 'arg0')]) ## dsr-routing.h (module 'dsr'): ns3::dsr::DsrRouting::DsrRouting() [constructor] cls.add_constructor([]) ## dsr-routing.h (module 'dsr'): uint16_t ns3::dsr::DsrRouting::AddAckReqHeader(ns3::Ptr<ns3::Packet> & packet, ns3::Ipv4Address nextHop) [member function] cls.add_method('AddAckReqHeader', 'uint16_t', [param('ns3::Ptr< ns3::Packet > &', 'packet'), param('ns3::Ipv4Address', 'nextHop')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::AddRoute(ns3::dsr::RouteCacheEntry & rt) [member function] cls.add_method('AddRoute', 'bool', [param('ns3::dsr::RouteCacheEntry &', 'rt')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::AddRoute_Link(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > nodelist, ns3::Ipv4Address source) [member function] cls.add_method('AddRoute_Link', 'bool', [param('std::vector< ns3::Ipv4Address >', 'nodelist'), param('ns3::Ipv4Address', 'source')]) ## dsr-routing.h (module 'dsr'): int64_t ns3::dsr::DsrRouting::AssignStreams(int64_t stream) [member function] cls.add_method('AssignStreams', 'int64_t', [param('int64_t', 'stream')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CallCancelPacketTimer(uint16_t ackId, ns3::Ipv4Header const & ipv4Header, ns3::Ipv4Address realSrc, ns3::Ipv4Address realDst) [member function] cls.add_method('CallCancelPacketTimer', 'void', [param('uint16_t', 'ackId'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('ns3::Ipv4Address', 'realSrc'), param('ns3::Ipv4Address', 'realDst')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelLinkPacketTimer(ns3::dsr::MaintainBuffEntry & mb) [member function] cls.add_method('CancelLinkPacketTimer', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelNetworkPacketTimer(ns3::dsr::MaintainBuffEntry & mb) [member function] cls.add_method('CancelNetworkPacketTimer', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelPacketTimerNextHop(ns3::Ipv4Address nextHop, uint8_t protocol) [member function] cls.add_method('CancelPacketTimerNextHop', 'void', [param('ns3::Ipv4Address', 'nextHop'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelPassivePacketTimer(ns3::dsr::MaintainBuffEntry & mb) [member function] cls.add_method('CancelPassivePacketTimer', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::CancelPassiveTimer(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t segsLeft) [member function] cls.add_method('CancelPassiveTimer', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'segsLeft')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelRreqTimer(ns3::Ipv4Address dst, bool isRemove) [member function] cls.add_method('CancelRreqTimer', 'void', [param('ns3::Ipv4Address', 'dst'), param('bool', 'isRemove')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CheckSendBuffer() [member function] cls.add_method('CheckSendBuffer', 'void', []) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ConnectCallbacks() [member function] cls.add_method('ConnectCallbacks', 'void', []) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::DeleteAllRoutesIncludeLink(ns3::Ipv4Address errorSrc, ns3::Ipv4Address unreachNode, ns3::Ipv4Address node) [member function] cls.add_method('DeleteAllRoutesIncludeLink', 'void', [param('ns3::Ipv4Address', 'errorSrc'), param('ns3::Ipv4Address', 'unreachNode'), param('ns3::Ipv4Address', 'node')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::FindSourceEntry(ns3::Ipv4Address src, ns3::Ipv4Address dst, uint16_t id) [member function] cls.add_method('FindSourceEntry', 'bool', [param('ns3::Ipv4Address', 'src'), param('ns3::Ipv4Address', 'dst'), param('uint16_t', 'id')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ForwardErrPacket(ns3::dsr::DsrOptionRerrUnreachHeader & rerr, ns3::dsr::DsrOptionSRHeader & sourceRoute, ns3::Ipv4Address nextHop, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('ForwardErrPacket', 'void', [param('ns3::dsr::DsrOptionRerrUnreachHeader &', 'rerr'), param('ns3::dsr::DsrOptionSRHeader &', 'sourceRoute'), param('ns3::Ipv4Address', 'nextHop'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ForwardPacket(ns3::Ptr<ns3::Packet const> packet, ns3::dsr::DsrOptionSRHeader & sourceRoute, ns3::Ipv4Header const & ipv4Header, ns3::Ipv4Address source, ns3::Ipv4Address destination, ns3::Ipv4Address targetAddress, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('ForwardPacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::dsr::DsrOptionSRHeader &', 'sourceRoute'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ipv4Address', 'targetAddress'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) ## dsr-routing.h (module 'dsr'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::dsr::DsrRouting::GetDownTarget() const [member function] cls.add_method('GetDownTarget', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True, is_virtual=True) ## dsr-routing.h (module 'dsr'): ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::dsr::DsrRouting::GetDownTarget6() const [member function] cls.add_method('GetDownTarget6', 'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True, is_virtual=True) ## dsr-routing.h (module 'dsr'): std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::dsr::DsrRouting::GetElementsFromContext(std::string context) [member function] cls.add_method('GetElementsFromContext', 'std::vector< std::string >', [param('std::string', 'context')]) ## dsr-routing.h (module 'dsr'): uint16_t ns3::dsr::DsrRouting::GetIDfromIP(ns3::Ipv4Address address) [member function] cls.add_method('GetIDfromIP', 'uint16_t', [param('ns3::Ipv4Address', 'address')]) ## dsr-routing.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrRouting::GetIPfromID(uint16_t id) [member function] cls.add_method('GetIPfromID', 'ns3::Ipv4Address', [param('uint16_t', 'id')]) ## dsr-routing.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrRouting::GetIPfromMAC(ns3::Mac48Address address) [member function] cls.add_method('GetIPfromMAC', 'ns3::Ipv4Address', [param('ns3::Mac48Address', 'address')]) ## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::NetDevice> ns3::dsr::DsrRouting::GetNetDeviceFromContext(std::string context) [member function] cls.add_method('GetNetDeviceFromContext', 'ns3::Ptr< ns3::NetDevice >', [param('std::string', 'context')]) ## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::Node> ns3::dsr::DsrRouting::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True) ## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::Node> ns3::dsr::DsrRouting::GetNodeWithAddress(ns3::Ipv4Address ipv4Address) [member function] cls.add_method('GetNodeWithAddress', 'ns3::Ptr< ns3::Node >', [param('ns3::Ipv4Address', 'ipv4Address')]) ## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::dsr::DsrOptions> ns3::dsr::DsrRouting::GetOption(int optionNumber) [member function] cls.add_method('GetOption', 'ns3::Ptr< ns3::dsr::DsrOptions >', [param('int', 'optionNumber')]) ## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::dsr::PassiveBuffer> ns3::dsr::DsrRouting::GetPassiveBuffer() const [member function] cls.add_method('GetPassiveBuffer', 'ns3::Ptr< ns3::dsr::PassiveBuffer >', [], is_const=True) ## dsr-routing.h (module 'dsr'): uint32_t ns3::dsr::DsrRouting::GetPriority(ns3::dsr::DsrMessageType messageType) [member function] cls.add_method('GetPriority', 'uint32_t', [param('ns3::dsr::DsrMessageType', 'messageType')]) ## dsr-routing.h (module 'dsr'): int ns3::dsr::DsrRouting::GetProtocolNumber() const [member function] cls.add_method('GetProtocolNumber', 'int', [], is_const=True, is_virtual=True) ## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::dsr::RreqTable> ns3::dsr::DsrRouting::GetRequestTable() const [member function] cls.add_method('GetRequestTable', 'ns3::Ptr< ns3::dsr::RreqTable >', [], is_const=True) ## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::dsr::RouteCache> ns3::dsr::DsrRouting::GetRouteCache() const [member function] cls.add_method('GetRouteCache', 'ns3::Ptr< ns3::dsr::RouteCache >', [], is_const=True) ## dsr-routing.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrRouting::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::IncreaseRetransTimer() [member function] cls.add_method('IncreaseRetransTimer', 'void', []) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::Insert(ns3::Ptr<ns3::dsr::DsrOptions> option) [member function] cls.add_method('Insert', 'void', [param('ns3::Ptr< ns3::dsr::DsrOptions >', 'option')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::IsLinkCache() [member function] cls.add_method('IsLinkCache', 'bool', []) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::LinkScheduleTimerExpire(ns3::dsr::MaintainBuffEntry & mb, uint8_t protocol) [member function] cls.add_method('LinkScheduleTimerExpire', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::LookupRoute(ns3::Ipv4Address id, ns3::dsr::RouteCacheEntry & rt) [member function] cls.add_method('LookupRoute', 'bool', [param('ns3::Ipv4Address', 'id'), param('ns3::dsr::RouteCacheEntry &', 'rt')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::NetworkScheduleTimerExpire(ns3::dsr::MaintainBuffEntry & mb, uint8_t protocol) [member function] cls.add_method('NetworkScheduleTimerExpire', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::PacketNewRoute(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function] cls.add_method('PacketNewRoute', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::PassiveEntryCheck(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t segsLeft, uint16_t fragmentOffset, uint16_t identification, bool saveEntry) [member function] cls.add_method('PassiveEntryCheck', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'segsLeft'), param('uint16_t', 'fragmentOffset'), param('uint16_t', 'identification'), param('bool', 'saveEntry')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::PassiveScheduleTimerExpire(ns3::dsr::MaintainBuffEntry & mb, uint8_t protocol) [member function] cls.add_method('PassiveScheduleTimerExpire', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::PrintVector(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('PrintVector', 'void', [param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::PriorityScheduler(uint32_t priority, bool continueWithFirst) [member function] cls.add_method('PriorityScheduler', 'void', [param('uint32_t', 'priority'), param('bool', 'continueWithFirst')]) ## dsr-routing.h (module 'dsr'): uint8_t ns3::dsr::DsrRouting::Process(ns3::Ptr<ns3::Packet> & packet, ns3::Ipv4Header const & ipv4Header, ns3::Ipv4Address dst, uint8_t * nextHeader, uint8_t protocol, bool & isDropped) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet > &', 'packet'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('ns3::Ipv4Address', 'dst'), param('uint8_t *', 'nextHeader'), param('uint8_t', 'protocol'), param('bool &', 'isDropped')]) ## dsr-routing.h (module 'dsr'): ns3::IpL4Protocol::RxStatus ns3::dsr::DsrRouting::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> incomingInterface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')], is_virtual=True) ## dsr-routing.h (module 'dsr'): ns3::IpL4Protocol::RxStatus ns3::dsr::DsrRouting::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> incomingInterface) [member function] cls.add_method('Receive', 'ns3::IpL4Protocol::RxStatus', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')], is_virtual=True) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::RouteRequestTimerExpire(ns3::Ptr<ns3::Packet> packet, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > address, uint32_t requestId, uint8_t protocol) [member function] cls.add_method('RouteRequestTimerExpire', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('std::vector< ns3::Ipv4Address >', 'address'), param('uint32_t', 'requestId'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SalvagePacket(ns3::Ptr<ns3::Packet const> packet, ns3::Ipv4Address source, ns3::Ipv4Address dst, uint8_t protocol) [member function] cls.add_method('SalvagePacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'dst'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleCachedReply(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, ns3::Ptr<ns3::Ipv4Route> route, double hops) [member function] cls.add_method('ScheduleCachedReply', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ptr< ns3::Ipv4Route >', 'route'), param('double', 'hops')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleInitialReply(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address nextHop, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('ScheduleInitialReply', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'nextHop'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleInterRequest(ns3::Ptr<ns3::Packet> packet) [member function] cls.add_method('ScheduleInterRequest', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleLinkPacketRetry(ns3::dsr::MaintainBuffEntry & mb, uint8_t protocol) [member function] cls.add_method('ScheduleLinkPacketRetry', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleNetworkPacketRetry(ns3::dsr::MaintainBuffEntry & mb, bool isFirst, uint8_t protocol) [member function] cls.add_method('ScheduleNetworkPacketRetry', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb'), param('bool', 'isFirst'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SchedulePassivePacketRetry(ns3::dsr::MaintainBuffEntry & mb, uint8_t protocol) [member function] cls.add_method('SchedulePassivePacketRetry', 'void', [param('ns3::dsr::MaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleRreqRetry(ns3::Ptr<ns3::Packet> packet, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > address, bool nonProp, uint32_t requestId, uint8_t protocol) [member function] cls.add_method('ScheduleRreqRetry', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('std::vector< ns3::Ipv4Address >', 'address'), param('bool', 'nonProp'), param('uint32_t', 'requestId'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::Scheduler(uint32_t priority) [member function] cls.add_method('Scheduler', 'void', [param('uint32_t', 'priority')]) ## dsr-routing.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrRouting::SearchNextHop(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('SearchNextHop', 'ns3::Ipv4Address', [param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendAck(uint16_t ackId, ns3::Ipv4Address destination, ns3::Ipv4Address realSrc, ns3::Ipv4Address realDst, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('SendAck', 'void', [param('uint16_t', 'ackId'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ipv4Address', 'realSrc'), param('ns3::Ipv4Address', 'realDst'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendBuffTimerExpire() [member function] cls.add_method('SendBuffTimerExpire', 'void', []) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendErrorRequest(ns3::dsr::DsrOptionRerrUnreachHeader & rerr, uint8_t protocol) [member function] cls.add_method('SendErrorRequest', 'void', [param('ns3::dsr::DsrOptionRerrUnreachHeader &', 'rerr'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendGratuitousReply(ns3::Ipv4Address replyTo, ns3::Ipv4Address replyFrom, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & nodeList, uint8_t protocol) [member function] cls.add_method('SendGratuitousReply', 'void', [param('ns3::Ipv4Address', 'replyTo'), param('ns3::Ipv4Address', 'replyFrom'), param('std::vector< ns3::Ipv4Address > &', 'nodeList'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendInitialRequest(ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function] cls.add_method('SendInitialRequest', 'void', [param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendPacket(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address nextHop, uint8_t protocol) [member function] cls.add_method('SendPacket', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'nextHop'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendPacketFromBuffer(ns3::dsr::DsrOptionSRHeader const & sourceRoute, ns3::Ipv4Address nextHop, uint8_t protocol) [member function] cls.add_method('SendPacketFromBuffer', 'void', [param('ns3::dsr::DsrOptionSRHeader const &', 'sourceRoute'), param('ns3::Ipv4Address', 'nextHop'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::SendRealDown(ns3::dsr::DsrNetworkQueueEntry & newEntry) [member function] cls.add_method('SendRealDown', 'bool', [param('ns3::dsr::DsrNetworkQueueEntry &', 'newEntry')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendReply(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address nextHop, ns3::Ptr<ns3::Ipv4Route> route) [member function] cls.add_method('SendReply', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'nextHop'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendRequest(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source) [member function] cls.add_method('SendRequest', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendUnreachError(ns3::Ipv4Address errorHop, ns3::Ipv4Address destination, ns3::Ipv4Address originalDst, uint8_t salvage, uint8_t protocol) [member function] cls.add_method('SendUnreachError', 'void', [param('ns3::Ipv4Address', 'errorHop'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ipv4Address', 'originalDst'), param('uint8_t', 'salvage'), param('uint8_t', 'protocol')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetDownTarget(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function] cls.add_method('SetDownTarget', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_virtual=True) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetDownTarget6(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr<ns3::Ipv6Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function] cls.add_method('SetDownTarget6', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_virtual=True) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetPassiveBuffer(ns3::Ptr<ns3::dsr::PassiveBuffer> r) [member function] cls.add_method('SetPassiveBuffer', 'void', [param('ns3::Ptr< ns3::dsr::PassiveBuffer >', 'r')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetRequestTable(ns3::Ptr<ns3::dsr::RreqTable> r) [member function] cls.add_method('SetRequestTable', 'void', [param('ns3::Ptr< ns3::dsr::RreqTable >', 'r')]) ## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::Ipv4Route> ns3::dsr::DsrRouting::SetRoute(ns3::Ipv4Address nextHop, ns3::Ipv4Address srcAddress) [member function] cls.add_method('SetRoute', 'ns3::Ptr< ns3::Ipv4Route >', [param('ns3::Ipv4Address', 'nextHop'), param('ns3::Ipv4Address', 'srcAddress')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetRouteCache(ns3::Ptr<ns3::dsr::RouteCache> r) [member function] cls.add_method('SetRouteCache', 'void', [param('ns3::Ptr< ns3::dsr::RouteCache >', 'r')]) ## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::UpdateRouteEntry(ns3::Ipv4Address dst) [member function] cls.add_method('UpdateRouteEntry', 'bool', [param('ns3::Ipv4Address', 'dst')]) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::UseExtends(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > rt) [member function] cls.add_method('UseExtends', 'void', [param('std::vector< ns3::Ipv4Address >', 'rt')]) ## dsr-routing.h (module 'dsr'): ns3::dsr::DsrRouting::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::NotifyNewAggregate() [member function] cls.add_method('NotifyNewAggregate', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3DsrDsrRoutingHeader_methods(root_module, cls): cls.add_output_stream_operator() ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrRoutingHeader::DsrRoutingHeader(ns3::dsr::DsrRoutingHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrRoutingHeader const &', 'arg0')]) ## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrRoutingHeader::DsrRoutingHeader() [constructor] cls.add_constructor([]) ## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrRoutingHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-fs-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrRoutingHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrRoutingHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-fs-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrRoutingHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrRoutingHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrRoutingHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) return def register_Ns3DsrErrorBuffEntry_methods(root_module, cls): cls.add_binary_comparison_operator('==') ## dsr-errorbuff.h (module 'dsr'): ns3::dsr::ErrorBuffEntry::ErrorBuffEntry(ns3::dsr::ErrorBuffEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::ErrorBuffEntry const &', 'arg0')]) ## dsr-errorbuff.h (module 'dsr'): ns3::dsr::ErrorBuffEntry::ErrorBuffEntry(ns3::Ptr<ns3::Packet const> pa=0, ns3::Ipv4Address d=ns3::Ipv4Address(), ns3::Ipv4Address s=ns3::Ipv4Address(), ns3::Ipv4Address n=ns3::Ipv4Address(), ns3::Time exp=ns3::Simulator::Now( ), uint8_t p=0) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 'd', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 's', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'n', default_value='ns3::Ipv4Address()'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now( )'), param('uint8_t', 'p', default_value='0')]) ## dsr-errorbuff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::ErrorBuffEntry::GetDestination() const [member function] cls.add_method('GetDestination', 'ns3::Ipv4Address', [], is_const=True) ## dsr-errorbuff.h (module 'dsr'): ns3::Time ns3::dsr::ErrorBuffEntry::GetExpireTime() const [member function] cls.add_method('GetExpireTime', 'ns3::Time', [], is_const=True) ## dsr-errorbuff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::ErrorBuffEntry::GetNextHop() const [member function] cls.add_method('GetNextHop', 'ns3::Ipv4Address', [], is_const=True) ## dsr-errorbuff.h (module 'dsr'): ns3::Ptr<ns3::Packet const> ns3::dsr::ErrorBuffEntry::GetPacket() const [member function] cls.add_method('GetPacket', 'ns3::Ptr< ns3::Packet const >', [], is_const=True) ## dsr-errorbuff.h (module 'dsr'): uint8_t ns3::dsr::ErrorBuffEntry::GetProtocol() const [member function] cls.add_method('GetProtocol', 'uint8_t', [], is_const=True) ## dsr-errorbuff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::ErrorBuffEntry::GetSource() const [member function] cls.add_method('GetSource', 'ns3::Ipv4Address', [], is_const=True) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffEntry::SetDestination(ns3::Ipv4Address d) [member function] cls.add_method('SetDestination', 'void', [param('ns3::Ipv4Address', 'd')]) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffEntry::SetExpireTime(ns3::Time exp) [member function] cls.add_method('SetExpireTime', 'void', [param('ns3::Time', 'exp')]) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffEntry::SetNextHop(ns3::Ipv4Address n) [member function] cls.add_method('SetNextHop', 'void', [param('ns3::Ipv4Address', 'n')]) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffEntry::SetPacket(ns3::Ptr<ns3::Packet const> p) [member function] cls.add_method('SetPacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'p')]) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffEntry::SetProtocol(uint8_t p) [member function] cls.add_method('SetProtocol', 'void', [param('uint8_t', 'p')]) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffEntry::SetSource(ns3::Ipv4Address s) [member function] cls.add_method('SetSource', 'void', [param('ns3::Ipv4Address', 's')]) return def register_Ns3DsrErrorBuffer_methods(root_module, cls): ## dsr-errorbuff.h (module 'dsr'): ns3::dsr::ErrorBuffer::ErrorBuffer(ns3::dsr::ErrorBuffer const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::ErrorBuffer const &', 'arg0')]) ## dsr-errorbuff.h (module 'dsr'): ns3::dsr::ErrorBuffer::ErrorBuffer() [constructor] cls.add_constructor([]) ## dsr-errorbuff.h (module 'dsr'): bool ns3::dsr::ErrorBuffer::Dequeue(ns3::Ipv4Address dst, ns3::dsr::ErrorBuffEntry & entry) [member function] cls.add_method('Dequeue', 'bool', [param('ns3::Ipv4Address', 'dst'), param('ns3::dsr::ErrorBuffEntry &', 'entry')]) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffer::DropPacketForErrLink(ns3::Ipv4Address source, ns3::Ipv4Address nextHop) [member function] cls.add_method('DropPacketForErrLink', 'void', [param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'nextHop')]) ## dsr-errorbuff.h (module 'dsr'): bool ns3::dsr::ErrorBuffer::Enqueue(ns3::dsr::ErrorBuffEntry & entry) [member function] cls.add_method('Enqueue', 'bool', [param('ns3::dsr::ErrorBuffEntry &', 'entry')]) ## dsr-errorbuff.h (module 'dsr'): bool ns3::dsr::ErrorBuffer::Find(ns3::Ipv4Address dst) [member function] cls.add_method('Find', 'bool', [param('ns3::Ipv4Address', 'dst')]) ## dsr-errorbuff.h (module 'dsr'): std::vector<ns3::dsr::ErrorBuffEntry, std::allocator<ns3::dsr::ErrorBuffEntry> > & ns3::dsr::ErrorBuffer::GetBuffer() [member function] cls.add_method('GetBuffer', 'std::vector< ns3::dsr::ErrorBuffEntry > &', []) ## dsr-errorbuff.h (module 'dsr'): ns3::Time ns3::dsr::ErrorBuffer::GetErrorBufferTimeout() const [member function] cls.add_method('GetErrorBufferTimeout', 'ns3::Time', [], is_const=True) ## dsr-errorbuff.h (module 'dsr'): uint32_t ns3::dsr::ErrorBuffer::GetMaxQueueLen() const [member function] cls.add_method('GetMaxQueueLen', 'uint32_t', [], is_const=True) ## dsr-errorbuff.h (module 'dsr'): uint32_t ns3::dsr::ErrorBuffer::GetSize() [member function] cls.add_method('GetSize', 'uint32_t', []) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffer::SetErrorBufferTimeout(ns3::Time t) [member function] cls.add_method('SetErrorBufferTimeout', 'void', [param('ns3::Time', 't')]) ## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::ErrorBuffer::SetMaxQueueLen(uint32_t len) [member function] cls.add_method('SetMaxQueueLen', 'void', [param('uint32_t', 'len')]) return def register_Ns3DsrGraReply_methods(root_module, cls): ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReply::GraReply(ns3::dsr::GraReply const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::GraReply const &', 'arg0')]) ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReply::GraReply() [constructor] cls.add_constructor([]) ## dsr-gratuitous-reply-table.h (module 'dsr'): bool ns3::dsr::GraReply::AddEntry(ns3::dsr::GraReplyEntry & graTableEntry) [member function] cls.add_method('AddEntry', 'bool', [param('ns3::dsr::GraReplyEntry &', 'graTableEntry')]) ## dsr-gratuitous-reply-table.h (module 'dsr'): void ns3::dsr::GraReply::Clear() [member function] cls.add_method('Clear', 'void', []) ## dsr-gratuitous-reply-table.h (module 'dsr'): bool ns3::dsr::GraReply::FindAndUpdate(ns3::Ipv4Address replyTo, ns3::Ipv4Address replyFrom, ns3::Time gratReplyHoldoff) [member function] cls.add_method('FindAndUpdate', 'bool', [param('ns3::Ipv4Address', 'replyTo'), param('ns3::Ipv4Address', 'replyFrom'), param('ns3::Time', 'gratReplyHoldoff')]) ## dsr-gratuitous-reply-table.h (module 'dsr'): uint32_t ns3::dsr::GraReply::GetGraTableSize() const [member function] cls.add_method('GetGraTableSize', 'uint32_t', [], is_const=True) ## dsr-gratuitous-reply-table.h (module 'dsr'): static ns3::TypeId ns3::dsr::GraReply::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-gratuitous-reply-table.h (module 'dsr'): void ns3::dsr::GraReply::Purge() [member function] cls.add_method('Purge', 'void', []) ## dsr-gratuitous-reply-table.h (module 'dsr'): void ns3::dsr::GraReply::SetGraTableSize(uint32_t g) [member function] cls.add_method('SetGraTableSize', 'void', [param('uint32_t', 'g')]) return def register_Ns3DsrGraReplyEntry_methods(root_module, cls): ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::GraReplyEntry(ns3::dsr::GraReplyEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::GraReplyEntry const &', 'arg0')]) ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::GraReplyEntry(ns3::Ipv4Address t, ns3::Ipv4Address f, ns3::Time h) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 't'), param('ns3::Ipv4Address', 'f'), param('ns3::Time', 'h')]) ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::m_gratReplyHoldoff [variable] cls.add_instance_attribute('m_gratReplyHoldoff', 'ns3::Time', is_const=False) ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::m_hearFrom [variable] cls.add_instance_attribute('m_hearFrom', 'ns3::Ipv4Address', is_const=False) ## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::m_replyTo [variable] cls.add_instance_attribute('m_replyTo', 'ns3::Ipv4Address', is_const=False) return def register_Ns3DsrLink_methods(root_module, cls): cls.add_binary_comparison_operator('<') ## dsr-rcache.h (module 'dsr'): ns3::dsr::Link::Link(ns3::dsr::Link const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::Link const &', 'arg0')]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::Link::Link(ns3::Ipv4Address ip1, ns3::Ipv4Address ip2) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ip1'), param('ns3::Ipv4Address', 'ip2')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::Link::Print() const [member function] cls.add_method('Print', 'void', [], is_const=True) ## dsr-rcache.h (module 'dsr'): ns3::dsr::Link::m_high [variable] cls.add_instance_attribute('m_high', 'ns3::Ipv4Address', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::Link::m_low [variable] cls.add_instance_attribute('m_low', 'ns3::Ipv4Address', is_const=False) return def register_Ns3DsrLinkKey_methods(root_module, cls): cls.add_binary_comparison_operator('<') ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::LinkKey() [constructor] cls.add_constructor([]) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::LinkKey(ns3::dsr::LinkKey const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::LinkKey const &', 'arg0')]) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::m_destination [variable] cls.add_instance_attribute('m_destination', 'ns3::Ipv4Address', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::m_nextHop [variable] cls.add_instance_attribute('m_nextHop', 'ns3::Ipv4Address', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::m_ourAdd [variable] cls.add_instance_attribute('m_ourAdd', 'ns3::Ipv4Address', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::m_source [variable] cls.add_instance_attribute('m_source', 'ns3::Ipv4Address', is_const=False) return def register_Ns3DsrLinkStab_methods(root_module, cls): ## dsr-rcache.h (module 'dsr'): ns3::dsr::LinkStab::LinkStab(ns3::dsr::LinkStab const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::LinkStab const &', 'arg0')]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::LinkStab::LinkStab(ns3::Time linkStab=ns3::Simulator::Now( )) [constructor] cls.add_constructor([param('ns3::Time', 'linkStab', default_value='ns3::Simulator::Now( )')]) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::LinkStab::GetLinkStability() const [member function] cls.add_method('GetLinkStability', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::LinkStab::Print() const [member function] cls.add_method('Print', 'void', [], is_const=True) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::LinkStab::SetLinkStability(ns3::Time linkStab) [member function] cls.add_method('SetLinkStability', 'void', [param('ns3::Time', 'linkStab')]) return def register_Ns3DsrMaintainBuffEntry_methods(root_module, cls): ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::MaintainBuffEntry::MaintainBuffEntry(ns3::dsr::MaintainBuffEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::MaintainBuffEntry const &', 'arg0')]) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::MaintainBuffEntry::MaintainBuffEntry(ns3::Ptr<ns3::Packet const> pa=0, ns3::Ipv4Address us=ns3::Ipv4Address(), ns3::Ipv4Address n=ns3::Ipv4Address(), ns3::Ipv4Address s=ns3::Ipv4Address(), ns3::Ipv4Address dst=ns3::Ipv4Address(), uint16_t ackId=0, uint8_t segs=0, ns3::Time exp=ns3::Simulator::Now( )) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 'us', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'n', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 's', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'dst', default_value='ns3::Ipv4Address()'), param('uint16_t', 'ackId', default_value='0'), param('uint8_t', 'segs', default_value='0'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now( )')]) ## dsr-maintain-buff.h (module 'dsr'): uint16_t ns3::dsr::MaintainBuffEntry::GetAckId() const [member function] cls.add_method('GetAckId', 'uint16_t', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::MaintainBuffEntry::GetDst() const [member function] cls.add_method('GetDst', 'ns3::Ipv4Address', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): ns3::Time ns3::dsr::MaintainBuffEntry::GetExpireTime() const [member function] cls.add_method('GetExpireTime', 'ns3::Time', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::MaintainBuffEntry::GetNextHop() const [member function] cls.add_method('GetNextHop', 'ns3::Ipv4Address', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::MaintainBuffEntry::GetOurAdd() const [member function] cls.add_method('GetOurAdd', 'ns3::Ipv4Address', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): ns3::Ptr<ns3::Packet const> ns3::dsr::MaintainBuffEntry::GetPacket() const [member function] cls.add_method('GetPacket', 'ns3::Ptr< ns3::Packet const >', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): uint8_t ns3::dsr::MaintainBuffEntry::GetSegsLeft() const [member function] cls.add_method('GetSegsLeft', 'uint8_t', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::MaintainBuffEntry::GetSrc() const [member function] cls.add_method('GetSrc', 'ns3::Ipv4Address', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffEntry::SetAckId(uint16_t ackId) [member function] cls.add_method('SetAckId', 'void', [param('uint16_t', 'ackId')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffEntry::SetDst(ns3::Ipv4Address n) [member function] cls.add_method('SetDst', 'void', [param('ns3::Ipv4Address', 'n')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffEntry::SetExpireTime(ns3::Time exp) [member function] cls.add_method('SetExpireTime', 'void', [param('ns3::Time', 'exp')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffEntry::SetNextHop(ns3::Ipv4Address n) [member function] cls.add_method('SetNextHop', 'void', [param('ns3::Ipv4Address', 'n')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffEntry::SetOurAdd(ns3::Ipv4Address us) [member function] cls.add_method('SetOurAdd', 'void', [param('ns3::Ipv4Address', 'us')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffEntry::SetPacket(ns3::Ptr<ns3::Packet const> p) [member function] cls.add_method('SetPacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'p')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffEntry::SetSegsLeft(uint8_t segs) [member function] cls.add_method('SetSegsLeft', 'void', [param('uint8_t', 'segs')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffEntry::SetSrc(ns3::Ipv4Address s) [member function] cls.add_method('SetSrc', 'void', [param('ns3::Ipv4Address', 's')]) return def register_Ns3DsrMaintainBuffer_methods(root_module, cls): ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::MaintainBuffer::MaintainBuffer(ns3::dsr::MaintainBuffer const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::MaintainBuffer const &', 'arg0')]) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::MaintainBuffer::MaintainBuffer() [constructor] cls.add_constructor([]) ## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::MaintainBuffer::AllEqual(ns3::dsr::MaintainBuffEntry & entry) [member function] cls.add_method('AllEqual', 'bool', [param('ns3::dsr::MaintainBuffEntry &', 'entry')]) ## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::MaintainBuffer::Dequeue(ns3::Ipv4Address dst, ns3::dsr::MaintainBuffEntry & entry) [member function] cls.add_method('Dequeue', 'bool', [param('ns3::Ipv4Address', 'dst'), param('ns3::dsr::MaintainBuffEntry &', 'entry')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffer::DropPacketWithNextHop(ns3::Ipv4Address nextHop) [member function] cls.add_method('DropPacketWithNextHop', 'void', [param('ns3::Ipv4Address', 'nextHop')]) ## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::MaintainBuffer::Enqueue(ns3::dsr::MaintainBuffEntry & entry) [member function] cls.add_method('Enqueue', 'bool', [param('ns3::dsr::MaintainBuffEntry &', 'entry')]) ## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::MaintainBuffer::Find(ns3::Ipv4Address nextHop) [member function] cls.add_method('Find', 'bool', [param('ns3::Ipv4Address', 'nextHop')]) ## dsr-maintain-buff.h (module 'dsr'): ns3::Time ns3::dsr::MaintainBuffer::GetMaintainBufferTimeout() const [member function] cls.add_method('GetMaintainBufferTimeout', 'ns3::Time', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): uint32_t ns3::dsr::MaintainBuffer::GetMaxQueueLen() const [member function] cls.add_method('GetMaxQueueLen', 'uint32_t', [], is_const=True) ## dsr-maintain-buff.h (module 'dsr'): uint32_t ns3::dsr::MaintainBuffer::GetSize() [member function] cls.add_method('GetSize', 'uint32_t', []) ## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::MaintainBuffer::LinkEqual(ns3::dsr::MaintainBuffEntry & entry) [member function] cls.add_method('LinkEqual', 'bool', [param('ns3::dsr::MaintainBuffEntry &', 'entry')]) ## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::MaintainBuffer::NetworkEqual(ns3::dsr::MaintainBuffEntry & entry) [member function] cls.add_method('NetworkEqual', 'bool', [param('ns3::dsr::MaintainBuffEntry &', 'entry')]) ## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::MaintainBuffer::PromiscEqual(ns3::dsr::MaintainBuffEntry & entry) [member function] cls.add_method('PromiscEqual', 'bool', [param('ns3::dsr::MaintainBuffEntry &', 'entry')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffer::SetMaintainBufferTimeout(ns3::Time t) [member function] cls.add_method('SetMaintainBufferTimeout', 'void', [param('ns3::Time', 't')]) ## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::MaintainBuffer::SetMaxQueueLen(uint32_t len) [member function] cls.add_method('SetMaxQueueLen', 'void', [param('uint32_t', 'len')]) return def register_Ns3DsrNetworkKey_methods(root_module, cls): cls.add_binary_comparison_operator('<') ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::NetworkKey() [constructor] cls.add_constructor([]) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::NetworkKey(ns3::dsr::NetworkKey const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::NetworkKey const &', 'arg0')]) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_ackId [variable] cls.add_instance_attribute('m_ackId', 'uint16_t', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_destination [variable] cls.add_instance_attribute('m_destination', 'ns3::Ipv4Address', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_nextHop [variable] cls.add_instance_attribute('m_nextHop', 'ns3::Ipv4Address', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_ourAdd [variable] cls.add_instance_attribute('m_ourAdd', 'ns3::Ipv4Address', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_source [variable] cls.add_instance_attribute('m_source', 'ns3::Ipv4Address', is_const=False) return def register_Ns3DsrNodeStab_methods(root_module, cls): ## dsr-rcache.h (module 'dsr'): ns3::dsr::NodeStab::NodeStab(ns3::dsr::NodeStab const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::NodeStab const &', 'arg0')]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::NodeStab::NodeStab(ns3::Time nodeStab=ns3::Simulator::Now( )) [constructor] cls.add_constructor([param('ns3::Time', 'nodeStab', default_value='ns3::Simulator::Now( )')]) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::NodeStab::GetNodeStability() const [member function] cls.add_method('GetNodeStability', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::NodeStab::SetNodeStability(ns3::Time nodeStab) [member function] cls.add_method('SetNodeStability', 'void', [param('ns3::Time', 'nodeStab')]) return def register_Ns3DsrPassiveBuffEntry_methods(root_module, cls): cls.add_binary_comparison_operator('==') ## dsr-passive-buff.h (module 'dsr'): ns3::dsr::PassiveBuffEntry::PassiveBuffEntry(ns3::dsr::PassiveBuffEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::PassiveBuffEntry const &', 'arg0')]) ## dsr-passive-buff.h (module 'dsr'): ns3::dsr::PassiveBuffEntry::PassiveBuffEntry(ns3::Ptr<ns3::Packet const> pa=0, ns3::Ipv4Address d=ns3::Ipv4Address(), ns3::Ipv4Address s=ns3::Ipv4Address(), ns3::Ipv4Address n=ns3::Ipv4Address(), uint16_t i=0, uint16_t f=0, uint8_t seg=0, ns3::Time exp=ns3::Simulator::Now( ), uint8_t p=0) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 'd', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 's', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'n', default_value='ns3::Ipv4Address()'), param('uint16_t', 'i', default_value='0'), param('uint16_t', 'f', default_value='0'), param('uint8_t', 'seg', default_value='0'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now( )'), param('uint8_t', 'p', default_value='0')]) ## dsr-passive-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::PassiveBuffEntry::GetDestination() const [member function] cls.add_method('GetDestination', 'ns3::Ipv4Address', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): ns3::Time ns3::dsr::PassiveBuffEntry::GetExpireTime() const [member function] cls.add_method('GetExpireTime', 'ns3::Time', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): uint16_t ns3::dsr::PassiveBuffEntry::GetFragmentOffset() const [member function] cls.add_method('GetFragmentOffset', 'uint16_t', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): uint16_t ns3::dsr::PassiveBuffEntry::GetIdentification() const [member function] cls.add_method('GetIdentification', 'uint16_t', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::PassiveBuffEntry::GetNextHop() const [member function] cls.add_method('GetNextHop', 'ns3::Ipv4Address', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): ns3::Ptr<ns3::Packet const> ns3::dsr::PassiveBuffEntry::GetPacket() const [member function] cls.add_method('GetPacket', 'ns3::Ptr< ns3::Packet const >', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): uint8_t ns3::dsr::PassiveBuffEntry::GetProtocol() const [member function] cls.add_method('GetProtocol', 'uint8_t', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): uint8_t ns3::dsr::PassiveBuffEntry::GetSegsLeft() const [member function] cls.add_method('GetSegsLeft', 'uint8_t', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::PassiveBuffEntry::GetSource() const [member function] cls.add_method('GetSource', 'ns3::Ipv4Address', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetDestination(ns3::Ipv4Address d) [member function] cls.add_method('SetDestination', 'void', [param('ns3::Ipv4Address', 'd')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetExpireTime(ns3::Time exp) [member function] cls.add_method('SetExpireTime', 'void', [param('ns3::Time', 'exp')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetFragmentOffset(uint16_t f) [member function] cls.add_method('SetFragmentOffset', 'void', [param('uint16_t', 'f')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetIdentification(uint16_t i) [member function] cls.add_method('SetIdentification', 'void', [param('uint16_t', 'i')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetNextHop(ns3::Ipv4Address n) [member function] cls.add_method('SetNextHop', 'void', [param('ns3::Ipv4Address', 'n')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetPacket(ns3::Ptr<ns3::Packet const> p) [member function] cls.add_method('SetPacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'p')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetProtocol(uint8_t p) [member function] cls.add_method('SetProtocol', 'void', [param('uint8_t', 'p')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetSegsLeft(uint8_t seg) [member function] cls.add_method('SetSegsLeft', 'void', [param('uint8_t', 'seg')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffEntry::SetSource(ns3::Ipv4Address s) [member function] cls.add_method('SetSource', 'void', [param('ns3::Ipv4Address', 's')]) return def register_Ns3DsrPassiveBuffer_methods(root_module, cls): ## dsr-passive-buff.h (module 'dsr'): ns3::dsr::PassiveBuffer::PassiveBuffer(ns3::dsr::PassiveBuffer const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::PassiveBuffer const &', 'arg0')]) ## dsr-passive-buff.h (module 'dsr'): ns3::dsr::PassiveBuffer::PassiveBuffer() [constructor] cls.add_constructor([]) ## dsr-passive-buff.h (module 'dsr'): bool ns3::dsr::PassiveBuffer::AllEqual(ns3::dsr::PassiveBuffEntry & entry) [member function] cls.add_method('AllEqual', 'bool', [param('ns3::dsr::PassiveBuffEntry &', 'entry')]) ## dsr-passive-buff.h (module 'dsr'): bool ns3::dsr::PassiveBuffer::Dequeue(ns3::Ipv4Address dst, ns3::dsr::PassiveBuffEntry & entry) [member function] cls.add_method('Dequeue', 'bool', [param('ns3::Ipv4Address', 'dst'), param('ns3::dsr::PassiveBuffEntry &', 'entry')]) ## dsr-passive-buff.h (module 'dsr'): bool ns3::dsr::PassiveBuffer::Enqueue(ns3::dsr::PassiveBuffEntry & entry) [member function] cls.add_method('Enqueue', 'bool', [param('ns3::dsr::PassiveBuffEntry &', 'entry')]) ## dsr-passive-buff.h (module 'dsr'): bool ns3::dsr::PassiveBuffer::Find(ns3::Ipv4Address dst) [member function] cls.add_method('Find', 'bool', [param('ns3::Ipv4Address', 'dst')]) ## dsr-passive-buff.h (module 'dsr'): uint32_t ns3::dsr::PassiveBuffer::GetMaxQueueLen() const [member function] cls.add_method('GetMaxQueueLen', 'uint32_t', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): ns3::Time ns3::dsr::PassiveBuffer::GetPassiveBufferTimeout() const [member function] cls.add_method('GetPassiveBufferTimeout', 'ns3::Time', [], is_const=True) ## dsr-passive-buff.h (module 'dsr'): uint32_t ns3::dsr::PassiveBuffer::GetSize() [member function] cls.add_method('GetSize', 'uint32_t', []) ## dsr-passive-buff.h (module 'dsr'): static ns3::TypeId ns3::dsr::PassiveBuffer::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffer::SetMaxQueueLen(uint32_t len) [member function] cls.add_method('SetMaxQueueLen', 'void', [param('uint32_t', 'len')]) ## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::PassiveBuffer::SetPassiveBufferTimeout(ns3::Time t) [member function] cls.add_method('SetPassiveBufferTimeout', 'void', [param('ns3::Time', 't')]) return def register_Ns3DsrPassiveKey_methods(root_module, cls): cls.add_binary_comparison_operator('<') ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::PassiveKey() [constructor] cls.add_constructor([]) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::PassiveKey(ns3::dsr::PassiveKey const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::PassiveKey const &', 'arg0')]) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::m_ackId [variable] cls.add_instance_attribute('m_ackId', 'uint16_t', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::m_destination [variable] cls.add_instance_attribute('m_destination', 'ns3::Ipv4Address', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::m_segsLeft [variable] cls.add_instance_attribute('m_segsLeft', 'uint8_t', is_const=False) ## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::m_source [variable] cls.add_instance_attribute('m_source', 'ns3::Ipv4Address', is_const=False) return def register_Ns3DsrReceivedRreqEntry_methods(root_module, cls): cls.add_binary_comparison_operator('==') ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::ReceivedRreqEntry::ReceivedRreqEntry(ns3::dsr::ReceivedRreqEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::ReceivedRreqEntry const &', 'arg0')]) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::ReceivedRreqEntry::ReceivedRreqEntry(ns3::Ipv4Address d=ns3::Ipv4Address(), uint16_t i=0) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'd', default_value='ns3::Ipv4Address()'), param('uint16_t', 'i', default_value='0')]) ## dsr-rreq-table.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::ReceivedRreqEntry::GetDestination() const [member function] cls.add_method('GetDestination', 'ns3::Ipv4Address', [], is_const=True) ## dsr-rreq-table.h (module 'dsr'): ns3::Time ns3::dsr::ReceivedRreqEntry::GetExpireTime() const [member function] cls.add_method('GetExpireTime', 'ns3::Time', [], is_const=True) ## dsr-rreq-table.h (module 'dsr'): uint16_t ns3::dsr::ReceivedRreqEntry::GetIdentification() const [member function] cls.add_method('GetIdentification', 'uint16_t', [], is_const=True) ## dsr-rreq-table.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::ReceivedRreqEntry::GetSource() const [member function] cls.add_method('GetSource', 'ns3::Ipv4Address', [], is_const=True) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::ReceivedRreqEntry::SetDestination(ns3::Ipv4Address d) [member function] cls.add_method('SetDestination', 'void', [param('ns3::Ipv4Address', 'd')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::ReceivedRreqEntry::SetExpireTime(ns3::Time exp) [member function] cls.add_method('SetExpireTime', 'void', [param('ns3::Time', 'exp')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::ReceivedRreqEntry::SetIdentification(uint16_t i) [member function] cls.add_method('SetIdentification', 'void', [param('uint16_t', 'i')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::ReceivedRreqEntry::SetSource(ns3::Ipv4Address s) [member function] cls.add_method('SetSource', 'void', [param('ns3::Ipv4Address', 's')]) return def register_Ns3DsrRouteCache_methods(root_module, cls): ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::RouteCache(ns3::dsr::RouteCache const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::RouteCache const &', 'arg0')]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::RouteCache() [constructor] cls.add_constructor([]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::AddArpCache(ns3::Ptr<ns3::ArpCache> arg0) [member function] cls.add_method('AddArpCache', 'void', [param('ns3::Ptr< ns3::ArpCache >', 'arg0')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::AddNeighbor(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > nodeList, ns3::Ipv4Address ownAddress, ns3::Time expire) [member function] cls.add_method('AddNeighbor', 'void', [param('std::vector< ns3::Ipv4Address >', 'nodeList'), param('ns3::Ipv4Address', 'ownAddress'), param('ns3::Time', 'expire')]) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::AddRoute(ns3::dsr::RouteCacheEntry & rt) [member function] cls.add_method('AddRoute', 'bool', [param('ns3::dsr::RouteCacheEntry &', 'rt')]) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::AddRoute_Link(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > nodelist, ns3::Ipv4Address node) [member function] cls.add_method('AddRoute_Link', 'bool', [param('std::vector< ns3::Ipv4Address >', 'nodelist'), param('ns3::Ipv4Address', 'node')]) ## dsr-rcache.h (module 'dsr'): uint16_t ns3::dsr::RouteCache::CheckUniqueAckId(ns3::Ipv4Address nextHop) [member function] cls.add_method('CheckUniqueAckId', 'uint16_t', [param('ns3::Ipv4Address', 'nextHop')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::Clear() [member function] cls.add_method('Clear', 'void', []) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::ClearMac() [member function] cls.add_method('ClearMac', 'void', []) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::DelArpCache(ns3::Ptr<ns3::ArpCache> arg0) [member function] cls.add_method('DelArpCache', 'void', [param('ns3::Ptr< ns3::ArpCache >', 'arg0')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::DeleteAllRoutesIncludeLink(ns3::Ipv4Address errorSrc, ns3::Ipv4Address unreachNode, ns3::Ipv4Address node) [member function] cls.add_method('DeleteAllRoutesIncludeLink', 'void', [param('ns3::Ipv4Address', 'errorSrc'), param('ns3::Ipv4Address', 'unreachNode'), param('ns3::Ipv4Address', 'node')]) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::DeleteRoute(ns3::Ipv4Address dst) [member function] cls.add_method('DeleteRoute', 'bool', [param('ns3::Ipv4Address', 'dst')]) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::FindSameRoute(ns3::dsr::RouteCacheEntry & rt, std::list<ns3::dsr::RouteCacheEntry, std::allocator<ns3::dsr::RouteCacheEntry> > & rtVector) [member function] cls.add_method('FindSameRoute', 'bool', [param('ns3::dsr::RouteCacheEntry &', 'rt'), param('std::list< ns3::dsr::RouteCacheEntry > &', 'rtVector')]) ## dsr-rcache.h (module 'dsr'): uint16_t ns3::dsr::RouteCache::GetAckSize() [member function] cls.add_method('GetAckSize', 'uint16_t', []) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::RouteCache::GetBadLinkLifetime() const [member function] cls.add_method('GetBadLinkLifetime', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::RouteCache::GetCacheTimeout() const [member function] cls.add_method('GetCacheTimeout', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): ns3::Callback<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::dsr::RouteCache::GetCallback() const [member function] cls.add_method('GetCallback', 'ns3::Callback< void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::RouteCache::GetExpireTime(ns3::Ipv4Address addr) [member function] cls.add_method('GetExpireTime', 'ns3::Time', [param('ns3::Ipv4Address', 'addr')]) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::RouteCache::GetInitStability() const [member function] cls.add_method('GetInitStability', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): uint32_t ns3::dsr::RouteCache::GetMaxCacheLen() const [member function] cls.add_method('GetMaxCacheLen', 'uint32_t', [], is_const=True) ## dsr-rcache.h (module 'dsr'): uint32_t ns3::dsr::RouteCache::GetMaxEntriesEachDst() const [member function] cls.add_method('GetMaxEntriesEachDst', 'uint32_t', [], is_const=True) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::RouteCache::GetMinLifeTime() const [member function] cls.add_method('GetMinLifeTime', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): uint64_t ns3::dsr::RouteCache::GetStabilityDecrFactor() const [member function] cls.add_method('GetStabilityDecrFactor', 'uint64_t', [], is_const=True) ## dsr-rcache.h (module 'dsr'): uint64_t ns3::dsr::RouteCache::GetStabilityIncrFactor() const [member function] cls.add_method('GetStabilityIncrFactor', 'uint64_t', [], is_const=True) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::GetSubRoute() const [member function] cls.add_method('GetSubRoute', 'bool', [], is_const=True) ## dsr-rcache.h (module 'dsr'): ns3::Callback<void, ns3::WifiMacHeader const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::dsr::RouteCache::GetTxErrorCallback() const [member function] cls.add_method('GetTxErrorCallback', 'ns3::Callback< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True) ## dsr-rcache.h (module 'dsr'): static ns3::TypeId ns3::dsr::RouteCache::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::RouteCache::GetUseExtends() const [member function] cls.add_method('GetUseExtends', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::IsLinkCache() [member function] cls.add_method('IsLinkCache', 'bool', []) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::IsNeighbor(ns3::Ipv4Address addr) [member function] cls.add_method('IsNeighbor', 'bool', [param('ns3::Ipv4Address', 'addr')]) ## dsr-rcache.h (module 'dsr'): ns3::Mac48Address ns3::dsr::RouteCache::LookupMacAddress(ns3::Ipv4Address arg0) [member function] cls.add_method('LookupMacAddress', 'ns3::Mac48Address', [param('ns3::Ipv4Address', 'arg0')]) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::LookupRoute(ns3::Ipv4Address id, ns3::dsr::RouteCacheEntry & rt) [member function] cls.add_method('LookupRoute', 'bool', [param('ns3::Ipv4Address', 'id'), param('ns3::dsr::RouteCacheEntry &', 'rt')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::Print(std::ostream & os) [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::PrintRouteVector(std::list<ns3::dsr::RouteCacheEntry, std::allocator<ns3::dsr::RouteCacheEntry> > route) [member function] cls.add_method('PrintRouteVector', 'void', [param('std::list< ns3::dsr::RouteCacheEntry >', 'route')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::PrintVector(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function] cls.add_method('PrintVector', 'void', [param('std::vector< ns3::Ipv4Address > &', 'vec')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::ProcessTxError(ns3::WifiMacHeader const & arg0) [member function] cls.add_method('ProcessTxError', 'void', [param('ns3::WifiMacHeader const &', 'arg0')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::Purge() [member function] cls.add_method('Purge', 'void', []) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::PurgeLinkNode() [member function] cls.add_method('PurgeLinkNode', 'void', []) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::PurgeMac() [member function] cls.add_method('PurgeMac', 'void', []) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::RebuildBestRouteTable(ns3::Ipv4Address source) [member function] cls.add_method('RebuildBestRouteTable', 'void', [param('ns3::Ipv4Address', 'source')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::RemoveLastEntry(std::list<ns3::dsr::RouteCacheEntry, std::allocator<ns3::dsr::RouteCacheEntry> > & rtVector) [member function] cls.add_method('RemoveLastEntry', 'void', [param('std::list< ns3::dsr::RouteCacheEntry > &', 'rtVector')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::ScheduleTimer() [member function] cls.add_method('ScheduleTimer', 'void', []) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetBadLinkLifetime(ns3::Time t) [member function] cls.add_method('SetBadLinkLifetime', 'void', [param('ns3::Time', 't')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetCacheTimeout(ns3::Time t) [member function] cls.add_method('SetCacheTimeout', 'void', [param('ns3::Time', 't')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetCacheType(std::string type) [member function] cls.add_method('SetCacheType', 'void', [param('std::string', 'type')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetCallback(ns3::Callback<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetCallback', 'void', [param('ns3::Callback< void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetInitStability(ns3::Time initStability) [member function] cls.add_method('SetInitStability', 'void', [param('ns3::Time', 'initStability')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetMaxCacheLen(uint32_t len) [member function] cls.add_method('SetMaxCacheLen', 'void', [param('uint32_t', 'len')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetMaxEntriesEachDst(uint32_t entries) [member function] cls.add_method('SetMaxEntriesEachDst', 'void', [param('uint32_t', 'entries')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetMinLifeTime(ns3::Time minLifeTime) [member function] cls.add_method('SetMinLifeTime', 'void', [param('ns3::Time', 'minLifeTime')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetStabilityDecrFactor(uint64_t decrFactor) [member function] cls.add_method('SetStabilityDecrFactor', 'void', [param('uint64_t', 'decrFactor')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetStabilityIncrFactor(uint64_t incrFactor) [member function] cls.add_method('SetStabilityIncrFactor', 'void', [param('uint64_t', 'incrFactor')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetSubRoute(bool subRoute) [member function] cls.add_method('SetSubRoute', 'void', [param('bool', 'subRoute')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::SetUseExtends(ns3::Time useExtends) [member function] cls.add_method('SetUseExtends', 'void', [param('ns3::Time', 'useExtends')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::UpdateNeighbor(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > nodeList, ns3::Time expire) [member function] cls.add_method('UpdateNeighbor', 'void', [param('std::vector< ns3::Ipv4Address >', 'nodeList'), param('ns3::Time', 'expire')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::UpdateNetGraph() [member function] cls.add_method('UpdateNetGraph', 'void', []) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCache::UpdateRouteEntry(ns3::Ipv4Address dst) [member function] cls.add_method('UpdateRouteEntry', 'bool', [param('ns3::Ipv4Address', 'dst')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCache::UseExtends(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > rt) [member function] cls.add_method('UseExtends', 'void', [param('std::vector< ns3::Ipv4Address >', 'rt')]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::m_arp [variable] cls.add_instance_attribute('m_arp', 'std::vector< ns3::Ptr< ns3::ArpCache > >', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::m_delay [variable] cls.add_instance_attribute('m_delay', 'ns3::Time', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::m_handleLinkFailure [variable] cls.add_instance_attribute('m_handleLinkFailure', 'ns3::Callback< void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::m_nb [variable] cls.add_instance_attribute('m_nb', 'std::vector< ns3::dsr::RouteCache::Neighbor >', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::m_ntimer [variable] cls.add_instance_attribute('m_ntimer', 'ns3::Timer', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::m_txErrorCallback [variable] cls.add_instance_attribute('m_txErrorCallback', 'ns3::Callback< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', is_const=False) return def register_Ns3DsrRouteCacheNeighbor_methods(root_module, cls): ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::Neighbor::Neighbor(ns3::dsr::RouteCache::Neighbor const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::RouteCache::Neighbor const &', 'arg0')]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::Neighbor::Neighbor(ns3::Ipv4Address ip, ns3::Mac48Address mac, ns3::Time t) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ip'), param('ns3::Mac48Address', 'mac'), param('ns3::Time', 't')]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::Neighbor::Neighbor() [constructor] cls.add_constructor([]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::Neighbor::close [variable] cls.add_instance_attribute('close', 'bool', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::Neighbor::m_expireTime [variable] cls.add_instance_attribute('m_expireTime', 'ns3::Time', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::Neighbor::m_hardwareAddress [variable] cls.add_instance_attribute('m_hardwareAddress', 'ns3::Mac48Address', is_const=False) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCache::Neighbor::m_neighborAddress [variable] cls.add_instance_attribute('m_neighborAddress', 'ns3::Ipv4Address', is_const=False) return def register_Ns3DsrRouteCacheEntry_methods(root_module, cls): cls.add_binary_comparison_operator('==') ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCacheEntry::RouteCacheEntry(ns3::dsr::RouteCacheEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::RouteCacheEntry const &', 'arg0')]) ## dsr-rcache.h (module 'dsr'): ns3::dsr::RouteCacheEntry::RouteCacheEntry(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > const & ip=std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> >(), ns3::Ipv4Address dst=ns3::Ipv4Address(), ns3::Time exp=ns3::Simulator::Now( )) [constructor] cls.add_constructor([param('std::vector< ns3::Ipv4Address > const &', 'ip', default_value='std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> >()'), param('ns3::Ipv4Address', 'dst', default_value='ns3::Ipv4Address()'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now( )')]) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::RouteCacheEntry::GetBlacklistTimeout() const [member function] cls.add_method('GetBlacklistTimeout', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::RouteCacheEntry::GetDestination() const [member function] cls.add_method('GetDestination', 'ns3::Ipv4Address', [], is_const=True) ## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::RouteCacheEntry::GetExpireTime() const [member function] cls.add_method('GetExpireTime', 'ns3::Time', [], is_const=True) ## dsr-rcache.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::RouteCacheEntry::GetVector() const [member function] cls.add_method('GetVector', 'std::vector< ns3::Ipv4Address >', [], is_const=True) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCacheEntry::Invalidate(ns3::Time badLinkLifetime) [member function] cls.add_method('Invalidate', 'void', [param('ns3::Time', 'badLinkLifetime')]) ## dsr-rcache.h (module 'dsr'): bool ns3::dsr::RouteCacheEntry::IsUnidirectional() const [member function] cls.add_method('IsUnidirectional', 'bool', [], is_const=True) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCacheEntry::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCacheEntry::SetBlacklistTimeout(ns3::Time t) [member function] cls.add_method('SetBlacklistTimeout', 'void', [param('ns3::Time', 't')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCacheEntry::SetDestination(ns3::Ipv4Address d) [member function] cls.add_method('SetDestination', 'void', [param('ns3::Ipv4Address', 'd')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCacheEntry::SetExpireTime(ns3::Time exp) [member function] cls.add_method('SetExpireTime', 'void', [param('ns3::Time', 'exp')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCacheEntry::SetUnidirectional(bool u) [member function] cls.add_method('SetUnidirectional', 'void', [param('bool', 'u')]) ## dsr-rcache.h (module 'dsr'): void ns3::dsr::RouteCacheEntry::SetVector(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > v) [member function] cls.add_method('SetVector', 'void', [param('std::vector< ns3::Ipv4Address >', 'v')]) return def register_Ns3DsrRreqTable_methods(root_module, cls): ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTable::RreqTable(ns3::dsr::RreqTable const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::RreqTable const &', 'arg0')]) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTable::RreqTable() [constructor] cls.add_constructor([]) ## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::RreqTable::CheckUniqueRreqId(ns3::Ipv4Address dst) [member function] cls.add_method('CheckUniqueRreqId', 'uint32_t', [param('ns3::Ipv4Address', 'dst')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::FindAndUpdate(ns3::Ipv4Address dst) [member function] cls.add_method('FindAndUpdate', 'void', [param('ns3::Ipv4Address', 'dst')]) ## dsr-rreq-table.h (module 'dsr'): bool ns3::dsr::RreqTable::FindSourceEntry(ns3::Ipv4Address src, ns3::Ipv4Address dst, uint16_t id) [member function] cls.add_method('FindSourceEntry', 'bool', [param('ns3::Ipv4Address', 'src'), param('ns3::Ipv4Address', 'dst'), param('uint16_t', 'id')]) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList * ns3::dsr::RreqTable::FindUnidirectional(ns3::Ipv4Address neighbor) [member function] cls.add_method('FindUnidirectional', 'ns3::dsr::BlackList *', [param('ns3::Ipv4Address', 'neighbor')]) ## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::RreqTable::GetInitHopLimit() const [member function] cls.add_method('GetInitHopLimit', 'uint32_t', [], is_const=True) ## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::RreqTable::GetRreqCnt(ns3::Ipv4Address dst) [member function] cls.add_method('GetRreqCnt', 'uint32_t', [param('ns3::Ipv4Address', 'dst')]) ## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::RreqTable::GetRreqIdSize() const [member function] cls.add_method('GetRreqIdSize', 'uint32_t', [], is_const=True) ## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::RreqTable::GetRreqSize() [member function] cls.add_method('GetRreqSize', 'uint32_t', []) ## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::RreqTable::GetRreqTableSize() const [member function] cls.add_method('GetRreqTableSize', 'uint32_t', [], is_const=True) ## dsr-rreq-table.h (module 'dsr'): static ns3::TypeId ns3::dsr::RreqTable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::RreqTable::GetUniqueRreqIdSize() const [member function] cls.add_method('GetUniqueRreqIdSize', 'uint32_t', [], is_const=True) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::Invalidate() [member function] cls.add_method('Invalidate', 'void', []) ## dsr-rreq-table.h (module 'dsr'): bool ns3::dsr::RreqTable::MarkLinkAsUnidirectional(ns3::Ipv4Address neighbor, ns3::Time blacklistTimeout) [member function] cls.add_method('MarkLinkAsUnidirectional', 'bool', [param('ns3::Ipv4Address', 'neighbor'), param('ns3::Time', 'blacklistTimeout')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::PurgeNeighbor() [member function] cls.add_method('PurgeNeighbor', 'void', []) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::RemoveLeastExpire(std::map<ns3::Ipv4Address, ns3::dsr::RreqTableEntry, std::less<ns3::Ipv4Address>, std::allocator<std::pair<ns3::Ipv4Address const, ns3::dsr::RreqTableEntry> > > & rreqDstMap) [member function] cls.add_method('RemoveLeastExpire', 'void', [param('std::map< ns3::Ipv4Address, ns3::dsr::RreqTableEntry > &', 'rreqDstMap')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::RemoveRreqEntry(ns3::Ipv4Address dst) [member function] cls.add_method('RemoveRreqEntry', 'void', [param('ns3::Ipv4Address', 'dst')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::SetInitHopLimit(uint32_t hl) [member function] cls.add_method('SetInitHopLimit', 'void', [param('uint32_t', 'hl')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::SetRreqIdSize(uint32_t id) [member function] cls.add_method('SetRreqIdSize', 'void', [param('uint32_t', 'id')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::SetRreqTableSize(uint32_t rt) [member function] cls.add_method('SetRreqTableSize', 'void', [param('uint32_t', 'rt')]) ## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::RreqTable::SetUniqueRreqIdSize(uint32_t uid) [member function] cls.add_method('SetUniqueRreqIdSize', 'void', [param('uint32_t', 'uid')]) return def register_Ns3DsrRreqTableEntry_methods(root_module, cls): ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry::RreqTableEntry() [constructor] cls.add_constructor([]) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry::RreqTableEntry(ns3::dsr::RreqTableEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::RreqTableEntry const &', 'arg0')]) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry::m_expire [variable] cls.add_instance_attribute('m_expire', 'ns3::Time', is_const=False) ## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry::m_reqNo [variable] cls.add_instance_attribute('m_reqNo', 'uint32_t', is_const=False) return def register_Ns3DsrSendBuffEntry_methods(root_module, cls): cls.add_binary_comparison_operator('==') ## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::SendBuffEntry::SendBuffEntry(ns3::dsr::SendBuffEntry const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::SendBuffEntry const &', 'arg0')]) ## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::SendBuffEntry::SendBuffEntry(ns3::Ptr<ns3::Packet const> pa=0, ns3::Ipv4Address d=ns3::Ipv4Address(), ns3::Time exp=ns3::Simulator::Now( ), uint8_t p=0) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 'd', default_value='ns3::Ipv4Address()'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now( )'), param('uint8_t', 'p', default_value='0')]) ## dsr-rsendbuff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::SendBuffEntry::GetDestination() const [member function] cls.add_method('GetDestination', 'ns3::Ipv4Address', [], is_const=True) ## dsr-rsendbuff.h (module 'dsr'): ns3::Time ns3::dsr::SendBuffEntry::GetExpireTime() const [member function] cls.add_method('GetExpireTime', 'ns3::Time', [], is_const=True) ## dsr-rsendbuff.h (module 'dsr'): ns3::Ptr<ns3::Packet const> ns3::dsr::SendBuffEntry::GetPacket() const [member function] cls.add_method('GetPacket', 'ns3::Ptr< ns3::Packet const >', [], is_const=True) ## dsr-rsendbuff.h (module 'dsr'): uint8_t ns3::dsr::SendBuffEntry::GetProtocol() const [member function] cls.add_method('GetProtocol', 'uint8_t', [], is_const=True) ## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::SendBuffEntry::SetDestination(ns3::Ipv4Address d) [member function] cls.add_method('SetDestination', 'void', [param('ns3::Ipv4Address', 'd')]) ## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::SendBuffEntry::SetExpireTime(ns3::Time exp) [member function] cls.add_method('SetExpireTime', 'void', [param('ns3::Time', 'exp')]) ## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::SendBuffEntry::SetPacket(ns3::Ptr<ns3::Packet const> p) [member function] cls.add_method('SetPacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'p')]) ## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::SendBuffEntry::SetProtocol(uint8_t p) [member function] cls.add_method('SetProtocol', 'void', [param('uint8_t', 'p')]) return def register_Ns3DsrSendBuffer_methods(root_module, cls): ## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::SendBuffer::SendBuffer(ns3::dsr::SendBuffer const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::SendBuffer const &', 'arg0')]) ## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::SendBuffer::SendBuffer() [constructor] cls.add_constructor([]) ## dsr-rsendbuff.h (module 'dsr'): bool ns3::dsr::SendBuffer::Dequeue(ns3::Ipv4Address dst, ns3::dsr::SendBuffEntry & entry) [member function] cls.add_method('Dequeue', 'bool', [param('ns3::Ipv4Address', 'dst'), param('ns3::dsr::SendBuffEntry &', 'entry')]) ## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::SendBuffer::DropPacketWithDst(ns3::Ipv4Address dst) [member function] cls.add_method('DropPacketWithDst', 'void', [param('ns3::Ipv4Address', 'dst')]) ## dsr-rsendbuff.h (module 'dsr'): bool ns3::dsr::SendBuffer::Enqueue(ns3::dsr::SendBuffEntry & entry) [member function] cls.add_method('Enqueue', 'bool', [param('ns3::dsr::SendBuffEntry &', 'entry')]) ## dsr-rsendbuff.h (module 'dsr'): bool ns3::dsr::SendBuffer::Find(ns3::Ipv4Address dst) [member function] cls.add_method('Find', 'bool', [param('ns3::Ipv4Address', 'dst')]) ## dsr-rsendbuff.h (module 'dsr'): std::vector<ns3::dsr::SendBuffEntry, std::allocator<ns3::dsr::SendBuffEntry> > & ns3::dsr::SendBuffer::GetBuffer() [member function] cls.add_method('GetBuffer', 'std::vector< ns3::dsr::SendBuffEntry > &', []) ## dsr-rsendbuff.h (module 'dsr'): uint32_t ns3::dsr::SendBuffer::GetMaxQueueLen() const [member function] cls.add_method('GetMaxQueueLen', 'uint32_t', [], is_const=True) ## dsr-rsendbuff.h (module 'dsr'): ns3::Time ns3::dsr::SendBuffer::GetSendBufferTimeout() const [member function] cls.add_method('GetSendBufferTimeout', 'ns3::Time', [], is_const=True) ## dsr-rsendbuff.h (module 'dsr'): uint32_t ns3::dsr::SendBuffer::GetSize() [member function] cls.add_method('GetSize', 'uint32_t', []) ## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::SendBuffer::SetMaxQueueLen(uint32_t len) [member function] cls.add_method('SetMaxQueueLen', 'void', [param('uint32_t', 'len')]) ## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::SendBuffer::SetSendBufferTimeout(ns3::Time t) [member function] cls.add_method('SetSendBufferTimeout', 'void', [param('ns3::Time', 't')]) return def register_Ns3DsrDsrOptionAck_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAck::DsrOptionAck(ns3::dsr::DsrOptionAck const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionAck const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAck::DsrOptionAck() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionAck::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionAck::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionAck::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionAck::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_virtual=True) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAck::OPT_NUMBER [variable] cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True) return def register_Ns3DsrDsrOptionAckHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckHeader::DsrOptionAckHeader(ns3::dsr::DsrOptionAckHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionAckHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckHeader::DsrOptionAckHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionAckHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint16_t ns3::dsr::DsrOptionAckHeader::GetAckId() const [member function] cls.add_method('GetAckId', 'uint16_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionAckHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionAckHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionAckHeader::GetRealDst() const [member function] cls.add_method('GetRealDst', 'ns3::Ipv4Address', [], is_const=True) ## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionAckHeader::GetRealSrc() const [member function] cls.add_method('GetRealSrc', 'ns3::Ipv4Address', [], is_const=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionAckHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionAckHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::SetAckId(uint16_t identification) [member function] cls.add_method('SetAckId', 'void', [param('uint16_t', 'identification')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::SetRealDst(ns3::Ipv4Address realDstAddress) [member function] cls.add_method('SetRealDst', 'void', [param('ns3::Ipv4Address', 'realDstAddress')]) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::SetRealSrc(ns3::Ipv4Address realSrcAddress) [member function] cls.add_method('SetRealSrc', 'void', [param('ns3::Ipv4Address', 'realSrcAddress')]) return def register_Ns3DsrDsrOptionAckReq_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAckReq::DsrOptionAckReq(ns3::dsr::DsrOptionAckReq const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionAckReq const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAckReq::DsrOptionAckReq() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionAckReq::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionAckReq::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionAckReq::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionAckReq::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_virtual=True) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAckReq::OPT_NUMBER [variable] cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True) return def register_Ns3DsrDsrOptionAckReqHeader_methods(root_module, cls): ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckReqHeader::DsrOptionAckReqHeader(ns3::dsr::DsrOptionAckReqHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionAckReqHeader const &', 'arg0')]) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckReqHeader::DsrOptionAckReqHeader() [constructor] cls.add_constructor([]) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionAckReqHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint16_t ns3::dsr::DsrOptionAckReqHeader::GetAckId() const [member function] cls.add_method('GetAckId', 'uint16_t', [], is_const=True) ## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionAckReqHeader::GetAlignment() const [member function] cls.add_method('GetAlignment', 'ns3::dsr::DsrOptionHeader::Alignment', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionAckReqHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionAckReqHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionAckReqHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckReqHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckReqHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckReqHeader::SetAckId(uint16_t identification) [member function] cls.add_method('SetAckId', 'void', [param('uint16_t', 'identification')]) return def register_Ns3DsrDsrOptionPad1_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPad1::DsrOptionPad1(ns3::dsr::DsrOptionPad1 const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionPad1 const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPad1::DsrOptionPad1() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionPad1::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionPad1::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionPad1::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_virtual=True) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPad1::OPT_NUMBER [variable] cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True) return def register_Ns3DsrDsrOptionPadn_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPadn::DsrOptionPadn(ns3::dsr::DsrOptionPadn const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionPadn const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPadn::DsrOptionPadn() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionPadn::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionPadn::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionPadn::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_virtual=True) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPadn::OPT_NUMBER [variable] cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True) return def register_Ns3DsrDsrOptionRerr_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRerr::DsrOptionRerr(ns3::dsr::DsrOptionRerr const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionRerr const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRerr::DsrOptionRerr() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerr::DoSendError(ns3::Ptr<ns3::Packet> p, ns3::dsr::DsrOptionRerrUnreachHeader & rerr, uint32_t rerrSize, ns3::Ipv4Address ipv4Address, uint8_t protocol) [member function] cls.add_method('DoSendError', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::dsr::DsrOptionRerrUnreachHeader &', 'rerr'), param('uint32_t', 'rerrSize'), param('ns3::Ipv4Address', 'ipv4Address'), param('uint8_t', 'protocol')]) ## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRerr::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerr::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRerr::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerr::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_virtual=True) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRerr::OPT_NUMBER [variable] cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True) return def register_Ns3DsrDsrOptionRrep_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRrep::DsrOptionRrep(ns3::dsr::DsrOptionRrep const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionRrep const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRrep::DsrOptionRrep() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRrep::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRrep::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRrep::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRrep::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_virtual=True) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRrep::OPT_NUMBER [variable] cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True) return def register_Ns3DsrDsrOptionRreq_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRreq::DsrOptionRreq(ns3::dsr::DsrOptionRreq const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionRreq const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRreq::DsrOptionRreq() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRreq::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRreq::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRreq::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRreq::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_virtual=True) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRreq::OPT_NUMBER [variable] cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True) return def register_Ns3DsrDsrOptionSR_methods(root_module, cls): ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionSR::DsrOptionSR(ns3::dsr::DsrOptionSR const & arg0) [copy constructor] cls.add_constructor([param('ns3::dsr::DsrOptionSR const &', 'arg0')]) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionSR::DsrOptionSR() [constructor] cls.add_constructor([]) ## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionSR::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSR::GetOptionNumber() const [member function] cls.add_method('GetOptionNumber', 'uint8_t', [], is_const=True, is_virtual=True) ## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionSR::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSR::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function] cls.add_method('Process', 'uint8_t', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')], is_virtual=True) ## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionSR::OPT_NUMBER [variable] cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True) return def register_functions(root_module): module = root_module register_functions_ns3_FatalImpl(module.get_submodule('FatalImpl'), root_module) register_functions_ns3_Hash(module.get_submodule('Hash'), root_module) register_functions_ns3_dsr(module.get_submodule('dsr'), root_module) register_functions_ns3_internal(module.get_submodule('internal'), root_module) return def register_functions_ns3_FatalImpl(module, root_module): return def register_functions_ns3_Hash(module, root_module): register_functions_ns3_Hash_Function(module.get_submodule('Function'), root_module) return def register_functions_ns3_Hash_Function(module, root_module): return def register_functions_ns3_dsr(module, root_module): return def register_functions_ns3_internal(module, root_module): return def main(): out = FileCodeSink(sys.stdout) root_module = module_init() register_types(root_module) register_methods(root_module) register_functions(root_module) root_module.generate(out) if __name__ == '__main__': main()
gpl-2.0
Pardus-Linux/buildfarm
buildfarm/cli.py
2
7177
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2011 TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # Please read the COPYING file. # import os import re import sys import shutil import pisi import pisi.context as ctx import pisi.ui import pisi.util class CLI(pisi.ui.UI): "Command Line Interface special to buildfarm" def __init__(self, output, show_debug=False, show_verbose=False): super(CLI, self).__init__(show_debug, show_verbose) self.warnings = 0 self.errors = 0 self.output_file = output self.outtypes = {'Warning' : ('brightyellow', '\033[01;33m', '#FFFF00'), 'Error' : ('red', '\033[31m', '#CC0000'), 'Action' : ('green', '\033[32m', '#00CC00'), 'Notify' : ('cyan', '\033[36m', '#99CCFF'), 'Status' : ('brightgreen', '\033[01;32m', '#00FF00'), 'Display' : ('gray', '\033[0m', '#CCCCCC'), 'Default' : ('default', '\033[0m', '#CCCCCC')} self.color_map = dict([(v, m) for k, v, m in self.outtypes.values()]) def flush_logs(self): text_file = self.output_file.name html_file = text_file.replace(".txt", ".html") package = os.path.basename(text_file.split(".txt")[0]) self.output_file.flush() shutil.copy(text_file, html_file) log_file = text_file.replace(".txt", ".log") _file = open(log_file, "w") for line in open(html_file, "r").readlines(): line = line.rstrip('\033[0m\n') + '\n' match = re.match("(\033.*?m)(.*)", line) if match: _file.write("%s\n" % match.groups()[1]) else: _file.write(line) _file.close() # We now have an HTML file which is an ANSI colored text file _file = open("%s.swp" % html_file, "w") _file.write("<html><head><title>Build log for %s</title></head>\n" % package) _file.write("<body style=\"background-color: #000000; color: #CCCCCC; font-family: Monospace\">\n") for line in open(html_file, "r").readlines(): line = line.rstrip('\033[0m\n') + '\n' match = re.match("(\033.*?m)(.*)", line) if match: match = match.groups() _file.write("<span style=\"color: %s\">%s</span><br />\n" % (self.color_map.get(match[0], '\033[0m'), match[1])) else: _file.write("<span>%s</span><br />\n" % line) _file.write("\n</body></html>") _file.close() shutil.move("%s.swp" % html_file, html_file) try: os.unlink(text_file) except IOError: pass def close(self): pisi.util.xterm_title_reset() def format(self, msg, msgtype, colored=True, html=False, noln=False): result = "" # Do not use newline is noln is True newline = "" if noln else "\n" if html: # HTML Output result = "<span style=\"color: %s\">%s</span><br />\n" % (self.outtypes.get(msgtype, ['', '', '#000000'])[2], msg) else: if not ctx.get_option('no_color'): if msgtype == 'Display': result = msg elif colored and self.outtypes.has_key(msgtype): result = pisi.util.colorize(msg, self.outtypes[msgtype][0]) + newline else: result = msg + newline else: result = msgtype + ': ' + msg + newline return result def output(self, msg, msgtype=None, err=False, verbose=False, only_on_screen=False, noln=False): if (verbose and self.show_verbose) or (not verbose): if type(msg)==type(unicode()): msg = msg.encode('utf-8') if err: out = sys.stderr else: out = sys.stdout # Output to screen out.write(self.format(msg, msgtype, noln=noln)) out.flush() if not only_on_screen: # Output the same stuff to the log file self.output_file.write(self.format(msg, msgtype, colored=True)) self.output_file.flush() def info(self, msg, verbose=False, noln=False): self.output(unicode(msg), 'Info', verbose=verbose, noln=noln) def warning(self, msg): msg = unicode(msg) self.warnings += 1 if ctx.log: ctx.log.warning(msg) self.output(msg, 'Warning', err=True, verbose=False) def error(self, msg): msg = unicode(msg) self.errors += 1 if ctx.log: ctx.log.error(msg) self.output(msg, 'Error', err=True) def action(self, msg): msg = unicode(msg) if ctx.log: ctx.log.info(msg) self.output(msg, 'Action') def choose(self, msg, opts): msg = unicode(msg) prompt = msg + pisi.util.colorize(' (%s)' % "/".join(opts), 'red') while True: selection = raw_input(prompt.encode('utf-8')) for opt in opts: if opt.startswith(selection): return opt def confirm(self, msg): # Modify so that it always returns True in buildfarm return True def display_progress(self, **ka): """ display progress of any operation """ if ka['operation'] in ["removing", "rebuilding-db"]: return elif ka['operation'] == "fetching": totalsize = '%.1f %s' % pisi.util.human_readable_size(ka['total_size']) out = '\r%-30.50s (%s)%3d%% %9.2f %s [%s]' % \ (ka['filename'], totalsize, ka['percent'], ka['rate'], ka['symbol'], ka['eta']) self.output(out, 'Display', only_on_screen=True) else: self.output("\r%s (%d%%)" % (ka['info'], ka['percent']), 'Display', only_on_screen=True) if ka['percent'] == 100: self.output(' [complete]\n', 'Display') def status(self, msg = None): if msg: msg = unicode(msg) self.output(msg, 'Status') pisi.util.xterm_title(msg) def notify(self, event, **keywords): if event == pisi.ui.installed: msg = 'Installed %s' % keywords['package'].name elif event == pisi.ui.removed: msg = 'Removed %s' % keywords['package'].name elif event == pisi.ui.upgraded: msg = 'Upgraded %s' % keywords['package'].name elif event == pisi.ui.configured: msg = 'Configured %s' % keywords['package'].name elif event == pisi.ui.extracting: msg = 'Extracting the files of %s' % keywords['package'].name else: msg = None if msg: self.output(msg, 'Notify') if ctx.log: ctx.log.info(msg)
gpl-2.0
netzimme/mbed-os
tools/test/examples/examples_lib.py
15
15213
""" Import and bulid a bunch of example programs This library includes functions that are shared between the examples.py and the update.py modules. """ import os from os.path import dirname, abspath, basename import os.path import sys import subprocess from shutil import rmtree from sets import Set ROOT = abspath(dirname(dirname(dirname(dirname(__file__))))) sys.path.insert(0, ROOT) from tools.build_api import get_mbed_official_release from tools.targets import TARGET_MAP from tools.export import EXPORTERS SUPPORTED_TOOLCHAINS = ["ARM", "IAR", "GCC_ARM"] SUPPORTED_IDES = [exp for exp in EXPORTERS.keys() if exp != "cmsis" and exp != "zip"] def print_list(lst): """Prints to screen the contents of a list Args: lst - a list of any type, to be displayed """ if lst: for thing in lst: print("# %s" % thing) def print_category(results, index, message): summary = [example for key, summ in results.iteritems() for example in summ[index]] if all(len(s) == 0 for s in summary): return print("#") print("#" * 80) print("# %s" % message) print("#" * 80) split_summ = [s.rsplit(" ", 1) for s in summary] print_list(summary) def print_summary(results, export=False): """Prints to screen the results of compiling/exporting combinations of example programs, targets and compile toolchains/IDEs. Args: results - results of the compilation stage. See compile_repos() and export_repos() for details of the format. """ print("#"*80) print("# Examples compilation summary") print("#"*80) print_category(results, 2, "Passed example combinations") second_result = "Failed example combinations" if not export else \ "Failed export example combinations" print_category(results, 3, second_result) if export: print_category(results, 4, "Failed build combinations") print_category(results, 5, "Skipped build combinations") print("#") print("#"*80) def valid_choices(allowed_choices, all_choices): if len(allowed_choices) > 0: return [t for t in all_choices if t in allowed_choices] else: return all_choices def target_cross_toolchain(allowed_targets, allowed_toolchains, features=[]): """Generate pairs of target and toolchains Args: allowed_targets - a list of all possible targets allowed_toolchains - a list of all possible toolchains Kwargs: features - the features that must be in the features array of a target """ for target in allowed_targets: for toolchain in allowed_toolchains: if all(feature in TARGET_MAP[target].features for feature in features): yield target, toolchain def target_cross_ide(allowed_targets, allowed_ides, features=[], toolchains=[]): """Generate pairs of target and ides Args: allowed_targets - a list of all possible targets allowed_ides - a list of all possible IDEs Kwargs: features - the features that must be in the features array of a target """ for target in allowed_targets: for ide in allowed_ides: if (target in EXPORTERS[ide].TARGETS and (not toolchains or EXPORTERS[ide].TOOLCHAIN in toolchains) and all(feature in TARGET_MAP[target].features for feature in features)): yield target, ide def get_repo_list(example): """ Returns a list of all the repos associated with the specific example in the json config file. If there are repos listed under the mbed section then these will be returned as a list. If not then the github single repo with be returned. NOTE: This does not currently deal with multiple examples underneath a github sourced exampe repo. Args: example - Example for which the repo list is requested repos - The list of repos and types contained within that example in the json file """ repos = [] if len(example['mbed']) > 0: for repo in example['mbed']: repos.append({ 'repo': repo, 'type': 'hg' }) else: repos.append({ 'repo': example['github'], 'type': 'git' }) return repos def source_repos(config, examples): """ Imports each of the repos and its dependencies (.lib files) associated with the specific examples name from the json config file. Note if there is already a clone of the repo then it will first be removed to ensure a clean, up to date cloning. Args: config - the json object imported from the file. """ print("\nImporting example repos....\n") for example in config['examples']: for repo_info in get_repo_list(example): name = basename(repo_info['repo']) if name in examples: if os.path.exists(name): print("'%s' example directory already exists. Deleting..." % name) rmtree(name) subprocess.call(["mbed-cli", "import", repo_info['repo']]) def clone_repos(config, examples): """ Clones each of the repos associated with the specific examples name from the json config file. Note if there is already a clone of the repo then it will first be removed to ensure a clean, up to date cloning. Args: config - the json object imported from the file. """ print("\nCloning example repos....\n") for example in config['examples']: for repo_info in get_repo_list(example): name = basename(repo_info['repo']) if name in examples: if os.path.exists(name): print("'%s' example directory already exists. Deleting..." % name) rmtree(name) subprocess.call([repo_info['type'], "clone", repo_info['repo']]) def deploy_repos(config, examples): """ If the example directory exists as provided by the json config file, pull in the examples dependencies by using `mbed-cli deploy`. Args: config - the json object imported from the file. """ print("\nDeploying example repos....\n") for example in config['examples']: for repo_info in get_repo_list(example): name = basename(repo_info['repo']) if name in examples: if os.path.exists(name): os.chdir(name) subprocess.call(["mbed-cli", "deploy"]) os.chdir("..") else: print("'%s' example directory doesn't exist. Skipping..." % name) def get_num_failures(results, export=False): """ Returns the number of failed compilations from the results summary Args: results - results summary of the compilation stage. See compile_repos() for details of the format. num_failures """ num_failures = 0 for key, val in results.iteritems(): num_failures = num_failures + len(val[3]) if export: num_failures += len(val[4]) return num_failures def export_repos(config, ides, targets, examples): """Exports and builds combinations of example programs, targets and IDEs. The results are returned in a [key: value] dictionary format: Where key = The example name from the json config file value = a list containing: pass_status, successes, export failures, build_failures, and build_skips where pass_status = The overall pass status for the export of the full set of example programs comprising the example suite. IE they must build and export) True if all examples pass, false otherwise successes = list of examples that exported and built (if possible) If the exporter has no build functionality, then it is a pass if exported export_failures = list of examples that failed to export. build_failures = list of examples that failed to build build_skips = list of examples that cannot build Both successes and failures contain the example name, target and IDE Args: config - the json object imported from the file. ides - List of IDES to export to """ results = {} valid_examples = Set(examples) print("\nExporting example repos....\n") for example in config['examples']: example_names = [basename(x['repo']) for x in get_repo_list(example)] common_examples = valid_examples.intersection(Set(example_names)) if not common_examples: continue export_failures = [] build_failures = [] build_skips = [] successes = [] exported = True pass_status = True if example['export']: for repo_info in get_repo_list(example): example_project_name = basename(repo_info['repo']) os.chdir(example_project_name) # Check that the target, IDE, and features combinations are valid and return a # list of valid combinations to work through for target, ide in target_cross_ide(valid_choices(example['targets'], targets), valid_choices(example['exporters'], ides), example['features'], example['toolchains']): example_name = "{} {} {}".format(example_project_name, target, ide) def status(message): print(message + " %s" % example_name) sys.stdout.flush() status("Exporting") proc = subprocess.Popen(["mbed-cli", "export", "-i", ide, "-m", target]) proc.wait() if proc.returncode: export_failures.append(example_name) status("FAILURE exporting") else: status("SUCCESS exporting") status("Building") try: if EXPORTERS[ide].build(example_project_name): status("FAILURE building") build_failures.append(example_name) else: status("SUCCESS building") successes.append(example_name) except TypeError: successes.append(example_name) build_skips.append(example_name) os.chdir("..") if len(build_failures+export_failures) > 0: pass_status= False else: exported = False results[example['name']] = [exported, pass_status, successes, export_failures, build_failures, build_skips] return results def compile_repos(config, toolchains, targets, examples): """Compiles combinations of example programs, targets and compile chains. The results are returned in a [key: value] dictionary format: Where key = The example name from the json config file value = a list containing: pass_status, successes, and failures where pass_status = The overall pass status for the compilation of the full set of example programs comprising the example suite. True if all examples pass, false otherwise successes = list of passing examples. failures = list of failing examples. Both successes and failures contain the example name, target and compile chain Args: config - the json object imported from the file. toolchains - List of toolchains to compile for. results - results of the compilation stage. """ results = {} valid_examples = Set(examples) print("\nCompiling example repos....\n") for example in config['examples']: example_names = [basename(x['repo']) for x in get_repo_list(example)] common_examples = valid_examples.intersection(Set(example_names)) if not common_examples: continue failures = [] successes = [] compiled = True pass_status = True if example['compile']: for repo_info in get_repo_list(example): name = basename(repo_info['repo']) os.chdir(name) # Check that the target, toolchain and features combinations are valid and return a # list of valid combinations to work through for target, toolchain in target_cross_toolchain(valid_choices(example['targets'], targets), valid_choices(example['toolchains'], toolchains), example['features']): print("Compiling %s for %s, %s" % (name, target, toolchain)) proc = subprocess.Popen(["mbed-cli", "compile", "-t", toolchain, "-m", target, "--silent"]) proc.wait() example_summary = "{} {} {}".format(name, target, toolchain) if proc.returncode: failures.append(example_summary) else: successes.append(example_summary) os.chdir("..") # If there are any compilation failures for the example 'set' then the overall status is fail. if len(failures) > 0: pass_status = False else: compiled = False results[example['name']] = [compiled, pass_status, successes, failures] return results def update_mbedos_version(config, tag, examples): """ For each example repo identified in the config json object, update the version of mbed-os to that specified by the supplied GitHub tag. This function assumes that each example repo has already been cloned. Args: config - the json object imported from the file. tag - GitHub tag corresponding to a version of mbed-os to upgrade to. """ print("Updating mbed-os in examples to version %s\n" % tag) for example in config['examples']: if example['name'] not in examples: continue for repo_info in get_repo_list(example): update_dir = basename(repo_info['repo']) + "/mbed-os" print("\nChanging dir to %s\n" % update_dir) os.chdir(update_dir) subprocess.call(["mbed-cli", "update", tag, "--clean"]) os.chdir("../..")
apache-2.0
nithinmurali/robocomp
tools/robocompdsl/parseCDSL.py
2
9452
#!/usr/bin/env python from pyparsing import Word, alphas, alphanums, nums, OneOrMore, CharsNotIn, Literal, Combine from pyparsing import cppStyleComment, Optional, Suppress, ZeroOrMore, Group, StringEnd, srange from pyparsing import nestedExpr, CaselessLiteral import sys, traceback, os debug = False #debug = True from parseIDSL import * def getTypeFromModule(vtype, module): for t in module['types']: if t['name'] == vtype: return t['type'] return None def getKindFromPool(vtype, modulePool, debug=False): if debug: print vtype split = vtype.split("::") if debug: print split if len(split) > 1: vtype = split[1] mname = split[0] if debug: print 'SPLIT (' + vtype+'), (' + mname + ')' if mname in modulePool.modulePool: if debug: print 'dentro SPLIT (' + vtype+'), (' + mname + ')' r = getTypeFromModule(vtype, modulePool.modulePool[mname]) if r != None: return r if mname.startswith("RoboComp"): if mname[8:] in modulePool.modulePool: r = getTypeFromModule(vtype, modulePool.modulePool[mname[8:]]) if r != None: return r else: if debug: print 'no split' for module in modulePool.modulePool: if debug: print ' '+str(module) r = getTypeFromModule(vtype, modulePool.modulePool[module]) if r != None: return r def decoratorAndType_to_const_ampersand(decorator, vtype, modulePool): ampersand = ' & ' const = ' ' if vtype in [ 'float', 'int' ]: # MAIN BASIC TYPES if decorator in [ 'out' ]: #out ampersand = ' &' const = ' ' else: #read-only ampersand = ' ' const = 'const ' elif vtype in [ 'bool' ]: # BOOL SEEM TO BE SPECIAL const = ' ' if decorator in [ 'out' ]: # out ampersand = ' &' else: #read-only ampersand = ' ' elif vtype in [ 'string' ]: # STRINGS if decorator in [ 'out' ]: # out const = ' ' ampersand = ' &' else: #read-only const = 'const ' ampersand = ' &' else: # GENERIC, USED FOR USER-DEFINED DATA TYPES kind = getKindFromPool(vtype, modulePool) if kind == None: kind = getKindFromPool(vtype, modulePool, debug=True) raise Exception('error, unknown data structure, map or sequence '+vtype) else: if kind == 'enum': # ENUM const = ' ' if decorator in [ 'out' ]: # out ampersand = ' &' else: #read-only ampersand = ' ' else: # THE REST if decorator in [ 'out' ]: #out ampersand = ' &' const = ' ' else: # read-only ampersand = ' &' const = 'const ' return const, ampersand def getNameNumber(aalist): somelist = [str(x) for x in aalist] somelist.sort() lastNum = 0 ret = [] for rqi, rq in enumerate(somelist): dup = False if rqi < len(somelist)-1: if rq == somelist[rqi+1]: dup = True if rqi > 0: if rq == somelist[rqi-1]: dup = True name = rq num = '' if dup: lastNum += 1 num = str(lastNum) name = rq ret.append([name, num]) return ret class CDSLParsing: @staticmethod def fromFile(filename, verbose=False, includeIncludes=True): # Open input file #inputText = "\n".join([line for line in open(filename, 'r').read().split("\n") if not line.lstrip(" \t").startswith('//')]) inputText = open(filename, 'r').read() try: ret = CDSLParsing.fromString(inputText) except: print 'Error reading', filename traceback.print_exc() print 'Error reading', filename sys.exit(1) ret['filename'] = filename return ret @staticmethod def fromString(inputText, verbose=False): if verbose: print 'Verbose:', verbose text = nestedExpr("/*", "*/").suppress().transformString(inputText) semicolon = Suppress(Word(";")) quote = Suppress(Word("\"")) op = Suppress(Word("{")) cl = Suppress(Word("}")) opp = Suppress(Word("(")) clp = Suppress(Word(")")) identifier = Word( alphas+"_", alphanums+"_" ) # Imports idslImport = Suppress(CaselessLiteral("import")) + quote + CharsNotIn("\";").setResultsName('path') + quote + semicolon idslImports = OneOrMore(idslImport) # Communications implementsList = Group(CaselessLiteral('implements') + identifier + ZeroOrMore(Suppress(Word(',')) + identifier) + semicolon) requiresList = Group(CaselessLiteral('requires') + identifier + ZeroOrMore(Suppress(Word(',')) + identifier) + semicolon) subscribesList = Group(CaselessLiteral('subscribesTo') + identifier + ZeroOrMore(Suppress(Word(',')) + identifier) + semicolon) publishesList = Group(CaselessLiteral('publishes') + identifier + ZeroOrMore(Suppress(Word(',')) + identifier) + semicolon) communicationList = implementsList | requiresList | subscribesList | publishesList communications = Group( Suppress(CaselessLiteral("communications")) + op + ZeroOrMore(communicationList) + cl + semicolon) # Language language = Suppress(CaselessLiteral("language")) + (CaselessLiteral("cpp")|CaselessLiteral("python")) + semicolon # GUI gui = Group(Optional(Suppress(CaselessLiteral("gui")) + CaselessLiteral("Qt") + opp + identifier + clp + semicolon )) # additional options options = Group(Optional(Suppress(CaselessLiteral("options")) + identifier + ZeroOrMore(Suppress(Word(',')) + identifier) + semicolon)) componentContents = communications.setResultsName('communications') & language.setResultsName('language') & gui.setResultsName('gui') & options.setResultsName('options') component = Suppress(CaselessLiteral("component")) + identifier.setResultsName("name") + op + componentContents.setResultsName("properties") + cl + semicolon CDSL = idslImports.setResultsName("imports") + component.setResultsName("component") CDSL.ignore( cppStyleComment ) tree = CDSL.parseString(text) return CDSLParsing.component(tree) @staticmethod def printComponent(component, start=''): # Component name print 'Component', component['name'] # Imports print '\tImports:' for imp in component['imports']: print '\t\t', imp # Language print '\tLanguage:' print '\t\t', component['language'] # GUI print '\tGUI:' print '\t\t', component['gui'] # Communications print '\tCommunications:' print '\t\tImplements', component['implements'] print '\t\tRequires', component['requires'] print '\t\tPublishes', component['publishes'] print '\t\tSubscribes', component['subscribesTo'] @staticmethod def component(tree, start=''): component = {} # Set options component['options'] = [] try: for op in tree['properties']['options']: component['options'].append(op.lower()) except: traceback.print_exc() # Component name component['name'] = tree['component']['name'] # Imports component['imports'] = [] component['recursiveImports'] = [] imprts = tree['imports'] if 'agmagent' in component['options']: imprts = ['/robocomp/interfaces/IDSLs/AGMAgent.idsl', '/robocomp/interfaces/IDSLs/AGMExecutive.idsl', '/robocomp/interfaces/IDSLs/AGMCommonBehavior.idsl', '/robocomp/interfaces/IDSLs/AGMWorldModel.idsl'] for i in tree['imports']: if not i in imprts: imprts.append(i) for imp in imprts: component['imports'].append(imp) #print 'moduleee', imp imp2 = imp.split('/')[-1] component['recursiveImports'] += [imp2] try: importedModule = IDSLParsing.gimmeIDSL(imp2) except: print 'Error reading IMPORT', imp2 traceback.print_exc() print 'Error reading IMPORT', imp2 os._exit(1) component['recursiveImports'] += [x for x in importedModule['imports'].split('#') if len(x)>0] #print 'moduleee', imp, 'done' #print component['recursiveImports'] # Language component['language'] = tree['properties']['language'][0] # GUI component['gui'] = 'none' try: uiT = tree['properties']['gui'][0] uiI = tree['properties']['gui'][1] if uiT.lower() == 'qt' and uiI in ['QWidget', 'QMainWindow', 'QDialog' ]: component['gui'] = [ uiT, uiI ] pass else: print 'Wrong UI specification', tree['properties']['gui'] sys.exit(1) except: pass # Communications component['implements'] = [] component['requires'] = [] component['publishes'] = [] component['subscribesTo'] = [] for comm in tree['properties']['communications']: if comm[0] == 'implements': for interface in comm[1:]: component['implements'].append(interface) if comm[0] == 'requires': for interface in comm[1:]: component['requires'].append(interface) if comm[0] == 'publishes': for interface in comm[1:]: component['publishes'].append(interface) if comm[0] == 'subscribesTo': for interface in comm[1:]: component['subscribesTo'].append(interface) # Handle options for communications if 'agmagent' in component['options']: if not 'AGMCommonBehavior' in component['implements']: component['implements'] = ['AGMCommonBehavior'] + component['implements'] if not 'AGMAgentTopic' in component['publishes']: component['publishes'] = ['AGMAgentTopic'] + component['publishes'] if not 'AGMExecutiveTopic' in component['subscribesTo']: component['subscribesTo'] = ['AGMExecutiveTopic'] + component['subscribesTo'] return component if __name__ == '__main__': CDSLParsing.fromFile(sys.argv[1])
gpl-3.0
sYnfo/samba-1
python/samba/tests/dcerpc/misc.py
44
1982
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <[email protected]> 2007 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # """Tests for samba.dcerpc.misc.""" from samba.dcerpc import misc import samba.tests text1 = "76f53846-a7c2-476a-ae2c-20e2b80d7b34" text2 = "344edffa-330a-4b39-b96e-2c34da52e8b1" class GUIDTests(samba.tests.TestCase): def test_str(self): guid = misc.GUID(text1) self.assertEquals(text1, str(guid)) def test_repr(self): guid = misc.GUID(text1) self.assertEquals("GUID('%s')" % text1, repr(guid)) def test_compare_different(self): guid1 = misc.GUID(text1) guid2 = misc.GUID(text2) self.assertTrue(cmp(guid1, guid2) > 0) def test_compare_same(self): guid1 = misc.GUID(text1) guid2 = misc.GUID(text1) self.assertEquals(0, cmp(guid1, guid2)) self.assertEquals(guid1, guid2) class PolicyHandleTests(samba.tests.TestCase): def test_init(self): x = misc.policy_handle(text1, 1) self.assertEquals(1, x.handle_type) self.assertEquals(text1, str(x.uuid)) def test_repr(self): x = misc.policy_handle(text1, 42) self.assertEquals("policy_handle(%d, '%s')" % (42, text1), repr(x)) def test_str(self): x = misc.policy_handle(text1, 42) self.assertEquals("%d, %s" % (42, text1), str(x))
gpl-3.0
alexryndin/ambari
ambari-server/src/main/resources/stacks/ADH/1.5/services/HIVE/package/alerts/alert_hive_metastore.py
3
9232
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import os import socket import time import traceback import logging from resource_management.libraries.functions import format from resource_management.libraries.functions import get_kinit_path from resource_management.core.resources import Execute from ambari_commons.os_check import OSConst from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl OK_MESSAGE = "Metastore OK - Hive command took {0:.3f}s" CRITICAL_MESSAGE = "Metastore on {0} failed ({1})" SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}' SMOKEUSER_KEYTAB_KEY = '{{cluster-env/smokeuser_keytab}}' SMOKEUSER_PRINCIPAL_KEY = '{{cluster-env/smokeuser_principal_name}}' SMOKEUSER_KEY = '{{cluster-env/smokeuser}}' HIVE_METASTORE_URIS_KEY = '{{hive-site/hive.metastore.uris}}' # The configured Kerberos executable search paths, if any KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY = '{{kerberos-env/executable_search_paths}}' # default keytab location SMOKEUSER_KEYTAB_SCRIPT_PARAM_KEY = 'default.smoke.keytab' SMOKEUSER_KEYTAB_DEFAULT = '/etc/security/keytabs/smokeuser.headless.keytab' # default smoke principal SMOKEUSER_PRINCIPAL_SCRIPT_PARAM_KEY = 'default.smoke.principal' SMOKEUSER_PRINCIPAL_DEFAULT = '[email protected]' # default smoke user SMOKEUSER_SCRIPT_PARAM_KEY = 'default.smoke.user' SMOKEUSER_DEFAULT = 'ambari-qa' HIVE_CONF_DIR = '/usr/hdp/current/hive-metastore/conf/conf.server' HIVE_CONF_DIR_LEGACY = '/etc/hive/conf.server' HIVE_BIN_DIR = '/usr/hdp/current/hive-metastore/bin' HIVE_BIN_DIR_LEGACY = '/usr/lib/hive/bin' CHECK_COMMAND_TIMEOUT_KEY = 'check.command.timeout' CHECK_COMMAND_TIMEOUT_DEFAULT = 60.0 HADOOPUSER_KEY = '{{cluster-env/hadoop.user.name}}' HADOOPUSER_DEFAULT = 'hadoop' logger = logging.getLogger('ambari_alerts') @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT) def get_tokens(): """ Returns a tuple of tokens in the format {{site/property}} that will be used to build the dictionary passed into execute """ return (SECURITY_ENABLED_KEY,SMOKEUSER_KEYTAB_KEY,SMOKEUSER_PRINCIPAL_KEY, HIVE_METASTORE_URIS_KEY, SMOKEUSER_KEY, KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY) @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY) def get_tokens(): """ Returns a tuple of tokens in the format {{site/property}} that will be used to build the dictionary passed into execute """ return (HIVE_METASTORE_URIS_KEY, HADOOPUSER_KEY) @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT) def execute(configurations={}, parameters={}, host_name=None): """ Returns a tuple containing the result code and a pre-formatted result label Keyword arguments: configurations (dictionary): a mapping of configuration key to value parameters (dictionary): a mapping of script parameter key to value host_name (string): the name of this host where the alert is running """ if configurations is None: return (('UNKNOWN', ['There were no configurations supplied to the script.'])) if not HIVE_METASTORE_URIS_KEY in configurations: return (('UNKNOWN', ['Hive metastore uris were not supplied to the script.'])) metastore_uris = configurations[HIVE_METASTORE_URIS_KEY].split(',') security_enabled = False if SECURITY_ENABLED_KEY in configurations: security_enabled = str(configurations[SECURITY_ENABLED_KEY]).upper() == 'TRUE' check_command_timeout = CHECK_COMMAND_TIMEOUT_DEFAULT if CHECK_COMMAND_TIMEOUT_KEY in parameters: check_command_timeout = float(parameters[CHECK_COMMAND_TIMEOUT_KEY]) # defaults smokeuser_keytab = SMOKEUSER_KEYTAB_DEFAULT smokeuser_principal = SMOKEUSER_PRINCIPAL_DEFAULT smokeuser = SMOKEUSER_DEFAULT # check script params if SMOKEUSER_PRINCIPAL_SCRIPT_PARAM_KEY in parameters: smokeuser_principal = parameters[SMOKEUSER_PRINCIPAL_SCRIPT_PARAM_KEY] if SMOKEUSER_SCRIPT_PARAM_KEY in parameters: smokeuser = parameters[SMOKEUSER_SCRIPT_PARAM_KEY] if SMOKEUSER_KEYTAB_SCRIPT_PARAM_KEY in parameters: smokeuser_keytab = parameters[SMOKEUSER_KEYTAB_SCRIPT_PARAM_KEY] # check configurations last as they should always take precedence if SMOKEUSER_PRINCIPAL_KEY in configurations: smokeuser_principal = configurations[SMOKEUSER_PRINCIPAL_KEY] if SMOKEUSER_KEY in configurations: smokeuser = configurations[SMOKEUSER_KEY] result_code = None try: if security_enabled: if SMOKEUSER_KEYTAB_KEY in configurations: smokeuser_keytab = configurations[SMOKEUSER_KEYTAB_KEY] # Get the configured Kerberos executable search paths, if any if KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY in configurations: kerberos_executable_search_paths = configurations[KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY] else: kerberos_executable_search_paths = None kinit_path_local = get_kinit_path(kerberos_executable_search_paths) kinitcmd=format("{kinit_path_local} -kt {smokeuser_keytab} {smokeuser_principal}; ") Execute(kinitcmd, user=smokeuser, path=["/bin/", "/usr/bin/", "/usr/lib/hive/bin/", "/usr/sbin/"], timeout=10) if host_name is None: host_name = socket.getfqdn() for uri in metastore_uris: if host_name in uri: metastore_uri = uri conf_dir = HIVE_CONF_DIR_LEGACY bin_dir = HIVE_BIN_DIR_LEGACY if os.path.exists(HIVE_CONF_DIR): conf_dir = HIVE_CONF_DIR bin_dir = HIVE_BIN_DIR cmd = format("export HIVE_CONF_DIR='{conf_dir}' ; " "hive --hiveconf hive.metastore.uris={metastore_uri}\ --hiveconf hive.metastore.client.connect.retry.delay=1\ --hiveconf hive.metastore.failure.retries=1\ --hiveconf hive.metastore.connect.retries=1\ --hiveconf hive.metastore.client.socket.timeout=14\ --hiveconf hive.execution.engine=mr -e 'show databases;'") start_time = time.time() try: Execute(cmd, user=smokeuser, path=["/bin/", "/usr/bin/", "/usr/sbin/", bin_dir], timeout=int(check_command_timeout) ) total_time = time.time() - start_time result_code = 'OK' label = OK_MESSAGE.format(total_time) except: result_code = 'CRITICAL' label = CRITICAL_MESSAGE.format(host_name, traceback.format_exc()) except: label = traceback.format_exc() result_code = 'UNKNOWN' return ((result_code, [label])) @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY) def execute(configurations={}, parameters={}, host_name=None): """ Returns a tuple containing the result code and a pre-formatted result label Keyword arguments: configurations (dictionary): a mapping of configuration key to value parameters (dictionary): a mapping of script parameter key to value host_name (string): the name of this host where the alert is running """ from resource_management.libraries.functions import reload_windows_env reload_windows_env() hive_home = os.environ['HIVE_HOME'] if configurations is None: return (('UNKNOWN', ['There were no configurations supplied to the script.'])) if not HIVE_METASTORE_URIS_KEY in configurations: return (('UNKNOWN', ['Hive metastore uris were not supplied to the script.'])) metastore_uris = configurations[HIVE_METASTORE_URIS_KEY].split(',') # defaults hiveuser = HADOOPUSER_DEFAULT if HADOOPUSER_KEY in configurations: hiveuser = configurations[HADOOPUSER_KEY] result_code = None try: if host_name is None: host_name = socket.getfqdn() for uri in metastore_uris: if host_name in uri: metastore_uri = uri hive_cmd = os.path.join(hive_home, "bin", "hive.cmd") cmd = format("cmd /c {hive_cmd} --hiveconf hive.metastore.uris={metastore_uri}\ --hiveconf hive.metastore.client.connect.retry.delay=1\ --hiveconf hive.metastore.failure.retries=1\ --hiveconf hive.metastore.connect.retries=1\ --hiveconf hive.metastore.client.socket.timeout=14\ --hiveconf hive.execution.engine=mr -e 'show databases;'") start_time = time.time() try: Execute(cmd, user=hiveuser, timeout=30) total_time = time.time() - start_time result_code = 'OK' label = OK_MESSAGE.format(total_time) except: result_code = 'CRITICAL' label = CRITICAL_MESSAGE.format(host_name, traceback.format_exc()) except: label = traceback.format_exc() result_code = 'UNKNOWN' return ((result_code, [label]))
apache-2.0
janusnic/youtube-dl-GUI
youtube_dl/extractor/spankwire.py
31
4129
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_parse_urlparse, compat_urllib_request, ) from ..utils import ( str_to_int, unified_strdate, ) from ..aes import aes_decrypt_text class SpankwireIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?P<url>spankwire\.com/[^/]*/video(?P<videoid>[0-9]+)/?)' _TEST = { 'url': 'http://www.spankwire.com/Buckcherry-s-X-Rated-Music-Video-Crazy-Bitch/video103545/', 'md5': '8bbfde12b101204b39e4b9fe7eb67095', 'info_dict': { 'id': '103545', 'ext': 'mp4', 'title': 'Buckcherry`s X Rated Music Video Crazy Bitch', 'description': 'Crazy Bitch X rated music video.', 'uploader': 'oreusz', 'uploader_id': '124697', 'upload_date': '20070508', 'age_limit': 18, } } def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('videoid') url = 'http://www.' + mobj.group('url') req = compat_urllib_request.Request(url) req.add_header('Cookie', 'age_verified=1') webpage = self._download_webpage(req, video_id) title = self._html_search_regex( r'<h1>([^<]+)', webpage, 'title') description = self._html_search_regex( r'<div\s+id="descriptionContent">([^<]+)<', webpage, 'description', fatal=False) thumbnail = self._html_search_regex( r'playerData\.screenShot\s*=\s*["\']([^"\']+)["\']', webpage, 'thumbnail', fatal=False) uploader = self._html_search_regex( r'by:\s*<a [^>]*>(.+?)</a>', webpage, 'uploader', fatal=False) uploader_id = self._html_search_regex( r'by:\s*<a href="/Profile\.aspx\?.*?UserId=(\d+).*?"', webpage, 'uploader id', fatal=False) upload_date = unified_strdate(self._html_search_regex( r'</a> on (.+?) at \d+:\d+', webpage, 'upload date', fatal=False)) view_count = str_to_int(self._html_search_regex( r'<div id="viewsCounter"><span>([\d,\.]+)</span> views</div>', webpage, 'view count', fatal=False)) comment_count = str_to_int(self._html_search_regex( r'Comments<span[^>]+>\s*\(([\d,\.]+)\)</span>', webpage, 'comment count', fatal=False)) video_urls = list(map( compat_urllib_parse.unquote, re.findall(r'playerData\.cdnPath[0-9]{3,}\s*=\s*["\']([^"\']+)["\']', webpage))) if webpage.find('flashvars\.encrypted = "true"') != -1: password = self._html_search_regex( r'flashvars\.video_title = "([^"]+)', webpage, 'password').replace('+', ' ') video_urls = list(map( lambda s: aes_decrypt_text(s, password, 32).decode('utf-8'), video_urls)) formats = [] for video_url in video_urls: path = compat_urllib_parse_urlparse(video_url).path format = path.split('/')[4].split('_')[:2] resolution, bitrate_str = format format = "-".join(format) height = int(resolution.rstrip('Pp')) tbr = int(bitrate_str.rstrip('Kk')) formats.append({ 'url': video_url, 'resolution': resolution, 'format': format, 'tbr': tbr, 'height': height, 'format_id': format, }) self._sort_formats(formats) age_limit = self._rta_search(webpage) return { 'id': video_id, 'title': title, 'description': description, 'thumbnail': thumbnail, 'uploader': uploader, 'uploader_id': uploader_id, 'upload_date': upload_date, 'view_count': view_count, 'comment_count': comment_count, 'formats': formats, 'age_limit': age_limit, }
mit
mikesun/xen-cow-checkpointing
tools/python/xen/util/xpopen.py
9
6760
# # Copyright (c) 2001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved # # PSF LICENSE AGREEMENT FOR PYTHON 2.3 # ------------------------------------ # # 1. This LICENSE AGREEMENT is between the Python Software Foundation # ("PSF"), and the Individual or Organization ("Licensee") accessing and # otherwise using Python 2.3 software in source or binary form and its # associated documentation. # # 2. Subject to the terms and conditions of this License Agreement, PSF # hereby grants Licensee a nonexclusive, royalty-free, world-wide # license to reproduce, analyze, test, perform and/or display publicly, # prepare derivative works, distribute, and otherwise use Python 2.3 # alone or in any derivative version, provided, however, that PSF's # License Agreement and PSF's notice of copyright, i.e., "Copyright (c) # 2001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved" are # retained in Python 2.3 alone or in any derivative version prepared by # Licensee. # # 3. In the event Licensee prepares a derivative work that is based on # or incorporates Python 2.3 or any part thereof, and wants to make # the derivative work available to others as provided herein, then # Licensee hereby agrees to include in any such work a brief summary of # the changes made to Python 2.3. # # 4. PSF is making Python 2.3 available to Licensee on an "AS IS" # basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR # IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND # DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS # FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.3 WILL NOT # INFRINGE ANY THIRD PARTY RIGHTS. # # 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON # 2.3 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS # A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.3, # OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. # # 6. This License Agreement will automatically terminate upon a material # breach of its terms and conditions. # # 7. Nothing in this License Agreement shall be deemed to create any # relationship of agency, partnership, or joint venture between PSF and # Licensee. This License Agreement does not grant permission to use PSF # trademarks or trade name in a trademark sense to endorse or promote # products or services of Licensee, or any third party. # # 8. By copying, installing or otherwise using Python 2.3, Licensee # agrees to be bound by the terms and conditions of this License # Agreement. # # Modifications: Copyright (c) 2005 Christian Limpach <[email protected]> # - add support for excluding a list of file descriptors from being # closed, allowing access to those file descriptors from the command. # """Spawn a command with pipes to its stdin, stdout, and optionally stderr. The normal os.popen(cmd, mode) call spawns a shell command and provides a file interface to just the input or output of the process depending on whether mode is 'r' or 'w'. This module provides the functions xpopen2(cmd) and xpopen3(cmd) which return two or three pipes to the spawned command. Optionally exclude a list of file descriptors from being closed, allowing access to those file descriptors from the command. """ import os import sys try: MAXFD = os.sysconf('SC_OPEN_MAX') except (AttributeError, ValueError): MAXFD = 256 _active = [] def _cleanup(): for inst in _active[:]: inst.poll() class xPopen3: """Class representing a child process. Normally instances are created by the factory functions popen2() and popen3().""" sts = -1 # Child not completed yet def __init__(self, cmd, capturestderr=False, bufsize=-1, passfd=()): """The parameter 'cmd' is the shell command to execute in a sub-process. The 'capturestderr' flag, if true, specifies that the object should capture standard error output of the child process. The default is false. If the 'bufsize' parameter is specified, it specifies the size of the I/O buffers to/from the child process.""" _cleanup() self.passfd = passfd p2cread, p2cwrite = os.pipe() c2pread, c2pwrite = os.pipe() if capturestderr: errout, errin = os.pipe() self.pid = os.fork() if self.pid == 0: # Child os.dup2(p2cread, 0) os.dup2(c2pwrite, 1) if capturestderr: os.dup2(errin, 2) self._run_child(cmd) os.close(p2cread) self.tochild = os.fdopen(p2cwrite, 'w', bufsize) os.close(c2pwrite) self.fromchild = os.fdopen(c2pread, 'r', bufsize) if capturestderr: os.close(errin) self.childerr = os.fdopen(errout, 'r', bufsize) else: self.childerr = None _active.append(self) def _run_child(self, cmd): if isinstance(cmd, basestring): cmd = ['/bin/sh', '-c', cmd] for i in range(3, MAXFD): if i in self.passfd: continue try: os.close(i) except OSError: pass try: os.execvp(cmd[0], cmd) finally: os._exit(127) def poll(self): """Return the exit status of the child process if it has finished, or -1 if it hasn't finished yet.""" if self.sts < 0: try: pid, sts = os.waitpid(self.pid, os.WNOHANG) if pid == self.pid: self.sts = sts _active.remove(self) except os.error: pass return self.sts def wait(self): """Wait for and return the exit status of the child process.""" if self.sts < 0: pid, sts = os.waitpid(self.pid, 0) if pid == self.pid: self.sts = sts _active.remove(self) return self.sts def xpopen2(cmd, bufsize=-1, mode='t', passfd=[]): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin) are returned.""" inst = xPopen3(cmd, False, bufsize, passfd) return inst.fromchild, inst.tochild def xpopen3(cmd, bufsize=-1, mode='t', passfd=[]): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin, child_stderr) are returned.""" inst = xPopen3(cmd, True, bufsize, passfd) return inst.fromchild, inst.tochild, inst.childerr
gpl-2.0
simonbates/bitstructures
substructure/models.py
1
2253
from django.db import models class Entry(models.Model): """ >>> from datetime import datetime >>> test1 = Entry() >>> test1.id = 1 >>> test1.slug = 'testentry1' >>> test1.is_published() False >>> test1.is_draft() True >>> test1.get_absolute_url() '/drafts/testentry1' >>> test2 = Entry() >>> test2.id = 2 >>> test2.slug = 'testentry2' >>> test2.date_published = datetime(2001, 2, 3) >>> test2.is_published() True >>> test2.is_draft() False >>> test2.get_absolute_url() '/2001/02/testentry2' """ slug = models.SlugField(unique=True, blank=False) title = models.CharField(maxlength=200, blank=False) date_published = models.DateTimeField(null=True, blank=True) text = models.TextField(blank=False) def __str__(self): return self.title def is_published(self): return bool(self.date_published) def is_draft(self): return not self.is_published() def get_absolute_url(self): if self.is_published(): year = self.date_published.year month = self.date_published.month return '/%04d/%02d/%s' % (year, month, self.slug) else: return '/drafts/%s' % (self.slug) def tags(self): entrytags = EntryTag.objects.select_related().filter(entry=self).order_by('number') tags = [] for entrytag in entrytags: tags.append(entrytag.tag) return tags class Admin: fields = ( (None, {'fields': ('title', 'slug', 'date_published')}), (None, {'fields': ('text',), 'classes': 'monospace'}) ) list_display = ('title', 'get_absolute_url', 'date_published') ordering = ['-date_published'] class Tag(models.Model): name = models.CharField(maxlength=50, blank=False) def __str__(self): return self.name def get_absolute_url(self): return '/tagged-with/%s' % (self.name) class Admin: pass class EntryTag(models.Model): entry = models.ForeignKey(Entry) tag = models.ForeignKey(Tag) number = models.IntegerField() class Admin: list_display = ('entry', 'tag', 'number') ordering = ['entry']
mit
janocat/odoo
addons/portal_project_issue/tests/test_access_rights.py
338
10547
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## from openerp.addons.portal_project.tests.test_access_rights import TestPortalProjectBase from openerp.exceptions import AccessError from openerp.osv.orm import except_orm from openerp.tools import mute_logger class TestPortalProjectBase(TestPortalProjectBase): def setUp(self): super(TestPortalProjectBase, self).setUp() cr, uid = self.cr, self.uid # Useful models self.project_issue = self.registry('project.issue') # Various test issues self.issue_1_id = self.project_issue.create(cr, uid, { 'name': 'Test1', 'user_id': False, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True}) self.issue_2_id = self.project_issue.create(cr, uid, { 'name': 'Test2', 'user_id': False, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True}) self.issue_3_id = self.project_issue.create(cr, uid, { 'name': 'Test3', 'user_id': False, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True}) self.issue_4_id = self.project_issue.create(cr, uid, { 'name': 'Test4', 'user_id': self.user_projectuser_id, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True}) self.issue_5_id = self.project_issue.create(cr, uid, { 'name': 'Test5', 'user_id': self.user_portal_id, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True}) self.issue_6_id = self.project_issue.create(cr, uid, { 'name': 'Test6', 'user_id': self.user_public_id, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True}) class TestPortalIssue(TestPortalProjectBase): @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.models') def test_00_project_access_rights(self): """ Test basic project access rights, for project and portal_project """ cr, uid, pigs_id = self.cr, self.uid, self.project_pigs_id # ---------------------------------------- # CASE1: public project # ---------------------------------------- # Do: Alfred reads project -> ok (employee ok public) # Test: all project issues visible issue_ids = self.project_issue.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)]) test_issue_ids = set([self.issue_1_id, self.issue_2_id, self.issue_3_id, self.issue_4_id, self.issue_5_id, self.issue_6_id]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: project user cannot see all issues of a public project') # Test: all project issues readable self.project_issue.read(cr, self.user_projectuser_id, issue_ids, ['name']) # Test: all project issues writable self.project_issue.write(cr, self.user_projectuser_id, issue_ids, {'description': 'TestDescription'}) # Do: Bert reads project -> crash, no group # Test: no project issue visible self.assertRaises(AccessError, self.project_issue.search, cr, self.user_none_id, [('project_id', '=', pigs_id)]) # Test: no project issue readable self.assertRaises(AccessError, self.project_issue.read, cr, self.user_none_id, issue_ids, ['name']) # Test: no project issue writable self.assertRaises(AccessError, self.project_issue.write, cr, self.user_none_id, issue_ids, {'description': 'TestDescription'}) # Do: Chell reads project -> ok (portal ok public) # Test: all project issues visible issue_ids = self.project_issue.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: project user cannot see all issues of a public project') # Test: all project issues readable self.project_issue.read(cr, self.user_portal_id, issue_ids, ['name']) # Test: no project issue writable self.assertRaises(AccessError, self.project_issue.write, cr, self.user_portal_id, issue_ids, {'description': 'TestDescription'}) # Do: Donovan reads project -> ok (public ok public) # Test: all project issues visible issue_ids = self.project_issue.search(cr, self.user_public_id, [('project_id', '=', pigs_id)]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: project user cannot see all issues of a public project') # ---------------------------------------- # CASE2: portal project # ---------------------------------------- self.project_project.write(cr, uid, [pigs_id], {'privacy_visibility': 'portal'}) # Do: Alfred reads project -> ok (employee ok public) # Test: all project issues visible issue_ids = self.project_issue.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: project user cannot see all issues of a portal project') # Do: Bert reads project -> crash, no group # Test: no project issue searchable self.assertRaises(AccessError, self.project_issue.search, cr, self.user_none_id, [('project_id', '=', pigs_id)]) # Data: issue follower self.project_issue.message_subscribe_users(cr, self.user_projectuser_id, [self.issue_1_id, self.issue_3_id], [self.user_portal_id]) # Do: Chell reads project -> ok (portal ok public) # Test: only followed project issues visible + assigned issue_ids = self.project_issue.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)]) test_issue_ids = set([self.issue_1_id, self.issue_3_id, self.issue_5_id]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: portal user should see the followed issues of a portal project') # Data: issue follower cleaning self.project_issue.message_unsubscribe_users(cr, self.user_projectuser_id, [self.issue_1_id, self.issue_3_id], [self.user_portal_id]) # ---------------------------------------- # CASE3: employee project # ---------------------------------------- self.project_project.write(cr, uid, [pigs_id], {'privacy_visibility': 'employees'}) # Do: Alfred reads project -> ok (employee ok employee) # Test: all project issues visible issue_ids = self.project_issue.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)]) test_issue_ids = set([self.issue_1_id, self.issue_2_id, self.issue_3_id, self.issue_4_id, self.issue_5_id, self.issue_6_id]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: project user cannot see all issues of an employees project') # Do: Chell reads project -> ko (portal ko employee) # Test: no project issue visible + assigned issue_ids = self.project_issue.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)]) self.assertFalse(issue_ids, 'access rights: portal user should not see issues of an employees project, even if assigned') # ---------------------------------------- # CASE4: followers project # ---------------------------------------- self.project_project.write(cr, uid, [pigs_id], {'privacy_visibility': 'followers'}) # Do: Alfred reads project -> ko (employee ko followers) # Test: no project issue visible issue_ids = self.project_issue.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)]) test_issue_ids = set([self.issue_4_id]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: employee user should not see issues of a not-followed followers project, only assigned') # Do: Chell reads project -> ko (portal ko employee) # Test: no project issue visible issue_ids = self.project_issue.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)]) test_issue_ids = set([self.issue_5_id]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: portal user should not see issues of a not-followed followers project, only assigned') # Data: subscribe Alfred, Chell and Donovan as follower self.project_project.message_subscribe_users(cr, uid, [pigs_id], [self.user_projectuser_id, self.user_portal_id, self.user_public_id]) self.project_issue.message_subscribe_users(cr, self.user_manager_id, [self.issue_1_id, self.issue_3_id], [self.user_portal_id, self.user_projectuser_id]) # Do: Alfred reads project -> ok (follower ok followers) # Test: followed + assigned issues visible issue_ids = self.project_issue.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)]) test_issue_ids = set([self.issue_1_id, self.issue_3_id, self.issue_4_id]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: employee user should not see followed + assigned issues of a follower project') # Do: Chell reads project -> ok (follower ok follower) # Test: followed + assigned issues visible issue_ids = self.project_issue.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)]) test_issue_ids = set([self.issue_1_id, self.issue_3_id, self.issue_5_id]) self.assertEqual(set(issue_ids), test_issue_ids, 'access rights: employee user should not see followed + assigned issues of a follower project')
agpl-3.0
Seitanas/kvm-vdi
guest_agent/ovirt-guest-agent/LockActiveSession.py
1
4728
#!/usr/bin/python # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Refer to the README and COPYING files for full details of the license. # import logging import os import os.path import subprocess import dbus class SessionWrapper(object): def __init__(self, session, bus, path): self._bus = bus self._path = path self._session = session self._props = GetInterface(bus, 'login1', '', path, 'org.freedesktop.DBus.Properties') def _getProperty(self, name): return self._props.Get('org.freedesktop.login1.Session', name) def GetId(self): return self._getProperty('Id') def IsActive(self): return self._getProperty('Active') def GetX11Display(self): return self._getProperty('Display') def GetUnixUser(self): return self._getProperty('User')[0] def Lock(self): return self._session.Lock() def GetInterface(bus, service, name, path, fname=None): obj = bus.get_object('org.freedesktop.%s' % service, path) iface = fname if not iface: iface = 'org.freedesktop.%s.%s' % (service, name) if not name: iface = iface[:-1] return dbus.Interface(obj, dbus_interface=iface) def GetInterfaceByName(bus, service, name, isSub): path = '/org/freedesktop/' + service if isSub: path += '/' + name return GetInterface(bus, service, name, path) def GetSessions(manager): try: return manager.GetSessions() except dbus.DBusException: return [x[4] for x in manager.ListSessions()] def GetSession(bus, service, managerIsSub, wrapSession): session = None try: manager = GetInterfaceByName(bus, service, 'Manager', managerIsSub) for session_path in GetSessions(manager): s = GetInterface(bus, service, 'Session', session_path) s = wrapSession(s, bus, session_path) if s.IsActive(): session = s break except dbus.DBusException: logging.exception("%s seems not to be available", service) return session def GetActiveSession(): bus = dbus.SystemBus() ARGS = (('ConsoleKit', True, lambda *a: a[0]), ('login1', False, SessionWrapper)) for args in ARGS: session = GetSession(bus, *args) if session: break return session def GetScreenSaver(): try: bus = dbus.SessionBus() screensaver = GetInterface(bus, 'ScreenSaver', '', '/ScreenSaver') except dbus.DBusException: logging.exception("Error retrieving ScreenSaver interface (ignore if " "running on GNOME).") screensaver = None return screensaver def LockSession(session): # First try to lock in the KDE "standard" interface. Since KDE is # using a session bus, all operations must be execued in the user # context. pid = os.fork() if pid == 0: os.environ['DISPLAY'] = session.GetX11Display() os.setuid(session.GetUnixUser()) screensaver = GetScreenSaver() if screensaver is not None: screensaver.Lock() exitcode = 0 else: logging.info("KDE standard interface seems not to be supported") exitcode = 1 os._exit(exitcode) result = os.waitpid(pid, 0) logging.debug("Process %d terminated (result = %s)", pid, result) # If our first try failed, try the GNOME "standard" interface. if result[1] != 0: logging.info("Attempting session lock via ConsoleKit/LoginD") session.Lock() def main(): if os.path.exists('/usr/bin/loginctl'): subprocess.call(['/usr/bin/loginctl', 'lock-sessions']) else: session = GetActiveSession() if session is not None: try: LockSession(session) logging.info("Session %s should be locked now.", session.GetId()) except dbus.DBusException: logging.exception("Error while trying to lock session.") else: logging.error("Error locking session (no active session).") if __name__ == '__main__': main()
mit
thesamet/gerrit
contrib/check-valid-commit.py
21
2925
#!/usr/bin/env python from __future__ import print_function import subprocess import getopt import sys SSH_USER = 'bot' SSH_HOST = 'localhost' SSH_PORT = 29418 SSH_COMMAND = 'ssh %s@%s -p %d gerrit approve ' % (SSH_USER, SSH_HOST, SSH_PORT) FAILURE_SCORE = '--code-review=-2' FAILURE_MESSAGE = 'This commit message does not match the standard.' \ + ' Please correct the commit message and upload a replacement patch.' PASS_SCORE = '--code-review=0' PASS_MESSAGE = '' def main(): change = None project = None branch = None commit = None patchset = None try: opts, _args = getopt.getopt(sys.argv[1:], '', \ ['change=', 'project=', 'branch=', 'commit=', 'patchset=']) except getopt.GetoptError as err: print('Error: %s' % (err)) usage() sys.exit(-1) for arg, value in opts: if arg == '--change': change = value elif arg == '--project': project = value elif arg == '--branch': branch = value elif arg == '--commit': commit = value elif arg == '--patchset': patchset = value else: print('Error: option %s not recognized' % (arg)) usage() sys.exit(-1) if change == None or project == None or branch == None \ or commit == None or patchset == None: usage() sys.exit(-1) command = 'git cat-file commit %s' % (commit) status, output = subprocess.getstatusoutput(command) if status != 0: print('Error running \'%s\'. status: %s, output:\n\n%s' % \ (command, status, output)) sys.exit(-1) commitMessage = output[(output.find('\n\n')+2):] commitLines = commitMessage.split('\n') if len(commitLines) > 1 and len(commitLines[1]) != 0: fail(commit, 'Invalid commit summary. The summary must be ' \ + 'one line followed by a blank line.') i = 0 for line in commitLines: i = i + 1 if len(line) > 80: fail(commit, 'Line %d is over 80 characters.' % i) passes(commit) def usage(): print('Usage:\n') print(sys.argv[0] + ' --change <change id> --project <project name> ' \ + '--branch <branch> --commit <sha1> --patchset <patchset id>') def fail( commit, message ): command = SSH_COMMAND + FAILURE_SCORE + ' -m \\\"' \ + _shell_escape( FAILURE_MESSAGE + '\n\n' + message) \ + '\\\" ' + commit subprocess.getstatusoutput(command) sys.exit(1) def passes( commit ): command = SSH_COMMAND + PASS_SCORE + ' -m \\\"' \ + _shell_escape(PASS_MESSAGE) + ' \\\" ' + commit subprocess.getstatusoutput(command) def _shell_escape(x): s = '' for c in x: if c in '\n': s = s + '\\\"$\'\\n\'\\\"' else: s = s + c return s if __name__ == '__main__': main()
apache-2.0
garbled1/ansible
lib/ansible/modules/system/authorized_key.py
26
22062
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Brad Olson <[email protected]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'core'} DOCUMENTATION = ''' --- module: authorized_key short_description: Adds or removes an SSH authorized key description: - "Adds or removes SSH authorized keys for particular user accounts" version_added: "0.5" options: user: description: - The username on the remote host whose authorized_keys file will be modified required: true key: description: - The SSH public key(s), as a string or (since 1.9) url (https://github.com/username.keys) required: true path: description: - Alternate path to the authorized_keys file required: false default: "(homedir)+/.ssh/authorized_keys" version_added: "1.2" manage_dir: description: - Whether this module should manage the directory of the authorized key file. If set, the module will create the directory, as well as set the owner and permissions of an existing directory. Be sure to set C(manage_dir=no) if you are using an alternate directory for authorized_keys, as set with C(path), since you could lock yourself out of SSH access. See the example below. required: false choices: [ "yes", "no" ] default: "yes" version_added: "1.2" state: description: - Whether the given key (with the given key_options) should or should not be in the file required: false choices: [ "present", "absent" ] default: "present" key_options: description: - A string of ssh key options to be prepended to the key in the authorized_keys file required: false default: null version_added: "1.4" exclusive: description: - Whether to remove all other non-specified keys from the authorized_keys file. Multiple keys can be specified in a single C(key) string value by separating them by newlines. - This option is not loop aware, so if you use C(with_) , it will be exclusive per iteration of the loop, if you want multiple keys in the file you need to pass them all to C(key) in a single batch as mentioned above. required: false choices: [ "yes", "no" ] default: "no" version_added: "1.9" validate_certs: description: - This only applies if using a https url as the source of the keys. If set to C(no), the SSL certificates will not be validated. - This should only set to C(no) used on personally controlled sites using self-signed certificates as it avoids verifying the source site. - Prior to 2.1 the code worked as if this was set to C(yes). required: false default: "yes" choices: ["yes", "no"] version_added: "2.1" comment: description: - Change the comment on the public key. Rewriting the comment is useful in cases such as fetching it from GitHub or GitLab. - If no comment is specified, the existing comment will be kept. required: false default: None version_added: "2.4" author: "Ansible Core Team" ''' EXAMPLES = ''' - name: Set authorized key took from file authorized_key: user: charlie state: present key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}" - name: Set authorized key took from url authorized_key: user: charlie state: present key: https://github.com/charlie.keys - name: Set authorized key in alternate location authorized_key: user: charlie state: present key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}" path: /etc/ssh/authorized_keys/charlie manage_dir: False - name: Set up multiple authorized keys authorized_key: user: deploy state: present key: '{{ item }}' with_file: - public_keys/doe-jane - public_keys/doe-john - name: Set authorized key defining key options authorized_key: user: charlie state: present key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}" key_options: 'no-port-forwarding,from="10.0.1.1"' - name: Set authorized key without validating the TLS/SSL certificates authorized_key: user: charlie state: present key: https://github.com/user.keys validate_certs: False - name: Set authorized key, removing all the authorized key already set authorized_key: user: root key: '{{ item }}' state: present exclusive: True with_file: - public_keys/doe-jane - name: Set authorized key for user ubuntu copying it from current user authorized_key: user: ubuntu state: present key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}" ''' RETURN = ''' exclusive: description: If the key has been forced to be exclusive or not. returned: success type: boolean sample: False key: description: The key that the module was running against. returned: success type: string sample: https://github.com/user.keys key_option: description: Key options related to the key. returned: success type: string sample: null keyfile: description: Path for authorized key file. returned: success type: string sample: /home/user/.ssh/authorized_keys manage_dir: description: Whether this module managed the directory of the authorized key file. returned: success type: boolean sample: True path: description: Alternate path to the authorized_keys file returned: success type: string sample: null state: description: Whether the given key (with the given key_options) should or should not be in the file returned: success type: string sample: present unique: description: Whether the key is unique returned: success type: boolean sample: false user: description: The username on the remote host whose authorized_keys file will be modified returned: success type: string sample: user validate_certs: description: This only applies if using a https url as the source of the keys. If set to C(no), the SSL certificates will not be validated. returned: success type: boolean sample: true ''' # Makes sure the public key line is present or absent in the user's .ssh/authorized_keys. # # Arguments # ========= # user = username # key = line to add to authorized_keys for user # path = path to the user's authorized_keys file (default: ~/.ssh/authorized_keys) # manage_dir = whether to create, and control ownership of the directory (default: true) # state = absent|present (default: present) # # see example in examples/playbooks import os import pwd import os.path import tempfile import re import shlex from operator import itemgetter from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception from ansible.module_utils.urls import fetch_url class keydict(dict): """ a dictionary that maintains the order of keys as they are added This has become an abuse of the dict interface. Probably should be rewritten to be an entirely custom object with methods instead of bracket-notation. Our requirements are for a data structure that: * Preserves insertion order * Can store multiple values for a single key. The present implementation has the following functions used by the rest of the code: * __setitem__(): to add a key=value. The value can never be disassociated with the key, only new values can be added in addition. * items(): to retrieve the key, value pairs. Other dict methods should work but may be surprising. For instance, there will be multiple keys that are the same in keys() and __getitem__() will return a list of the values that have been set via __setitem__. """ # http://stackoverflow.com/questions/2328235/pythonextend-the-dict-class def __init__(self, *args, **kw): super(keydict, self).__init__(*args, **kw) self.itemlist = list(super(keydict, self).keys()) def __setitem__(self, key, value): self.itemlist.append(key) if key in self: self[key].append(value) else: super(keydict, self).__setitem__(key, [value]) def __iter__(self): return iter(self.itemlist) def keys(self): return self.itemlist def _item_generator(self): indexes = {} for key in self.itemlist: if key in indexes: indexes[key] += 1 else: indexes[key] = 0 yield key, self[key][indexes[key]] def iteritems(self): raise NotImplementedError("Do not use this as it's not available on py3") def items(self): return list(self._item_generator()) def itervalues(self): raise NotImplementedError("Do not use this as it's not available on py3") def values(self): return [item[1] for item in self.items()] def keyfile(module, user, write=False, path=None, manage_dir=True): """ Calculate name of authorized keys file, optionally creating the directories and file, properly setting permissions. :param str user: name of user in passwd file :param bool write: if True, write changes to authorized_keys file (creating directories if needed) :param str path: if not None, use provided path rather than default of '~user/.ssh/authorized_keys' :param bool manage_dir: if True, create and set ownership of the parent dir of the authorized_keys file :return: full path string to authorized_keys for user """ if module.check_mode and path is not None: keysfile = path return keysfile try: user_entry = pwd.getpwnam(user) except KeyError: e = get_exception() if module.check_mode and path is None: module.fail_json(msg="Either user must exist or you must provide full path to key file in check mode") module.fail_json(msg="Failed to lookup user %s: %s" % (user, str(e))) if path is None: homedir = user_entry.pw_dir sshdir = os.path.join(homedir, ".ssh") keysfile = os.path.join(sshdir, "authorized_keys") else: sshdir = os.path.dirname(path) keysfile = path if not write: return keysfile uid = user_entry.pw_uid gid = user_entry.pw_gid if manage_dir: if not os.path.exists(sshdir): os.mkdir(sshdir, int('0700', 8)) if module.selinux_enabled(): module.set_default_selinux_context(sshdir, False) os.chown(sshdir, uid, gid) os.chmod(sshdir, int('0700', 8)) if not os.path.exists(keysfile): basedir = os.path.dirname(keysfile) if not os.path.exists(basedir): os.makedirs(basedir) try: f = open(keysfile, "w") # touches file so we can set ownership and perms finally: f.close() if module.selinux_enabled(): module.set_default_selinux_context(keysfile, False) try: os.chown(keysfile, uid, gid) os.chmod(keysfile, int('0600', 8)) except OSError: pass return keysfile def parseoptions(module, options): ''' reads a string containing ssh-key options and returns a dictionary of those options ''' options_dict = keydict() # ordered dict if options: # the following regex will split on commas while # ignoring those commas that fall within quotes regex = re.compile(r'''((?:[^,"']|"[^"]*"|'[^']*')+)''') parts = regex.split(options)[1:-1] for part in parts: if "=" in part: (key, value) = part.split("=", 1) options_dict[key] = value elif part != ",": options_dict[part] = None return options_dict def parsekey(module, raw_key, rank=None): ''' parses a key, which may or may not contain a list of ssh-key options at the beginning rank indicates the keys original ordering, so that it can be written out in the same order. ''' VALID_SSH2_KEY_TYPES = [ 'ssh-ed25519', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', 'ssh-dss', 'ssh-rsa', ] options = None # connection options key = None # encrypted key string key_type = None # type of ssh key type_index = None # index of keytype in key string|list # remove comment yaml escapes raw_key = raw_key.replace('\#', '#') # split key safely lex = shlex.shlex(raw_key) lex.quotes = [] lex.commenters = '' # keep comment hashes lex.whitespace_split = True key_parts = list(lex) if key_parts and key_parts[0] == '#': # comment line, invalid line, etc. return (raw_key, 'skipped', None, None, rank) for i in range(0, len(key_parts)): if key_parts[i] in VALID_SSH2_KEY_TYPES: type_index = i key_type = key_parts[i] break # check for options if type_index is None: return None elif type_index > 0: options = " ".join(key_parts[:type_index]) # parse the options (if any) options = parseoptions(module, options) # get key after the type index key = key_parts[(type_index + 1)] # set comment to everything after the key if len(key_parts) > (type_index + 1): comment = " ".join(key_parts[(type_index + 2):]) return (key, key_type, options, comment, rank) def readfile(filename): if not os.path.isfile(filename): return '' f = open(filename) try: return f.read() finally: f.close() def parsekeys(module, lines): keys = {} for rank_index, line in enumerate(lines.splitlines(True)): key_data = parsekey(module, line, rank=rank_index) if key_data: # use key as identifier keys[key_data[0]] = key_data else: # for an invalid line, just set the line # dict key to the line so it will be re-output later keys[line] = (line, 'skipped', None, None, rank_index) return keys def writefile(module, filename, content): fd, tmp_path = tempfile.mkstemp('', 'tmp', os.path.dirname(filename)) f = open(tmp_path, "w") try: f.write(content) except IOError: e = get_exception() module.fail_json(msg="Failed to write to file %s: %s" % (tmp_path, str(e))) f.close() module.atomic_move(tmp_path, filename) def serialize(keys): lines = [] new_keys = keys.values() # order the new_keys by their original ordering, via the rank item in the tuple ordered_new_keys = sorted(new_keys, key=itemgetter(4)) for key in ordered_new_keys: try: (keyhash, key_type, options, comment, rank) = key option_str = "" if options: option_strings = [] for option_key, value in options.items(): if value is None: option_strings.append("%s" % option_key) else: option_strings.append("%s=%s" % (option_key, value)) option_str = ",".join(option_strings) option_str += " " # comment line or invalid line, just leave it if not key_type: key_line = key if key_type == 'skipped': key_line = key[0] else: key_line = "%s%s %s %s\n" % (option_str, key_type, keyhash, comment) except Exception: key_line = key lines.append(key_line) return ''.join(lines) def enforce_state(module, params): """ Add or remove key. """ user = params["user"] key = params["key"] path = params.get("path", None) manage_dir = params.get("manage_dir", True) state = params.get("state", "present") key_options = params.get("key_options", None) exclusive = params.get("exclusive", False) comment = params.get("comment", None) error_msg = "Error getting key from: %s" # if the key is a url, request it and use it as key source if key.startswith("http"): try: resp, info = fetch_url(module, key) if info['status'] != 200: module.fail_json(msg=error_msg % key) else: key = resp.read() except Exception: module.fail_json(msg=error_msg % key) # resp.read gives bytes on python3, convert to native string type key = to_native(key, errors='surrogate_or_strict') # extract individual keys into an array, skipping blank lines and comments new_keys = [s for s in key.splitlines() if s and not s.startswith('#')] # check current state -- just get the filename, don't create file do_write = False params["keyfile"] = keyfile(module, user, do_write, path, manage_dir) existing_content = readfile(params["keyfile"]) existing_keys = parsekeys(module, existing_content) # Add a place holder for keys that should exist in the state=present and # exclusive=true case keys_to_exist = [] # we will order any non exclusive new keys higher than all the existing keys, # resulting in the new keys being written to the key file after existing keys, but # in the order of new_keys max_rank_of_existing_keys = len(existing_keys) # Check our new keys, if any of them exist we'll continue. for rank_index, new_key in enumerate(new_keys): parsed_new_key = parsekey(module, new_key, rank=rank_index) if not parsed_new_key: module.fail_json(msg="invalid key specified: %s" % new_key) if key_options is not None: parsed_options = parseoptions(module, key_options) # rank here is the rank in the provided new keys, which may be unrelated to rank in existing_keys parsed_new_key = (parsed_new_key[0], parsed_new_key[1], parsed_options, parsed_new_key[3], parsed_new_key[4]) if comment is not None: parsed_new_key = (parsed_new_key[0], parsed_new_key[1], parsed_new_key[2], comment, parsed_new_key[4]) matched = False non_matching_keys = [] if parsed_new_key[0] in existing_keys: # Then we check if everything (except the rank at index 4) matches, including # the key type and options. If not, we append this # existing key to the non-matching list # We only want it to match everything when the state # is present if parsed_new_key[:4] != existing_keys[parsed_new_key[0]][:4] and state == "present": non_matching_keys.append(existing_keys[parsed_new_key[0]]) else: matched = True # handle idempotent state=present if state == "present": keys_to_exist.append(parsed_new_key[0]) if len(non_matching_keys) > 0: for non_matching_key in non_matching_keys: if non_matching_key[0] in existing_keys: del existing_keys[non_matching_key[0]] do_write = True # new key that didn't exist before. Where should it go in the ordering? if not matched: # We want the new key to be after existing keys if not exclusive (rank > max_rank_of_existing_keys) total_rank = max_rank_of_existing_keys + parsed_new_key[4] # replace existing key tuple with new parsed key with its total rank existing_keys[parsed_new_key[0]] = (parsed_new_key[0], parsed_new_key[1], parsed_new_key[2], parsed_new_key[3], total_rank) do_write = True elif state == "absent": if not matched: continue del existing_keys[parsed_new_key[0]] do_write = True # remove all other keys to honor exclusive # for 'exclusive', make sure keys are written in the order the new keys were if state == "present" and exclusive: to_remove = frozenset(existing_keys).difference(keys_to_exist) for key in to_remove: del existing_keys[key] do_write = True if do_write: filename = keyfile(module, user, do_write, path, manage_dir) new_content = serialize(existing_keys) diff = None if module._diff: diff = { 'before_header': params['keyfile'], 'after_header': filename, 'before': existing_content, 'after': new_content, } params['diff'] = diff if module.check_mode: module.exit_json(changed=True, diff=diff) writefile(module, filename, new_content) params['changed'] = True else: if module.check_mode: module.exit_json(changed=False) return params def main(): module = AnsibleModule( argument_spec=dict( user=dict(required=True, type='str'), key=dict(required=True, type='str'), path=dict(required=False, type='str'), manage_dir=dict(required=False, type='bool', default=True), state=dict(default='present', choices=['absent', 'present']), key_options=dict(required=False, type='str'), unique=dict(default=False, type='bool'), exclusive=dict(default=False, type='bool'), comment=dict(required=False, default=None, type='str'), validate_certs=dict(default=True, type='bool'), ), supports_check_mode=True ) results = enforce_state(module, module.params) module.exit_json(**results) if __name__ == '__main__': main()
gpl-3.0
apache/allura
Allura/allura/tasks/index_tasks.py
2
5711
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. from __future__ import unicode_literals from __future__ import absolute_import import sys import logging from contextlib import contextmanager from tg import app_globals as g from tg import tmpl_context as c from allura.lib import helpers as h from allura.lib.decorators import task from allura.lib.exceptions import CompoundError from allura.lib.solr import make_solr_from_config import six log = logging.getLogger(__name__) def __get_solr(solr_hosts=None): return make_solr_from_config(solr_hosts) if solr_hosts else g.solr def __add_objects(objects, solr_hosts=None): solr_instance = __get_solr(solr_hosts) solr_instance.add([obj.solarize() for obj in objects]) def __del_objects(object_solr_ids): solr_instance = __get_solr() solr_query = 'id:({0})'.format(' || '.join(object_solr_ids)) solr_instance.delete(q=solr_query) def check_for_dirty_ming_records(msg_prefix, ming_sessions=None): """ A debugging helper to diagnose issues with code that unintentionally modifies records, causing them to be written back to mongo (potentially clobbering values written by a parallel task/request) """ if ming_sessions is None: from allura.model import main_orm_session, artifact_orm_session, project_orm_session ming_sessions = [main_orm_session, artifact_orm_session, project_orm_session] for sess in ming_sessions: dirty_objects = list(sess.uow.dirty) if dirty_objects: log.warning(msg_prefix + ' changed objects, causing writes back to mongo: %s', dirty_objects) @task def add_projects(project_ids): from allura.model.project import Project projects = Project.query.find(dict(_id={'$in': project_ids})).all() __add_objects(projects) check_for_dirty_ming_records('add_projects task') @task def del_projects(project_solr_ids): __del_objects(project_solr_ids) @task def add_users(user_ids): from allura.model import User users = User.query.find(dict(_id={'$in': user_ids})).all() __add_objects(users) @task def del_users(user_solr_ids): __del_objects(user_solr_ids) @task def add_artifacts(ref_ids, update_solr=True, update_refs=True, solr_hosts=None): ''' Add the referenced artifacts to SOLR and shortlinks. :param solr_hosts: a list of solr hosts to use instead of the defaults :type solr_hosts: [str] ''' from allura import model as M from allura.lib.search import find_shortlinks exceptions = [] solr_updates = [] with _indexing_disabled(M.session.artifact_orm_session._get()): for ref in M.ArtifactReference.query.find(dict(_id={'$in': ref_ids})): try: artifact = ref.artifact if artifact is None: continue # c.app is normally set, so keep using it. During a reindex its not though, so set it from artifact with h.push_config(c, app=getattr(c, 'app', None) or artifact.app): s = artifact.solarize() if s is None: continue if update_solr: solr_updates.append(s) if update_refs: if isinstance(artifact, M.Snapshot): continue # Find shortlinks in the raw text, not the escaped html # created by the `solarize()`. link_text = artifact.index().get('text') or '' shortlinks = find_shortlinks(link_text) ref.references = [link.ref_id for link in shortlinks] except Exception: log.error('Error indexing artifact %s', ref._id) exceptions.append(sys.exc_info()) __get_solr(solr_hosts).add(solr_updates) if len(exceptions) == 1: six.reraise(exceptions[0][0], exceptions[0][1], exceptions[0][2]) if exceptions: raise CompoundError(*exceptions) check_for_dirty_ming_records('add_artifacts task') @task def del_artifacts(ref_ids): from allura import model as M if ref_ids: __del_objects(ref_ids) M.ArtifactReference.query.remove(dict(_id={'$in': ref_ids})) M.Shortlink.query.remove(dict(ref_id={'$in': ref_ids})) @task def solr_del_project_artifacts(project_id): g.solr.delete(q='project_id_s:%s' % project_id) @task def commit(): g.solr.commit() @task def solr_del_tool(project_id, mount_point_s): g.solr.delete(q='project_id_s:"%s" AND mount_point_s:"%s"' % (project_id, mount_point_s)) @contextmanager def _indexing_disabled(session): session.disable_index = session.skip_mod_date = True try: yield session finally: session.disable_index = session.skip_mod_date = False
apache-2.0
Abi1ity/uniclust2.0
SQLAlchemy-0.9.9/test/orm/inheritance/_poly_fixtures.py
25
11682
from sqlalchemy import Integer, String, ForeignKey, func, desc, and_, or_ from sqlalchemy.orm import interfaces, relationship, mapper, \ clear_mappers, create_session, joinedload, joinedload_all, \ subqueryload, subqueryload_all, polymorphic_union, aliased,\ class_mapper from sqlalchemy import exc as sa_exc from sqlalchemy.engine import default from sqlalchemy.testing import AssertsCompiledSQL, fixtures from sqlalchemy import testing from sqlalchemy.testing.schema import Table, Column from sqlalchemy.testing import assert_raises, eq_ class Company(fixtures.ComparableEntity): pass class Person(fixtures.ComparableEntity): pass class Engineer(Person): pass class Manager(Person): pass class Boss(Manager): pass class Machine(fixtures.ComparableEntity): pass class MachineType(fixtures.ComparableEntity): pass class Paperwork(fixtures.ComparableEntity): pass class _PolymorphicFixtureBase(fixtures.MappedTest, AssertsCompiledSQL): run_inserts = 'once' run_setup_mappers = 'once' run_deletes = None @classmethod def define_tables(cls, metadata): global people, engineers, managers, boss global companies, paperwork, machines companies = Table('companies', metadata, Column('company_id', Integer, primary_key=True, test_needs_autoincrement=True), Column('name', String(50))) people = Table('people', metadata, Column('person_id', Integer, primary_key=True, test_needs_autoincrement=True), Column('company_id', Integer, ForeignKey('companies.company_id')), Column('name', String(50)), Column('type', String(30))) engineers = Table('engineers', metadata, Column('person_id', Integer, ForeignKey('people.person_id'), primary_key=True), Column('status', String(30)), Column('engineer_name', String(50)), Column('primary_language', String(50))) machines = Table('machines', metadata, Column('machine_id', Integer, primary_key=True, test_needs_autoincrement=True), Column('name', String(50)), Column('engineer_id', Integer, ForeignKey('engineers.person_id'))) managers = Table('managers', metadata, Column('person_id', Integer, ForeignKey('people.person_id'), primary_key=True), Column('status', String(30)), Column('manager_name', String(50))) boss = Table('boss', metadata, Column('boss_id', Integer, ForeignKey('managers.person_id'), primary_key=True), Column('golf_swing', String(30))) paperwork = Table('paperwork', metadata, Column('paperwork_id', Integer, primary_key=True, test_needs_autoincrement=True), Column('description', String(50)), Column('person_id', Integer, ForeignKey('people.person_id'))) @classmethod def insert_data(cls): cls.e1 = e1 = Engineer( name="dilbert", engineer_name="dilbert", primary_language="java", status="regular engineer", paperwork=[ Paperwork(description="tps report #1"), Paperwork(description="tps report #2")], machines=[ Machine(name='IBM ThinkPad'), Machine(name='IPhone')]) cls.e2 = e2 = Engineer( name="wally", engineer_name="wally", primary_language="c++", status="regular engineer", paperwork=[ Paperwork(description="tps report #3"), Paperwork(description="tps report #4")], machines=[Machine(name="Commodore 64")]) cls.b1 = b1 = Boss( name="pointy haired boss", golf_swing="fore", manager_name="pointy", status="da boss", paperwork=[Paperwork(description="review #1")]) cls.m1 = m1 = Manager( name="dogbert", manager_name="dogbert", status="regular manager", paperwork=[ Paperwork(description="review #2"), Paperwork(description="review #3")]) cls.e3 = e3 = Engineer( name="vlad", engineer_name="vlad", primary_language="cobol", status="elbonian engineer", paperwork=[ Paperwork(description='elbonian missive #3')], machines=[ Machine(name="Commodore 64"), Machine(name="IBM 3270")]) cls.c1 = c1 = Company(name="MegaCorp, Inc.") c1.employees = [e1, e2, b1, m1] cls.c2 = c2 = Company(name="Elbonia, Inc.") c2.employees = [e3] sess = create_session() sess.add(c1) sess.add(c2) sess.flush() sess.expunge_all() cls.all_employees = [e1, e2, b1, m1, e3] cls.c1_employees = [e1, e2, b1, m1] cls.c2_employees = [e3] def _company_with_emps_machines_fixture(self): fixture = self._company_with_emps_fixture() fixture[0].employees[0].machines = [ Machine(name="IBM ThinkPad"), Machine(name="IPhone"), ] fixture[0].employees[1].machines = [ Machine(name="Commodore 64") ] return fixture def _company_with_emps_fixture(self): return [ Company( name="MegaCorp, Inc.", employees=[ Engineer( name="dilbert", engineer_name="dilbert", primary_language="java", status="regular engineer" ), Engineer( name="wally", engineer_name="wally", primary_language="c++", status="regular engineer"), Boss( name="pointy haired boss", golf_swing="fore", manager_name="pointy", status="da boss"), Manager( name="dogbert", manager_name="dogbert", status="regular manager"), ]), Company( name="Elbonia, Inc.", employees=[ Engineer( name="vlad", engineer_name="vlad", primary_language="cobol", status="elbonian engineer") ]) ] def _emps_wo_relationships_fixture(self): return [ Engineer( name="dilbert", engineer_name="dilbert", primary_language="java", status="regular engineer"), Engineer( name="wally", engineer_name="wally", primary_language="c++", status="regular engineer"), Boss( name="pointy haired boss", golf_swing="fore", manager_name="pointy", status="da boss"), Manager( name="dogbert", manager_name="dogbert", status="regular manager"), Engineer( name="vlad", engineer_name="vlad", primary_language="cobol", status="elbonian engineer") ] @classmethod def setup_mappers(cls): mapper(Company, companies, properties={ 'employees':relationship( Person, order_by=people.c.person_id)}) mapper(Machine, machines) person_with_polymorphic,\ manager_with_polymorphic = cls._get_polymorphics() mapper(Person, people, with_polymorphic=person_with_polymorphic, polymorphic_on=people.c.type, polymorphic_identity='person', order_by=people.c.person_id, properties={ 'paperwork':relationship( Paperwork, order_by=paperwork.c.paperwork_id)}) mapper(Engineer, engineers, inherits=Person, polymorphic_identity='engineer', properties={ 'machines':relationship( Machine, order_by=machines.c.machine_id)}) mapper(Manager, managers, with_polymorphic=manager_with_polymorphic, inherits=Person, polymorphic_identity='manager') mapper(Boss, boss, inherits=Manager, polymorphic_identity='boss') mapper(Paperwork, paperwork) class _Polymorphic(_PolymorphicFixtureBase): select_type = "" @classmethod def _get_polymorphics(cls): return None, None class _PolymorphicPolymorphic(_PolymorphicFixtureBase): select_type = "Polymorphic" @classmethod def _get_polymorphics(cls): return '*', '*' class _PolymorphicUnions(_PolymorphicFixtureBase): select_type = "Unions" @classmethod def _get_polymorphics(cls): people, engineers, managers, boss = \ cls.tables.people, cls.tables.engineers, \ cls.tables.managers, cls.tables.boss person_join = polymorphic_union({ 'engineer':people.join(engineers), 'manager':people.join(managers)}, None, 'pjoin') manager_join = people.join(managers).outerjoin(boss) person_with_polymorphic = ( [Person, Manager, Engineer], person_join) manager_with_polymorphic = ('*', manager_join) return person_with_polymorphic,\ manager_with_polymorphic class _PolymorphicAliasedJoins(_PolymorphicFixtureBase): select_type = "AliasedJoins" @classmethod def _get_polymorphics(cls): people, engineers, managers, boss = \ cls.tables.people, cls.tables.engineers, \ cls.tables.managers, cls.tables.boss person_join = people \ .outerjoin(engineers) \ .outerjoin(managers) \ .select(use_labels=True) \ .alias('pjoin') manager_join = people \ .join(managers) \ .outerjoin(boss) \ .select(use_labels=True) \ .alias('mjoin') person_with_polymorphic = ( [Person, Manager, Engineer], person_join) manager_with_polymorphic = ('*', manager_join) return person_with_polymorphic,\ manager_with_polymorphic class _PolymorphicJoins(_PolymorphicFixtureBase): select_type = "Joins" @classmethod def _get_polymorphics(cls): people, engineers, managers, boss = \ cls.tables.people, cls.tables.engineers, \ cls.tables.managers, cls.tables.boss person_join = people.outerjoin(engineers).outerjoin(managers) manager_join = people.join(managers).outerjoin(boss) person_with_polymorphic = ( [Person, Manager, Engineer], person_join) manager_with_polymorphic = ('*', manager_join) return person_with_polymorphic,\ manager_with_polymorphic
bsd-3-clause
atheed/servo
tests/wpt/css-tests/tools/pywebsocket/src/example/echo_wsh.py
494
2197
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. _GOODBYE_MESSAGE = u'Goodbye' def web_socket_do_extra_handshake(request): # This example handler accepts any request. See origin_check_wsh.py for how # to reject access from untrusted scripts based on origin value. pass # Always accept. def web_socket_transfer_data(request): while True: line = request.ws_stream.receive_message() if line is None: return if isinstance(line, unicode): request.ws_stream.send_message(line, binary=False) if line == _GOODBYE_MESSAGE: return else: request.ws_stream.send_message(line, binary=True) # vi:sts=4 sw=4 et
mpl-2.0
qedi-r/home-assistant
setup.py
2
2275
#!/usr/bin/env python3 """Home Assistant setup script.""" from datetime import datetime as dt from setuptools import setup, find_packages import homeassistant.const as hass_const PROJECT_NAME = "Home Assistant" PROJECT_PACKAGE_NAME = "homeassistant" PROJECT_LICENSE = "Apache License 2.0" PROJECT_AUTHOR = "The Home Assistant Authors" PROJECT_COPYRIGHT = " 2013-{}, {}".format(dt.now().year, PROJECT_AUTHOR) PROJECT_URL = "https://home-assistant.io/" PROJECT_EMAIL = "[email protected]" PROJECT_GITHUB_USERNAME = "home-assistant" PROJECT_GITHUB_REPOSITORY = "home-assistant" PYPI_URL = "https://pypi.python.org/pypi/{}".format(PROJECT_PACKAGE_NAME) GITHUB_PATH = "{}/{}".format(PROJECT_GITHUB_USERNAME, PROJECT_GITHUB_REPOSITORY) GITHUB_URL = "https://github.com/{}".format(GITHUB_PATH) DOWNLOAD_URL = "{}/archive/{}.zip".format(GITHUB_URL, hass_const.__version__) PROJECT_URLS = { "Bug Reports": "{}/issues".format(GITHUB_URL), "Dev Docs": "https://developers.home-assistant.io/", "Discord": "https://discordapp.com/invite/c5DvZ4e", "Forum": "https://community.home-assistant.io/", } PACKAGES = find_packages(exclude=["tests", "tests.*"]) REQUIRES = [ "aiohttp==3.6.1", "astral==1.10.1", "async_timeout==3.0.1", "attrs==19.3.0", "bcrypt==3.1.7", "certifi>=2019.9.11", 'contextvars==2.4;python_version<"3.7"', "importlib-metadata==0.23", "jinja2>=2.10.3", "PyJWT==1.7.1", # PyJWT has loose dependency. We want the latest one. "cryptography==2.8", "pip>=8.0.3", "python-slugify==4.0.0", "pytz>=2019.03", "pyyaml==5.1.2", "requests==2.22.0", "ruamel.yaml==0.15.100", "voluptuous==0.11.7", "voluptuous-serialize==2.3.0", ] MIN_PY_VERSION = ".".join(map(str, hass_const.REQUIRED_PYTHON_VER)) setup( name=PROJECT_PACKAGE_NAME, version=hass_const.__version__, url=PROJECT_URL, download_url=DOWNLOAD_URL, project_urls=PROJECT_URLS, author=PROJECT_AUTHOR, author_email=PROJECT_EMAIL, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIRES, python_requires=">={}".format(MIN_PY_VERSION), test_suite="tests", entry_points={"console_scripts": ["hass = homeassistant.__main__:main"]}, )
apache-2.0
Yemsheng/collect-exceptions
collect_exceptions/contrib/django/models.py
1
3768
import sys import logging log = logging.getLogger('django') import traceback from django.conf import settings as django_settings def default_exception_collector(exception_str): log.error(exception_str) def my_exception_handler(request, **kwargs): try: log.debug(dir(request)) request_info = '%s %s%s\n' % ( request.method, request.get_host(), request.get_full_path()) if request.body: request_info = request_info + request.body + '\n' type_, value, tb = sys.exc_info() exc_info = traceback.format_exception(type_, value, tb) einfo = ''.join(exc_info) einfo = request_info + einfo log.warning(einfo) django_settings.COLLECT_EXCEPTIONS_CONFIG['exception_collector'](einfo) except Exception, e: log.warning(e) def register_handlers(): from django.core.signals import got_request_exception # Connect to Django's internal signal handler got_request_exception.connect(my_exception_handler, weak=False) log.info('If Celery is installed, register a signal handler') if 'djcelery' in django_settings.INSTALLED_APPS: try: # Celery < 2.5? is not supported from collect_exceptions.contrib.celery import register_signal except ImportError: log.warning('Failed to install Celery error handler') else: try: register_signal() except Exception: log.warning('Failed to install Celery error handler') def is_config_ok(): if not getattr(django_settings, 'COLLECT_EXCEPTIONS_CONFIG', None): log.warning('no COLLECT_EXCEPTIONS_CONFIG in settings return False') return False if not django_settings.COLLECT_EXCEPTIONS_CONFIG.get('EXCEPTION_COLLECTOR', None): log.warning( 'no EXCEPTION_COLLECTOR in COLLECT_EXCEPTIONS_CONFIG return False') return False return True def get_mod_func(callback): try: dot = callback.rindex('.') except ValueError: return callback, '' return callback[:dot], callback[dot + 1:] def import_module(name): log.debug('import_module name = %s' % name) __import__(name) return sys.modules[name] def handle_config(): EXCEPTION_COLLECTOR = django_settings.COLLECT_EXCEPTIONS_CONFIG[ 'EXCEPTION_COLLECTOR'] mod_name, func_name = get_mod_func(EXCEPTION_COLLECTOR) log.info('mod_name = %s func_name = %s' % (mod_name, func_name)) try: mod = import_module(mod_name) except Exception, e: log.warning(e) log.warning('import_module except return False') return False else: try: lookup_func = getattr(mod, func_name) if not callable(lookup_func): log.error( "Could not import %s.%s. Func is not callable." % (mod_name, func_name)) return False django_settings.COLLECT_EXCEPTIONS_CONFIG[ 'exception_collector'] = lookup_func except AttributeError: log.error( "Could not import %s.%s. Func is not callable." % (mod_name, func_name)) return False log.info('handle_config return True') return True if is_config_ok(): ret = handle_config() if not ret: log.error('collect exceptions package config wrong') log.error('check your settings') else: if not getattr(django_settings, 'COLLECT_EXCEPTIONS_CONFIG', None): django_settings.COLLECT_EXCEPTIONS_CONFIG = {} django_settings.COLLECT_EXCEPTIONS_CONFIG[ 'exception_collector'] = default_exception_collector register_handlers()
bsd-3-clause
OSSESAC/odoopubarquiluz
addons/account/wizard/account_report_common_partner.py
56
2031
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## from openerp.osv import fields, osv class account_common_partner_report(osv.osv_memory): _name = 'account.common.partner.report' _description = 'Account Common Partner Report' _inherit = "account.common.report" _columns = { 'result_selection': fields.selection([('customer','Receivable Accounts'), ('supplier','Payable Accounts'), ('customer_supplier','Receivable and Payable Accounts')], "Partner's", required=True), } _defaults = { 'result_selection': 'customer', } def pre_print_report(self, cr, uid, ids, data, context=None): if context is None: context = {} data['form'].update(self.read(cr, uid, ids, ['result_selection'], context=context)[0]) return data account_common_partner_report() #vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
agpl-3.0
GoogleCloudPlatform/gsutil
gslib/addlhelp/wildcards.py
1
9242
# -*- coding: utf-8 -*- # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Additional help about wildcards.""" from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals from gslib.help_provider import HelpProvider _DETAILED_HELP_TEXT = (""" <B>DESCRIPTION</B> gsutil supports URI wildcards. For example, the command: gsutil cp gs://bucket/data/abc* . copies all objects that start with gs://bucket/data/abc followed by any number of characters within that subdirectory. NOTE: Some command shells expand wildcard matches prior to running the gsutil command; however, most shells do not support recursive wildcards (``**``). You can skip command shell wildcard expansion and instead use gsutil's wildcarding support in such shells by single-quoting (on Linux) or double-quoting (on Windows) the argument. For example: gsutil cp 'data/abc**' gs://bucket <B>DIRECTORY BY DIRECTORY VS RECURSIVE WILDCARDS</B> The ``*`` wildcard only matches up to the end of a path within a subdirectory. For example, if your bucket contains objects named gs://bucket/data/abcd, gs://bucket/data/abcdef, and gs://bucket/data/abcxyx, as well as an object in a sub-directory (gs://bucket/data/abc/def) the above gsutil cp command would match the first 3 object names but not the last one. If you want matches to span directory boundaries, use a ``**`` wildcard: gsutil cp gs://bucket/data/abc** . matches all four objects above. Note that gsutil supports the same wildcards for both object and file names. Thus, for example: gsutil cp data/abc* gs://bucket matches all names in the local file system. <B>BUCKET WILDCARDS</B> You can specify wildcards for bucket names within a single project. For example: gsutil ls gs://data*.example.com lists the contents of all buckets whose name starts with ``data`` and ends with ``.example.com`` in the default project. The -p option can be used to specify a project other than the default. For example: gsutil ls -p other-project gs://data*.example.com You can also combine bucket and object name wildcards. For example, this command removes all ``.txt`` files in any of your Google Cloud Storage buckets in the default project: gsutil rm gs://*/**.txt <B>OTHER WILDCARD CHARACTERS</B> In addition to ``*``, you can use these wildcards: ? Matches a single character. For example "gs://bucket/??.txt" only matches objects with two characters followed by .txt. [chars] Match any of the specified characters. For example ``gs://bucket/[aeiou].txt`` matches objects that contain a single vowel character followed by ``.txt``. [char range] Match any of the range of characters. For example ``gs://bucket/[a-m].txt`` matches objects that contain letters a, b, c, ... or m, and end with ``.txt``. You can combine wildcards to provide more powerful matches, for example: gs://bucket/[a-m]??.j*g <B>POTENTIALLY SURPRISING BEHAVIOR WHEN USING WILDCARDS</B> There are a couple of ways that using wildcards can result in surprising behavior: 1. Shells (like bash and zsh) can attempt to expand wildcards before passing the arguments to gsutil. If the wildcard was supposed to refer to a cloud object, this can result in surprising "Not found" errors (e.g., if the shell tries to expand the wildcard ``gs://my-bucket/*`` on the local machine, matching no local files, and failing the command). Note that some shells include additional characters in their wildcard character sets. For example, if you use zsh with the extendedglob option enabled it treats ``#`` as a special character, which conflicts with that character's use in referencing versioned objects (see `Restore noncurrent object versions <https://cloud.google.com/storage/docs/using-versioned-objects#restore>`_ for an example). To avoid these problems, surround the wildcarded expression with single quotes (on Linux) or double quotes (on Windows). 2. Attempting to specify a filename that contains wildcard characters won't work, because gsutil tries to expand the wildcard characters rather than using them as literal characters. For example, running the command: gsutil cp './file[1]' gs://my-bucket causes gsutil to try to match the ``[1]`` part as a wildcard. There's an open issue to support a "raw" mode for gsutil to provide a way to work with file names that contain wildcard characters, but until / unless that support is implemented there's no really good way to use gsutil with such file names. You could use a wildcard to name such files, for example replacing the above command with: gsutil cp './file*1*' gs://my-bucket but that approach may be difficult to use in general. <B>DIFFERENT BEHAVIOR FOR "DOT" FILES IN LOCAL FILE SYSTEM</B> Per standard Unix behavior, the wildcard ``*`` only matches files that don't start with a ``.`` character (to avoid confusion with the ``.`` and ``..`` directories present in all Unix directories). gsutil provides this same behavior when using wildcards over a file system URI, but does not provide this behavior over cloud URIs. For example, the following command copies all objects from gs://bucket1 to gs://bucket2: gsutil cp gs://bucket1/* gs://bucket2 but the following command copies only files that don't start with a ``.`` from the directory ``dir`` to gs://bucket1: gsutil cp dir/* gs://bucket1 <B>EFFICIENCY CONSIDERATION: USING WILDCARDS OVER MANY OBJECTS</B> It is more efficient, faster, and less network traffic-intensive to use wildcards that have a non-wildcard object-name prefix, like: gs://bucket/abc*.txt than it is to use wildcards as the first part of the object name, like: gs://bucket/*abc.txt This is because the request for ``gs://bucket/abc*.txt`` asks the server to send back the subset of results whose object name start with ``abc`` at the bucket root, and then gsutil filters the result list for objects whose name ends with ``.txt``. In contrast, ``gs://bucket/*abc.txt`` asks the server for the complete list of objects in the bucket root, and then filters for those objects whose name ends with ``abc.txt``. This efficiency consideration becomes increasingly noticeable when you use buckets containing thousands or more objects. It is sometimes possible to set up the names of your objects to fit with expected wildcard matching patterns, to take advantage of the efficiency of doing server-side prefix requests. See, for example "gsutil help prod" for a concrete use case example. <B>EFFICIENCY CONSIDERATION: USING MID-PATH WILDCARDS</B> Suppose you have a bucket with these objects: gs://bucket/obj1 gs://bucket/obj2 gs://bucket/obj3 gs://bucket/obj4 gs://bucket/dir1/obj5 gs://bucket/dir2/obj6 If you run the command: gsutil ls gs://bucket/*/obj5 gsutil performs a /-delimited top-level bucket listing and then one bucket listing for each subdirectory, for a total of 3 bucket listings: GET /bucket/?delimiter=/ GET /bucket/?prefix=dir1/obj5&delimiter=/ GET /bucket/?prefix=dir2/obj5&delimiter=/ The more bucket listings your wildcard requires, the slower and more expensive it becomes. The number of bucket listings required grows as: - the number of wildcard components (e.g., "gs://bucket/a??b/c*/*/d" has 3 wildcard components); - the number of subdirectories that match each component; and - the number of results (pagination is implemented using one GET request per 1000 results, specifying markers for each). If you want to use a mid-path wildcard, you might try instead using a recursive wildcard, for example: gsutil ls gs://bucket/**/obj5 This matches more objects than ``gs://bucket/*/obj5`` (since it spans directories), but is implemented using a delimiter-less bucket listing request (which means fewer bucket requests, though it lists the entire bucket and filters locally, so that could require a non-trivial amount of network traffic). """) class CommandOptions(HelpProvider): """Additional help about wildcards.""" # Help specification. See help_provider.py for documentation. help_spec = HelpProvider.HelpSpec( help_name='wildcards', help_name_aliases=['wildcard', '*', '**'], help_type='additional_help', help_one_line_summary='Wildcard Names', help_text=_DETAILED_HELP_TEXT, subcommand_help_text={}, )
apache-2.0
djo938/supershell
pyshell/arg/test/decorator_test.py
3
5387
#!/usr/bin/env python -t # -*- coding: utf-8 -*- # Copyright (C) 2015 Jonathan Delvaux <[email protected]> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import pytest from pyshell.arg.argfeeder import ArgFeeder from pyshell.arg.checker.argchecker import ArgChecker from pyshell.arg.checker.defaultvalue import DefaultValueChecker from pyshell.arg.decorator import FunAnalyser from pyshell.arg.decorator import shellMethod from pyshell.arg.exception import DecoratorException class TestDecorator(object): def test_funAnalyzer(self): # init limit case with pytest.raises(DecoratorException): FunAnalyser(None) with pytest.raises(DecoratorException): FunAnalyser(52) with pytest.raises(DecoratorException): FunAnalyser("plop") # empty fun def toto(): pass fa = FunAnalyser(toto) assert fa is not None assert fa.lendefault == 0 with pytest.raises(DecoratorException): fa.hasDefault("plop") with pytest.raises(DecoratorException): fa.getDefault("plop") with pytest.raises(DecoratorException): fa.setCheckerDefault("plop", "plip") # non empty fun def toto(plop): pass fa = FunAnalyser(toto) assert fa is not None assert fa.lendefault == 0 assert not fa.hasDefault("plop") with pytest.raises(DecoratorException): fa.getDefault("plop") assert fa.setCheckerDefault("plop", "plip") == "plip" # non empty fun def toto(plop="plap"): pass fa = FunAnalyser(toto) assert fa is not None assert fa.lendefault == 1 assert fa.hasDefault("plop") assert fa.getDefault("plop") == "plap" assert fa.setCheckerDefault("plop", ArgChecker()).getDefaultValue() == "plap" def toto(a, plop="plap"): pass fa = FunAnalyser(toto) assert fa is not None assert fa.lendefault == 1 assert fa.hasDefault("plop") assert fa.getDefault("plop") == "plap" assert fa.setCheckerDefault("plop", ArgChecker()).getDefaultValue() == "plap" def test_decorator(self): # try to send no argchecker in the list exception = False try: shellMethod(ghaaa="toto") except DecoratorException: exception = True assert exception exception = False try: shellMethod(ghaaa=ArgChecker()) except DecoratorException: exception = True assert not exception # try to set two decorator on the same function exception = False try: @shellMethod(plop=ArgChecker()) @shellMethod(plop=ArgChecker()) def tete(plop="a"): pass except DecoratorException: exception = True assert exception # try to set two key with the same name # will be a python syntax error, no need to check # set arg checker on unexistant param exception = False try: @shellMethod(b=ArgChecker(), a=ArgChecker()) def titi(a): pass except DecoratorException: exception = True assert exception # TODO try to not bind param without default value """exception = False try: @shellMethod() def tata(plop): pass except DecoratorException: exception = True self.assertTrue(exception)""" exception = False try: @shellMethod() def tyty(plop=5): pass except DecoratorException: exception = True assert not exception # make a test with class and self exception = False try: class Plop(object): @shellMethod() def toto(self): pass except DecoratorException: exception = True assert not exception # faire des tests qui aboutissent et verifier les donnees generees @shellMethod(a=ArgChecker()) def toto(a, b=5): pass assert isinstance(toto.checker, ArgFeeder) assert "a" in toto.checker.arg_type_list assert isinstance(toto.checker.arg_type_list["a"], ArgChecker) assert "b" in toto.checker.arg_type_list assert isinstance(toto.checker.arg_type_list["b"], DefaultValueChecker) k = list(toto.checker.arg_type_list.keys()) assert k[0] == "a" and k[1] == "b" # TODO test with a class meth static
gpl-3.0
arista-eosplus/ansible
lib/ansible/plugins/shell/sh.py
69
4222
# (c) 2014, Chris Church <[email protected]> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.module_utils.six.moves import shlex_quote from ansible.plugins.shell import ShellBase class ShellModule(ShellBase): # Common shell filenames that this plugin handles. # Note: sh is the default shell plugin so this plugin may also be selected # if the filename is not listed in any Shell plugin. COMPATIBLE_SHELLS = frozenset(('sh', 'zsh', 'bash', 'dash', 'ksh')) # Family of shells this has. Must match the filename without extension SHELL_FAMILY = 'sh' # How to end lines in a python script one-liner _SHELL_EMBEDDED_PY_EOL = '\n' _SHELL_REDIRECT_ALLNULL = '> /dev/null 2>&1' _SHELL_AND = '&&' _SHELL_OR = '||' _SHELL_SUB_LEFT = '"`' _SHELL_SUB_RIGHT = '`"' _SHELL_GROUP_LEFT = '(' _SHELL_GROUP_RIGHT = ')' def checksum(self, path, python_interp): # The following test needs to be SH-compliant. BASH-isms will # not work if /bin/sh points to a non-BASH shell. # # In the following test, each condition is a check and logical # comparison (|| or &&) that sets the rc value. Every check is run so # the last check in the series to fail will be the rc that is # returned. # # If a check fails we error before invoking the hash functions because # hash functions may successfully take the hash of a directory on BSDs # (UFS filesystem?) which is not what the rest of the ansible code # expects # # If all of the available hashing methods fail we fail with an rc of # 0. This logic is added to the end of the cmd at the bottom of this # function. # Return codes: # checksum: success! # 0: Unknown error # 1: Remote file does not exist # 2: No read permissions on the file # 3: File is a directory # 4: No python interpreter # Quoting gets complex here. We're writing a python string that's # used by a variety of shells on the remote host to invoke a python # "one-liner". shell_escaped_path = shlex_quote(path) test = "rc=flag; [ -r %(p)s ] %(shell_or)s rc=2; [ -f %(p)s ] %(shell_or)s rc=1; [ -d %(p)s ] %(shell_and)s rc=3; %(i)s -V 2>/dev/null %(shell_or)s rc=4; [ x\"$rc\" != \"xflag\" ] %(shell_and)s echo \"${rc} \"%(p)s %(shell_and)s exit 0" % dict(p=shell_escaped_path, i=python_interp, shell_and=self._SHELL_AND, shell_or=self._SHELL_OR) # NOQA csums = [ u"({0} -c 'import hashlib; BLOCKSIZE = 65536; hasher = hashlib.sha1();{2}afile = open(\"'{1}'\", \"rb\"){2}buf = afile.read(BLOCKSIZE){2}while len(buf) > 0:{2}\thasher.update(buf){2}\tbuf = afile.read(BLOCKSIZE){2}afile.close(){2}print(hasher.hexdigest())' 2>/dev/null)".format(python_interp, shell_escaped_path, self._SHELL_EMBEDDED_PY_EOL), # NOQA Python > 2.4 (including python3) u"({0} -c 'import sha; BLOCKSIZE = 65536; hasher = sha.sha();{2}afile = open(\"'{1}'\", \"rb\"){2}buf = afile.read(BLOCKSIZE){2}while len(buf) > 0:{2}\thasher.update(buf){2}\tbuf = afile.read(BLOCKSIZE){2}afile.close(){2}print(hasher.hexdigest())' 2>/dev/null)".format(python_interp, shell_escaped_path, self._SHELL_EMBEDDED_PY_EOL), # NOQA Python == 2.4 ] cmd = (" %s " % self._SHELL_OR).join(csums) cmd = "%s; %s %s (echo \'0 \'%s)" % (test, cmd, self._SHELL_OR, shell_escaped_path) return cmd
gpl-3.0
dfeyer/TranslationTypo3Org
local_apps/pootle_misc/templatetags/baseurl.py
6
1046
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2009 Zuza Software Foundation # # This file is part of Pootle. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. from django import template from django.template.defaultfilters import stringfilter from pootle_misc.baseurl import l, m, abs_l register = template.Library() register.filter('l', stringfilter(l)) register.filter('m', stringfilter(m)) register.filter('abs_l', stringfilter(abs_l))
gpl-2.0
hanzorama/magenta
magenta/common/testing_lib.py
3
2751
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Testing support code.""" # internal imports import numpy as np from google.protobuf import text_format def assert_set_equality(test_case, expected, actual): """Asserts that two lists are equal without order. Given two lists, treat them as sets and test equality. This function only requires an __eq__ method to be defined on the objects, and not __hash__ which set comparison requires. This function removes the burden of defining a __hash__ method just for testing. This function calls into tf.test.TestCase.assert* methods and behaves like a test assert. The function returns if `expected` and `actual` contain the same objects regardless of ordering. Note, this is an O(n^2) operation and is not suitable for large lists. Args: test_case: A tf.test.TestCase instance from a test. expected: A list of objects. actual: A list of objects. """ actual_found = np.zeros(len(actual), dtype=bool) for expected_obj in expected: found = False for i, actual_obj in enumerate(actual): if expected_obj == actual_obj: actual_found[i] = True found = True break if not found: test_case.fail('Expected %s not found in actual collection' % expected_obj) if not np.all(actual_found): test_case.fail('Actual objects %s not found in expected collection' % np.array(actual)[np.invert(actual_found)]) def parse_test_proto(proto_type, proto_string): instance = proto_type() text_format.Merge(proto_string, instance) return instance class MockStringProto(object): """Provides common methods for a protocol buffer object. Wraps a single string value. This makes testing equality easy. """ def __init__(self, string=''): self.string = string @staticmethod def FromString(string): # pylint: disable=invalid-name return MockStringProto(string) def SerializeToString(self): # pylint: disable=invalid-name return 'serialized:' + self.string def __eq__(self, other): return isinstance(other, MockStringProto) and self.string == other.string def __hash__(self): return hash(self.string)
apache-2.0
sushantgoel/Flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/jinja2/testsuite/api.py
402
10381
# -*- coding: utf-8 -*- """ jinja2.testsuite.api ~~~~~~~~~~~~~~~~~~~~ Tests the public API and related stuff. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest import os import tempfile import shutil from jinja2.testsuite import JinjaTestCase from jinja2._compat import next from jinja2 import Environment, Undefined, DebugUndefined, \ StrictUndefined, UndefinedError, meta, \ is_undefined, Template, DictLoader from jinja2.utils import Cycler env = Environment() class ExtendedAPITestCase(JinjaTestCase): def test_item_and_attribute(self): from jinja2.sandbox import SandboxedEnvironment for env in Environment(), SandboxedEnvironment(): # the |list is necessary for python3 tmpl = env.from_string('{{ foo.items()|list }}') assert tmpl.render(foo={'items': 42}) == "[('items', 42)]" tmpl = env.from_string('{{ foo|attr("items")()|list }}') assert tmpl.render(foo={'items': 42}) == "[('items', 42)]" tmpl = env.from_string('{{ foo["items"] }}') assert tmpl.render(foo={'items': 42}) == '42' def test_finalizer(self): def finalize_none_empty(value): if value is None: value = u'' return value env = Environment(finalize=finalize_none_empty) tmpl = env.from_string('{% for item in seq %}|{{ item }}{% endfor %}') assert tmpl.render(seq=(None, 1, "foo")) == '||1|foo' tmpl = env.from_string('<{{ none }}>') assert tmpl.render() == '<>' def test_cycler(self): items = 1, 2, 3 c = Cycler(*items) for item in items + items: assert c.current == item assert next(c) == item next(c) assert c.current == 2 c.reset() assert c.current == 1 def test_expressions(self): expr = env.compile_expression("foo") assert expr() is None assert expr(foo=42) == 42 expr2 = env.compile_expression("foo", undefined_to_none=False) assert is_undefined(expr2()) expr = env.compile_expression("42 + foo") assert expr(foo=42) == 84 def test_template_passthrough(self): t = Template('Content') assert env.get_template(t) is t assert env.select_template([t]) is t assert env.get_or_select_template([t]) is t assert env.get_or_select_template(t) is t def test_autoescape_autoselect(self): def select_autoescape(name): if name is None or '.' not in name: return False return name.endswith('.html') env = Environment(autoescape=select_autoescape, loader=DictLoader({ 'test.txt': '{{ foo }}', 'test.html': '{{ foo }}' })) t = env.get_template('test.txt') assert t.render(foo='<foo>') == '<foo>' t = env.get_template('test.html') assert t.render(foo='<foo>') == '&lt;foo&gt;' t = env.from_string('{{ foo }}') assert t.render(foo='<foo>') == '<foo>' class MetaTestCase(JinjaTestCase): def test_find_undeclared_variables(self): ast = env.parse('{% set foo = 42 %}{{ bar + foo }}') x = meta.find_undeclared_variables(ast) assert x == set(['bar']) ast = env.parse('{% set foo = 42 %}{{ bar + foo }}' '{% macro meh(x) %}{{ x }}{% endmacro %}' '{% for item in seq %}{{ muh(item) + meh(seq) }}{% endfor %}') x = meta.find_undeclared_variables(ast) assert x == set(['bar', 'seq', 'muh']) def test_find_refererenced_templates(self): ast = env.parse('{% extends "layout.html" %}{% include helper %}') i = meta.find_referenced_templates(ast) assert next(i) == 'layout.html' assert next(i) is None assert list(i) == [] ast = env.parse('{% extends "layout.html" %}' '{% from "test.html" import a, b as c %}' '{% import "meh.html" as meh %}' '{% include "muh.html" %}') i = meta.find_referenced_templates(ast) assert list(i) == ['layout.html', 'test.html', 'meh.html', 'muh.html'] def test_find_included_templates(self): ast = env.parse('{% include ["foo.html", "bar.html"] %}') i = meta.find_referenced_templates(ast) assert list(i) == ['foo.html', 'bar.html'] ast = env.parse('{% include ("foo.html", "bar.html") %}') i = meta.find_referenced_templates(ast) assert list(i) == ['foo.html', 'bar.html'] ast = env.parse('{% include ["foo.html", "bar.html", foo] %}') i = meta.find_referenced_templates(ast) assert list(i) == ['foo.html', 'bar.html', None] ast = env.parse('{% include ("foo.html", "bar.html", foo) %}') i = meta.find_referenced_templates(ast) assert list(i) == ['foo.html', 'bar.html', None] class StreamingTestCase(JinjaTestCase): def test_basic_streaming(self): tmpl = env.from_string("<ul>{% for item in seq %}<li>{{ loop.index " "}} - {{ item }}</li>{%- endfor %}</ul>") stream = tmpl.stream(seq=list(range(4))) self.assert_equal(next(stream), '<ul>') self.assert_equal(next(stream), '<li>1 - 0</li>') self.assert_equal(next(stream), '<li>2 - 1</li>') self.assert_equal(next(stream), '<li>3 - 2</li>') self.assert_equal(next(stream), '<li>4 - 3</li>') self.assert_equal(next(stream), '</ul>') def test_buffered_streaming(self): tmpl = env.from_string("<ul>{% for item in seq %}<li>{{ loop.index " "}} - {{ item }}</li>{%- endfor %}</ul>") stream = tmpl.stream(seq=list(range(4))) stream.enable_buffering(size=3) self.assert_equal(next(stream), u'<ul><li>1 - 0</li><li>2 - 1</li>') self.assert_equal(next(stream), u'<li>3 - 2</li><li>4 - 3</li></ul>') def test_streaming_behavior(self): tmpl = env.from_string("") stream = tmpl.stream() assert not stream.buffered stream.enable_buffering(20) assert stream.buffered stream.disable_buffering() assert not stream.buffered def test_dump_stream(self): tmp = tempfile.mkdtemp() try: tmpl = env.from_string(u"\u2713") stream = tmpl.stream() stream.dump(os.path.join(tmp, 'dump.txt'), 'utf-8') with open(os.path.join(tmp, 'dump.txt'), 'rb') as f: self.assertEqual(f.read(), b'\xe2\x9c\x93') finally: shutil.rmtree(tmp) class UndefinedTestCase(JinjaTestCase): def test_stopiteration_is_undefined(self): def test(): raise StopIteration() t = Template('A{{ test() }}B') assert t.render(test=test) == 'AB' t = Template('A{{ test().missingattribute }}B') self.assert_raises(UndefinedError, t.render, test=test) def test_undefined_and_special_attributes(self): try: Undefined('Foo').__dict__ except AttributeError: pass else: assert False, "Expected actual attribute error" def test_default_undefined(self): env = Environment(undefined=Undefined) self.assert_equal(env.from_string('{{ missing }}').render(), u'') self.assert_raises(UndefinedError, env.from_string('{{ missing.attribute }}').render) self.assert_equal(env.from_string('{{ missing|list }}').render(), '[]') self.assert_equal(env.from_string('{{ missing is not defined }}').render(), 'True') self.assert_equal(env.from_string('{{ foo.missing }}').render(foo=42), '') self.assert_equal(env.from_string('{{ not missing }}').render(), 'True') def test_debug_undefined(self): env = Environment(undefined=DebugUndefined) self.assert_equal(env.from_string('{{ missing }}').render(), '{{ missing }}') self.assert_raises(UndefinedError, env.from_string('{{ missing.attribute }}').render) self.assert_equal(env.from_string('{{ missing|list }}').render(), '[]') self.assert_equal(env.from_string('{{ missing is not defined }}').render(), 'True') self.assert_equal(env.from_string('{{ foo.missing }}').render(foo=42), u"{{ no such element: int object['missing'] }}") self.assert_equal(env.from_string('{{ not missing }}').render(), 'True') def test_strict_undefined(self): env = Environment(undefined=StrictUndefined) self.assert_raises(UndefinedError, env.from_string('{{ missing }}').render) self.assert_raises(UndefinedError, env.from_string('{{ missing.attribute }}').render) self.assert_raises(UndefinedError, env.from_string('{{ missing|list }}').render) self.assert_equal(env.from_string('{{ missing is not defined }}').render(), 'True') self.assert_raises(UndefinedError, env.from_string('{{ foo.missing }}').render, foo=42) self.assert_raises(UndefinedError, env.from_string('{{ not missing }}').render) self.assert_equal(env.from_string('{{ missing|default("default", true) }}').render(), 'default') def test_indexing_gives_undefined(self): t = Template("{{ var[42].foo }}") self.assert_raises(UndefinedError, t.render, var=0) def test_none_gives_proper_error(self): try: Environment().getattr(None, 'split')() except UndefinedError as e: assert e.message == "'None' has no attribute 'split'" else: assert False, 'expected exception' def test_object_repr(self): try: Undefined(obj=42, name='upper')() except UndefinedError as e: assert e.message == "'int object' has no attribute 'upper'" else: assert False, 'expected exception' def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(ExtendedAPITestCase)) suite.addTest(unittest.makeSuite(MetaTestCase)) suite.addTest(unittest.makeSuite(StreamingTestCase)) suite.addTest(unittest.makeSuite(UndefinedTestCase)) return suite
apache-2.0
unreal666/youtube-dl
youtube_dl/extractor/rockstargames.py
64
2248
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, ) class RockstarGamesIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rockstargames\.com/videos(?:/video/|#?/?\?.*\bvideo=)(?P<id>\d+)' _TESTS = [{ 'url': 'https://www.rockstargames.com/videos/video/11544/', 'md5': '03b5caa6e357a4bd50e3143fc03e5733', 'info_dict': { 'id': '11544', 'ext': 'mp4', 'title': 'Further Adventures in Finance and Felony Trailer', 'description': 'md5:6d31f55f30cb101b5476c4a379e324a3', 'thumbnail': r're:^https?://.*\.jpg$', 'timestamp': 1464876000, 'upload_date': '20160602', } }, { 'url': 'http://www.rockstargames.com/videos#/?video=48', 'only_matching': True, }] def _real_extract(self, url): video_id = self._match_id(url) video = self._download_json( 'https://www.rockstargames.com/videoplayer/videos/get-video.json', video_id, query={ 'id': video_id, 'locale': 'en_us', })['video'] title = video['title'] formats = [] for video in video['files_processed']['video/mp4']: if not video.get('src'): continue resolution = video.get('resolution') height = int_or_none(self._search_regex( r'^(\d+)[pP]$', resolution or '', 'height', default=None)) formats.append({ 'url': self._proto_relative_url(video['src']), 'format_id': resolution, 'height': height, }) if not formats: youtube_id = video.get('youtube_id') if youtube_id: return self.url_result(youtube_id, 'Youtube') self._sort_formats(formats) return { 'id': video_id, 'title': title, 'description': video.get('description'), 'thumbnail': self._proto_relative_url(video.get('screencap')), 'timestamp': parse_iso8601(video.get('created')), 'formats': formats, }
unlicense
payeldillip/django
tests/gis_tests/test_geoip.py
75
6731
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import socket import unittest import warnings from unittest import skipUnless from django.conf import settings from django.contrib.gis.geoip import HAS_GEOIP from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry from django.test import ignore_warnings from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.utils.encoding import force_text if HAS_GEOIP: from django.contrib.gis.geoip import GeoIP, GeoIPException from django.contrib.gis.geoip.prototypes import GeoIP_lib_version # Note: Requires use of both the GeoIP country and city datasets. # The GEOIP_DATA path should be the only setting set (the directory # should contain links or the actual database files 'GeoIP.dat' and # 'GeoLiteCity.dat'. @skipUnless(HAS_GEOIP and getattr(settings, "GEOIP_PATH", None), "GeoIP is required along with the GEOIP_PATH setting.") @ignore_warnings(category=RemovedInDjango20Warning) class GeoIPTest(unittest.TestCase): addr = '128.249.1.1' fqdn = 'tmc.edu' def _is_dns_available(self, domain): # Naive check to see if there is DNS available to use. # Used to conditionally skip fqdn geoip checks. # See #25407 for details. ErrClass = socket.error if six.PY2 else OSError try: socket.gethostbyname(domain) return True except ErrClass: return False def test01_init(self): "Testing GeoIP initialization." g1 = GeoIP() # Everything inferred from GeoIP path path = settings.GEOIP_PATH g2 = GeoIP(path, 0) # Passing in data path explicitly. g3 = GeoIP.open(path, 0) # MaxMind Python API syntax. for g in (g1, g2, g3): self.assertTrue(g._country) self.assertTrue(g._city) # Only passing in the location of one database. city = os.path.join(path, 'GeoLiteCity.dat') cntry = os.path.join(path, 'GeoIP.dat') g4 = GeoIP(city, country='') self.assertIsNone(g4._country) g5 = GeoIP(cntry, city='') self.assertIsNone(g5._city) # Improper parameters. bad_params = (23, 'foo', 15.23) for bad in bad_params: self.assertRaises(GeoIPException, GeoIP, cache=bad) if isinstance(bad, six.string_types): e = GeoIPException else: e = TypeError self.assertRaises(e, GeoIP, bad, 0) def test02_bad_query(self): "Testing GeoIP query parameter checking." cntry_g = GeoIP(city='<foo>') # No city database available, these calls should fail. self.assertRaises(GeoIPException, cntry_g.city, 'google.com') self.assertRaises(GeoIPException, cntry_g.coords, 'yahoo.com') # Non-string query should raise TypeError self.assertRaises(TypeError, cntry_g.country_code, 17) self.assertRaises(TypeError, cntry_g.country_name, GeoIP) def test03_country(self): "Testing GeoIP country querying methods." g = GeoIP(city='<foo>') queries = [self.addr] if self._is_dns_available(self.fqdn): queries.append(self.fqdn) for query in queries: for func in (g.country_code, g.country_code_by_addr, g.country_code_by_name): self.assertEqual('US', func(query), 'Failed for func %s and query %s' % (func, query)) for func in (g.country_name, g.country_name_by_addr, g.country_name_by_name): self.assertEqual('United States', func(query), 'Failed for func %s and query %s' % (func, query)) self.assertEqual({'country_code': 'US', 'country_name': 'United States'}, g.country(query)) @skipUnless(HAS_GEOS, "Geos is required") def test04_city(self): "Testing GeoIP city querying methods." g = GeoIP(country='<foo>') queries = [self.addr] if self._is_dns_available(self.fqdn): queries.append(self.fqdn) for query in queries: # Country queries should still work. for func in (g.country_code, g.country_code_by_addr, g.country_code_by_name): self.assertEqual('US', func(query)) for func in (g.country_name, g.country_name_by_addr, g.country_name_by_name): self.assertEqual('United States', func(query)) self.assertEqual({'country_code': 'US', 'country_name': 'United States'}, g.country(query)) # City information dictionary. d = g.city(query) self.assertEqual('USA', d['country_code3']) self.assertEqual('Houston', d['city']) self.assertEqual('TX', d['region']) self.assertEqual(713, d['area_code']) geom = g.geos(query) self.assertIsInstance(geom, GEOSGeometry) lon, lat = (-95.4010, 29.7079) lat_lon = g.lat_lon(query) lat_lon = (lat_lon[1], lat_lon[0]) for tup in (geom.tuple, g.coords(query), g.lon_lat(query), lat_lon): self.assertAlmostEqual(lon, tup[0], 4) self.assertAlmostEqual(lat, tup[1], 4) def test05_unicode_response(self): "Testing that GeoIP strings are properly encoded, see #16553." g = GeoIP() fqdn = "duesseldorf.de" if self._is_dns_available(fqdn): d = g.city(fqdn) self.assertEqual('Düsseldorf', d['city']) d = g.country('200.26.205.1') # Some databases have only unaccented countries self.assertIn(d['country_name'], ('Curaçao', 'Curacao')) def test_deprecation_warning(self): with warnings.catch_warnings(record=True) as warns: warnings.simplefilter('always') GeoIP() self.assertEqual(len(warns), 1) msg = str(warns[0].message) self.assertIn('django.contrib.gis.geoip is deprecated', msg) def test_repr(self): path = settings.GEOIP_PATH g = GeoIP(path=path) country_path = g._country_file city_path = g._city_file if GeoIP_lib_version: expected = '<GeoIP [v%(version)s] _country_file="%(country)s", _city_file="%(city)s">' % { 'version': force_text(GeoIP_lib_version()), 'country': country_path, 'city': city_path, } else: expected = '<GeoIP _country_file="%(country)s", _city_file="%(city)s">' % { 'country': country_path, 'city': city_path, } self.assertEqual(repr(g), expected)
bsd-3-clause
southerncross/tianchi-monster
AliTianChi-master/preprocess/split_by_date.py
1
1384
#-*-coding:utf-8-*- """ 将tianchi_mobile_recommend_train_user.csv按照日期分割为31份**.csv文件,放在'/data/date/'目录下。 生成的**.csv文件内容格式如下: user_id, item_id, behavior_type,user_geohash,item_category, hour 99512554,37320317, 3, 94gn6nd, 9232, 20 """ import csv import os #记录已存在的date.csv date_dictionary = {} #将words写入date.csv文件最后一行,文件打开采用'a'模式,即在原文件后添加(add) def writeByDate(date,words): file_name = date+".csv" os.chdir('../data/date/') if not date_dictionary.has_key(date): date_dictionary[date] = True f = open(file_name,'a') write = csv.writer(f) write.writerow(['user_id','item_id','behavior_type','user_geohash','item_category','hour']) write.writerow(words) f.close() else: f = open(file_name,'a') write = csv.writer(f) write.writerow(words) f.close() os.chdir('../../preprocess/') #主函数 def splitByDate(): os.mkdir('../data/date') f = open("../data/tianchi_mobile_recommend_train_user.csv") rows = csv.reader(f) rows.next() for row in rows: date = row[-1].split(" ")[0] hour = row[-1].split(" ")[1] words = row[0:-1] words.append(hour) writeByDate(date,words)
mit
Simran-B/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/locale.py
48
82594
""" Locale support. The module provides low-level access to the C lib's locale APIs and adds high level number formatting APIs as well as a locale aliasing engine to complement these. The aliasing engine includes support for many commonly used locale names and maps them to values suitable for passing to the C lib's setlocale() function. It also includes default encodings for all supported locale names. """ import sys, encodings, encodings.aliases import functools # Try importing the _locale module. # # If this fails, fall back on a basic 'C' locale emulation. # Yuck: LC_MESSAGES is non-standard: can't tell whether it exists before # trying the import. So __all__ is also fiddled at the end of the file. __all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error", "setlocale", "resetlocale", "localeconv", "strcoll", "strxfrm", "str", "atof", "atoi", "format", "format_string", "currency", "normalize", "LC_CTYPE", "LC_COLLATE", "LC_TIME", "LC_MONETARY", "LC_NUMERIC", "LC_ALL", "CHAR_MAX"] try: from _locale import * except ImportError: # Locale emulation CHAR_MAX = 127 LC_ALL = 6 LC_COLLATE = 3 LC_CTYPE = 0 LC_MESSAGES = 5 LC_MONETARY = 4 LC_NUMERIC = 1 LC_TIME = 2 Error = ValueError def localeconv(): """ localeconv() -> dict. Returns numeric and monetary locale-specific parameters. """ # 'C' locale default values return {'grouping': [127], 'currency_symbol': '', 'n_sign_posn': 127, 'p_cs_precedes': 127, 'n_cs_precedes': 127, 'mon_grouping': [], 'n_sep_by_space': 127, 'decimal_point': '.', 'negative_sign': '', 'positive_sign': '', 'p_sep_by_space': 127, 'int_curr_symbol': '', 'p_sign_posn': 127, 'thousands_sep': '', 'mon_thousands_sep': '', 'frac_digits': 127, 'mon_decimal_point': '', 'int_frac_digits': 127} def setlocale(category, value=None): """ setlocale(integer,string=None) -> string. Activates/queries locale processing. """ if value not in (None, '', 'C'): raise Error, '_locale emulation only supports "C" locale' return 'C' def strcoll(a,b): """ strcoll(string,string) -> int. Compares two strings according to the locale. """ return cmp(a,b) def strxfrm(s): """ strxfrm(string) -> string. Returns a string that behaves for cmp locale-aware. """ return s _localeconv = localeconv # With this dict, you can override some items of localeconv's return value. # This is useful for testing purposes. _override_localeconv = {} @functools.wraps(_localeconv) def localeconv(): d = _localeconv() if _override_localeconv: d.update(_override_localeconv) return d ### Number formatting APIs # Author: Martin von Loewis # improved by Georg Brandl # Iterate over grouping intervals def _grouping_intervals(grouping): for interval in grouping: # if grouping is -1, we are done if interval == CHAR_MAX: return # 0: re-use last group ad infinitum if interval == 0: while True: yield last_interval yield interval last_interval = interval #perform the grouping from right to left def _group(s, monetary=False): conv = localeconv() thousands_sep = conv[monetary and 'mon_thousands_sep' or 'thousands_sep'] grouping = conv[monetary and 'mon_grouping' or 'grouping'] if not grouping: return (s, 0) result = "" seps = 0 if s[-1] == ' ': stripped = s.rstrip() right_spaces = s[len(stripped):] s = stripped else: right_spaces = '' left_spaces = '' groups = [] for interval in _grouping_intervals(grouping): if not s or s[-1] not in "0123456789": # only non-digit characters remain (sign, spaces) left_spaces = s s = '' break groups.append(s[-interval:]) s = s[:-interval] if s: groups.append(s) groups.reverse() return ( left_spaces + thousands_sep.join(groups) + right_spaces, len(thousands_sep) * (len(groups) - 1) ) # Strip a given amount of excess padding from the given string def _strip_padding(s, amount): lpos = 0 while amount and s[lpos] == ' ': lpos += 1 amount -= 1 rpos = len(s) - 1 while amount and s[rpos] == ' ': rpos -= 1 amount -= 1 return s[lpos:rpos+1] def format(percent, value, grouping=False, monetary=False, *additional): """Returns the locale-aware substitution of a %? specifier (percent). additional is for format strings which contain one or more '*' modifiers.""" # this is only for one-percent-specifier strings and this should be checked if percent[0] != '%': raise ValueError("format() must be given exactly one %char " "format specifier") if additional: formatted = percent % ((value,) + additional) else: formatted = percent % value # floats and decimal ints need special action! if percent[-1] in 'eEfFgG': seps = 0 parts = formatted.split('.') if grouping: parts[0], seps = _group(parts[0], monetary=monetary) decimal_point = localeconv()[monetary and 'mon_decimal_point' or 'decimal_point'] formatted = decimal_point.join(parts) if seps: formatted = _strip_padding(formatted, seps) elif percent[-1] in 'diu': seps = 0 if grouping: formatted, seps = _group(formatted, monetary=monetary) if seps: formatted = _strip_padding(formatted, seps) return formatted import re, operator _percent_re = re.compile(r'%(?:\((?P<key>.*?)\))?' r'(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]') def format_string(f, val, grouping=False): """Formats a string in the same way that the % formatting would use, but takes the current locale into account. Grouping is applied if the third parameter is true.""" percents = list(_percent_re.finditer(f)) new_f = _percent_re.sub('%s', f) if isinstance(val, tuple): new_val = list(val) i = 0 for perc in percents: starcount = perc.group('modifiers').count('*') new_val[i] = format(perc.group(), new_val[i], grouping, False, *new_val[i+1:i+1+starcount]) del new_val[i+1:i+1+starcount] i += (1 + starcount) val = tuple(new_val) elif operator.isMappingType(val): for perc in percents: key = perc.group("key") val[key] = format(perc.group(), val[key], grouping) else: # val is a single value val = format(percents[0].group(), val, grouping) return new_f % val def currency(val, symbol=True, grouping=False, international=False): """Formats val according to the currency settings in the current locale.""" conv = localeconv() # check for illegal values digits = conv[international and 'int_frac_digits' or 'frac_digits'] if digits == 127: raise ValueError("Currency formatting is not possible using " "the 'C' locale.") s = format('%%.%if' % digits, abs(val), grouping, monetary=True) # '<' and '>' are markers if the sign must be inserted between symbol and value s = '<' + s + '>' if symbol: smb = conv[international and 'int_curr_symbol' or 'currency_symbol'] precedes = conv[val<0 and 'n_cs_precedes' or 'p_cs_precedes'] separated = conv[val<0 and 'n_sep_by_space' or 'p_sep_by_space'] if precedes: s = smb + (separated and ' ' or '') + s else: s = s + (separated and ' ' or '') + smb sign_pos = conv[val<0 and 'n_sign_posn' or 'p_sign_posn'] sign = conv[val<0 and 'negative_sign' or 'positive_sign'] if sign_pos == 0: s = '(' + s + ')' elif sign_pos == 1: s = sign + s elif sign_pos == 2: s = s + sign elif sign_pos == 3: s = s.replace('<', sign) elif sign_pos == 4: s = s.replace('>', sign) else: # the default if nothing specified; # this should be the most fitting sign position s = sign + s return s.replace('<', '').replace('>', '') def str(val): """Convert float to integer, taking the locale into account.""" return format("%.12g", val) def atof(string, func=float): "Parses a string as a float according to the locale settings." #First, get rid of the grouping ts = localeconv()['thousands_sep'] if ts: string = string.replace(ts, '') #next, replace the decimal point with a dot dd = localeconv()['decimal_point'] if dd: string = string.replace(dd, '.') #finally, parse the string return func(string) def atoi(str): "Converts a string to an integer according to the locale settings." return atof(str, int) def _test(): setlocale(LC_ALL, "") #do grouping s1 = format("%d", 123456789,1) print s1, "is", atoi(s1) #standard formatting s1 = str(3.14) print s1, "is", atof(s1) ### Locale name aliasing engine # Author: Marc-Andre Lemburg, [email protected] # Various tweaks by Fredrik Lundh <[email protected]> # store away the low-level version of setlocale (it's # overridden below) _setlocale = setlocale def normalize(localename): """ Returns a normalized locale code for the given locale name. The returned locale code is formatted for use with setlocale(). If normalization fails, the original name is returned unchanged. If the given encoding is not known, the function defaults to the default encoding for the locale code just like setlocale() does. """ # Normalize the locale name and extract the encoding fullname = localename.lower() if ':' in fullname: # ':' is sometimes used as encoding delimiter. fullname = fullname.replace(':', '.') if '.' in fullname: langname, encoding = fullname.split('.')[:2] fullname = langname + '.' + encoding else: langname = fullname encoding = '' # First lookup: fullname (possibly with encoding) norm_encoding = encoding.replace('-', '') norm_encoding = norm_encoding.replace('_', '') lookup_name = langname + '.' + encoding code = locale_alias.get(lookup_name, None) if code is not None: return code #print 'first lookup failed' # Second try: langname (without encoding) code = locale_alias.get(langname, None) if code is not None: #print 'langname lookup succeeded' if '.' in code: langname, defenc = code.split('.') else: langname = code defenc = '' if encoding: # Convert the encoding to a C lib compatible encoding string norm_encoding = encodings.normalize_encoding(encoding) #print 'norm encoding: %r' % norm_encoding norm_encoding = encodings.aliases.aliases.get(norm_encoding, norm_encoding) #print 'aliased encoding: %r' % norm_encoding encoding = locale_encoding_alias.get(norm_encoding, norm_encoding) else: encoding = defenc #print 'found encoding %r' % encoding if encoding: return langname + '.' + encoding else: return langname else: return localename def _parse_localename(localename): """ Parses the locale code for localename and returns the result as tuple (language code, encoding). The localename is normalized and passed through the locale alias engine. A ValueError is raised in case the locale name cannot be parsed. The language code corresponds to RFC 1766. code and encoding can be None in case the values cannot be determined or are unknown to this implementation. """ code = normalize(localename) if '@' in code: # Deal with locale modifiers code, modifier = code.split('@') if modifier == 'euro' and '.' not in code: # Assume Latin-9 for @euro locales. This is bogus, # since some systems may use other encodings for these # locales. Also, we ignore other modifiers. return code, 'iso-8859-15' if '.' in code: return tuple(code.split('.')[:2]) elif code == 'C': return None, None raise ValueError, 'unknown locale: %s' % localename def _build_localename(localetuple): """ Builds a locale code from the given tuple (language code, encoding). No aliasing or normalizing takes place. """ language, encoding = localetuple if language is None: language = 'C' if encoding is None: return language else: return language + '.' + encoding def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')): """ Tries to determine the default locale settings and returns them as tuple (language code, encoding). According to POSIX, a program which has not called setlocale(LC_ALL, "") runs using the portable 'C' locale. Calling setlocale(LC_ALL, "") lets it use the default locale as defined by the LANG variable. Since we don't want to interfere with the current locale setting we thus emulate the behavior in the way described above. To maintain compatibility with other platforms, not only the LANG variable is tested, but a list of variables given as envvars parameter. The first found to be defined will be used. envvars defaults to the search path used in GNU gettext; it must always contain the variable name 'LANG'. Except for the code 'C', the language code corresponds to RFC 1766. code and encoding can be None in case the values cannot be determined. """ try: # check if it's supported by the _locale module import _locale code, encoding = _locale._getdefaultlocale() except (ImportError, AttributeError): pass else: # make sure the code/encoding values are valid if sys.platform == "win32" and code and code[:2] == "0x": # map windows language identifier to language name code = windows_locale.get(int(code, 0)) # ...add other platform-specific processing here, if # necessary... return code, encoding # fall back on POSIX behaviour import os lookup = os.environ.get for variable in envvars: localename = lookup(variable,None) if localename: if variable == 'LANGUAGE': localename = localename.split(':')[0] break else: localename = 'C' return _parse_localename(localename) def getlocale(category=LC_CTYPE): """ Returns the current setting for the given locale category as tuple (language code, encoding). category may be one of the LC_* value except LC_ALL. It defaults to LC_CTYPE. Except for the code 'C', the language code corresponds to RFC 1766. code and encoding can be None in case the values cannot be determined. """ localename = _setlocale(category) if category == LC_ALL and ';' in localename: raise TypeError, 'category LC_ALL is not supported' return _parse_localename(localename) def setlocale(category, locale=None): """ Set the locale for the given category. The locale can be a string, a locale tuple (language code, encoding), or None. Locale tuples are converted to strings the locale aliasing engine. Locale strings are passed directly to the C lib. category may be given as one of the LC_* values. """ if locale and type(locale) is not type(""): # convert to string locale = normalize(_build_localename(locale)) return _setlocale(category, locale) def resetlocale(category=LC_ALL): """ Sets the locale for category to the default setting. The default setting is determined by calling getdefaultlocale(). category defaults to LC_ALL. """ _setlocale(category, _build_localename(getdefaultlocale())) if sys.platform in ('win32', 'darwin', 'mac'): # On Win32, this will return the ANSI code page # On the Mac, it should return the system encoding; # it might return "ascii" instead def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using.""" import _locale return _locale._getdefaultlocale()[1] else: # On Unix, if CODESET is available, use that. try: CODESET except NameError: # Fall back to parsing environment variables :-( def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, by looking at environment variables.""" return getdefaultlocale()[1] else: def getpreferredencoding(do_setlocale = True): """Return the charset that the user is likely using, according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) setlocale(LC_CTYPE, "") result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) ### Database # # The following data was extracted from the locale.alias file which # comes with X11 and then hand edited removing the explicit encoding # definitions and adding some more aliases. The file is usually # available as /usr/lib/X11/locale/locale.alias. # # # The local_encoding_alias table maps lowercase encoding alias names # to C locale encoding names (case-sensitive). Note that normalize() # first looks up the encoding in the encodings.aliases dictionary and # then applies this mapping to find the correct C lib name for the # encoding. # locale_encoding_alias = { # Mappings for non-standard encoding names used in locale names '437': 'C', 'c': 'C', 'en': 'ISO8859-1', 'jis': 'JIS7', 'jis7': 'JIS7', 'ajec': 'eucJP', # Mappings from Python codec names to C lib encoding names 'ascii': 'ISO8859-1', 'latin_1': 'ISO8859-1', 'iso8859_1': 'ISO8859-1', 'iso8859_10': 'ISO8859-10', 'iso8859_11': 'ISO8859-11', 'iso8859_13': 'ISO8859-13', 'iso8859_14': 'ISO8859-14', 'iso8859_15': 'ISO8859-15', 'iso8859_2': 'ISO8859-2', 'iso8859_3': 'ISO8859-3', 'iso8859_4': 'ISO8859-4', 'iso8859_5': 'ISO8859-5', 'iso8859_6': 'ISO8859-6', 'iso8859_7': 'ISO8859-7', 'iso8859_8': 'ISO8859-8', 'iso8859_9': 'ISO8859-9', 'iso2022_jp': 'JIS7', 'shift_jis': 'SJIS', 'tactis': 'TACTIS', 'euc_jp': 'eucJP', 'euc_kr': 'eucKR', 'utf_8': 'UTF8', 'koi8_r': 'KOI8-R', 'koi8_u': 'KOI8-U', # XXX This list is still incomplete. If you know more # mappings, please file a bug report. Thanks. } # # The locale_alias table maps lowercase alias names to C locale names # (case-sensitive). Encodings are always separated from the locale # name using a dot ('.'); they should only be given in case the # language name is needed to interpret the given encoding alias # correctly (CJK codes often have this need). # # Note that the normalize() function which uses this tables # removes '_' and '-' characters from the encoding part of the # locale name before doing the lookup. This saves a lot of # space in the table. # # MAL 2004-12-10: # Updated alias mapping to most recent locale.alias file # from X.org distribution using makelocalealias.py. # # These are the differences compared to the old mapping (Python 2.4 # and older): # # updated 'bg' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251' # updated 'bg_bg' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251' # updated 'bulgarian' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251' # updated 'cz' -> 'cz_CZ.ISO8859-2' to 'cs_CZ.ISO8859-2' # updated 'cz_cz' -> 'cz_CZ.ISO8859-2' to 'cs_CZ.ISO8859-2' # updated 'czech' -> 'cs_CS.ISO8859-2' to 'cs_CZ.ISO8859-2' # updated 'dutch' -> 'nl_BE.ISO8859-1' to 'nl_NL.ISO8859-1' # updated 'et' -> 'et_EE.ISO8859-4' to 'et_EE.ISO8859-15' # updated 'et_ee' -> 'et_EE.ISO8859-4' to 'et_EE.ISO8859-15' # updated 'fi' -> 'fi_FI.ISO8859-1' to 'fi_FI.ISO8859-15' # updated 'fi_fi' -> 'fi_FI.ISO8859-1' to 'fi_FI.ISO8859-15' # updated 'iw' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8' # updated 'iw_il' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8' # updated 'japanese' -> 'ja_JP.SJIS' to 'ja_JP.eucJP' # updated 'lt' -> 'lt_LT.ISO8859-4' to 'lt_LT.ISO8859-13' # updated 'lv' -> 'lv_LV.ISO8859-4' to 'lv_LV.ISO8859-13' # updated 'sl' -> 'sl_CS.ISO8859-2' to 'sl_SI.ISO8859-2' # updated 'slovene' -> 'sl_CS.ISO8859-2' to 'sl_SI.ISO8859-2' # updated 'th_th' -> 'th_TH.TACTIS' to 'th_TH.ISO8859-11' # updated 'zh_cn' -> 'zh_CN.eucCN' to 'zh_CN.gb2312' # updated 'zh_cn.big5' -> 'zh_TW.eucTW' to 'zh_TW.big5' # updated 'zh_tw' -> 'zh_TW.eucTW' to 'zh_TW.big5' # # MAL 2008-05-30: # Updated alias mapping to most recent locale.alias file # from X.org distribution using makelocalealias.py. # # These are the differences compared to the old mapping (Python 2.5 # and older): # # updated 'cs_cs.iso88592' -> 'cs_CZ.ISO8859-2' to 'cs_CS.ISO8859-2' # updated 'serbocroatian' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2' # updated 'sh' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2' # updated 'sh_hr.iso88592' -> 'sh_HR.ISO8859-2' to 'hr_HR.ISO8859-2' # updated 'sh_sp' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2' # updated 'sh_yu' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2' # updated 'sp' -> 'sp_YU.ISO8859-5' to 'sr_CS.ISO8859-5' # updated 'sp_yu' -> 'sp_YU.ISO8859-5' to 'sr_CS.ISO8859-5' # updated 'sr' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5' # updated 'sr@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5' # updated 'sr_sp' -> 'sr_SP.ISO8859-2' to 'sr_CS.ISO8859-2' # updated 'sr_yu' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5' # updated 'sr_yu.cp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251' # updated 'sr_yu.iso88592' -> 'sr_YU.ISO8859-2' to 'sr_CS.ISO8859-2' # updated 'sr_yu.iso88595' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5' # updated 'sr_yu.iso88595@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5' # updated 'sr_yu.microsoftcp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251' # updated 'sr_yu.utf8@cyrillic' -> 'sr_YU.UTF-8' to 'sr_CS.UTF-8' # updated 'sr_yu@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5' locale_alias = { 'a3': 'a3_AZ.KOI8-C', 'a3_az': 'a3_AZ.KOI8-C', 'a3_az.koi8c': 'a3_AZ.KOI8-C', 'af': 'af_ZA.ISO8859-1', 'af_za': 'af_ZA.ISO8859-1', 'af_za.iso88591': 'af_ZA.ISO8859-1', 'am': 'am_ET.UTF-8', 'am_et': 'am_ET.UTF-8', 'american': 'en_US.ISO8859-1', 'american.iso88591': 'en_US.ISO8859-1', 'ar': 'ar_AA.ISO8859-6', 'ar_aa': 'ar_AA.ISO8859-6', 'ar_aa.iso88596': 'ar_AA.ISO8859-6', 'ar_ae': 'ar_AE.ISO8859-6', 'ar_ae.iso88596': 'ar_AE.ISO8859-6', 'ar_bh': 'ar_BH.ISO8859-6', 'ar_bh.iso88596': 'ar_BH.ISO8859-6', 'ar_dz': 'ar_DZ.ISO8859-6', 'ar_dz.iso88596': 'ar_DZ.ISO8859-6', 'ar_eg': 'ar_EG.ISO8859-6', 'ar_eg.iso88596': 'ar_EG.ISO8859-6', 'ar_iq': 'ar_IQ.ISO8859-6', 'ar_iq.iso88596': 'ar_IQ.ISO8859-6', 'ar_jo': 'ar_JO.ISO8859-6', 'ar_jo.iso88596': 'ar_JO.ISO8859-6', 'ar_kw': 'ar_KW.ISO8859-6', 'ar_kw.iso88596': 'ar_KW.ISO8859-6', 'ar_lb': 'ar_LB.ISO8859-6', 'ar_lb.iso88596': 'ar_LB.ISO8859-6', 'ar_ly': 'ar_LY.ISO8859-6', 'ar_ly.iso88596': 'ar_LY.ISO8859-6', 'ar_ma': 'ar_MA.ISO8859-6', 'ar_ma.iso88596': 'ar_MA.ISO8859-6', 'ar_om': 'ar_OM.ISO8859-6', 'ar_om.iso88596': 'ar_OM.ISO8859-6', 'ar_qa': 'ar_QA.ISO8859-6', 'ar_qa.iso88596': 'ar_QA.ISO8859-6', 'ar_sa': 'ar_SA.ISO8859-6', 'ar_sa.iso88596': 'ar_SA.ISO8859-6', 'ar_sd': 'ar_SD.ISO8859-6', 'ar_sd.iso88596': 'ar_SD.ISO8859-6', 'ar_sy': 'ar_SY.ISO8859-6', 'ar_sy.iso88596': 'ar_SY.ISO8859-6', 'ar_tn': 'ar_TN.ISO8859-6', 'ar_tn.iso88596': 'ar_TN.ISO8859-6', 'ar_ye': 'ar_YE.ISO8859-6', 'ar_ye.iso88596': 'ar_YE.ISO8859-6', 'arabic': 'ar_AA.ISO8859-6', 'arabic.iso88596': 'ar_AA.ISO8859-6', 'az': 'az_AZ.ISO8859-9E', 'az_az': 'az_AZ.ISO8859-9E', 'az_az.iso88599e': 'az_AZ.ISO8859-9E', 'be': 'be_BY.CP1251', 'be_by': 'be_BY.CP1251', 'be_by.cp1251': 'be_BY.CP1251', 'be_by.microsoftcp1251': 'be_BY.CP1251', 'bg': 'bg_BG.CP1251', 'bg_bg': 'bg_BG.CP1251', 'bg_bg.cp1251': 'bg_BG.CP1251', 'bg_bg.iso88595': 'bg_BG.ISO8859-5', 'bg_bg.koi8r': 'bg_BG.KOI8-R', 'bg_bg.microsoftcp1251': 'bg_BG.CP1251', 'bn_in': 'bn_IN.UTF-8', 'bokmal': 'nb_NO.ISO8859-1', 'bokm\xe5l': 'nb_NO.ISO8859-1', 'br': 'br_FR.ISO8859-1', 'br_fr': 'br_FR.ISO8859-1', 'br_fr.iso88591': 'br_FR.ISO8859-1', 'br_fr.iso885914': 'br_FR.ISO8859-14', 'br_fr.iso885915': 'br_FR.ISO8859-15', 'br_fr.iso885915@euro': 'br_FR.ISO8859-15', 'br_fr.utf8@euro': 'br_FR.UTF-8', 'br_fr@euro': 'br_FR.ISO8859-15', 'bs': 'bs_BA.ISO8859-2', 'bs_ba': 'bs_BA.ISO8859-2', 'bs_ba.iso88592': 'bs_BA.ISO8859-2', 'bulgarian': 'bg_BG.CP1251', 'c': 'C', 'c-french': 'fr_CA.ISO8859-1', 'c-french.iso88591': 'fr_CA.ISO8859-1', 'c.en': 'C', 'c.iso88591': 'en_US.ISO8859-1', 'c_c': 'C', 'c_c.c': 'C', 'ca': 'ca_ES.ISO8859-1', 'ca_es': 'ca_ES.ISO8859-1', 'ca_es.iso88591': 'ca_ES.ISO8859-1', 'ca_es.iso885915': 'ca_ES.ISO8859-15', 'ca_es.iso885915@euro': 'ca_ES.ISO8859-15', 'ca_es.utf8@euro': 'ca_ES.UTF-8', 'ca_es@euro': 'ca_ES.ISO8859-15', 'catalan': 'ca_ES.ISO8859-1', 'cextend': 'en_US.ISO8859-1', 'cextend.en': 'en_US.ISO8859-1', 'chinese-s': 'zh_CN.eucCN', 'chinese-t': 'zh_TW.eucTW', 'croatian': 'hr_HR.ISO8859-2', 'cs': 'cs_CZ.ISO8859-2', 'cs_cs': 'cs_CZ.ISO8859-2', 'cs_cs.iso88592': 'cs_CS.ISO8859-2', 'cs_cz': 'cs_CZ.ISO8859-2', 'cs_cz.iso88592': 'cs_CZ.ISO8859-2', 'cy': 'cy_GB.ISO8859-1', 'cy_gb': 'cy_GB.ISO8859-1', 'cy_gb.iso88591': 'cy_GB.ISO8859-1', 'cy_gb.iso885914': 'cy_GB.ISO8859-14', 'cy_gb.iso885915': 'cy_GB.ISO8859-15', 'cy_gb@euro': 'cy_GB.ISO8859-15', 'cz': 'cs_CZ.ISO8859-2', 'cz_cz': 'cs_CZ.ISO8859-2', 'czech': 'cs_CZ.ISO8859-2', 'da': 'da_DK.ISO8859-1', 'da_dk': 'da_DK.ISO8859-1', 'da_dk.88591': 'da_DK.ISO8859-1', 'da_dk.885915': 'da_DK.ISO8859-15', 'da_dk.iso88591': 'da_DK.ISO8859-1', 'da_dk.iso885915': 'da_DK.ISO8859-15', 'da_dk@euro': 'da_DK.ISO8859-15', 'danish': 'da_DK.ISO8859-1', 'danish.iso88591': 'da_DK.ISO8859-1', 'dansk': 'da_DK.ISO8859-1', 'de': 'de_DE.ISO8859-1', 'de_at': 'de_AT.ISO8859-1', 'de_at.iso88591': 'de_AT.ISO8859-1', 'de_at.iso885915': 'de_AT.ISO8859-15', 'de_at.iso885915@euro': 'de_AT.ISO8859-15', 'de_at.utf8@euro': 'de_AT.UTF-8', 'de_at@euro': 'de_AT.ISO8859-15', 'de_be': 'de_BE.ISO8859-1', 'de_be.iso88591': 'de_BE.ISO8859-1', 'de_be.iso885915': 'de_BE.ISO8859-15', 'de_be.iso885915@euro': 'de_BE.ISO8859-15', 'de_be.utf8@euro': 'de_BE.UTF-8', 'de_be@euro': 'de_BE.ISO8859-15', 'de_ch': 'de_CH.ISO8859-1', 'de_ch.iso88591': 'de_CH.ISO8859-1', 'de_ch.iso885915': 'de_CH.ISO8859-15', 'de_ch@euro': 'de_CH.ISO8859-15', 'de_de': 'de_DE.ISO8859-1', 'de_de.88591': 'de_DE.ISO8859-1', 'de_de.885915': 'de_DE.ISO8859-15', 'de_de.885915@euro': 'de_DE.ISO8859-15', 'de_de.iso88591': 'de_DE.ISO8859-1', 'de_de.iso885915': 'de_DE.ISO8859-15', 'de_de.iso885915@euro': 'de_DE.ISO8859-15', 'de_de.utf8@euro': 'de_DE.UTF-8', 'de_de@euro': 'de_DE.ISO8859-15', 'de_lu': 'de_LU.ISO8859-1', 'de_lu.iso88591': 'de_LU.ISO8859-1', 'de_lu.iso885915': 'de_LU.ISO8859-15', 'de_lu.iso885915@euro': 'de_LU.ISO8859-15', 'de_lu.utf8@euro': 'de_LU.UTF-8', 'de_lu@euro': 'de_LU.ISO8859-15', 'deutsch': 'de_DE.ISO8859-1', 'dutch': 'nl_NL.ISO8859-1', 'dutch.iso88591': 'nl_BE.ISO8859-1', 'ee': 'ee_EE.ISO8859-4', 'ee_ee': 'ee_EE.ISO8859-4', 'ee_ee.iso88594': 'ee_EE.ISO8859-4', 'eesti': 'et_EE.ISO8859-1', 'el': 'el_GR.ISO8859-7', 'el_gr': 'el_GR.ISO8859-7', 'el_gr.iso88597': 'el_GR.ISO8859-7', 'el_gr@euro': 'el_GR.ISO8859-15', 'en': 'en_US.ISO8859-1', 'en.iso88591': 'en_US.ISO8859-1', 'en_au': 'en_AU.ISO8859-1', 'en_au.iso88591': 'en_AU.ISO8859-1', 'en_be': 'en_BE.ISO8859-1', 'en_be@euro': 'en_BE.ISO8859-15', 'en_bw': 'en_BW.ISO8859-1', 'en_bw.iso88591': 'en_BW.ISO8859-1', 'en_ca': 'en_CA.ISO8859-1', 'en_ca.iso88591': 'en_CA.ISO8859-1', 'en_gb': 'en_GB.ISO8859-1', 'en_gb.88591': 'en_GB.ISO8859-1', 'en_gb.iso88591': 'en_GB.ISO8859-1', 'en_gb.iso885915': 'en_GB.ISO8859-15', 'en_gb@euro': 'en_GB.ISO8859-15', 'en_hk': 'en_HK.ISO8859-1', 'en_hk.iso88591': 'en_HK.ISO8859-1', 'en_ie': 'en_IE.ISO8859-1', 'en_ie.iso88591': 'en_IE.ISO8859-1', 'en_ie.iso885915': 'en_IE.ISO8859-15', 'en_ie.iso885915@euro': 'en_IE.ISO8859-15', 'en_ie.utf8@euro': 'en_IE.UTF-8', 'en_ie@euro': 'en_IE.ISO8859-15', 'en_in': 'en_IN.ISO8859-1', 'en_nz': 'en_NZ.ISO8859-1', 'en_nz.iso88591': 'en_NZ.ISO8859-1', 'en_ph': 'en_PH.ISO8859-1', 'en_ph.iso88591': 'en_PH.ISO8859-1', 'en_sg': 'en_SG.ISO8859-1', 'en_sg.iso88591': 'en_SG.ISO8859-1', 'en_uk': 'en_GB.ISO8859-1', 'en_us': 'en_US.ISO8859-1', 'en_us.88591': 'en_US.ISO8859-1', 'en_us.885915': 'en_US.ISO8859-15', 'en_us.iso88591': 'en_US.ISO8859-1', 'en_us.iso885915': 'en_US.ISO8859-15', 'en_us.iso885915@euro': 'en_US.ISO8859-15', 'en_us@euro': 'en_US.ISO8859-15', 'en_us@euro@euro': 'en_US.ISO8859-15', 'en_za': 'en_ZA.ISO8859-1', 'en_za.88591': 'en_ZA.ISO8859-1', 'en_za.iso88591': 'en_ZA.ISO8859-1', 'en_za.iso885915': 'en_ZA.ISO8859-15', 'en_za@euro': 'en_ZA.ISO8859-15', 'en_zw': 'en_ZW.ISO8859-1', 'en_zw.iso88591': 'en_ZW.ISO8859-1', 'eng_gb': 'en_GB.ISO8859-1', 'eng_gb.8859': 'en_GB.ISO8859-1', 'english': 'en_EN.ISO8859-1', 'english.iso88591': 'en_EN.ISO8859-1', 'english_uk': 'en_GB.ISO8859-1', 'english_uk.8859': 'en_GB.ISO8859-1', 'english_united-states': 'en_US.ISO8859-1', 'english_united-states.437': 'C', 'english_us': 'en_US.ISO8859-1', 'english_us.8859': 'en_US.ISO8859-1', 'english_us.ascii': 'en_US.ISO8859-1', 'eo': 'eo_XX.ISO8859-3', 'eo_eo': 'eo_EO.ISO8859-3', 'eo_eo.iso88593': 'eo_EO.ISO8859-3', 'eo_xx': 'eo_XX.ISO8859-3', 'eo_xx.iso88593': 'eo_XX.ISO8859-3', 'es': 'es_ES.ISO8859-1', 'es_ar': 'es_AR.ISO8859-1', 'es_ar.iso88591': 'es_AR.ISO8859-1', 'es_bo': 'es_BO.ISO8859-1', 'es_bo.iso88591': 'es_BO.ISO8859-1', 'es_cl': 'es_CL.ISO8859-1', 'es_cl.iso88591': 'es_CL.ISO8859-1', 'es_co': 'es_CO.ISO8859-1', 'es_co.iso88591': 'es_CO.ISO8859-1', 'es_cr': 'es_CR.ISO8859-1', 'es_cr.iso88591': 'es_CR.ISO8859-1', 'es_do': 'es_DO.ISO8859-1', 'es_do.iso88591': 'es_DO.ISO8859-1', 'es_ec': 'es_EC.ISO8859-1', 'es_ec.iso88591': 'es_EC.ISO8859-1', 'es_es': 'es_ES.ISO8859-1', 'es_es.88591': 'es_ES.ISO8859-1', 'es_es.iso88591': 'es_ES.ISO8859-1', 'es_es.iso885915': 'es_ES.ISO8859-15', 'es_es.iso885915@euro': 'es_ES.ISO8859-15', 'es_es.utf8@euro': 'es_ES.UTF-8', 'es_es@euro': 'es_ES.ISO8859-15', 'es_gt': 'es_GT.ISO8859-1', 'es_gt.iso88591': 'es_GT.ISO8859-1', 'es_hn': 'es_HN.ISO8859-1', 'es_hn.iso88591': 'es_HN.ISO8859-1', 'es_mx': 'es_MX.ISO8859-1', 'es_mx.iso88591': 'es_MX.ISO8859-1', 'es_ni': 'es_NI.ISO8859-1', 'es_ni.iso88591': 'es_NI.ISO8859-1', 'es_pa': 'es_PA.ISO8859-1', 'es_pa.iso88591': 'es_PA.ISO8859-1', 'es_pa.iso885915': 'es_PA.ISO8859-15', 'es_pa@euro': 'es_PA.ISO8859-15', 'es_pe': 'es_PE.ISO8859-1', 'es_pe.iso88591': 'es_PE.ISO8859-1', 'es_pe.iso885915': 'es_PE.ISO8859-15', 'es_pe@euro': 'es_PE.ISO8859-15', 'es_pr': 'es_PR.ISO8859-1', 'es_pr.iso88591': 'es_PR.ISO8859-1', 'es_py': 'es_PY.ISO8859-1', 'es_py.iso88591': 'es_PY.ISO8859-1', 'es_py.iso885915': 'es_PY.ISO8859-15', 'es_py@euro': 'es_PY.ISO8859-15', 'es_sv': 'es_SV.ISO8859-1', 'es_sv.iso88591': 'es_SV.ISO8859-1', 'es_sv.iso885915': 'es_SV.ISO8859-15', 'es_sv@euro': 'es_SV.ISO8859-15', 'es_us': 'es_US.ISO8859-1', 'es_us.iso88591': 'es_US.ISO8859-1', 'es_uy': 'es_UY.ISO8859-1', 'es_uy.iso88591': 'es_UY.ISO8859-1', 'es_uy.iso885915': 'es_UY.ISO8859-15', 'es_uy@euro': 'es_UY.ISO8859-15', 'es_ve': 'es_VE.ISO8859-1', 'es_ve.iso88591': 'es_VE.ISO8859-1', 'es_ve.iso885915': 'es_VE.ISO8859-15', 'es_ve@euro': 'es_VE.ISO8859-15', 'estonian': 'et_EE.ISO8859-1', 'et': 'et_EE.ISO8859-15', 'et_ee': 'et_EE.ISO8859-15', 'et_ee.iso88591': 'et_EE.ISO8859-1', 'et_ee.iso885913': 'et_EE.ISO8859-13', 'et_ee.iso885915': 'et_EE.ISO8859-15', 'et_ee.iso88594': 'et_EE.ISO8859-4', 'et_ee@euro': 'et_EE.ISO8859-15', 'eu': 'eu_ES.ISO8859-1', 'eu_es': 'eu_ES.ISO8859-1', 'eu_es.iso88591': 'eu_ES.ISO8859-1', 'eu_es.iso885915': 'eu_ES.ISO8859-15', 'eu_es.iso885915@euro': 'eu_ES.ISO8859-15', 'eu_es.utf8@euro': 'eu_ES.UTF-8', 'eu_es@euro': 'eu_ES.ISO8859-15', 'fa': 'fa_IR.UTF-8', 'fa_ir': 'fa_IR.UTF-8', 'fa_ir.isiri3342': 'fa_IR.ISIRI-3342', 'fi': 'fi_FI.ISO8859-15', 'fi_fi': 'fi_FI.ISO8859-15', 'fi_fi.88591': 'fi_FI.ISO8859-1', 'fi_fi.iso88591': 'fi_FI.ISO8859-1', 'fi_fi.iso885915': 'fi_FI.ISO8859-15', 'fi_fi.iso885915@euro': 'fi_FI.ISO8859-15', 'fi_fi.utf8@euro': 'fi_FI.UTF-8', 'fi_fi@euro': 'fi_FI.ISO8859-15', 'finnish': 'fi_FI.ISO8859-1', 'finnish.iso88591': 'fi_FI.ISO8859-1', 'fo': 'fo_FO.ISO8859-1', 'fo_fo': 'fo_FO.ISO8859-1', 'fo_fo.iso88591': 'fo_FO.ISO8859-1', 'fo_fo.iso885915': 'fo_FO.ISO8859-15', 'fo_fo@euro': 'fo_FO.ISO8859-15', 'fr': 'fr_FR.ISO8859-1', 'fr_be': 'fr_BE.ISO8859-1', 'fr_be.88591': 'fr_BE.ISO8859-1', 'fr_be.iso88591': 'fr_BE.ISO8859-1', 'fr_be.iso885915': 'fr_BE.ISO8859-15', 'fr_be.iso885915@euro': 'fr_BE.ISO8859-15', 'fr_be.utf8@euro': 'fr_BE.UTF-8', 'fr_be@euro': 'fr_BE.ISO8859-15', 'fr_ca': 'fr_CA.ISO8859-1', 'fr_ca.88591': 'fr_CA.ISO8859-1', 'fr_ca.iso88591': 'fr_CA.ISO8859-1', 'fr_ca.iso885915': 'fr_CA.ISO8859-15', 'fr_ca@euro': 'fr_CA.ISO8859-15', 'fr_ch': 'fr_CH.ISO8859-1', 'fr_ch.88591': 'fr_CH.ISO8859-1', 'fr_ch.iso88591': 'fr_CH.ISO8859-1', 'fr_ch.iso885915': 'fr_CH.ISO8859-15', 'fr_ch@euro': 'fr_CH.ISO8859-15', 'fr_fr': 'fr_FR.ISO8859-1', 'fr_fr.88591': 'fr_FR.ISO8859-1', 'fr_fr.iso88591': 'fr_FR.ISO8859-1', 'fr_fr.iso885915': 'fr_FR.ISO8859-15', 'fr_fr.iso885915@euro': 'fr_FR.ISO8859-15', 'fr_fr.utf8@euro': 'fr_FR.UTF-8', 'fr_fr@euro': 'fr_FR.ISO8859-15', 'fr_lu': 'fr_LU.ISO8859-1', 'fr_lu.88591': 'fr_LU.ISO8859-1', 'fr_lu.iso88591': 'fr_LU.ISO8859-1', 'fr_lu.iso885915': 'fr_LU.ISO8859-15', 'fr_lu.iso885915@euro': 'fr_LU.ISO8859-15', 'fr_lu.utf8@euro': 'fr_LU.UTF-8', 'fr_lu@euro': 'fr_LU.ISO8859-15', 'fran\xe7ais': 'fr_FR.ISO8859-1', 'fre_fr': 'fr_FR.ISO8859-1', 'fre_fr.8859': 'fr_FR.ISO8859-1', 'french': 'fr_FR.ISO8859-1', 'french.iso88591': 'fr_CH.ISO8859-1', 'french_france': 'fr_FR.ISO8859-1', 'french_france.8859': 'fr_FR.ISO8859-1', 'ga': 'ga_IE.ISO8859-1', 'ga_ie': 'ga_IE.ISO8859-1', 'ga_ie.iso88591': 'ga_IE.ISO8859-1', 'ga_ie.iso885914': 'ga_IE.ISO8859-14', 'ga_ie.iso885915': 'ga_IE.ISO8859-15', 'ga_ie.iso885915@euro': 'ga_IE.ISO8859-15', 'ga_ie.utf8@euro': 'ga_IE.UTF-8', 'ga_ie@euro': 'ga_IE.ISO8859-15', 'galego': 'gl_ES.ISO8859-1', 'galician': 'gl_ES.ISO8859-1', 'gd': 'gd_GB.ISO8859-1', 'gd_gb': 'gd_GB.ISO8859-1', 'gd_gb.iso88591': 'gd_GB.ISO8859-1', 'gd_gb.iso885914': 'gd_GB.ISO8859-14', 'gd_gb.iso885915': 'gd_GB.ISO8859-15', 'gd_gb@euro': 'gd_GB.ISO8859-15', 'ger_de': 'de_DE.ISO8859-1', 'ger_de.8859': 'de_DE.ISO8859-1', 'german': 'de_DE.ISO8859-1', 'german.iso88591': 'de_CH.ISO8859-1', 'german_germany': 'de_DE.ISO8859-1', 'german_germany.8859': 'de_DE.ISO8859-1', 'gl': 'gl_ES.ISO8859-1', 'gl_es': 'gl_ES.ISO8859-1', 'gl_es.iso88591': 'gl_ES.ISO8859-1', 'gl_es.iso885915': 'gl_ES.ISO8859-15', 'gl_es.iso885915@euro': 'gl_ES.ISO8859-15', 'gl_es.utf8@euro': 'gl_ES.UTF-8', 'gl_es@euro': 'gl_ES.ISO8859-15', 'greek': 'el_GR.ISO8859-7', 'greek.iso88597': 'el_GR.ISO8859-7', 'gu_in': 'gu_IN.UTF-8', 'gv': 'gv_GB.ISO8859-1', 'gv_gb': 'gv_GB.ISO8859-1', 'gv_gb.iso88591': 'gv_GB.ISO8859-1', 'gv_gb.iso885914': 'gv_GB.ISO8859-14', 'gv_gb.iso885915': 'gv_GB.ISO8859-15', 'gv_gb@euro': 'gv_GB.ISO8859-15', 'he': 'he_IL.ISO8859-8', 'he_il': 'he_IL.ISO8859-8', 'he_il.cp1255': 'he_IL.CP1255', 'he_il.iso88598': 'he_IL.ISO8859-8', 'he_il.microsoftcp1255': 'he_IL.CP1255', 'hebrew': 'iw_IL.ISO8859-8', 'hebrew.iso88598': 'iw_IL.ISO8859-8', 'hi': 'hi_IN.ISCII-DEV', 'hi_in': 'hi_IN.ISCII-DEV', 'hi_in.isciidev': 'hi_IN.ISCII-DEV', 'hr': 'hr_HR.ISO8859-2', 'hr_hr': 'hr_HR.ISO8859-2', 'hr_hr.iso88592': 'hr_HR.ISO8859-2', 'hrvatski': 'hr_HR.ISO8859-2', 'hu': 'hu_HU.ISO8859-2', 'hu_hu': 'hu_HU.ISO8859-2', 'hu_hu.iso88592': 'hu_HU.ISO8859-2', 'hungarian': 'hu_HU.ISO8859-2', 'icelandic': 'is_IS.ISO8859-1', 'icelandic.iso88591': 'is_IS.ISO8859-1', 'id': 'id_ID.ISO8859-1', 'id_id': 'id_ID.ISO8859-1', 'in': 'id_ID.ISO8859-1', 'in_id': 'id_ID.ISO8859-1', 'is': 'is_IS.ISO8859-1', 'is_is': 'is_IS.ISO8859-1', 'is_is.iso88591': 'is_IS.ISO8859-1', 'is_is.iso885915': 'is_IS.ISO8859-15', 'is_is@euro': 'is_IS.ISO8859-15', 'iso-8859-1': 'en_US.ISO8859-1', 'iso-8859-15': 'en_US.ISO8859-15', 'iso8859-1': 'en_US.ISO8859-1', 'iso8859-15': 'en_US.ISO8859-15', 'iso_8859_1': 'en_US.ISO8859-1', 'iso_8859_15': 'en_US.ISO8859-15', 'it': 'it_IT.ISO8859-1', 'it_ch': 'it_CH.ISO8859-1', 'it_ch.iso88591': 'it_CH.ISO8859-1', 'it_ch.iso885915': 'it_CH.ISO8859-15', 'it_ch@euro': 'it_CH.ISO8859-15', 'it_it': 'it_IT.ISO8859-1', 'it_it.88591': 'it_IT.ISO8859-1', 'it_it.iso88591': 'it_IT.ISO8859-1', 'it_it.iso885915': 'it_IT.ISO8859-15', 'it_it.iso885915@euro': 'it_IT.ISO8859-15', 'it_it.utf8@euro': 'it_IT.UTF-8', 'it_it@euro': 'it_IT.ISO8859-15', 'italian': 'it_IT.ISO8859-1', 'italian.iso88591': 'it_IT.ISO8859-1', 'iu': 'iu_CA.NUNACOM-8', 'iu_ca': 'iu_CA.NUNACOM-8', 'iu_ca.nunacom8': 'iu_CA.NUNACOM-8', 'iw': 'he_IL.ISO8859-8', 'iw_il': 'he_IL.ISO8859-8', 'iw_il.iso88598': 'he_IL.ISO8859-8', 'ja': 'ja_JP.eucJP', 'ja.jis': 'ja_JP.JIS7', 'ja.sjis': 'ja_JP.SJIS', 'ja_jp': 'ja_JP.eucJP', 'ja_jp.ajec': 'ja_JP.eucJP', 'ja_jp.euc': 'ja_JP.eucJP', 'ja_jp.eucjp': 'ja_JP.eucJP', 'ja_jp.iso-2022-jp': 'ja_JP.JIS7', 'ja_jp.iso2022jp': 'ja_JP.JIS7', 'ja_jp.jis': 'ja_JP.JIS7', 'ja_jp.jis7': 'ja_JP.JIS7', 'ja_jp.mscode': 'ja_JP.SJIS', 'ja_jp.sjis': 'ja_JP.SJIS', 'ja_jp.ujis': 'ja_JP.eucJP', 'japan': 'ja_JP.eucJP', 'japanese': 'ja_JP.eucJP', 'japanese-euc': 'ja_JP.eucJP', 'japanese.euc': 'ja_JP.eucJP', 'japanese.sjis': 'ja_JP.SJIS', 'jp_jp': 'ja_JP.eucJP', 'ka': 'ka_GE.GEORGIAN-ACADEMY', 'ka_ge': 'ka_GE.GEORGIAN-ACADEMY', 'ka_ge.georgianacademy': 'ka_GE.GEORGIAN-ACADEMY', 'ka_ge.georgianps': 'ka_GE.GEORGIAN-PS', 'ka_ge.georgianrs': 'ka_GE.GEORGIAN-ACADEMY', 'kl': 'kl_GL.ISO8859-1', 'kl_gl': 'kl_GL.ISO8859-1', 'kl_gl.iso88591': 'kl_GL.ISO8859-1', 'kl_gl.iso885915': 'kl_GL.ISO8859-15', 'kl_gl@euro': 'kl_GL.ISO8859-15', 'km_kh': 'km_KH.UTF-8', 'kn_in': 'kn_IN.UTF-8', 'ko': 'ko_KR.eucKR', 'ko_kr': 'ko_KR.eucKR', 'ko_kr.euc': 'ko_KR.eucKR', 'ko_kr.euckr': 'ko_KR.eucKR', 'korean': 'ko_KR.eucKR', 'korean.euc': 'ko_KR.eucKR', 'kw': 'kw_GB.ISO8859-1', 'kw_gb': 'kw_GB.ISO8859-1', 'kw_gb.iso88591': 'kw_GB.ISO8859-1', 'kw_gb.iso885914': 'kw_GB.ISO8859-14', 'kw_gb.iso885915': 'kw_GB.ISO8859-15', 'kw_gb@euro': 'kw_GB.ISO8859-15', 'ky': 'ky_KG.UTF-8', 'ky_kg': 'ky_KG.UTF-8', 'lithuanian': 'lt_LT.ISO8859-13', 'lo': 'lo_LA.MULELAO-1', 'lo_la': 'lo_LA.MULELAO-1', 'lo_la.cp1133': 'lo_LA.IBM-CP1133', 'lo_la.ibmcp1133': 'lo_LA.IBM-CP1133', 'lo_la.mulelao1': 'lo_LA.MULELAO-1', 'lt': 'lt_LT.ISO8859-13', 'lt_lt': 'lt_LT.ISO8859-13', 'lt_lt.iso885913': 'lt_LT.ISO8859-13', 'lt_lt.iso88594': 'lt_LT.ISO8859-4', 'lv': 'lv_LV.ISO8859-13', 'lv_lv': 'lv_LV.ISO8859-13', 'lv_lv.iso885913': 'lv_LV.ISO8859-13', 'lv_lv.iso88594': 'lv_LV.ISO8859-4', 'mi': 'mi_NZ.ISO8859-1', 'mi_nz': 'mi_NZ.ISO8859-1', 'mi_nz.iso88591': 'mi_NZ.ISO8859-1', 'mk': 'mk_MK.ISO8859-5', 'mk_mk': 'mk_MK.ISO8859-5', 'mk_mk.cp1251': 'mk_MK.CP1251', 'mk_mk.iso88595': 'mk_MK.ISO8859-5', 'mk_mk.microsoftcp1251': 'mk_MK.CP1251', 'mr_in': 'mr_IN.UTF-8', 'ms': 'ms_MY.ISO8859-1', 'ms_my': 'ms_MY.ISO8859-1', 'ms_my.iso88591': 'ms_MY.ISO8859-1', 'mt': 'mt_MT.ISO8859-3', 'mt_mt': 'mt_MT.ISO8859-3', 'mt_mt.iso88593': 'mt_MT.ISO8859-3', 'nb': 'nb_NO.ISO8859-1', 'nb_no': 'nb_NO.ISO8859-1', 'nb_no.88591': 'nb_NO.ISO8859-1', 'nb_no.iso88591': 'nb_NO.ISO8859-1', 'nb_no.iso885915': 'nb_NO.ISO8859-15', 'nb_no@euro': 'nb_NO.ISO8859-15', 'nl': 'nl_NL.ISO8859-1', 'nl_be': 'nl_BE.ISO8859-1', 'nl_be.88591': 'nl_BE.ISO8859-1', 'nl_be.iso88591': 'nl_BE.ISO8859-1', 'nl_be.iso885915': 'nl_BE.ISO8859-15', 'nl_be.iso885915@euro': 'nl_BE.ISO8859-15', 'nl_be.utf8@euro': 'nl_BE.UTF-8', 'nl_be@euro': 'nl_BE.ISO8859-15', 'nl_nl': 'nl_NL.ISO8859-1', 'nl_nl.88591': 'nl_NL.ISO8859-1', 'nl_nl.iso88591': 'nl_NL.ISO8859-1', 'nl_nl.iso885915': 'nl_NL.ISO8859-15', 'nl_nl.iso885915@euro': 'nl_NL.ISO8859-15', 'nl_nl.utf8@euro': 'nl_NL.UTF-8', 'nl_nl@euro': 'nl_NL.ISO8859-15', 'nn': 'nn_NO.ISO8859-1', 'nn_no': 'nn_NO.ISO8859-1', 'nn_no.88591': 'nn_NO.ISO8859-1', 'nn_no.iso88591': 'nn_NO.ISO8859-1', 'nn_no.iso885915': 'nn_NO.ISO8859-15', 'nn_no@euro': 'nn_NO.ISO8859-15', 'no': 'no_NO.ISO8859-1', 'no@nynorsk': 'ny_NO.ISO8859-1', 'no_no': 'no_NO.ISO8859-1', 'no_no.88591': 'no_NO.ISO8859-1', 'no_no.iso88591': 'no_NO.ISO8859-1', 'no_no.iso885915': 'no_NO.ISO8859-15', 'no_no@euro': 'no_NO.ISO8859-15', 'norwegian': 'no_NO.ISO8859-1', 'norwegian.iso88591': 'no_NO.ISO8859-1', 'nr': 'nr_ZA.ISO8859-1', 'nr_za': 'nr_ZA.ISO8859-1', 'nr_za.iso88591': 'nr_ZA.ISO8859-1', 'nso': 'nso_ZA.ISO8859-15', 'nso_za': 'nso_ZA.ISO8859-15', 'nso_za.iso885915': 'nso_ZA.ISO8859-15', 'ny': 'ny_NO.ISO8859-1', 'ny_no': 'ny_NO.ISO8859-1', 'ny_no.88591': 'ny_NO.ISO8859-1', 'ny_no.iso88591': 'ny_NO.ISO8859-1', 'ny_no.iso885915': 'ny_NO.ISO8859-15', 'ny_no@euro': 'ny_NO.ISO8859-15', 'nynorsk': 'nn_NO.ISO8859-1', 'oc': 'oc_FR.ISO8859-1', 'oc_fr': 'oc_FR.ISO8859-1', 'oc_fr.iso88591': 'oc_FR.ISO8859-1', 'oc_fr.iso885915': 'oc_FR.ISO8859-15', 'oc_fr@euro': 'oc_FR.ISO8859-15', 'pa_in': 'pa_IN.UTF-8', 'pd': 'pd_US.ISO8859-1', 'pd_de': 'pd_DE.ISO8859-1', 'pd_de.iso88591': 'pd_DE.ISO8859-1', 'pd_de.iso885915': 'pd_DE.ISO8859-15', 'pd_de@euro': 'pd_DE.ISO8859-15', 'pd_us': 'pd_US.ISO8859-1', 'pd_us.iso88591': 'pd_US.ISO8859-1', 'pd_us.iso885915': 'pd_US.ISO8859-15', 'pd_us@euro': 'pd_US.ISO8859-15', 'ph': 'ph_PH.ISO8859-1', 'ph_ph': 'ph_PH.ISO8859-1', 'ph_ph.iso88591': 'ph_PH.ISO8859-1', 'pl': 'pl_PL.ISO8859-2', 'pl_pl': 'pl_PL.ISO8859-2', 'pl_pl.iso88592': 'pl_PL.ISO8859-2', 'polish': 'pl_PL.ISO8859-2', 'portuguese': 'pt_PT.ISO8859-1', 'portuguese.iso88591': 'pt_PT.ISO8859-1', 'portuguese_brazil': 'pt_BR.ISO8859-1', 'portuguese_brazil.8859': 'pt_BR.ISO8859-1', 'posix': 'C', 'posix-utf2': 'C', 'pp': 'pp_AN.ISO8859-1', 'pp_an': 'pp_AN.ISO8859-1', 'pp_an.iso88591': 'pp_AN.ISO8859-1', 'pt': 'pt_PT.ISO8859-1', 'pt_br': 'pt_BR.ISO8859-1', 'pt_br.88591': 'pt_BR.ISO8859-1', 'pt_br.iso88591': 'pt_BR.ISO8859-1', 'pt_br.iso885915': 'pt_BR.ISO8859-15', 'pt_br@euro': 'pt_BR.ISO8859-15', 'pt_pt': 'pt_PT.ISO8859-1', 'pt_pt.88591': 'pt_PT.ISO8859-1', 'pt_pt.iso88591': 'pt_PT.ISO8859-1', 'pt_pt.iso885915': 'pt_PT.ISO8859-15', 'pt_pt.iso885915@euro': 'pt_PT.ISO8859-15', 'pt_pt.utf8@euro': 'pt_PT.UTF-8', 'pt_pt@euro': 'pt_PT.ISO8859-15', 'ro': 'ro_RO.ISO8859-2', 'ro_ro': 'ro_RO.ISO8859-2', 'ro_ro.iso88592': 'ro_RO.ISO8859-2', 'romanian': 'ro_RO.ISO8859-2', 'ru': 'ru_RU.ISO8859-5', 'ru_ru': 'ru_RU.ISO8859-5', 'ru_ru.cp1251': 'ru_RU.CP1251', 'ru_ru.iso88595': 'ru_RU.ISO8859-5', 'ru_ru.koi8r': 'ru_RU.KOI8-R', 'ru_ru.microsoftcp1251': 'ru_RU.CP1251', 'ru_ua': 'ru_UA.KOI8-U', 'ru_ua.cp1251': 'ru_UA.CP1251', 'ru_ua.koi8u': 'ru_UA.KOI8-U', 'ru_ua.microsoftcp1251': 'ru_UA.CP1251', 'rumanian': 'ro_RO.ISO8859-2', 'russian': 'ru_RU.ISO8859-5', 'rw': 'rw_RW.ISO8859-1', 'rw_rw': 'rw_RW.ISO8859-1', 'rw_rw.iso88591': 'rw_RW.ISO8859-1', 'se_no': 'se_NO.UTF-8', 'serbocroatian': 'sr_CS.ISO8859-2', 'sh': 'sr_CS.ISO8859-2', 'sh_hr': 'sh_HR.ISO8859-2', 'sh_hr.iso88592': 'hr_HR.ISO8859-2', 'sh_sp': 'sr_CS.ISO8859-2', 'sh_yu': 'sr_CS.ISO8859-2', 'si': 'si_LK.UTF-8', 'si_lk': 'si_LK.UTF-8', 'sinhala': 'si_LK.UTF-8', 'sk': 'sk_SK.ISO8859-2', 'sk_sk': 'sk_SK.ISO8859-2', 'sk_sk.iso88592': 'sk_SK.ISO8859-2', 'sl': 'sl_SI.ISO8859-2', 'sl_cs': 'sl_CS.ISO8859-2', 'sl_si': 'sl_SI.ISO8859-2', 'sl_si.iso88592': 'sl_SI.ISO8859-2', 'slovak': 'sk_SK.ISO8859-2', 'slovene': 'sl_SI.ISO8859-2', 'slovenian': 'sl_SI.ISO8859-2', 'sp': 'sr_CS.ISO8859-5', 'sp_yu': 'sr_CS.ISO8859-5', 'spanish': 'es_ES.ISO8859-1', 'spanish.iso88591': 'es_ES.ISO8859-1', 'spanish_spain': 'es_ES.ISO8859-1', 'spanish_spain.8859': 'es_ES.ISO8859-1', 'sq': 'sq_AL.ISO8859-2', 'sq_al': 'sq_AL.ISO8859-2', 'sq_al.iso88592': 'sq_AL.ISO8859-2', 'sr': 'sr_CS.ISO8859-5', 'sr@cyrillic': 'sr_CS.ISO8859-5', 'sr@latn': 'sr_CS.ISO8859-2', 'sr_cs.iso88592': 'sr_CS.ISO8859-2', 'sr_cs.iso88592@latn': 'sr_CS.ISO8859-2', 'sr_cs.iso88595': 'sr_CS.ISO8859-5', 'sr_cs.utf8@latn': 'sr_CS.UTF-8', 'sr_cs@latn': 'sr_CS.ISO8859-2', 'sr_sp': 'sr_CS.ISO8859-2', 'sr_yu': 'sr_CS.ISO8859-5', 'sr_yu.cp1251@cyrillic': 'sr_CS.CP1251', 'sr_yu.iso88592': 'sr_CS.ISO8859-2', 'sr_yu.iso88595': 'sr_CS.ISO8859-5', 'sr_yu.iso88595@cyrillic': 'sr_CS.ISO8859-5', 'sr_yu.microsoftcp1251@cyrillic': 'sr_CS.CP1251', 'sr_yu.utf8@cyrillic': 'sr_CS.UTF-8', 'sr_yu@cyrillic': 'sr_CS.ISO8859-5', 'ss': 'ss_ZA.ISO8859-1', 'ss_za': 'ss_ZA.ISO8859-1', 'ss_za.iso88591': 'ss_ZA.ISO8859-1', 'st': 'st_ZA.ISO8859-1', 'st_za': 'st_ZA.ISO8859-1', 'st_za.iso88591': 'st_ZA.ISO8859-1', 'sv': 'sv_SE.ISO8859-1', 'sv_fi': 'sv_FI.ISO8859-1', 'sv_fi.iso88591': 'sv_FI.ISO8859-1', 'sv_fi.iso885915': 'sv_FI.ISO8859-15', 'sv_fi.iso885915@euro': 'sv_FI.ISO8859-15', 'sv_fi.utf8@euro': 'sv_FI.UTF-8', 'sv_fi@euro': 'sv_FI.ISO8859-15', 'sv_se': 'sv_SE.ISO8859-1', 'sv_se.88591': 'sv_SE.ISO8859-1', 'sv_se.iso88591': 'sv_SE.ISO8859-1', 'sv_se.iso885915': 'sv_SE.ISO8859-15', 'sv_se@euro': 'sv_SE.ISO8859-15', 'swedish': 'sv_SE.ISO8859-1', 'swedish.iso88591': 'sv_SE.ISO8859-1', 'ta': 'ta_IN.TSCII-0', 'ta_in': 'ta_IN.TSCII-0', 'ta_in.tscii': 'ta_IN.TSCII-0', 'ta_in.tscii0': 'ta_IN.TSCII-0', 'tg': 'tg_TJ.KOI8-C', 'tg_tj': 'tg_TJ.KOI8-C', 'tg_tj.koi8c': 'tg_TJ.KOI8-C', 'th': 'th_TH.ISO8859-11', 'th_th': 'th_TH.ISO8859-11', 'th_th.iso885911': 'th_TH.ISO8859-11', 'th_th.tactis': 'th_TH.TIS620', 'th_th.tis620': 'th_TH.TIS620', 'thai': 'th_TH.ISO8859-11', 'tl': 'tl_PH.ISO8859-1', 'tl_ph': 'tl_PH.ISO8859-1', 'tl_ph.iso88591': 'tl_PH.ISO8859-1', 'tn': 'tn_ZA.ISO8859-15', 'tn_za': 'tn_ZA.ISO8859-15', 'tn_za.iso885915': 'tn_ZA.ISO8859-15', 'tr': 'tr_TR.ISO8859-9', 'tr_tr': 'tr_TR.ISO8859-9', 'tr_tr.iso88599': 'tr_TR.ISO8859-9', 'ts': 'ts_ZA.ISO8859-1', 'ts_za': 'ts_ZA.ISO8859-1', 'ts_za.iso88591': 'ts_ZA.ISO8859-1', 'tt': 'tt_RU.TATAR-CYR', 'tt_ru': 'tt_RU.TATAR-CYR', 'tt_ru.koi8c': 'tt_RU.KOI8-C', 'tt_ru.tatarcyr': 'tt_RU.TATAR-CYR', 'turkish': 'tr_TR.ISO8859-9', 'turkish.iso88599': 'tr_TR.ISO8859-9', 'uk': 'uk_UA.KOI8-U', 'uk_ua': 'uk_UA.KOI8-U', 'uk_ua.cp1251': 'uk_UA.CP1251', 'uk_ua.iso88595': 'uk_UA.ISO8859-5', 'uk_ua.koi8u': 'uk_UA.KOI8-U', 'uk_ua.microsoftcp1251': 'uk_UA.CP1251', 'univ': 'en_US.utf', 'universal': 'en_US.utf', 'universal.utf8@ucs4': 'en_US.UTF-8', 'ur': 'ur_PK.CP1256', 'ur_pk': 'ur_PK.CP1256', 'ur_pk.cp1256': 'ur_PK.CP1256', 'ur_pk.microsoftcp1256': 'ur_PK.CP1256', 'uz': 'uz_UZ.UTF-8', 'uz_uz': 'uz_UZ.UTF-8', 'uz_uz.iso88591': 'uz_UZ.ISO8859-1', 'uz_uz.utf8@cyrillic': 'uz_UZ.UTF-8', 'uz_uz@cyrillic': 'uz_UZ.UTF-8', 've': 've_ZA.UTF-8', 've_za': 've_ZA.UTF-8', 'vi': 'vi_VN.TCVN', 'vi_vn': 'vi_VN.TCVN', 'vi_vn.tcvn': 'vi_VN.TCVN', 'vi_vn.tcvn5712': 'vi_VN.TCVN', 'vi_vn.viscii': 'vi_VN.VISCII', 'vi_vn.viscii111': 'vi_VN.VISCII', 'wa': 'wa_BE.ISO8859-1', 'wa_be': 'wa_BE.ISO8859-1', 'wa_be.iso88591': 'wa_BE.ISO8859-1', 'wa_be.iso885915': 'wa_BE.ISO8859-15', 'wa_be.iso885915@euro': 'wa_BE.ISO8859-15', 'wa_be@euro': 'wa_BE.ISO8859-15', 'xh': 'xh_ZA.ISO8859-1', 'xh_za': 'xh_ZA.ISO8859-1', 'xh_za.iso88591': 'xh_ZA.ISO8859-1', 'yi': 'yi_US.CP1255', 'yi_us': 'yi_US.CP1255', 'yi_us.cp1255': 'yi_US.CP1255', 'yi_us.microsoftcp1255': 'yi_US.CP1255', 'zh': 'zh_CN.eucCN', 'zh_cn': 'zh_CN.gb2312', 'zh_cn.big5': 'zh_TW.big5', 'zh_cn.euc': 'zh_CN.eucCN', 'zh_cn.gb18030': 'zh_CN.gb18030', 'zh_cn.gb2312': 'zh_CN.gb2312', 'zh_cn.gbk': 'zh_CN.gbk', 'zh_hk': 'zh_HK.big5hkscs', 'zh_hk.big5': 'zh_HK.big5', 'zh_hk.big5hkscs': 'zh_HK.big5hkscs', 'zh_tw': 'zh_TW.big5', 'zh_tw.big5': 'zh_TW.big5', 'zh_tw.euc': 'zh_TW.eucTW', 'zh_tw.euctw': 'zh_TW.eucTW', 'zu': 'zu_ZA.ISO8859-1', 'zu_za': 'zu_ZA.ISO8859-1', 'zu_za.iso88591': 'zu_ZA.ISO8859-1', } # # This maps Windows language identifiers to locale strings. # # This list has been updated from # http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp # to include every locale up to Windows XP. # # NOTE: this mapping is incomplete. If your language is missing, please # submit a bug report to Python bug manager, which you can find via: # http://www.python.org/dev/ # Make sure you include the missing language identifier and the suggested # locale code. # windows_locale = { 0x0436: "af_ZA", # Afrikaans 0x041c: "sq_AL", # Albanian 0x0401: "ar_SA", # Arabic - Saudi Arabia 0x0801: "ar_IQ", # Arabic - Iraq 0x0c01: "ar_EG", # Arabic - Egypt 0x1001: "ar_LY", # Arabic - Libya 0x1401: "ar_DZ", # Arabic - Algeria 0x1801: "ar_MA", # Arabic - Morocco 0x1c01: "ar_TN", # Arabic - Tunisia 0x2001: "ar_OM", # Arabic - Oman 0x2401: "ar_YE", # Arabic - Yemen 0x2801: "ar_SY", # Arabic - Syria 0x2c01: "ar_JO", # Arabic - Jordan 0x3001: "ar_LB", # Arabic - Lebanon 0x3401: "ar_KW", # Arabic - Kuwait 0x3801: "ar_AE", # Arabic - United Arab Emirates 0x3c01: "ar_BH", # Arabic - Bahrain 0x4001: "ar_QA", # Arabic - Qatar 0x042b: "hy_AM", # Armenian 0x042c: "az_AZ", # Azeri Latin 0x082c: "az_AZ", # Azeri - Cyrillic 0x042d: "eu_ES", # Basque 0x0423: "be_BY", # Belarusian 0x0445: "bn_IN", # Begali 0x201a: "bs_BA", # Bosnian 0x141a: "bs_BA", # Bosnian - Cyrillic 0x047e: "br_FR", # Breton - France 0x0402: "bg_BG", # Bulgarian 0x0403: "ca_ES", # Catalan 0x0004: "zh_CHS",# Chinese - Simplified 0x0404: "zh_TW", # Chinese - Taiwan 0x0804: "zh_CN", # Chinese - PRC 0x0c04: "zh_HK", # Chinese - Hong Kong S.A.R. 0x1004: "zh_SG", # Chinese - Singapore 0x1404: "zh_MO", # Chinese - Macao S.A.R. 0x7c04: "zh_CHT",# Chinese - Traditional 0x041a: "hr_HR", # Croatian 0x101a: "hr_BA", # Croatian - Bosnia 0x0405: "cs_CZ", # Czech 0x0406: "da_DK", # Danish 0x048c: "gbz_AF",# Dari - Afghanistan 0x0465: "div_MV",# Divehi - Maldives 0x0413: "nl_NL", # Dutch - The Netherlands 0x0813: "nl_BE", # Dutch - Belgium 0x0409: "en_US", # English - United States 0x0809: "en_GB", # English - United Kingdom 0x0c09: "en_AU", # English - Australia 0x1009: "en_CA", # English - Canada 0x1409: "en_NZ", # English - New Zealand 0x1809: "en_IE", # English - Ireland 0x1c09: "en_ZA", # English - South Africa 0x2009: "en_JA", # English - Jamaica 0x2409: "en_CB", # English - Carribbean 0x2809: "en_BZ", # English - Belize 0x2c09: "en_TT", # English - Trinidad 0x3009: "en_ZW", # English - Zimbabwe 0x3409: "en_PH", # English - Phillippines 0x0425: "et_EE", # Estonian 0x0438: "fo_FO", # Faroese 0x0464: "fil_PH",# Filipino 0x040b: "fi_FI", # Finnish 0x040c: "fr_FR", # French - France 0x080c: "fr_BE", # French - Belgium 0x0c0c: "fr_CA", # French - Canada 0x100c: "fr_CH", # French - Switzerland 0x140c: "fr_LU", # French - Luxembourg 0x180c: "fr_MC", # French - Monaco 0x0462: "fy_NL", # Frisian - Netherlands 0x0456: "gl_ES", # Galician 0x0437: "ka_GE", # Georgian 0x0407: "de_DE", # German - Germany 0x0807: "de_CH", # German - Switzerland 0x0c07: "de_AT", # German - Austria 0x1007: "de_LU", # German - Luxembourg 0x1407: "de_LI", # German - Liechtenstein 0x0408: "el_GR", # Greek 0x0447: "gu_IN", # Gujarati 0x040d: "he_IL", # Hebrew 0x0439: "hi_IN", # Hindi 0x040e: "hu_HU", # Hungarian 0x040f: "is_IS", # Icelandic 0x0421: "id_ID", # Indonesian 0x045d: "iu_CA", # Inuktitut 0x085d: "iu_CA", # Inuktitut - Latin 0x083c: "ga_IE", # Irish - Ireland 0x0434: "xh_ZA", # Xhosa - South Africa 0x0435: "zu_ZA", # Zulu 0x0410: "it_IT", # Italian - Italy 0x0810: "it_CH", # Italian - Switzerland 0x0411: "ja_JP", # Japanese 0x044b: "kn_IN", # Kannada - India 0x043f: "kk_KZ", # Kazakh 0x0457: "kok_IN",# Konkani 0x0412: "ko_KR", # Korean 0x0440: "ky_KG", # Kyrgyz 0x0426: "lv_LV", # Latvian 0x0427: "lt_LT", # Lithuanian 0x046e: "lb_LU", # Luxembourgish 0x042f: "mk_MK", # FYRO Macedonian 0x043e: "ms_MY", # Malay - Malaysia 0x083e: "ms_BN", # Malay - Brunei 0x044c: "ml_IN", # Malayalam - India 0x043a: "mt_MT", # Maltese 0x0481: "mi_NZ", # Maori 0x047a: "arn_CL",# Mapudungun 0x044e: "mr_IN", # Marathi 0x047c: "moh_CA",# Mohawk - Canada 0x0450: "mn_MN", # Mongolian 0x0461: "ne_NP", # Nepali 0x0414: "nb_NO", # Norwegian - Bokmal 0x0814: "nn_NO", # Norwegian - Nynorsk 0x0482: "oc_FR", # Occitan - France 0x0448: "or_IN", # Oriya - India 0x0463: "ps_AF", # Pashto - Afghanistan 0x0429: "fa_IR", # Persian 0x0415: "pl_PL", # Polish 0x0416: "pt_BR", # Portuguese - Brazil 0x0816: "pt_PT", # Portuguese - Portugal 0x0446: "pa_IN", # Punjabi 0x046b: "quz_BO",# Quechua (Bolivia) 0x086b: "quz_EC",# Quechua (Ecuador) 0x0c6b: "quz_PE",# Quechua (Peru) 0x0418: "ro_RO", # Romanian - Romania 0x0417: "rm_CH", # Raeto-Romanese 0x0419: "ru_RU", # Russian 0x243b: "smn_FI",# Sami Finland 0x103b: "smj_NO",# Sami Norway 0x143b: "smj_SE",# Sami Sweden 0x043b: "se_NO", # Sami Northern Norway 0x083b: "se_SE", # Sami Northern Sweden 0x0c3b: "se_FI", # Sami Northern Finland 0x203b: "sms_FI",# Sami Skolt 0x183b: "sma_NO",# Sami Southern Norway 0x1c3b: "sma_SE",# Sami Southern Sweden 0x044f: "sa_IN", # Sanskrit 0x0c1a: "sr_SP", # Serbian - Cyrillic 0x1c1a: "sr_BA", # Serbian - Bosnia Cyrillic 0x081a: "sr_SP", # Serbian - Latin 0x181a: "sr_BA", # Serbian - Bosnia Latin 0x046c: "ns_ZA", # Northern Sotho 0x0432: "tn_ZA", # Setswana - Southern Africa 0x041b: "sk_SK", # Slovak 0x0424: "sl_SI", # Slovenian 0x040a: "es_ES", # Spanish - Spain 0x080a: "es_MX", # Spanish - Mexico 0x0c0a: "es_ES", # Spanish - Spain (Modern) 0x100a: "es_GT", # Spanish - Guatemala 0x140a: "es_CR", # Spanish - Costa Rica 0x180a: "es_PA", # Spanish - Panama 0x1c0a: "es_DO", # Spanish - Dominican Republic 0x200a: "es_VE", # Spanish - Venezuela 0x240a: "es_CO", # Spanish - Colombia 0x280a: "es_PE", # Spanish - Peru 0x2c0a: "es_AR", # Spanish - Argentina 0x300a: "es_EC", # Spanish - Ecuador 0x340a: "es_CL", # Spanish - Chile 0x380a: "es_UR", # Spanish - Uruguay 0x3c0a: "es_PY", # Spanish - Paraguay 0x400a: "es_BO", # Spanish - Bolivia 0x440a: "es_SV", # Spanish - El Salvador 0x480a: "es_HN", # Spanish - Honduras 0x4c0a: "es_NI", # Spanish - Nicaragua 0x500a: "es_PR", # Spanish - Puerto Rico 0x0441: "sw_KE", # Swahili 0x041d: "sv_SE", # Swedish - Sweden 0x081d: "sv_FI", # Swedish - Finland 0x045a: "syr_SY",# Syriac 0x0449: "ta_IN", # Tamil 0x0444: "tt_RU", # Tatar 0x044a: "te_IN", # Telugu 0x041e: "th_TH", # Thai 0x041f: "tr_TR", # Turkish 0x0422: "uk_UA", # Ukrainian 0x0420: "ur_PK", # Urdu 0x0820: "ur_IN", # Urdu - India 0x0443: "uz_UZ", # Uzbek - Latin 0x0843: "uz_UZ", # Uzbek - Cyrillic 0x042a: "vi_VN", # Vietnamese 0x0452: "cy_GB", # Welsh } def _print_locale(): """ Test function. """ categories = {} def _init_categories(categories=categories): for k,v in globals().items(): if k[:3] == 'LC_': categories[k] = v _init_categories() del categories['LC_ALL'] print 'Locale defaults as determined by getdefaultlocale():' print '-'*72 lang, enc = getdefaultlocale() print 'Language: ', lang or '(undefined)' print 'Encoding: ', enc or '(undefined)' print print 'Locale settings on startup:' print '-'*72 for name,category in categories.items(): print name, '...' lang, enc = getlocale(category) print ' Language: ', lang or '(undefined)' print ' Encoding: ', enc or '(undefined)' print print print 'Locale settings after calling resetlocale():' print '-'*72 resetlocale() for name,category in categories.items(): print name, '...' lang, enc = getlocale(category) print ' Language: ', lang or '(undefined)' print ' Encoding: ', enc or '(undefined)' print try: setlocale(LC_ALL, "") except: print 'NOTE:' print 'setlocale(LC_ALL, "") does not support the default locale' print 'given in the OS environment variables.' else: print print 'Locale settings after calling setlocale(LC_ALL, ""):' print '-'*72 for name,category in categories.items(): print name, '...' lang, enc = getlocale(category) print ' Language: ', lang or '(undefined)' print ' Encoding: ', enc or '(undefined)' print ### try: LC_MESSAGES except NameError: pass else: __all__.append("LC_MESSAGES") if __name__=='__main__': print 'Locale aliasing:' print _print_locale() print print 'Number formatting:' print _test()
apache-2.0
biokit/biokit
biokit/sequence/seq.py
1
6546
import string import collections import pylab __all__ = ['Sequence'] class Sequence(object): """Common data structure to all sequences (e.g., :meth:`~biokit.sequence.dna.DNA`) A sequence is a string contained in the :attr:`_data`. If you manipulate this attribute, you should also changed the :attr:`_N` (length of the string) and set :attr:`_counter` to None. Sequences can be concatenated easily. You can also add a string or numpy array or pandas time series to an existing sequence:: d1 = Sequence('ACGT') d2 = Sequence('ACGT') Note that there is a :meth:`check` method, which is not called during the instanciation but is called when adding sequences together. Each type of sequence (e.g., Sequence, DNA, RNA) has its own symbols. So you cannot add a DNA sequence with a RNA sequence for instance. Those are valid operation:: >>> d1 = Sequence('ACGT') >>> d1 += 'AAAA' >>> d1 + d1 >>> "AAAA" + d1 """ def __init__(self, data=''): # initialise before filling _data attribute self._checked = False if isinstance(data, str): self._data = data elif isinstance(data, Sequence): self._data = data._data self._checked = data._checked elif self._looks_like_a_sequence(data) is True: self._data = data._data self._checked = data._checked else: # assume it is a list or numpy array or pandas TimeSeries self._data = "".join(data) self._N = len(self._data) self._counter = None try: #python2 self.symbols = string.punctuation + string.letters except: # python3 self.symbols = string.punctuation + string.ascii_letters self._type = 'Sequence' def _looks_like_a_sequence(self, this): # if it looks like a sequence, let us assume it is a sequence if hasattr(this, 'symbols') and hasattr(this, '_data') and\ hasattr(this, '_checked'): return True else: return False def _get_N(self): return self._N N = property(_get_N) def __len__(self): return self._N def _get_sequence(self): return self._data[:] sequence = property(_get_sequence, doc="returns a copy of the sequence") def _get_count(self): if self._counter is None: self._counter = collections.Counter(self._data) return self._counter counter = property(_get_count, doc="return counter of the letters") def histogram(self): pylab.clf() import pandas as pd pd.Series(self.counter).plot(kind='bar') def pie(self): pylab.clf() keys = self.counter.keys() labels = dict([(k,float(self.counter[k])/len(self)) for k in keys]) pylab.pie([self.counter[k] for k in keys], labels=[k + ':'+str(labels[k]) for k in keys]) def hamming_distance(self, other): """Return hamming distance between this sequence and another sequence The Hamming distance between s and t, denoted dH(s,t), is the number of corresponding symbols that differ in s and t. :: >>> d1 = 'GAGCCTACTAACGGGAT' >>> d2 = 'CATCGTAATGACGGCCT' >>> s = Sequence(d1) >>> s.hamming_distance(d2) 7 """ # TODO:: convert to appropriate sequence. return sum(1 for x,y in zip(self._data, other._data) if x!=y) def upper(self): """convertes sequence string to uppercase (inplace)""" self._data = self._data.upper() def lower(self): """convertes sequence string to lowercase (inplace)""" self._data = self._data.lower() def _check_sequence(self): """checks that characters are valid symbols""" for i, x in enumerate(self._data): if x not in self.symbols: raise ValueError("found invalid symbol %s at position %s" % (x,i)) self._checked = True def __repr__(self): if self._N > 10: return "%s: %s ... (length %s) " % (self._type, self.sequence[0:10], self._N) else: return "%s: %s (length %s) " % (self._type, self.sequence, self._N) def __str__(self): if self._N > 10: return "%s: %s ... (length %s) " % (self._type,self.sequence[0:10], self._N) else: return "%s: %s (length %s) " % (self._type, self.sequence, self._N) def __convert_to_compat(self, other): from biokit.sequence.rna import RNA from biokit.sequence.dna import DNA if isinstance(self, RNA): other = RNA(other) elif isinstance(self, DNA): other = DNA(other) elif isinstance(self, Sequence): other = Sequence(other) # if self._check is True: # other._check_sequence() return other def __add__(self, other): # input may be a string or list, in which case we need to convert to a sequence if isinstance(other, Sequence) is False: other = self.__convert_to_compat(other) elif type(other) != type(self): raise TypeError('incompatible sequences %s versus %s' % (type(other), type(self))) # now let us add the 2 sequences return self.__convert_to_compat(self._data + other._data) def __radd__(self, other): """operator other + self""" if isinstance(other, Sequence) is False: other = self.__convert_to_compat(other) elif type(other) != type(self): raise TypeError('incompatible sequences %s versus %s' % (type(other), type(self))) # now let us add the 2 sequences return self.__convert_to_compat(other._data + self._data) def __iadd__(self, other): if isinstance(other, Sequence) is False: other = self.__convert_to_compat(other) elif type(other) != type(self): raise TypeError('incompatible sequences %s versus %s' % (type(other), type(self))) # now let us add the 2 sequences self._data += other._data self._N = self._N + other._N return self def __eq__(self, other): if isinstance(other, str): return self._data == other else: #assume this is a sequence: return self._data == other._data
bsd-2-clause
mytest-e2/ritest-e2
lib/python/Tools/Notifications.py
66
1963
notifications = [ ] notificationAdded = [ ] # notifications which are currently on screen (and might be closed by similiar notifications) current_notifications = [ ] def __AddNotification(fnc, screen, id, *args, **kwargs): if ".MessageBox'>" in `screen`: kwargs["simple"] = True notifications.append((fnc, screen, args, kwargs, id)) for x in notificationAdded: x() def AddNotification(screen, *args, **kwargs): AddNotificationWithCallback(None, screen, *args, **kwargs) def AddNotificationWithCallback(fnc, screen, *args, **kwargs): __AddNotification(fnc, screen, None, *args, **kwargs) def AddNotificationParentalControl(fnc, screen, *args, **kwargs): RemovePopup("Parental control") __AddNotification(fnc, screen, "Parental control", *args, **kwargs) def AddNotificationWithID(id, screen, *args, **kwargs): __AddNotification(None, screen, id, *args, **kwargs) def AddNotificationWithIDCallback(fnc, id, screen, *args, **kwargs): __AddNotification(fnc, screen, id, *args, **kwargs) # we don't support notifications with callback and ID as this # would require manually calling the callback on cancelled popups. def RemovePopup(id): # remove similiar notifications print "RemovePopup, id =", id for x in notifications: if x[4] and x[4] == id: print "(found in notifications)" notifications.remove(x) for x in current_notifications: if x[0] == id: print "(found in current notifications)" x[1].close() from Screens.MessageBox import MessageBox def AddPopup(text, type, timeout, id = None): if id is not None: RemovePopup(id) print "AddPopup, id =", id AddNotificationWithID(id, MessageBox, text = text, type = type, timeout = timeout, close_on_any_key = True) def AddPopupWithCallback(fnc, text, type, timeout, id = None): if id is not None: RemovePopup(id) print "AddPopup, id =", id AddNotificationWithIDCallback(fnc, id, MessageBox, text = text, type = type, timeout = timeout, close_on_any_key = False)
gpl-2.0
lauri-codes/GameShop
gameshop/game/facebook.py
1
21613
#!/usr/bin/env python # # Copyright 2010 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Python client library for the Facebook Platform. This client library is designed to support the Graph API and the official Facebook JavaScript SDK, which is the canonical way to implement Facebook authentication. Read more about the Graph API at http://developers.facebook.com/docs/api. You can download the Facebook JavaScript SDK at http://github.com/facebook/connect-js/. If your application is using Google AppEngine's webapp framework, your usage of this module might look like this: user = facebook.get_user_from_cookie(self.request.cookies, key, secret) if user: graph = facebook.GraphAPI(user["access_token"]) profile = graph.get_object("me") friends = graph.get_connections("me", "friends") """ import urllib import urllib2 import httplib import hashlib import hmac import base64 import logging import socket # Find a JSON parser try: import simplejson as json except ImportError: try: from django.utils import simplejson as json except ImportError: import json _parse_json = json.loads # Find a query string parser try: from urlparse import parse_qs except ImportError: from cgi import parse_qs class GraphAPI(object): """A client for the Facebook Graph API. See http://developers.facebook.com/docs/api for complete documentation for the API. The Graph API is made up of the objects in Facebook (e.g., people, pages, events, photos) and the connections between them (e.g., friends, photo tags, and event RSVPs). This client provides access to those primitive types in a generic way. For example, given an OAuth access token, this will fetch the profile of the active user and the list of the user's friends: graph = facebook.GraphAPI(access_token) user = graph.get_object("me") friends = graph.get_connections(user["id"], "friends") You can see a list of all of the objects and connections supported by the API at http://developers.facebook.com/docs/reference/api/. You can obtain an access token via OAuth or by using the Facebook JavaScript SDK. See http://developers.facebook.com/docs/authentication/ for details. If you are using the JavaScript SDK, you can use the get_user_from_cookie() method below to get the OAuth access token for the active user from the cookie saved by the SDK. """ def __init__(self, access_token=None, timeout=None): self.access_token = access_token self.timeout = timeout def get_object(self, id, **args): """Fetchs the given object from the graph.""" return self.request(id, args) def get_objects(self, ids, **args): """Fetchs all of the given object from the graph. We return a map from ID to object. If any of the IDs are invalid, we raise an exception. """ args["ids"] = ",".join(ids) return self.request("", args) def get_connections(self, id, connection_name, **args): """Fetchs the connections for given object.""" return self.request(id + "/" + connection_name, args) def put_object(self, parent_object, connection_name, **data): """Writes the given object to the graph, connected to the given parent. For example, graph.put_object("me", "feed", message="Hello, world") writes "Hello, world" to the active user's wall. Likewise, this will comment on a the first post of the active user's feed: feed = graph.get_connections("me", "feed") post = feed["data"][0] graph.put_object(post["id"], "comments", message="First!") See http://developers.facebook.com/docs/api#publishing for all of the supported writeable objects. Certain write operations require extended permissions. For example, publishing to a user's feed requires the "publish_actions" permission. See http://developers.facebook.com/docs/publishing/ for details about publishing permissions. """ assert self.access_token, "Write operations require an access token" return self.request(parent_object + "/" + connection_name, post_args=data) def put_wall_post(self, message, attachment={}, profile_id="me"): """Writes a wall post to the given profile's wall. We default to writing to the authenticated user's wall if no profile_id is specified. attachment adds a structured attachment to the status message being posted to the Wall. It should be a dictionary of the form: {"name": "Link name" "link": "http://www.example.com/", "caption": "{*actor*} posted a new review", "description": "This is a longer description of the attachment", "picture": "http://www.example.com/thumbnail.jpg"} """ return self.put_object(profile_id, "feed", message=message, **attachment) def put_comment(self, object_id, message): """Writes the given comment on the given post.""" return self.put_object(object_id, "comments", message=message) def put_like(self, object_id): """Likes the given post.""" return self.put_object(object_id, "likes") def delete_object(self, id): """Deletes the object with the given ID from the graph.""" self.request(id, post_args={"method": "delete"}) def delete_request(self, user_id, request_id): """Deletes the Request with the given ID for the given user.""" conn = httplib.HTTPSConnection('graph.facebook.com') url = '/%s_%s?%s' % ( request_id, user_id, urllib.urlencode({'access_token': self.access_token}), ) conn.request('DELETE', url) response = conn.getresponse() data = response.read() response = _parse_json(data) # Raise an error if we got one, but don't not if Facebook just # gave us a Bool value if (response and isinstance(response, dict) and response.get("error")): raise GraphAPIError(response) conn.close() def put_photo(self, image, message=None, album_id=None, **kwargs): """Uploads an image using multipart/form-data. image=File like object for the image message=Caption for your image album_id=None posts to /me/photos which uses or creates and uses an album for your application. """ object_id = album_id or "me" #it would have been nice to reuse self.request; #but multipart is messy in urllib post_args = { 'access_token': self.access_token, 'source': image, 'message': message } post_args.update(kwargs) content_type, body = self._encode_multipart_form(post_args) req = urllib2.Request(("https://graph.facebook.com/%s/photos" % object_id), data=body) req.add_header('Content-Type', content_type) try: data = urllib2.urlopen(req).read() #For Python 3 use this: except urllib2.HTTPError as e: #except urllib2.HTTPError, e: data = e.read() # Facebook sends OAuth errors as 400, and urllib2 # throws an exception, we want a GraphAPIError try: response = _parse_json(data) # Raise an error if we got one, but don't not if Facebook just # gave us a Bool value if (response and isinstance(response, dict) and response.get("error")): raise GraphAPIError(response) except ValueError: response = data return response # based on: http://code.activestate.com/recipes/146306/ def _encode_multipart_form(self, fields): """Encode files as 'multipart/form-data'. Fields are a dict of form name-> value. For files, value should be a file object. Other file-like objects might work and a fake name will be chosen. Returns (content_type, body) ready for httplib.HTTP instance. """ BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' CRLF = '\r\n' L = [] for (key, value) in fields.items(): logging.debug("Encoding %s, (%s)%s" % (key, type(value), value)) if not value: continue L.append('--' + BOUNDARY) if hasattr(value, 'read') and callable(value.read): filename = getattr(value, 'name', '%s.jpg' % key) L.append(('Content-Disposition: form-data;' 'name="%s";' 'filename="%s"') % (key, filename)) L.append('Content-Type: image/jpeg') value = value.read() logging.debug(type(value)) else: L.append('Content-Disposition: form-data; name="%s"' % key) L.append('') if isinstance(value, unicode): logging.debug("Convert to ascii") value = value.encode('ascii') L.append(value) L.append('--' + BOUNDARY + '--') L.append('') body = CRLF.join(L) content_type = 'multipart/form-data; boundary=%s' % BOUNDARY return content_type, body def request(self, path, args=None, post_args=None): """Fetches the given path in the Graph API. We translate args to a valid query string. If post_args is given, we send a POST request to the given path with the given arguments. """ args = args or {} if self.access_token: if post_args is not None: post_args["access_token"] = self.access_token else: args["access_token"] = self.access_token post_data = None if post_args is None else urllib.urlencode(post_args) try: file = urllib2.urlopen("https://graph.facebook.com/" + path + "?" + urllib.urlencode(args), post_data, timeout=self.timeout) except urllib2.HTTPError as e: response = _parse_json(e.read()) raise GraphAPIError(response) except TypeError: # Timeout support for Python <2.6 if self.timeout: socket.setdefaulttimeout(self.timeout) file = urllib2.urlopen("https://graph.facebook.com/" + path + "?" + urllib.urlencode(args), post_data) try: fileInfo = file.info() if fileInfo.maintype == 'text': response = _parse_json(file.read()) elif fileInfo.maintype == 'image': mimetype = fileInfo['content-type'] response = { "data": file.read(), "mime-type": mimetype, "url": file.url, } else: raise GraphAPIError('Maintype was not text or image') finally: file.close() if response and isinstance(response, dict) and response.get("error"): raise GraphAPIError(response["error"]["type"], response["error"]["message"]) return response def api_request(self, path, args=None, post_args=None): """Fetches the given path in the Graph API. We translate args to a valid query string. If post_args is given, we send a POST request to the given path with the given arguments. """ args = args or {} if self.access_token: if post_args is not None: post_args["access_token"] = self.access_token else: args["access_token"] = self.access_token if self.api_key: if post_args is not None: post_args["api_key"] = self.api_key else: args["api_key"] = self.api_key if post_args is not None: post_args["format"] = "json-strings" else: args["format"] = "json-strings" post_data = None if post_args is None else urllib.urlencode(post_args) try: file = urllib.urlopen("https://api.facebook.com/method/" + path + "?" + urllib.urlencode(args), post_data, timeout=self.timeout) except TypeError: # Timeout support for Python <2.6 if self.timeout: socket.setdefaulttimeout(self.timeout) file = urllib.urlopen("https://api.facebook.com/method/" + path + "?" + urllib.urlencode(args), post_data) try: response = _parse_json(file.read()) finally: file.close() if response and response.get("error"): raise GraphAPIError(response) return response def fql(self, query, args=None, post_args=None): """FQL query. Example query: "SELECT affiliations FROM user WHERE uid = me()" """ args = args or {} if self.access_token: if post_args is not None: post_args["access_token"] = self.access_token else: args["access_token"] = self.access_token post_data = None if post_args is None else urllib.urlencode(post_args) """Check if query is a dict and use the multiquery method else use single query """ if not isinstance(query, basestring): args["queries"] = query fql_method = 'fql.multiquery' else: args["query"] = query fql_method = 'fql.query' args["format"] = "json" try: file = urllib2.urlopen("https://api.facebook.com/method/" + fql_method + "?" + urllib.urlencode(args), post_data, timeout=self.timeout) except TypeError: # Timeout support for Python <2.6 if self.timeout: socket.setdefaulttimeout(self.timeout) file = urllib2.urlopen("https://api.facebook.com/method/" + fql_method + "?" + urllib.urlencode(args), post_data) try: content = file.read() response = _parse_json(content) #Return a list if success, return a dictionary if failed if type(response) is dict and "error_code" in response: raise GraphAPIError(response) except Exception as e: raise e finally: file.close() return response def extend_access_token(self, app_id, app_secret): """ Extends the expiration time of a valid OAuth access token. See <https://developers.facebook.com/roadmap/offline-access-removal/ #extend_token> """ args = { "client_id": app_id, "client_secret": app_secret, "grant_type": "fb_exchange_token", "fb_exchange_token": self.access_token, } response = urllib.urlopen("https://graph.facebook.com/oauth/" "access_token?" + urllib.urlencode(args)).read() query_str = parse_qs(response) if "access_token" in query_str: result = {"access_token": query_str["access_token"][0]} if "expires" in query_str: result["expires"] = query_str["expires"][0] return result else: response = json.loads(response) raise GraphAPIError(response) class GraphAPIError(Exception): def __init__(self, result): #Exception.__init__(self, message) #self.type = type self.result = result try: self.type = result["error_code"] except: self.type = "" # OAuth 2.0 Draft 10 try: self.message = result["error_description"] except: # OAuth 2.0 Draft 00 try: self.message = result["error"]["message"] except: # REST server style try: self.message = result["error_msg"] except: self.message = result Exception.__init__(self, self.message) def get_user_from_cookie(cookies, app_id, app_secret): """Parses the cookie set by the official Facebook JavaScript SDK. cookies should be a dictionary-like object mapping cookie names to cookie values. If the user is logged in via Facebook, we return a dictionary with the keys "uid" and "access_token". The former is the user's Facebook ID, and the latter can be used to make authenticated requests to the Graph API. If the user is not logged in, we return None. Download the official Facebook JavaScript SDK at http://github.com/facebook/connect-js/. Read more about Facebook authentication at http://developers.facebook.com/docs/authentication/. """ cookie = cookies.get("fbsr_" + app_id, "") if not cookie: return None parsed_request = parse_signed_request(cookie, app_secret) try: result = get_access_token_from_code(parsed_request["code"], "", app_id, app_secret) except GraphAPIError: return None result["uid"] = parsed_request["user_id"] return result def parse_signed_request(signed_request, app_secret): """ Return dictionary with signed request data. We return a dictionary containing the information in the signed_request. This includes a user_id if the user has authorised your application, as well as any information requested. If the signed_request is malformed or corrupted, False is returned. """ try: l = signed_request.split('.', 2) encoded_sig = str(l[0]) payload = str(l[1]) sig = base64.urlsafe_b64decode(encoded_sig + "=" * ((4 - len(encoded_sig) % 4) % 4)) data = base64.urlsafe_b64decode(payload + "=" * ((4 - len(payload) % 4) % 4)) except IndexError: # Signed request was malformed. return False except TypeError: # Signed request had a corrupted payload. return False data = _parse_json(data) if data.get('algorithm', '').upper() != 'HMAC-SHA256': return False # HMAC can only handle ascii (byte) strings # http://bugs.python.org/issue5285 app_secret = app_secret.encode('ascii') payload = payload.encode('ascii') expected_sig = hmac.new(app_secret, msg=payload, digestmod=hashlib.sha256).digest() if sig != expected_sig: return False return data def auth_url(app_id, canvas_url, perms=None, state=None): url = "https://www.facebook.com/dialog/oauth?" kvps = {'client_id': app_id, 'redirect_uri': canvas_url} if perms: kvps['scope'] = ",".join(perms) if state: kvps['state'] = state return url + urllib.urlencode(kvps) def get_access_token_from_code(code, redirect_uri, app_id, app_secret): """Get an access token from the "code" returned from an OAuth dialog. Returns a dict containing the user-specific access token and its expiration date (if applicable). """ args = { "code": code, "redirect_uri": redirect_uri, "client_id": app_id, "client_secret": app_secret, } # We would use GraphAPI.request() here, except for that the fact # that the response is a key-value pair, and not JSON. response = urllib.urlopen("https://graph.facebook.com/oauth/access_token" + "?" + urllib.urlencode(args)).read() query_str = parse_qs(response) if "access_token" in query_str: result = {"access_token": query_str["access_token"][0]} if "expires" in query_str: result["expires"] = query_str["expires"][0] return result else: response = json.loads(response) raise GraphAPIError(response) def get_app_access_token(app_id, app_secret): """Get the access_token for the app. This token can be used for insights and creating test users. app_id = retrieved from the developer page app_secret = retrieved from the developer page Returns the application access_token. """ # Get an app access token args = {'grant_type': 'client_credentials', 'client_id': app_id, 'client_secret': app_secret} file = urllib2.urlopen("https://graph.facebook.com/oauth/access_token?" + urllib.urlencode(args)) try: result = file.read().split("=")[1] finally: file.close() return result
gpl-2.0
hasanferit/trumpcrawler
crawlenv/lib/python3.5/site-packages/pip/compat/__init__.py
342
4672
"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import os import sys from pip._vendor.six import text_type try: from logging.config import dictConfig as logging_dictConfig except ImportError: from pip.compat.dictconfig import dictConfig as logging_dictConfig try: from collections import OrderedDict except ImportError: from pip._vendor.ordereddict import OrderedDict try: import ipaddress except ImportError: try: from pip._vendor import ipaddress except ImportError: import ipaddr as ipaddress ipaddress.ip_address = ipaddress.IPAddress ipaddress.ip_network = ipaddress.IPNetwork try: import sysconfig def get_stdlib(): paths = [ sysconfig.get_path("stdlib"), sysconfig.get_path("platstdlib"), ] return set(filter(bool, paths)) except ImportError: from distutils import sysconfig def get_stdlib(): paths = [ sysconfig.get_python_lib(standard_lib=True), sysconfig.get_python_lib(standard_lib=True, plat_specific=True), ] return set(filter(bool, paths)) __all__ = [ "logging_dictConfig", "ipaddress", "uses_pycache", "console_to_str", "native_str", "get_path_uid", "stdlib_pkgs", "WINDOWS", "samefile", "OrderedDict", ] if sys.version_info >= (3, 4): uses_pycache = True from importlib.util import cache_from_source else: import imp uses_pycache = hasattr(imp, 'cache_from_source') if uses_pycache: cache_from_source = imp.cache_from_source else: cache_from_source = None if sys.version_info >= (3,): def console_to_str(s): try: return s.decode(sys.__stdout__.encoding) except UnicodeDecodeError: return s.decode('utf_8') def native_str(s, replace=False): if isinstance(s, bytes): return s.decode('utf-8', 'replace' if replace else 'strict') return s else: def console_to_str(s): return s def native_str(s, replace=False): # Replace is ignored -- unicode to UTF-8 can't fail if isinstance(s, text_type): return s.encode('utf-8') return s def total_seconds(td): if hasattr(td, "total_seconds"): return td.total_seconds() else: val = td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6 return val / 10 ** 6 def get_path_uid(path): """ Return path's uid. Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003 Placed this function in compat due to differences on AIX and Jython, that should eventually go away. :raises OSError: When path is a symlink or can't be read. """ if hasattr(os, 'O_NOFOLLOW'): fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW) file_uid = os.fstat(fd).st_uid os.close(fd) else: # AIX and Jython # WARNING: time of check vulnerability, but best we can do w/o NOFOLLOW if not os.path.islink(path): # older versions of Jython don't have `os.fstat` file_uid = os.stat(path).st_uid else: # raise OSError for parity with os.O_NOFOLLOW above raise OSError( "%s is a symlink; Will not return uid for symlinks" % path ) return file_uid def expanduser(path): """ Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 """ expanded = os.path.expanduser(path) if path.startswith('~/') and expanded.startswith('//'): expanded = expanded[1:] return expanded # packages in the stdlib that may have installation metadata, but should not be # considered 'installed'. this theoretically could be determined based on # dist.location (py27:`sysconfig.get_paths()['stdlib']`, # py26:sysconfig.get_config_vars('LIBDEST')), but fear platform variation may # make this ineffective, so hard-coding stdlib_pkgs = ('python', 'wsgiref') if sys.version_info >= (2, 7): stdlib_pkgs += ('argparse',) # windows detection, covers cpython and ironpython WINDOWS = (sys.platform.startswith("win") or (sys.platform == 'cli' and os.name == 'nt')) def samefile(file1, file2): """Provide an alternative for os.path.samefile on Windows/Python2""" if hasattr(os.path, 'samefile'): return os.path.samefile(file1, file2) else: path1 = os.path.normcase(os.path.abspath(file1)) path2 = os.path.normcase(os.path.abspath(file2)) return path1 == path2
mit
google/ml_collections
ml_collections/config_flags/tests/mini_config.py
1
1067
# Copyright 2021 The ML Collections Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Lint as: python 3 """Dummy Config file.""" class MiniConfig(object): """Just a dummy config.""" def __init__(self): self.dict = {} self.field = False def __getitem__(self, key): return self.dict[key] def __contains__(self, key): return key in self.dict def __setitem__(self, key, value): self.dict[key] = value def get_config(): cfg = MiniConfig() cfg['entry_with_collision'] = False cfg.entry_with_collision = True return cfg
apache-2.0
GenericStudent/home-assistant
homeassistant/components/w800rf32/binary_sensor.py
21
4040
"""Support for w800rf32 binary sensors.""" import logging import W800rf32 as w800 import voluptuous as vol from homeassistant.components.binary_sensor import ( DEVICE_CLASSES_SCHEMA, PLATFORM_SCHEMA, BinarySensorEntity, ) from homeassistant.const import CONF_DEVICE_CLASS, CONF_DEVICES, CONF_NAME from homeassistant.core import callback from homeassistant.helpers import config_validation as cv, event as evt from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.util import dt as dt_util from . import W800RF32_DEVICE _LOGGER = logging.getLogger(__name__) CONF_OFF_DELAY = "off_delay" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_DEVICES): { cv.string: vol.Schema( { vol.Optional(CONF_NAME): cv.string, vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA, vol.Optional(CONF_OFF_DELAY): vol.All( cv.time_period, cv.positive_timedelta ), } ) } }, extra=vol.ALLOW_EXTRA, ) async def async_setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Binary Sensor platform to w800rf32.""" binary_sensors = [] # device_id --> "c1 or a3" X10 device. entity (type dictionary) # --> name, device_class etc for device_id, entity in config[CONF_DEVICES].items(): _LOGGER.debug( "Add %s w800rf32.binary_sensor (class %s)", entity[CONF_NAME], entity.get(CONF_DEVICE_CLASS), ) device = W800rf32BinarySensor( device_id, entity.get(CONF_NAME), entity.get(CONF_DEVICE_CLASS), entity.get(CONF_OFF_DELAY), ) binary_sensors.append(device) add_entities(binary_sensors) class W800rf32BinarySensor(BinarySensorEntity): """A representation of a w800rf32 binary sensor.""" def __init__(self, device_id, name, device_class=None, off_delay=None): """Initialize the w800rf32 sensor.""" self._signal = W800RF32_DEVICE.format(device_id) self._name = name self._device_class = device_class self._off_delay = off_delay self._state = False self._delay_listener = None @callback def _off_delay_listener(self, now): """Switch device off after a delay.""" self._delay_listener = None self.update_state(False) @property def name(self): """Return the device name.""" return self._name @property def should_poll(self): """No polling needed.""" return False @property def device_class(self): """Return the sensor class.""" return self._device_class @property def is_on(self): """Return true if the sensor state is True.""" return self._state @callback def binary_sensor_update(self, event): """Call for control updates from the w800rf32 gateway.""" if not isinstance(event, w800.W800rf32Event): return dev_id = event.device command = event.command _LOGGER.debug( "BinarySensor update (Device ID: %s Command %s ...)", dev_id, command ) # Update the w800rf32 device state if command in ("On", "Off"): is_on = command == "On" self.update_state(is_on) if self.is_on and self._off_delay is not None and self._delay_listener is None: self._delay_listener = evt.async_track_point_in_time( self.hass, self._off_delay_listener, dt_util.utcnow() + self._off_delay ) def update_state(self, state): """Update the state of the device.""" self._state = state self.async_write_ha_state() async def async_added_to_hass(self): """Register update callback.""" async_dispatcher_connect(self.hass, self._signal, self.binary_sensor_update)
apache-2.0
cytec/Sick-Beard
lib/sqlalchemy/dialects/mysql/base.py
12
98649
# mysql/base.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Support for the MySQL database. Supported Versions and Features ------------------------------- SQLAlchemy supports 6 major MySQL versions: 3.23, 4.0, 4.1, 5.0, 5.1 and 6.0, with capabilities increasing with more modern servers. Versions 4.1 and higher support the basic SQL functionality that SQLAlchemy uses in the ORM and SQL expressions. These versions pass the applicable tests in the suite 100%. No heroic measures are taken to work around major missing SQL features- if your server version does not support sub-selects, for example, they won't work in SQLAlchemy either. Most available DBAPI drivers are supported; see below. ===================================== =============== Feature Minimum Version ===================================== =============== sqlalchemy.orm 4.1.1 Table Reflection 3.23.x DDL Generation 4.1.1 utf8/Full Unicode Connections 4.1.1 Transactions 3.23.15 Two-Phase Transactions 5.0.3 Nested Transactions 5.0.3 ===================================== =============== See the official MySQL documentation for detailed information about features supported in any given server release. Connecting ---------- See the API documentation on individual drivers for details on connecting. Connection Timeouts ------------------- MySQL features an automatic connection close behavior, for connections that have been idle for eight hours or more. To circumvent having this issue, use the ``pool_recycle`` option which controls the maximum age of any connection:: engine = create_engine('mysql+mysqldb://...', pool_recycle=3600) Storage Engines --------------- Most MySQL server installations have a default table type of ``MyISAM``, a non-transactional table type. During a transaction, non-transactional storage engines do not participate and continue to store table changes in autocommit mode. For fully atomic transactions, all participating tables must use a transactional engine such as ``InnoDB``, ``Falcon``, ``SolidDB``, `PBXT`, etc. Storage engines can be elected when creating tables in SQLAlchemy by supplying a ``mysql_engine='whatever'`` to the ``Table`` constructor. Any MySQL table creation option can be specified in this syntax:: Table('mytable', metadata, Column('data', String(32)), mysql_engine='InnoDB', mysql_charset='utf8' ) Case Sensitivity and Table Reflection ------------------------------------- MySQL has inconsistent support for case-sensitive identifier names, basing support on specific details of the underlying operating system. However, it has been observed that no matter what case sensitivity behavior is present, the names of tables in foreign key declarations are *always* received from the database as all-lower case, making it impossible to accurately reflect a schema where inter-related tables use mixed-case identifier names. Therefore it is strongly advised that table names be declared as all lower case both within SQLAlchemy as well as on the MySQL database itself, especially if database reflection features are to be used. Transaction Isolation Level --------------------------- :func:`.create_engine` accepts an ``isolation_level`` parameter which results in the command ``SET SESSION TRANSACTION ISOLATION LEVEL <level>`` being invoked for every new connection. Valid values for this parameter are ``READ COMMITTED``, ``READ UNCOMMITTED``, ``REPEATABLE READ``, and ``SERIALIZABLE``:: engine = create_engine( "mysql://scott:tiger@localhost/test", isolation_level="READ UNCOMMITTED" ) (new in 0.7.6) Keys ---- Not all MySQL storage engines support foreign keys. For ``MyISAM`` and similar engines, the information loaded by table reflection will not include foreign keys. For these tables, you may supply a :class:`~sqlalchemy.ForeignKeyConstraint` at reflection time:: Table('mytable', metadata, ForeignKeyConstraint(['other_id'], ['othertable.other_id']), autoload=True ) When creating tables, SQLAlchemy will automatically set ``AUTO_INCREMENT`` on an integer primary key column:: >>> t = Table('mytable', metadata, ... Column('mytable_id', Integer, primary_key=True) ... ) >>> t.create() CREATE TABLE mytable ( id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) You can disable this behavior by supplying ``autoincrement=False`` to the :class:`~sqlalchemy.Column`. This flag can also be used to enable auto-increment on a secondary column in a multi-column key for some storage engines:: Table('mytable', metadata, Column('gid', Integer, primary_key=True, autoincrement=False), Column('id', Integer, primary_key=True) ) SQL Mode -------- MySQL SQL modes are supported. Modes that enable ``ANSI_QUOTES`` (such as ``ANSI``) require an engine option to modify SQLAlchemy's quoting style. When using an ANSI-quoting mode, supply ``use_ansiquotes=True`` when creating your ``Engine``:: create_engine('mysql://localhost/test', use_ansiquotes=True) This is an engine-wide option and is not toggleable on a per-connection basis. SQLAlchemy does not presume to ``SET sql_mode`` for you with this option. For the best performance, set the quoting style server-wide in ``my.cnf`` or by supplying ``--sql-mode`` to ``mysqld``. You can also use a :class:`sqlalchemy.pool.Pool` listener hook to issue a ``SET SESSION sql_mode='...'`` on connect to configure each connection. If you do not specify ``use_ansiquotes``, the regular MySQL quoting style is used by default. If you do issue a ``SET sql_mode`` through SQLAlchemy, the dialect must be updated if the quoting style is changed. Again, this change will affect all connections:: connection.execute('SET sql_mode="ansi"') connection.dialect.use_ansiquotes = True MySQL SQL Extensions -------------------- Many of the MySQL SQL extensions are handled through SQLAlchemy's generic function and operator support:: table.select(table.c.password==func.md5('plaintext')) table.select(table.c.username.op('regexp')('^[a-d]')) And of course any valid MySQL statement can be executed as a string as well. Some limited direct support for MySQL extensions to SQL is currently available. * SELECT pragma:: select(..., prefixes=['HIGH_PRIORITY', 'SQL_SMALL_RESULT']) * UPDATE with LIMIT:: update(..., mysql_limit=10) CAST Support ------------ MySQL documents the CAST operator as available in version 4.0.2. When using the SQLAlchemy :func:`.cast` function, SQLAlchemy will not render the CAST token on MySQL before this version, based on server version detection, instead rendering the internal expression directly. CAST may still not be desirable on an early MySQL version post-4.0.2, as it didn't add all datatype support until 4.1.1. If your application falls into this narrow area, the behavior of CAST can be controlled using the :ref:`sqlalchemy.ext.compiler_toplevel` system, as per the recipe below:: from sqlalchemy.sql.expression import _Cast from sqlalchemy.ext.compiler import compiles @compiles(_Cast, 'mysql') def _check_mysql_version(element, compiler, **kw): if compiler.dialect.server_version_info < (4, 1, 0): return compiler.process(element.clause, **kw) else: return compiler.visit_cast(element, **kw) The above function, which only needs to be declared once within an application, overrides the compilation of the :func:`.cast` construct to check for version 4.1.0 before fully rendering CAST; else the internal element of the construct is rendered directly. .. _mysql_indexes: MySQL Specific Index Options ---------------------------- MySQL-specific extensions to the :class:`.Index` construct are available. Index Length ~~~~~~~~~~~~~ MySQL provides an option to create index entries with a certain length, where "length" refers to the number of characters or bytes in each value which will become part of the index. SQLAlchemy provides this feature via the ``mysql_length`` parameter:: Index('my_index', my_table.c.data, mysql_length=10) Prefix lengths are given in characters for nonbinary string types and in bytes for binary string types. The value passed to the keyword argument will be simply passed through to the underlying CREATE INDEX command, so it *must* be an integer. MySQL only allows a length for an index if it is for a CHAR, VARCHAR, TEXT, BINARY, VARBINARY and BLOB. Index Types ~~~~~~~~~~~~~ Some MySQL storage engines permit you to specify an index type when creating an index or primary key constraint. SQLAlchemy provides this feature via the ``mysql_using`` parameter on :class:`.Index`:: Index('my_index', my_table.c.data, mysql_using='hash') As well as the ``mysql_using`` parameter on :class:`.PrimaryKeyConstraint`:: PrimaryKeyConstraint("data", mysql_using='hash') The value passed to the keyword argument will be simply passed through to the underlying CREATE INDEX or PRIMARY KEY clause, so it *must* be a valid index type for your MySQL storage engine. More information can be found at: http://dev.mysql.com/doc/refman/5.0/en/create-index.html http://dev.mysql.com/doc/refman/5.0/en/create-table.html """ import datetime, inspect, re, sys from sqlalchemy import schema as sa_schema from sqlalchemy import exc, log, sql, util from sqlalchemy.sql import operators as sql_operators from sqlalchemy.sql import functions as sql_functions from sqlalchemy.sql import compiler from array import array as _array from sqlalchemy.engine import reflection from sqlalchemy.engine import base as engine_base, default from sqlalchemy import types as sqltypes from sqlalchemy.util import topological from sqlalchemy.types import DATE, DATETIME, BOOLEAN, TIME, \ BLOB, BINARY, VARBINARY RESERVED_WORDS = set( ['accessible', 'add', 'all', 'alter', 'analyze','and', 'as', 'asc', 'asensitive', 'before', 'between', 'bigint', 'binary', 'blob', 'both', 'by', 'call', 'cascade', 'case', 'change', 'char', 'character', 'check', 'collate', 'column', 'condition', 'constraint', 'continue', 'convert', 'create', 'cross', 'current_date', 'current_time', 'current_timestamp', 'current_user', 'cursor', 'database', 'databases', 'day_hour', 'day_microsecond', 'day_minute', 'day_second', 'dec', 'decimal', 'declare', 'default', 'delayed', 'delete', 'desc', 'describe', 'deterministic', 'distinct', 'distinctrow', 'div', 'double', 'drop', 'dual', 'each', 'else', 'elseif', 'enclosed', 'escaped', 'exists', 'exit', 'explain', 'false', 'fetch', 'float', 'float4', 'float8', 'for', 'force', 'foreign', 'from', 'fulltext', 'grant', 'group', 'having', 'high_priority', 'hour_microsecond', 'hour_minute', 'hour_second', 'if', 'ignore', 'in', 'index', 'infile', 'inner', 'inout', 'insensitive', 'insert', 'int', 'int1', 'int2', 'int3', 'int4', 'int8', 'integer', 'interval', 'into', 'is', 'iterate', 'join', 'key', 'keys', 'kill', 'leading', 'leave', 'left', 'like', 'limit', 'linear', 'lines', 'load', 'localtime', 'localtimestamp', 'lock', 'long', 'longblob', 'longtext', 'loop', 'low_priority', 'master_ssl_verify_server_cert', 'match', 'mediumblob', 'mediumint', 'mediumtext', 'middleint', 'minute_microsecond', 'minute_second', 'mod', 'modifies', 'natural', 'not', 'no_write_to_binlog', 'null', 'numeric', 'on', 'optimize', 'option', 'optionally', 'or', 'order', 'out', 'outer', 'outfile', 'precision', 'primary', 'procedure', 'purge', 'range', 'read', 'reads', 'read_only', 'read_write', 'real', 'references', 'regexp', 'release', 'rename', 'repeat', 'replace', 'require', 'restrict', 'return', 'revoke', 'right', 'rlike', 'schema', 'schemas', 'second_microsecond', 'select', 'sensitive', 'separator', 'set', 'show', 'smallint', 'spatial', 'specific', 'sql', 'sqlexception', 'sqlstate', 'sqlwarning', 'sql_big_result', 'sql_calc_found_rows', 'sql_small_result', 'ssl', 'starting', 'straight_join', 'table', 'terminated', 'then', 'tinyblob', 'tinyint', 'tinytext', 'to', 'trailing', 'trigger', 'true', 'undo', 'union', 'unique', 'unlock', 'unsigned', 'update', 'usage', 'use', 'using', 'utc_date', 'utc_time', 'utc_timestamp', 'values', 'varbinary', 'varchar', 'varcharacter', 'varying', 'when', 'where', 'while', 'with', 'write', 'x509', 'xor', 'year_month', 'zerofill', # 5.0 'columns', 'fields', 'privileges', 'soname', 'tables', # 4.1 'accessible', 'linear', 'master_ssl_verify_server_cert', 'range', 'read_only', 'read_write', # 5.1 ]) AUTOCOMMIT_RE = re.compile( r'\s*(?:UPDATE|INSERT|CREATE|DELETE|DROP|ALTER|LOAD +DATA|REPLACE)', re.I | re.UNICODE) SET_RE = re.compile( r'\s*SET\s+(?:(?:GLOBAL|SESSION)\s+)?\w', re.I | re.UNICODE) class _NumericType(object): """Base for MySQL numeric types.""" def __init__(self, unsigned=False, zerofill=False, **kw): self.unsigned = unsigned self.zerofill = zerofill super(_NumericType, self).__init__(**kw) class _FloatType(_NumericType, sqltypes.Float): def __init__(self, precision=None, scale=None, asdecimal=True, **kw): if isinstance(self, (REAL, DOUBLE)) and \ ( (precision is None and scale is not None) or (precision is not None and scale is None) ): raise exc.ArgumentError( "You must specify both precision and scale or omit " "both altogether.") super(_FloatType, self).__init__(precision=precision, asdecimal=asdecimal, **kw) self.scale = scale class _IntegerType(_NumericType, sqltypes.Integer): def __init__(self, display_width=None, **kw): self.display_width = display_width super(_IntegerType, self).__init__(**kw) class _StringType(sqltypes.String): """Base for MySQL string types.""" def __init__(self, charset=None, collation=None, ascii=False, binary=False, national=False, **kw): self.charset = charset # allow collate= or collation= self.collation = kw.pop('collate', collation) self.ascii = ascii # We have to munge the 'unicode' param strictly as a dict # otherwise 2to3 will turn it into str. self.__dict__['unicode'] = kw.get('unicode', False) # sqltypes.String does not accept the 'unicode' arg at all. if 'unicode' in kw: del kw['unicode'] self.binary = binary self.national = national super(_StringType, self).__init__(**kw) def __repr__(self): attributes = inspect.getargspec(self.__init__)[0][1:] attributes.extend(inspect.getargspec(_StringType.__init__)[0][1:]) params = {} for attr in attributes: val = getattr(self, attr) if val is not None and val is not False: params[attr] = val return "%s(%s)" % (self.__class__.__name__, ', '.join(['%s=%r' % (k, params[k]) for k in params])) class NUMERIC(_NumericType, sqltypes.NUMERIC): """MySQL NUMERIC type.""" __visit_name__ = 'NUMERIC' def __init__(self, precision=None, scale=None, asdecimal=True, **kw): """Construct a NUMERIC. :param precision: Total digits in this number. If scale and precision are both None, values are stored to limits allowed by the server. :param scale: The number of digits after the decimal point. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(NUMERIC, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw) class DECIMAL(_NumericType, sqltypes.DECIMAL): """MySQL DECIMAL type.""" __visit_name__ = 'DECIMAL' def __init__(self, precision=None, scale=None, asdecimal=True, **kw): """Construct a DECIMAL. :param precision: Total digits in this number. If scale and precision are both None, values are stored to limits allowed by the server. :param scale: The number of digits after the decimal point. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(DECIMAL, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw) class DOUBLE(_FloatType): """MySQL DOUBLE type.""" __visit_name__ = 'DOUBLE' def __init__(self, precision=None, scale=None, asdecimal=True, **kw): """Construct a DOUBLE. :param precision: Total digits in this number. If scale and precision are both None, values are stored to limits allowed by the server. :param scale: The number of digits after the decimal point. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(DOUBLE, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw) class REAL(_FloatType, sqltypes.REAL): """MySQL REAL type.""" __visit_name__ = 'REAL' def __init__(self, precision=None, scale=None, asdecimal=True, **kw): """Construct a REAL. :param precision: Total digits in this number. If scale and precision are both None, values are stored to limits allowed by the server. :param scale: The number of digits after the decimal point. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(REAL, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw) class FLOAT(_FloatType, sqltypes.FLOAT): """MySQL FLOAT type.""" __visit_name__ = 'FLOAT' def __init__(self, precision=None, scale=None, asdecimal=False, **kw): """Construct a FLOAT. :param precision: Total digits in this number. If scale and precision are both None, values are stored to limits allowed by the server. :param scale: The number of digits after the decimal point. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(FLOAT, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw) def bind_processor(self, dialect): return None class INTEGER(_IntegerType, sqltypes.INTEGER): """MySQL INTEGER type.""" __visit_name__ = 'INTEGER' def __init__(self, display_width=None, **kw): """Construct an INTEGER. :param display_width: Optional, maximum display width for this number. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(INTEGER, self).__init__(display_width=display_width, **kw) class BIGINT(_IntegerType, sqltypes.BIGINT): """MySQL BIGINTEGER type.""" __visit_name__ = 'BIGINT' def __init__(self, display_width=None, **kw): """Construct a BIGINTEGER. :param display_width: Optional, maximum display width for this number. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(BIGINT, self).__init__(display_width=display_width, **kw) class MEDIUMINT(_IntegerType): """MySQL MEDIUMINTEGER type.""" __visit_name__ = 'MEDIUMINT' def __init__(self, display_width=None, **kw): """Construct a MEDIUMINTEGER :param display_width: Optional, maximum display width for this number. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(MEDIUMINT, self).__init__(display_width=display_width, **kw) class TINYINT(_IntegerType): """MySQL TINYINT type.""" __visit_name__ = 'TINYINT' def __init__(self, display_width=None, **kw): """Construct a TINYINT. Note: following the usual MySQL conventions, TINYINT(1) columns reflected during Table(..., autoload=True) are treated as Boolean columns. :param display_width: Optional, maximum display width for this number. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(TINYINT, self).__init__(display_width=display_width, **kw) class SMALLINT(_IntegerType, sqltypes.SMALLINT): """MySQL SMALLINTEGER type.""" __visit_name__ = 'SMALLINT' def __init__(self, display_width=None, **kw): """Construct a SMALLINTEGER. :param display_width: Optional, maximum display width for this number. :param unsigned: a boolean, optional. :param zerofill: Optional. If true, values will be stored as strings left-padded with zeros. Note that this does not effect the values returned by the underlying database API, which continue to be numeric. """ super(SMALLINT, self).__init__(display_width=display_width, **kw) class BIT(sqltypes.TypeEngine): """MySQL BIT type. This type is for MySQL 5.0.3 or greater for MyISAM, and 5.0.5 or greater for MyISAM, MEMORY, InnoDB and BDB. For older versions, use a MSTinyInteger() type. """ __visit_name__ = 'BIT' def __init__(self, length=None): """Construct a BIT. :param length: Optional, number of bits. """ self.length = length def result_processor(self, dialect, coltype): """Convert a MySQL's 64 bit, variable length binary string to a long. TODO: this is MySQL-db, pyodbc specific. OurSQL and mysqlconnector already do this, so this logic should be moved to those dialects. """ def process(value): if value is not None: v = 0L for i in map(ord, value): v = v << 8 | i return v return value return process class _MSTime(sqltypes.Time): """MySQL TIME type.""" __visit_name__ = 'TIME' def result_processor(self, dialect, coltype): time = datetime.time def process(value): # convert from a timedelta value if value is not None: seconds = value.seconds minutes = seconds / 60 return time(minutes / 60, minutes % 60, seconds - minutes * 60) else: return None return process class TIMESTAMP(sqltypes.TIMESTAMP): """MySQL TIMESTAMP type.""" __visit_name__ = 'TIMESTAMP' class YEAR(sqltypes.TypeEngine): """MySQL YEAR type, for single byte storage of years 1901-2155.""" __visit_name__ = 'YEAR' def __init__(self, display_width=None): self.display_width = display_width class TEXT(_StringType, sqltypes.TEXT): """MySQL TEXT type, for text up to 2^16 characters.""" __visit_name__ = 'TEXT' def __init__(self, length=None, **kw): """Construct a TEXT. :param length: Optional, if provided the server may optimize storage by substituting the smallest TEXT type sufficient to store ``length`` characters. :param charset: Optional, a column-level character set for this string value. Takes precedence to 'ascii' or 'unicode' short-hand. :param collation: Optional, a column-level collation for this string value. Takes precedence to 'binary' short-hand. :param ascii: Defaults to False: short-hand for the ``latin1`` character set, generates ASCII in schema. :param unicode: Defaults to False: short-hand for the ``ucs2`` character set, generates UNICODE in schema. :param national: Optional. If true, use the server's configured national character set. :param binary: Defaults to False: short-hand, pick the binary collation type that matches the column's character set. Generates BINARY in schema. This does not affect the type of data stored, only the collation of character data. """ super(TEXT, self).__init__(length=length, **kw) class TINYTEXT(_StringType): """MySQL TINYTEXT type, for text up to 2^8 characters.""" __visit_name__ = 'TINYTEXT' def __init__(self, **kwargs): """Construct a TINYTEXT. :param charset: Optional, a column-level character set for this string value. Takes precedence to 'ascii' or 'unicode' short-hand. :param collation: Optional, a column-level collation for this string value. Takes precedence to 'binary' short-hand. :param ascii: Defaults to False: short-hand for the ``latin1`` character set, generates ASCII in schema. :param unicode: Defaults to False: short-hand for the ``ucs2`` character set, generates UNICODE in schema. :param national: Optional. If true, use the server's configured national character set. :param binary: Defaults to False: short-hand, pick the binary collation type that matches the column's character set. Generates BINARY in schema. This does not affect the type of data stored, only the collation of character data. """ super(TINYTEXT, self).__init__(**kwargs) class MEDIUMTEXT(_StringType): """MySQL MEDIUMTEXT type, for text up to 2^24 characters.""" __visit_name__ = 'MEDIUMTEXT' def __init__(self, **kwargs): """Construct a MEDIUMTEXT. :param charset: Optional, a column-level character set for this string value. Takes precedence to 'ascii' or 'unicode' short-hand. :param collation: Optional, a column-level collation for this string value. Takes precedence to 'binary' short-hand. :param ascii: Defaults to False: short-hand for the ``latin1`` character set, generates ASCII in schema. :param unicode: Defaults to False: short-hand for the ``ucs2`` character set, generates UNICODE in schema. :param national: Optional. If true, use the server's configured national character set. :param binary: Defaults to False: short-hand, pick the binary collation type that matches the column's character set. Generates BINARY in schema. This does not affect the type of data stored, only the collation of character data. """ super(MEDIUMTEXT, self).__init__(**kwargs) class LONGTEXT(_StringType): """MySQL LONGTEXT type, for text up to 2^32 characters.""" __visit_name__ = 'LONGTEXT' def __init__(self, **kwargs): """Construct a LONGTEXT. :param charset: Optional, a column-level character set for this string value. Takes precedence to 'ascii' or 'unicode' short-hand. :param collation: Optional, a column-level collation for this string value. Takes precedence to 'binary' short-hand. :param ascii: Defaults to False: short-hand for the ``latin1`` character set, generates ASCII in schema. :param unicode: Defaults to False: short-hand for the ``ucs2`` character set, generates UNICODE in schema. :param national: Optional. If true, use the server's configured national character set. :param binary: Defaults to False: short-hand, pick the binary collation type that matches the column's character set. Generates BINARY in schema. This does not affect the type of data stored, only the collation of character data. """ super(LONGTEXT, self).__init__(**kwargs) class VARCHAR(_StringType, sqltypes.VARCHAR): """MySQL VARCHAR type, for variable-length character data.""" __visit_name__ = 'VARCHAR' def __init__(self, length=None, **kwargs): """Construct a VARCHAR. :param charset: Optional, a column-level character set for this string value. Takes precedence to 'ascii' or 'unicode' short-hand. :param collation: Optional, a column-level collation for this string value. Takes precedence to 'binary' short-hand. :param ascii: Defaults to False: short-hand for the ``latin1`` character set, generates ASCII in schema. :param unicode: Defaults to False: short-hand for the ``ucs2`` character set, generates UNICODE in schema. :param national: Optional. If true, use the server's configured national character set. :param binary: Defaults to False: short-hand, pick the binary collation type that matches the column's character set. Generates BINARY in schema. This does not affect the type of data stored, only the collation of character data. """ super(VARCHAR, self).__init__(length=length, **kwargs) class CHAR(_StringType, sqltypes.CHAR): """MySQL CHAR type, for fixed-length character data.""" __visit_name__ = 'CHAR' def __init__(self, length=None, **kwargs): """Construct a CHAR. :param length: Maximum data length, in characters. :param binary: Optional, use the default binary collation for the national character set. This does not affect the type of data stored, use a BINARY type for binary data. :param collation: Optional, request a particular collation. Must be compatible with the national character set. """ super(CHAR, self).__init__(length=length, **kwargs) class NVARCHAR(_StringType, sqltypes.NVARCHAR): """MySQL NVARCHAR type. For variable-length character data in the server's configured national character set. """ __visit_name__ = 'NVARCHAR' def __init__(self, length=None, **kwargs): """Construct an NVARCHAR. :param length: Maximum data length, in characters. :param binary: Optional, use the default binary collation for the national character set. This does not affect the type of data stored, use a BINARY type for binary data. :param collation: Optional, request a particular collation. Must be compatible with the national character set. """ kwargs['national'] = True super(NVARCHAR, self).__init__(length=length, **kwargs) class NCHAR(_StringType, sqltypes.NCHAR): """MySQL NCHAR type. For fixed-length character data in the server's configured national character set. """ __visit_name__ = 'NCHAR' def __init__(self, length=None, **kwargs): """Construct an NCHAR. :param length: Maximum data length, in characters. :param binary: Optional, use the default binary collation for the national character set. This does not affect the type of data stored, use a BINARY type for binary data. :param collation: Optional, request a particular collation. Must be compatible with the national character set. """ kwargs['national'] = True super(NCHAR, self).__init__(length=length, **kwargs) class TINYBLOB(sqltypes._Binary): """MySQL TINYBLOB type, for binary data up to 2^8 bytes.""" __visit_name__ = 'TINYBLOB' class MEDIUMBLOB(sqltypes._Binary): """MySQL MEDIUMBLOB type, for binary data up to 2^24 bytes.""" __visit_name__ = 'MEDIUMBLOB' class LONGBLOB(sqltypes._Binary): """MySQL LONGBLOB type, for binary data up to 2^32 bytes.""" __visit_name__ = 'LONGBLOB' class ENUM(sqltypes.Enum, _StringType): """MySQL ENUM type.""" __visit_name__ = 'ENUM' def __init__(self, *enums, **kw): """Construct an ENUM. Example: Column('myenum', MSEnum("foo", "bar", "baz")) :param enums: The range of valid values for this ENUM. Values will be quoted when generating the schema according to the quoting flag (see below). :param strict: Defaults to False: ensure that a given value is in this ENUM's range of permissible values when inserting or updating rows. Note that MySQL will not raise a fatal error if you attempt to store an out of range value- an alternate value will be stored instead. (See MySQL ENUM documentation.) :param charset: Optional, a column-level character set for this string value. Takes precedence to 'ascii' or 'unicode' short-hand. :param collation: Optional, a column-level collation for this string value. Takes precedence to 'binary' short-hand. :param ascii: Defaults to False: short-hand for the ``latin1`` character set, generates ASCII in schema. :param unicode: Defaults to False: short-hand for the ``ucs2`` character set, generates UNICODE in schema. :param binary: Defaults to False: short-hand, pick the binary collation type that matches the column's character set. Generates BINARY in schema. This does not affect the type of data stored, only the collation of character data. :param quoting: Defaults to 'auto': automatically determine enum value quoting. If all enum values are surrounded by the same quoting character, then use 'quoted' mode. Otherwise, use 'unquoted' mode. 'quoted': values in enums are already quoted, they will be used directly when generating the schema - this usage is deprecated. 'unquoted': values in enums are not quoted, they will be escaped and surrounded by single quotes when generating the schema. Previous versions of this type always required manually quoted values to be supplied; future versions will always quote the string literals for you. This is a transitional option. """ self.quoting = kw.pop('quoting', 'auto') if self.quoting == 'auto' and len(enums): # What quoting character are we using? q = None for e in enums: if len(e) == 0: self.quoting = 'unquoted' break elif q is None: q = e[0] if e[0] != q or e[-1] != q: self.quoting = 'unquoted' break else: self.quoting = 'quoted' if self.quoting == 'quoted': util.warn_deprecated( 'Manually quoting ENUM value literals is deprecated. Supply ' 'unquoted values and use the quoting= option in cases of ' 'ambiguity.') enums = self._strip_enums(enums) self.strict = kw.pop('strict', False) length = max([len(v) for v in enums] + [0]) kw.pop('metadata', None) kw.pop('schema', None) kw.pop('name', None) kw.pop('quote', None) kw.pop('native_enum', None) _StringType.__init__(self, length=length, **kw) sqltypes.Enum.__init__(self, *enums) @classmethod def _strip_enums(cls, enums): strip_enums = [] for a in enums: if a[0:1] == '"' or a[0:1] == "'": # strip enclosing quotes and unquote interior a = a[1:-1].replace(a[0] * 2, a[0]) strip_enums.append(a) return strip_enums def bind_processor(self, dialect): super_convert = super(ENUM, self).bind_processor(dialect) def process(value): if self.strict and value is not None and value not in self.enums: raise exc.InvalidRequestError('"%s" not a valid value for ' 'this enum' % value) if super_convert: return super_convert(value) else: return value return process def adapt(self, impltype, **kw): kw['strict'] = self.strict return sqltypes.Enum.adapt(self, impltype, **kw) class SET(_StringType): """MySQL SET type.""" __visit_name__ = 'SET' def __init__(self, *values, **kw): """Construct a SET. Example:: Column('myset', MSSet("'foo'", "'bar'", "'baz'")) :param values: The range of valid values for this SET. Values will be used exactly as they appear when generating schemas. Strings must be quoted, as in the example above. Single-quotes are suggested for ANSI compatibility and are required for portability to servers with ANSI_QUOTES enabled. :param charset: Optional, a column-level character set for this string value. Takes precedence to 'ascii' or 'unicode' short-hand. :param collation: Optional, a column-level collation for this string value. Takes precedence to 'binary' short-hand. :param ascii: Defaults to False: short-hand for the ``latin1`` character set, generates ASCII in schema. :param unicode: Defaults to False: short-hand for the ``ucs2`` character set, generates UNICODE in schema. :param binary: Defaults to False: short-hand, pick the binary collation type that matches the column's character set. Generates BINARY in schema. This does not affect the type of data stored, only the collation of character data. """ self._ddl_values = values strip_values = [] for a in values: if a[0:1] == '"' or a[0:1] == "'": # strip enclosing quotes and unquote interior a = a[1:-1].replace(a[0] * 2, a[0]) strip_values.append(a) self.values = strip_values kw.setdefault('length', max([len(v) for v in strip_values] + [0])) super(SET, self).__init__(**kw) def result_processor(self, dialect, coltype): def process(value): # The good news: # No ',' quoting issues- commas aren't allowed in SET values # The bad news: # Plenty of driver inconsistencies here. if isinstance(value, util.set_types): # ..some versions convert '' to an empty set if not value: value.add('') # ..some return sets.Set, even for pythons that have __builtin__.set if not isinstance(value, set): value = set(value) return value # ...and some versions return strings if value is not None: return set(value.split(',')) else: return value return process def bind_processor(self, dialect): super_convert = super(SET, self).bind_processor(dialect) def process(value): if value is None or isinstance(value, (int, long, basestring)): pass else: if None in value: value = set(value) value.remove(None) value.add('') value = ','.join(value) if super_convert: return super_convert(value) else: return value return process # old names MSTime = _MSTime MSSet = SET MSEnum = ENUM MSLongBlob = LONGBLOB MSMediumBlob = MEDIUMBLOB MSTinyBlob = TINYBLOB MSBlob = BLOB MSBinary = BINARY MSVarBinary = VARBINARY MSNChar = NCHAR MSNVarChar = NVARCHAR MSChar = CHAR MSString = VARCHAR MSLongText = LONGTEXT MSMediumText = MEDIUMTEXT MSTinyText = TINYTEXT MSText = TEXT MSYear = YEAR MSTimeStamp = TIMESTAMP MSBit = BIT MSSmallInteger = SMALLINT MSTinyInteger = TINYINT MSMediumInteger = MEDIUMINT MSBigInteger = BIGINT MSNumeric = NUMERIC MSDecimal = DECIMAL MSDouble = DOUBLE MSReal = REAL MSFloat = FLOAT MSInteger = INTEGER colspecs = { sqltypes.Numeric: NUMERIC, sqltypes.Float: FLOAT, sqltypes.Time: _MSTime, sqltypes.Enum: ENUM, } # Everything 3.23 through 5.1 excepting OpenGIS types. ischema_names = { 'bigint': BIGINT, 'binary': BINARY, 'bit': BIT, 'blob': BLOB, 'boolean': BOOLEAN, 'char': CHAR, 'date': DATE, 'datetime': DATETIME, 'decimal': DECIMAL, 'double': DOUBLE, 'enum': ENUM, 'fixed': DECIMAL, 'float': FLOAT, 'int': INTEGER, 'integer': INTEGER, 'longblob': LONGBLOB, 'longtext': LONGTEXT, 'mediumblob': MEDIUMBLOB, 'mediumint': MEDIUMINT, 'mediumtext': MEDIUMTEXT, 'nchar': NCHAR, 'nvarchar': NVARCHAR, 'numeric': NUMERIC, 'set': SET, 'smallint': SMALLINT, 'text': TEXT, 'time': TIME, 'timestamp': TIMESTAMP, 'tinyblob': TINYBLOB, 'tinyint': TINYINT, 'tinytext': TINYTEXT, 'varbinary': VARBINARY, 'varchar': VARCHAR, 'year': YEAR, } class MySQLExecutionContext(default.DefaultExecutionContext): def should_autocommit_text(self, statement): return AUTOCOMMIT_RE.match(statement) class MySQLCompiler(compiler.SQLCompiler): render_table_with_column_in_update_from = True """Overridden from base SQLCompiler value""" extract_map = compiler.SQLCompiler.extract_map.copy() extract_map.update ({ 'milliseconds': 'millisecond', }) def visit_random_func(self, fn, **kw): return "rand%s" % self.function_argspec(fn) def visit_utc_timestamp_func(self, fn, **kw): return "UTC_TIMESTAMP" def visit_sysdate_func(self, fn, **kw): return "SYSDATE()" def visit_concat_op(self, binary, **kw): return "concat(%s, %s)" % (self.process(binary.left), self.process(binary.right)) def visit_match_op(self, binary, **kw): return "MATCH (%s) AGAINST (%s IN BOOLEAN MODE)" % (self.process(binary.left), self.process(binary.right)) def get_from_hint_text(self, table, text): return text def visit_typeclause(self, typeclause): type_ = typeclause.type.dialect_impl(self.dialect) if isinstance(type_, sqltypes.Integer): if getattr(type_, 'unsigned', False): return 'UNSIGNED INTEGER' else: return 'SIGNED INTEGER' elif isinstance(type_, sqltypes.TIMESTAMP): return 'DATETIME' elif isinstance(type_, (sqltypes.DECIMAL, sqltypes.DateTime, sqltypes.Date, sqltypes.Time)): return self.dialect.type_compiler.process(type_) elif isinstance(type_, sqltypes.Text): return 'CHAR' elif (isinstance(type_, sqltypes.String) and not isinstance(type_, (ENUM, SET))): if getattr(type_, 'length'): return 'CHAR(%s)' % type_.length else: return 'CHAR' elif isinstance(type_, sqltypes._Binary): return 'BINARY' elif isinstance(type_, sqltypes.NUMERIC): return self.dialect.type_compiler.process(type_).replace('NUMERIC', 'DECIMAL') else: return None def visit_cast(self, cast, **kwargs): # No cast until 4, no decimals until 5. if not self.dialect._supports_cast: return self.process(cast.clause) type_ = self.process(cast.typeclause) if type_ is None: return self.process(cast.clause) return 'CAST(%s AS %s)' % (self.process(cast.clause), type_) def render_literal_value(self, value, type_): value = super(MySQLCompiler, self).render_literal_value(value, type_) if self.dialect._backslash_escapes: value = value.replace('\\', '\\\\') return value def get_select_precolumns(self, select): """Add special MySQL keywords in place of DISTINCT. .. note:: this usage is deprecated. :meth:`.Select.prefix_with` should be used for special keywords at the start of a SELECT. """ if isinstance(select._distinct, basestring): return select._distinct.upper() + " " elif select._distinct: return "DISTINCT " else: return "" def visit_join(self, join, asfrom=False, **kwargs): # 'JOIN ... ON ...' for inner joins isn't available until 4.0. # Apparently < 3.23.17 requires theta joins for inner joins # (but not outer). Not generating these currently, but # support can be added, preferably after dialects are # refactored to be version-sensitive. return ''.join( (self.process(join.left, asfrom=True, **kwargs), (join.isouter and " LEFT OUTER JOIN " or " INNER JOIN "), self.process(join.right, asfrom=True, **kwargs), " ON ", self.process(join.onclause, **kwargs))) def for_update_clause(self, select): if select.for_update == 'read': return ' LOCK IN SHARE MODE' else: return super(MySQLCompiler, self).for_update_clause(select) def limit_clause(self, select): # MySQL supports: # LIMIT <limit> # LIMIT <offset>, <limit> # and in server versions > 3.3: # LIMIT <limit> OFFSET <offset> # The latter is more readable for offsets but we're stuck with the # former until we can refine dialects by server revision. limit, offset = select._limit, select._offset if (limit, offset) == (None, None): return '' elif offset is not None: # As suggested by the MySQL docs, need to apply an # artificial limit if one wasn't provided # http://dev.mysql.com/doc/refman/5.0/en/select.html if limit is None: # hardwire the upper limit. Currently # needed by OurSQL with Python 3 # (https://bugs.launchpad.net/oursql/+bug/686232), # but also is consistent with the usage of the upper # bound as part of MySQL's "syntax" for OFFSET with # no LIMIT return ' \n LIMIT %s, %s' % ( self.process(sql.literal(offset)), "18446744073709551615") else: return ' \n LIMIT %s, %s' % ( self.process(sql.literal(offset)), self.process(sql.literal(limit))) else: # No offset provided, so just use the limit return ' \n LIMIT %s' % (self.process(sql.literal(limit)),) def update_limit_clause(self, update_stmt): limit = update_stmt.kwargs.get('%s_limit' % self.dialect.name, None) if limit: return "LIMIT %s" % limit else: return None def update_tables_clause(self, update_stmt, from_table, extra_froms, **kw): return ', '.join(t._compiler_dispatch(self, asfrom=True, **kw) for t in [from_table] + list(extra_froms)) def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw): return None # ug. "InnoDB needs indexes on foreign keys and referenced keys [...]. # Starting with MySQL 4.1.2, these indexes are created automatically. # In older versions, the indexes must be created explicitly or the # creation of foreign key constraints fails." class MySQLDDLCompiler(compiler.DDLCompiler): def create_table_constraints(self, table): """Get table constraints.""" constraint_string = super(MySQLDDLCompiler, self).create_table_constraints(table) engine_key = '%s_engine' % self.dialect.name is_innodb = table.kwargs.has_key(engine_key) and \ table.kwargs[engine_key].lower() == 'innodb' auto_inc_column = table._autoincrement_column if is_innodb and \ auto_inc_column is not None and \ auto_inc_column is not list(table.primary_key)[0]: if constraint_string: constraint_string += ", \n\t" constraint_string += "KEY `idx_autoinc_%s`(`%s`)" % (auto_inc_column.name, \ self.preparer.format_column(auto_inc_column)) return constraint_string def get_column_specification(self, column, **kw): """Builds column DDL.""" colspec = [self.preparer.format_column(column), self.dialect.type_compiler.process(column.type) ] default = self.get_column_default_string(column) if default is not None: colspec.append('DEFAULT ' + default) is_timestamp = isinstance(column.type, sqltypes.TIMESTAMP) if not column.nullable and not is_timestamp: colspec.append('NOT NULL') elif column.nullable and is_timestamp and default is None: colspec.append('NULL') if column is column.table._autoincrement_column and column.server_default is None: colspec.append('AUTO_INCREMENT') return ' '.join(colspec) def post_create_table(self, table): """Build table-level CREATE options like ENGINE and COLLATE.""" table_opts = [] opts = dict( ( k[len(self.dialect.name)+1:].upper(), v ) for k, v in table.kwargs.items() if k.startswith('%s_' % self.dialect.name) ) for opt in topological.sort([ ('DEFAULT_CHARSET', 'COLLATE'), ('DEFAULT_CHARACTER_SET', 'COLLATE') ], opts): arg = opts[opt] if opt in _options_of_type_string: arg = "'%s'" % arg.replace("\\", "\\\\").replace("'", "''") if opt in ('DATA_DIRECTORY', 'INDEX_DIRECTORY', 'DEFAULT_CHARACTER_SET', 'CHARACTER_SET', 'DEFAULT_CHARSET', 'DEFAULT_COLLATE'): opt = opt.replace('_', ' ') joiner = '=' if opt in ('TABLESPACE', 'DEFAULT CHARACTER SET', 'CHARACTER SET', 'COLLATE'): joiner = ' ' table_opts.append(joiner.join((opt, arg))) return ' '.join(table_opts) def visit_create_index(self, create): index = create.element preparer = self.preparer table = preparer.format_table(index.table) columns = [preparer.quote(c.name, c.quote) for c in index.columns] name = preparer.quote( self._index_identifier(index.name), index.quote) text = "CREATE " if index.unique: text += "UNIQUE " text += "INDEX %s ON %s " % (name, table) columns = ', '.join(columns) if 'mysql_length' in index.kwargs: length = index.kwargs['mysql_length'] text += "(%s(%d))" % (columns, length) else: text += "(%s)" % (columns) if 'mysql_using' in index.kwargs: using = index.kwargs['mysql_using'] text += " USING %s" % (preparer.quote(using, index.quote)) return text def visit_primary_key_constraint(self, constraint): text = super(MySQLDDLCompiler, self).\ visit_primary_key_constraint(constraint) if "mysql_using" in constraint.kwargs: using = constraint.kwargs['mysql_using'] text += " USING %s" % ( self.preparer.quote(using, constraint.quote)) return text def visit_drop_index(self, drop): index = drop.element return "\nDROP INDEX %s ON %s" % \ (self.preparer.quote( self._index_identifier(index.name), index.quote ), self.preparer.format_table(index.table)) def visit_drop_constraint(self, drop): constraint = drop.element if isinstance(constraint, sa_schema.ForeignKeyConstraint): qual = "FOREIGN KEY " const = self.preparer.format_constraint(constraint) elif isinstance(constraint, sa_schema.PrimaryKeyConstraint): qual = "PRIMARY KEY " const = "" elif isinstance(constraint, sa_schema.UniqueConstraint): qual = "INDEX " const = self.preparer.format_constraint(constraint) else: qual = "" const = self.preparer.format_constraint(constraint) return "ALTER TABLE %s DROP %s%s" % \ (self.preparer.format_table(constraint.table), qual, const) class MySQLTypeCompiler(compiler.GenericTypeCompiler): def _extend_numeric(self, type_, spec): "Extend a numeric-type declaration with MySQL specific extensions." if not self._mysql_type(type_): return spec if type_.unsigned: spec += ' UNSIGNED' if type_.zerofill: spec += ' ZEROFILL' return spec def _extend_string(self, type_, defaults, spec): """Extend a string-type declaration with standard SQL CHARACTER SET / COLLATE annotations and MySQL specific extensions. """ def attr(name): return getattr(type_, name, defaults.get(name)) if attr('charset'): charset = 'CHARACTER SET %s' % attr('charset') elif attr('ascii'): charset = 'ASCII' elif attr('unicode'): charset = 'UNICODE' else: charset = None if attr('collation'): collation = 'COLLATE %s' % type_.collation elif attr('binary'): collation = 'BINARY' else: collation = None if attr('national'): # NATIONAL (aka NCHAR/NVARCHAR) trumps charsets. return ' '.join([c for c in ('NATIONAL', spec, collation) if c is not None]) return ' '.join([c for c in (spec, charset, collation) if c is not None]) def _mysql_type(self, type_): return isinstance(type_, (_StringType, _NumericType)) def visit_NUMERIC(self, type_): if type_.precision is None: return self._extend_numeric(type_, "NUMERIC") elif type_.scale is None: return self._extend_numeric(type_, "NUMERIC(%(precision)s)" % {'precision': type_.precision}) else: return self._extend_numeric(type_, "NUMERIC(%(precision)s, %(scale)s)" % {'precision': type_.precision, 'scale' : type_.scale}) def visit_DECIMAL(self, type_): if type_.precision is None: return self._extend_numeric(type_, "DECIMAL") elif type_.scale is None: return self._extend_numeric(type_, "DECIMAL(%(precision)s)" % {'precision': type_.precision}) else: return self._extend_numeric(type_, "DECIMAL(%(precision)s, %(scale)s)" % {'precision': type_.precision, 'scale' : type_.scale}) def visit_DOUBLE(self, type_): if type_.precision is not None and type_.scale is not None: return self._extend_numeric(type_, "DOUBLE(%(precision)s, %(scale)s)" % {'precision': type_.precision, 'scale' : type_.scale}) else: return self._extend_numeric(type_, 'DOUBLE') def visit_REAL(self, type_): if type_.precision is not None and type_.scale is not None: return self._extend_numeric(type_, "REAL(%(precision)s, %(scale)s)" % {'precision': type_.precision, 'scale' : type_.scale}) else: return self._extend_numeric(type_, 'REAL') def visit_FLOAT(self, type_): if self._mysql_type(type_) and \ type_.scale is not None and \ type_.precision is not None: return self._extend_numeric(type_, "FLOAT(%s, %s)" % (type_.precision, type_.scale)) elif type_.precision is not None: return self._extend_numeric(type_, "FLOAT(%s)" % (type_.precision,)) else: return self._extend_numeric(type_, "FLOAT") def visit_INTEGER(self, type_): if self._mysql_type(type_) and type_.display_width is not None: return self._extend_numeric(type_, "INTEGER(%(display_width)s)" % {'display_width': type_.display_width}) else: return self._extend_numeric(type_, "INTEGER") def visit_BIGINT(self, type_): if self._mysql_type(type_) and type_.display_width is not None: return self._extend_numeric(type_, "BIGINT(%(display_width)s)" % {'display_width': type_.display_width}) else: return self._extend_numeric(type_, "BIGINT") def visit_MEDIUMINT(self, type_): if self._mysql_type(type_) and type_.display_width is not None: return self._extend_numeric(type_, "MEDIUMINT(%(display_width)s)" % {'display_width': type_.display_width}) else: return self._extend_numeric(type_, "MEDIUMINT") def visit_TINYINT(self, type_): if self._mysql_type(type_) and type_.display_width is not None: return self._extend_numeric(type_, "TINYINT(%s)" % type_.display_width) else: return self._extend_numeric(type_, "TINYINT") def visit_SMALLINT(self, type_): if self._mysql_type(type_) and type_.display_width is not None: return self._extend_numeric(type_, "SMALLINT(%(display_width)s)" % {'display_width': type_.display_width} ) else: return self._extend_numeric(type_, "SMALLINT") def visit_BIT(self, type_): if type_.length is not None: return "BIT(%s)" % type_.length else: return "BIT" def visit_DATETIME(self, type_): return "DATETIME" def visit_DATE(self, type_): return "DATE" def visit_TIME(self, type_): return "TIME" def visit_TIMESTAMP(self, type_): return 'TIMESTAMP' def visit_YEAR(self, type_): if type_.display_width is None: return "YEAR" else: return "YEAR(%s)" % type_.display_width def visit_TEXT(self, type_): if type_.length: return self._extend_string(type_, {}, "TEXT(%d)" % type_.length) else: return self._extend_string(type_, {}, "TEXT") def visit_TINYTEXT(self, type_): return self._extend_string(type_, {}, "TINYTEXT") def visit_MEDIUMTEXT(self, type_): return self._extend_string(type_, {}, "MEDIUMTEXT") def visit_LONGTEXT(self, type_): return self._extend_string(type_, {}, "LONGTEXT") def visit_VARCHAR(self, type_): if type_.length: return self._extend_string(type_, {}, "VARCHAR(%d)" % type_.length) else: raise exc.CompileError( "VARCHAR requires a length on dialect %s" % self.dialect.name) def visit_CHAR(self, type_): if type_.length: return self._extend_string(type_, {}, "CHAR(%(length)s)" % {'length' : type_.length}) else: return self._extend_string(type_, {}, "CHAR") def visit_NVARCHAR(self, type_): # We'll actually generate the equiv. "NATIONAL VARCHAR" instead # of "NVARCHAR". if type_.length: return self._extend_string(type_, {'national':True}, "VARCHAR(%(length)s)" % {'length': type_.length}) else: raise exc.CompileError( "NVARCHAR requires a length on dialect %s" % self.dialect.name) def visit_NCHAR(self, type_): # We'll actually generate the equiv. "NATIONAL CHAR" instead of "NCHAR". if type_.length: return self._extend_string(type_, {'national':True}, "CHAR(%(length)s)" % {'length': type_.length}) else: return self._extend_string(type_, {'national':True}, "CHAR") def visit_VARBINARY(self, type_): return "VARBINARY(%d)" % type_.length def visit_large_binary(self, type_): return self.visit_BLOB(type_) def visit_enum(self, type_): if not type_.native_enum: return super(MySQLTypeCompiler, self).visit_enum(type_) else: return self.visit_ENUM(type_) def visit_BLOB(self, type_): if type_.length: return "BLOB(%d)" % type_.length else: return "BLOB" def visit_TINYBLOB(self, type_): return "TINYBLOB" def visit_MEDIUMBLOB(self, type_): return "MEDIUMBLOB" def visit_LONGBLOB(self, type_): return "LONGBLOB" def visit_ENUM(self, type_): quoted_enums = [] for e in type_.enums: quoted_enums.append("'%s'" % e.replace("'", "''")) return self._extend_string(type_, {}, "ENUM(%s)" % ",".join(quoted_enums)) def visit_SET(self, type_): return self._extend_string(type_, {}, "SET(%s)" % ",".join(type_._ddl_values)) def visit_BOOLEAN(self, type): return "BOOL" class MySQLIdentifierPreparer(compiler.IdentifierPreparer): reserved_words = RESERVED_WORDS def __init__(self, dialect, server_ansiquotes=False, **kw): if not server_ansiquotes: quote = "`" else: quote = '"' super(MySQLIdentifierPreparer, self).__init__( dialect, initial_quote=quote, escape_quote=quote) def _quote_free_identifiers(self, *ids): """Unilaterally identifier-quote any number of strings.""" return tuple([self.quote_identifier(i) for i in ids if i is not None]) class MySQLDialect(default.DefaultDialect): """Details of the MySQL dialect. Not used directly in application code.""" name = 'mysql' supports_alter = True # identifiers are 64, however aliases can be 255... max_identifier_length = 255 max_index_name_length = 64 supports_native_enum = True supports_sane_rowcount = True supports_sane_multi_rowcount = False default_paramstyle = 'format' colspecs = colspecs statement_compiler = MySQLCompiler ddl_compiler = MySQLDDLCompiler type_compiler = MySQLTypeCompiler ischema_names = ischema_names preparer = MySQLIdentifierPreparer # default SQL compilation settings - # these are modified upon initialize(), # i.e. first connect _backslash_escapes = True _server_ansiquotes = False def __init__(self, use_ansiquotes=None, isolation_level=None, **kwargs): default.DefaultDialect.__init__(self, **kwargs) self.isolation_level = isolation_level def on_connect(self): if self.isolation_level is not None: def connect(conn): self.set_isolation_level(conn, self.isolation_level) return connect else: return None _isolation_lookup = set(['SERIALIZABLE', 'READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ']) def set_isolation_level(self, connection, level): level = level.replace('_', ' ') if level not in self._isolation_lookup: raise exc.ArgumentError( "Invalid value '%s' for isolation_level. " "Valid isolation levels for %s are %s" % (level, self.name, ", ".join(self._isolation_lookup)) ) cursor = connection.cursor() cursor.execute("SET SESSION TRANSACTION ISOLATION LEVEL %s" % level) cursor.execute("COMMIT") cursor.close() def get_isolation_level(self, connection): cursor = connection.cursor() cursor.execute('SELECT @@tx_isolation') val = cursor.fetchone()[0] cursor.close() return val.upper().replace("-", " ") def do_commit(self, connection): """Execute a COMMIT.""" # COMMIT/ROLLBACK were introduced in 3.23.15. # Yes, we have at least one user who has to talk to these old versions! # # Ignore commit/rollback if support isn't present, otherwise even basic # operations via autocommit fail. try: connection.commit() except: if self.server_version_info < (3, 23, 15): args = sys.exc_info()[1].args if args and args[0] == 1064: return raise def do_rollback(self, connection): """Execute a ROLLBACK.""" try: connection.rollback() except: if self.server_version_info < (3, 23, 15): args = sys.exc_info()[1].args if args and args[0] == 1064: return raise def do_begin_twophase(self, connection, xid): connection.execute(sql.text("XA BEGIN :xid"), xid=xid) def do_prepare_twophase(self, connection, xid): connection.execute(sql.text("XA END :xid"), xid=xid) connection.execute(sql.text("XA PREPARE :xid"), xid=xid) def do_rollback_twophase(self, connection, xid, is_prepared=True, recover=False): if not is_prepared: connection.execute(sql.text("XA END :xid"), xid=xid) connection.execute(sql.text("XA ROLLBACK :xid"), xid=xid) def do_commit_twophase(self, connection, xid, is_prepared=True, recover=False): if not is_prepared: self.do_prepare_twophase(connection, xid) connection.execute(sql.text("XA COMMIT :xid"), xid=xid) def do_recover_twophase(self, connection): resultset = connection.execute("XA RECOVER") return [row['data'][0:row['gtrid_length']] for row in resultset] def is_disconnect(self, e, connection, cursor): if isinstance(e, self.dbapi.OperationalError): return self._extract_error_code(e) in \ (2006, 2013, 2014, 2045, 2055) elif isinstance(e, self.dbapi.InterfaceError): # if underlying connection is closed, # this is the error you get return "(0, '')" in str(e) else: return False def _compat_fetchall(self, rp, charset=None): """Proxy result rows to smooth over MySQL-Python driver inconsistencies.""" return [_DecodingRowProxy(row, charset) for row in rp.fetchall()] def _compat_fetchone(self, rp, charset=None): """Proxy a result row to smooth over MySQL-Python driver inconsistencies.""" return _DecodingRowProxy(rp.fetchone(), charset) def _compat_first(self, rp, charset=None): """Proxy a result row to smooth over MySQL-Python driver inconsistencies.""" return _DecodingRowProxy(rp.first(), charset) def _extract_error_code(self, exception): raise NotImplementedError() def _get_default_schema_name(self, connection): return connection.execute('SELECT DATABASE()').scalar() def has_table(self, connection, table_name, schema=None): # SHOW TABLE STATUS LIKE and SHOW TABLES LIKE do not function properly # on macosx (and maybe win?) with multibyte table names. # # TODO: if this is not a problem on win, make the strategy swappable # based on platform. DESCRIBE is slower. # [ticket:726] # full_name = self.identifier_preparer.format_table(table, # use_schema=True) full_name = '.'.join(self.identifier_preparer._quote_free_identifiers( schema, table_name)) st = "DESCRIBE %s" % full_name rs = None try: try: rs = connection.execute(st) have = rs.rowcount > 0 rs.close() return have except exc.DBAPIError, e: if self._extract_error_code(e.orig) == 1146: return False raise finally: if rs: rs.close() def initialize(self, connection): default.DefaultDialect.initialize(self, connection) self._connection_charset = self._detect_charset(connection) self._server_casing = self._detect_casing(connection) self._server_collations = self._detect_collations(connection) self._detect_ansiquotes(connection) if self._server_ansiquotes: # if ansiquotes == True, build a new IdentifierPreparer # with the new setting self.identifier_preparer = self.preparer(self, server_ansiquotes=self._server_ansiquotes) @property def _supports_cast(self): return self.server_version_info is None or \ self.server_version_info >= (4, 0, 2) @reflection.cache def get_schema_names(self, connection, **kw): rp = connection.execute("SHOW schemas") return [r[0] for r in rp] @reflection.cache def get_table_names(self, connection, schema=None, **kw): """Return a Unicode SHOW TABLES from a given schema.""" if schema is not None: current_schema = schema else: current_schema = self.default_schema_name charset = self._connection_charset if self.server_version_info < (5, 0, 2): rp = connection.execute("SHOW TABLES FROM %s" % self.identifier_preparer.quote_identifier(current_schema)) return [row[0] for row in self._compat_fetchall(rp, charset=charset)] else: rp = connection.execute("SHOW FULL TABLES FROM %s" % self.identifier_preparer.quote_identifier(current_schema)) return [row[0] for row in self._compat_fetchall(rp, charset=charset)\ if row[1] == 'BASE TABLE'] @reflection.cache def get_view_names(self, connection, schema=None, **kw): charset = self._connection_charset if self.server_version_info < (5, 0, 2): raise NotImplementedError if schema is None: schema = self.default_schema_name if self.server_version_info < (5, 0, 2): return self.get_table_names(connection, schema) charset = self._connection_charset rp = connection.execute("SHOW FULL TABLES FROM %s" % self.identifier_preparer.quote_identifier(schema)) return [row[0] for row in self._compat_fetchall(rp, charset=charset)\ if row[1] == 'VIEW'] @reflection.cache def get_table_options(self, connection, table_name, schema=None, **kw): parsed_state = self._parsed_state_or_create(connection, table_name, schema, **kw) return parsed_state.table_options @reflection.cache def get_columns(self, connection, table_name, schema=None, **kw): parsed_state = self._parsed_state_or_create(connection, table_name, schema, **kw) return parsed_state.columns @reflection.cache def get_primary_keys(self, connection, table_name, schema=None, **kw): parsed_state = self._parsed_state_or_create(connection, table_name, schema, **kw) for key in parsed_state.keys: if key['type'] == 'PRIMARY': # There can be only one. ##raise Exception, str(key) return [s[0] for s in key['columns']] return [] @reflection.cache def get_foreign_keys(self, connection, table_name, schema=None, **kw): parsed_state = self._parsed_state_or_create(connection, table_name, schema, **kw) default_schema = None fkeys = [] for spec in parsed_state.constraints: # only FOREIGN KEYs ref_name = spec['table'][-1] ref_schema = len(spec['table']) > 1 and spec['table'][-2] or schema if not ref_schema: if default_schema is None: default_schema = \ connection.dialect.default_schema_name if schema == default_schema: ref_schema = schema loc_names = spec['local'] ref_names = spec['foreign'] con_kw = {} for opt in ('name', 'onupdate', 'ondelete'): if spec.get(opt, False): con_kw[opt] = spec[opt] fkey_d = { 'name' : spec['name'], 'constrained_columns' : loc_names, 'referred_schema' : ref_schema, 'referred_table' : ref_name, 'referred_columns' : ref_names, 'options' : con_kw } fkeys.append(fkey_d) return fkeys @reflection.cache def get_indexes(self, connection, table_name, schema=None, **kw): parsed_state = self._parsed_state_or_create(connection, table_name, schema, **kw) indexes = [] for spec in parsed_state.keys: unique = False flavor = spec['type'] if flavor == 'PRIMARY': continue if flavor == 'UNIQUE': unique = True elif flavor in (None, 'FULLTEXT', 'SPATIAL'): pass else: self.logger.info( "Converting unknown KEY type %s to a plain KEY" % flavor) pass index_d = {} index_d['name'] = spec['name'] index_d['column_names'] = [s[0] for s in spec['columns']] index_d['unique'] = unique index_d['type'] = flavor indexes.append(index_d) return indexes @reflection.cache def get_view_definition(self, connection, view_name, schema=None, **kw): charset = self._connection_charset full_name = '.'.join(self.identifier_preparer._quote_free_identifiers( schema, view_name)) sql = self._show_create_table(connection, None, charset, full_name=full_name) return sql def _parsed_state_or_create(self, connection, table_name, schema=None, **kw): return self._setup_parser( connection, table_name, schema, info_cache=kw.get('info_cache', None) ) @util.memoized_property def _tabledef_parser(self): """return the MySQLTableDefinitionParser, generate if needed. The deferred creation ensures that the dialect has retrieved server version information first. """ if (self.server_version_info < (4, 1) and self._server_ansiquotes): # ANSI_QUOTES doesn't affect SHOW CREATE TABLE on < 4.1 preparer = self.preparer(self, server_ansiquotes=False) else: preparer = self.identifier_preparer return MySQLTableDefinitionParser(self, preparer) @reflection.cache def _setup_parser(self, connection, table_name, schema=None, **kw): charset = self._connection_charset parser = self._tabledef_parser full_name = '.'.join(self.identifier_preparer._quote_free_identifiers( schema, table_name)) sql = self._show_create_table(connection, None, charset, full_name=full_name) if sql.startswith('CREATE ALGORITHM'): # Adapt views to something table-like. columns = self._describe_table(connection, None, charset, full_name=full_name) sql = parser._describe_to_create(table_name, columns) return parser.parse(sql, charset) def _detect_charset(self, connection): raise NotImplementedError() def _detect_casing(self, connection): """Sniff out identifier case sensitivity. Cached per-connection. This value can not change without a server restart. """ # http://dev.mysql.com/doc/refman/5.0/en/name-case-sensitivity.html charset = self._connection_charset row = self._compat_first(connection.execute( "SHOW VARIABLES LIKE 'lower_case_table_names'"), charset=charset) if not row: cs = 0 else: # 4.0.15 returns OFF or ON according to [ticket:489] # 3.23 doesn't, 4.0.27 doesn't.. if row[1] == 'OFF': cs = 0 elif row[1] == 'ON': cs = 1 else: cs = int(row[1]) return cs def _detect_collations(self, connection): """Pull the active COLLATIONS list from the server. Cached per-connection. """ collations = {} if self.server_version_info < (4, 1, 0): pass else: charset = self._connection_charset rs = connection.execute('SHOW COLLATION') for row in self._compat_fetchall(rs, charset): collations[row[0]] = row[1] return collations def _detect_ansiquotes(self, connection): """Detect and adjust for the ANSI_QUOTES sql mode.""" row = self._compat_first( connection.execute("SHOW VARIABLES LIKE 'sql_mode'"), charset=self._connection_charset) if not row: mode = '' else: mode = row[1] or '' # 4.0 if mode.isdigit(): mode_no = int(mode) mode = (mode_no | 4 == mode_no) and 'ANSI_QUOTES' or '' self._server_ansiquotes = 'ANSI_QUOTES' in mode # as of MySQL 5.0.1 self._backslash_escapes = 'NO_BACKSLASH_ESCAPES' not in mode def _show_create_table(self, connection, table, charset=None, full_name=None): """Run SHOW CREATE TABLE for a ``Table``.""" if full_name is None: full_name = self.identifier_preparer.format_table(table) st = "SHOW CREATE TABLE %s" % full_name rp = None try: rp = connection.execute(st) except exc.DBAPIError, e: if self._extract_error_code(e.orig) == 1146: raise exc.NoSuchTableError(full_name) else: raise row = self._compat_first(rp, charset=charset) if not row: raise exc.NoSuchTableError(full_name) return row[1].strip() return sql def _describe_table(self, connection, table, charset=None, full_name=None): """Run DESCRIBE for a ``Table`` and return processed rows.""" if full_name is None: full_name = self.identifier_preparer.format_table(table) st = "DESCRIBE %s" % full_name rp, rows = None, None try: try: rp = connection.execute(st) except exc.DBAPIError, e: if self._extract_error_code(e.orig) == 1146: raise exc.NoSuchTableError(full_name) else: raise rows = self._compat_fetchall(rp, charset=charset) finally: if rp: rp.close() return rows class ReflectedState(object): """Stores raw information about a SHOW CREATE TABLE statement.""" def __init__(self): self.columns = [] self.table_options = {} self.table_name = None self.keys = [] self.constraints = [] class MySQLTableDefinitionParser(object): """Parses the results of a SHOW CREATE TABLE statement.""" def __init__(self, dialect, preparer): self.dialect = dialect self.preparer = preparer self._prep_regexes() def parse(self, show_create, charset): state = ReflectedState() state.charset = charset for line in re.split(r'\r?\n', show_create): if line.startswith(' ' + self.preparer.initial_quote): self._parse_column(line, state) # a regular table options line elif line.startswith(') '): self._parse_table_options(line, state) # an ANSI-mode table options line elif line == ')': pass elif line.startswith('CREATE '): self._parse_table_name(line, state) # Not present in real reflection, but may be if loading from a file. elif not line: pass else: type_, spec = self._parse_constraints(line) if type_ is None: util.warn("Unknown schema content: %r" % line) elif type_ == 'key': state.keys.append(spec) elif type_ == 'constraint': state.constraints.append(spec) else: pass return state def _parse_constraints(self, line): """Parse a KEY or CONSTRAINT line. :param line: A line of SHOW CREATE TABLE output """ # KEY m = self._re_key.match(line) if m: spec = m.groupdict() # convert columns into name, length pairs spec['columns'] = self._parse_keyexprs(spec['columns']) return 'key', spec # CONSTRAINT m = self._re_constraint.match(line) if m: spec = m.groupdict() spec['table'] = \ self.preparer.unformat_identifiers(spec['table']) spec['local'] = [c[0] for c in self._parse_keyexprs(spec['local'])] spec['foreign'] = [c[0] for c in self._parse_keyexprs(spec['foreign'])] return 'constraint', spec # PARTITION and SUBPARTITION m = self._re_partition.match(line) if m: # Punt! return 'partition', line # No match. return (None, line) def _parse_table_name(self, line, state): """Extract the table name. :param line: The first line of SHOW CREATE TABLE """ regex, cleanup = self._pr_name m = regex.match(line) if m: state.table_name = cleanup(m.group('name')) def _parse_table_options(self, line, state): """Build a dictionary of all reflected table-level options. :param line: The final line of SHOW CREATE TABLE output. """ options = {} if not line or line == ')': pass else: rest_of_line = line[:] for regex, cleanup in self._pr_options: m = regex.search(rest_of_line) if not m: continue directive, value = m.group('directive'), m.group('val') if cleanup: value = cleanup(value) options[directive.lower()] = value rest_of_line = regex.sub('', rest_of_line) for nope in ('auto_increment', 'data directory', 'index directory'): options.pop(nope, None) for opt, val in options.items(): state.table_options['%s_%s' % (self.dialect.name, opt)] = val def _parse_column(self, line, state): """Extract column details. Falls back to a 'minimal support' variant if full parse fails. :param line: Any column-bearing line from SHOW CREATE TABLE """ spec = None m = self._re_column.match(line) if m: spec = m.groupdict() spec['full'] = True else: m = self._re_column_loose.match(line) if m: spec = m.groupdict() spec['full'] = False if not spec: util.warn("Unknown column definition %r" % line) return if not spec['full']: util.warn("Incomplete reflection of column definition %r" % line) name, type_, args, notnull = \ spec['name'], spec['coltype'], spec['arg'], spec['notnull'] try: col_type = self.dialect.ischema_names[type_] except KeyError: util.warn("Did not recognize type '%s' of column '%s'" % (type_, name)) col_type = sqltypes.NullType # Column type positional arguments eg. varchar(32) if args is None or args == '': type_args = [] elif args[0] == "'" and args[-1] == "'": type_args = self._re_csv_str.findall(args) else: type_args = [int(v) for v in self._re_csv_int.findall(args)] # Column type keyword options type_kw = {} for kw in ('unsigned', 'zerofill'): if spec.get(kw, False): type_kw[kw] = True for kw in ('charset', 'collate'): if spec.get(kw, False): type_kw[kw] = spec[kw] if type_ == 'enum': type_args = ENUM._strip_enums(type_args) type_instance = col_type(*type_args, **type_kw) col_args, col_kw = [], {} # NOT NULL col_kw['nullable'] = True if spec.get('notnull', False): col_kw['nullable'] = False # AUTO_INCREMENT if spec.get('autoincr', False): col_kw['autoincrement'] = True elif issubclass(col_type, sqltypes.Integer): col_kw['autoincrement'] = False # DEFAULT default = spec.get('default', None) if default == 'NULL': # eliminates the need to deal with this later. default = None col_d = dict(name=name, type=type_instance, default=default) col_d.update(col_kw) state.columns.append(col_d) def _describe_to_create(self, table_name, columns): """Re-format DESCRIBE output as a SHOW CREATE TABLE string. DESCRIBE is a much simpler reflection and is sufficient for reflecting views for runtime use. This method formats DDL for columns only- keys are omitted. :param columns: A sequence of DESCRIBE or SHOW COLUMNS 6-tuples. SHOW FULL COLUMNS FROM rows must be rearranged for use with this function. """ buffer = [] for row in columns: (name, col_type, nullable, default, extra) = \ [row[i] for i in (0, 1, 2, 4, 5)] line = [' '] line.append(self.preparer.quote_identifier(name)) line.append(col_type) if not nullable: line.append('NOT NULL') if default: if 'auto_increment' in default: pass elif (col_type.startswith('timestamp') and default.startswith('C')): line.append('DEFAULT') line.append(default) elif default == 'NULL': line.append('DEFAULT') line.append(default) else: line.append('DEFAULT') line.append("'%s'" % default.replace("'", "''")) if extra: line.append(extra) buffer.append(' '.join(line)) return ''.join([('CREATE TABLE %s (\n' % self.preparer.quote_identifier(table_name)), ',\n'.join(buffer), '\n) ']) def _parse_keyexprs(self, identifiers): """Unpack '"col"(2),"col" ASC'-ish strings into components.""" return self._re_keyexprs.findall(identifiers) def _prep_regexes(self): """Pre-compile regular expressions.""" self._re_columns = [] self._pr_options = [] _final = self.preparer.final_quote quotes = dict(zip(('iq', 'fq', 'esc_fq'), [re.escape(s) for s in (self.preparer.initial_quote, _final, self.preparer._escape_identifier(_final))])) self._pr_name = _pr_compile( r'^CREATE (?:\w+ +)?TABLE +' r'%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s +\($' % quotes, self.preparer._unescape_identifier) # `col`,`col2`(32),`col3`(15) DESC # # Note: ASC and DESC aren't reflected, so we'll punt... self._re_keyexprs = _re_compile( r'(?:' r'(?:%(iq)s((?:%(esc_fq)s|[^%(fq)s])+)%(fq)s)' r'(?:\((\d+)\))?(?=\,|$))+' % quotes) # 'foo' or 'foo','bar' or 'fo,o','ba''a''r' self._re_csv_str = _re_compile(r'\x27(?:\x27\x27|[^\x27])*\x27') # 123 or 123,456 self._re_csv_int = _re_compile(r'\d+') # `colname` <type> [type opts] # (NOT NULL | NULL) # DEFAULT ('value' | CURRENT_TIMESTAMP...) # COMMENT 'comment' # COLUMN_FORMAT (FIXED|DYNAMIC|DEFAULT) # STORAGE (DISK|MEMORY) self._re_column = _re_compile( r' ' r'%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s +' r'(?P<coltype>\w+)' r'(?:\((?P<arg>(?:\d+|\d+,\d+|' r'(?:\x27(?:\x27\x27|[^\x27])*\x27,?)+))\))?' r'(?: +(?P<unsigned>UNSIGNED))?' r'(?: +(?P<zerofill>ZEROFILL))?' r'(?: +CHARACTER SET +(?P<charset>[\w_]+))?' r'(?: +COLLATE +(?P<collate>[\w_]+))?' r'(?: +(?P<notnull>NOT NULL))?' r'(?: +DEFAULT +(?P<default>' r'(?:NULL|\x27(?:\x27\x27|[^\x27])*\x27|\w+' r'(?: +ON UPDATE \w+)?)' r'))?' r'(?: +(?P<autoincr>AUTO_INCREMENT))?' r'(?: +COMMENT +(P<comment>(?:\x27\x27|[^\x27])+))?' r'(?: +COLUMN_FORMAT +(?P<colfmt>\w+))?' r'(?: +STORAGE +(?P<storage>\w+))?' r'(?: +(?P<extra>.*))?' r',?$' % quotes ) # Fallback, try to parse as little as possible self._re_column_loose = _re_compile( r' ' r'%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s +' r'(?P<coltype>\w+)' r'(?:\((?P<arg>(?:\d+|\d+,\d+|\x27(?:\x27\x27|[^\x27])+\x27))\))?' r'.*?(?P<notnull>NOT NULL)?' % quotes ) # (PRIMARY|UNIQUE|FULLTEXT|SPATIAL) INDEX `name` (USING (BTREE|HASH))? # (`col` (ASC|DESC)?, `col` (ASC|DESC)?) # KEY_BLOCK_SIZE size | WITH PARSER name self._re_key = _re_compile( r' ' r'(?:(?P<type>\S+) )?KEY' r'(?: +%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s)?' r'(?: +USING +(?P<using_pre>\S+))?' r' +\((?P<columns>.+?)\)' r'(?: +USING +(?P<using_post>\S+))?' r'(?: +KEY_BLOCK_SIZE +(?P<keyblock>\S+))?' r'(?: +WITH PARSER +(?P<parser>\S+))?' r',?$' % quotes ) # CONSTRAINT `name` FOREIGN KEY (`local_col`) # REFERENCES `remote` (`remote_col`) # MATCH FULL | MATCH PARTIAL | MATCH SIMPLE # ON DELETE CASCADE ON UPDATE RESTRICT # # unique constraints come back as KEYs kw = quotes.copy() kw['on'] = 'RESTRICT|CASCASDE|SET NULL|NOACTION' self._re_constraint = _re_compile( r' ' r'CONSTRAINT +' r'%(iq)s(?P<name>(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s +' r'FOREIGN KEY +' r'\((?P<local>[^\)]+?)\) REFERENCES +' r'(?P<table>%(iq)s[^%(fq)s]+%(fq)s(?:\.%(iq)s[^%(fq)s]+%(fq)s)?) +' r'\((?P<foreign>[^\)]+?)\)' r'(?: +(?P<match>MATCH \w+))?' r'(?: +ON DELETE (?P<ondelete>%(on)s))?' r'(?: +ON UPDATE (?P<onupdate>%(on)s))?' % kw ) # PARTITION # # punt! self._re_partition = _re_compile(r'(?:.*)(?:SUB)?PARTITION(?:.*)') # Table-level options (COLLATE, ENGINE, etc.) # Do the string options first, since they have quoted strings we need to get rid of. for option in _options_of_type_string: self._add_option_string(option) for option in ('ENGINE', 'TYPE', 'AUTO_INCREMENT', 'AVG_ROW_LENGTH', 'CHARACTER SET', 'DEFAULT CHARSET', 'CHECKSUM', 'COLLATE', 'DELAY_KEY_WRITE', 'INSERT_METHOD', 'MAX_ROWS', 'MIN_ROWS', 'PACK_KEYS', 'ROW_FORMAT', 'KEY_BLOCK_SIZE'): self._add_option_word(option) self._add_option_regex('UNION', r'\([^\)]+\)') self._add_option_regex('TABLESPACE', r'.*? STORAGE DISK') self._add_option_regex('RAID_TYPE', r'\w+\s+RAID_CHUNKS\s*\=\s*\w+RAID_CHUNKSIZE\s*=\s*\w+') _optional_equals = r'(?:\s*(?:=\s*)|\s+)' def _add_option_string(self, directive): regex = (r'(?P<directive>%s)%s' r"'(?P<val>(?:[^']|'')*?)'(?!')" % (re.escape(directive), self._optional_equals)) self._pr_options.append( _pr_compile(regex, lambda v: v.replace("\\\\","\\").replace("''", "'"))) def _add_option_word(self, directive): regex = (r'(?P<directive>%s)%s' r'(?P<val>\w+)' % (re.escape(directive), self._optional_equals)) self._pr_options.append(_pr_compile(regex)) def _add_option_regex(self, directive, regex): regex = (r'(?P<directive>%s)%s' r'(?P<val>%s)' % (re.escape(directive), self._optional_equals, regex)) self._pr_options.append(_pr_compile(regex)) _options_of_type_string = ('COMMENT', 'DATA DIRECTORY', 'INDEX DIRECTORY', 'PASSWORD', 'CONNECTION') log.class_logger(MySQLTableDefinitionParser) log.class_logger(MySQLDialect) class _DecodingRowProxy(object): """Return unicode-decoded values based on type inspection. Smooth over data type issues (esp. with alpha driver versions) and normalize strings as Unicode regardless of user-configured driver encoding settings. """ # Some MySQL-python versions can return some columns as # sets.Set(['value']) (seriously) but thankfully that doesn't # seem to come up in DDL queries. def __init__(self, rowproxy, charset): self.rowproxy = rowproxy self.charset = charset def __getitem__(self, index): item = self.rowproxy[index] if isinstance(item, _array): item = item.tostring() # Py2K if self.charset and isinstance(item, str): # end Py2K # Py3K #if self.charset and isinstance(item, bytes): return item.decode(self.charset) else: return item def __getattr__(self, attr): item = getattr(self.rowproxy, attr) if isinstance(item, _array): item = item.tostring() # Py2K if self.charset and isinstance(item, str): # end Py2K # Py3K #if self.charset and isinstance(item, bytes): return item.decode(self.charset) else: return item def _pr_compile(regex, cleanup=None): """Prepare a 2-tuple of compiled regex and callable.""" return (_re_compile(regex), cleanup) def _re_compile(regex): """Compile a string to regex, I and UNICODE.""" return re.compile(regex, re.I | re.UNICODE)
gpl-3.0
edx-solutions/edx-platform
openedx/core/djangoapps/cors_csrf/migrations/0001_initial.py
5
1205
# -*- coding: utf-8 -*- from django.db import migrations, models import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='XDomainProxyConfiguration', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), ('enabled', models.BooleanField(default=False, verbose_name='Enabled')), ('whitelist', models.TextField(help_text='List of domains that are allowed to make cross-domain requests to this site. Please list each domain on its own line.')), ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), ], options={ 'ordering': ('-change_date',), 'abstract': False, }, ), ]
agpl-3.0
ukanga/SickRage
sickbeard/providers/hounddawgs.py
3
7574
# coding=utf-8 # Author: Idan Gutman # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # SickRage is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with SickRage. If not, see <http://www.gnu.org/licenses/>. from __future__ import print_function, unicode_literals import re import traceback from requests.utils import dict_from_cookiejar from sickbeard import logger, tvcache from sickbeard.bs4_parser import BS4Parser from sickrage.helper.common import convert_size, try_int from sickrage.providers.torrent.TorrentProvider import TorrentProvider class HoundDawgsProvider(TorrentProvider): # pylint: disable=too-many-instance-attributes def __init__(self): TorrentProvider.__init__(self, "HoundDawgs") self.username = None self.password = None self.minseed = None self.minleech = None self.freeleech = None self.ranked = None self.urls = { 'base_url': 'https://hounddawgs.org/', 'search': 'https://hounddawgs.org/torrents.php', 'login': 'https://hounddawgs.org/login.php' } self.url = self.urls['base_url'] self.search_params = { "filter_cat[85]": 1, "filter_cat[58]": 1, "filter_cat[57]": 1, "filter_cat[74]": 1, "filter_cat[92]": 1, "filter_cat[93]": 1, "order_by": "s3", "order_way": "desc", "type": '', "userid": '', "searchstr": '', "searchimdb": '', "searchtags": '' } self.cache = tvcache.TVCache(self) def login(self): if any(dict_from_cookiejar(self.session.cookies).values()): return True login_params = { 'username': self.username, 'password': self.password, 'keeplogged': 'on', 'login': 'Login' } self.get_url(self.urls['base_url'], returns='text') response = self.get_url(self.urls['login'], post_data=login_params, returns='text') if not response: logger.log("Unable to connect to provider", logger.WARNING) return False if re.search('Dit brugernavn eller kodeord er forkert.', response) \ or re.search('<title>Login :: HoundDawgs</title>', response) \ or re.search('Dine cookies er ikke aktiveret.', response): logger.log("Invalid username or password. Check your settings", logger.WARNING) return False return True def search(self, search_strings, age=0, ep_obj=None): # pylint: disable=too-many-locals,too-many-branches,too-many-statements results = [] if not self.login(): return results for mode in search_strings: items = [] logger.log("Search Mode: {0}".format(mode), logger.DEBUG) for search_string in search_strings[mode]: if mode != 'RSS': logger.log("Search string: {0}".format (search_string.decode("utf-8")), logger.DEBUG) self.search_params['searchstr'] = search_string data = self.get_url(self.urls['search'], params=self.search_params, returns='text') if not data: logger.log('URL did not return data', logger.DEBUG) continue strTableStart = "<table class=\"torrent_table" startTableIndex = data.find(strTableStart) trimmedData = data[startTableIndex:] if not trimmedData: continue try: with BS4Parser(trimmedData, 'html5lib') as html: result_table = html.find('table', {'id': 'torrent_table'}) if not result_table: logger.log("Data returned from provider does not contain any torrents", logger.DEBUG) continue result_tbody = result_table.find('tbody') entries = result_tbody.contents del entries[1::2] for result in entries[1:]: torrent = result('td') if len(torrent) <= 1: break allAs = (torrent[1])('a') try: notinternal = result.find('img', src='/static//common/user_upload.png') if self.ranked and notinternal: logger.log("Found a user uploaded release, Ignoring it..", logger.DEBUG) continue freeleech = result.find('img', src='/static//common/browse/freeleech.png') if self.freeleech and not freeleech: continue title = allAs[2].string download_url = self.urls['base_url'] + allAs[0].attrs['href'] torrent_size = result.find("td", class_="nobr").find_next_sibling("td").string if torrent_size: size = convert_size(torrent_size) or -1 seeders = try_int((result('td')[6]).text.replace(',', '')) leechers = try_int((result('td')[7]).text.replace(',', '')) except (AttributeError, TypeError): continue if not title or not download_url: continue # Filter unseeded torrent if seeders < self.minseed or leechers < self.minleech: if mode != 'RSS': logger.log("Discarding torrent because it doesn't meet the minimum seeders or leechers: {0} (S:{1} L:{2})".format (title, seeders, leechers), logger.DEBUG) continue item = {'title': title, 'link': download_url, 'size': size, 'seeders': seeders, 'leechers': leechers, 'hash': ''} if mode != 'RSS': logger.log("Found result: {0} with {1} seeders and {2} leechers".format(title, seeders, leechers), logger.DEBUG) items.append(item) except Exception: logger.log("Failed parsing provider. Traceback: {0}".format(traceback.format_exc()), logger.ERROR) # For each search mode sort all the items by seeders if available items.sort(key=lambda d: try_int(d.get('seeders', 0)), reverse=True) results += items return results provider = HoundDawgsProvider()
gpl-3.0
gautam1858/tensorflow
tensorflow/python/ops/init_ops_test.py
4
7576
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for initializers in init_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.core.protobuf import config_pb2 from tensorflow.python.client import session from tensorflow.python.eager import context from tensorflow.python.framework import ops from tensorflow.python.framework import test_util from tensorflow.python.ops import init_ops from tensorflow.python.ops import variable_scope from tensorflow.python.ops import variables from tensorflow.python.platform import test @test_util.run_all_in_graph_and_eager_modes class InitializersTest(test.TestCase): def _runner(self, init, shape, target_mean=None, target_std=None, target_max=None, target_min=None): output = self.evaluate(init(shape)) self.assertEqual(output.shape, shape) lim = 3e-2 if target_std is not None: self.assertGreater(lim, abs(output.std() - target_std)) if target_mean is not None: self.assertGreater(lim, abs(output.mean() - target_mean)) if target_max is not None: self.assertGreater(lim, abs(output.max() - target_max)) if target_min is not None: self.assertGreater(lim, abs(output.min() - target_min)) def test_uniform(self): tensor_shape = (9, 6, 7) with self.cached_session(): self._runner( init_ops.RandomUniform(minval=-1, maxval=1, seed=124), tensor_shape, target_mean=0., target_max=1, target_min=-1) def test_normal(self): tensor_shape = (8, 12, 99) with self.cached_session(): self._runner( init_ops.RandomNormal(mean=0, stddev=1, seed=153), tensor_shape, target_mean=0., target_std=1) def test_truncated_normal(self): tensor_shape = (12, 99, 7) with self.cached_session(): self._runner( init_ops.TruncatedNormal(mean=0, stddev=1, seed=126), tensor_shape, target_mean=0., target_max=2, target_min=-2) def test_constant(self): tensor_shape = (5, 6, 4) with self.cached_session(): self._runner( init_ops.Constant(2), tensor_shape, target_mean=2, target_max=2, target_min=2) def test_lecun_uniform(self): tensor_shape = (5, 6, 4, 2) with self.cached_session(): fan_in, _ = init_ops._compute_fans(tensor_shape) std = np.sqrt(1. / fan_in) self._runner( init_ops.lecun_uniform(seed=123), tensor_shape, target_mean=0., target_std=std) def test_glorot_uniform_initializer(self): tensor_shape = (5, 6, 4, 2) with self.cached_session(): fan_in, fan_out = init_ops._compute_fans(tensor_shape) std = np.sqrt(2. / (fan_in + fan_out)) self._runner( init_ops.glorot_uniform_initializer(seed=123), tensor_shape, target_mean=0., target_std=std) def test_he_uniform(self): tensor_shape = (5, 6, 4, 2) with self.cached_session(): fan_in, _ = init_ops._compute_fans(tensor_shape) std = np.sqrt(2. / fan_in) self._runner( init_ops.he_uniform(seed=123), tensor_shape, target_mean=0., target_std=std) def test_lecun_normal(self): tensor_shape = (5, 6, 4, 2) with self.cached_session(): fan_in, _ = init_ops._compute_fans(tensor_shape) std = np.sqrt(1. / fan_in) self._runner( init_ops.lecun_normal(seed=123), tensor_shape, target_mean=0., target_std=std) def test_glorot_normal_initializer(self): tensor_shape = (5, 6, 4, 2) with self.cached_session(): fan_in, fan_out = init_ops._compute_fans(tensor_shape) std = np.sqrt(2. / (fan_in + fan_out)) self._runner( init_ops.glorot_normal_initializer(seed=123), tensor_shape, target_mean=0., target_std=std) def test_he_normal(self): tensor_shape = (5, 6, 4, 2) with self.cached_session(): fan_in, _ = init_ops._compute_fans(tensor_shape) std = np.sqrt(2. / fan_in) self._runner( init_ops.he_normal(seed=123), tensor_shape, target_mean=0., target_std=std) def test_Orthogonal(self): tensor_shape = (20, 20) with self.cached_session(): self._runner(init_ops.Orthogonal(seed=123), tensor_shape, target_mean=0.) def testVariablePlacementWithOrthogonalInitializer(self): if not context.context().num_gpus(): self.skipTest('No devices other than CPUs found') with ops.Graph().as_default() as g: with ops.device('gpu:0'): variable_scope.get_variable( name='v', shape=[8, 2], initializer=init_ops.Orthogonal) variable_scope.get_variable( name='w', shape=[8, 2], initializer=init_ops.RandomNormal) run_metadata = config_pb2.RunMetadata() run_options = config_pb2.RunOptions( trace_level=config_pb2.RunOptions.FULL_TRACE) config = config_pb2.ConfigProto( allow_soft_placement=False, log_device_placement=True) # Note: allow_soft_placement=False will fail whenever we cannot satisfy # the colocation constraints. with session.Session(config=config, graph=g) as sess: sess.run( variables.global_variables_initializer(), options=run_options, run_metadata=run_metadata) def test_eager_orthogonal_gpu(self): if not context.context().num_gpus(): self.skipTest('No devices other than CPUs found') with context.eager_mode(): v = variable_scope.get_variable( name='v', shape=[8, 2], initializer=init_ops.Orthogonal) w = variable_scope.get_variable( name='w', shape=[8, 2], initializer=init_ops.RandomNormal) self.assertTrue('GPU' in v.handle.device) self.assertTrue('GPU' in w.handle.device) def test_Identity(self): with self.cached_session(): tensor_shape = (3, 4, 5) with self.assertRaises(ValueError): self._runner( init_ops.Identity(), tensor_shape, target_mean=1. / tensor_shape[0], target_max=1.) tensor_shape = (3, 3) self._runner( init_ops.Identity(), tensor_shape, target_mean=1. / tensor_shape[0], target_max=1.) def test_Zeros(self): tensor_shape = (4, 5) with self.cached_session(): self._runner( init_ops.Zeros(), tensor_shape, target_mean=0., target_max=0.) def test_Ones(self): tensor_shape = (4, 5) with self.cached_session(): self._runner(init_ops.Ones(), tensor_shape, target_mean=1., target_max=1.) if __name__ == '__main__': test.main()
apache-2.0
thebritican/anovelmous
migrations/versions/273db4d82b38_.py
1
5040
"""empty message Revision ID: 273db4d82b38 Revises: 1d239589c41f Create Date: 2015-01-11 22:58:54.093128 """ # revision identifiers, used by Alembic. revision = '273db4d82b38' down_revision = '1d239589c41f' from alembic import op import sqlalchemy as sa from sqlalchemy_utils import ArrowType def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table('user', sa.Column('id', sa.Integer(), nullable=False), sa.Column('email', sa.String(length=255), nullable=False), sa.Column('confirmed_at', ArrowType(), nullable=True), sa.Column('is_active', sa.Boolean(), server_default='0', nullable=False), sa.Column('created_at', ArrowType(), nullable=False), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('email') ) op.create_table('role', sa.Column('id', sa.Integer(), nullable=False), sa.Column('name', sa.String(length=50), nullable=True), sa.Column('description', sa.String(length=255), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('name') ) op.create_table('token', sa.Column('id', sa.Integer(), nullable=False), sa.Column('content', sa.Unicode(length=28), nullable=False), sa.Column('is_punctuation', sa.Boolean(), nullable=False), sa.Column('created_at', ArrowType(), nullable=False), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('content') ) op.create_table('novel', sa.Column('id', sa.Integer(), nullable=False), sa.Column('title', sa.Unicode(), nullable=False), sa.Column('created_at', ArrowType(), nullable=False), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('title') ) op.create_table('chapter', sa.Column('id', sa.Integer(), nullable=False), sa.Column('title', sa.Unicode(), nullable=False), sa.Column('created_at', ArrowType(), nullable=False), sa.Column('novel_id', sa.Integer(), nullable=False), sa.ForeignKeyConstraint(['novel_id'], ['novel.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_table('user_auth', sa.Column('id', sa.Integer(), nullable=False), sa.Column('user_id', sa.Integer(), nullable=True), sa.Column('username', sa.String(length=50), nullable=False), sa.Column('password', sa.String(length=255), server_default='', nullable=False), sa.Column('reset_password_token', sa.String(length=100), server_default='', nullable=False), sa.Column('is_active', sa.Boolean(), server_default='0', nullable=False), sa.ForeignKeyConstraint(['user_id'], ['user.id'], ondelete='CASCADE'), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('username') ) op.create_table('user_roles', sa.Column('id', sa.Integer(), nullable=False), sa.Column('user_id', sa.Integer(), nullable=True), sa.Column('role_id', sa.Integer(), nullable=True), sa.ForeignKeyConstraint(['role_id'], ['role.id'], ondelete='CASCADE'), sa.ForeignKeyConstraint(['user_id'], ['user.id'], ondelete='CASCADE'), sa.PrimaryKeyConstraint('id') ) op.create_table('novel_token', sa.Column('id', sa.Integer(), nullable=False), sa.Column('token', sa.Unicode(length=28), nullable=False), sa.Column('ordinal', sa.Integer(), nullable=False), sa.Column('chapter_id', sa.Integer(), nullable=False), sa.Column('created_at', ArrowType(), nullable=False), sa.ForeignKeyConstraint(['chapter_id'], ['chapter.id'], ), sa.ForeignKeyConstraint(['token'], ['token.content'], ), sa.PrimaryKeyConstraint('id') ) op.create_table('formatted_novel_token', sa.Column('id', sa.Integer(), nullable=False), sa.Column('token', sa.Unicode(length=35), nullable=False), sa.Column('ordinal', sa.Integer(), nullable=False), sa.Column('chapter_id', sa.Integer(), nullable=False), sa.Column('created_at', ArrowType(), nullable=False), sa.ForeignKeyConstraint(['chapter_id'], ['chapter.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_table('vote', sa.Column('id', sa.Integer(), nullable=False), sa.Column('token', sa.Unicode(), nullable=False), sa.Column('is_punctuation', sa.Boolean(), nullable=False), sa.Column('ordinal', sa.Integer(), nullable=False), sa.Column('selected', sa.Boolean(), nullable=False), sa.Column('chapter_id', sa.Integer(), nullable=False), sa.Column('username', sa.Unicode(), nullable=False), sa.Column('user_id', sa.Integer(), nullable=False), sa.Column('created_at', ArrowType(), nullable=False), sa.ForeignKeyConstraint(['chapter_id'], ['chapter.id'], ), sa.PrimaryKeyConstraint('id') ) ### end Alembic commands ### def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.drop_table('vote') op.drop_table('formatted_novel_token') op.drop_table('novel_token') op.drop_table('user_roles') op.drop_table('user_auth') op.drop_table('chapter') op.drop_table('novel') op.drop_table('token') op.drop_table('role') op.drop_table('user') ### end Alembic commands ###
mit
bigswitch/nova
nova/tests/functional/api_sample_tests/test_consoles.py
14
2211
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from nova.console import manager as console_manager # noqa - only for cfg from nova.tests.functional.api_sample_tests import test_servers class ConsolesSamplesJsonTest(test_servers.ServersSampleBase): sample_dir = "consoles" def setUp(self): super(ConsolesSamplesJsonTest, self).setUp() self.flags(console_public_hostname='fake') self.flags(console_host='fake') self.flags(console_driver='nova.console.fake.FakeConsoleProxy') self.console = self.start_service('console', host='fake') def _create_consoles(self, server_uuid): response = self._do_post('servers/%s/consoles' % server_uuid, 'consoles-create-req', {}) self.assertEqual(response.status_code, 200) def test_create_consoles(self): uuid = self._post_server() self._create_consoles(uuid) def test_list_consoles(self): uuid = self._post_server() self._create_consoles(uuid) response = self._do_get('servers/%s/consoles' % uuid) self._verify_response('consoles-list-get-resp', {}, response, 200) def test_console_get(self): uuid = self._post_server() self._create_consoles(uuid) response = self._do_get('servers/%s/consoles/1' % uuid) self._verify_response('consoles-get-resp', {}, response, 200) def test_console_delete(self): uuid = self._post_server() self._create_consoles(uuid) response = self._do_delete('servers/%s/consoles/1' % uuid) self.assertEqual(202, response.status_code)
apache-2.0
rohit21122012/DCASE2013
runs/2016/dnn2016med_traps/traps16/task1_scene_classification.py
40
38423
#!/usr/bin/env python # -*- coding: utf-8 -*- # # DCASE 2016::Acoustic Scene Classification / Baseline System import argparse import textwrap import timeit import skflow from sklearn import mixture from sklearn import preprocessing as pp from sklearn.externals import joblib from sklearn.metrics import confusion_matrix from src.dataset import * from src.evaluation import * from src.features import * __version_info__ = ('1', '0', '0') __version__ = '.'.join(__version_info__) final_result = {} train_start = 0.0 train_end = 0.0 test_start = 0.0 test_end = 0.0 def main(argv): numpy.random.seed(123456) # let's make randomization predictable tot_start = timeit.default_timer() parser = argparse.ArgumentParser( prefix_chars='-+', formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent('''\ DCASE 2016 Task 1: Acoustic Scene Classification Baseline system --------------------------------------------- Tampere University of Technology / Audio Research Group Author: Toni Heittola ( [email protected] ) System description This is an baseline implementation for D-CASE 2016 challenge acoustic scene classification task. Features: MFCC (static+delta+acceleration) Classifier: GMM ''')) # Setup argument handling parser.add_argument("-development", help="Use the system in the development mode", action='store_true', default=False, dest='development') parser.add_argument("-challenge", help="Use the system in the challenge mode", action='store_true', default=False, dest='challenge') parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__) args = parser.parse_args() # Load parameters from config file parameter_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.splitext(os.path.basename(__file__))[0] + '.yaml') params = load_parameters(parameter_file) params = process_parameters(params) make_folders(params) title("DCASE 2016::Acoustic Scene Classification / Baseline System") # Check if mode is defined if not (args.development or args.challenge): args.development = True args.challenge = False dataset_evaluation_mode = 'folds' if args.development and not args.challenge: print "Running system in development mode" dataset_evaluation_mode = 'folds' elif not args.development and args.challenge: print "Running system in challenge mode" dataset_evaluation_mode = 'full' # Get dataset container class dataset = eval(params['general']['development_dataset'])(data_path=params['path']['data']) # Fetch data over internet and setup the data # ================================================== if params['flow']['initialize']: dataset.fetch() # Extract features for all audio files in the dataset # ================================================== if params['flow']['extract_features']: section_header('Feature extraction') # Collect files in train sets files = [] for fold in dataset.folds(mode=dataset_evaluation_mode): for item_id, item in enumerate(dataset.train(fold)): if item['file'] not in files: files.append(item['file']) for item_id, item in enumerate(dataset.test(fold)): if item['file'] not in files: files.append(item['file']) files = sorted(files) # Go through files and make sure all features are extracted do_feature_extraction(files=files, dataset=dataset, feature_path=params['path']['features'], params=params['features'], overwrite=params['general']['overwrite']) foot() # Prepare feature normalizers # ================================================== if params['flow']['feature_normalizer']: section_header('Feature normalizer') do_feature_normalization(dataset=dataset, feature_normalizer_path=params['path']['feature_normalizers'], feature_path=params['path']['features'], dataset_evaluation_mode=dataset_evaluation_mode, overwrite=params['general']['overwrite']) foot() # System training # ================================================== if params['flow']['train_system']: section_header('System training') train_start = timeit.default_timer() do_system_training(dataset=dataset, model_path=params['path']['models'], feature_normalizer_path=params['path']['feature_normalizers'], feature_path=params['path']['features'], classifier_params=params['classifier']['parameters'], classifier_method=params['classifier']['method'], dataset_evaluation_mode=dataset_evaluation_mode, overwrite=params['general']['overwrite'] ) train_end = timeit.default_timer() foot() # System evaluation in development mode if args.development and not args.challenge: # System testing # ================================================== if params['flow']['test_system']: section_header('System testing') test_start = timeit.default_timer() do_system_testing(dataset=dataset, feature_path=params['path']['features'], result_path=params['path']['results'], model_path=params['path']['models'], feature_params=params['features'], dataset_evaluation_mode=dataset_evaluation_mode, classifier_method=params['classifier']['method'], overwrite=params['general']['overwrite'] ) test_end = timeit.default_timer() foot() # System evaluation # ================================================== if params['flow']['evaluate_system']: section_header('System evaluation') do_system_evaluation(dataset=dataset, dataset_evaluation_mode=dataset_evaluation_mode, result_path=params['path']['results']) foot() # System evaluation with challenge data elif not args.development and args.challenge: # Fetch data over internet and setup the data challenge_dataset = eval(params['general']['challenge_dataset'])() if params['flow']['initialize']: challenge_dataset.fetch() # System testing if params['flow']['test_system']: section_header('System testing with challenge data') do_system_testing(dataset=challenge_dataset, feature_path=params['path']['features'], result_path=params['path']['challenge_results'], model_path=params['path']['models'], feature_params=params['features'], dataset_evaluation_mode=dataset_evaluation_mode, classifier_method=params['classifier']['method'], overwrite=True ) foot() print " " print "Your results for the challenge data are stored at [" + params['path']['challenge_results'] + "]" print " " tot_end = timeit.default_timer() print " " print "Train Time : " + str(train_end - train_start) print " " print " " print "Test Time : " + str(test_end - test_start) print " " print " " print "Total Time : " + str(tot_end - tot_start) print " " final_result['train_time'] = train_end - train_start final_result['test_time'] = test_end - test_start final_result['tot_time'] = tot_end - tot_start joblib.dump(final_result, 'result.pkl') return 0 def process_parameters(params): """Parameter post-processing. Parameters ---------- params : dict parameters in dict Returns ------- params : dict processed parameters """ # Convert feature extraction window and hop sizes seconds to samples params['features']['mfcc']['win_length'] = int(params['features']['win_length_seconds'] * params['features']['fs']) params['features']['mfcc']['hop_length'] = int(params['features']['hop_length_seconds'] * params['features']['fs']) # Copy parameters for current classifier method params['classifier']['parameters'] = params['classifier_parameters'][params['classifier']['method']] # Hash params['features']['hash'] = get_parameter_hash(params['features']) params['classifier']['hash'] = get_parameter_hash(params['classifier']) # Paths params['path']['data'] = os.path.join(os.path.dirname(os.path.realpath(__file__)), params['path']['data']) params['path']['base'] = os.path.join(os.path.dirname(os.path.realpath(__file__)), params['path']['base']) # Features params['path']['features_'] = params['path']['features'] params['path']['features'] = os.path.join(params['path']['base'], params['path']['features'], params['features']['hash']) # Feature normalizers params['path']['feature_normalizers_'] = params['path']['feature_normalizers'] params['path']['feature_normalizers'] = os.path.join(params['path']['base'], params['path']['feature_normalizers'], params['features']['hash']) # Models params['path']['models_'] = params['path']['models'] params['path']['models'] = os.path.join(params['path']['base'], params['path']['models'], params['features']['hash'], params['classifier']['hash']) # Results params['path']['results_'] = params['path']['results'] params['path']['results'] = os.path.join(params['path']['base'], params['path']['results'], params['features']['hash'], params['classifier']['hash']) return params def make_folders(params, parameter_filename='parameters.yaml'): """Create all needed folders, and saves parameters in yaml-file for easier manual browsing of data. Parameters ---------- params : dict parameters in dict parameter_filename : str filename to save parameters used to generate the folder name Returns ------- nothing """ # Check that target path exists, create if not check_path(params['path']['features']) check_path(params['path']['feature_normalizers']) check_path(params['path']['models']) check_path(params['path']['results']) # Save parameters into folders to help manual browsing of files. # Features feature_parameter_filename = os.path.join(params['path']['features'], parameter_filename) if not os.path.isfile(feature_parameter_filename): save_parameters(feature_parameter_filename, params['features']) # Feature normalizers feature_normalizer_parameter_filename = os.path.join(params['path']['feature_normalizers'], parameter_filename) if not os.path.isfile(feature_normalizer_parameter_filename): save_parameters(feature_normalizer_parameter_filename, params['features']) # Models model_features_parameter_filename = os.path.join(params['path']['base'], params['path']['models_'], params['features']['hash'], parameter_filename) if not os.path.isfile(model_features_parameter_filename): save_parameters(model_features_parameter_filename, params['features']) model_models_parameter_filename = os.path.join(params['path']['base'], params['path']['models_'], params['features']['hash'], params['classifier']['hash'], parameter_filename) if not os.path.isfile(model_models_parameter_filename): save_parameters(model_models_parameter_filename, params['classifier']) # Results # Save parameters into folders to help manual browsing of files. result_features_parameter_filename = os.path.join(params['path']['base'], params['path']['results_'], params['features']['hash'], parameter_filename) if not os.path.isfile(result_features_parameter_filename): save_parameters(result_features_parameter_filename, params['features']) result_models_parameter_filename = os.path.join(params['path']['base'], params['path']['results_'], params['features']['hash'], params['classifier']['hash'], parameter_filename) if not os.path.isfile(result_models_parameter_filename): save_parameters(result_models_parameter_filename, params['classifier']) def get_feature_filename(audio_file, path, extension='cpickle'): """Get feature filename Parameters ---------- audio_file : str audio file name from which the features are extracted path : str feature path extension : str file extension (Default value='cpickle') Returns ------- feature_filename : str full feature filename """ audio_filename = os.path.split(audio_file)[1] return os.path.join(path, os.path.splitext(audio_filename)[0] + '.' + extension) def get_feature_normalizer_filename(fold, path, extension='cpickle'): """Get normalizer filename Parameters ---------- fold : int >= 0 evaluation fold number path : str normalizer path extension : str file extension (Default value='cpickle') Returns ------- normalizer_filename : str full normalizer filename """ return os.path.join(path, 'scale_fold' + str(fold) + '.' + extension) def get_model_filename(fold, path, extension='cpickle'): """Get model filename Parameters ---------- fold : int >= 0 evaluation fold number path : str model path extension : str file extension (Default value='cpickle') Returns ------- model_filename : str full model filename """ return os.path.join(path, 'model_fold' + str(fold) + '.' + extension) def get_result_filename(fold, path, extension='txt'): """Get result filename Parameters ---------- fold : int >= 0 evaluation fold number path : str result path extension : str file extension (Default value='cpickle') Returns ------- result_filename : str full result filename """ if fold == 0: return os.path.join(path, 'results.' + extension) else: return os.path.join(path, 'results_fold' + str(fold) + '.' + extension) def do_feature_extraction(files, dataset, feature_path, params, overwrite=False): """Feature extraction Parameters ---------- files : list file list dataset : class dataset class feature_path : str path where the features are saved params : dict parameter dict overwrite : bool overwrite existing feature files (Default value=False) Returns ------- nothing Raises ------- IOError Audio file not found. """ # Check that target path exists, create if not check_path(feature_path) for file_id, audio_filename in enumerate(files): # Get feature filename current_feature_file = get_feature_filename(audio_file=os.path.split(audio_filename)[1], path=feature_path) progress(title_text='Extracting', percentage=(float(file_id) / len(files)), note=os.path.split(audio_filename)[1]) if not os.path.isfile(current_feature_file) or overwrite: # Load audio data if os.path.isfile(dataset.relative_to_absolute_path(audio_filename)): y, fs = load_audio(filename=dataset.relative_to_absolute_path(audio_filename), mono=True, fs=params['fs']) else: raise IOError("Audio file not found [%s]" % audio_filename) # Extract features if params['method'] == 'lfcc': feature_file_txt = get_feature_filename(audio_file=os.path.split(audio_filename)[1], path=feature_path, extension='txt') feature_data = feature_extraction_lfcc(feature_file_txt) elif params['method'] == 'traps': feature_data = feature_extraction_traps(y=y, fs=fs, traps_params=params['traps'], mfcc_params=params['mfcc']) else: # feature_data['feat'].shape is (1501, 60) feature_data = feature_extraction(y=y, fs=fs, include_mfcc0=params['include_mfcc0'], include_delta=params['include_delta'], include_acceleration=params['include_acceleration'], mfcc_params=params['mfcc'], delta_params=params['mfcc_delta'], acceleration_params=params['mfcc_acceleration']) # Save save_data(current_feature_file, feature_data) def do_feature_normalization(dataset, feature_normalizer_path, feature_path, dataset_evaluation_mode='folds', overwrite=False): """Feature normalization Calculated normalization factors for each evaluation fold based on the training material available. Parameters ---------- dataset : class dataset class feature_normalizer_path : str path where the feature normalizers are saved. feature_path : str path where the features are saved. dataset_evaluation_mode : str ['folds', 'full'] evaluation mode, 'full' all material available is considered to belong to one fold. (Default value='folds') overwrite : bool overwrite existing normalizers (Default value=False) Returns ------- nothing Raises ------- IOError Feature file not found. """ # Check that target path exists, create if not check_path(feature_normalizer_path) for fold in dataset.folds(mode=dataset_evaluation_mode): current_normalizer_file = get_feature_normalizer_filename(fold=fold, path=feature_normalizer_path) if not os.path.isfile(current_normalizer_file) or overwrite: # Initialize statistics file_count = len(dataset.train(fold)) normalizer = FeatureNormalizer() for item_id, item in enumerate(dataset.train(fold)): progress(title_text='Collecting data', fold=fold, percentage=(float(item_id) / file_count), note=os.path.split(item['file'])[1]) # Load features if os.path.isfile(get_feature_filename(audio_file=item['file'], path=feature_path)): feature_data = load_data(get_feature_filename(audio_file=item['file'], path=feature_path))['stat'] else: raise IOError("Feature file not found [%s]" % (item['file'])) # Accumulate statistics normalizer.accumulate(feature_data) # Calculate normalization factors normalizer.finalize() # Save save_data(current_normalizer_file, normalizer) def do_system_training(dataset, model_path, feature_normalizer_path, feature_path, classifier_params, dataset_evaluation_mode='folds', classifier_method='gmm', overwrite=False): """System training model container format: { 'normalizer': normalizer class 'models' : { 'office' : mixture.GMM class 'home' : mixture.GMM class ... } } Parameters ---------- dataset : class dataset class model_path : str path where the models are saved. feature_normalizer_path : str path where the feature normalizers are saved. feature_path : str path where the features are saved. classifier_params : dict parameter dict dataset_evaluation_mode : str ['folds', 'full'] evaluation mode, 'full' all material available is considered to belong to one fold. (Default value='folds') classifier_method : str ['gmm'] classifier method, currently only GMM supported (Default value='gmm') overwrite : bool overwrite existing models (Default value=False) Returns ------- nothing Raises ------- ValueError classifier_method is unknown. IOError Feature normalizer not found. Feature file not found. """ if classifier_method != 'gmm' and classifier_method != 'dnn': raise ValueError("Unknown classifier method [" + classifier_method + "]") # Check that target path exists, create if not check_path(model_path) for fold in dataset.folds(mode=dataset_evaluation_mode): current_model_file = get_model_filename(fold=fold, path=model_path) if not os.path.isfile(current_model_file) or overwrite: # Load normalizer feature_normalizer_filename = get_feature_normalizer_filename(fold=fold, path=feature_normalizer_path) if os.path.isfile(feature_normalizer_filename): normalizer = load_data(feature_normalizer_filename) else: raise IOError("Feature normalizer not found [%s]" % feature_normalizer_filename) # Initialize model container model_container = {'normalizer': normalizer, 'models': {}} # Collect training examples file_count = len(dataset.train(fold)) data = {} for item_id, item in enumerate(dataset.train(fold)): progress(title_text='Collecting data', fold=fold, percentage=(float(item_id) / file_count), note=os.path.split(item['file'])[1]) # Load features feature_filename = get_feature_filename(audio_file=item['file'], path=feature_path) if os.path.isfile(feature_filename): feature_data = load_data(feature_filename)['feat'] else: raise IOError("Features not found [%s]" % (item['file'])) # Scale features feature_data = model_container['normalizer'].normalize(feature_data) # Store features per class label if item['scene_label'] not in data: data[item['scene_label']] = feature_data else: data[item['scene_label']] = numpy.vstack((data[item['scene_label']], feature_data)) le = pp.LabelEncoder() tot_data = {} # Train models for each class for label in data: progress(title_text='Train models', fold=fold, note=label) if classifier_method == 'gmm': model_container['models'][label] = mixture.GMM(**classifier_params).fit(data[label]) elif classifier_method == 'dnn': if 'x' not in tot_data: tot_data['x'] = data[label] tot_data['y'] = numpy.repeat(label, len(data[label]), axis=0) else: tot_data['x'] = numpy.vstack((tot_data['x'], data[label])) tot_data['y'] = numpy.hstack((tot_data['y'], numpy.repeat(label, len(data[label]), axis=0))) else: raise ValueError("Unknown classifier method [" + classifier_method + "]") clf = skflow.TensorFlowDNNClassifier(**classifier_params) if classifier_method == 'dnn': tot_data['y'] = le.fit_transform(tot_data['y']) clf.fit(tot_data['x'], tot_data['y']) clf.save('dnn/dnnmodel1') # Save models save_data(current_model_file, model_container) def do_system_testing(dataset, result_path, feature_path, model_path, feature_params, dataset_evaluation_mode='folds', classifier_method='gmm', overwrite=False): """System testing. If extracted features are not found from disk, they are extracted but not saved. Parameters ---------- dataset : class dataset class result_path : str path where the results are saved. feature_path : str path where the features are saved. model_path : str path where the models are saved. feature_params : dict parameter dict dataset_evaluation_mode : str ['folds', 'full'] evaluation mode, 'full' all material available is considered to belong to one fold. (Default value='folds') classifier_method : str ['gmm'] classifier method, currently only GMM supported (Default value='gmm') overwrite : bool overwrite existing models (Default value=False) Returns ------- nothing Raises ------- ValueError classifier_method is unknown. IOError Model file not found. Audio file not found. """ if classifier_method != 'gmm' and classifier_method != 'dnn': raise ValueError("Unknown classifier method [" + classifier_method + "]") # Check that target path exists, create if not check_path(result_path) for fold in dataset.folds(mode=dataset_evaluation_mode): current_result_file = get_result_filename(fold=fold, path=result_path) if not os.path.isfile(current_result_file) or overwrite: results = [] # Load class model container model_filename = get_model_filename(fold=fold, path=model_path) if os.path.isfile(model_filename): model_container = load_data(model_filename) else: raise IOError("Model file not found [%s]" % model_filename) file_count = len(dataset.test(fold)) for file_id, item in enumerate(dataset.test(fold)): progress(title_text='Testing', fold=fold, percentage=(float(file_id) / file_count), note=os.path.split(item['file'])[1]) # Load features feature_filename = get_feature_filename(audio_file=item['file'], path=feature_path) if os.path.isfile(feature_filename): feature_data = load_data(feature_filename)['feat'] else: # Load audio if os.path.isfile(dataset.relative_to_absolute_path(item['file'])): y, fs = load_audio(filename=dataset.relative_to_absolute_path(item['file']), mono=True, fs=feature_params['fs']) else: raise IOError("Audio file not found [%s]" % (item['file'])) if feature_params['method'] == 'lfcc': feature_file_txt = get_feature_filename(audio_file=os.path.split(item['file'])[1], path=feature_path, extension='txt') feature_data = feature_extraction_lfcc(feature_file_txt) elif feature_params['method'] == 'traps': feature_data = feature_extraction_traps(y=y, fs=fs, traps_params=params['traps'], mfcc_params=feature_params['mfcc'], statistics=False)['feat'] else: feature_data = feature_extraction(y=y, fs=fs, include_mfcc0=feature_params['include_mfcc0'], include_delta=feature_params['include_delta'], include_acceleration=feature_params['include_acceleration'], mfcc_params=feature_params['mfcc'], delta_params=feature_params['mfcc_delta'], acceleration_params=feature_params['mfcc_acceleration'], statistics=False)['feat'] # Normalize features feature_data = model_container['normalizer'].normalize(feature_data) # Do classification for the block if classifier_method == 'gmm': current_result = do_classification_gmm(feature_data, model_container) current_class = current_result['class'] elif classifier_method == 'dnn': current_result = do_classification_dnn(feature_data, model_container) current_class = dataset.scene_labels[current_result['class_id']] else: raise ValueError("Unknown classifier method [" + classifier_method + "]") # Store the result if classifier_method == 'gmm': results.append((dataset.absolute_to_relative(item['file']), current_class)) elif classifier_method == 'dnn': logs_in_tuple = tuple(lo for lo in current_result['logls']) results.append((dataset.absolute_to_relative(item['file']), current_class) + logs_in_tuple) else: raise ValueError("Unknown classifier method [" + classifier_method + "]") # Save testing results with open(current_result_file, 'wt') as f: writer = csv.writer(f, delimiter='\t') for result_item in results: writer.writerow(result_item) def do_classification_dnn(feature_data, model_container): # Initialize log-likelihood matrix to -inf logls = numpy.empty(15) logls.fill(-numpy.inf) model_clf = skflow.TensorFlowEstimator.restore('dnn/dnnmodel1') logls = numpy.sum(numpy.log(model_clf.predict_proba(feature_data)), 0) classification_result_id = numpy.argmax(logls) return {'class_id': classification_result_id, 'logls': logls} def do_classification_gmm(feature_data, model_container): """GMM classification for give feature matrix model container format: { 'normalizer': normalizer class 'models' : { 'office' : mixture.GMM class 'home' : mixture.GMM class ... } } Parameters ---------- feature_data : numpy.ndarray [shape=(t, feature vector length)] feature matrix model_container : dict model container Returns ------- result : str classification result as scene label """ # Initialize log-likelihood matrix to -inf logls = numpy.empty(len(model_container['models'])) logls.fill(-numpy.inf) for label_id, label in enumerate(model_container['models']): logls[label_id] = numpy.sum(model_container['models'][label].score(feature_data)) classification_result_id = numpy.argmax(logls) return {'class': model_container['models'].keys()[classification_result_id], 'logls': logls} def do_system_evaluation(dataset, result_path, dataset_evaluation_mode='folds'): """System evaluation. Testing outputs are collected and evaluated. Evaluation results are printed. Parameters ---------- dataset : class dataset class result_path : str path where the results are saved. dataset_evaluation_mode : str ['folds', 'full'] evaluation mode, 'full' all material available is considered to belong to one fold. (Default value='folds') Returns ------- nothing Raises ------- IOError Result file not found """ dcase2016_scene_metric = DCASE2016_SceneClassification_Metrics(class_list=dataset.scene_labels) results_fold = [] tot_cm = numpy.zeros((dataset.scene_label_count, dataset.scene_label_count)) for fold in dataset.folds(mode=dataset_evaluation_mode): dcase2016_scene_metric_fold = DCASE2016_SceneClassification_Metrics(class_list=dataset.scene_labels) results = [] result_filename = get_result_filename(fold=fold, path=result_path) if os.path.isfile(result_filename): with open(result_filename, 'rt') as f: for row in csv.reader(f, delimiter='\t'): results.append(row) else: raise IOError("Result file not found [%s]" % result_filename) # Rewrite the result file if os.path.isfile(result_filename): with open(result_filename+'2', 'wt') as f: writer = csv.writer(f, delimiter='\t') for result_item in results: y_true = (dataset.file_meta(result_item[0])[0]['scene_label'],) #print type(y_true) #print type(result_item) writer.writerow(y_true + tuple(result_item)) y_true = [] y_pred = [] for result in results: y_true.append(dataset.file_meta(result[0])[0]['scene_label']) y_pred.append(result[1]) dcase2016_scene_metric.evaluate(system_output=y_pred, annotated_ground_truth=y_true) dcase2016_scene_metric_fold.evaluate(system_output=y_pred, annotated_ground_truth=y_true) results_fold.append(dcase2016_scene_metric_fold.results()) tot_cm += confusion_matrix(y_true, y_pred) final_result['tot_cm'] = tot_cm final_result['tot_cm_acc'] = numpy.sum(numpy.diag(tot_cm)) / numpy.sum(tot_cm) results = dcase2016_scene_metric.results() final_result['result'] = results print " File-wise evaluation, over %d folds" % dataset.fold_count fold_labels = '' separator = ' =====================+======+======+==========+ +' if dataset.fold_count > 1: for fold in dataset.folds(mode=dataset_evaluation_mode): fold_labels += " {:8s} |".format('Fold' + str(fold)) separator += "==========+" print " {:20s} | {:4s} : {:4s} | {:8s} | |".format('Scene label', 'Nref', 'Nsys', 'Accuracy') + fold_labels print separator for label_id, label in enumerate(sorted(results['class_wise_accuracy'])): fold_values = '' if dataset.fold_count > 1: for fold in dataset.folds(mode=dataset_evaluation_mode): fold_values += " {:5.1f} % |".format(results_fold[fold - 1]['class_wise_accuracy'][label] * 100) print " {:20s} | {:4d} : {:4d} | {:5.1f} % | |".format(label, results['class_wise_data'][label]['Nref'], results['class_wise_data'][label]['Nsys'], results['class_wise_accuracy'][ label] * 100) + fold_values print separator fold_values = '' if dataset.fold_count > 1: for fold in dataset.folds(mode=dataset_evaluation_mode): fold_values += " {:5.1f} % |".format(results_fold[fold - 1]['overall_accuracy'] * 100) print " {:20s} | {:4d} : {:4d} | {:5.1f} % | |".format('Overall accuracy', results['Nref'], results['Nsys'], results['overall_accuracy'] * 100) + fold_values if __name__ == "__main__": try: sys.exit(main(sys.argv)) except (ValueError, IOError) as e: sys.exit(e)
mit
matthieudumont/dipy
scratch/very_scratch/eddy_currents.py
22
1282
import numpy as np import dipy as dp import nibabel as ni dname = '/home/eg01/Data_Backup/Data/Eleftherios/CBU090133_METHODS/20090227_145404/Series_003_CBU_DTI_64D_iso_1000' #dname = '/home/eg01/Data_Backup/Data/Frank_Eleftherios/frank/20100511_m030y_cbu100624/08_ep2d_advdiff_101dir_DSI' data,affine,bvals,gradients=dp.load_dcm_dir(dname) ''' rot=np.array([[1,0,0,0], [0,np.cos(np.pi/2),-np.sin(np.pi/2),0], [0,np.sin(np.pi/2), np.cos(np.pi/2),0], [0,0,0,1]]) from scipy.ndimage import affine_transform as aff naffine=np.dot(affine,rot) ''' data[:,:,:,1] source=ni.Nifti1Image(data[:,:,:,1],affine) target=ni.Nifti1Image(data[:,:,:,0],affine) #similarity 'cc', 'cr', 'crl1', 'mi', je', 'ce', 'nmi', 'smi'. 'cr' similarity='cr' #interp 'pv', 'tri' interp = 'tri' #subsampling None or sequence (3,) subsampling=None #search 'affine', 'rigid', 'similarity' or ['rigid','affine'] search='affine' #optimizer 'simplex', 'powell', 'steepest', 'cg', 'bfgs' or #sequence of optimizers optimizer= 'powell' T=dp.volume_register(source,target,similarity,\ interp,subsampling,search,) sourceT=dp.volume_transform(source, T.inv(), reference=target) s=source.get_data() t=target.get_data() sT=sourceT.get_data()
bsd-3-clause
ddrmanxbxfr/servo
tests/wpt/css-tests/tools/html5lib/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset(["pre", "textarea"] + list(rcdataElements)) def __iter__(self): preserve = 0 for token in _base.Filter.__iter__(self): type = token["type"] if type == "StartTag" \ and (preserve or token["name"] in self.spacePreserveElements): preserve += 1 elif type == "EndTag" and preserve: preserve -= 1 elif not preserve and type == "SpaceCharacters" and token["data"]: # Test on token["data"] above to not introduce spaces where there were not token["data"] = " " elif not preserve and type == "Characters": token["data"] = collapse_spaces(token["data"]) yield token def collapse_spaces(text): return SPACES_REGEX.sub(' ', text)
mpl-2.0
lihui7115/ChromiumGStreamerBackend
chrome/common/extensions/docs/server2/github_file_system_test.py
97
1617
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import sys import unittest from appengine_wrappers import files from fake_fetchers import ConfigureFakeFetchers from github_file_system import GithubFileSystem from object_store_creator import ObjectStoreCreator from test_util import Server2Path class GithubFileSystemTest(unittest.TestCase): def setUp(self): ConfigureFakeFetchers() self._base_path = Server2Path('test_data', 'github_file_system') self._file_system = GithubFileSystem.CreateChromeAppsSamples( ObjectStoreCreator.ForTest()) def _ReadLocalFile(self, filename): with open(os.path.join(self._base_path, filename), 'r') as f: return f.read() def testList(self): self.assertEqual(json.loads(self._ReadLocalFile('expected_list.json')), self._file_system.Read(['']).Get()) def testRead(self): self.assertEqual(self._ReadLocalFile('expected_read.txt'), self._file_system.ReadSingle('analytics/launch.js').Get()) def testStat(self): self.assertEqual(0, self._file_system.Stat('zipball').version) def testKeyGeneration(self): self.assertEqual(0, len(files.GetBlobKeys())) self._file_system.ReadSingle('analytics/launch.js').Get() self.assertEqual(1, len(files.GetBlobKeys())) self._file_system.ReadSingle('analytics/main.css').Get() self.assertEqual(1, len(files.GetBlobKeys())) if __name__ == '__main__': unittest.main()
bsd-3-clause
Edraak/edx-platform
lms/djangoapps/ccx/tests/test_utils.py
27
1683
""" test utils """ from nose.plugins.attrib import attr from lms.djangoapps.ccx.tests.factories import CcxFactory from student.roles import CourseCcxCoachRole from student.tests.factories import ( AdminFactory, ) from xmodule.modulestore.tests.django_utils import ( ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE) from xmodule.modulestore.tests.factories import CourseFactory from ccx_keys.locator import CCXLocator @attr('shard_1') class TestGetCCXFromCCXLocator(ModuleStoreTestCase): """Verify that get_ccx_from_ccx_locator functions properly""" MODULESTORE = TEST_DATA_SPLIT_MODULESTORE def setUp(self): """Set up a course, coach, ccx and user""" super(TestGetCCXFromCCXLocator, self).setUp() self.course = CourseFactory.create() coach = self.coach = AdminFactory.create() role = CourseCcxCoachRole(self.course.id) role.add_users(coach) def call_fut(self, course_id): """call the function under test in this test case""" from lms.djangoapps.ccx.utils import get_ccx_from_ccx_locator return get_ccx_from_ccx_locator(course_id) def test_non_ccx_locator(self): """verify that nothing is returned if locator is not a ccx locator """ result = self.call_fut(self.course.id) self.assertEqual(result, None) def test_ccx_locator(self): """verify that the ccx is retuned if using a ccx locator """ ccx = CcxFactory(course_id=self.course.id, coach=self.coach) course_key = CCXLocator.from_course_locator(self.course.id, ccx.id) result = self.call_fut(course_key) self.assertEqual(result, ccx)
agpl-3.0
nprapps/graeae
render_utils.py
1
6337
#!/usr/bin/env python import codecs from datetime import datetime import json import time import urllib import subprocess from decimal import Decimal from flask import Markup, g, render_template, request from slimit import minify from smartypants import smartypants import app_config import copytext class BetterJSONEncoder(json.JSONEncoder): """ A JSON encoder that intelligently handles datetimes. """ def default(self, obj): if isinstance(obj, datetime): encoded_object = obj.isoformat() else: encoded_object = json.JSONEncoder.default(self, obj) return encoded_object class Includer(object): """ Base class for Javascript and CSS psuedo-template-tags. See `make_context` for an explanation of `asset_depth`. """ def __init__(self, asset_depth=0): self.includes = [] self.tag_string = None self.asset_depth = asset_depth def push(self, path): self.includes.append(path) return '' def _compress(self): raise NotImplementedError() def _relativize_path(self, path): relative_path = path depth = len(request.path.split('/')) - (2 + self.asset_depth) while depth > 0: relative_path = '../%s' % relative_path depth -= 1 return relative_path def render(self, path): if getattr(g, 'compile_includes', False): if path in g.compiled_includes: timestamp_path = g.compiled_includes[path] else: # Add a querystring to the rendered filename to prevent caching timestamp_path = '%s?%i' % (path, int(time.time())) out_path = 'www/%s' % path if path not in g.compiled_includes: print 'Rendering %s' % out_path with codecs.open(out_path, 'w', encoding='utf-8') as f: f.write(self._compress()) # See "fab render" g.compiled_includes[path] = timestamp_path markup = Markup(self.tag_string % self._relativize_path(timestamp_path)) else: response = ','.join(self.includes) response = '\n'.join([ self.tag_string % self._relativize_path(src) for src in self.includes ]) markup = Markup(response) del self.includes[:] return markup class JavascriptIncluder(Includer): """ Psuedo-template tag that handles collecting Javascript and serving appropriate clean or compressed versions. """ def __init__(self, *args, **kwargs): Includer.__init__(self, *args, **kwargs) self.tag_string = '<script type="text/javascript" src="%s"></script>' def _compress(self): output = [] src_paths = [] for src in self.includes: src_paths.append('www/%s' % src) with codecs.open('www/%s' % src, encoding='utf-8') as f: print '- compressing %s' % src output.append(minify(f.read())) context = make_context() context['paths'] = src_paths header = render_template('_js_header.js', **context) output.insert(0, header) return '\n'.join(output) class CSSIncluder(Includer): """ Psuedo-template tag that handles collecting CSS and serving appropriate clean or compressed versions. """ def __init__(self, *args, **kwargs): Includer.__init__(self, *args, **kwargs) self.tag_string = '<link rel="stylesheet" type="text/css" href="%s" />' def _compress(self): output = [] src_paths = [] for src in self.includes: src_paths.append('%s' % src) try: compressed_src = subprocess.check_output(["node_modules/less/bin/lessc", "-x", src]) output.append(compressed_src) except: print 'It looks like "lessc" isn\'t installed. Try running: "npm install"' raise context = make_context() context['paths'] = src_paths header = render_template('_css_header.css', **context) output.insert(0, header) return '\n'.join(output) def flatten_app_config(): """ Returns a copy of app_config containing only configuration variables. """ config = {} # Only all-caps [constant] vars get included for k, v in app_config.__dict__.items(): if k.upper() == k: config[k] = v return config def make_context(asset_depth=0): """ Create a base-context for rendering views. Includes app_config and JS/CSS includers. `asset_depth` indicates how far into the url hierarchy the assets are hosted. If 0, then they are at the root. If 1 then at /foo/, etc. """ context = flatten_app_config() try: context['COPY'] = copytext.Copy(app_config.COPY_PATH) except copytext.CopyException: pass context['JS'] = JavascriptIncluder(asset_depth=asset_depth) context['CSS'] = CSSIncluder(asset_depth=asset_depth) return context def urlencode_filter(s): """ Filter to urlencode strings. """ if type(s) == 'Markup': s = s.unescape() # Evaulate COPY elements if type(s) is not unicode: s = unicode(s) s = s.encode('utf8') s = urllib.quote_plus(s) return Markup(s) def smarty_filter(s): """ Filter to smartypants strings. """ if type(s) == 'Markup': s = s.unescape() # Evaulate COPY elements if type(s) is not unicode: s = unicode(s) s = s.encode('utf-8') s = smartypants(s) try: return Markup(s) except: print 'This string failed to encode: %s' % s return Markup(s) def format_commas_filter(s, precision=1): """ Formats numbers nicely """ if s: fmt = '{{:,.{0}f}}'.format(precision) return fmt.format(Decimal(s)) else: return '' def format_thousands_filter(s, show_k=True, precision=1): """ Format 1,000 as 1k """ if int(s) % 1000 == 0: s = int(s) / 1000 if show_k: return '{0}k'.format(s) else: return s else: return format_commas_filter(s, 0)
mit
arnaudsj/titanium_mobile
support/android/compiler.py
1
9347
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Appcelerator Titanium Mobile # # Resource to Android Page Compiler # Handles JS, CSS and HTML files only # import os, sys, re, shutil, tempfile, run, codecs, traceback, types import jspacker, simplejson from xml.sax.saxutils import escape from sgmllib import SGMLParser from csspacker import CSSPacker from deltafy import Deltafy import bindings ignoreFiles = ['.gitignore', '.cvsignore', '.DS_Store'] ignoreDirs = ['.git','.svn','_svn', 'CVS'] ignoreSymbols = ['version','userAgent','name','_JSON','include','fireEvent','addEventListener','removeEventListener','buildhash','builddate'] template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) # class for extracting javascripts class ScriptProcessor(SGMLParser): def __init__(self): SGMLParser.__init__(self) self.scripts = [] def unknown_starttag(self, tag, attrs): if tag == 'script': for attr in attrs: if attr[0]=='src': self.scripts.append(attr[1]) class Compiler(object): def __init__(self,tiapp,project_dir,java,classes_dir,root_dir, include_all_modules=False): self.tiapp = tiapp self.java = java self.appname = tiapp.properties['name'] self.classes_dir = classes_dir self.template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) self.appid = tiapp.properties['id'] self.root_dir = root_dir self.project_dir = os.path.abspath(os.path.expanduser(project_dir)) self.modules = set() self.jar_libraries = set() json_contents = open(os.path.join(self.template_dir,'dependency.json')).read() self.depends_map = simplejson.loads(json_contents) # go ahead and slurp in any required modules for required in self.depends_map['required']: self.add_required_module(required) if (tiapp.has_app_property('ti.android.include_all_modules')): if tiapp.to_bool(tiapp.get_app_property('ti.android.include_all_modules')): include_all_modules = True if include_all_modules: print '[INFO] Force including all modules...' sys.stdout.flush() for module in bindings.get_all_module_names(): self.add_required_module(module) self.module_methods = set() self.js_files = {} self.html_scripts = [] self.compiled_files = [] def add_required_module(self, name): name = name.lower() if name in ('buildhash','builddate'): return # ignore these if not name in self.modules: self.modules.add(name) module_jar = bindings.find_module_jar(name) if module_jar != None and os.path.exists(module_jar): print "[DEBUG] detected module %s, path = %s" % (name, module_jar) self.jar_libraries.add(module_jar) else: print "[DEBUG] unknown module = %s" % name if self.depends_map['libraries'].has_key(name): for lib in self.depends_map['libraries'][name]: lf = os.path.join(self.template_dir,lib) if os.path.exists(lf): if not lf in self.jar_libraries: print "[DEBUG] adding required library: %s" % lib self.jar_libraries.add(lf) if self.depends_map['dependencies'].has_key(name): for depend in self.depends_map['dependencies'][name]: self.add_required_module(depend) def is_module(self, name): ucase_module_names = ("XML", "API", "JSON", "UI") if name.isupper() and name not in ucase_module_names: return False # completely upper case signifies a constant if not name[0].isupper() and name != "iPhone": return False if 'iPhone.' in name: return False return True def extract_from_namespace(self, name, line): modules = set() methods = set() symbols = re.findall(r'%s\.(\w+)' % name, line) if len(symbols) == 0: return modules, methods for sym in symbols: sub_symbols = self.extract_from_namespace("%s.%s" % (name, sym), line) for module in sub_symbols[0]: modules.add("%s.%s" % (sym, module)) for method_name in sub_symbols[1]: method_name = "%s.%s" % (sym, method_name) methods.add(method_name) if sym in ignoreSymbols: continue if self.is_module(sym): modules.add(sym) else: methods.add(sym) return modules, methods def extract_and_combine_modules(self, name, line): modules, methods = self.extract_from_namespace(name, line) for module in modules: self.add_required_module(module) for method in methods: self.module_methods.add(method) def extract_modules(self,out): for line in out.split(';'): self.extract_and_combine_modules('Titanium',line) self.extract_and_combine_modules('Ti',line) def compile_javascript(self, fullpath): js_jar = os.path.join(self.template_dir, 'js.jar') # poor man's os.path.relpath (we don't have python 2.6 in windows) resource_relative_path = fullpath[len(self.project_dir)+1:].replace("\\", "/") # chop off '.js' js_class_name = resource_relative_path[:-3] escape_chars = ['\\', '/', ' ', '.','-'] for escape_char in escape_chars: js_class_name = js_class_name.replace(escape_char, '_') # TODO: add closure compiling too? jsc_args = [self.java, '-classpath', js_jar, 'org.mozilla.javascript.tools.jsc.Main', '-main-method-class', 'org.appcelerator.titanium.TiScriptRunner', '-nosource', '-package', self.appid + '.js', '-encoding', 'utf8', '-o', js_class_name, '-d', self.classes_dir, fullpath] print "[INFO] Compiling javascript: %s" % resource_relative_path sys.stdout.flush() so, se = run.run(jsc_args, ignore_error=True, return_error=True) if not se is None and len(se): sys.stderr.write("[ERROR] %s\n" % se) sys.stderr.flush() sys.exit(1) def compile_into_bytecode(self, paths): compile_js = False # we only optimize for production deploy type or if it's forcefully overridden with ti.android.compilejs if self.tiapp.has_app_property("ti.android.compilejs"): if self.tiapp.to_bool(self.tiapp.get_app_property('ti.android.compilejs')): print "[DEBUG] Found ti.android.compilejs=true, overriding default (this may take some time)" sys.stdout.flush() compile_js = True elif self.tiapp.has_app_property('ti.deploytype'): if self.tiapp.get_app_property('ti.deploytype') == 'production': print "[DEBUG] Deploy type is production, turning on JS compilation" sys.stdout.flush() compile_js = True if not compile_js: return for fullpath in paths: # skip any JS found inside HTML <script> if fullpath in self.html_scripts: continue self.compile_javascript(fullpath) def get_ext(self, path): fp = os.path.splitext(path) return fp[1][1:] def make_function_from_file(self, path, pack=True): ext = self.get_ext(path) path = os.path.expanduser(path) file_contents = codecs.open(path,'r',encoding='utf-8').read() if pack: file_contents = self.pack(path, ext, file_contents) if ext == 'js': # determine which modules this file is using self.extract_modules(file_contents) return file_contents def pack(self, path, ext, file_contents): def jspack(c): return jspacker.jsmin(c) def csspack(c): return CSSPacker(c).pack() packers = {'js': jspack, 'css': csspack } if ext in packers: file_contents = packers[ext](file_contents) of = codecs.open(path,'w',encoding='utf-8') of.write(file_contents) of.close() return file_contents def extra_source_inclusions(self,path): content = codecs.open(path,'r',encoding='utf-8').read() p = ScriptProcessor() p.feed(content) p.close() for script in p.scripts: # ignore remote scripts if script.startswith('http://') or script.startswith('https://'): continue # resolve to a full path p = os.path.abspath(os.path.join(os.path.join(path,'..'),script)) self.html_scripts.append(p) def compile(self, compile_bytecode=True, info_message="Compiling Javascript Resources ..."): if info_message: print "[INFO] %s" % info_message sys.stdout.flush() for root, dirs, files in os.walk(self.project_dir): for dir in dirs: if dir in ignoreDirs: dirs.remove(dir) if len(files) > 0: prefix = root[len(self.project_dir):] for f in files: fp = os.path.splitext(f) if len(fp)!=2: continue if fp[1] == '.jss': continue if not fp[1] in ['.html','.js','.css']: continue if f in ignoreFiles: continue fullpath = os.path.join(root,f) if fp[1] == '.html': self.extra_source_inclusions(fullpath) if fp[1] == '.js': relative = prefix[1:] js_contents = self.make_function_from_file(fullpath, pack=False) if relative!='': key = "%s_%s" % (relative,f) else: key = f key = key.replace('.js','').replace('\\','_').replace('/','_').replace(' ','_').replace('.','_') self.js_files[fullpath] = (key, js_contents) if compile_bytecode: self.compile_into_bytecode(self.js_files) if __name__ == "__main__": if len(sys.argv) != 2: print "Usage: %s <projectdir>" % sys.argv[0] sys.exit(1) project_dir = os.path.expanduser(sys.argv[1]) resources_dir = os.path.join(project_dir, 'Resources') root_dir = os.path.join(project_dir, 'build', 'android') destdir = os.path.join(root_dir, 'bin', 'classes') sys.path.append("..") from tiapp import TiAppXML tiapp = TiAppXML(os.path.join(project_dir, 'tiapp.xml')) c = Compiler(tiapp, resources_dir, 'java', destdir, root_dir) project_deltafy = Deltafy(resources_dir) project_deltas = project_deltafy.scan() c.compile()
apache-2.0
glyph/imaginary
imaginary/test/test_text.py
1
17044
import pprint, string from twisted.trial import unittest from twisted.conch.insults import insults, helper from imaginary.wiring import textserver, terminalui from imaginary import text as T from imaginary import unc from imaginary import __version__ as imaginaryVersion def F(*a, **kw): if "currentAttrs" not in kw: kw["currentAttrs"] = T.AttributeSet() return ''.join(list(T.flatten(a, **kw))) def NN(**kw): nkw = dict.fromkeys(T.AttributeSet.__names__, T.unset) nkw.update(kw) AS = T.AttributeSet(**nkw) x = T.neutral.clone().update(AS) return x def E(*s): return '\x1b[' + ';'.join(s) + 'm' class AttributeSetting(unittest.TestCase): AS = T.AttributeSet B, U, R, L = '1', '4', '7', '5' testData = [ # From To Expected Name? (AS(), AS(), '', 'no transition'), (AS(), NN(bold=True), E(B), 'enable bold'), (AS(), NN(), '', 'do not care about bold'), (AS(), NN(fg='1'), E('31'), 'red foreground'), (AS(), NN(bg='2'), E('42'), 'green background')] blink = AS(blink=True) testData.extend([ (blink, NN(blink=True), '', 'no transition'), (blink, NN(), '', 'do not care'), (blink, NN(blink=False), E('0'), 'turn off blink')]) bu = AS(blink=True, underline=True) testData.extend([ (bu, bu, '', 'no transition'), (bu, NN(blink=True), '', 'do not care'), (bu, NN(blink=True, underline=False), E('0', L), 'disable underline'), (bu, NN(underline=False), E('0', L), 'disable underline'), (bu, NN(blink=False, underline=False), E('0'), 'turn it all off')]) testData.extend([ (AS(), NN(fg='1'), E('31'), 'set fg red'), (AS(), NN(bg='2'), E('42'), 'set bg green'), (AS(), NN(fg='3', bg='4'), E('33', '44'), 'set fg and bg'), (AS(fg='5'), NN(fg='9'), E('0'), 'reset fg'), (AS(bg='6'), NN(bg='9'), E('0'), 'reset bg'), (AS(fg='7', bg='0'), NN(), '', 'do nothing'), (AS(fg='1', bg='2'), NN(fg='9'), E('0', '42'), 'reset fg'), (AS(fg='3', bg='4'), NN(bg='9'), E('0', '33'), 'reset bg'), (AS(fg='5'), NN(bg='3'), E('43'), 'enable bg'), (AS(bg='7'), NN(bg='3'), E('43'), 'switch bg'), (AS(fg='2'), NN(fg='1'), E('31'), 'switch fg'), (AS(fg='6'), NN(fg='6'), '', 'request same'), ]) def testMega(self): # trial should support this use case. failures = [] for n, (start, finish, output, msg) in enumerate(self.testData): got = finish.toVT102(start) if got != output: failures.append((got, output, str(n) + ': ' + msg)) if failures: failures.insert(0, ('received', 'expected', "what's up")) raise unittest.FailTest(pprint.pformat(failures)) class Colorization(unittest.TestCase): def testTrivialStringOnly(self): self.assertEquals( F('hello world'), 'hello world') self.assertEquals( F('hello', ' ', 'world'), 'hello world') self.assertEquals( F(''), '') def testNoColors(self): self.assertEquals( F([[T.fg.green, "hi", T.bg.yellow, "there", T.bold, "no"], "normal", [T.fg.blue, "blue"], "notblue"], useColors=False), "hitherenonormalbluenotblue") def testTrivialStringAndList(self): self.assertEquals( F(['hello world']), 'hello world') self.assertEquals( F(['hello', ' ', 'world']), 'hello world') self.assertEquals( F(['hello', [' ', ['world']]]), 'hello world') self.assertEquals( F(['hello', [' '], 'world']), 'hello world') self.assertEquals( F([[['hello'], ' '], 'world']), 'hello world') def testTrivialStringWithAttributes(self): self.assertEquals( F('hello world', currentAttrs=T.fg.normal), 'hello world') def testForegroundColorization(self): for code, sym in [(30, T.fg.black), (31, T.fg.red), (32, T.fg.green), (33, T.fg.yellow), (34, T.fg.blue), (35, T.fg.magenta), (36, T.fg.cyan), (37, T.fg.white)]: self.assertEquals( F(sym, 'hello world'), '\x1b[%dmhello world\x1b[0m' % (code,)) def testBackgroundColorization(self): for code, sym in [(40, T.bg.black), (41, T.bg.red), (42, T.bg.green), (43, T.bg.yellow), (44, T.bg.blue), (45, T.bg.magenta), (46, T.bg.cyan), (47, T.bg.white)]: self.assertEquals( F(sym, 'hello world'), '\x1b[%dmhello world\x1b[0m' % (code,)) def testExtraAttributes(self): for code, sym in [(1, T.bold), (5, T.blink), (7, T.reverseVideo), (4, T.underline)]: self.assertEquals( F(sym, 'hello world'), '\x1b[%dmhello world\x1b[0m' % (code,)) self.assertEquals(F(T.fg.normal, 'hello world'), 'hello world') self.assertEquals(F(T.bg.normal, 'hello world'), 'hello world') def testSmallerNestedCharacterState(self): a = F([T.fg.red, 'red', [T.reverseVideo, '!red']]) b = '\x1b[31mred\x1b[7m!red\x1b[0m' self.assertEquals(a, b) def _assertECMA48Equality(self, a, b): errorLines = ['received\t\texpected'] for la, lb in zip(unc.prettystring(a).splitlines(), unc.prettystring(b).splitlines()): errorLines.append(la + '\t\t' + lb) self.assertEquals(a, b, '\nERROR!\n' + '\n'.join(errorLines)) def testNestedCharacterState(self): a = F([T.fg.red, 'hello'], [T.bg.green, 'world', [T.bg.normal, 'more worlds']], [T.blink, 'blinky'], [T.fg.red, T.bg.blue, 'multicolor', [T.reverseVideo, 'colormulti']]) b = ('\x1b[31mhello' '\x1b[0;42mworld' '\x1b[0mmore worlds' '\x1b[5mblinky' '\x1b[0;31;44mmulticolor' '\x1b[7mcolormulti\x1b[0m') self._assertECMA48Equality(a, b) self._assertECMA48Equality( F([T.fg.red, [T.bg.green, [T.blink, 'hello'], ' '], 'world']), '\x1b[5;31;42mhello\x1b[0;31;42m \x1b[0;31mworld\x1b[0m') self._assertECMA48Equality( F([T.fg.cyan, T.bg.magenta, 'Hello ', [T.fg.normal, 'world'], '.']), '\x1b[36;45mHello \x1b[0;45mworld\x1b[36m.\x1b[0m') class AsynchronousIncrementalUTF8DecoderTestCase(unittest.TestCase): """ Test L{imaginary.wiring.terminalui.AsynchronousIncrementalUTF8Decoder} """ def setUp(self): self.a = terminalui.AsynchronousIncrementalUTF8Decoder() def testASCII(self): for ch in 'hello, world': self.a.add(ch) self.assertEquals(self.a.get(), u'hello, world') def testTwoBytes(self): character = u'\N{LATIN CAPITAL LETTER A WITH GRAVE}' byte1, byte2 = character.encode('utf-8') self.a.add(byte1) self.assertEquals(self.a.get(), u'') self.a.add(byte2) self.assertEquals(self.a.get(), character) def testThreeBytes(self): character = u'\N{HIRAGANA LETTER A}' byte1, byte2, byte3 = character.encode('utf-8') self.a.add(byte1) self.assertEquals(self.a.get(), u'') self.a.add(byte2) self.assertEquals(self.a.get(), u'') self.a.add(byte3) self.assertEquals(self.a.get(), character) def testFourBytes(self): character = u'\N{BYZANTINE MUSICAL SYMBOL PSILI}' byte1, byte2, byte3, byte4 = character.encode('utf-8') self.a.add(byte1) self.assertEquals(self.a.get(), u'') self.a.add(byte2) self.assertEquals(self.a.get(), u'') self.a.add(byte3) self.assertEquals(self.a.get(), u'') self.a.add(byte4) self.assertEquals(self.a.get(), character) def testSeveralCharacters(self): char1 = u'\N{LATIN CAPITAL LETTER A WITH GRAVE}' byte1, byte2 = char1.encode('utf-8') self.a.add(byte1) self.assertEquals(self.a.get(), u'') self.a.add(byte2) self.assertEquals(self.a.get(), char1) char2 = u'\N{HIRAGANA LETTER A}' byte1, byte2, byte3 = char2.encode('utf-8') self.a.add(byte1) self.assertEquals(self.a.get(), char1) self.a.add(byte2) self.assertEquals(self.a.get(), char1) self.a.add(byte3) self.assertEquals(self.a.get(), char1 + char2) char3 = u'\N{BYZANTINE MUSICAL SYMBOL PSILI}' byte1, byte2, byte3, byte4 = char3.encode('utf-8') self.a.add(byte1) self.assertEquals(self.a.get(), char1 + char2) self.a.add(byte2) self.assertEquals(self.a.get(), char1 + char2) self.a.add(byte3) self.assertEquals(self.a.get(), char1 + char2) self.a.add(byte4) self.assertEquals(self.a.get(), char1 + char2 + char3) def testReset(self): self.a.add('a') self.a.reset() self.assertEquals(self.a.get(), u'') def testNarrowWidth(self): self.a.add('a') self.assertEquals(self.a.width(), 1) def testWideWidth(self): map(self.a.add, u'\N{HIRAGANA LETTER A}'.encode('utf-8')) self.assertEquals(self.a.width(), 2) def testMixedWidth(self): self.a.add('a') map(self.a.add, u'\N{HIRAGANA LETTER A}'.encode('utf-8')) self.assertEquals(self.a.width(), 3) map(self.a.add, u'\N{HIRAGANA LETTER A}'.encode('utf-8')) self.a.add('a') self.assertEquals(self.a.width(), 6) def testPop(self): self.a.add('a') self.assertEquals(self.a.pop(), u'a') self.assertEquals(self.a.get(), u'') def testPopIncompleteCharacter(self): self.a.add(u'\N{LATIN CAPITAL LETTER A WITH GRAVE}'.encode('utf-8')[0]) self.assertRaises(ValueError, self.a.pop) def testPopEmpty(self): self.assertRaises(IndexError, self.a.pop) class UTF8TerminalBuffer(helper.TerminalBuffer): # An unfortunate hack'n'paste of # helper.TerminalBuffer.insertAtCursor def insertAtCursor(self, b): if b == '\r': self.x = 0 elif b == '\n' or self.x >= self.width: self.x = 0 self._scrollDown() # The following conditional has been changed from the original. if (b > '\x7f' or b in string.printable) and b not in '\r\n': ch = (b, self._currentFormattingState()) if self.modes.get(insults.modes.IRM): self.lines[self.y][self.x:self.x] = [ch] self.lines[self.y].pop() else: self.lines[self.y][self.x] = ch self.x += 1 class TextServerTestCase(unittest.TestCase): """ Tests for L{imaginary.wiring.textserver} """ def setUp(self): self.terminal = UTF8TerminalBuffer() self.terminal.connectionMade() self.protocol = terminalui.TextServerBase() self.protocol.makeConnection(self.terminal) self.terminal.reset() def testUTF8Input(self): character = u'\N{HIRAGANA LETTER A}' for ch in character.encode('utf-8'): self.protocol.keystrokeReceived(ch, None) self.assertEquals(str(self.terminal).strip(), character.encode('utf-8')) def testNonPrintableInput(self): lines = [] self.protocol.lineReceived = lines.append bytes = range(0, 127) for special in [8, 10, 13]: bytes.remove(special) bytes = ''.join(map(chr, bytes)) + 'WOO' expected = ''.join([byte for byte in bytes if byte >= ' ' and byte != '\x7f']) expected = expected.decode('ascii') for byte in bytes: self.protocol.keystrokeReceived(byte, None) self.protocol.keystrokeReceived('\n', None) self.assertEquals(lines, [expected]) def _backspaceTest(self, character, width): """ Verify that a character is erased properly by a backspace. @param character: The character to receive, echo, and then have deleted. @type character: C{unicode} @param width: How many columns the given character is expected to be when rendered. This is how many backspaces are expected to be required to erase it. @type width: C{int} """ lines = [] self.protocol.lineReceived = lines.append # The terminal emulator we use doesn't know enough unicode for this # test to work out right. So we'll fake it ourselves here. written = [] self.terminal.write = written.append self.protocol.keystrokeReceived('a', None) self.protocol.keystrokeReceived(character.encode('utf-8'), None) self.protocol.keystrokeReceived(self.terminal.BACKSPACE, None) self.assertEquals( ''.join(written), 'a' + character.encode('utf-8') + '\b' * width + ' ' * width + '\b' * width) def test_eraseNarrowWithBackspace(self): """ If a backspace keystroke is received when the cursor is positioned directly after a character with an I{east asian width} of I{narrow}, the character is removed from the input buffer and the character is erased from the client display with a C{'\b \b'} sequence. """ self._backspaceTest(u'x', 1) def test_eraseWideWithBackspace(self): """ If a backspace keystroke is received when the cursor is positioned directly after a character with an I{east asian width} of I{wide}, the character is removed from the input buffer and the character is erased from the client display with a C{'\b\b \b\b'} sequence. """ self._backspaceTest(u'\u1100', 2) def test_eraseFullwidthWithBackspace(self): """ If a backspace keystroke is received when the cursor is positioned directly after a character with an I{east asian width} of I{fullwidth}, character is removed from the input buffer and the character is erased from the client display with a C{'\b\b \b\b'} sequence. """ self._backspaceTest(u'\u3000', 2) def test_eraseHalfwidthWithBackspace(self): """ If a backspace keystroke is received when the cursor is positioned directly after a character with an I{east asian width} of I{halfwidth}, character is removed from the input buffer and the character is erased from the client display with a C{'\b \b'} sequence. """ self._backspaceTest(u'\u20a9', 1) def test_eraseNeutralWithBackspace(self): """ If a backspace keystroke is received when the cursor is positioned directly after a character with an I{east asian width} of I{neutral}, character is removed from the input buffer and the character is erased from the client display with a C{'\b \b'} sequence. """ self._backspaceTest(u'\xa0', 1) def test_eraseAmbiguousWithBackspace(self): """ If a backspace keystroke is received when the cursor is positioned directly after a character with an I{east asian width} of I{neutral}, character is removed from the input buffer and the character is erased from the client display with a C{'\b \b'} sequence. """ self._backspaceTest(u'\xa1', 1) class MOTDTests(unittest.TestCase): """ Tests for the I{message of the day} presented by L{CharacterSelectionTextServer}. """ def test_imaginaryVersion(self): """ The message contains the Imaginary version number. """ self.assertIn( imaginaryVersion, textserver.CharacterSelectionTextServer.motd)
mit
jesiv/soTp1
tp1/simusched/graph_cores.py
3
5891
#!/usr/bin/env python # coding: utf-8 import sys, os import matplotlib matplotlib.use('Agg') from pylab import * from matplotlib.transforms import TransformedBbox class EventFactory(object): #CPU time pid cpu (si pid == -1 -> idle) cpu_event= lambda x: Event(x[0],EventFactory.Events.keys().index(x[0]),int(x[1]),int(x[2]),int(x[3])) #EVENT time pid other_event= lambda x: Event(x[0],EventFactory.Events.keys().index(x[0]),int(x[1]),int(x[2]),-1) #CONTEXT CPU cpu time (se pone pid == -2) context_switch_event= lambda x: Event(x[0] ,EventFactory.Events.keys().index(x[0]),int(x[3]),-2,int(x[2])) Events = {'LOAD': other_event, 'CPU':cpu_event, 'BLOCK': other_event, 'UNBLOCK': other_event, 'DEADLINE': other_event, 'EXIT': other_event, 'CONTEXT':context_switch_event, 'WAITING':None, 'NOT_LOAD': None, 'CPU_BLOCK': None} @classmethod def get_event(cls, event_line): splited_event_line= event_line.split() if splited_event_line[0] in EventFactory.Events.keys(): return EventFactory.Events[splited_event_line[0]](splited_event_line) else: return None class Event(object): def __init__(self, event_type, event_code, time, pid, core): self.event_type= event_type self.event_code= event_code self.time= time self.pid= pid self.core= core def __str__(self): return 'Type: ' + self.event_type + ', Code: ' + str(self.event_code) + ', Time: ' + str(self.time) + ', Pid: ' + str(self.pid) + ', Core: ' + str(self.core) def parseInput(fin): ln = 0 result = [] cores = 0 pids= 0 settings = None cpus_timeline= dict() for line in fin: ln += 1 vls = line.split() if line and line[0] == '#': if line.startswith('# SETTINGS '): settings = line[11:].strip() continue else: line= line[2:].strip() # Queda --> 'CONTEXT CPU cpu time event= EventFactory.get_event(line) result.append(event) if event.event_type == 'CPU': if (cores <=event.core): cores = event.core+1 if event.event_type == 'LOAD': if(pids <= event.pid): pids = event.pid +1 return settings, result, cores, pids def dataGathering(data, cores, pids): core_timeline= dict() # core: list(pids) NOTA: se supone que en cada tick hay un pid block_lapse= dict() for event in data: #core_time if event.core != -1: if event.core not in core_timeline: core_timeline[event.core]= [] core_timeline[event.core].append(event.pid) return core_timeline def draw_cores_timeline_gannt(cores_timeline, filename): ''' pre: cores_timeline = {core: list(pid) } ''' # Necesitaria tener la info algo asi como # core: {pid: ini_1,fin_1,ini_2,fin_2} (es decir por intervalos) # broken_barh necesita (inicio, longitud) colors={'pid':'#c0ffc0','switch':'#b7b7f7', 'idle':'#d0d0d0'} fig= figure(figsize=(11.8,8.3)) ax = fig.add_subplot(111) title('Tareas en Core por tiempo') yticks(cores_timeline.keys()) # ax.xaxis.set_major_locator( ax.xaxis.set_major_locator( IndexLocator(2,1) ) #xticks(range(len(cores_timeline[0])),range(0,len(cores_timeline[0]),5)) xlabel('Tiempo') ylabel('Core') ylim((-1,len(cores_timeline.keys()))) ax.grid(True) for core in cores_timeline: pids_by_time= cores_timeline[core] intervals= dict() last_pid= None for time in range(len(pids_by_time)): if last_pid != pids_by_time[time]: last_pid = pids_by_time[time] if last_pid not in intervals: intervals[last_pid]= [] intervals[last_pid].append((time, 1)) #intervals.push((last_pid,time,1)) else: #pid, time, interval_size= intervals.pop() #intervals.push((pid, time, interval_size+1)) time, interval_size= intervals[last_pid].pop() intervals[last_pid].append((time, interval_size+1)) for pid in intervals: if pid >= 0: rect= ax.broken_barh(intervals[pid], (core-0.25, 0.5), facecolor=colors['pid']) for init, size in intervals[pid]: ax.text(init+(size/2.0),core, str(pid), ha="center", va="center", size=9, weight='bold') elif pid == -1: rect= ax.broken_barh(intervals[pid], (core-0.25, 0.5), facecolor=colors['idle']) elif pid == -2: rect= ax.broken_barh(intervals[pid], (core-0.25, 0.5), facecolor=colors['switch']) else: print 'ERROR!' tarea_dummy = Rectangle((0, 0), 1, 1, fc=colors['pid']) switch_dummy = Rectangle((0, 0), 1, 1, fc=colors['switch']) idle_dummy = Rectangle((0, 0), 1, 1, fc=colors['idle']) legend([tarea_dummy, switch_dummy, idle_dummy], ['Tarea','Cambio de contexto','Inactivo']) tight_layout() fig.autofmt_xdate() ax.legend() savefig(filename+'.png', dpi=300, format='png') def main(argv): if len(argv) <= 1: fin = sys.stdin fout_cores_timeline= 'out_cores_timeline' else: fin = open(argv[1], 'r') preffix= argv[1] fout_cores_timeline= preffix + '_cores_timeline' print 'parsing input' settings, data, cores, pids = parseInput(fin) print 'data gathering' cores_timeline= dataGathering(data, cores, pids) print cores_timeline #todo dump de los datos print 'drawing cores timeline' draw_cores_timeline_gannt(cores_timeline, fout_cores_timeline) if __name__ == "__main__": main(sys.argv)
mit
ar7z1/ansible
lib/ansible/modules/storage/netapp/na_ontap_net_ifgrp.py
9
11332
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = """ module: na_ontap_net_ifgrp short_description: NetApp Ontap modify network interface group extends_documentation_fragment: - netapp.na_ontap version_added: '2.6' author: NetApp Ansible Team ([email protected]) description: - Create, modify, destroy the network interface group options: state: description: - Whether the specified network interface group should exist or not. choices: ['present', 'absent'] default: present distribution_function: description: - Specifies the traffic distribution function for the ifgrp. choices: ['mac', 'ip', 'sequential', 'port'] name: description: - Specifies the interface group name. required: true mode: description: - Specifies the link policy for the ifgrp. node: description: - Specifies the name of node. required: true port: description: - Adds the specified port. """ EXAMPLES = """ - name: create ifgrp na_ontap_net_ifgrp: state=present username={{ netapp_username }} password={{ netapp_password }} hostname={{ netapp_hostname }} distribution_function=ip name=a0c port=e0d mode=multimode node={{ Vsim node name }} - name: delete ifgrp na_ontap_net_ifgrp: state=absent username={{ netapp_username }} password={{ netapp_password }} hostname={{ netapp_hostname }} name=a0c node={{ Vsim node name }} """ RETURN = """ """ import traceback from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_native import ansible.module_utils.netapp as netapp_utils HAS_NETAPP_LIB = netapp_utils.has_netapp_lib() class NetAppOntapIfGrp(object): """ Create, Modifies and Destroys a IfGrp """ def __init__(self): """ Initialize the Ontap IfGrp class """ self.argument_spec = netapp_utils.na_ontap_host_argument_spec() self.argument_spec.update(dict( state=dict(required=False, choices=['present', 'absent'], default='present'), distribution_function=dict(required=False, type='str', choices=['mac', 'ip', 'sequential', 'port']), name=dict(required=True, type='str'), mode=dict(required=False, type='str'), node=dict(required=True, type='str'), port=dict(required=False, type='str'), )) self.module = AnsibleModule( argument_spec=self.argument_spec, required_if=[ ('state', 'present', ['distribution_function', 'mode']) ], supports_check_mode=True ) parameters = self.module.params # set up state variables self.state = parameters['state'] self.distribution_function = parameters['distribution_function'] self.name = parameters['name'] self.mode = parameters['mode'] self.node = parameters['node'] self.port = parameters['port'] if HAS_NETAPP_LIB is False: self.module.fail_json(msg="the python NetApp-Lib module is required") else: self.server = netapp_utils.setup_na_ontap_zapi(module=self.module) return def get_if_grp(self): """ Return details about the if_group :param: name : Name of the if_group :return: Details about the if_group. None if not found. :rtype: dict """ if_group_iter = netapp_utils.zapi.NaElement('net-port-get-iter') if_group_info = netapp_utils.zapi.NaElement('net-port-info') if_group_info.add_new_child('port', self.name) if_group_info.add_new_child('port-type', 'if_group') query = netapp_utils.zapi.NaElement('query') query.add_child_elem(if_group_info) if_group_iter.add_child_elem(query) result = self.server.invoke_successfully(if_group_iter, True) return_value = None if result.get_child_by_name('num-records') and \ int(result.get_child_content('num-records')) >= 1: if_group_attributes = result.get_child_by_name('attributes-list').get_child_by_name('net-port-info') distribution_function = if_group_attributes.get_child_content('ifgrp-distribution-function') name = if_group_attributes.get_child_content('port') mode = if_group_attributes.get_child_content('ifgrp-mode') ports = if_group_attributes.get_child_content('ifgrp-port') node = if_group_attributes.get_child_content('node') return_value = { 'name': name, 'distribution_function': distribution_function, 'mode': mode, 'node': node, 'ports': ports } return return_value def get_if_grp_ports(self): """ Return ports of the if_group :param: name : Name of the if_group :return: Ports of the if_group. None if not found. :rtype: dict """ if_group_iter = netapp_utils.zapi.NaElement('net-port-ifgrp-get') if_group_iter.add_new_child('ifgrp-name', self.name) if_group_iter.add_new_child('node', self.node) result = self.server.invoke_successfully(if_group_iter, True) return_value = None if result.get_child_by_name('attributes'): if_group_attributes = result.get_child_by_name('attributes').get_child_by_name('net-ifgrp-info') name = if_group_attributes.get_child_content('ifgrp-name') mode = if_group_attributes.get_child_content('mode') port_list = [] if if_group_attributes.get_child_by_name('ports'): ports = if_group_attributes.get_child_by_name('ports').get_children() for each in ports: port_list.append(each.get_content()) node = if_group_attributes.get_child_content('node') return_value = { 'name': name, 'mode': mode, 'node': node, 'ports': port_list } return return_value def create_if_grp(self): """ Creates a new ifgrp """ route_obj = netapp_utils.zapi.NaElement("net-port-ifgrp-create") route_obj.add_new_child("distribution-function", self.distribution_function) route_obj.add_new_child("ifgrp-name", self.name) route_obj.add_new_child("mode", self.mode) route_obj.add_new_child("node", self.node) try: self.server.invoke_successfully(route_obj, True) except netapp_utils.zapi.NaApiError as error: self.module.fail_json(msg='Error creating if_group %s: %s' % (self.name, to_native(error)), exception=traceback.format_exc()) def delete_if_grp(self): """ Deletes a ifgrp """ route_obj = netapp_utils.zapi.NaElement("net-port-ifgrp-destroy") route_obj.add_new_child("ifgrp-name", self.name) route_obj.add_new_child("node", self.node) try: self.server.invoke_successfully(route_obj, True) except netapp_utils.zapi.NaApiError as error: self.module.fail_json(msg='Error deleting if_group %s: %s' % (self.name, to_native(error)), exception=traceback.format_exc()) def add_port_to_if_grp(self): """ adds port to a ifgrp """ route_obj = netapp_utils.zapi.NaElement("net-port-ifgrp-add-port") route_obj.add_new_child("ifgrp-name", self.name) route_obj.add_new_child("port", self.port) route_obj.add_new_child("node", self.node) try: self.server.invoke_successfully(route_obj, True) except netapp_utils.zapi.NaApiError as error: self.module.fail_json(msg='Error adding port %s to if_group %s: %s' % (self.port, self.name, to_native(error)), exception=traceback.format_exc()) def remove_port_to_if_grp(self): """ removes port from a ifgrp """ route_obj = netapp_utils.zapi.NaElement("net-port-ifgrp-remove-port") route_obj.add_new_child("ifgrp-name", self.name) route_obj.add_new_child("port", self.port) route_obj.add_new_child("node", self.node) try: self.server.invoke_successfully(route_obj, True) except netapp_utils.zapi.NaApiError as error: self.module.fail_json(msg='Error removing port %s to if_group %s: %s' % (self.port, self.name, to_native(error)), exception=traceback.format_exc()) def apply(self): changed = False ifgroup_exists = False add_ports_exists = True remove_ports_exists = False results = netapp_utils.get_cserver(self.server) cserver = netapp_utils.setup_na_ontap_zapi(module=self.module, vserver=results) netapp_utils.ems_log_event("na_ontap_net_ifgrp", cserver) if_group_detail = self.get_if_grp() if if_group_detail: ifgroup_exists = True ifgrp_ports_detail = self.get_if_grp_ports() if self.state == 'absent': changed = True if self.port: if self.port in ifgrp_ports_detail['ports']: remove_ports_exists = True elif self.state == 'present': if self.port: if not ifgrp_ports_detail['ports']: add_ports_exists = False changed = True else: if self.port not in ifgrp_ports_detail['ports']: add_ports_exists = False changed = True else: if self.state == 'present': changed = True if changed: if self.module.check_mode: pass else: if self.state == 'present': if not ifgroup_exists: self.create_if_grp() if self.port: self.add_port_to_if_grp() else: if not add_ports_exists: self.add_port_to_if_grp() elif self.state == 'absent': if remove_ports_exists: self.remove_port_to_if_grp() self.delete_if_grp() self.module.exit_json(changed=changed) def main(): """ Creates the NetApp Ontap Net Route object and runs the correct play task """ obj = NetAppOntapIfGrp() obj.apply() if __name__ == '__main__': main()
gpl-3.0
trabacus-softapps/openerp-8.0-cc
openerp/addons/website_blog/controllers/main.py
3
11636
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## from openerp.addons.web import http from openerp.addons.web.http import request from openerp.tools.translate import _ from openerp import SUPERUSER_ID import werkzeug class WebsiteBlog(http.Controller): _blog_post_per_page = 6 _post_comment_per_page = 6 def nav_list(self): blog_post_obj = request.registry['blog.post'] groups = blog_post_obj.read_group(request.cr, request.uid, [], ['name', 'create_date'], groupby="create_date", orderby="create_date asc", context=request.context) for group in groups: group['date'] = "%s_%s" % (group['__domain'][0][2], group['__domain'][1][2]) return groups @http.route([ '/blog', '/blog/page/<int:page>/', ], type='http', auth="public", website=True, multilang=True) def blogs(self, page=1): BYPAGE = 60 cr, uid, context = request.cr, request.uid, request.context blog_obj = request.registry['blog.post'] total = blog_obj.search(cr, uid, [], count=True, context=context) pager = request.website.pager( url='/blog/', total=total, page=page, step=BYPAGE, ) bids = blog_obj.search(cr, uid, [], offset=(page-1)*BYPAGE, limit=BYPAGE, context=context) blogs = blog_obj.browse(cr, uid, bids, context=context) return request.website.render("website_blog.latest_blogs", { 'blogs': blogs, 'pager': pager }) @http.route([ '/blog/<model("blog.blog"):blog>/', '/blog/<model("blog.blog"):blog>/page/<int:page>/', '/blog/<model("blog.blog"):blog>/tag/<model("blog.tag"):tag>/', '/blog/<model("blog.blog"):blog>/tag/<model("blog.tag"):tag>/page/<int:page>/', '/blog/<model("blog.blog"):blog>/date/<string(length=21):date>/', '/blog/<model("blog.blog"):blog>/date/<string(length=21):date>/page/<int:page>/', '/blog/<model("blog.blog"):blog>/tag/<model("blog.tag"):tag>/date/<string(length=21):date>/', '/blog/<model("blog.blog"):blog>/tag/<model("blog.tag"):tag>/date/<string(length=21):date>/page/<int:page>/', ], type='http', auth="public", website=True, multilang=True) def blog(self, blog=None, tag=None, date=None, page=1, **opt): """ Prepare all values to display the blog. :param blog: blog currently browsed. :param tag: tag that is currently used to filter blog posts :param integer page: current page of the pager. Can be the blog or post pager. :param date: date currently used to filter blog posts (dateBegin_dateEnd) :return dict values: values for the templates, containing - 'blog_posts': list of browse records that are the posts to display in a given blog, if not blog_post_id - 'blog': browse of the current blog, if blog_id - 'blogs': list of browse records of blogs - 'pager': the pager to display posts pager in a blog - 'tag': current tag, if tag_id - 'nav_list': a dict [year][month] for archives navigation """ BYPAGE = 10 cr, uid, context = request.cr, request.uid, request.context blog_post_obj = request.registry['blog.post'] blog_posts = None blog_obj = request.registry['blog.blog'] blog_ids = blog_obj.search(cr, uid, [], context=context) blogs = blog_obj.browse(cr, uid, blog_ids, context=context) path_filter = "" domain = [] if blog: path_filter += "%s/" % blog.id domain += [("id", "in", [post.id for post in blog.blog_post_ids])] if tag: path_filter += 'tag/%s/' % tag.id domain += [("id", "in", [post.id for post in tag.blog_post_ids])] if date: path_filter += "date/%s/" % date domain += [("create_date", ">=", date.split("_")[0]), ("create_date", "<=", date.split("_")[1])] blog_post_ids = blog_post_obj.search(cr, uid, domain, context=context) blog_posts = blog_post_obj.browse(cr, uid, blog_post_ids, context=context) pager = request.website.pager( url="/blog/%s" % path_filter, total=len(blog_posts), page=page, step=self._blog_post_per_page, scope=BYPAGE ) pager_begin = (page - 1) * self._blog_post_per_page pager_end = page * self._blog_post_per_page blog_posts = blog_posts[pager_begin:pager_end] tag_obj = request.registry['blog.tag'] tag_ids = tag_obj.search(cr, uid, [], context=context) tags = tag_obj.browse(cr, uid, tag_ids, context=context) values = { 'blog': blog, 'blogs': blogs, 'tags': tags, 'tag': tag, 'blog_posts': blog_posts, 'pager': pager, 'nav_list': self.nav_list(), 'path_filter': path_filter, 'date': date, } return request.website.render("website_blog.blog_post_short", values) @http.route([ '/blogpost/<model("blog.post"):blog_post>/', ], type='http', auth="public", website=True, multilang=True) def blog_post(self, blog_post, tag=None, date=None, page=1, enable_editor=None, **post): """ Prepare all values to display the blog. :param blog_post: blog post currently browsed. If not set, the user is browsing the blog and a post pager is calculated. If set the user is reading the blog post and a comments pager is calculated. :param blog: blog currently browsed. :param tag: tag that is currently used to filter blog posts :param integer page: current page of the pager. Can be the blog or post pager. :param date: date currently used to filter blog posts (dateBegin_dateEnd) - 'enable_editor': editor control :return dict values: values for the templates, containing - 'blog_post': browse of the current post, if blog_post_id - 'blog': browse of the current blog, if blog_id - 'blogs': list of browse records of blogs - 'pager': the pager to display comments pager in a blog post - 'tag': current tag, if tag_id - 'nav_list': a dict [year][month] for archives navigation """ pager_url = "/blogpost/%s" % blog_post.id pager = request.website.pager( url=pager_url, total=len(blog_post.website_message_ids), page=page, step=self._post_comment_per_page, scope=7 ) pager_begin = (page - 1) * self._post_comment_per_page pager_end = page * self._post_comment_per_page blog_post.website_message_ids = blog_post.website_message_ids[pager_begin:pager_end] cr, uid, context = request.cr, request.uid, request.context blog_obj = request.registry['blog.blog'] blog_ids = blog_obj.search(cr, uid, [], context=context) blogs = blog_obj.browse(cr, uid, blog_ids, context=context) tag_obj = request.registry['blog.tag'] tag_ids = tag_obj.search(cr, uid, [], context=context) tags = tag_obj.browse(cr, uid, tag_ids, context=context) MONTHS = [None, _('January'), _('February'), _('March'), _('April'), _('May'), _('June'), _('July'), _('August'), _('September'), _('October'), _('November'), _('December')] values = { 'blog': blog_post.blog_id, 'blogs': blogs, 'tags': tags, 'tag': tag and request.registry['blog.tag'].browse(cr, uid, int(tag), context=context) or None, 'blog_post': blog_post, 'main_object': blog_post, 'pager': pager, 'nav_list': self.nav_list(), 'enable_editor': enable_editor, 'date': date, 'date_name': date and "%s %s" % (MONTHS[int(date.split("-")[1])], date.split("-")[0]) or None } return request.website.render("website_blog.blog_post_complete", values) @http.route(['/blogpost/comment'], type='http', auth="public", methods=['POST'], website=True) def blog_post_comment(self, blog_post_id=0, **post): cr, uid, context = request.cr, request.uid, request.context if post.get('comment'): user = request.registry['res.users'].browse(cr, SUPERUSER_ID, uid, context=context) group_ids = user.groups_id group_id = request.registry["ir.model.data"].get_object_reference(cr, uid, 'website_mail', 'group_comment')[1] if group_id in [group.id for group in group_ids]: blog_post = request.registry['blog.post'] blog_post.check_access_rights(cr, uid, 'read') blog_post.message_post( cr, SUPERUSER_ID, int(blog_post_id), body=post.get('comment'), type='comment', subtype='mt_comment', author_id=user.partner_id.id, context=dict(context, mail_create_nosubcribe=True)) return werkzeug.utils.redirect(request.httprequest.referrer + "#comments") @http.route('/blogpost/new', type='http', auth="public", website=True, multilang=True) def blog_post_create(self, blog_id, **post): cr, uid, context = request.cr, request.uid, request.context create_context = dict(context, mail_create_nosubscribe=True) new_blog_post_id = request.registry['blog.post'].create( request.cr, request.uid, { 'blog_id': blog_id, 'name': _("Blog Post Title"), 'content': '', 'website_published': False, }, context=create_context) return werkzeug.utils.redirect("/blogpost/%s/?enable_editor=1" % new_blog_post_id) @http.route('/blogpost/duplicate', type='http', auth="public", website=True) def blog_post_copy(self, blog_post_id, **post): """ Duplicate a blog. :param blog_post_id: id of the blog post currently browsed. :return redirect to the new blog created """ cr, uid, context = request.cr, request.uid, request.context create_context = dict(context, mail_create_nosubscribe=True) new_blog_post_id = request.registry['blog.post'].copy(cr, uid, blog_post_id, {}, context=create_context) return werkzeug.utils.redirect("/blogpost/%s/?enable_editor=1" % new_blog_post_id)
agpl-3.0
tcpcloud/contrail-controller
src/config/utils/create_floating_pool.py
5
4482
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import argparse import ConfigParser import json import copy from netaddr import IPNetwork from vnc_api.vnc_api import * def get_ip(ip_w_pfx): return str(IPNetwork(ip_w_pfx).ip) # end get_ip class VncProvisioner(object): def __init__(self, args_str=None): self._args = None if not args_str: args_str = ' '.join(sys.argv[1:]) self._parse_args(args_str) self._vnc_lib = VncApi(self._args.admin_user, self._args.admin_password, self._args.admin_tenant_name, self._args.api_server_ip, self._args.api_server_port, '/', api_server_use_ssl=self._args.api_server_use_ssl) vnc_lib = self._vnc_lib fq_name = self._args.public_vn_name.split(':') vn_obj = vnc_lib.virtual_network_read(fq_name=fq_name) self.add_floating_ip_pool(vn_obj, self._args.floating_ip_pool_name) # end __init__ def add_floating_ip_pool(self, pub_vn_obj, fip_pool_name): vnc_lib = self._vnc_lib fip_pool_obj = FloatingIpPool(fip_pool_name, pub_vn_obj) self._vnc_lib.floating_ip_pool_create(fip_pool_obj) # end add_route_target def _parse_args(self, args_str): ''' Eg. python create_floating_pool.py --public_vn_name dom:proj:pub-vn --floating_ip_pool_name fip_pool --api_server_ip 127.0.0.1 --api_server_port 8082 --api_server_use_ssl False ''' # Source any specified config/ini file # Turn off help, so we print all options in response to -h conf_parser = argparse.ArgumentParser(add_help=False) conf_parser.add_argument("-c", "--conf_file", help="Specify config file", metavar="FILE") args, remaining_argv = conf_parser.parse_known_args(args_str.split()) defaults = { 'public_vn_name': 'default-domain:' 'default-project:default-virtual-network', 'floating_ip_pool_name': 'fip_pool', 'api_server_ip': '127.0.0.1', 'api_server_port': '8082', } ksopts = { 'admin_user': 'user1', 'admin_password': 'password1', 'admin_tenant_name': 'default-domain' } if args.conf_file: config = ConfigParser.SafeConfigParser() config.read([args.conf_file]) defaults.update(dict(config.items("DEFAULTS"))) if 'KEYSTONE' in config.sections(): ksopts.update(dict(config.items("KEYSTONE"))) # Override with CLI options # Don't surpress add_help here so it will handle -h parser = argparse.ArgumentParser( # Inherit options from config_parser parents=[conf_parser], # print script description with -h/--help description=__doc__, # Don't mess with format of description formatter_class=argparse.RawDescriptionHelpFormatter, ) defaults.update(ksopts) parser.set_defaults(**defaults) parser.add_argument( "--public_vn_name", help="Colon separated fully qualified name", required=True) parser.add_argument( "--floating_ip_pool_name", help="Name of the floating IP pool", required=True) parser.add_argument( "--api_server_ip", help="IP address of api server", required=True) parser.add_argument("--api_server_port", help="Port of api server", required=True) parser.add_argument("--api_server_use_ssl", help="Use SSL to connect with API server") parser.add_argument( "--admin_user", help="Name of keystone admin user", required=True) parser.add_argument( "--admin_password", help="Password of keystone admin user", required=True) parser.add_argument( "--admin_tenant_name", help="Tenamt name for keystone admin user", required=True) self._args = parser.parse_args(remaining_argv) # end _parse_args # end class VncProvisioner def main(args_str=None): VncProvisioner(args_str) # end main if __name__ == "__main__": main()
apache-2.0
tntnatbry/tensorflow
tensorflow/contrib/graph_editor/util.py
16
16834
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Utility functions for the graph_editor. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import re from six import iteritems from tensorflow.python.framework import ops as tf_ops from tensorflow.python.ops import array_ops as tf_array_ops __all__ = [ "make_list_of_op", "get_tensors", "make_list_of_t", "get_generating_ops", "get_consuming_ops", "ControlOutputs", "placeholder_name", "make_placeholder_from_tensor", "make_placeholder_from_dtype_and_shape", ] def concatenate_unique(la, lb): """Add all the elements of lb in la if they are not there already.""" for l in lb: if l not in la: la.append(l) return la # TODO(fkp): very generic code, it should be moved in a more generic place. class ListView(object): """Immutable list wrapper. This class is strongly inspired by the one in tf.Operation. """ def __init__(self, list_): if not isinstance(list_, list): raise TypeError("Expected a list, got: {}.".format(type(list_))) self._list = list_ def __iter__(self): return iter(self._list) def __len__(self): return len(self._list) def __bool__(self): return bool(self._list) # Python 3 wants __bool__, Python 2.7 wants __nonzero__ __nonzero__ = __bool__ def __getitem__(self, i): return self._list[i] def __add__(self, other): if not isinstance(other, list): other = list(other) return list(self) + other # TODO(fkp): very generic code, it should be moved in a more generic place. def is_iterable(obj): """Return true if the object is iterable.""" try: _ = iter(obj) except Exception: # pylint: disable=broad-except return False return True def flatten_tree(tree, leaves=None): """Flatten a tree into a list. Args: tree: iterable or not. If iterable, its elements (child) can also be iterable or not. leaves: list to which the tree leaves are appended (None by default). Returns: A list of all the leaves in the tree. """ if leaves is None: leaves = [] if isinstance(tree, dict): for _, child in iteritems(tree): flatten_tree(child, leaves) elif is_iterable(tree): for child in tree: flatten_tree(child, leaves) else: leaves.append(tree) return leaves def transform_tree(tree, fn, iterable_type=tuple): """Transform all the nodes of a tree. Args: tree: iterable or not. If iterable, its elements (child) can also be iterable or not. fn: function to apply to each leaves. iterable_type: type use to construct the resulting tree for unknwon iterable, typically `list` or `tuple`. Returns: A tree whose leaves has been transformed by `fn`. The hierarchy of the output tree mimics the one of the input tree. """ if is_iterable(tree): if isinstance(tree, dict): res = tree.__new__(type(tree)) res.__init__( (k, transform_tree(child, fn)) for k, child in iteritems(tree)) return res elif isinstance(tree, tuple): # NamedTuple? if hasattr(tree, "_asdict"): res = tree.__new__(type(tree), **transform_tree(tree._asdict(), fn)) else: res = tree.__new__(type(tree), (transform_tree(child, fn) for child in tree)) return res elif isinstance(tree, collections.Sequence): res = tree.__new__(type(tree)) res.__init__(transform_tree(child, fn) for child in tree) return res else: return iterable_type(transform_tree(child, fn) for child in tree) else: return fn(tree) def check_graphs(*args): """Check that all the element in args belong to the same graph. Args: *args: a list of object with a obj.graph property. Raises: ValueError: if all the elements do not belong to the same graph. """ graph = None for i, sgv in enumerate(args): if graph is None and sgv.graph is not None: graph = sgv.graph elif sgv.graph is not None and sgv.graph is not graph: raise ValueError("Argument[{}]: Wrong graph!".format(i)) def get_unique_graph(tops, check_types=None, none_if_empty=False): """Return the unique graph used by the all the elements in tops. Args: tops: list of elements to check (usually a list of tf.Operation and/or tf.Tensor). Or a tf.Graph. check_types: check that the element in tops are of given type(s). If None, the types (tf.Operation, tf.Tensor) are used. none_if_empty: don't raise an error if tops is an empty list, just return None. Returns: The unique graph used by all the tops. Raises: TypeError: if tops is not a iterable of tf.Operation. ValueError: if the graph is not unique. """ if isinstance(tops, tf_ops.Graph): return tops if not is_iterable(tops): raise TypeError("{} is not iterable".format(type(tops))) if check_types is None: check_types = (tf_ops.Operation, tf_ops.Tensor) elif not is_iterable(check_types): check_types = (check_types,) g = None for op in tops: if not isinstance(op, check_types): raise TypeError("Expected a type in ({}), got: {}".format(", ".join([str( t) for t in check_types]), type(op))) if g is None: g = op.graph elif g is not op.graph: raise ValueError("Operation {} does not belong to given graph".format(op)) if g is None and not none_if_empty: raise ValueError("Can't find the unique graph of an empty list") return g def make_list_of_op(ops, check_graph=True, allow_graph=True, ignore_ts=False): """Convert ops to a list of `tf.Operation`. Args: ops: can be an iterable of `tf.Operation`, a `tf.Graph` or a single operation. check_graph: if `True` check if all the operations belong to the same graph. allow_graph: if `False` a `tf.Graph` cannot be converted. ignore_ts: if True, silently ignore `tf.Tensor`. Returns: A newly created list of `tf.Operation`. Raises: TypeError: if ops cannot be converted to a list of `tf.Operation` or, if `check_graph` is `True`, if all the ops do not belong to the same graph. """ if isinstance(ops, tf_ops.Graph): if allow_graph: return ops.get_operations() else: raise TypeError("allow_graph is False: cannot convert a tf.Graph.") else: if not is_iterable(ops): ops = [ops] if not ops: return [] if check_graph: check_types = None if ignore_ts else tf_ops.Operation get_unique_graph(ops, check_types=check_types) return [op for op in ops if isinstance(op, tf_ops.Operation)] # TODO(fkp): move this function in tf.Graph? def get_tensors(graph): """get all the tensors which are input or output of an op in the graph. Args: graph: a `tf.Graph`. Returns: A list of `tf.Tensor`. Raises: TypeError: if graph is not a `tf.Graph`. """ if not isinstance(graph, tf_ops.Graph): raise TypeError("Expected a graph, got: {}".format(type(graph))) ts = [] for op in graph.get_operations(): ts += op.outputs return ts def make_list_of_t(ts, check_graph=True, allow_graph=True, ignore_ops=False): """Convert ts to a list of `tf.Tensor`. Args: ts: can be an iterable of `tf.Tensor`, a `tf.Graph` or a single tensor. check_graph: if `True` check if all the tensors belong to the same graph. allow_graph: if `False` a `tf.Graph` cannot be converted. ignore_ops: if `True`, silently ignore `tf.Operation`. Returns: A newly created list of `tf.Tensor`. Raises: TypeError: if `ts` cannot be converted to a list of `tf.Tensor` or, if `check_graph` is `True`, if all the ops do not belong to the same graph. """ if isinstance(ts, tf_ops.Graph): if allow_graph: return get_tensors(ts) else: raise TypeError("allow_graph is False: cannot convert a tf.Graph.") else: if not is_iterable(ts): ts = [ts] if not ts: return [] if check_graph: check_types = None if ignore_ops else tf_ops.Tensor get_unique_graph(ts, check_types=check_types) return [t for t in ts if isinstance(t, tf_ops.Tensor)] def get_generating_ops(ts): """Return all the generating ops of the tensors in `ts`. Args: ts: a list of `tf.Tensor` Returns: A list of all the generating `tf.Operation` of the tensors in `ts`. Raises: TypeError: if `ts` cannot be converted to a list of `tf.Tensor`. """ ts = make_list_of_t(ts, allow_graph=False) return [t.op for t in ts] def get_consuming_ops(ts): """Return all the consuming ops of the tensors in ts. Args: ts: a list of `tf.Tensor` Returns: A list of all the consuming `tf.Operation` of the tensors in `ts`. Raises: TypeError: if ts cannot be converted to a list of `tf.Tensor`. """ ts = make_list_of_t(ts, allow_graph=False) ops = [] for t in ts: for op in t.consumers(): if op not in ops: ops.append(op) return ops class ControlOutputs(object): """The control outputs topology.""" def __init__(self, graph): """Create a dictionary of control-output dependencies. Args: graph: a `tf.Graph`. Returns: A dictionary where a key is a `tf.Operation` instance and the corresponding value is a list of all the ops which have the key as one of their control-input dependencies. Raises: TypeError: graph is not a `tf.Graph`. """ if not isinstance(graph, tf_ops.Graph): raise TypeError("Expected a tf.Graph, got: {}".format(type(graph))) self._control_outputs = {} self._graph = graph self._version = None self._build() def update(self): """Update the control outputs if the graph has changed.""" if self._version != self._graph.version: self._build() return self def _build(self): """Build the control outputs dictionary.""" self._control_outputs.clear() ops = self._graph.get_operations() for op in ops: for control_input in op.control_inputs: if control_input not in self._control_outputs: self._control_outputs[control_input] = [] if op not in self._control_outputs[control_input]: self._control_outputs[control_input].append(op) self._version = self._graph.version def get_all(self): return self._control_outputs def get(self, op): """return the control outputs of op.""" if op in self._control_outputs: return self._control_outputs[op] else: return () @property def graph(self): return self._graph def scope_finalize(scope): if scope and scope[-1] != "/": scope += "/" return scope def scope_dirname(scope): slash = scope.rfind("/") if slash == -1: return "" return scope[:slash + 1] def scope_basename(scope): slash = scope.rfind("/") if slash == -1: return scope return scope[slash + 1:] def placeholder_name(t=None, scope=None): """Create placeholder name for the graph editor. Args: t: optional tensor on which the placeholder operation's name will be based on scope: absolute scope with which to prefix the placeholder's name. None means that the scope of t is preserved. "" means the root scope. Returns: A new placeholder name prefixed by "geph". Note that "geph" stands for Graph Editor PlaceHolder. This convention allows to quickly identify the placeholder generated by the Graph Editor. Raises: TypeError: if t is not None or a tf.Tensor. """ if scope is not None: scope = scope_finalize(scope) if t is not None: if not isinstance(t, tf_ops.Tensor): raise TypeError("Expected a tf.Tenfor, got: {}".format(type(t))) op_dirname = scope_dirname(t.op.name) op_basename = scope_basename(t.op.name) if scope is None: scope = op_dirname if op_basename.startswith("geph__"): ph_name = op_basename else: ph_name = "geph__{}_{}".format(op_basename, t.value_index) return scope + ph_name else: if scope is None: scope = "" return scope + "geph" def make_placeholder_from_tensor(t, scope=None): """Create a `tf.placeholder` for the Graph Editor. Note that the correct graph scope must be set by the calling function. Args: t: a `tf.Tensor` whose name will be used to create the placeholder (see function placeholder_name). scope: absolute scope within which to create the placeholder. None means that the scope of `t` is preserved. `""` means the root scope. Returns: A newly created `tf.placeholder`. Raises: TypeError: if `t` is not `None` or a `tf.Tensor`. """ return tf_array_ops.placeholder( dtype=t.dtype, shape=t.get_shape(), name=placeholder_name( t, scope=scope)) def make_placeholder_from_dtype_and_shape(dtype, shape=None, scope=None): """Create a tf.placeholder for the Graph Editor. Note that the correct graph scope must be set by the calling function. The placeholder is named using the function placeholder_name (with no tensor argument). Args: dtype: the tensor type. shape: the tensor shape (optional). scope: absolute scope within which to create the placeholder. None means that the scope of t is preserved. "" means the root scope. Returns: A newly created tf.placeholder. """ return tf_array_ops.placeholder( dtype=dtype, shape=shape, name=placeholder_name(scope=scope)) _INTERNAL_VARIABLE_RE = re.compile(r"^__\w+__$") def get_predefined_collection_names(): """Return all the predefined collection names.""" return [getattr(tf_ops.GraphKeys, key) for key in dir(tf_ops.GraphKeys) if not _INTERNAL_VARIABLE_RE.match(key)] def find_corresponding_elem(target, dst_graph, dst_scope="", src_scope=""): """Find corresponding op/tensor in a different graph. Args: target: A `tf.Tensor` or a `tf.Operation` belonging to the original graph. dst_graph: The graph in which the corresponding graph element must be found. dst_scope: A scope which is prepended to the name to look for. src_scope: A scope which is removed from the original of `target` name. Returns: The corresponding tf.Tensor` or a `tf.Operation`. Raises: ValueError: if `src_name` does not start with `src_scope`. TypeError: if `target` is not a `tf.Tensor` or a `tf.Operation` KeyError: If the corresponding graph element cannot be found. """ src_name = target.name if src_scope: src_scope = scope_finalize(src_scope) if not src_name.startswidth(src_scope): raise ValueError("{} does not start with {}".format(src_name, src_scope)) src_name = src_name[len(src_scope):] dst_name = src_name if dst_scope: dst_scope = scope_finalize(dst_scope) dst_name = dst_scope + dst_name if isinstance(target, tf_ops.Tensor): return dst_graph.get_tensor_by_name(dst_name) if isinstance(target, tf_ops.Operation): return dst_graph.get_operation_by_name(dst_name) raise TypeError("Expected tf.Tensor or tf.Operation, got: {}", type(target)) def find_corresponding(targets, dst_graph, dst_scope="", src_scope=""): """Find corresponding ops/tensors in a different graph. `targets` is a Python tree, that is, a nested structure of iterable (list, tupple, dictionary) whose leaves are instances of `tf.Tensor` or `tf.Operation` Args: targets: A Python tree containing `tf.Tensor` or `tf.Operation` belonging to the original graph. dst_graph: The graph in which the corresponding graph element must be found. dst_scope: A scope which is prepended to the name to look for. src_scope: A scope which is removed from the original of `top` name. Returns: A Python tree containin the corresponding tf.Tensor` or a `tf.Operation`. Raises: ValueError: if `src_name` does not start with `src_scope`. TypeError: if `top` is not a `tf.Tensor` or a `tf.Operation` KeyError: If the corresponding graph element cannot be found. """ def func(top): return find_corresponding_elem(top, dst_graph, dst_scope, src_scope) return transform_tree(targets, func)
apache-2.0
Jorge-Rodriguez/ansible
test/units/mock/yaml_helper.py
209
5267
import io import yaml from ansible.module_utils.six import PY3 from ansible.parsing.yaml.loader import AnsibleLoader from ansible.parsing.yaml.dumper import AnsibleDumper class YamlTestUtils(object): """Mixin class to combine with a unittest.TestCase subclass.""" def _loader(self, stream): """Vault related tests will want to override this. Vault cases should setup a AnsibleLoader that has the vault password.""" return AnsibleLoader(stream) def _dump_stream(self, obj, stream, dumper=None): """Dump to a py2-unicode or py3-string stream.""" if PY3: return yaml.dump(obj, stream, Dumper=dumper) else: return yaml.dump(obj, stream, Dumper=dumper, encoding=None) def _dump_string(self, obj, dumper=None): """Dump to a py2-unicode or py3-string""" if PY3: return yaml.dump(obj, Dumper=dumper) else: return yaml.dump(obj, Dumper=dumper, encoding=None) def _dump_load_cycle(self, obj): # Each pass though a dump or load revs the 'generation' # obj to yaml string string_from_object_dump = self._dump_string(obj, dumper=AnsibleDumper) # wrap a stream/file like StringIO around that yaml stream_from_object_dump = io.StringIO(string_from_object_dump) loader = self._loader(stream_from_object_dump) # load the yaml stream to create a new instance of the object (gen 2) obj_2 = loader.get_data() # dump the gen 2 objects directory to strings string_from_object_dump_2 = self._dump_string(obj_2, dumper=AnsibleDumper) # The gen 1 and gen 2 yaml strings self.assertEquals(string_from_object_dump, string_from_object_dump_2) # the gen 1 (orig) and gen 2 py object self.assertEquals(obj, obj_2) # again! gen 3... load strings into py objects stream_3 = io.StringIO(string_from_object_dump_2) loader_3 = self._loader(stream_3) obj_3 = loader_3.get_data() string_from_object_dump_3 = self._dump_string(obj_3, dumper=AnsibleDumper) self.assertEquals(obj, obj_3) # should be transitive, but... self.assertEquals(obj_2, obj_3) self.assertEquals(string_from_object_dump, string_from_object_dump_3) def _old_dump_load_cycle(self, obj): '''Dump the passed in object to yaml, load it back up, dump again, compare.''' stream = io.StringIO() yaml_string = self._dump_string(obj, dumper=AnsibleDumper) self._dump_stream(obj, stream, dumper=AnsibleDumper) yaml_string_from_stream = stream.getvalue() # reset stream stream.seek(0) loader = self._loader(stream) # loader = AnsibleLoader(stream, vault_password=self.vault_password) obj_from_stream = loader.get_data() stream_from_string = io.StringIO(yaml_string) loader2 = self._loader(stream_from_string) # loader2 = AnsibleLoader(stream_from_string, vault_password=self.vault_password) obj_from_string = loader2.get_data() stream_obj_from_stream = io.StringIO() stream_obj_from_string = io.StringIO() if PY3: yaml.dump(obj_from_stream, stream_obj_from_stream, Dumper=AnsibleDumper) yaml.dump(obj_from_stream, stream_obj_from_string, Dumper=AnsibleDumper) else: yaml.dump(obj_from_stream, stream_obj_from_stream, Dumper=AnsibleDumper, encoding=None) yaml.dump(obj_from_stream, stream_obj_from_string, Dumper=AnsibleDumper, encoding=None) yaml_string_stream_obj_from_stream = stream_obj_from_stream.getvalue() yaml_string_stream_obj_from_string = stream_obj_from_string.getvalue() stream_obj_from_stream.seek(0) stream_obj_from_string.seek(0) if PY3: yaml_string_obj_from_stream = yaml.dump(obj_from_stream, Dumper=AnsibleDumper) yaml_string_obj_from_string = yaml.dump(obj_from_string, Dumper=AnsibleDumper) else: yaml_string_obj_from_stream = yaml.dump(obj_from_stream, Dumper=AnsibleDumper, encoding=None) yaml_string_obj_from_string = yaml.dump(obj_from_string, Dumper=AnsibleDumper, encoding=None) assert yaml_string == yaml_string_obj_from_stream assert yaml_string == yaml_string_obj_from_stream == yaml_string_obj_from_string assert (yaml_string == yaml_string_obj_from_stream == yaml_string_obj_from_string == yaml_string_stream_obj_from_stream == yaml_string_stream_obj_from_string) assert obj == obj_from_stream assert obj == obj_from_string assert obj == yaml_string_obj_from_stream assert obj == yaml_string_obj_from_string assert obj == obj_from_stream == obj_from_string == yaml_string_obj_from_stream == yaml_string_obj_from_string return {'obj': obj, 'yaml_string': yaml_string, 'yaml_string_from_stream': yaml_string_from_stream, 'obj_from_stream': obj_from_stream, 'obj_from_string': obj_from_string, 'yaml_string_obj_from_string': yaml_string_obj_from_string}
gpl-3.0
xbmc/atv2
xbmc/lib/libPython/Python/Lib/test/test_netrc.py
99
1116
import netrc, os, unittest, sys from test import test_support TEST_NETRC = """ machine foo login log1 password pass1 account acct1 macdef macro1 line1 line2 macdef macro2 line3 line4 default login log2 password pass2 """ temp_filename = test_support.TESTFN class NetrcTestCase(unittest.TestCase): def setUp (self): mode = 'w' if sys.platform not in ['cygwin']: mode += 't' fp = open(temp_filename, mode) fp.write(TEST_NETRC) fp.close() self.netrc = netrc.netrc(temp_filename) def tearDown (self): del self.netrc os.unlink(temp_filename) def test_case_1(self): self.assert_(self.netrc.macros == {'macro1':['line1\n', 'line2\n'], 'macro2':['line3\n', 'line4\n']} ) self.assert_(self.netrc.hosts['foo'] == ('log1', 'acct1', 'pass1')) self.assert_(self.netrc.hosts['default'] == ('log2', None, 'pass2')) def test_main(): test_support.run_unittest(NetrcTestCase) if __name__ == "__main__": test_main()
gpl-2.0
ai-ku/langvis
dependencies/jython-2.1/Lib/test/test_jbasic.py
2
3030
from test_support import * print_test('Basic Java Integration (test_jbasic.py)', 1) print_test('type conversions', 2) print_test('numbers', 3) from java.lang.Math import abs assert abs(-2.) == 2., 'Python float to Java double' assert abs(-2) == 2l, 'Python int to Java long' assert abs(-2l) == 2l, 'Python long to Java long' try: abs(-123456789123456789123l) except TypeError: pass print_test('strings', 3) from java.lang import Integer, String assert Integer.valueOf('42') == 42, 'Python string to Java string' print_test('arrays', 3) chars = ['a', 'b', 'c'] assert String.valueOf(chars) == 'abc', 'char array' print_test('Enumerations', 3) from java.util import Vector vec = Vector() items = range(10) for i in items: vec.addElement(i) expected = 0 for i in vec.elements(): assert i == expected, 'testing enumeration on java.util.Vector' expected = expected+1 print_test('create java objects', 2) from java.math import BigInteger assert BigInteger('1234', 10).intValue() == 1234, 'BigInteger(string)' assert BigInteger([0x11, 0x11, 0x11]).intValue() == 0x111111, 'BigInteger(byte[])' assert BigInteger(-1, [0x11, 0x11, 0x11]).intValue() == -0x111111, 'BigInteger(int, byte[])' print_test('call static methods') s1 = String.valueOf(['1', '2', '3']) s2 = String.valueOf('123') s3 = String.valueOf(123) s4 = String.valueOf(123l) s5 = String.valueOf(['0', '1', '2', '3', 'a', 'b'], 1, 3) assert s1 == s2 == s3 == s4 == s5, 'String.valueOf method with different arguments' print_test('call instance methods') s = String('hello') assert s.regionMatches(1, 1, 'ell', 0, 3), 'method call with boolean true' assert s.regionMatches(0, 1, 'ell', 0, 3), 'method call with boolean false' assert s.regionMatches(1, 'ell', 0, 3), 'method call no boolean' assert s.regionMatches(1, 1, 'eLl', 0, 3), 'method call ignore case' assert not s.regionMatches(1, 'eLl', 0, 3), 'should ignore case' from java import awt print_test('get/set fields') d = awt.Dimension(3,9) assert d.width == 3 and d.height == 9, 'getting fields' d.width = 42 assert d.width == 42 and d.height == 9, 'setting fields' #Make sure non-existent fields fail try: print d.foo except AttributeError: pass else: raise AssertionError, 'd.foo should throw type error' print_test('get/set bean properties') b1 = awt.Button() b1.label = 'foo' b2 = awt.Button(label='foo') assert b1.label == b2.label == 'foo', 'Button label bean property' print_test('bean event properties') # Test bean event properties - single and multiple flag = 0 def testAction(event): global flag flag = flag + 1 doit = awt.event.ActionEvent(b1, awt.event.ActionEvent.ACTION_PERFORMED, "") b1.actionPerformed = testAction flag = 0 b1.dispatchEvent(doit) assert flag == 1, 'one action per event' b1.actionPerformed.append(testAction) flag = 0 b1.dispatchEvent(doit) assert flag == 2, 'two actions per event' b1.actionPerformed = testAction flag = 0 b1.dispatchEvent(doit) assert flag == 1, 'one actions per event - again' # TBD: JPython does not properly exit after this code!
mit
zhanghenry/stocks
django/conf/locale/zh_CN/formats.py
634
1810
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' # 2016年9月5日 TIME_FORMAT = 'H:i' # 20:45 DATETIME_FORMAT = 'Y年n月j日 H:i' # 2016年9月5日 20:45 YEAR_MONTH_FORMAT = 'Y年n月' # 2016年9月 MONTH_DAY_FORMAT = 'm月j日' # 9月5日 SHORT_DATE_FORMAT = 'Y年n月j日' # 2016年9月5日 SHORT_DATETIME_FORMAT = 'Y年n月j日 H:i' # 2016年9月5日 20:45 FIRST_DAY_OF_WEEK = 1 # 星期一 (Monday) # The *_INPUT_FORMATS strings use the Python strftime format syntax, # see http://docs.python.org/library/datetime.html#strftime-strptime-behavior DATE_INPUT_FORMATS = ( '%Y/%m/%d', # '2016/09/05' '%Y-%m-%d', # '2016-09-05' '%Y年%n月%j日', # '2016年9月5日' ) TIME_INPUT_FORMATS = ( '%H:%M', # '20:45' '%H:%M:%S', # '20:45:29' '%H:%M:%S.%f', # '20:45:29.000200' ) DATETIME_INPUT_FORMATS = ( '%Y/%m/%d %H:%M', # '2016/09/05 20:45' '%Y-%m-%d %H:%M', # '2016-09-05 20:45' '%Y年%n月%j日 %H:%M', # '2016年9月5日 14:45' '%Y/%m/%d %H:%M:%S', # '2016/09/05 20:45:29' '%Y-%m-%d %H:%M:%S', # '2016-09-05 20:45:29' '%Y年%n月%j日 %H:%M:%S', # '2016年9月5日 20:45:29' '%Y/%m/%d %H:%M:%S.%f', # '2016/09/05 20:45:29.000200' '%Y-%m-%d %H:%M:%S.%f', # '2016-09-05 20:45:29.000200' '%Y年%n月%j日 %H:%n:%S.%f', # '2016年9月5日 20:45:29.000200' ) DECIMAL_SEPARATOR = '.' THOUSAND_SEPARATOR = '' NUMBER_GROUPING = 4
bsd-3-clause
reyoung/Paddle
python/paddle/trainer_config_helpers/layer_math.py
8
4029
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from .layers import LayerOutput, mixed_layer, identity_projection, \ slope_intercept_layer, scaling_layer, repeat_layer from .attrs import is_compatible_with from .default_decorators import * import activations as act from paddle.trainer.config_parser import logger __all__ = [] def register_unary_math_op(op_name, act): def op(input, name=None): return mixed_layer( input=[identity_projection(input=input)], name=name, act=act) op = wrap_name_default(op_name)(op) op.__doc__ = type(act).__doc__ globals()[op_name] = op __all__.append(op_name) register_unary_math_op('exp', act.ExpActivation()) register_unary_math_op('log', act.LogActivation()) register_unary_math_op('abs', act.AbsActivation()) register_unary_math_op('sigmoid', act.SigmoidActivation()) register_unary_math_op('tanh', act.TanhActivation()) register_unary_math_op('square', act.SquareActivation()) register_unary_math_op('relu', act.ReluActivation()) register_unary_math_op('sqrt', act.SqrtActivation()) register_unary_math_op('reciprocal', act.ReciprocalActivation()) def add(layeroutput, other): if is_compatible_with(other, float): return slope_intercept_layer(input=layeroutput, intercept=other) if not isinstance(other, LayerOutput): logger.fatal("LayerOutput can only be added with" " another LayerOutput or a number") if layeroutput.size == other.size: return mixed_layer(input=[ identity_projection(input=layeroutput), identity_projection(input=other) ]) if other.size != 1 and layeroutput.size != 1: logger.fatal("Two LayerOutput can be added only if they have equal size" " or one of their sizes is 1. sizes are %s and %s" % (layeroutput.size, other.size)) elif layeroutput.size == 1: tmp = layeroutput layeroutput = other other = tmp other = repeat_layer(other, layeroutput.size) return mixed_layer(input=[ identity_projection(input=layeroutput), identity_projection(input=other) ]) LayerOutput.__radd__ = add LayerOutput.__add__ = add def sub(layeroutput, other): if is_compatible_with(other, float): return slope_intercept_layer(input=layeroutput, intercept=-other) if not isinstance(other, LayerOutput): logger.fatal("LayerOutput can only be subtracted with" " another Layeroutput or a number") neg = slope_intercept_layer(input=other, slope=-1.0) return add(layeroutput, neg) LayerOutput.__sub__ = sub def rsub(layeroutput, other): neg = slope_intercept_layer(input=layeroutput, slope=-1.0) return add(neg, other) LayerOutput.__rsub__ = rsub def mul(layeroutput, other): if is_compatible_with(other, float): return slope_intercept_layer(input=layeroutput, slope=other) if not isinstance(other, LayerOutput): logger.fatal("LayerOutput can only be multiplied with" " another Layeroutput or a number") elif layeroutput.size == 1: return scaling_layer(input=other, weight=layeroutput) elif other.size == 1: return scaling_layer(input=layeroutput, weight=other) else: logger.fatal("At least one of the operand of '*' must be a number" " or a LayerOutput with size=1") LayerOutput.__mul__ = mul LayerOutput.__rmul__ = mul
apache-2.0
cainmatt/django
django/test/html.py
220
7928
""" Comparing two html documents. """ from __future__ import unicode_literals import re from django.utils import six from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html_parser import HTMLParseError, HTMLParser WHITESPACE = re.compile('\s+') def normalize_whitespace(string): return WHITESPACE.sub(' ', string) @python_2_unicode_compatible class Element(object): def __init__(self, name, attributes): self.name = name self.attributes = sorted(attributes) self.children = [] def append(self, element): if isinstance(element, six.string_types): element = force_text(element) element = normalize_whitespace(element) if self.children: if isinstance(self.children[-1], six.string_types): self.children[-1] += element self.children[-1] = normalize_whitespace(self.children[-1]) return elif self.children: # removing last children if it is only whitespace # this can result in incorrect dom representations since # whitespace between inline tags like <span> is significant if isinstance(self.children[-1], six.string_types): if self.children[-1].isspace(): self.children.pop() if element: self.children.append(element) def finalize(self): def rstrip_last_element(children): if children: if isinstance(children[-1], six.string_types): children[-1] = children[-1].rstrip() if not children[-1]: children.pop() children = rstrip_last_element(children) return children rstrip_last_element(self.children) for i, child in enumerate(self.children): if isinstance(child, six.string_types): self.children[i] = child.strip() elif hasattr(child, 'finalize'): child.finalize() def __eq__(self, element): if not hasattr(element, 'name'): return False if hasattr(element, 'name') and self.name != element.name: return False if len(self.attributes) != len(element.attributes): return False if self.attributes != element.attributes: # attributes without a value is same as attribute with value that # equals the attributes name: # <input checked> == <input checked="checked"> for i in range(len(self.attributes)): attr, value = self.attributes[i] other_attr, other_value = element.attributes[i] if value is None: value = attr if other_value is None: other_value = other_attr if attr != other_attr or value != other_value: return False if self.children != element.children: return False return True def __hash__(self): return hash((self.name,) + tuple(a for a in self.attributes)) def __ne__(self, element): return not self.__eq__(element) def _count(self, element, count=True): if not isinstance(element, six.string_types): if self == element: return 1 i = 0 for child in self.children: # child is text content and element is also text content, then # make a simple "text" in "text" if isinstance(child, six.string_types): if isinstance(element, six.string_types): if count: i += child.count(element) elif element in child: return 1 else: i += child._count(element, count=count) if not count and i: return i return i def __contains__(self, element): return self._count(element, count=False) > 0 def count(self, element): return self._count(element, count=True) def __getitem__(self, key): return self.children[key] def __str__(self): output = '<%s' % self.name for key, value in self.attributes: if value: output += ' %s="%s"' % (key, value) else: output += ' %s' % key if self.children: output += '>\n' output += ''.join(six.text_type(c) for c in self.children) output += '\n</%s>' % self.name else: output += ' />' return output def __repr__(self): return six.text_type(self) @python_2_unicode_compatible class RootElement(Element): def __init__(self): super(RootElement, self).__init__(None, ()) def __str__(self): return ''.join(six.text_type(c) for c in self.children) class Parser(HTMLParser): SELF_CLOSING_TAGS = ('br', 'hr', 'input', 'img', 'meta', 'spacer', 'link', 'frame', 'base', 'col') def __init__(self): HTMLParser.__init__(self) self.root = RootElement() self.open_tags = [] self.element_positions = {} def error(self, msg): raise HTMLParseError(msg, self.getpos()) def format_position(self, position=None, element=None): if not position and element: position = self.element_positions[element] if position is None: position = self.getpos() if hasattr(position, 'lineno'): position = position.lineno, position.offset return 'Line %d, Column %d' % position @property def current(self): if self.open_tags: return self.open_tags[-1] else: return self.root def handle_startendtag(self, tag, attrs): self.handle_starttag(tag, attrs) if tag not in self.SELF_CLOSING_TAGS: self.handle_endtag(tag) def handle_starttag(self, tag, attrs): # Special case handling of 'class' attribute, so that comparisons of DOM # instances are not sensitive to ordering of classes. attrs = [ (name, " ".join(sorted(value.split(" ")))) if name == "class" else (name, value) for name, value in attrs ] element = Element(tag, attrs) self.current.append(element) if tag not in self.SELF_CLOSING_TAGS: self.open_tags.append(element) self.element_positions[element] = self.getpos() def handle_endtag(self, tag): if not self.open_tags: self.error("Unexpected end tag `%s` (%s)" % ( tag, self.format_position())) element = self.open_tags.pop() while element.name != tag: if not self.open_tags: self.error("Unexpected end tag `%s` (%s)" % ( tag, self.format_position())) element = self.open_tags.pop() def handle_data(self, data): self.current.append(data) def handle_charref(self, name): self.current.append('&%s;' % name) def handle_entityref(self, name): self.current.append('&%s;' % name) def parse_html(html): """ Takes a string that contains *valid* HTML and turns it into a Python object structure that can be easily compared against other HTML on semantic equivalence. Syntactical differences like which quotation is used on arguments will be ignored. """ parser = Parser() parser.feed(html) parser.close() document = parser.root document.finalize() # Removing ROOT element if it's not necessary if len(document.children) == 1: if not isinstance(document.children[0], six.string_types): document = document.children[0] return document
bsd-3-clause
ImmobilienScout24/moto
moto/rds2/responses.py
10
19789
from __future__ import unicode_literals from moto.core.responses import BaseResponse from moto.ec2.models import ec2_backends from .models import rds2_backends import json import re class RDS2Response(BaseResponse): @property def backend(self): return rds2_backends[self.region] def _get_db_kwargs(self): args = { "auto_minor_version_upgrade": self._get_param('AutoMinorVersionUpgrade'), "allocated_storage": self._get_int_param('AllocatedStorage'), "availability_zone": self._get_param("AvailabilityZone"), "backup_retention_period": self._get_param("BackupRetentionPeriod"), "db_instance_class": self._get_param('DBInstanceClass'), "db_instance_identifier": self._get_param('DBInstanceIdentifier'), "db_name": self._get_param("DBName"), # DBParameterGroupName "db_subnet_group_name": self._get_param("DBSubnetGroupName"), "engine": self._get_param("Engine"), "engine_version": self._get_param("EngineVersion"), "iops": self._get_int_param("Iops"), "master_password": self._get_param('MasterUserPassword'), "master_username": self._get_param('MasterUsername'), "multi_az": self._get_bool_param("MultiAZ"), # OptionGroupName "port": self._get_param('Port'), # PreferredBackupWindow # PreferredMaintenanceWindow "publicly_accessible": self._get_param("PubliclyAccessible"), "region": self.region, "security_groups": self._get_multi_param('DBSecurityGroups.member'), "storage_type": self._get_param("StorageType"), # VpcSecurityGroupIds.member.N "tags": list() } args['tags'] = self.unpack_complex_list_params('Tags.member', ('Key', 'Value')) return args def _get_db_replica_kwargs(self): return { "auto_minor_version_upgrade": self._get_param('AutoMinorVersionUpgrade'), "availability_zone": self._get_param("AvailabilityZone"), "db_instance_class": self._get_param('DBInstanceClass'), "db_instance_identifier": self._get_param('DBInstanceIdentifier'), "db_subnet_group_name": self._get_param("DBSubnetGroupName"), "iops": self._get_int_param("Iops"), # OptionGroupName "port": self._get_param('Port'), "publicly_accessible": self._get_param("PubliclyAccessible"), "source_db_identifier": self._get_param('SourceDBInstanceIdentifier'), "storage_type": self._get_param("StorageType"), } def _get_option_group_kwargs(self): return { 'major_engine_version': self._get_param('MajorEngineVersion'), 'description': self._get_param('OptionGroupDescription'), 'engine_name': self._get_param('EngineName'), 'name': self._get_param('OptionGroupName') } def unpack_complex_list_params(self, label, names): unpacked_list = list() count = 1 while self._get_param('{0}.{1}.{2}'.format(label, count, names[0])): param = dict() for i in range(len(names)): param[names[i]] = self._get_param('{0}.{1}.{2}'.format(label, count, names[i])) unpacked_list.append(param) count += 1 return unpacked_list def unpack_list_params(self, label): unpacked_list = list() count = 1 while self._get_param('{0}.{1}'.format(label, count)): unpacked_list.append(self._get_param('{0}.{1}'.format(label, count))) count += 1 return unpacked_list def create_dbinstance(self): return self.create_db_instance() def create_db_instance(self): db_kwargs = self._get_db_kwargs() database = self.backend.create_database(db_kwargs) template = self.response_template(CREATE_DATABASE_TEMPLATE) return template.render(database=database) def create_dbinstance_read_replica(self): return self.create_db_instance_read_replica() def create_db_instance_read_replica(self): db_kwargs = self._get_db_replica_kwargs() database = self.backend.create_database_replica(db_kwargs) template = self.response_template(CREATE_DATABASE_REPLICA_TEMPLATE) return template.render(database=database) def describe_dbinstances(self): return self.describe_db_instances() def describe_db_instances(self): db_instance_identifier = self._get_param('DBInstanceIdentifier') databases = self.backend.describe_databases(db_instance_identifier) template = self.response_template(DESCRIBE_DATABASES_TEMPLATE) return template.render(databases=databases) def modify_dbinstance(self): return self.modify_db_instance() def modify_db_instance(self): db_instance_identifier = self._get_param('DBInstanceIdentifier') db_kwargs = self._get_db_kwargs() database = self.backend.modify_database(db_instance_identifier, db_kwargs) template = self.response_template(MODIFY_DATABASE_TEMPLATE) return template.render(database=database) def delete_dbinstance(self): return self.delete_db_instance() def delete_db_instance(self): db_instance_identifier = self._get_param('DBInstanceIdentifier') database = self.backend.delete_database(db_instance_identifier) template = self.response_template(DELETE_DATABASE_TEMPLATE) return template.render(database=database) def reboot_dbinstance(self): return self.reboot_db_instance() def reboot_db_instance(self): db_instance_identifier = self._get_param('DBInstanceIdentifier') database = self.backend.reboot_db_instance(db_instance_identifier) template = self.response_template(REBOOT_DATABASE_TEMPLATE) return template.render(database=database) def list_tags_for_resource(self): arn = self._get_param('ResourceName') template = self.response_template(LIST_TAGS_FOR_RESOURCE_TEMPLATE) tags = self.backend.list_tags_for_resource(arn) return template.render(tags=tags) def add_tags_to_resource(self): arn = self._get_param('ResourceName') tags = self.unpack_complex_list_params('Tags.member', ('Key', 'Value')) tags = self.backend.add_tags_to_resource(arn, tags) template = self.response_template(ADD_TAGS_TO_RESOURCE_TEMPLATE) return template.render(tags=tags) def remove_tags_from_resource(self): arn = self._get_param('ResourceName') tag_keys = self.unpack_list_params('TagKeys.member') self.backend.remove_tags_from_resource(arn, tag_keys) template = self.response_template(REMOVE_TAGS_FROM_RESOURCE_TEMPLATE) return template.render() def create_dbsecurity_group(self): return self.create_db_security_group() def create_db_security_group(self): group_name = self._get_param('DBSecurityGroupName') description = self._get_param('DBSecurityGroupDescription') security_group = self.backend.create_security_group(group_name, description) template = self.response_template(CREATE_SECURITY_GROUP_TEMPLATE) return template.render(security_group=security_group) def describe_dbsecurity_groups(self): return self.describe_db_security_groups() def describe_db_security_groups(self): security_group_name = self._get_param('DBSecurityGroupName') security_groups = self.backend.describe_security_groups(security_group_name) template = self.response_template(DESCRIBE_SECURITY_GROUPS_TEMPLATE) return template.render(security_groups=security_groups) def delete_dbsecurity_group(self): return self.delete_db_security_group() def delete_db_security_group(self): security_group_name = self._get_param('DBSecurityGroupName') security_group = self.backend.delete_security_group(security_group_name) template = self.response_template(DELETE_SECURITY_GROUP_TEMPLATE) return template.render(security_group=security_group) def authorize_dbsecurity_group_ingress(self): return self.authorize_db_security_group_ingress() def authorize_db_security_group_ingress(self): security_group_name = self._get_param('DBSecurityGroupName') cidr_ip = self._get_param('CIDRIP') security_group = self.backend.authorize_security_group(security_group_name, cidr_ip) template = self.response_template(AUTHORIZE_SECURITY_GROUP_TEMPLATE) return template.render(security_group=security_group) def create_dbsubnet_group(self): return self.create_db_subnet_group() def create_db_subnet_group(self): subnet_name = self._get_param('DBSubnetGroupName') description = self._get_param('DBSubnetGroupDescription') subnet_ids = self._get_multi_param('SubnetIds.member') subnets = [ec2_backends[self.region].get_subnet(subnet_id) for subnet_id in subnet_ids] subnet_group = self.backend.create_subnet_group(subnet_name, description, subnets) template = self.response_template(CREATE_SUBNET_GROUP_TEMPLATE) return template.render(subnet_group=subnet_group) def describe_dbsubnet_groups(self): return self.describe_db_subnet_groups() def describe_db_subnet_groups(self): subnet_name = self._get_param('DBSubnetGroupName') subnet_groups = self.backend.describe_subnet_groups(subnet_name) template = self.response_template(DESCRIBE_SUBNET_GROUPS_TEMPLATE) return template.render(subnet_groups=subnet_groups) def delete_dbsubnet_group(self): return self.delete_db_subnet_group() def delete_db_subnet_group(self): subnet_name = self._get_param('DBSubnetGroupName') subnet_group = self.backend.delete_subnet_group(subnet_name) template = self.response_template(DELETE_SUBNET_GROUP_TEMPLATE) return template.render(subnet_group=subnet_group) def create_option_group(self): kwargs = self._get_option_group_kwargs() option_group = self.backend.create_option_group(kwargs) template = self.response_template(CREATE_OPTION_GROUP_TEMPLATE) return template.render(option_group=option_group) def delete_option_group(self): kwargs = self._get_option_group_kwargs() option_group = self.backend.delete_option_group(kwargs['name']) template = self.response_template(DELETE_OPTION_GROUP_TEMPLATE) return template.render(option_group=option_group) def describe_option_groups(self): kwargs = self._get_option_group_kwargs() kwargs['max_records'] = self._get_param('MaxRecords') kwargs['marker'] = self._get_param('Marker') option_groups = self.backend.describe_option_groups(kwargs) template = self.response_template(DESCRIBE_OPTION_GROUP_TEMPLATE) return template.render(option_groups=option_groups) def describe_option_group_options(self): engine_name = self._get_param('EngineName') major_engine_version = self._get_param('MajorEngineVersion') option_group_options = self.backend.describe_option_group_options(engine_name, major_engine_version) return option_group_options def modify_option_group(self): option_group_name = self._get_param('OptionGroupName') count = 1 options_to_include = [] while self._get_param('OptionsToInclude.member.{0}.OptionName'.format(count)): options_to_include.append({ 'Port': self._get_param('OptionsToInclude.member.{0}.Port'.format(count)), 'OptionName': self._get_param('OptionsToInclude.member.{0}.OptionName'.format(count)), 'DBSecurityGroupMemberships': self._get_param('OptionsToInclude.member.{0}.DBSecurityGroupMemberships'.format(count)), 'OptionSettings': self._get_param('OptionsToInclude.member.{0}.OptionSettings'.format(count)), 'VpcSecurityGroupMemberships': self._get_param('OptionsToInclude.member.{0}.VpcSecurityGroupMemberships'.format(count)) }) count += 1 count = 1 options_to_remove = [] while self._get_param('OptionsToRemove.member.{0}'.format(count)): options_to_remove.append(self._get_param('OptionsToRemove.member.{0}'.format(count))) count += 1 apply_immediately = self._get_param('ApplyImmediately') option_group = self.backend.modify_option_group(option_group_name, options_to_include, options_to_remove, apply_immediately) template = self.response_template(MODIFY_OPTION_GROUP_TEMPLATE) return template.render(option_group=option_group) CREATE_DATABASE_TEMPLATE = """{ "CreateDBInstanceResponse": { "CreateDBInstanceResult": { "DBInstance": {{ database.to_json() }} }, "ResponseMetadata": { "RequestId": "523e3218-afc7-11c3-90f5-f90431260ab4" } } }""" CREATE_DATABASE_REPLICA_TEMPLATE = """{"CreateDBInstanceReadReplicaResponse": { "ResponseMetadata": { "RequestId": "5e60c46d-a844-11e4-bb68-17f36418e58f" }, "CreateDBInstanceReadReplicaResult": { "DBInstance": {{ database.to_json() }} } }}""" DESCRIBE_DATABASES_TEMPLATE = """{ "DescribeDBInstancesResponse": { "DescribeDBInstancesResult": { "DBInstances": [ {%- for database in databases -%} {%- if loop.index != 1 -%},{%- endif -%} {{ database.to_json() }} {%- endfor -%} ] }, "ResponseMetadata": { "RequestId": "523e3218-afc7-11c3-90f5-f90431260ab4" } } }""" MODIFY_DATABASE_TEMPLATE = """{"ModifyDBInstanceResponse": { "ModifyDBInstanceResult": { "DBInstance": {{ database.to_json() }}, "ResponseMetadata": { "RequestId": "bb58476c-a1a8-11e4-99cf-55e92d4bbada" } } } }""" REBOOT_DATABASE_TEMPLATE = """{"RebootDBInstanceResponse": { "RebootDBInstanceResult": { "DBInstance": {{ database.to_json() }}, "ResponseMetadata": { "RequestId": "d55711cb-a1ab-11e4-99cf-55e92d4bbada" } } } }""" DELETE_DATABASE_TEMPLATE = """{ "DeleteDBInstanceResponse": { "DeleteDBInstanceResult": { "DBInstance": {{ database.to_json() }} }, "ResponseMetadata": { "RequestId": "523e3218-afc7-11c3-90f5-f90431260ab4" } } }""" CREATE_SECURITY_GROUP_TEMPLATE = """{"CreateDBSecurityGroupResponse": { "CreateDBSecurityGroupResult": { "DBSecurityGroup": {{ security_group.to_json() }}, "ResponseMetadata": { "RequestId": "462165d0-a77a-11e4-a5fa-75b30c556f97" }} } }""" DESCRIBE_SECURITY_GROUPS_TEMPLATE = """{ "DescribeDBSecurityGroupsResponse": { "ResponseMetadata": { "RequestId": "5df2014e-a779-11e4-bdb0-594def064d0c" }, "DescribeDBSecurityGroupsResult": { "Marker": "null", "DBSecurityGroups": [ {% for security_group in security_groups %} {%- if loop.index != 1 -%},{%- endif -%} {{ security_group.to_json() }} {% endfor %} ] } } }""" DELETE_SECURITY_GROUP_TEMPLATE = """{"DeleteDBSecurityGroupResponse": { "ResponseMetadata": { "RequestId": "97e846bd-a77d-11e4-ac58-91351c0f3426" } }}""" AUTHORIZE_SECURITY_GROUP_TEMPLATE = """{ "AuthorizeDBSecurityGroupIngressResponse": { "AuthorizeDBSecurityGroupIngressResult": { "DBSecurityGroup": {{ security_group.to_json() }} }, "ResponseMetadata": { "RequestId": "75d32fd5-a77e-11e4-8892-b10432f7a87d" } } }""" CREATE_SUBNET_GROUP_TEMPLATE = """{ "CreateDBSubnetGroupResponse": { "CreateDBSubnetGroupResult": { {{ subnet_group.to_json() }} }, "ResponseMetadata": { "RequestId": "3a401b3f-bb9e-11d3-f4c6-37db295f7674" } } }""" DESCRIBE_SUBNET_GROUPS_TEMPLATE = """{ "DescribeDBSubnetGroupsResponse": { "DescribeDBSubnetGroupsResult": { "DBSubnetGroups": [ {% for subnet_group in subnet_groups %} { {{ subnet_group.to_json() }} }{%- if not loop.last -%},{%- endif -%} {% endfor %} ], "Marker": null }, "ResponseMetadata": { "RequestId": "b783db3b-b98c-11d3-fbc7-5c0aad74da7c" } } }""" DELETE_SUBNET_GROUP_TEMPLATE = """{"DeleteDBSubnetGroupResponse": {"ResponseMetadata": {"RequestId": "13785dd5-a7fc-11e4-bb9c-7f371d0859b0"}}}""" CREATE_OPTION_GROUP_TEMPLATE = """{ "CreateOptionGroupResponse": { "CreateOptionGroupResult": { "OptionGroup": {{ option_group.to_json() }} }, "ResponseMetadata": { "RequestId": "1e38dad4-9f50-11e4-87ea-a31c60ed2e36" } } }""" DELETE_OPTION_GROUP_TEMPLATE = \ """{"DeleteOptionGroupResponse": {"ResponseMetadata": {"RequestId": "e2590367-9fa2-11e4-99cf-55e92d41c60e"}}}""" DESCRIBE_OPTION_GROUP_TEMPLATE = \ """{"DescribeOptionGroupsResponse": { "DescribeOptionGroupsResult": { "Marker": null, "OptionGroupsList": [ {%- for option_group in option_groups -%} {%- if loop.index != 1 -%},{%- endif -%} {{ option_group.to_json() }} {%- endfor -%} ]}, "ResponseMetadata": {"RequestId": "4caf445d-9fbc-11e4-87ea-a31c60ed2e36"} }}""" DESCRIBE_OPTION_GROUP_OPTIONS_TEMPLATE = \ """{"DescribeOptionGroupOptionsResponse": { "DescribeOptionGroupOptionsResult": { "Marker": null, "OptionGroupOptions": [ {%- for option_group_option in option_group_options -%} {%- if loop.index != 1 -%},{%- endif -%} {{ option_group_option.to_json() }} {%- endfor -%} ]}, "ResponseMetadata": {"RequestId": "457f7bb8-9fbf-11e4-9084-5754f80d5144"} }}""" MODIFY_OPTION_GROUP_TEMPLATE = \ """{"ModifyOptionGroupResponse": { "ResponseMetadata": { "RequestId": "ce9284a5-a0de-11e4-b984-a11a53e1f328" }, "ModifyOptionGroupResult": {{ option_group.to_json() }} } }""" LIST_TAGS_FOR_RESOURCE_TEMPLATE = \ """{"ListTagsForResourceResponse": {"ListTagsForResourceResult": {"TagList": [ {%- for tag in tags -%} {%- if loop.index != 1 -%},{%- endif -%} { "Key": "{{ tag['Key'] }}", "Value": "{{ tag['Value'] }}" } {%- endfor -%} ]}, "ResponseMetadata": { "RequestId": "8c21ba39-a598-11e4-b688-194eaf8658fa" } } }""" ADD_TAGS_TO_RESOURCE_TEMPLATE = \ """{"ListTagsForResourceResponse": { "ListTagsForResourceResult": { "TagList": [ {%- for tag in tags -%} {%- if loop.index != 1 -%},{%- endif -%} { "Key": "{{ tag['Key'] }}", "Value": "{{ tag['Value'] }}" } {%- endfor -%} ]}, "ResponseMetadata": { "RequestId": "b194d9ca-a664-11e4-b688-194eaf8658fa" } } }""" REMOVE_TAGS_FROM_RESOURCE_TEMPLATE = \ """{"RemoveTagsFromResourceResponse": {"ResponseMetadata": {"RequestId": "c6499a01-a664-11e4-8069-fb454b71a80e"}}} """
apache-2.0
52ai/django-ccsds
django/utils/regex_helper.py
97
12721
""" Functions for reversing a regular expression (used in reverse URL resolving). Used internally by Django and not intended for external use. This is not, and is not intended to be, a complete reg-exp decompiler. It should be good enough for a large class of URLS, however. """ from __future__ import unicode_literals from django.utils import six from django.utils.six.moves import zip # Mapping of an escape character to a representative of that class. So, e.g., # "\w" is replaced by "x" in a reverse URL. A value of None means to ignore # this sequence. Any missing key is mapped to itself. ESCAPE_MAPPINGS = { "A": None, "b": None, "B": None, "d": "0", "D": "x", "s": " ", "S": "x", "w": "x", "W": "!", "Z": None, } class Choice(list): """ Used to represent multiple possibilities at this point in a pattern string. We use a distinguished type, rather than a list, so that the usage in the code is clear. """ class Group(list): """ Used to represent a capturing group in the pattern string. """ class NonCapture(list): """ Used to represent a non-capturing group in the pattern string. """ def normalize(pattern): """ Given a reg-exp pattern, normalizes it to an iterable of forms that suffice for reverse matching. This does the following: (1) For any repeating sections, keeps the minimum number of occurrences permitted (this means zero for optional groups). (2) If an optional group includes parameters, include one occurrence of that group (along with the zero occurrence case from step (1)). (3) Select the first (essentially an arbitrary) element from any character class. Select an arbitrary character for any unordered class (e.g. '.' or '\w') in the pattern. (5) Ignore comments and any of the reg-exp flags that won't change what we construct ("iLmsu"). "(?x)" is an error, however. (6) Raise an error on all other non-capturing (?...) forms (e.g. look-ahead and look-behind matches) and any disjunctive ('|') constructs. Django's URLs for forward resolving are either all positional arguments or all keyword arguments. That is assumed here, as well. Although reverse resolving can be done using positional args when keyword args are specified, the two cannot be mixed in the same reverse() call. """ # Do a linear scan to work out the special features of this pattern. The # idea is that we scan once here and collect all the information we need to # make future decisions. result = [] non_capturing_groups = [] consume_next = True pattern_iter = next_char(iter(pattern)) num_args = 0 # A "while" loop is used here because later on we need to be able to peek # at the next character and possibly go around without consuming another # one at the top of the loop. try: ch, escaped = next(pattern_iter) except StopIteration: return [('', [])] try: while True: if escaped: result.append(ch) elif ch == '.': # Replace "any character" with an arbitrary representative. result.append(".") elif ch == '|': # FIXME: One day we'll should do this, but not in 1.0. raise NotImplementedError('Awaiting Implementation') elif ch == "^": pass elif ch == '$': break elif ch == ')': # This can only be the end of a non-capturing group, since all # other unescaped parentheses are handled by the grouping # section later (and the full group is handled there). # # We regroup everything inside the capturing group so that it # can be quantified, if necessary. start = non_capturing_groups.pop() inner = NonCapture(result[start:]) result = result[:start] + [inner] elif ch == '[': # Replace ranges with the first character in the range. ch, escaped = next(pattern_iter) result.append(ch) ch, escaped = next(pattern_iter) while escaped or ch != ']': ch, escaped = next(pattern_iter) elif ch == '(': # Some kind of group. ch, escaped = next(pattern_iter) if ch != '?' or escaped: # A positional group name = "_%d" % num_args num_args += 1 result.append(Group((("%%(%s)s" % name), name))) walk_to_end(ch, pattern_iter) else: ch, escaped = next(pattern_iter) if ch in "iLmsu#": # All of these are ignorable. Walk to the end of the # group. walk_to_end(ch, pattern_iter) elif ch == ':': # Non-capturing group non_capturing_groups.append(len(result)) elif ch != 'P': # Anything else, other than a named group, is something # we cannot reverse. raise ValueError("Non-reversible reg-exp portion: '(?%s'" % ch) else: ch, escaped = next(pattern_iter) if ch not in ('<', '='): raise ValueError("Non-reversible reg-exp portion: '(?P%s'" % ch) # We are in a named capturing group. Extra the name and # then skip to the end. if ch == '<': terminal_char = '>' # We are in a named backreference. else: terminal_char = ')' name = [] ch, escaped = next(pattern_iter) while ch != terminal_char: name.append(ch) ch, escaped = next(pattern_iter) param = ''.join(name) # Named backreferences have already consumed the # parenthesis. if terminal_char != ')': result.append(Group((("%%(%s)s" % param), param))) walk_to_end(ch, pattern_iter) else: result.append(Group((("%%(%s)s" % param), None))) elif ch in "*?+{": # Quantifiers affect the previous item in the result list. count, ch = get_quantifier(ch, pattern_iter) if ch: # We had to look ahead, but it wasn't need to compute the # quantifier, so use this character next time around the # main loop. consume_next = False if count == 0: if contains(result[-1], Group): # If we are quantifying a capturing group (or # something containing such a group) and the minimum is # zero, we must also handle the case of one occurrence # being present. All the quantifiers (except {0,0}, # which we conveniently ignore) that have a 0 minimum # also allow a single occurrence. result[-1] = Choice([None, result[-1]]) else: result.pop() elif count > 1: result.extend([result[-1]] * (count - 1)) else: # Anything else is a literal. result.append(ch) if consume_next: ch, escaped = next(pattern_iter) else: consume_next = True except StopIteration: pass except NotImplementedError: # A case of using the disjunctive form. No results for you! return [('', [])] return list(zip(*flatten_result(result))) def next_char(input_iter): """ An iterator that yields the next character from "pattern_iter", respecting escape sequences. An escaped character is replaced by a representative of its class (e.g. \w -> "x"). If the escaped character is one that is skipped, it is not returned (the next character is returned instead). Yields the next character, along with a boolean indicating whether it is a raw (unescaped) character or not. """ for ch in input_iter: if ch != '\\': yield ch, False continue ch = next(input_iter) representative = ESCAPE_MAPPINGS.get(ch, ch) if representative is None: continue yield representative, True def walk_to_end(ch, input_iter): """ The iterator is currently inside a capturing group. We want to walk to the close of this group, skipping over any nested groups and handling escaped parentheses correctly. """ if ch == '(': nesting = 1 else: nesting = 0 for ch, escaped in input_iter: if escaped: continue elif ch == '(': nesting += 1 elif ch == ')': if not nesting: return nesting -= 1 def get_quantifier(ch, input_iter): """ Parse a quantifier from the input, where "ch" is the first character in the quantifier. Returns the minimum number of occurrences permitted by the quantifier and either None or the next character from the input_iter if the next character is not part of the quantifier. """ if ch in '*?+': try: ch2, escaped = next(input_iter) except StopIteration: ch2 = None if ch2 == '?': ch2 = None if ch == '+': return 1, ch2 return 0, ch2 quant = [] while ch != '}': ch, escaped = next(input_iter) quant.append(ch) quant = quant[:-1] values = ''.join(quant).split(',') # Consume the trailing '?', if necessary. try: ch, escaped = next(input_iter) except StopIteration: ch = None if ch == '?': ch = None return int(values[0]), ch def contains(source, inst): """ Returns True if the "source" contains an instance of "inst". False, otherwise. """ if isinstance(source, inst): return True if isinstance(source, NonCapture): for elt in source: if contains(elt, inst): return True return False def flatten_result(source): """ Turns the given source sequence into a list of reg-exp possibilities and their arguments. Returns a list of strings and a list of argument lists. Each of the two lists will be of the same length. """ if source is None: return [''], [[]] if isinstance(source, Group): if source[1] is None: params = [] else: params = [source[1]] return [source[0]], [params] result = [''] result_args = [[]] pos = last = 0 for pos, elt in enumerate(source): if isinstance(elt, six.string_types): continue piece = ''.join(source[last:pos]) if isinstance(elt, Group): piece += elt[0] param = elt[1] else: param = None last = pos + 1 for i in range(len(result)): result[i] += piece if param: result_args[i].append(param) if isinstance(elt, (Choice, NonCapture)): if isinstance(elt, NonCapture): elt = [elt] inner_result, inner_args = [], [] for item in elt: res, args = flatten_result(item) inner_result.extend(res) inner_args.extend(args) new_result = [] new_args = [] for item, args in zip(result, result_args): for i_item, i_args in zip(inner_result, inner_args): new_result.append(item + i_item) new_args.append(args[:] + i_args) result = new_result result_args = new_args if pos >= last: piece = ''.join(source[last:]) for i in range(len(result)): result[i] += piece return result, result_args
bsd-3-clause
liangmingjie/react-native
JSCLegacyProfiler/trace_data.py
375
8013
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import re import unittest """ # _-----=> irqs-off # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / delay # TASK-PID CPU# |||| TIMESTAMP FUNCTION # | | | |||| | | <idle>-0 [001] ...2 3269.291072: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=mmcqd/0 next_pid=120 next_prio=120 """ TRACE_LINE_PATTERN = re.compile( r'^\s*(?P<task>.+)-(?P<pid>\d+)\s+(?:\((?P<tgid>.+)\)\s+)?\[(?P<cpu>\d+)\]\s+(?:(?P<flags>\S{4})\s+)?(?P<timestamp>[0-9.]+):\s+(?P<function>.+)$') """ Example lines from custom app traces: 0: B|27295|providerRemove 0: E tracing_mark_write: S|27311|NNFColdStart<D-7744962>|1112249168 """ APP_TRACE_LINE_PATTERN = re.compile( r'^(?P<type>.+?): (?P<args>.+)$') """ Example section names: NNFColdStart NNFColdStart<0><T7744962> NNFColdStart<X> NNFColdStart<T7744962> """ DECORATED_SECTION_NAME_PATTERN = re.compile(r'^(?P<section_name>.*?)(?:<0>)?(?:<(?P<command>.)(?P<argument>.*?)>)?$') SYSTRACE_LINE_TYPES = set(['0', 'tracing_mark_write']) class TraceLine(object): def __init__(self, task, pid, tgid, cpu, flags, timestamp, function): self.task = task self.pid = pid self.tgid = tgid self.cpu = cpu self.flags = flags self.timestamp = timestamp self.function = function self.canceled = False @property def is_app_trace_line(self): return isinstance(self.function, AppTraceFunction) def cancel(self): self.canceled = True def __str__(self): if self.canceled: return "" elif self.tgid: return "{task:>16s}-{pid:<5d} ({tgid:5s}) [{cpu:03d}] {flags:4s} {timestamp:12f}: {function}\n".format(**vars(self)) elif self.flags: return "{task:>16s}-{pid:<5d} [{cpu:03d}] {flags:4s} {timestamp:12f}: {function}\n".format(**vars(self)) else: return "{task:>16s}-{pid:<5d} [{cpu:03d}] {timestamp:12.6f}: {function}\n".format(**vars(self)) class AppTraceFunction(object): def __init__(self, type, args): self.type = type self.args = args self.operation = args[0] if len(args) >= 2 and args[1]: self.pid = int(args[1]) if len(args) >= 3: self._section_name, self.command, self.argument = _parse_section_name(args[2]) args[2] = self._section_name else: self._section_name = None self.command = None self.argument = None self.cookie = None @property def section_name(self): return self._section_name @section_name.setter def section_name(self, value): self._section_name = value self.args[2] = value def __str__(self): return "{type}: {args}".format(type=self.type, args='|'.join(self.args)) class AsyncTraceFunction(AppTraceFunction): def __init__(self, type, args): super(AsyncTraceFunction, self).__init__(type, args) self.cookie = int(args[3]) TRACE_TYPE_MAP = { 'S': AsyncTraceFunction, 'T': AsyncTraceFunction, 'F': AsyncTraceFunction, } def parse_line(line): match = TRACE_LINE_PATTERN.match(line.strip()) if not match: return None task = match.group("task") pid = int(match.group("pid")) tgid = match.group("tgid") cpu = int(match.group("cpu")) flags = match.group("flags") timestamp = float(match.group("timestamp")) function = match.group("function") app_trace = _parse_function(function) if app_trace: function = app_trace return TraceLine(task, pid, tgid, cpu, flags, timestamp, function) def parse_dextr_line(line): task = line["name"] pid = line["pid"] tgid = line["tid"] cpu = None flags = None timestamp = line["ts"] function = AppTraceFunction("DextrTrace", [line["ph"], line["pid"], line["name"]]) return TraceLine(task, pid, tgid, cpu, flags, timestamp, function) def _parse_function(function): line_match = APP_TRACE_LINE_PATTERN.match(function) if not line_match: return None type = line_match.group("type") if not type in SYSTRACE_LINE_TYPES: return None args = line_match.group("args").split('|') if len(args) == 1 and len(args[0]) == 0: args = None constructor = TRACE_TYPE_MAP.get(args[0], AppTraceFunction) return constructor(type, args) def _parse_section_name(section_name): if section_name is None: return section_name, None, None section_name_match = DECORATED_SECTION_NAME_PATTERN.match(section_name) section_name = section_name_match.group("section_name") command = section_name_match.group("command") argument = section_name_match.group("argument") return section_name, command, argument def _format_section_name(section_name, command, argument): if not command: return section_name return "{section_name}<{command}{argument}>".format(**vars()) class RoundTripFormattingTests(unittest.TestCase): def testPlainSectionName(self): section_name = "SectionName12345-5562342fas" self.assertEqual(section_name, _format_section_name(*_parse_section_name(section_name))) def testDecoratedSectionName(self): section_name = "SectionName12345-5562342fas<D-123456>" self.assertEqual(section_name, _format_section_name(*_parse_section_name(section_name))) def testSimpleFunction(self): function = "0: E" self.assertEqual(function, str(_parse_function(function))) def testFunctionWithoutCookie(self): function = "0: B|27295|providerRemove" self.assertEqual(function, str(_parse_function(function))) def testFunctionWithCookie(self): function = "0: S|27311|NNFColdStart|1112249168" self.assertEqual(function, str(_parse_function(function))) def testFunctionWithCookieAndArgs(self): function = "0: T|27311|NNFColdStart|1122|Start" self.assertEqual(function, str(_parse_function(function))) def testFunctionWithArgsButNoPid(self): function = "0: E|||foo=bar" self.assertEqual(function, str(_parse_function(function))) def testKitKatFunction(self): function = "tracing_mark_write: B|14127|Looper.dispatchMessage|arg=>>>>> Dispatching to Handler (android.os.Handler) {422ae980} null: 0|Java" self.assertEqual(function, str(_parse_function(function))) def testNonSysTraceFunctionIgnored(self): function = "sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=mmcqd/0 next_pid=120 next_prio=120" self.assertEqual(None, _parse_function(function)) def testLineWithFlagsAndTGID(self): line = " <idle>-0 ( 550) [000] d..2 7953.258473: cpu_idle: state=1 cpu_id=0\n" self.assertEqual(line, str(parse_line(line))) def testLineWithFlagsAndNoTGID(self): line = " <idle>-0 (-----) [000] d..2 7953.258473: cpu_idle: state=1 cpu_id=0\n" self.assertEqual(line, str(parse_line(line))) def testLineWithFlags(self): line = " <idle>-0 [001] ...2 3269.291072: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=mmcqd/0 next_pid=120 next_prio=120\n" self.assertEqual(line, str(parse_line(line))) def testLineWithoutFlags(self): line = " <idle>-0 [001] 3269.291072: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=mmcqd/0 next_pid=120 next_prio=120\n" self.assertEqual(line, str(parse_line(line)))
bsd-3-clause
PriceChild/ansible
lib/ansible/modules/cloud/amazon/ec2_customer_gateway.py
6
9026
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this library. If not, see <http://www.gnu.org/licenses/>. ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: ec2_customer_gateway short_description: Manage an AWS customer gateway description: - Manage an AWS customer gateway version_added: "2.2" author: Michael Baydoun (@MichaelBaydoun) requirements: [ botocore, boto3 ] notes: - You cannot create more than one customer gateway with the same IP address. If you run an identical request more than one time, the first request creates the customer gateway, and subsequent requests return information about the existing customer gateway. The subsequent requests do not create new customer gateway resources. - Return values contain customer_gateway and customer_gateways keys which are identical dicts. You should use customer_gateway. See U(https://github.com/ansible/ansible-modules-extras/issues/2773) for details. options: bgp_asn: description: - Border Gateway Protocol (BGP) Autonomous System Number (ASN), required when state=present. required: false default: null ip_address: description: - Internet-routable IP address for customers gateway, must be a static address. required: true name: description: - Name of the customer gateway. required: true state: description: - Create or terminate the Customer Gateway. required: false default: present choices: [ 'present', 'absent' ] extends_documentation_fragment: - aws - ec2 ''' EXAMPLES = ''' # Create Customer Gateway - ec2_customer_gateway: bgp_asn: 12345 ip_address: 1.2.3.4 name: IndianapolisOffice region: us-east-1 register: cgw # Delete Customer Gateway - ec2_customer_gateway: ip_address: 1.2.3.4 name: IndianapolisOffice state: absent region: us-east-1 register: cgw ''' RETURN = ''' gateway.customer_gateways: description: details about the gateway that was created. returned: success type: complex contains: bgp_asn: description: The Border Gateway Autonomous System Number. returned: when exists and gateway is available. sample: 65123 type: string customer_gateway_id: description: gateway id assigned by amazon. returned: when exists and gateway is available. sample: cgw-cb6386a2 type: string ip_address: description: ip address of your gateway device. returned: when exists and gateway is available. sample: 1.2.3.4 type: string state: description: state of gateway. returned: when gateway exists and is available. state: available type: string tags: description: any tags on the gateway. returned: when gateway exists and is available, and when tags exist. state: available type: string type: description: encryption type. returned: when gateway exists and is available. sample: ipsec.1 type: string ''' try: from botocore.exceptions import ClientError HAS_BOTOCORE = True except ImportError: HAS_BOTOCORE = False try: import boto3 HAS_BOTO3 = True except ImportError: HAS_BOTO3 = False from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.ec2 import (boto3_conn, camel_dict_to_snake_dict, ec2_argument_spec, get_aws_connection_info) class Ec2CustomerGatewayManager: def __init__(self, module): self.module = module try: region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module, boto3=True) if not region: module.fail_json(msg="Region must be specified as a parameter, in EC2_REGION or AWS_REGION environment variables or in boto configuration file") self.ec2 = boto3_conn(module, conn_type='client', resource='ec2', region=region, endpoint=ec2_url, **aws_connect_kwargs) except ClientError as e: module.fail_json(msg=e.message) def ensure_cgw_absent(self, gw_id): response = self.ec2.delete_customer_gateway( DryRun=False, CustomerGatewayId=gw_id ) return response def ensure_cgw_present(self, bgp_asn, ip_address): response = self.ec2.create_customer_gateway( DryRun=False, Type='ipsec.1', PublicIp=ip_address, BgpAsn=bgp_asn, ) return response def tag_cgw_name(self, gw_id, name): response = self.ec2.create_tags( DryRun=False, Resources=[ gw_id, ], Tags=[ { 'Key': 'Name', 'Value': name }, ] ) return response def describe_gateways(self, ip_address): response = self.ec2.describe_customer_gateways( DryRun=False, Filters=[ { 'Name': 'state', 'Values': [ 'available', ] }, { 'Name': 'ip-address', 'Values': [ ip_address, ] } ] ) return response def main(): argument_spec = ec2_argument_spec() argument_spec.update( dict( bgp_asn=dict(required=False, type='int'), ip_address=dict(required=True), name=dict(required=True), state=dict(default='present', choices=['present', 'absent']), ) ) module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True, required_if=[ ('state', 'present', ['bgp_asn']) ] ) if not HAS_BOTOCORE: module.fail_json(msg='botocore is required.') if not HAS_BOTO3: module.fail_json(msg='boto3 is required.') gw_mgr = Ec2CustomerGatewayManager(module) name = module.params.get('name') existing = gw_mgr.describe_gateways(module.params['ip_address']) # describe_gateways returns a key of CustomerGateways where as create_gateway returns a # key of CustomerGateway. For consistency, change it here existing['CustomerGateway'] = existing['CustomerGateways'] results = dict(changed=False) if module.params['state'] == 'present': if existing['CustomerGateway']: results['gateway'] = existing if existing['CustomerGateway'][0]['Tags']: tag_array = existing['CustomerGateway'][0]['Tags'] for key, value in enumerate(tag_array): if value['Key'] == 'Name': current_name = value['Value'] if current_name != name: results['name'] = gw_mgr.tag_cgw_name( results['gateway']['CustomerGateway'][0]['CustomerGatewayId'], module.params['name'], ) results['changed'] = True else: if not module.check_mode: results['gateway'] = gw_mgr.ensure_cgw_present( module.params['bgp_asn'], module.params['ip_address'], ) results['name'] = gw_mgr.tag_cgw_name( results['gateway']['CustomerGateway']['CustomerGatewayId'], module.params['name'], ) results['changed'] = True elif module.params['state'] == 'absent': if existing['CustomerGateway']: results['gateway'] = existing if not module.check_mode: results['gateway'] = gw_mgr.ensure_cgw_absent( existing['CustomerGateway'][0]['CustomerGatewayId'] ) results['changed'] = True pretty_results = camel_dict_to_snake_dict(results) module.exit_json(**pretty_results) if __name__ == '__main__': main()
gpl-3.0
shinglyu/moztrap
tests/model/environments/api/test_category_resource.py
3
2140
""" Tests for EnvironmentResource api. """ from tests.case.api.crud import ApiCrudCases class CategoryResourceTest(ApiCrudCases): @property def factory(self): """The model factory for this object.""" return self.F.CategoryFactory() @property def resource_name(self): """The resource name for this object.""" return "category" @property def permission(self): """The permissions needed to modify this object type.""" return "environments.manage_environments" @property def new_object_data(self): """Generates a dictionary containing the field names and auto-generated values needed to create a unique object. The output of this method can be sent in the payload parameter of a POST message. """ modifiers = (self.datetime, self.resource_name) return { u"name": u"category %s %s" % modifiers, u"elements": [], } def backend_object(self, id): """Returns the object from the backend, so you can query it's values in the database for validation. """ return self.model.Category.everything.get(id=id) def backend_data(self, backend_obj): """Query's the database for the object's current values. Output is a dictionary that should match the result of getting the object's detail via the API, and can be used to verify API output. Note: both keys and data should be in unicode """ return { u"id": backend_obj.id, u"name": unicode(backend_obj.name), u"resource_uri": unicode( self.get_detail_url(self.resource_name, str(backend_obj.id))), u"elements": [{ u"name": unicode(elem.name), u"id": elem.id, u"resource_uri": unicode(self.get_detail_url( "element", str(elem.id) )), } for elem in backend_obj.elements.all()] }
bsd-2-clause
felipenaselva/felipe.repository
script.module.universalscrapers/lib/universalscrapers/modules/js2py/legecy_translators/objects.py
11
11176
""" This module removes all objects/arrays from JS source code and replace them with LVALS. Also it has s function translating removed object/array to python code. Use this module just after removing constants. Later move on to removing functions""" OBJECT_LVAL = 'PyJsLvalObject%d_' ARRAY_LVAL = 'PyJsLvalArray%d_' from utils import * from jsparser import * from nodevisitor import exp_translator import functions from flow import KEYWORD_METHODS def FUNC_TRANSLATOR(*a):# stupid import system in python raise RuntimeError('Remember to set func translator. Thank you.') def set_func_translator(ftrans): # stupid stupid Python or Peter global FUNC_TRANSLATOR FUNC_TRANSLATOR = ftrans def is_empty_object(n, last): """n may be the inside of block or object""" if n.strip(): return False # seems to be but can be empty code last = last.strip() markers = {')', ';',} if not last or last[-1] in markers: return False return True # todo refine this function def is_object(n, last): """n may be the inside of block or object. last is the code before object""" if is_empty_object(n, last): return True if not n.strip(): return False #Object contains lines of code so it cant be an object if len(argsplit(n, ';'))>1: return False cands = argsplit(n, ',') if not cands[-1].strip(): return True # {xxxx,} empty after last , it must be an object for cand in cands: cand = cand.strip() # separate each candidate element at : in dict and check whether they are correct... kv = argsplit(cand, ':') if len(kv) > 2: # set the len of kv to 2 because of this stupid : expression kv = kv[0],':'.join(kv[1:]) if len(kv)==2: # key value pair, check whether not label or ?: k, v = kv if not is_lval(k.strip()): return False v = v.strip() if v.startswith('function'): continue #will fail on label... {xxx: while {}} if v[0]=='{': # value cant be a code block return False for e in KEYWORD_METHODS: # if v starts with any statement then return false if v.startswith(e) and len(e)<len(v) and v[len(e)] not in IDENTIFIER_PART: return False elif not (cand.startswith('set ') or cand.startswith('get ')): return False return True def is_array(last): #it can be prop getter last = last.strip() if any(endswith_keyword(last, e) for e in ['return', 'new', 'void', 'throw', 'typeof', 'in', 'instanceof']): return True markers = {')', ']'} return not last or not (last[-1] in markers or last[-1] in IDENTIFIER_PART) def remove_objects(code, count=1): """ This function replaces objects with OBJECTS_LVALS, returns new code, replacement dict and count. count arg is the number that should be added to the LVAL of the first replaced object """ replacements = {} #replacement dict br = bracket_split(code, ['{}', '[]']) res = '' last = '' for e in br: #test whether e is an object if e[0]=='{': n, temp_rep, cand_count = remove_objects(e[1:-1], count) # if e was not an object then n should not contain any : if is_object(n, last): #e was an object res += ' '+OBJECT_LVAL % count replacements[OBJECT_LVAL % count] = e count += 1 else: # e was just a code block but could contain objects inside res += '{%s}' % n count = cand_count replacements.update(temp_rep) elif e[0]=='[': if is_array(last): res += e # will be translated later else: # prop get n, rep, count = remove_objects(e[1:-1], count) res += '[%s]' % n replacements.update(rep) else: # e does not contain any objects res += e last = e #needed to test for this stipid empty object return res, replacements, count def remove_arrays(code, count=1): """removes arrays and replaces them with ARRAY_LVALS returns new code and replacement dict *NOTE* has to be called AFTER remove objects""" res = '' last = '' replacements = {} for e in bracket_split(code, ['[]']): if e[0]=='[': if is_array(last): name = ARRAY_LVAL % count res += ' ' + name replacements[name] = e count += 1 else: # pseudo array. But pseudo array can contain true array. for example a[['d'][3]] has 2 pseudo and 1 true array cand, new_replacements, count = remove_arrays(e[1:-1], count) res += '[%s]' % cand replacements.update(new_replacements) else: res += e last = e return res, replacements, count def translate_object(obj, lval, obj_count=1, arr_count=1): obj = obj[1:-1] # remove {} from both ends obj, obj_rep, obj_count = remove_objects(obj, obj_count) obj, arr_rep, arr_count = remove_arrays(obj, arr_count) # functions can be defined inside objects. exp translator cant translate them. # we have to remove them and translate with func translator # its better explained in translate_array function obj, hoisted, inline = functions.remove_functions(obj, all_inline=True) assert not hoisted gsetters_after = '' keys = argsplit(obj) res = [] for i, e in enumerate(keys, 1): e = e.strip() if e.startswith('set '): gsetters_after += translate_setter(lval, e) elif e.startswith('get '): gsetters_after += translate_getter(lval, e) elif ':' not in e: if i<len(keys): # can happen legally only in the last element {3:2,} raise SyntaxError('Unexpected "," in Object literal') break else: #Not getter, setter or elision spl = argsplit(e, ':') if len(spl)<2: raise SyntaxError('Invalid Object literal: '+e) try: key, value = spl except: #len(spl)> 2 print 'Unusual case ' + repr(e) key = spl[0] value = ':'.join(spl[1:]) key = key.strip() if is_internal(key): key = '%s.to_string().value' % key else: key = repr(key) value = exp_translator(value) if not value: raise SyntaxError('Missing value in Object literal') res.append('%s:%s' % (key, value)) res = '%s = Js({%s})\n' % (lval, ','.join(res)) + gsetters_after # translate all the nested objects (including removed earlier functions) for nested_name, nested_info in inline.iteritems(): # functions nested_block, nested_args = nested_info new_def = FUNC_TRANSLATOR(nested_name, nested_block, nested_args) res = new_def + res for lval, obj in obj_rep.iteritems(): #objects new_def, obj_count, arr_count = translate_object(obj, lval, obj_count, arr_count) # add object definition BEFORE array definition res = new_def + res for lval, obj in arr_rep.iteritems(): # arrays new_def, obj_count, arr_count = translate_array(obj, lval, obj_count, arr_count) # add object definition BEFORE array definition res = new_def + res return res, obj_count, arr_count def translate_setter(lval, setter): func = 'function' + setter[3:] try: _, data, _ = functions.remove_functions(func) if not data or len(data)>1: raise Exception() except: raise SyntaxError('Could not parse setter: '+setter) prop = data.keys()[0] body, args = data[prop] if len(args)!=1: #setter must have exactly 1 argument raise SyntaxError('Invalid setter. It must take exactly 1 argument.') # now messy part res = FUNC_TRANSLATOR('setter', body, args) res += "%s.define_own_property(%s, {'set': setter})\n"%(lval, repr(prop)) return res def translate_getter(lval, getter): func = 'function' + getter[3:] try: _, data, _ = functions.remove_functions(func) if not data or len(data)>1: raise Exception() except: raise SyntaxError('Could not parse getter: '+getter) prop = data.keys()[0] body, args = data[prop] if len(args)!=0: #setter must have exactly 0 argument raise SyntaxError('Invalid getter. It must take exactly 0 argument.') # now messy part res = FUNC_TRANSLATOR('getter', body, args) res += "%s.define_own_property(%s, {'get': setter})\n"%(lval, repr(prop)) return res def translate_array(array, lval, obj_count=1, arr_count=1): """array has to be any js array for example [1,2,3] lval has to be name of this array. Returns python code that adds lval to the PY scope it should be put before lval""" array = array[1:-1] array, obj_rep, obj_count = remove_objects(array, obj_count) array, arr_rep, arr_count = remove_arrays(array, arr_count) #functions can be also defined in arrays, this caused many problems since in Python # functions cant be defined inside literal # remove functions (they dont contain arrays or objects so can be translated easily) # hoisted functions are treated like inline array, hoisted, inline = functions.remove_functions(array, all_inline=True) assert not hoisted arr = [] # separate elements in array for e in argsplit(array, ','): # translate expressions in array PyJsLvalInline will not be translated! e = exp_translator(e.replace('\n', '')) arr.append(e if e else 'None') arr = '%s = Js([%s])\n' % (lval, ','.join(arr)) #But we can have more code to add to define arrays/objects/functions defined inside this array # translate nested objects: # functions: for nested_name, nested_info in inline.iteritems(): nested_block, nested_args = nested_info new_def = FUNC_TRANSLATOR(nested_name, nested_block, nested_args) arr = new_def + arr for lval, obj in obj_rep.iteritems(): new_def, obj_count, arr_count = translate_object(obj, lval, obj_count, arr_count) # add object definition BEFORE array definition arr = new_def + arr for lval, obj in arr_rep.iteritems(): new_def, obj_count, arr_count = translate_array(obj, lval, obj_count, arr_count) # add object definition BEFORE array definition arr = new_def + arr return arr, obj_count, arr_count if __name__=='__main__': test = 'a = {404:{494:19}}; b = 303; if () {f={:}; { }}' #print remove_objects(test) #print list(bracket_split(' {}')) print print remove_arrays('typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""], [][[5][5]])[1].toLowerCase()])') print is_object('', ')')
gpl-2.0
lixiangning888/whole_project
modules/signatures_merge_tmp/antidbg_windows.py
3
2558
# -*- coding: utf-8 -*- # Copyright (C) 2012 Claudio "nex" Guarnieri (@botherder) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from lib.cuckoo.common.abstracts import Signature class AntiDBGWindows(Signature): name = "antidbg_windows" description = "检查是否存在常见排错或检验程序的窗口" severity = 3 categories = ["anti-debug"] authors = ["nex", "KillerInstinct"] minimum = "1.2" evented = True filter_categories = set(["windows"]) def __init__(self, *args, **kwargs): Signature.__init__(self, *args, **kwargs) self.ret = dict() def on_call(self, call, process): indicators = [ "OLLYDBG", "WinDbgFrameClass", "pediy06", "GBDYLLO", "RegmonClass", "FilemonClass", "Regmonclass", "Filemonclass", "PROCMON_WINDOW_CLASS", "File Monitor - Sysinternals: www.sysinternals.com", "Process Monitor - Sysinternals: www.sysinternals.com", "Registry Monitor - Sysinternals: www.sysinternals.com", "18467-41", ] for indicator in indicators: if self.check_argument_call(call, pattern=indicator, category="windows"): if process["process_name"] not in self.ret.keys(): self.ret[process["process_name"]] = list() window = self.get_argument(call, "ClassName") if window == "0": window = self.get_argument(call, "WindowName") if window not in self.ret[process["process_name"]]: self.ret[process["process_name"]].append(window) return None def on_complete(self): if self.ret: for proc in self.ret.keys(): for value in self.ret[proc]: self.data.append({"Window": value}) return True return False
lgpl-3.0
lowitty/server
libsLinux/twisted/words/test/test_jabbererror.py
10
11430
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.words.protocols.jabber.error}. """ from twisted.trial import unittest from twisted.words.protocols.jabber import error from twisted.words.xish import domish NS_XML = 'http://www.w3.org/XML/1998/namespace' NS_STREAMS = 'http://etherx.jabber.org/streams' NS_XMPP_STREAMS = 'urn:ietf:params:xml:ns:xmpp-streams' NS_XMPP_STANZAS = 'urn:ietf:params:xml:ns:xmpp-stanzas' class BaseErrorTests(unittest.TestCase): def test_getElementPlain(self): """ Test getting an element for a plain error. """ e = error.BaseError('feature-not-implemented') element = e.getElement() self.assertIdentical(element.uri, None) self.assertEqual(len(element.children), 1) def test_getElementText(self): """ Test getting an element for an error with a text. """ e = error.BaseError('feature-not-implemented', 'text') element = e.getElement() self.assertEqual(len(element.children), 2) self.assertEqual(unicode(element.text), 'text') self.assertEqual(element.text.getAttribute((NS_XML, 'lang')), None) def test_getElementTextLang(self): """ Test getting an element for an error with a text and language. """ e = error.BaseError('feature-not-implemented', 'text', 'en_US') element = e.getElement() self.assertEqual(len(element.children), 2) self.assertEqual(unicode(element.text), 'text') self.assertEqual(element.text[(NS_XML, 'lang')], 'en_US') def test_getElementAppCondition(self): """ Test getting an element for an error with an app specific condition. """ ac = domish.Element(('testns', 'myerror')) e = error.BaseError('feature-not-implemented', appCondition=ac) element = e.getElement() self.assertEqual(len(element.children), 2) self.assertEqual(element.myerror, ac) class StreamErrorTests(unittest.TestCase): def test_getElementPlain(self): """ Test namespace of the element representation of an error. """ e = error.StreamError('feature-not-implemented') element = e.getElement() self.assertEqual(element.uri, NS_STREAMS) def test_getElementConditionNamespace(self): """ Test that the error condition element has the correct namespace. """ e = error.StreamError('feature-not-implemented') element = e.getElement() self.assertEqual(NS_XMPP_STREAMS, getattr(element, 'feature-not-implemented').uri) def test_getElementTextNamespace(self): """ Test that the error text element has the correct namespace. """ e = error.StreamError('feature-not-implemented', 'text') element = e.getElement() self.assertEqual(NS_XMPP_STREAMS, element.text.uri) class StanzaErrorTests(unittest.TestCase): """ Tests for L{error.StreamError}. """ def test_typeRemoteServerTimeout(self): """ Remote Server Timeout should yield type wait, code 504. """ e = error.StanzaError('remote-server-timeout') self.assertEqual('wait', e.type) self.assertEqual('504', e.code) def test_getElementPlain(self): """ Test getting an element for a plain stanza error. """ e = error.StanzaError('feature-not-implemented') element = e.getElement() self.assertEqual(element.uri, None) self.assertEqual(element['type'], 'cancel') self.assertEqual(element['code'], '501') def test_getElementType(self): """ Test getting an element for a stanza error with a given type. """ e = error.StanzaError('feature-not-implemented', 'auth') element = e.getElement() self.assertEqual(element.uri, None) self.assertEqual(element['type'], 'auth') self.assertEqual(element['code'], '501') def test_getElementConditionNamespace(self): """ Test that the error condition element has the correct namespace. """ e = error.StanzaError('feature-not-implemented') element = e.getElement() self.assertEqual(NS_XMPP_STANZAS, getattr(element, 'feature-not-implemented').uri) def test_getElementTextNamespace(self): """ Test that the error text element has the correct namespace. """ e = error.StanzaError('feature-not-implemented', text='text') element = e.getElement() self.assertEqual(NS_XMPP_STANZAS, element.text.uri) def test_toResponse(self): """ Test an error response is generated from a stanza. The addressing on the (new) response stanza should be reversed, an error child (with proper properties) added and the type set to C{'error'}. """ stanza = domish.Element(('jabber:client', 'message')) stanza['type'] = 'chat' stanza['to'] = '[email protected]' stanza['from'] = '[email protected]/resource' e = error.StanzaError('service-unavailable') response = e.toResponse(stanza) self.assertNotIdentical(response, stanza) self.assertEqual(response['from'], '[email protected]') self.assertEqual(response['to'], '[email protected]/resource') self.assertEqual(response['type'], 'error') self.assertEqual(response.error.children[0].name, 'service-unavailable') self.assertEqual(response.error['type'], 'cancel') self.assertNotEqual(stanza.children, response.children) class ParseErrorTests(unittest.TestCase): """ Tests for L{error._parseError}. """ def setUp(self): self.error = domish.Element((None, 'error')) def test_empty(self): """ Test parsing of the empty error element. """ result = error._parseError(self.error, 'errorns') self.assertEqual({'condition': None, 'text': None, 'textLang': None, 'appCondition': None}, result) def test_condition(self): """ Test parsing of an error element with a condition. """ self.error.addElement(('errorns', 'bad-request')) result = error._parseError(self.error, 'errorns') self.assertEqual('bad-request', result['condition']) def test_text(self): """ Test parsing of an error element with a text. """ text = self.error.addElement(('errorns', 'text')) text.addContent('test') result = error._parseError(self.error, 'errorns') self.assertEqual('test', result['text']) self.assertEqual(None, result['textLang']) def test_textLang(self): """ Test parsing of an error element with a text with a defined language. """ text = self.error.addElement(('errorns', 'text')) text[NS_XML, 'lang'] = 'en_US' text.addContent('test') result = error._parseError(self.error, 'errorns') self.assertEqual('en_US', result['textLang']) def test_appCondition(self): """ Test parsing of an error element with an app specific condition. """ condition = self.error.addElement(('testns', 'condition')) result = error._parseError(self.error, 'errorns') self.assertEqual(condition, result['appCondition']) def test_appConditionMultiple(self): """ Test parsing of an error element with multiple app specific conditions. """ self.error.addElement(('testns', 'condition')) condition = self.error.addElement(('testns', 'condition2')) result = error._parseError(self.error, 'errorns') self.assertEqual(condition, result['appCondition']) class ExceptionFromStanzaTests(unittest.TestCase): def test_basic(self): """ Test basic operations of exceptionFromStanza. Given a realistic stanza, check if a sane exception is returned. Using this stanza:: <iq type='error' from='pubsub.shakespeare.lit' to='[email protected]/barracks' id='subscriptions1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <subscriptions/> </pubsub> <error type='cancel'> <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <unsupported xmlns='http://jabber.org/protocol/pubsub#errors' feature='retrieve-subscriptions'/> </error> </iq> """ stanza = domish.Element((None, 'stanza')) p = stanza.addElement(('http://jabber.org/protocol/pubsub', 'pubsub')) p.addElement('subscriptions') e = stanza.addElement('error') e['type'] = 'cancel' e.addElement((NS_XMPP_STANZAS, 'feature-not-implemented')) uc = e.addElement(('http://jabber.org/protocol/pubsub#errors', 'unsupported')) uc['feature'] = 'retrieve-subscriptions' result = error.exceptionFromStanza(stanza) self.assert_(isinstance(result, error.StanzaError)) self.assertEqual('feature-not-implemented', result.condition) self.assertEqual('cancel', result.type) self.assertEqual(uc, result.appCondition) self.assertEqual([p], result.children) def test_legacy(self): """ Test legacy operations of exceptionFromStanza. Given a realistic stanza with only legacy (pre-XMPP) error information, check if a sane exception is returned. Using this stanza:: <message type='error' to='[email protected]/Home' from='[email protected]'> <body>Are you there?</body> <error code='502'>Unable to resolve hostname.</error> </message> """ stanza = domish.Element((None, 'stanza')) p = stanza.addElement('body', content='Are you there?') e = stanza.addElement('error', content='Unable to resolve hostname.') e['code'] = '502' result = error.exceptionFromStanza(stanza) self.assert_(isinstance(result, error.StanzaError)) self.assertEqual('service-unavailable', result.condition) self.assertEqual('wait', result.type) self.assertEqual('Unable to resolve hostname.', result.text) self.assertEqual([p], result.children) class ExceptionFromStreamErrorTests(unittest.TestCase): def test_basic(self): """ Test basic operations of exceptionFromStreamError. Given a realistic stream error, check if a sane exception is returned. Using this error:: <stream:error xmlns:stream='http://etherx.jabber.org/streams'> <xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> </stream:error> """ e = domish.Element(('http://etherx.jabber.org/streams', 'error')) e.addElement((NS_XMPP_STREAMS, 'xml-not-well-formed')) result = error.exceptionFromStreamError(e) self.assert_(isinstance(result, error.StreamError)) self.assertEqual('xml-not-well-formed', result.condition)
mit
benjamindeleener/odoo
openerp/report/render/rml2pdf/customfonts.py
49
2467
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from reportlab import rl_config import logging import glob import os # .apidoc title: TTF Font Table """This module allows the mapping of some system-available TTF fonts to the reportlab engine. This file could be customized per distro (although most Linux/Unix ones) should have the same filenames, only need the code below). Due to an awful configuration that ships with reportlab at many Linux and Ubuntu distros, we have to override the search path, too. """ _logger = logging.getLogger(__name__) CustomTTFonts = [] # Search path for TTF files, in addition of rl_config.TTFSearchPath TTFSearchPath = [ '/usr/share/fonts/truetype', # SuSE '/usr/share/fonts/dejavu', '/usr/share/fonts/liberation', # Fedora, RHEL '/usr/share/fonts/truetype/*','/usr/local/share/fonts' # Ubuntu, '/usr/share/fonts/TTF/*', # Mandriva/Mageia '/usr/share/fonts/TTF', # Arch Linux '/usr/lib/openoffice/share/fonts/truetype/', '~/.fonts', '~/.local/share/fonts', # mac os X - from # http://developer.apple.com/technotes/tn/tn2024.html '~/Library/Fonts', '/Library/Fonts', '/Network/Library/Fonts', '/System/Library/Fonts', # windows 'c:/winnt/fonts', 'c:/windows/fonts' ] def list_all_sysfonts(): """ This function returns list of font directories of system. """ filepath = [] # Perform the search for font files ourselves, as reportlab's # TTFOpenFile is not very good at it. searchpath = list(set(TTFSearchPath + rl_config.TTFSearchPath)) for dirname in searchpath: for filename in glob.glob(os.path.join(os.path.expanduser(dirname), '*.[Tt][Tt][FfCc]')): filepath.append(filename) return filepath def SetCustomFonts(rmldoc): """ Map some font names to the corresponding TTF fonts The ttf font may not even have the same name, as in Times -> Liberation Serif. This function is called once per report, so it should avoid system-wide processing (cache it, instead). """ for family, font, filename, mode in CustomTTFonts: if os.path.isabs(filename) and os.path.exists(filename): rmldoc.setTTFontMapping(family, font, filename, mode) return True
gpl-3.0
tjctw/PythonNote
thinkstat/thinkstats_test.py
2
1875
"""This file contains code for use with "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import unittest import random import thinkstats class Test(unittest.TestCase): def testMean(self): t = [1, 1, 1, 3, 3, 591] mu = thinkstats.Mean(t) self.assertEquals(mu, 100) def testVar(self): t = [1, 1, 1, 3, 3, 591] mu = thinkstats.Mean(t) var1 = thinkstats.Var(t) var2 = thinkstats.Var(t, mu) self.assertAlmostEquals(mu, 100.0) self.assertAlmostEquals(var1, 48217.0) self.assertAlmostEquals(var2, 48217.0) def testBinom(self): res = thinkstats.Binom(10, 3) self.assertEquals(res, 120) res = thinkstats.Binom(100, 4) self.assertEquals(res, 3921225) def testInterp(self): xs = [1, 2, 3] ys = [4, 5, 6] interp = thinkstats.Interpolator(xs, ys) y = interp.Lookup(1) self.assertAlmostEquals(y, 4) y = interp.Lookup(2) self.assertAlmostEquals(y, 5) y = interp.Lookup(3) self.assertAlmostEquals(y, 6) y = interp.Lookup(1.5) self.assertAlmostEquals(y, 4.5) y = interp.Lookup(2.75) self.assertAlmostEquals(y, 5.75) x = interp.Reverse(4) self.assertAlmostEquals(x, 1) x = interp.Reverse(6) self.assertAlmostEquals(x, 3) x = interp.Reverse(4.5) self.assertAlmostEquals(x, 1.5) x = interp.Reverse(5.75) self.assertAlmostEquals(x, 2.75) def testTrim(self): t = range(100) random.shuffle(t) trimmed = thinkstats.Trim(t, p=0.05) n = len(trimmed) self.assertEquals(n, 90) if __name__ == "__main__": unittest.main()
cc0-1.0
deerwalk/voltdb
third_party/cpp/googletest/googletest/test/gtest_catch_exceptions_test.py
2139
9901
#!/usr/bin/env python # # Copyright 2010 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """Tests Google Test's exception catching behavior. This script invokes gtest_catch_exceptions_test_ and gtest_catch_exceptions_ex_test_ (programs written with Google Test) and verifies their output. """ __author__ = '[email protected] (Vlad Losev)' import os import gtest_test_utils # Constants. FLAG_PREFIX = '--gtest_' LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests' NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0' FILTER_FLAG = FLAG_PREFIX + 'filter' # Path to the gtest_catch_exceptions_ex_test_ binary, compiled with # exceptions enabled. EX_EXE_PATH = gtest_test_utils.GetTestExecutablePath( 'gtest_catch_exceptions_ex_test_') # Path to the gtest_catch_exceptions_test_ binary, compiled with # exceptions disabled. EXE_PATH = gtest_test_utils.GetTestExecutablePath( 'gtest_catch_exceptions_no_ex_test_') environ = gtest_test_utils.environ SetEnvVar = gtest_test_utils.SetEnvVar # Tests in this file run a Google-Test-based test program and expect it # to terminate prematurely. Therefore they are incompatible with # the premature-exit-file protocol by design. Unset the # premature-exit filepath to prevent Google Test from creating # the file. SetEnvVar(gtest_test_utils.PREMATURE_EXIT_FILE_ENV_VAR, None) TEST_LIST = gtest_test_utils.Subprocess( [EXE_PATH, LIST_TESTS_FLAG], env=environ).output SUPPORTS_SEH_EXCEPTIONS = 'ThrowsSehException' in TEST_LIST if SUPPORTS_SEH_EXCEPTIONS: BINARY_OUTPUT = gtest_test_utils.Subprocess([EXE_PATH], env=environ).output EX_BINARY_OUTPUT = gtest_test_utils.Subprocess( [EX_EXE_PATH], env=environ).output # The tests. if SUPPORTS_SEH_EXCEPTIONS: # pylint:disable-msg=C6302 class CatchSehExceptionsTest(gtest_test_utils.TestCase): """Tests exception-catching behavior.""" def TestSehExceptions(self, test_output): self.assert_('SEH exception with code 0x2a thrown ' 'in the test fixture\'s constructor' in test_output) self.assert_('SEH exception with code 0x2a thrown ' 'in the test fixture\'s destructor' in test_output) self.assert_('SEH exception with code 0x2a thrown in SetUpTestCase()' in test_output) self.assert_('SEH exception with code 0x2a thrown in TearDownTestCase()' in test_output) self.assert_('SEH exception with code 0x2a thrown in SetUp()' in test_output) self.assert_('SEH exception with code 0x2a thrown in TearDown()' in test_output) self.assert_('SEH exception with code 0x2a thrown in the test body' in test_output) def testCatchesSehExceptionsWithCxxExceptionsEnabled(self): self.TestSehExceptions(EX_BINARY_OUTPUT) def testCatchesSehExceptionsWithCxxExceptionsDisabled(self): self.TestSehExceptions(BINARY_OUTPUT) class CatchCxxExceptionsTest(gtest_test_utils.TestCase): """Tests C++ exception-catching behavior. Tests in this test case verify that: * C++ exceptions are caught and logged as C++ (not SEH) exceptions * Exception thrown affect the remainder of the test work flow in the expected manner. """ def testCatchesCxxExceptionsInFixtureConstructor(self): self.assert_('C++ exception with description ' '"Standard C++ exception" thrown ' 'in the test fixture\'s constructor' in EX_BINARY_OUTPUT) self.assert_('unexpected' not in EX_BINARY_OUTPUT, 'This failure belongs in this test only if ' '"CxxExceptionInConstructorTest" (no quotes) ' 'appears on the same line as words "called unexpectedly"') if ('CxxExceptionInDestructorTest.ThrowsExceptionInDestructor' in EX_BINARY_OUTPUT): def testCatchesCxxExceptionsInFixtureDestructor(self): self.assert_('C++ exception with description ' '"Standard C++ exception" thrown ' 'in the test fixture\'s destructor' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInDestructorTest::TearDownTestCase() ' 'called as expected.' in EX_BINARY_OUTPUT) def testCatchesCxxExceptionsInSetUpTestCase(self): self.assert_('C++ exception with description "Standard C++ exception"' ' thrown in SetUpTestCase()' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInConstructorTest::TearDownTestCase() ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInSetUpTestCaseTest constructor ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInSetUpTestCaseTest destructor ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInSetUpTestCaseTest::SetUp() ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInSetUpTestCaseTest::TearDown() ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInSetUpTestCaseTest test body ' 'called as expected.' in EX_BINARY_OUTPUT) def testCatchesCxxExceptionsInTearDownTestCase(self): self.assert_('C++ exception with description "Standard C++ exception"' ' thrown in TearDownTestCase()' in EX_BINARY_OUTPUT) def testCatchesCxxExceptionsInSetUp(self): self.assert_('C++ exception with description "Standard C++ exception"' ' thrown in SetUp()' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInSetUpTest::TearDownTestCase() ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInSetUpTest destructor ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInSetUpTest::TearDown() ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('unexpected' not in EX_BINARY_OUTPUT, 'This failure belongs in this test only if ' '"CxxExceptionInSetUpTest" (no quotes) ' 'appears on the same line as words "called unexpectedly"') def testCatchesCxxExceptionsInTearDown(self): self.assert_('C++ exception with description "Standard C++ exception"' ' thrown in TearDown()' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInTearDownTest::TearDownTestCase() ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInTearDownTest destructor ' 'called as expected.' in EX_BINARY_OUTPUT) def testCatchesCxxExceptionsInTestBody(self): self.assert_('C++ exception with description "Standard C++ exception"' ' thrown in the test body' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInTestBodyTest::TearDownTestCase() ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInTestBodyTest destructor ' 'called as expected.' in EX_BINARY_OUTPUT) self.assert_('CxxExceptionInTestBodyTest::TearDown() ' 'called as expected.' in EX_BINARY_OUTPUT) def testCatchesNonStdCxxExceptions(self): self.assert_('Unknown C++ exception thrown in the test body' in EX_BINARY_OUTPUT) def testUnhandledCxxExceptionsAbortTheProgram(self): # Filters out SEH exception tests on Windows. Unhandled SEH exceptions # cause tests to show pop-up windows there. FITLER_OUT_SEH_TESTS_FLAG = FILTER_FLAG + '=-*Seh*' # By default, Google Test doesn't catch the exceptions. uncaught_exceptions_ex_binary_output = gtest_test_utils.Subprocess( [EX_EXE_PATH, NO_CATCH_EXCEPTIONS_FLAG, FITLER_OUT_SEH_TESTS_FLAG], env=environ).output self.assert_('Unhandled C++ exception terminating the program' in uncaught_exceptions_ex_binary_output) self.assert_('unexpected' not in uncaught_exceptions_ex_binary_output) if __name__ == '__main__': gtest_test_utils.Main()
agpl-3.0
aman-iitj/scipy
scipy/spatial/tests/test_kdtree.py
15
24484
# Copyright Anne M. Archibald 2008 # Released under the scipy license from __future__ import division, print_function, absolute_import from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_, run_module_suite) import numpy as np from scipy.spatial import KDTree, Rectangle, distance_matrix, cKDTree from scipy.spatial.ckdtree import cKDTreeNode from scipy.spatial import minkowski_distance as distance class ConsistencyTests: def test_nearest(self): x = self.x d, i = self.kdtree.query(x, 1) assert_almost_equal(d**2,np.sum((x-self.data[i])**2)) eps = 1e-8 assert_(np.all(np.sum((self.data-x[np.newaxis,:])**2,axis=1) > d**2-eps)) def test_m_nearest(self): x = self.x m = self.m dd, ii = self.kdtree.query(x, m) d = np.amax(dd) i = ii[np.argmax(dd)] assert_almost_equal(d**2,np.sum((x-self.data[i])**2)) eps = 1e-8 assert_equal(np.sum(np.sum((self.data-x[np.newaxis,:])**2,axis=1) < d**2+eps),m) def test_points_near(self): x = self.x d = self.d dd, ii = self.kdtree.query(x, k=self.kdtree.n, distance_upper_bound=d) eps = 1e-8 hits = 0 for near_d, near_i in zip(dd,ii): if near_d == np.inf: continue hits += 1 assert_almost_equal(near_d**2,np.sum((x-self.data[near_i])**2)) assert_(near_d < d+eps, "near_d=%g should be less than %g" % (near_d,d)) assert_equal(np.sum(np.sum((self.data-x[np.newaxis,:])**2,axis=1) < d**2+eps),hits) def test_points_near_l1(self): x = self.x d = self.d dd, ii = self.kdtree.query(x, k=self.kdtree.n, p=1, distance_upper_bound=d) eps = 1e-8 hits = 0 for near_d, near_i in zip(dd,ii): if near_d == np.inf: continue hits += 1 assert_almost_equal(near_d,distance(x,self.data[near_i],1)) assert_(near_d < d+eps, "near_d=%g should be less than %g" % (near_d,d)) assert_equal(np.sum(distance(self.data,x,1) < d+eps),hits) def test_points_near_linf(self): x = self.x d = self.d dd, ii = self.kdtree.query(x, k=self.kdtree.n, p=np.inf, distance_upper_bound=d) eps = 1e-8 hits = 0 for near_d, near_i in zip(dd,ii): if near_d == np.inf: continue hits += 1 assert_almost_equal(near_d,distance(x,self.data[near_i],np.inf)) assert_(near_d < d+eps, "near_d=%g should be less than %g" % (near_d,d)) assert_equal(np.sum(distance(self.data,x,np.inf) < d+eps),hits) def test_approx(self): x = self.x k = self.k eps = 0.1 d_real, i_real = self.kdtree.query(x, k) d, i = self.kdtree.query(x, k, eps=eps) assert_(np.all(d <= d_real*(1+eps))) class test_random(ConsistencyTests): def setUp(self): self.n = 100 self.m = 4 np.random.seed(1234) self.data = np.random.randn(self.n, self.m) self.kdtree = KDTree(self.data,leafsize=2) self.x = np.random.randn(self.m) self.d = 0.2 self.k = 10 class test_random_far(test_random): def setUp(self): test_random.setUp(self) self.x = np.random.randn(self.m)+10 class test_small(ConsistencyTests): def setUp(self): self.data = np.array([[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]) self.kdtree = KDTree(self.data) self.n = self.kdtree.n self.m = self.kdtree.m np.random.seed(1234) self.x = np.random.randn(3) self.d = 0.5 self.k = 4 def test_nearest(self): assert_array_equal( self.kdtree.query((0,0,0.1), 1), (0.1,0)) def test_nearest_two(self): assert_array_equal( self.kdtree.query((0,0,0.1), 2), ([0.1,0.9],[0,1])) class test_small_nonleaf(test_small): def setUp(self): test_small.setUp(self) self.kdtree = KDTree(self.data,leafsize=1) class test_small_compiled(test_small): def setUp(self): test_small.setUp(self) self.kdtree = cKDTree(self.data) class test_small_nonleaf_compiled(test_small): def setUp(self): test_small.setUp(self) self.kdtree = cKDTree(self.data,leafsize=1) class test_random_compiled(test_random): def setUp(self): test_random.setUp(self) self.kdtree = cKDTree(self.data) class test_random_far_compiled(test_random_far): def setUp(self): test_random_far.setUp(self) self.kdtree = cKDTree(self.data) class test_vectorization: def setUp(self): self.data = np.array([[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]) self.kdtree = KDTree(self.data) def test_single_query(self): d, i = self.kdtree.query(np.array([0,0,0])) assert_(isinstance(d,float)) assert_(np.issubdtype(i, int)) def test_vectorized_query(self): d, i = self.kdtree.query(np.zeros((2,4,3))) assert_equal(np.shape(d),(2,4)) assert_equal(np.shape(i),(2,4)) def test_single_query_multiple_neighbors(self): s = 23 kk = self.kdtree.n+s d, i = self.kdtree.query(np.array([0,0,0]),k=kk) assert_equal(np.shape(d),(kk,)) assert_equal(np.shape(i),(kk,)) assert_(np.all(~np.isfinite(d[-s:]))) assert_(np.all(i[-s:] == self.kdtree.n)) def test_vectorized_query_multiple_neighbors(self): s = 23 kk = self.kdtree.n+s d, i = self.kdtree.query(np.zeros((2,4,3)),k=kk) assert_equal(np.shape(d),(2,4,kk)) assert_equal(np.shape(i),(2,4,kk)) assert_(np.all(~np.isfinite(d[:,:,-s:]))) assert_(np.all(i[:,:,-s:] == self.kdtree.n)) def test_single_query_all_neighbors(self): d, i = self.kdtree.query([0,0,0],k=None,distance_upper_bound=1.1) assert_(isinstance(d,list)) assert_(isinstance(i,list)) def test_vectorized_query_all_neighbors(self): d, i = self.kdtree.query(np.zeros((2,4,3)),k=None,distance_upper_bound=1.1) assert_equal(np.shape(d),(2,4)) assert_equal(np.shape(i),(2,4)) assert_(isinstance(d[0,0],list)) assert_(isinstance(i[0,0],list)) class test_vectorization_compiled: def setUp(self): self.data = np.array([[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]) self.kdtree = cKDTree(self.data) def test_single_query(self): d, i = self.kdtree.query([0,0,0]) assert_(isinstance(d,float)) assert_(isinstance(i,int)) def test_vectorized_query(self): d, i = self.kdtree.query(np.zeros((2,4,3))) assert_equal(np.shape(d),(2,4)) assert_equal(np.shape(i),(2,4)) def test_vectorized_query_noncontiguous_values(self): np.random.seed(1234) qs = np.random.randn(3,1000).T ds, i_s = self.kdtree.query(qs) for q, d, i in zip(qs,ds,i_s): assert_equal(self.kdtree.query(q),(d,i)) def test_single_query_multiple_neighbors(self): s = 23 kk = self.kdtree.n+s d, i = self.kdtree.query([0,0,0],k=kk) assert_equal(np.shape(d),(kk,)) assert_equal(np.shape(i),(kk,)) assert_(np.all(~np.isfinite(d[-s:]))) assert_(np.all(i[-s:] == self.kdtree.n)) def test_vectorized_query_multiple_neighbors(self): s = 23 kk = self.kdtree.n+s d, i = self.kdtree.query(np.zeros((2,4,3)),k=kk) assert_equal(np.shape(d),(2,4,kk)) assert_equal(np.shape(i),(2,4,kk)) assert_(np.all(~np.isfinite(d[:,:,-s:]))) assert_(np.all(i[:,:,-s:] == self.kdtree.n)) class ball_consistency: def test_in_ball(self): l = self.T.query_ball_point(self.x, self.d, p=self.p, eps=self.eps) for i in l: assert_(distance(self.data[i],self.x,self.p) <= self.d*(1.+self.eps)) def test_found_all(self): c = np.ones(self.T.n,dtype=np.bool) l = self.T.query_ball_point(self.x, self.d, p=self.p, eps=self.eps) c[l] = False assert_(np.all(distance(self.data[c],self.x,self.p) >= self.d/(1.+self.eps))) class test_random_ball(ball_consistency): def setUp(self): n = 100 m = 4 np.random.seed(1234) self.data = np.random.randn(n,m) self.T = KDTree(self.data,leafsize=2) self.x = np.random.randn(m) self.p = 2. self.eps = 0 self.d = 0.2 class test_random_ball_compiled(ball_consistency): def setUp(self): n = 100 m = 4 np.random.seed(1234) self.data = np.random.randn(n,m) self.T = cKDTree(self.data,leafsize=2) self.x = np.random.randn(m) self.p = 2. self.eps = 0 self.d = 0.2 class test_random_ball_approx(test_random_ball): def setUp(self): test_random_ball.setUp(self) self.eps = 0.1 class test_random_ball_approx_compiled(test_random_ball_compiled): def setUp(self): test_random_ball_compiled.setUp(self) self.eps = 0.1 class test_random_ball_far(test_random_ball): def setUp(self): test_random_ball.setUp(self) self.d = 2. class test_random_ball_far_compiled(test_random_ball_compiled): def setUp(self): test_random_ball_compiled.setUp(self) self.d = 2. class test_random_ball_l1(test_random_ball): def setUp(self): test_random_ball.setUp(self) self.p = 1 class test_random_ball_l1_compiled(test_random_ball_compiled): def setUp(self): test_random_ball_compiled.setUp(self) self.p = 1 class test_random_ball_linf(test_random_ball): def setUp(self): test_random_ball.setUp(self) self.p = np.inf class test_random_ball_linf_compiled(test_random_ball_compiled): def setUp(self): test_random_ball_compiled.setUp(self) self.p = np.inf def test_random_ball_vectorized(): n = 20 m = 5 T = KDTree(np.random.randn(n,m)) r = T.query_ball_point(np.random.randn(2,3,m),1) assert_equal(r.shape,(2,3)) assert_(isinstance(r[0,0],list)) def test_random_ball_vectorized_compiled(): n = 20 m = 5 np.random.seed(1234) T = cKDTree(np.random.randn(n,m)) r = T.query_ball_point(np.random.randn(2,3,m),1) assert_equal(r.shape,(2,3)) assert_(isinstance(r[0,0],list)) class two_trees_consistency: def test_all_in_ball(self): r = self.T1.query_ball_tree(self.T2, self.d, p=self.p, eps=self.eps) for i, l in enumerate(r): for j in l: assert_(distance(self.data1[i],self.data2[j],self.p) <= self.d*(1.+self.eps)) def test_found_all(self): r = self.T1.query_ball_tree(self.T2, self.d, p=self.p, eps=self.eps) for i, l in enumerate(r): c = np.ones(self.T2.n,dtype=np.bool) c[l] = False assert_(np.all(distance(self.data2[c],self.data1[i],self.p) >= self.d/(1.+self.eps))) class test_two_random_trees(two_trees_consistency): def setUp(self): n = 50 m = 4 np.random.seed(1234) self.data1 = np.random.randn(n,m) self.T1 = KDTree(self.data1,leafsize=2) self.data2 = np.random.randn(n,m) self.T2 = KDTree(self.data2,leafsize=2) self.p = 2. self.eps = 0 self.d = 0.2 class test_two_random_trees_compiled(two_trees_consistency): def setUp(self): n = 50 m = 4 np.random.seed(1234) self.data1 = np.random.randn(n,m) self.T1 = cKDTree(self.data1,leafsize=2) self.data2 = np.random.randn(n,m) self.T2 = cKDTree(self.data2,leafsize=2) self.p = 2. self.eps = 0 self.d = 0.2 class test_two_random_trees_far(test_two_random_trees): def setUp(self): test_two_random_trees.setUp(self) self.d = 2 class test_two_random_trees_far_compiled(test_two_random_trees_compiled): def setUp(self): test_two_random_trees_compiled.setUp(self) self.d = 2 class test_two_random_trees_linf(test_two_random_trees): def setUp(self): test_two_random_trees.setUp(self) self.p = np.inf class test_two_random_trees_linf_compiled(test_two_random_trees_compiled): def setUp(self): test_two_random_trees_compiled.setUp(self) self.p = np.inf class test_rectangle: def setUp(self): self.rect = Rectangle([0,0],[1,1]) def test_min_inside(self): assert_almost_equal(self.rect.min_distance_point([0.5,0.5]),0) def test_min_one_side(self): assert_almost_equal(self.rect.min_distance_point([0.5,1.5]),0.5) def test_min_two_sides(self): assert_almost_equal(self.rect.min_distance_point([2,2]),np.sqrt(2)) def test_max_inside(self): assert_almost_equal(self.rect.max_distance_point([0.5,0.5]),1/np.sqrt(2)) def test_max_one_side(self): assert_almost_equal(self.rect.max_distance_point([0.5,1.5]),np.hypot(0.5,1.5)) def test_max_two_sides(self): assert_almost_equal(self.rect.max_distance_point([2,2]),2*np.sqrt(2)) def test_split(self): less, greater = self.rect.split(0,0.1) assert_array_equal(less.maxes,[0.1,1]) assert_array_equal(less.mins,[0,0]) assert_array_equal(greater.maxes,[1,1]) assert_array_equal(greater.mins,[0.1,0]) def test_distance_l2(): assert_almost_equal(distance([0,0],[1,1],2),np.sqrt(2)) def test_distance_l1(): assert_almost_equal(distance([0,0],[1,1],1),2) def test_distance_linf(): assert_almost_equal(distance([0,0],[1,1],np.inf),1) def test_distance_vectorization(): np.random.seed(1234) x = np.random.randn(10,1,3) y = np.random.randn(1,7,3) assert_equal(distance(x,y).shape,(10,7)) class test_count_neighbors: def setUp(self): n = 50 m = 2 np.random.seed(1234) self.T1 = KDTree(np.random.randn(n,m),leafsize=2) self.T2 = KDTree(np.random.randn(n,m),leafsize=2) def test_one_radius(self): r = 0.2 assert_equal(self.T1.count_neighbors(self.T2, r), np.sum([len(l) for l in self.T1.query_ball_tree(self.T2,r)])) def test_large_radius(self): r = 1000 assert_equal(self.T1.count_neighbors(self.T2, r), np.sum([len(l) for l in self.T1.query_ball_tree(self.T2,r)])) def test_multiple_radius(self): rs = np.exp(np.linspace(np.log(0.01),np.log(10),3)) results = self.T1.count_neighbors(self.T2, rs) assert_(np.all(np.diff(results) >= 0)) for r,result in zip(rs, results): assert_equal(self.T1.count_neighbors(self.T2, r), result) class test_count_neighbors_compiled: def setUp(self): n = 50 m = 2 np.random.seed(1234) self.T1 = cKDTree(np.random.randn(n,m),leafsize=2) self.T2 = cKDTree(np.random.randn(n,m),leafsize=2) def test_one_radius(self): r = 0.2 assert_equal(self.T1.count_neighbors(self.T2, r), np.sum([len(l) for l in self.T1.query_ball_tree(self.T2,r)])) def test_large_radius(self): r = 1000 assert_equal(self.T1.count_neighbors(self.T2, r), np.sum([len(l) for l in self.T1.query_ball_tree(self.T2,r)])) def test_multiple_radius(self): rs = np.exp(np.linspace(np.log(0.01),np.log(10),3)) results = self.T1.count_neighbors(self.T2, rs) assert_(np.all(np.diff(results) >= 0)) for r,result in zip(rs, results): assert_equal(self.T1.count_neighbors(self.T2, r), result) class test_sparse_distance_matrix: def setUp(self): n = 50 m = 4 np.random.seed(1234) self.T1 = KDTree(np.random.randn(n,m),leafsize=2) self.T2 = KDTree(np.random.randn(n,m),leafsize=2) self.r = 0.5 def test_consistency_with_neighbors(self): M = self.T1.sparse_distance_matrix(self.T2, self.r) r = self.T1.query_ball_tree(self.T2, self.r) for i,l in enumerate(r): for j in l: assert_almost_equal(M[i,j], distance(self.T1.data[i], self.T2.data[j]), decimal=14) for ((i,j),d) in M.items(): assert_(j in r[i]) def test_zero_distance(self): # raises an exception for bug 870 self.T1.sparse_distance_matrix(self.T1, self.r) class test_sparse_distance_matrix_compiled: def setUp(self): n = 50 m = 4 np.random.seed(0) data1 = np.random.randn(n,m) data2 = np.random.randn(n,m) self.T1 = cKDTree(data1,leafsize=2) self.T2 = cKDTree(data2,leafsize=2) self.ref_T1 = KDTree(data1, leafsize=2) self.ref_T2 = KDTree(data2, leafsize=2) self.r = 0.5 def test_consistency_with_neighbors(self): M = self.T1.sparse_distance_matrix(self.T2, self.r) r = self.T1.query_ball_tree(self.T2, self.r) for i,l in enumerate(r): for j in l: assert_almost_equal(M[i,j], distance(self.T1.data[i], self.T2.data[j]), decimal=14) for ((i,j),d) in M.items(): assert_(j in r[i]) def test_zero_distance(self): # raises an exception for bug 870 (FIXME: Does it?) self.T1.sparse_distance_matrix(self.T1, self.r) def test_consistency_with_python(self): M1 = self.T1.sparse_distance_matrix(self.T2, self.r) M2 = self.ref_T1.sparse_distance_matrix(self.ref_T2, self.r) assert_array_almost_equal(M1.todense(), M2.todense(), decimal=14) def test_distance_matrix(): m = 10 n = 11 k = 4 np.random.seed(1234) xs = np.random.randn(m,k) ys = np.random.randn(n,k) ds = distance_matrix(xs,ys) assert_equal(ds.shape, (m,n)) for i in range(m): for j in range(n): assert_almost_equal(distance(xs[i],ys[j]),ds[i,j]) def test_distance_matrix_looping(): m = 10 n = 11 k = 4 np.random.seed(1234) xs = np.random.randn(m,k) ys = np.random.randn(n,k) ds = distance_matrix(xs,ys) dsl = distance_matrix(xs,ys,threshold=1) assert_equal(ds,dsl) def check_onetree_query(T,d): r = T.query_ball_tree(T, d) s = set() for i, l in enumerate(r): for j in l: if i < j: s.add((i,j)) assert_(s == T.query_pairs(d)) def test_onetree_query(): np.random.seed(0) n = 50 k = 4 points = np.random.randn(n,k) T = KDTree(points) yield check_onetree_query, T, 0.1 points = np.random.randn(3*n,k) points[:n] *= 0.001 points[n:2*n] += 2 T = KDTree(points) yield check_onetree_query, T, 0.1 yield check_onetree_query, T, 0.001 yield check_onetree_query, T, 0.00001 yield check_onetree_query, T, 1e-6 def test_onetree_query_compiled(): np.random.seed(0) n = 100 k = 4 points = np.random.randn(n,k) T = cKDTree(points) yield check_onetree_query, T, 0.1 points = np.random.randn(3*n,k) points[:n] *= 0.001 points[n:2*n] += 2 T = cKDTree(points) yield check_onetree_query, T, 0.1 yield check_onetree_query, T, 0.001 yield check_onetree_query, T, 0.00001 yield check_onetree_query, T, 1e-6 def test_query_pairs_single_node(): tree = KDTree([[0, 1]]) assert_equal(tree.query_pairs(0.5), set()) def test_query_pairs_single_node_compiled(): tree = cKDTree([[0, 1]]) assert_equal(tree.query_pairs(0.5), set()) def test_ball_point_ints(): # Regression test for #1373. x, y = np.mgrid[0:4, 0:4] points = list(zip(x.ravel(), y.ravel())) tree = KDTree(points) assert_equal(sorted([4, 8, 9, 12]), sorted(tree.query_ball_point((2, 0), 1))) points = np.asarray(points, dtype=np.float) tree = KDTree(points) assert_equal(sorted([4, 8, 9, 12]), sorted(tree.query_ball_point((2, 0), 1))) def test_kdtree_comparisons(): # Regression test: node comparisons were done wrong in 0.12 w/Py3. nodes = [KDTree.node() for _ in range(3)] assert_equal(sorted(nodes), sorted(nodes[::-1])) def test_ckdtree_build_modes(): # check if different build modes for cKDTree give # similar query results np.random.seed(0) n = 5000 k = 4 points = np.random.randn(n, k) T1 = cKDTree(points).query(points, k=5)[-1] T2 = cKDTree(points, compact_nodes=False).query(points, k=5)[-1] T3 = cKDTree(points, balanced_tree=False).query(points, k=5)[-1] T4 = cKDTree(points, compact_nodes=False, balanced_tree=False).query(points, k=5)[-1] assert_array_equal(T1, T2) assert_array_equal(T1, T3) assert_array_equal(T1, T4) def test_ckdtree_pickle(): # test if it is possible to pickle # a cKDTree try: import cPickle # known failure on Python 2 # pickle currently only supported on Python 3 cPickle.dumps('pyflakes dummy') except ImportError: import pickle np.random.seed(0) n = 50 k = 4 points = np.random.randn(n, k) T1 = cKDTree(points) tmp = pickle.dumps(T1) T2 = pickle.loads(tmp) T1 = T1.query(points, k=5)[-1] T2 = T2.query(points, k=5)[-1] assert_array_equal(T1, T2) def test_ckdtree_copy_data(): # check if copy_data=True makes the kd-tree # impervious to data corruption by modification of # the data arrray np.random.seed(0) n = 5000 k = 4 points = np.random.randn(n, k) T = cKDTree(points, copy_data=True) q = points.copy() T1 = T.query(q, k=5)[-1] points[...] = np.random.randn(n, k) T2 = T.query(q, k=5)[-1] assert_array_equal(T1, T2) def test_ckdtree_parallel(): # check if parallel=True also generates correct # query results np.random.seed(0) n = 5000 k = 4 points = np.random.randn(n, k) T = cKDTree(points) T1 = T.query(points, k=5, n_jobs=64)[-1] T2 = T.query(points, k=5, n_jobs=-1)[-1] T3 = T.query(points, k=5)[-1] assert_array_equal(T1, T2) assert_array_equal(T1, T3) def test_ckdtree_view(): # Check that the nodes can be correctly viewed from Python. # This test also sanity checks each node in the cKDTree, and # thus verifies the internal structure of the kd-tree. np.random.seed(0) n = 100 k = 4 points = np.random.randn(n, k) kdtree = cKDTree(points) # walk the whole kd-tree and sanity check each node def recurse_tree(n): assert_(isinstance(n, cKDTreeNode)) if n.split_dim == -1: assert_(n.lesser is None) assert_(n.greater is None) assert_(n.indices.shape[0] <= kdtree.leafsize) else: recurse_tree(n.lesser) recurse_tree(n.greater) x = n.lesser.data_points[:, n.split_dim] y = n.greater.data_points[:, n.split_dim] assert_(x.max() < y.min()) recurse_tree(kdtree.tree) # check that indices are correctly retreived n = kdtree.tree assert_array_equal(np.sort(n.indices), range(100)) # check that data_points are correctly retreived assert_array_equal(kdtree.data[n.indices, :], n.data_points) # cKDTree is specialized to type double points, so no need to make # a unit test corresponding to test_ball_point_ints() if __name__ == "__main__": run_module_suite()
bsd-3-clause
TheTeaRex/cmpe281_mongoserver
node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
1417
12751
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os import re import shutil import subprocess import stat import string import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # A regex matching an argument corresponding to the output filename passed to # link.exe. _LINK_EXE_OUT_ARG = re.compile('/OUT:(?P<out>.+)$', re.IGNORECASE) def main(args): executor = WinTool() exit_code = executor.Dispatch(args) if exit_code is not None: sys.exit(exit_code) class WinTool(object): """This class performs all the Windows tooling steps. The methods can either be executed directly, or dispatched from an argument list.""" def _UseSeparateMspdbsrv(self, env, args): """Allows to use a unique instance of mspdbsrv.exe per linker instead of a shared one.""" if len(args) < 1: raise Exception("Not enough arguments") if args[0] != 'link.exe': return # Use the output filename passed to the linker to generate an endpoint name # for mspdbsrv.exe. endpoint_name = None for arg in args: m = _LINK_EXE_OUT_ARG.match(arg) if m: endpoint_name = re.sub(r'\W+', '', '%s_%d' % (m.group('out'), os.getpid())) break if endpoint_name is None: return # Adds the appropriate environment variable. This will be read by link.exe # to know which instance of mspdbsrv.exe it should connect to (if it's # not set then the default endpoint is used). env['_MSPDBSRV_ENDPOINT_'] = endpoint_name def Dispatch(self, args): """Dispatches a string command to a method.""" if len(args) < 1: raise Exception("Not enough arguments") method = "Exec%s" % self._CommandifyName(args[0]) return getattr(self, method)(*args[1:]) def _CommandifyName(self, name_string): """Transforms a tool name like recursive-mirror to RecursiveMirror.""" return name_string.title().replace('-', '') def _GetEnv(self, arch): """Gets the saved environment from a file for a given architecture.""" # The environment is saved as an "environment block" (see CreateProcess # and msvs_emulation for details). We convert to a dict here. # Drop last 2 NULs, one for list terminator, one for trailing vs. separator. pairs = open(arch).read()[:-2].split('\0') kvs = [item.split('=', 1) for item in pairs] return dict(kvs) def ExecStamp(self, path): """Simple stamp command.""" open(path, 'w').close() def ExecRecursiveMirror(self, source, dest): """Emulation of rm -rf out && cp -af in out.""" if os.path.exists(dest): if os.path.isdir(dest): def _on_error(fn, path, excinfo): # The operation failed, possibly because the file is set to # read-only. If that's why, make it writable and try the op again. if not os.access(path, os.W_OK): os.chmod(path, stat.S_IWRITE) fn(path) shutil.rmtree(dest, onerror=_on_error) else: if not os.access(dest, os.W_OK): # Attempt to make the file writable before deleting it. os.chmod(dest, stat.S_IWRITE) os.unlink(dest) if os.path.isdir(source): shutil.copytree(source, dest) else: shutil.copy2(source, dest) def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): """Filter diagnostic output from link that looks like: ' Creating library ui.dll.lib and object ui.dll.exp' This happens when there are exports from the dll or exe. """ env = self._GetEnv(arch) if use_separate_mspdbsrv == 'True': self._UseSeparateMspdbsrv(env, args) link = subprocess.Popen([args[0].replace('/', '\\')] + list(args[1:]), shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _ = link.communicate() for line in out.splitlines(): if (not line.startswith(' Creating library ') and not line.startswith('Generating code') and not line.startswith('Finished generating code')): print line return link.returncode def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, mt, rc, intermediate_manifest, *manifests): """A wrapper for handling creating a manifest resource and then executing a link command.""" # The 'normal' way to do manifests is to have link generate a manifest # based on gathering dependencies from the object files, then merge that # manifest with other manifests supplied as sources, convert the merged # manifest to a resource, and then *relink*, including the compiled # version of the manifest resource. This breaks incremental linking, and # is generally overly complicated. Instead, we merge all the manifests # provided (along with one that includes what would normally be in the # linker-generated one, see msvs_emulation.py), and include that into the # first and only link. We still tell link to generate a manifest, but we # only use that to assert that our simpler process did not miss anything. variables = { 'python': sys.executable, 'arch': arch, 'out': out, 'ldcmd': ldcmd, 'resname': resname, 'mt': mt, 'rc': rc, 'intermediate_manifest': intermediate_manifest, 'manifests': ' '.join(manifests), } add_to_ld = '' if manifests: subprocess.check_call( '%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo ' '-manifest %(manifests)s -out:%(out)s.manifest' % variables) if embed_manifest == 'True': subprocess.check_call( '%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest' ' %(out)s.manifest.rc %(resname)s' % variables) subprocess.check_call( '%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s ' '%(out)s.manifest.rc' % variables) add_to_ld = ' %(out)s.manifest.res' % variables subprocess.check_call(ldcmd + add_to_ld) # Run mt.exe on the theoretically complete manifest we generated, merging # it with the one the linker generated to confirm that the linker # generated one does not add anything. This is strictly unnecessary for # correctness, it's only to verify that e.g. /MANIFESTDEPENDENCY was not # used in a #pragma comment. if manifests: # Merge the intermediate one with ours to .assert.manifest, then check # that .assert.manifest is identical to ours. subprocess.check_call( '%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo ' '-manifest %(out)s.manifest %(intermediate_manifest)s ' '-out:%(out)s.assert.manifest' % variables) assert_manifest = '%(out)s.assert.manifest' % variables our_manifest = '%(out)s.manifest' % variables # Load and normalize the manifests. mt.exe sometimes removes whitespace, # and sometimes doesn't unfortunately. with open(our_manifest, 'rb') as our_f: with open(assert_manifest, 'rb') as assert_f: our_data = our_f.read().translate(None, string.whitespace) assert_data = assert_f.read().translate(None, string.whitespace) if our_data != assert_data: os.unlink(out) def dump(filename): sys.stderr.write('%s\n-----\n' % filename) with open(filename, 'rb') as f: sys.stderr.write(f.read() + '\n-----\n') dump(intermediate_manifest) dump(our_manifest) dump(assert_manifest) sys.stderr.write( 'Linker generated manifest "%s" added to final manifest "%s" ' '(result in "%s"). ' 'Were /MANIFEST switches used in #pragma statements? ' % ( intermediate_manifest, our_manifest, assert_manifest)) return 1 def ExecManifestWrapper(self, arch, *args): """Run manifest tool with environment set. Strip out undesirable warning (some XML blocks are recognized by the OS loader, but not the manifest tool).""" env = self._GetEnv(arch) popen = subprocess.Popen(args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _ = popen.communicate() for line in out.splitlines(): if line and 'manifest authoring warning 81010002' not in line: print line return popen.returncode def ExecManifestToRc(self, arch, *args): """Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).""" manifest_path, resource_path, resource_name = args with open(resource_path, 'wb') as output: output.write('#include <windows.h>\n%s RT_MANIFEST "%s"' % ( resource_name, os.path.abspath(manifest_path).replace('\\', '/'))) def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, *flags): """Filter noisy filenames output from MIDL compile step that isn't quietable via command line flags. """ args = ['midl', '/nologo'] + list(flags) + [ '/out', outdir, '/tlb', tlb, '/h', h, '/dlldata', dlldata, '/iid', iid, '/proxy', proxy, idl] env = self._GetEnv(arch) popen = subprocess.Popen(args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _ = popen.communicate() # Filter junk out of stdout, and write filtered versions. Output we want # to filter is pairs of lines that look like this: # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl # objidl.idl lines = out.splitlines() prefixes = ('Processing ', '64 bit Processing ') processing = set(os.path.basename(x) for x in lines if x.startswith(prefixes)) for line in lines: if not line.startswith(prefixes) and line not in processing: print line return popen.returncode def ExecAsmWrapper(self, arch, *args): """Filter logo banner from invocations of asm.exe.""" env = self._GetEnv(arch) popen = subprocess.Popen(args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _ = popen.communicate() for line in out.splitlines(): if (not line.startswith('Copyright (C) Microsoft Corporation') and not line.startswith('Microsoft (R) Macro Assembler') and not line.startswith(' Assembling: ') and line): print line return popen.returncode def ExecRcWrapper(self, arch, *args): """Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.""" env = self._GetEnv(arch) popen = subprocess.Popen(args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _ = popen.communicate() for line in out.splitlines(): if (not line.startswith('Microsoft (R) Windows (R) Resource Compiler') and not line.startswith('Copyright (C) Microsoft Corporation') and line): print line return popen.returncode def ExecActionWrapper(self, arch, rspfile, *dir): """Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.""" env = self._GetEnv(arch) # TODO(scottmg): This is a temporary hack to get some specific variables # through to actions that are set after gyp-time. http://crbug.com/333738. for k, v in os.environ.iteritems(): if k not in env: env[k] = v args = open(rspfile).read() dir = dir[0] if dir else None return subprocess.call(args, shell=True, env=env, cwd=dir) def ExecClCompile(self, project_dir, selected_files): """Executed by msvs-ninja projects when the 'ClCompile' target is used to build selected C/C++ files.""" project_dir = os.path.relpath(project_dir, BASE_DIR) selected_files = selected_files.split(';') ninja_targets = [os.path.join(project_dir, filename) + '^^' for filename in selected_files] cmd = ['ninja.exe'] cmd.extend(ninja_targets) return subprocess.call(cmd, shell=True, cwd=BASE_DIR) if __name__ == '__main__': sys.exit(main(sys.argv[1:]))
gpl-2.0
houstar/libnl
python/netlink/route/qdisc/htb.py
35
3608
# # Copyright (c) 2011 Thomas Graf <[email protected]> # """HTB qdisc """ from __future__ import absolute_import from ... import core as netlink from ... import util as util from .. import capi as capi from .. import tc as tc class HTBQdisc(object): def __init__(self, qdisc): self._qdisc = qdisc @property @netlink.nlattr(type=int) def default_class(self): return tc.Handle(capi.rtnl_htb_get_defcls(self._qdisc._rtnl_qdisc)) @default_class.setter def default_class(self, value): capi.rtnl_htb_set_defcls(self._qdisc._rtnl_qdisc, int(value)) @property @netlink.nlattr('r2q', type=int) def r2q(self): return capi.rtnl_htb_get_rate2quantum(self._qdisc._rtnl_qdisc) @r2q.setter def r2q(self, value): capi.rtnl_htb_get_rate2quantum(self._qdisc._rtnl_qdisc, int(value)) def brief(self): fmt = util.MyFormatter(self) ret = ' {s|default-class!k} {a|default_class}' if self.r2q: ret += ' {s|r2q!k} {a|r2q}' return fmt.format(ret) class HTBClass(object): def __init__(self, cl): self._class = cl @property @netlink.nlattr(type=str) def rate(self): rate = capi.rtnl_htb_get_rate(self._class._rtnl_class) return util.Rate(rate) @rate.setter def rate(self, value): capi.rtnl_htb_set_rate(self._class._rtnl_class, int(value)) @property @netlink.nlattr(type=str) def ceil(self): ceil = capi.rtnl_htb_get_ceil(self._class._rtnl_class) return util.Rate(ceil) @ceil.setter def ceil(self, value): capi.rtnl_htb_set_ceil(self._class._rtnl_class, int(value)) @property @netlink.nlattr(type=str) def burst(self): burst = capi.rtnl_htb_get_rbuffer(self._class._rtnl_class) return util.Size(burst) @burst.setter def burst(self, value): capi.rtnl_htb_set_rbuffer(self._class._rtnl_class, int(value)) @property @netlink.nlattr(type=str) def ceil_burst(self): burst = capi.rtnl_htb_get_cbuffer(self._class._rtnl_class) return util.Size(burst) @ceil_burst.setter def ceil_burst(self, value): capi.rtnl_htb_set_cbuffer(self._class._rtnl_class, int(value)) @property @netlink.nlattr(type=int) def prio(self): return capi.rtnl_htb_get_prio(self._class._rtnl_class) @prio.setter def prio(self, value): capi.rtnl_htb_set_prio(self._class._rtnl_class, int(value)) @property @netlink.nlattr(type=int) def quantum(self): return capi.rtnl_htb_get_quantum(self._class._rtnl_class) @quantum.setter def quantum(self, value): capi.rtnl_htb_set_quantum(self._class._rtnl_class, int(value)) @property @netlink.nlattr(type=int) def level(self): return capi.rtnl_htb_get_level(self._class._rtnl_class) @level.setter def level(self, value): capi.rtnl_htb_set_level(self._class._rtnl_class, int(value)) def brief(self): fmt = util.MyFormatter(self) ret = ' {t|prio} {t|rate}' if self.rate != self.ceil: ret += ' {s|borrow-up-to!k} {a|ceil}' ret += ' {t|burst}' return fmt.format(ret) def details(self): fmt = util.MyFormatter(self) return fmt.nl('\t{t|level} {t|quantum}') def init_qdisc(qdisc): qdisc.htb = HTBQdisc(qdisc) return qdisc.htb def init_class(cl): cl.htb = HTBClass(cl) return cl.htb #extern void rtnl_htb_set_quantum(struct rtnl_class *, uint32_t quantum);
lgpl-2.1
tudorvio/tempest
tempest/services/data_processing/v1_1/data_processing_client.py
9
10364
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_serialization import jsonutils as json from tempest.common import service_client class DataProcessingClient(service_client.ServiceClient): def _request_and_check_resp(self, request_func, uri, resp_status): """Make a request using specified request_func and check response status code. It returns a ResponseBody. """ resp, body = request_func(uri) self.expected_success(resp_status, resp.status) return service_client.ResponseBody(resp, body) def _request_and_check_resp_data(self, request_func, uri, resp_status): """Make a request using specified request_func and check response status code. It returns pair: resp and response data. """ resp, body = request_func(uri) self.expected_success(resp_status, resp.status) return resp, body def _request_check_and_parse_resp(self, request_func, uri, resp_status, *args, **kwargs): """Make a request using specified request_func, check response status code and parse response body. It returns a ResponseBody. """ headers = {'Content-Type': 'application/json'} resp, body = request_func(uri, headers=headers, *args, **kwargs) self.expected_success(resp_status, resp.status) body = json.loads(body) return service_client.ResponseBody(resp, body) def list_node_group_templates(self): """List all node group templates for a user.""" uri = 'node-group-templates' return self._request_check_and_parse_resp(self.get, uri, 200) def get_node_group_template(self, tmpl_id): """Returns the details of a single node group template.""" uri = 'node-group-templates/%s' % tmpl_id return self._request_check_and_parse_resp(self.get, uri, 200) def create_node_group_template(self, name, plugin_name, hadoop_version, node_processes, flavor_id, node_configs=None, **kwargs): """Creates node group template with specified params. It supports passing additional params using kwargs and returns created object. """ uri = 'node-group-templates' body = kwargs.copy() body.update({ 'name': name, 'plugin_name': plugin_name, 'hadoop_version': hadoop_version, 'node_processes': node_processes, 'flavor_id': flavor_id, 'node_configs': node_configs or dict(), }) return self._request_check_and_parse_resp(self.post, uri, 202, body=json.dumps(body)) def delete_node_group_template(self, tmpl_id): """Deletes the specified node group template by id.""" uri = 'node-group-templates/%s' % tmpl_id return self._request_and_check_resp(self.delete, uri, 204) def list_plugins(self): """List all enabled plugins.""" uri = 'plugins' return self._request_check_and_parse_resp(self.get, uri, 200) def get_plugin(self, plugin_name, plugin_version=None): """Returns the details of a single plugin.""" uri = 'plugins/%s' % plugin_name if plugin_version: uri += '/%s' % plugin_version return self._request_check_and_parse_resp(self.get, uri, 200) def list_cluster_templates(self): """List all cluster templates for a user.""" uri = 'cluster-templates' return self._request_check_and_parse_resp(self.get, uri, 200) def get_cluster_template(self, tmpl_id): """Returns the details of a single cluster template.""" uri = 'cluster-templates/%s' % tmpl_id return self._request_check_and_parse_resp(self.get, uri, 200) def create_cluster_template(self, name, plugin_name, hadoop_version, node_groups, cluster_configs=None, **kwargs): """Creates cluster template with specified params. It supports passing additional params using kwargs and returns created object. """ uri = 'cluster-templates' body = kwargs.copy() body.update({ 'name': name, 'plugin_name': plugin_name, 'hadoop_version': hadoop_version, 'node_groups': node_groups, 'cluster_configs': cluster_configs or dict(), }) return self._request_check_and_parse_resp(self.post, uri, 202, body=json.dumps(body)) def delete_cluster_template(self, tmpl_id): """Deletes the specified cluster template by id.""" uri = 'cluster-templates/%s' % tmpl_id return self._request_and_check_resp(self.delete, uri, 204) def list_data_sources(self): """List all data sources for a user.""" uri = 'data-sources' return self._request_check_and_parse_resp(self.get, uri, 200) def get_data_source(self, source_id): """Returns the details of a single data source.""" uri = 'data-sources/%s' % source_id return self._request_check_and_parse_resp(self.get, uri, 200) def create_data_source(self, name, data_source_type, url, **kwargs): """Creates data source with specified params. It supports passing additional params using kwargs and returns created object. """ uri = 'data-sources' body = kwargs.copy() body.update({ 'name': name, 'type': data_source_type, 'url': url }) return self._request_check_and_parse_resp(self.post, uri, 202, body=json.dumps(body)) def delete_data_source(self, source_id): """Deletes the specified data source by id.""" uri = 'data-sources/%s' % source_id return self._request_and_check_resp(self.delete, uri, 204) def list_job_binary_internals(self): """List all job binary internals for a user.""" uri = 'job-binary-internals' return self._request_check_and_parse_resp(self.get, uri, 200) def get_job_binary_internal(self, job_binary_id): """Returns the details of a single job binary internal.""" uri = 'job-binary-internals/%s' % job_binary_id return self._request_check_and_parse_resp(self.get, uri, 200) def create_job_binary_internal(self, name, data): """Creates job binary internal with specified params.""" uri = 'job-binary-internals/%s' % name return self._request_check_and_parse_resp(self.put, uri, 202, data) def delete_job_binary_internal(self, job_binary_id): """Deletes the specified job binary internal by id.""" uri = 'job-binary-internals/%s' % job_binary_id return self._request_and_check_resp(self.delete, uri, 204) def get_job_binary_internal_data(self, job_binary_id): """Returns data of a single job binary internal.""" uri = 'job-binary-internals/%s/data' % job_binary_id return self._request_and_check_resp_data(self.get, uri, 200) def list_job_binaries(self): """List all job binaries for a user.""" uri = 'job-binaries' return self._request_check_and_parse_resp(self.get, uri, 200) def get_job_binary(self, job_binary_id): """Returns the details of a single job binary.""" uri = 'job-binaries/%s' % job_binary_id return self._request_check_and_parse_resp(self.get, uri, 200) def create_job_binary(self, name, url, extra=None, **kwargs): """Creates job binary with specified params. It supports passing additional params using kwargs and returns created object. """ uri = 'job-binaries' body = kwargs.copy() body.update({ 'name': name, 'url': url, 'extra': extra or dict(), }) return self._request_check_and_parse_resp(self.post, uri, 202, body=json.dumps(body)) def delete_job_binary(self, job_binary_id): """Deletes the specified job binary by id.""" uri = 'job-binaries/%s' % job_binary_id return self._request_and_check_resp(self.delete, uri, 204) def get_job_binary_data(self, job_binary_id): """Returns data of a single job binary.""" uri = 'job-binaries/%s/data' % job_binary_id return self._request_and_check_resp_data(self.get, uri, 200) def list_jobs(self): """List all jobs for a user.""" uri = 'jobs' return self._request_check_and_parse_resp(self.get, uri, 200) def get_job(self, job_id): """Returns the details of a single job.""" uri = 'jobs/%s' % job_id return self._request_check_and_parse_resp(self.get, uri, 200) def create_job(self, name, job_type, mains, libs=None, **kwargs): """Creates job with specified params. It supports passing additional params using kwargs and returns created object. """ uri = 'jobs' body = kwargs.copy() body.update({ 'name': name, 'type': job_type, 'mains': mains, 'libs': libs or list(), }) return self._request_check_and_parse_resp(self.post, uri, 202, body=json.dumps(body)) def delete_job(self, job_id): """Deletes the specified job by id.""" uri = 'jobs/%s' % job_id return self._request_and_check_resp(self.delete, uri, 204)
apache-2.0
sniperyen/MyDjango
Lib/crispy_forms/templatetags/crispy_forms_field.py
11
5690
try: from itertools import izip except ImportError: izip = zip import django from django import forms from django import template from django.template import loader, Context from django.conf import settings from crispy_forms.utils import TEMPLATE_PACK, get_template_pack register = template.Library() @register.filter def is_checkbox(field): return isinstance(field.field.widget, forms.CheckboxInput) @register.filter def is_password(field): return isinstance(field.field.widget, forms.PasswordInput) @register.filter def is_radioselect(field): return isinstance(field.field.widget, forms.RadioSelect) @register.filter def is_select(field): return isinstance(field.field.widget, forms.Select) @register.filter def is_checkboxselectmultiple(field): return isinstance(field.field.widget, forms.CheckboxSelectMultiple) @register.filter def is_file(field): return isinstance(field.field.widget, forms.ClearableFileInput) @register.filter def classes(field): """ Returns CSS classes of a field """ return field.widget.attrs.get('class', None) @register.filter def css_class(field): """ Returns widgets class name in lowercase """ return field.field.widget.__class__.__name__.lower() def pairwise(iterable): """s -> (s0,s1), (s2,s3), (s4, s5), ...""" a = iter(iterable) return izip(a, a) class CrispyFieldNode(template.Node): def __init__(self, field, attrs): self.field = field self.attrs = attrs self.html5_required = 'html5_required' def render(self, context): # Nodes are not threadsafe so we must store and look up our instance # variables in the current rendering context first if self not in context.render_context: context.render_context[self] = ( template.Variable(self.field), self.attrs, template.Variable(self.html5_required) ) field, attrs, html5_required = context.render_context[self] field = field.resolve(context) try: html5_required = html5_required.resolve(context) except template.VariableDoesNotExist: html5_required = False # If template pack has been overridden in FormHelper we can pick it from context template_pack = context.get('template_pack', TEMPLATE_PACK) widgets = getattr(field.field.widget, 'widgets', [field.field.widget]) if isinstance(attrs, dict): attrs = [attrs] * len(widgets) converters = { 'textinput': 'textinput textInput', 'fileinput': 'fileinput fileUpload', 'passwordinput': 'textinput textInput', } converters.update(getattr(settings, 'CRISPY_CLASS_CONVERTERS', {})) for widget, attr in zip(widgets, attrs): class_name = widget.__class__.__name__.lower() class_name = converters.get(class_name, class_name) css_class = widget.attrs.get('class', '') if css_class: if css_class.find(class_name) == -1: css_class += " %s" % class_name else: css_class = class_name if ( template_pack in ['bootstrap3', 'bootstrap4'] and not is_checkbox(field) and not is_file(field) ): css_class += ' form-control' if field.errors: css_class += ' form-control-danger' widget.attrs['class'] = css_class # HTML5 required attribute if html5_required and field.field.required and 'required' not in widget.attrs: if field.field.widget.__class__.__name__ is not 'RadioSelect': widget.attrs['required'] = 'required' for attribute_name, attribute in attr.items(): attribute_name = template.Variable(attribute_name).resolve(context) if attribute_name in widget.attrs: widget.attrs[attribute_name] += " " + template.Variable(attribute).resolve(context) else: widget.attrs[attribute_name] = template.Variable(attribute).resolve(context) return field @register.tag(name="crispy_field") def crispy_field(parser, token): """ {% crispy_field field attrs %} """ token = token.split_contents() field = token.pop(1) attrs = {} # We need to pop tag name, or pairwise would fail token.pop(0) for attribute_name, value in pairwise(token): attrs[attribute_name] = value return CrispyFieldNode(field, attrs) @register.simple_tag() def crispy_addon(field, append="", prepend="", form_show_labels=True): """ Renders a form field using bootstrap's prepended or appended text:: {% crispy_addon form.my_field prepend="$" append=".00" %} You can also just prepend or append like so {% crispy_addon form.my_field prepend="$" %} {% crispy_addon form.my_field append=".00" %} """ if field: context = Context({ 'field': field, 'form_show_errors': True, 'form_show_labels': form_show_labels, }) template = loader.get_template('%s/layout/prepended_appended_text.html' % get_template_pack()) context['crispy_prepended_text'] = prepend context['crispy_appended_text'] = append if not prepend and not append: raise TypeError("Expected a prepend and/or append argument") if django.VERSION >= (1, 8): context = context.flatten() return template.render(context)
apache-2.0
gitseagull/pox
pox/log/color.py
26
5403
# Copyright 2011 James McCauley # # This file is part of POX. # # POX is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # POX is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with POX. If not, see <http://www.gnu.org/licenses/>. # NOTE: Not platform independent -- uses VT escape codes # Magic sequence used to introduce a command or color MAGIC = "@@@" # Colors for log levels LEVEL_COLORS = { 'DEBUG': 'CYAN', 'INFO': 'GREEN', 'WARNING': 'YELLOW', 'ERROR': 'RED', 'CRITICAL': 'blink@@@RED', } # Will get set to True if module is initialized enabled = False # Gets set to True if we should strip special sequences but # not actually try to colorize _strip_only = False import logging import sys # Name to (intensity, base_value) (more colors added later) COLORS = { 'black' : (0,0), 'red' : (0,1), 'green' : (0,2), 'yellow' : (0,3), 'blue' : (0,4), 'magenta' : (0,5), 'cyan' : (0,6), 'gray' : (0,7), 'darkgray' : (1,0), 'pink' : (1,1), 'white' : (1,7), } # Add intense/bold colors (names it capitals) for _c in [_n for _n,_v in COLORS.items() if _v[0] == 0]: COLORS[_c.upper()] = (1,COLORS[_c][1]) COMMANDS = { 'reset' : 0, 'bold' : 1, 'dim' : 2, 'bright' : 1, 'dull' : 2, 'bright:' : 1, 'dull:' : 2, 'blink' : 5, 'BLINK' : 6, 'invert' : 7, 'bg:' : -1, # Special 'level' : -2, # Special -- color of current level 'normal' : 22, 'underline' : 4, 'nounderline' : 24, } # Control Sequence Introducer CSI = "\033[" def _color (color, msg): """ Colorizes the given text """ return _proc(MAGIC + color) + msg + _proc(MAGIC + 'reset').lower() def _proc (msg, level_color = "DEBUG"): """ Do some replacements on the text """ msg = msg.split(MAGIC) #print "proc:",msg r = '' i = 0 cmd = False while i < len(msg): m = msg[i] #print i,m i += 1 if cmd: best = None bestlen = 0 for k,v in COMMANDS.iteritems(): if len(k) > bestlen: if m.startswith(k): best = (k,v) bestlen = len(k) special = None if best is not None and best[0].endswith(':'): special = best m = m[bestlen:] best = None bestlen = 0 for k,v in COLORS.iteritems(): if len(k) > bestlen: if m.startswith(k): best = (k,v) bestlen = len(k) if best is not None: #print "COMMAND", best m = m[bestlen:] if type(best[1]) is tuple: # Color brightness,color = best[1] if special is not None: if special[1] == -1: brightness = None color += 10 color += 30 if not _strip_only: r += CSI if brightness is not None: r += str(brightness) + ";" r += str(color) + "m" elif not _strip_only: # Command if best[1] == -2: r += _proc(MAGIC + LEVEL_COLORS.get(level_color, ""), level_color) else: r += CSI + str(best[1]) + "m" cmd = True r += m return r def launch (entire=False): """ If --entire then the whole message is color-coded, otherwise just the log level. Also turns on interpretation of some special sequences in the log format string. For example, try: log --format="%(levelname)s: @@@bold%(message)s@@@normal" log.color """ global enabled if enabled: return from pox.core import core log = core.getLogger() windows_hack = False # Try to work on Windows if sys.platform == "win32": try: from colorama import init windows_hack = True init() except: log.info("You need colorama if you want color logging on Windows") global _strip_only _strip_only = True from pox.core import _default_log_handler as dlf if not dlf: log.warning("Color logging disabled -- no default logger found") return #if not hasattr(dlf, 'formatter'): # log.warning("Color logging disabled -- no formatter found") # return #if not hasattr(dlf.formatter, '_fmt'): # log.warning("Color logging disabled -- formatter unrecognized") # return # Monkeypatch in a new format function... old_format = dlf.format if entire: def new_format (record): msg = _proc(old_format(record), record.levelname) color = LEVEL_COLORS.get(record.levelname) if color is None: return msg return _color(color, msg) else: def new_format (record): color = LEVEL_COLORS.get(record.levelname) oldlevelname = record.levelname if color is not None: record.levelname = _color(color, record.levelname) r = _proc(old_format(record), oldlevelname) record.levelname = oldlevelname return r dlf.format = new_format if windows_hack: if hasattr(dlf, "stream"): if dlf.stream is sys.__stderr__: dlf.stream = sys.stderr enabled = True else: enabled = True
gpl-3.0
deluge-clone/deluge
deluge/ui/console/commands/config.py
6
5738
# # config.py # # Copyright (C) 2008-2009 Ido Abramovich <[email protected]> # Copyright (C) 2009 Andrew Resch <[email protected]> # # Deluge is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free Software # Foundation; either version 3 of the License, or (at your option) # any later version. # # deluge is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with deluge. If not, write to: # The Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor # Boston, MA 02110-1301, USA. # # In addition, as a special exception, the copyright holders give # permission to link the code of portions of this program with the OpenSSL # library. # You must obey the GNU General Public License in all respects for all of # the code used other than OpenSSL. If you modify file(s) with this # exception, you may extend this exception to your version of the file(s), # but you are not obligated to do so. If you do not wish to do so, delete # this exception statement from your version. If you delete this exception # statement from all source files in the program, then also delete it here. # # import re import logging import tokenize import cStringIO from optparse import make_option from twisted.internet import defer from deluge.ui.console.main import BaseCommand import deluge.ui.console.colors as colors from deluge.ui.client import client import deluge.component as component log = logging.getLogger(__name__) def atom(next, token): """taken with slight modifications from http://effbot.org/zone/simple-iterator-parser.htm""" if token[1] == "(": out = [] token = next() while token[1] != ")": out.append(atom(next, token)) token = next() if token[1] == ",": token = next() return tuple(out) elif token[0] is tokenize.NUMBER or token[1] == "-": try: if token[1] == "-": return int(token[-1], 0) else: return int(token[1], 0) except ValueError: try: return float(token[-1]) except ValueError: return str(token[-1]) elif token[1].lower() == 'true': return True elif token[1].lower() == 'false': return False elif token[0] is tokenize.STRING or token[1] == "/": return token[-1].decode("string-escape") raise SyntaxError("malformed expression (%s)" % token[1]) def simple_eval(source): """ evaluates the 'source' string into a combination of primitive python objects taken from http://effbot.org/zone/simple-iterator-parser.htm""" src = cStringIO.StringIO(source).readline src = tokenize.generate_tokens(src) src = (token for token in src if token[0] is not tokenize.NL) res = atom(src.next, src.next()) return res class Command(BaseCommand): """Show and set configuration values""" option_list = BaseCommand.option_list + ( make_option('-s', '--set', action='store', nargs=2, dest='set', help='set value for key'), ) usage = "Usage: config [key1 [key2 ...]]\n"\ " config --set key value" def handle(self, *args, **options): self.console = component.get("ConsoleUI") if options['set']: return self._set_config(*args, **options) else: return self._get_config(*args, **options) def _get_config(self, *args, **options): deferred = defer.Deferred() config = component.get("CoreConfig") keys = config.keys() keys.sort() s = "" for key in keys: if args and key not in args: continue color = "{!white,black,bold!}" value = config[key] if type(value) in colors.type_color: color = colors.type_color[type(value)] # We need to format dicts for printing if isinstance(value, dict): import pprint value = pprint.pformat(value, 2, 80) new_value = [] for line in value.splitlines(): new_value.append("%s%s" % (color, line)) value = "\n".join(new_value) s += " %s: %s%s\n" % (key, color, value) self.console.write(s) return config def _set_config(self, *args, **options): deferred = defer.Deferred() config = component.get("CoreConfig") key = options["set"][0] val = simple_eval(options["set"][1] + " " .join(args)) if key not in config.keys(): self.console.write("{!error!}The key '%s' is invalid!" % key) return if type(config[key]) != type(val): try: val = type(config[key])(val) except: self.config.write("{!error!}Configuration value provided has incorrect type.") return def on_set_config(result): self.console.write("{!success!}Configuration value successfully updated.") deferred.callback(True) self.console.write("Setting %s to %s.." % (key, val)) client.core.set_config({key: val}).addCallback(on_set_config) return deferred def complete(self, text): return [ k for k in component.get("CoreConfig").keys() if k.startswith(text) ]
gpl-3.0
Gamebasis/3DGamebasisServer
GameData/blender-2.71-windows64/2.71/scripts/freestyle/styles/haloing.py
7
2005
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # Filename : haloing.py # Author : Stephane Grabli # Date : 04/08/2005 # Purpose : This style module selects the lines that # are connected (in the image) to a specific # object and trims them in order to produce # a haloing effect around the target shape from freestyle.chainingiterators import ChainSilhouetteIterator from freestyle.predicates import ( AndUP1D, NotUP1D, QuantitativeInvisibilityUP1D, TrueUP1D, pyIsOccludedByUP1D, ) from freestyle.shaders import ( IncreasingColorShader, IncreasingThicknessShader, SamplingShader, TipRemoverShader, pyTVertexRemoverShader, ) from freestyle.types import Id, Operators # id corresponds to the id of the target object # (accessed by SHIFT+click) id = Id(3,0) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyIsOccludedByUP1D(id)) Operators.select(upred) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred)) shaders_list = [ IncreasingThicknessShader(3, 5), IncreasingColorShader(1,0,0, 1,0,1,0,1), SamplingShader(1.0), pyTVertexRemoverShader(), TipRemoverShader(3.0), ] Operators.create(TrueUP1D(), shaders_list)
gpl-3.0
ericshawlinux/bitcoin
test/functional/rpc_blockchain.py
5
12641
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPCs related to blockchainstate. Test the following RPCs: - getblockchaininfo - gettxoutsetinfo - getdifficulty - getbestblockhash - getblockhash - getblockheader - getchaintxstats - getnetworkhashps - verifychain Tests correspond to code in rpc/blockchain.cpp. """ from decimal import Decimal import http.client import subprocess from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_greater_than, assert_greater_than_or_equal, assert_raises, assert_raises_rpc_error, assert_is_hex_string, assert_is_hash_string, ) from test_framework.blocktools import ( create_block, create_coinbase, ) from test_framework.messages import ( msg_block, ) from test_framework.mininode import ( P2PInterface, ) class BlockchainTest(BitcoinTestFramework): def set_test_params(self): self.num_nodes = 1 def run_test(self): self.restart_node(0, extra_args=['-stopatheight=207', '-prune=1']) # Set extra args with pruning after rescan is complete self._test_getblockchaininfo() self._test_getchaintxstats() self._test_gettxoutsetinfo() self._test_getblockheader() self._test_getdifficulty() self._test_getnetworkhashps() self._test_stopatheight() self._test_waitforblockheight() assert self.nodes[0].verifychain(4, 0) def _test_getblockchaininfo(self): self.log.info("Test getblockchaininfo") keys = [ 'bestblockhash', 'bip9_softforks', 'blocks', 'chain', 'chainwork', 'difficulty', 'headers', 'initialblockdownload', 'mediantime', 'pruned', 'size_on_disk', 'softforks', 'verificationprogress', 'warnings', ] res = self.nodes[0].getblockchaininfo() # result should have these additional pruning keys if manual pruning is enabled assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning'] + keys)) # size_on_disk should be > 0 assert_greater_than(res['size_on_disk'], 0) # pruneheight should be greater or equal to 0 assert_greater_than_or_equal(res['pruneheight'], 0) # check other pruning fields given that prune=1 assert res['pruned'] assert not res['automatic_pruning'] self.restart_node(0, ['-stopatheight=207']) res = self.nodes[0].getblockchaininfo() # should have exact keys assert_equal(sorted(res.keys()), keys) self.restart_node(0, ['-stopatheight=207', '-prune=550']) res = self.nodes[0].getblockchaininfo() # result should have these additional pruning keys if prune=550 assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys)) # check related fields assert res['pruned'] assert_equal(res['pruneheight'], 0) assert res['automatic_pruning'] assert_equal(res['prune_target_size'], 576716800) assert_greater_than(res['size_on_disk'], 0) def _test_getchaintxstats(self): self.log.info("Test getchaintxstats") # Test `getchaintxstats` invalid extra parameters assert_raises_rpc_error(-1, 'getchaintxstats', self.nodes[0].getchaintxstats, 0, '', 0) # Test `getchaintxstats` invalid `nblocks` assert_raises_rpc_error(-1, "JSON value is not an integer as expected", self.nodes[0].getchaintxstats, '') assert_raises_rpc_error(-8, "Invalid block count: should be between 0 and the block's height - 1", self.nodes[0].getchaintxstats, -1) assert_raises_rpc_error(-8, "Invalid block count: should be between 0 and the block's height - 1", self.nodes[0].getchaintxstats, self.nodes[0].getblockcount()) # Test `getchaintxstats` invalid `blockhash` assert_raises_rpc_error(-1, "JSON value is not a string as expected", self.nodes[0].getchaintxstats, blockhash=0) assert_raises_rpc_error(-8, "blockhash must be of length 64 (not 1, for '0')", self.nodes[0].getchaintxstats, blockhash='0') assert_raises_rpc_error(-8, "blockhash must be hexadecimal string (not 'ZZZ0000000000000000000000000000000000000000000000000000000000000')", self.nodes[0].getchaintxstats, blockhash='ZZZ0000000000000000000000000000000000000000000000000000000000000') assert_raises_rpc_error(-5, "Block not found", self.nodes[0].getchaintxstats, blockhash='0000000000000000000000000000000000000000000000000000000000000000') blockhash = self.nodes[0].getblockhash(200) self.nodes[0].invalidateblock(blockhash) assert_raises_rpc_error(-8, "Block is not in main chain", self.nodes[0].getchaintxstats, blockhash=blockhash) self.nodes[0].reconsiderblock(blockhash) chaintxstats = self.nodes[0].getchaintxstats(1) # 200 txs plus genesis tx assert_equal(chaintxstats['txcount'], 201) # tx rate should be 1 per 10 minutes, or 1/600 # we have to round because of binary math assert_equal(round(chaintxstats['txrate'] * 600, 10), Decimal(1)) b1_hash = self.nodes[0].getblockhash(1) b1 = self.nodes[0].getblock(b1_hash) b200_hash = self.nodes[0].getblockhash(200) b200 = self.nodes[0].getblock(b200_hash) time_diff = b200['mediantime'] - b1['mediantime'] chaintxstats = self.nodes[0].getchaintxstats() assert_equal(chaintxstats['time'], b200['time']) assert_equal(chaintxstats['txcount'], 201) assert_equal(chaintxstats['window_final_block_hash'], b200_hash) assert_equal(chaintxstats['window_block_count'], 199) assert_equal(chaintxstats['window_tx_count'], 199) assert_equal(chaintxstats['window_interval'], time_diff) assert_equal(round(chaintxstats['txrate'] * time_diff, 10), Decimal(199)) chaintxstats = self.nodes[0].getchaintxstats(blockhash=b1_hash) assert_equal(chaintxstats['time'], b1['time']) assert_equal(chaintxstats['txcount'], 2) assert_equal(chaintxstats['window_final_block_hash'], b1_hash) assert_equal(chaintxstats['window_block_count'], 0) assert('window_tx_count' not in chaintxstats) assert('window_interval' not in chaintxstats) assert('txrate' not in chaintxstats) def _test_gettxoutsetinfo(self): node = self.nodes[0] res = node.gettxoutsetinfo() assert_equal(res['total_amount'], Decimal('8725.00000000')) assert_equal(res['transactions'], 200) assert_equal(res['height'], 200) assert_equal(res['txouts'], 200) assert_equal(res['bogosize'], 15000), assert_equal(res['bestblock'], node.getblockhash(200)) size = res['disk_size'] assert size > 6400 assert size < 64000 assert_equal(len(res['bestblock']), 64) assert_equal(len(res['hash_serialized_2']), 64) self.log.info("Test that gettxoutsetinfo() works for blockchain with just the genesis block") b1hash = node.getblockhash(1) node.invalidateblock(b1hash) res2 = node.gettxoutsetinfo() assert_equal(res2['transactions'], 0) assert_equal(res2['total_amount'], Decimal('0')) assert_equal(res2['height'], 0) assert_equal(res2['txouts'], 0) assert_equal(res2['bogosize'], 0), assert_equal(res2['bestblock'], node.getblockhash(0)) assert_equal(len(res2['hash_serialized_2']), 64) self.log.info("Test that gettxoutsetinfo() returns the same result after invalidate/reconsider block") node.reconsiderblock(b1hash) res3 = node.gettxoutsetinfo() # The field 'disk_size' is non-deterministic and can thus not be # compared between res and res3. Everything else should be the same. del res['disk_size'], res3['disk_size'] assert_equal(res, res3) def _test_getblockheader(self): node = self.nodes[0] assert_raises_rpc_error(-8, "hash must be of length 64 (not 8, for 'nonsense')", node.getblockheader, "nonsense") assert_raises_rpc_error(-8, "hash must be hexadecimal string (not 'ZZZ7bb8b1697ea987f3b223ba7819250cae33efacb068d23dc24859824a77844')", node.getblockheader, "ZZZ7bb8b1697ea987f3b223ba7819250cae33efacb068d23dc24859824a77844") assert_raises_rpc_error(-5, "Block not found", node.getblockheader, "0cf7bb8b1697ea987f3b223ba7819250cae33efacb068d23dc24859824a77844") besthash = node.getbestblockhash() secondbesthash = node.getblockhash(199) header = node.getblockheader(besthash) assert_equal(header['hash'], besthash) assert_equal(header['height'], 200) assert_equal(header['confirmations'], 1) assert_equal(header['previousblockhash'], secondbesthash) assert_is_hex_string(header['chainwork']) assert_equal(header['nTx'], 1) assert_is_hash_string(header['hash']) assert_is_hash_string(header['previousblockhash']) assert_is_hash_string(header['merkleroot']) assert_is_hash_string(header['bits'], length=None) assert isinstance(header['time'], int) assert isinstance(header['mediantime'], int) assert isinstance(header['nonce'], int) assert isinstance(header['version'], int) assert isinstance(int(header['versionHex'], 16), int) assert isinstance(header['difficulty'], Decimal) def _test_getdifficulty(self): difficulty = self.nodes[0].getdifficulty() # 1 hash in 2 should be valid, so difficulty should be 1/2**31 # binary => decimal => binary math is why we do this check assert abs(difficulty * 2**31 - 1) < 0.0001 def _test_getnetworkhashps(self): hashes_per_second = self.nodes[0].getnetworkhashps() # This should be 2 hashes every 10 minutes or 1/300 assert abs(hashes_per_second * 300 - 1) < 0.0001 def _test_stopatheight(self): assert_equal(self.nodes[0].getblockcount(), 200) self.nodes[0].generatetoaddress(6, self.nodes[0].get_deterministic_priv_key().address) assert_equal(self.nodes[0].getblockcount(), 206) self.log.debug('Node should not stop at this height') assert_raises(subprocess.TimeoutExpired, lambda: self.nodes[0].process.wait(timeout=3)) try: self.nodes[0].generatetoaddress(1, self.nodes[0].get_deterministic_priv_key().address) except (ConnectionError, http.client.BadStatusLine): pass # The node already shut down before response self.log.debug('Node should stop at this height...') self.nodes[0].wait_until_stopped() self.start_node(0) assert_equal(self.nodes[0].getblockcount(), 207) def _test_waitforblockheight(self): self.log.info("Test waitforblockheight") node = self.nodes[0] node.add_p2p_connection(P2PInterface()) current_height = node.getblock(node.getbestblockhash())['height'] # Create a fork somewhere below our current height, invalidate the tip # of that fork, and then ensure that waitforblockheight still # works as expected. # # (Previously this was broken based on setting # `rpc/blockchain.cpp:latestblock` incorrectly.) # b20hash = node.getblockhash(20) b20 = node.getblock(b20hash) def solve_and_send_block(prevhash, height, time): b = create_block(prevhash, create_coinbase(height), time) b.solve() node.p2p.send_message(msg_block(b)) node.p2p.sync_with_ping() return b b21f = solve_and_send_block(int(b20hash, 16), 21, b20['time'] + 1) b22f = solve_and_send_block(b21f.sha256, 22, b21f.nTime + 1) node.invalidateblock(b22f.hash) def assert_waitforheight(height, timeout=2): assert_equal( node.waitforblockheight(height, timeout)['height'], current_height) assert_waitforheight(0) assert_waitforheight(current_height - 1) assert_waitforheight(current_height) assert_waitforheight(current_height + 1) if __name__ == '__main__': BlockchainTest().main()
mit
sachinkum/Bal-Aveksha
WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/utils/inspect.py
323
4195
from __future__ import absolute_import import inspect from django.utils import six def getargspec(func): if six.PY2: return inspect.getargspec(func) sig = inspect.signature(func) args = [ p.name for p in sig.parameters.values() if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD ] varargs = [ p.name for p in sig.parameters.values() if p.kind == inspect.Parameter.VAR_POSITIONAL ] varargs = varargs[0] if varargs else None varkw = [ p.name for p in sig.parameters.values() if p.kind == inspect.Parameter.VAR_KEYWORD ] varkw = varkw[0] if varkw else None defaults = [ p.default for p in sig.parameters.values() if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD and p.default is not p.empty ] or None return args, varargs, varkw, defaults def get_func_args(func): if six.PY2: argspec = inspect.getargspec(func) return argspec.args[1:] # ignore 'self' sig = inspect.signature(func) return [ arg_name for arg_name, param in sig.parameters.items() if param.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD ] def get_func_full_args(func): """ Return a list of (argument name, default value) tuples. If the argument does not have a default value, omit it in the tuple. Arguments such as *args and **kwargs are also included. """ if six.PY2: argspec = inspect.getargspec(func) args = argspec.args[1:] # ignore 'self' defaults = argspec.defaults or [] # Split args into two lists depending on whether they have default value no_default = args[:len(args) - len(defaults)] with_default = args[len(args) - len(defaults):] # Join the two lists and combine it with default values args = [(arg,) for arg in no_default] + zip(with_default, defaults) # Add possible *args and **kwargs and prepend them with '*' or '**' varargs = [('*' + argspec.varargs,)] if argspec.varargs else [] kwargs = [('**' + argspec.keywords,)] if argspec.keywords else [] return args + varargs + kwargs sig = inspect.signature(func) args = [] for arg_name, param in sig.parameters.items(): name = arg_name # Ignore 'self' if name == 'self': continue if param.kind == inspect.Parameter.VAR_POSITIONAL: name = '*' + name elif param.kind == inspect.Parameter.VAR_KEYWORD: name = '**' + name if param.default != inspect.Parameter.empty: args.append((name, param.default)) else: args.append((name,)) return args def func_accepts_kwargs(func): if six.PY2: # Not all callables are inspectable with getargspec, so we'll # try a couple different ways but in the end fall back on assuming # it is -- we don't want to prevent registration of valid but weird # callables. try: argspec = inspect.getargspec(func) except TypeError: try: argspec = inspect.getargspec(func.__call__) except (TypeError, AttributeError): argspec = None return not argspec or argspec[2] is not None return any( p for p in inspect.signature(func).parameters.values() if p.kind == p.VAR_KEYWORD ) def func_accepts_var_args(func): """ Return True if function 'func' accepts positional arguments *args. """ if six.PY2: return inspect.getargspec(func)[1] is not None return any( p for p in inspect.signature(func).parameters.values() if p.kind == p.VAR_POSITIONAL ) def func_has_no_args(func): args = inspect.getargspec(func)[0] if six.PY2 else [ p for p in inspect.signature(func).parameters.values() if p.kind == p.POSITIONAL_OR_KEYWORD ] return len(args) == 1 def func_supports_parameter(func, parameter): if six.PY3: return parameter in inspect.signature(func).parameters else: args, varargs, varkw, defaults = inspect.getargspec(func) return parameter in args
gpl-3.0