Lines Matching +full:ascii +full:. +full:d

5 # This is an example that shows how to send ASCII formatted control
6 # messages to a node using ngctl(8).
8 # What we will do here create a divert(4) tap. This simply dumps
9 # out all packets diverted by some ipfw(8) divert rule to the console.
41 # anything. The ``inet/raw/divert'' is the hook name on the ksocket
42 # node, which tells it what kind of socket to create.
44 # Lets give our ksocket node a global name. How about ``fred'':
48 # Note that we used ngctl's ``name'' command to do this. However,
54 # Here we are using the ASCII <-> binary control message conversion
55 # routines. ngctl does this for us automatically when we use the
56 # ``msg'' command.
59 # supplied by the system. We do this by sending the ksocket node a
60 # ``bind'' control message. Again, ngctl does the conversion of the
61 # control message from ASCII to binary behind the scenes.
63 + msg fred: bind inet/192.168.1.1
66 # special support for the PF_LOCAL and PF_INET protocol families.
68 # ``bind'' command as ``inet/192.168.1.1'' (since we didn't specify
69 # a port number, it's assumed to be zero). We could have also
76 # new ones is added.
80 # types when parsing. Now since we didn't ask for a specific port
84 Rec'd response "getname" (5) from "fred:":
85 Args: inet/192.168.1.1:1029
87 # As soon as we sent the message, we got back a response. Here
91 # as ``fred:''. The message arguments field is then displayed to
92 # us in its ASCII form. In this case, what we get back is a struct
93 # sockaddr, and there we see that our port number is 1029.
96 # want to see. How about anything from 192.168.1.129.
100 $ ipfw add 100 divert 1029 ip from 192.168.1.129 to any
101 00100 divert 1029 ip from 192.168.1.129 to any
107 Rec'd data packet on hook "foo":
108 0000: 45 00 00 3c 57 00 00 00 20 01 bf ee c0 a8 01 81 E..<W... .......
109 0010: c0 a8 01 01 08 00 49 5c 03 00 01 00 61 62 63 64 ......I\....abcd
110 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
113 Rec'd data packet on hook "foo":
114 0000: 45 00 00 3c 58 00 00 00 20 01 be ee c0 a8 01 81 E..<X... .......
115 0010: c0 a8 01 01 08 00 48 5c 03 00 02 00 61 62 63 64 ......H\....abcd
116 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
119 Rec'd data packet on hook "foo":
120 0000: 45 00 00 3c 59 00 00 00 20 01 bd ee c0 a8 01 81 E..<Y... .......
121 0010: c0 a8 01 01 08 00 47 5c 03 00 03 00 61 62 63 64 ......G\....abcd
122 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
127 # hook of ngctl's socket node. Since the packets are getting diverted,
128 # the 192.168.1.129 machine doesn't see any response from us.
133 + msg bar connect inet/192.168.1.33:13
136 Rec'd data packet on hook "foo":
137 0000: 4d 6f 6e 20 4e 6f 76 20 32 39 20 31 37 3a 34 38 Mon Nov 29 17:48
138 0010: 3a 33 37 20 31 39 39 39 0d 0a :37 1999..
144 + msg bar bind local/"/tmp/bar.socket"
147 # Here's an example of a more complicated ASCII control message argument.
148 # If you look in /sys/netgraph/ng_message.h, you will see that a node
165 # this structure in ASCII form (lines wrapped for readability):
167 + msg bar bind local/"/tmp/bar.socket"
169 Rec'd response "listhooks" (7) from "bar":