def main():
    domain_collector = PruneCandidateDomainList()
    domain_collector.start()

    domain_logger = LogCandidateDomains()
    domain_logger.start()

    io = nmsg.io()
    # io.add_input_channel('ch208')
    io.add_input_channel('ch204')
    io.set_filter_msgtype('SIE', 'dnsdedupe')
    io.add_output_callback(process_msg)
    io.loop()
Beispiel #2
0
# 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 nmsg
import sys

count = 0

def cb(msg):
    global count
    count += 1
    if (count % 10000) == 0:
        sys.stderr.write('.')

io = nmsg.io()
input = nmsg.input.open_file(sys.argv[1])
io.add_input(input)
io.add_output_callback(cb)
io.add_output_callback(cb)
io.add_output_callback(cb)
io.loop()

print '\ncount=%s' % count
Beispiel #3
0
def main(ch):
    io = nmsg.io()
    io.add_input_channel(ch)
    io.add_output_callback(print_nmsg)
    io.loop()