Showing posts with label value of zero. Show all posts
Showing posts with label value of zero. Show all posts

Monday, April 21, 2008

What is the Difference Between IPv4 and IPv6? continue...

IPv6 Extension Headers

In general, most protocols have header information followed by a payload that contains the actual data to be transmitted from one point to another. Some protocols include a trailer that usually is use to provide some type of integrity check, such as CRC, to ensure that the frame or datagram has arrived at the destination without corruption.

Still other protocols, and we're talking about IPv6 here, allow for additional headers to follow the ini tial IPv6 header, to describe certain aspects of the datagram. These headers are not required, but one or more can be placed into the datagram. These additional extension headers are placed directly after the IPv6 header, where the payload section is usually located. The payload that follows the lPv6 header, or the extension headers, will be a header for the encapsulated upper-layer protocol being transported by the IPv6 datagram. It is interesting to note that among the following headers, if the hop-by-hop header is used, it must follow the IPv6 header as the first additional header. Other extension headers don't have to be in any particular order, but the RFCs do suggest that certain headers be placed in a certain order.

The field Next Header is used to indicate whether another header follows the current header, after the initial IPv6 header. Yet if the next header is not one that the receiving node recognizes, the node should discard the datagram and send an ICMP message to the source indicating that there was a problem with the packet. In IPv6, the ICMP code for this is 1, which in text format means "unrecognized Next Header Field Header type encountered." This ICMP message is used in many of the IPv6 procedures.

Internet 2010

It is important to note that an IPv6 datagram doesn't have to have any extension headers. They are used only when the feature is implemented in the IPv6 hardware (or software) routing mechanism.

The extension headers that can follow the IPv6 header include these:

The preceding list is described in the recommended order suggested by the RFC. This can change depending on a few circumstances. For example, if the Destination Options header should be read n just by the node specified by the destination address found in the initial IPv6 header, but also by th other destinations listed in the Routing header, then the Destination Options header should be p1 immediately after the Hop-by-Hop header, followed by the Routing header.

The Options Type Field for Hop-by-Hop and Destination Options

If the Destination Options header should be examined only by the final destination node, it should be placed just before the upper-layer header. The Options Type field for Hop-by-Hop and Destination Options is an 8-bit field. However, it should be interpreted by bit values, not by byte values.

The third-highest-ordered bit used is either zero or one. If the bit has a value of zero, the data contained in the option cannot be changed by a node it passes through on the way to its eventual destination. If the bit has a value of one, a node can change data in the extension header.

The Next Header field is used by all options. It simply specifies what the next option (following the current option) will be. These option type numbers are based on those described for IPv4. These numbers were originally defined in RFC 1700, and later RFCs. However, the RFC process was not sufficient to keep up with newer protocols and services that were being developed, so an online database now exists. You can use this database to determine what type of protocol or option the Next Header field indicates.

Other IPv6 Considerations

Although IPv6 contains a field that defines the maximum number of hops (the Hop-to-Hop field), it is not required that all nodes support this function, though they can if desired. Instead, upper-layer protocols (such as TCP) are generally delegated this responsibility.

In addition, upper-level protocols should be aware that the maximum payload space has been reduced if IPv6 headers are to be added to the packet. Again, this is a modification that will require that upper-layer protocols be modified, or that the source use fragmentation to deliver packets to their destination.

The Future of IPv6

IPv4 has been in use for more than 10 years now, and although most of the address-space issues have been resolved, there will come a time when the usefulness and flexibility of IPv6 becomes more and more important. There are many enhancements to IPv6 that might warrant its implementation in your network. If your network hasn't yet adopted IPv6, you can bet that eventually it will.

Wednesday, November 7, 2007

Using a Custom Script Library for Common Tasks

Applies to:

Microsoft Office InfoPath 2003 Service Pack 1

The Office InfoPath 2003 Software Development Kit includes a code library that contains functions that may be useful to you when designing forms. These functions perform tasks that are difficult or impossible to accomplish using the Microsoft Office InfoPath 2003 object model. The functions are used extensively by the sample forms installed with InfoPath.

The name of the Microsoft JScript source file is Common.js. Note that these functions will work only with the default language of JScript and not with Microsoft VBScript or managed code. The Common.js code library file can be found in the :\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office InfoPath 2003 SDK\CodeLibrary folder.

Internet 2010To use the functions, you must copy them into your form's Script.js file. Many of the functions depend on one or more of the other functions included in Common.js. For example, the count function calls the getNodeList function. You must copy both functions into Script.js if you want to use the count function.

The following table describes the functions contained in Common.js.

Function Function Description Parameters
convertXMLNumberToJScript Converts the boundary conditions INF and -INF to values that are compatible with JScript.

Dependencies: parseFloat

value The number to convert.
convertJScriptNumberToXML Converts the boundary conditions Number.NEGATIVE_INFINITY and Number.POSITIVE_INFINITY to XML-compatible values.
value The number to convert.
getNodeValue Returns the value contained in the specified node as a string.

Dependencies: getNode, isInvalidOrEmpty

xpath An XPath expression that represents the XML Document Object Model (DOM) for which the value is to be returned.
defaultValue The default value of the specified node.
getNodeTypedValue Returns the value contained in the specified node. Use this function instead of the getNodeValue function when you want to return the value based on the data type declared in the schema.

Dependencies: getNode, isInvalidOrEmpty, convertXMLNumberToJScript

xpath An XPath expression that represents the XML DOM node for which the value is to be returned.
defaultValue The default value of the specified node.
fNumber A Boolean that specifies whether the value is numeric.
setNodeValue Assigns a value to the specified node.

Dependencies: getNode

xpath An XPath expression that represents the XML DOM node for which the value is to be assigned.
value The value to assign to the specified node.

Note If a value of zero (0) is passed to this argument, the value will not be assigned to the node.

setNodeTypedValue Assigns a value to the specified XML DOM node. Use this function instead of the setNodeValue function when assigning a floating point or decimal value.

Dependencies: getNode, convertJScriptNumberToXML

xpath An XPath expression that represents the XML DOM node for which the value is to be assigned.
value The value to assign to the specified node.

Note If a value of zero (0) is passed to this argument, the value will not be assigned to the node.

setNil Removes the value of the specified node and sets its xsi:nil attribute to "True".

Dependencies: getNode

xpath An XPath expression that represents the XML DOM node for which the value is to be removed.
setRoundedValue Rounds a number to three decimal places and assigns it to the specified node.

Dependencies: getNode, roundFloat, setNodeTypedValue

xpath An XPath expression that represents the XML DOM node for which the number is to be assigned.
value The number to round.
roundFloat Returns a number rounded to a specified number of decimal places.
value The number to round.
decimalPlaces Number indicating how many places to the right of the decimal are included in the rounding.
normalizeSource Ensures that the correct context of a node is returned by ignoring text nodes. Returns a node of type NODE_ELEMENT or NODE_ATTRIBUTE.
oEvent A reference to the DataDOMEvent object.
normalizeParent Ensures that the correct context of a parent node is returned by ignoring text nodes. Returns a node of type NODE_ELEMENT or NODE_ATTRIBUTE.
oEvent A reference to the DataDOMEvent object.
initializeNodeValue Assigns a value to the specified node only if the node is empty.

Dependencies: getNode, setNodeValue

xpath An XPath expression that represents the XML DOM node for which the value is to be assigned.
strValue The value to assign to the specified node.
count Returns the number of times that the specified node appears in the form.

Dependencies: getNodeList

xpath An XPath expression that represents the XML DOM node for which to count the occurrences.
sum Returns the sum of the nodes that match the specified XPath expression. You can use this function to create running totals.

Dependencies: applyAction

xpath An XPath expression that represents the XML DOM nodes to sum.
sort Sorts the specified nodes in the form.

Dependencies: getNode, count

xpathParent An XPath expression that represents the parent XML DOM node of the nodes to sort.
xpathChildren An XPath expression that represents the XML DOM nodes to sort.
fnCompare The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII-character order.

The following functions are not designed to be called directly; they support the functions listed in the table above.

  • applyAction
  • getNode
  • getNodeList
  • isInvalidOrEmpty

Internet Blogosphere